1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

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 Serious Server 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 Serious Server 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 >/dev/null || reboot
    chmod 755 /tmp/keepalive
    cru a keepalive "*/8 * * * * /tmp/keepalive >/dev/null 2>&1"
  3. mmosoll

    mmosoll Serious Server Member

Share This Page