Marathoni83
Newbie
Hallo zusammen,
ich bin gerade dabei ein Script zu entwickeln, welches eine Verbindung zu einem entfernten Netzwerk überprüfen soll.
Das Script ist wie folgt aufgebaut:
ping -c 60 192.168.121.3 > pingout
sleep 70
????if????
mail -s Verbindung prüfen mustermann@mustermann.de
Der Inhalt der Datei Pingout sind wie folgt aus:
64 bytes from 192.168.121.3: icmp_seq=1 ttl=252 time=352 ms
64 bytes from 192.168.121.3: icmp_seq=2 ttl=252 time=82.4 ms
64 bytes from 192.168.121.3: icmp_seq=3 ttl=252 time=150 ms
64 bytes from 192.168.121.3: icmp_seq=4 ttl=252 time=113 ms
64 bytes from 192.168.121.3: icmp_seq=5 ttl=252 time=62.8 ms
64 bytes from 192.168.121.3: icmp_seq=6 ttl=252 time=23.6 ms
64 bytes from 192.168.121.3: icmp_seq=7 ttl=252 time=19.8 ms
64 bytes from 192.168.121.3: icmp_seq=8 ttl=252 time=20.0 ms
64 bytes from 192.168.121.3: icmp_seq=9 ttl=252 time=21.0 ms
64 bytes from 192.168.121.3: icmp_seq=10 ttl=252 time=19.9 ms
64 bytes from 192.168.121.3: icmp_seq=11 ttl=252 time=166 ms
64 bytes from 192.168.121.3: icmp_seq=12 ttl=252 time=408 ms
64 bytes from 192.168.121.3: icmp_seq=13 ttl=252 time=450 ms
64 bytes from 192.168.121.3: icmp_seq=14 ttl=252 time=454 ms
64 bytes from 192.168.121.3: icmp_seq=15 ttl=252 time=466 ms
--- 192.168.121.3 ping statistics ---
15 packets transmitted, 15 received, 0% packet loss, time 14018ms
rtt min/avg/max/mdev = 19.860/187.523/466.997/176.463 ms
Und hier fängt mein Problem an. Die Mail soll nur versendet werden,
wenn die einzelnen Zeilen daraufhin überprüft wurden, ob ein Ping länger als
100 ms dauert. Tritt z.B. der Fall auf, dass in 20 Zeilen der Wert über 100 ms liegt,
soll eine Mail gesendet werden.
Gruß
Marathoni83
ich bin gerade dabei ein Script zu entwickeln, welches eine Verbindung zu einem entfernten Netzwerk überprüfen soll.
Das Script ist wie folgt aufgebaut:
ping -c 60 192.168.121.3 > pingout
sleep 70
????if????
mail -s Verbindung prüfen mustermann@mustermann.de
Der Inhalt der Datei Pingout sind wie folgt aus:
64 bytes from 192.168.121.3: icmp_seq=1 ttl=252 time=352 ms
64 bytes from 192.168.121.3: icmp_seq=2 ttl=252 time=82.4 ms
64 bytes from 192.168.121.3: icmp_seq=3 ttl=252 time=150 ms
64 bytes from 192.168.121.3: icmp_seq=4 ttl=252 time=113 ms
64 bytes from 192.168.121.3: icmp_seq=5 ttl=252 time=62.8 ms
64 bytes from 192.168.121.3: icmp_seq=6 ttl=252 time=23.6 ms
64 bytes from 192.168.121.3: icmp_seq=7 ttl=252 time=19.8 ms
64 bytes from 192.168.121.3: icmp_seq=8 ttl=252 time=20.0 ms
64 bytes from 192.168.121.3: icmp_seq=9 ttl=252 time=21.0 ms
64 bytes from 192.168.121.3: icmp_seq=10 ttl=252 time=19.9 ms
64 bytes from 192.168.121.3: icmp_seq=11 ttl=252 time=166 ms
64 bytes from 192.168.121.3: icmp_seq=12 ttl=252 time=408 ms
64 bytes from 192.168.121.3: icmp_seq=13 ttl=252 time=450 ms
64 bytes from 192.168.121.3: icmp_seq=14 ttl=252 time=454 ms
64 bytes from 192.168.121.3: icmp_seq=15 ttl=252 time=466 ms
--- 192.168.121.3 ping statistics ---
15 packets transmitted, 15 received, 0% packet loss, time 14018ms
rtt min/avg/max/mdev = 19.860/187.523/466.997/176.463 ms
Und hier fängt mein Problem an. Die Mail soll nur versendet werden,
wenn die einzelnen Zeilen daraufhin überprüft wurden, ob ein Ping länger als
100 ms dauert. Tritt z.B. der Fall auf, dass in 20 Zeilen der Wert über 100 ms liegt,
soll eine Mail gesendet werden.
Gruß
Marathoni83