Script to run a ping test once every hour and report when problem?

Discussion in 'Tomato Firmware' started by fefrie, Jun 22, 2014.

  1. fefrie

    fefrie Networkin' Nut Member

    I was having service issues with my ISP with 32% lost packets and high ping times (+300ms)

    I was tearing my hair out thinking that it was my laptop or even my router.

    I was using Tomatos Ping test under the tools section, and I thought that it would be great if there was some sort of script that would execute a ping test every X minutes and send an email or log it if there were more than X% lost packets, or if the average/max ping time went over Xms.

    Is there any way to do that?
     
  2. mmosoll

    mmosoll Networkin' Nut Member

    I don't send email, only reboot if ping fail and check all 8 minutes. maybe it can help you.

    Admin/Scripts/Init (with your IP):

    sleep 5
    cat <<END > /tmp/keepalive
    ping -c5 192.168.1.5 >/dev/null || reboot
    END
    chmod 755 /tmp/keepalive
    cru a keepalive "*/8 * * * * /tmp/keepalive >/dev/null 2>&1"
     
  3. mmosoll

    mmosoll Networkin' Nut Member

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice