Ad Widget

Collapse

Packet loss monitoring

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • fableman
    Member
    • Oct 2007
    • 78

    #16
    1. create a file named "packetloss" at this location "/etc/zabbix/externalscripts/"

    /etc/zabbix/externalscripts/packetloss

    2. cut out and paste this in "packetloss" file

    #!/bin/sh
    if [ -z $1 ]
    then
    echo "missing ip / hostname address"
    echo " example ./packetloss 192.168.201.1 10000"
    echo "10000 = 10000 bytes to ping with. the more you use the harder the netrwork will have to deliver it and you start see packetloss. ping with normal ping size is kinda pointless, on LAN networks I recomend to use 10000 - 20000 and on internet around 3000"
    echo "Remember some firewalls might block pings over 100"
    echo "/ Fableman"
    fi
    if [ -z $2 ]
    then
    echo "missing ping size"
    echo " example ./packetloss 192.168.201.1 10000"
    echo "10000 = 10000 bytes to ping with. the more you use the harder the netrwork will have to deliver
    it and you start see packetloss. ping with normal ping size is kinda pointless, on LAN networks I recomend to use 10000 - 20000 and on internet around 3000"
    echo "Remember some firewalls might block pings over 100"
    echo "/ Fableman"
    exit
    fi
    tal=`ping -q -i0.30 -n -s $2 -c5 $1 | grep "packet loss" | cut -d " " -f6 | cut -d "%" -f1`
    if [ -z $tal ]
    then
    echo 100
    else
    echo $tal
    fi


    3. Now we make file runnable Type: chmod u+x etc/zabbix/externalscripts/packetloss


    4. in zabbix verify the host you want to monitor the packetloss on have a valid IP or hoste name and the correct "Connect to" selected.

    Then under Item you create a new Item for that host

    Type: External Check
    Key: packetloss[10000]

    SAVE

    5. now check monitoring /lastest data for that host and you should start see packetloss numbers

    Done.


    the numer 10000 you added is Ping size.
    its very hard to spot packetloss when only sending a few byte as a normal ping dose.
    Soo I added ping size and I sening the pings much faster speed aswell.

    Try increase the size until you see packetloss then you know you pushing your equipment limits


    Good luck..

    (I hope I dident miss any.)

    Comment

    • oneye
      Junior Member
      • May 2008
      • 27

      #17
      Thank you fableman! You really helped me out.
      Problem solved!

      Thanks again!

      Best regards

      Comment

      • fableman
        Member
        • Oct 2007
        • 78

        #18
        Originally posted by oneye
        Thank you fableman! You really helped me out.
        Problem solved!

        Thanks again!

        Best regards
        your welcome.. Open source for the win! :

        Comment

        • ths
          Junior Member
          • Mar 2011
          • 1

          #19
          Does not work for the following case: (ping errors)
          ping -q -i0.30 -n -s 50 -c5 192.168.0.7 2> /dev/null | grep "packet loss" | cut -d " " -f6 | cut -d "%" -f1

          Return
          +3

          I'd like to get the value 100

          "

          5 packets transmitted, 0 received, +3 errors, 100% packet loss, time 1210ms
          , pipe 3
          "

          Comment

          Working...