Ad Widget

Collapse

Fableman, your ping script

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • barronj
    Junior Member
    • Feb 2008
    • 17

    #1

    Fableman, your ping script

    I actually sent a PM to you last week, but they are easy to miss on this board, and I thought that maybe others might have similar questions, so I'm posting here.

    It seems to work well. The results are different than what I was getting with icmppingsec, which is of course expected.

    However, it seems to leave gaps with NO data sometimes. icmppingsec would populate a zero, which I wasn't sure I was happy with, since I wasn't sure if it counted those values for averaging. (I have a trigger that fires if it's >300ms average over 15 minutes.)

    However, I'm not sure whether to think that these gaps when using the script represent periods of time where no response was received, or some other problem. What would you expect to be true?

    Also, as I'm somewhat of a novice with Linux, I went to look up the Linux ping switches to see if there were any options that might favorably alter this behavior. Far be it from me to criticize (since the pings do seem to work), but it LOOKS to me like -i is to specify the interface, and -I is to specify the interval.

    Is it just undocumented that you can put the interval in before the address, after the -i switch?

    Thanks, and I'm really just curious, not trying to second guess your scripting.
  • barronj
    Junior Member
    • Feb 2008
    • 17

    #2
    I suppose I should reference the original thread and the script in question.

    This is fabelman's script:
    Code:
    #!/bin/sh
    tal=`ping -c5 -i0.25 $1 | tail -n 1 | awk '{print $4}'| cut -d/ -f2`
    if [ -z $tal ]
    then
    echo 0
    else
    echo $tal
    fi
    It originates from this thread: http://www.zabbix.com/forum/showthre...0452#post30452

    Comment

    • barronj
      Junior Member
      • Feb 2008
      • 17

      #3
      Any thoughts on this from anyone?

      It's not a burning issue, but I want to be sure that I'm getting what I think I'm getting from my triggers. Ultimately that comes down to how Zabbix does the averaging I suppose, but I'd also like to know that missing data using the means the packet was lost, or whether it means that the response was > some threshold.

      Thanks!

      Comment

      Working...