<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="de-CH">
	<id>https://wiki.primat.ch/index.php?action=history&amp;feed=atom&amp;title=Reachability_Test</id>
	<title>Reachability Test - Versionsgeschichte</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.primat.ch/index.php?action=history&amp;feed=atom&amp;title=Reachability_Test"/>
	<link rel="alternate" type="text/html" href="https://wiki.primat.ch/index.php?title=Reachability_Test&amp;action=history"/>
	<updated>2026-05-19T09:28:15Z</updated>
	<subtitle>Versionsgeschichte dieser Seite in Primatenwiki</subtitle>
	<generator>MediaWiki 1.43.0</generator>
	<entry>
		<id>https://wiki.primat.ch/index.php?title=Reachability_Test&amp;diff=51&amp;oldid=prev</id>
		<title>Rbritt: Die Seite wurde neu angelegt: «Testscripte um zu testen, ob ein Server noch nach Aussen sieht oder nicht.  Diese Scripte erfordern screen:  # apt-get install screen    = Init Script = Folgendes Skript nach /etc/init.d/ kopieren und ausführbar machen. /etc/init.d/reachabilitytest:  #! /bin/sh    ### BEGIN INIT INFO  # Provides:          reachability test  # Required-Start:    $network  # Required-Stop:       # Default-Start:     2 3 4 5  # Default-Stop:      0 1 6  # Short-Description: p…»</title>
		<link rel="alternate" type="text/html" href="https://wiki.primat.ch/index.php?title=Reachability_Test&amp;diff=51&amp;oldid=prev"/>
		<updated>2025-01-08T18:09:41Z</updated>

		<summary type="html">&lt;p&gt;Die Seite wurde neu angelegt: «Testscripte um zu testen, ob ein Server noch nach Aussen sieht oder nicht.  Diese Scripte erfordern screen:  # apt-get install screen    = Init Script = Folgendes Skript nach /etc/init.d/ kopieren und ausführbar machen. /etc/init.d/reachabilitytest:  #! /bin/sh    ### BEGIN INIT INFO  # Provides:          reachability test  # Required-Start:    $network  # Required-Stop:       # Default-Start:     2 3 4 5  # Default-Stop:      0 1 6  # Short-Description: p…»&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Neue Seite&lt;/b&gt;&lt;/p&gt;&lt;div&gt;Testscripte um zu testen, ob ein Server noch nach Aussen sieht oder nicht.&lt;br /&gt;
&lt;br /&gt;
Diese Scripte erfordern screen:&lt;br /&gt;
 # apt-get install screen&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Init Script =&lt;br /&gt;
Folgendes Skript nach /etc/init.d/ kopieren und ausführbar machen.&lt;br /&gt;
/etc/init.d/reachabilitytest:&lt;br /&gt;
 #! /bin/sh&lt;br /&gt;
 &lt;br /&gt;
 ### BEGIN INIT INFO&lt;br /&gt;
 # Provides:          reachability test&lt;br /&gt;
 # Required-Start:    $network&lt;br /&gt;
 # Required-Stop:     &lt;br /&gt;
 # Default-Start:     2 3 4 5&lt;br /&gt;
 # Default-Stop:      0 1 6&lt;br /&gt;
 # Short-Description: pings switch.ch(130.59.138.57) and metas.ch(162.23.8.239) to test the reachability&lt;br /&gt;
 # Description:       more foo for your bars&lt;br /&gt;
 ### END INIT INFO&lt;br /&gt;
 &lt;br /&gt;
 # Carry out specific functions when asked to by the system&lt;br /&gt;
 case &amp;quot;$1&amp;quot; in&lt;br /&gt;
   start)&lt;br /&gt;
     echo &amp;quot;Starting reachability test&amp;quot; &lt;br /&gt;
 &lt;br /&gt;
     screen -dm -S reachabilityswitch /etc/reachabilityscript_switch.sh&lt;br /&gt;
     screen -dm -S reachabilitymetas /etc/reachabilityscript_metas.sh &lt;br /&gt;
 &lt;br /&gt;
     ;;&lt;br /&gt;
   stop)&lt;br /&gt;
     echo &amp;quot;Stopping reachability test&amp;quot; &lt;br /&gt;
 &lt;br /&gt;
     screen -X -S reachabilityswitch quit&lt;br /&gt;
     screen -X -S reachabilitymetas quit&lt;br /&gt;
     ;;&lt;br /&gt;
   *)&lt;br /&gt;
     echo &amp;quot;Usage: /etc/init.d/reachabilitytest {start|stop}&amp;quot;&lt;br /&gt;
     exit 1&lt;br /&gt;
     ;;&lt;br /&gt;
 esac&lt;br /&gt;
 &lt;br /&gt;
 exit 0&lt;br /&gt;
&lt;br /&gt;
= Startscripts =&lt;br /&gt;
Diese beiden Skripte in /etc erstellen und ausführbar machen.&lt;br /&gt;
&lt;br /&gt;
/etc/reachabilityscript_switch.sh:&lt;br /&gt;
 #!/bin/bash&lt;br /&gt;
 &lt;br /&gt;
 host=130.59.138.57&lt;br /&gt;
 &lt;br /&gt;
 while :; do&lt;br /&gt;
     result=`ping -W 20 -c 1 $host | grep &amp;#039;bytes from &amp;#039;`&lt;br /&gt;
     if [ $? -gt 0 ]; then&lt;br /&gt;
         echo -e &amp;quot;`date +&amp;#039;%Y/%m/%d %H:%M:%S&amp;#039;` - host $host is down&amp;quot; &amp;gt;&amp;gt; /var/log/reachability/reachability_switch.txt&lt;br /&gt;
     else&lt;br /&gt;
         echo -e &amp;quot;`date +&amp;#039;%Y/%m/%d %H:%M:%S&amp;#039;` - host $host is ok -`echo $result | cut -d &amp;#039;:&amp;#039; -f 2`&amp;quot; &amp;gt;&amp;gt; /var/log/reachability/reachability_switch.txt&lt;br /&gt;
         sleep 20 # avoid ping rain&lt;br /&gt;
     fi&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
/etc/reachabilityscript_metas.sh:&lt;br /&gt;
 #!/bin/bash&lt;br /&gt;
 &lt;br /&gt;
 host=162.23.8.239&lt;br /&gt;
 &lt;br /&gt;
 while :; do&lt;br /&gt;
     result=`ping -W 20 -c 1 $host | grep &amp;#039;bytes from &amp;#039;`&lt;br /&gt;
     if [ $? -gt 0 ]; then&lt;br /&gt;
         echo -e &amp;quot;`date +&amp;#039;%Y/%m/%d %H:%M:%S&amp;#039;` - host $host is down&amp;quot; &amp;gt;&amp;gt; /var/log/reachability/reachability_switch.txt&lt;br /&gt;
     else&lt;br /&gt;
         echo -e &amp;quot;`date +&amp;#039;%Y/%m/%d %H:%M:%S&amp;#039;` - host $host is ok -`echo $result | cut -d &amp;#039;:&amp;#039; -f 2`&amp;quot; &amp;gt;&amp;gt; /var/log/reachability/reachability_switch.txt&lt;br /&gt;
         sleep 20 # avoid ping rain&lt;br /&gt;
     fi&lt;br /&gt;
 done&lt;/div&gt;</summary>
		<author><name>Rbritt</name></author>
	</entry>
</feed>