Ad Widget

Collapse

ping

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • krusty
    Senior Member
    • Oct 2005
    • 222

    #1

    ping

    Hi im looking to a trigger that shows the average. I the average is higher then 120 ms i want to send an email.

    I use the following trigger but it dosen´t work. Have anyone idea?
    Code:
    {HOST:icmpping.avg(0)}>120
    icmpping is just a simple check
  • Nate Bell
    Senior Member
    • Feb 2005
    • 141

    #2
    icmpping just returns a binary value, either 0 (no ping) or 1 (ping), so the average of icmpping is going to be at most 1. I use a bash script to ping a site/host three times, and return the average time. Here's the script I use:
    Code:
    #!/bin/bash
    #pingtime.sh
    ping -c3 -W10 $1 &> /tmp/pingtime.dmp
    grep avg /tmp/pingtime.dmp | cut -d"/" -f5
    Now create a UserParameter:
    Code:
    UserParameter=pingtime[*],/[i]locationofzabbixscripts[/i]/pingtime.sh
    You can now create an item in Zabbix like so:
    Code:
    pingtime[google.com]
    and this item will return the average time it took to ping google.com 3 times.

    That's my method at least. Hope you find some use in it.

    Nate

    Comment

    • krusty
      Senior Member
      • Oct 2005
      • 222

      #3
      Nice work

      Thanks for posting. I will check this in the evening. I give you report about it.

      Greez

      Comment

      • krusty
        Senior Member
        • Oct 2005
        • 222

        #4
        Hi,

        I got the following error in zabbix_server.log:

        031256:20051130:085700 Simple check [check_service[pingtime[192.168.0.4],192.168.0.5]] is not supported
        031256:20051130:085700 Parameter [pingtime[192.168.0.4]] is not supported by agent on host [testhost1]

        I installed a new simple check with key "pingtime[192.168.0.4]". What´s my mistake?

        Krusty

        Comment

        • James Wells
          Senior Member
          • Jun 2005
          • 664

          #5
          Greetings,
          Originally posted by krusty
          Hi im looking to a trigger that shows the average. I the average is higher then 120 ms i want to send an email.
          Create a simple check of item icmppingsec, then create a trigger based on this. The trigger, based on your previous exmple would be something like;
          Code:
          {HOST:icmppingsec.avg(30)}>0.12
          This will trigger if the ping time between the Zabbix server and HOST, averages higher than 120ms over a period of 30 seconds.

          A word of warning though. 120ms is not a lot of variance when it comes to network latency. Expect this trigger to activate often, unless you are running a gigabit network.
          Unofficial Zabbix Developer

          Comment

          • krusty
            Senior Member
            • Oct 2005
            • 222

            #6
            Thanks for your discription but i located a problem.

            When I show graph of the trigger there is only 0.00. Can i check the value manually in zabbix?

            Comment

            • krusty
              Senior Member
              • Oct 2005
              • 222

              #7
              I found my mistake. I check one host in my own LAN an the ping is only 3ms
              If i check the values of the last hour i get values of 0.0024 and so on.
              Sorry for my stupid post.

              Comment

              • sauron
                Senior Member
                • Jan 2005
                • 215

                #8
                KISS:

                icmppingsec Return ICMP ping response time Number of seconds Example: 0.02
                http://www.zabbix.com/manual/v1.1/config_items.php

                Comment

                • krusty
                  Senior Member
                  • Oct 2005
                  • 222

                  #9
                  @sauron

                  you are so right. After i have fix the problem i watch the manual and i found the discription.

                  nobody is perfect.

                  Comment

                  • Nate Bell
                    Senior Member
                    • Feb 2005
                    • 141

                    #10
                    Apparenly, I like doing things the hard way.

                    Nate

                    Comment

                    Working...