Столкнулся с зависаниями ping когда поставил мониторинг соединения провайдера. Когда связь есть скрипт:
Code:
while true; do
if ping -c 1 $host1 > /dev/null 2>&1 || ping -c 1 $host2 > /dev/null 2>&1 ; then
let live_c+=1
[ $live_c -ge $flip_trsh ] && dead_c=0
else
let dead_c+=1
live_c=0
fi
if [ ! -f $online_flag ] && [ $live_c -ge $live_trsh ]; then
touch $online_flag
$LOG "### $1 is ALIVE! ### count: $live_c ###"
fi
if [ -f $online_flag ] && [ $dead_c -ge $dead_trsh ]; then
rm $online_flag
$LOG "### $1 is DEAD! ### count: $dead_c ###"
kill -1 pppd
fi
sleep 30
done
работает нормально. Недавно упало PPPoE и скрипт вис на пингах. Убиванием пинг процессов удалось дать ему досчитать до диагностики "ppp0 is DEAD".
Стал проверять работу ping.
Запускаю каждые 5 минут скрипт:
Code:
#!/bin/sh
ping -c 3 192.168.1.2 > /dev/null 2>&1
На пингуемом компе вижу только один запрос и ответ:
Code:
14:50:08.196001 IP ASUSRouter > KABINET: icmp 84: echo request seq 0 (DF)
14:50:08.196053 IP KABINET > ASUSRouter: icmp 84: echo reply seq 0 (DF)
14:55:08.374252 IP ASUSRouter > KABINET: icmp 84: echo request seq 0 (DF)
14:55:08.374304 IP KABINET > ASUSRouter: icmp 84: echo reply seq 0 (DF)
15:00:08.692029 IP ASUSRouter > KABINET: icmp 84: echo request seq 0 (DF)
15:00:08.692076 IP KABINET > ASUSRouter: icmp 84: echo reply seq 0 (DF)
А в роутере висят незавершившиеся пинги:
Code:
29663 root 320 S /opt/sbin/cron
29664 root 468 S /bin/sh -c run-parts /opt/etc/cron.5mins
29665 root 504 S /bin/sh /opt/bin/run-parts /opt/etc/cron.5mins
29668 root 500 S /bin/sh /opt/bin/run-parts /opt/etc/cron.5mins
29669 root 400 S ping -c 3 192.168.1.2
29730 root 320 S /opt/sbin/cron
29731 root 468 S /bin/sh -c run-parts /opt/etc/cron.5mins
29732 root 504 S /bin/sh /opt/bin/run-parts /opt/etc/cron.5mins
29735 root 500 S /bin/sh /opt/bin/run-parts /opt/etc/cron.5mins
29736 root 400 S ping -c 3 192.168.1.2
29798 root 320 S /opt/sbin/cron
29800 root 468 S /bin/sh -c run-parts /opt/etc/cron.5mins
29801 root 504 S /bin/sh /opt/bin/run-parts /opt/etc/cron.5mins
29805 root 516 S /bin/sh /opt/bin/run-parts /opt/etc/cron.5mins
29806 root 400 S ping -c 3 192.168.1.2
Ping из BusyBox v1.1.3 (2006.06.29-17:07+0000) прошивка 1.9.2.7-7f-pre7.
Пинг запущеный из ssh прекрасно работает:
Code:
[root@ASUSRouter root]$ ping -c 3 192.168.1.2
PING 192.168.1.2 (192.168.1.2): 56 data bytes
84 bytes from 192.168.1.2: icmp_seq=0 ttl=128 time=0.6 ms
84 bytes from 192.168.1.2: icmp_seq=1 ttl=128 time=0.6 ms
84 bytes from 192.168.1.2: icmp_seq=2 ttl=128 time=0.6 ms
--- 192.168.1.2 ping statistics ---
3 packets transmitted, 3 packets received, 0% packet loss
round-trip min/avg/max = 0.6/0.6/0.6 ms
Подскажите может что-то я не так делаю или это ошибка?