Ad Widget

Collapse

icmppingsec doesn't work

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ufocek
    Senior Member
    • Aug 2006
    • 161

    #1

    icmppingsec doesn't work

    I have problem with icmppingsec because on two servers it works and on the other servers it don't work.

    My configuration item on the server A (work):
    Code:
    Type: simple check
    Key: icmppingsec[10.0.10.10,5,300,128,100,avg]
    Type of information: float
    Units: ms
    Use custom multiplier: 1000
    Update intervals: 30
    Code:
    rpm -qa |grep fping
    fping-2.2b1-1
    
    ls -lh /usr/sbin/fping 
    -rws--s--- 1 root zabbix 20K Feb  2  2001 /usr/sbin/fping
    Code:
    fping 10.0.10.10 -c5 -p300 -b128 -t100
    10.0.10.10 : [0], 156 bytes, 0.74 ms (0.74 avg, 0% loss)
    10.0.10.10 : [1], 156 bytes, 0.51 ms (0.62 avg, 0% loss)
    10.0.10.10 : [2], 156 bytes, 0.59 ms (0.61 avg, 0% loss)
    10.0.10.10 : [3], 156 bytes, 0.54 ms (0.59 avg, 0% loss)
    10.0.10.10 : [4], 156 bytes, 0.57 ms (0.59 avg, 0% loss)
    10.0.10.10 : xmt/rcv/%loss = 5/5/0%, min/avg/max = 0.51/0.59/0.7
    zabbix server and agent 1.8.4 / Redhat 5.6

    The same configuration I put to another server, and doesn't work

    My configuration item on the server B (work):
    Code:
    Type: simple check
    Key: icmppingsec[10.7.224.100,5,300,128,100,avg]
    Type of information: float
    Units: ms
    Use custom multiplier: 1000
    Update intervals: 30
    Code:
    rpm -qa |grep fping
    fping-2.2b1-1
    ls -lh /usr/sbin/fping 
    -rws--s--- 1 root zabbix 20K Feb  2  2001 /usr/sbin/fping
    Code:
    fping 10.7.224.100 -c5 -p300 -b128 -t100
    10.7.224.100 : [0], 156 bytes, 0.62 ms (0.62 avg, 0% loss)
    10.7.224.100 : [1], 156 bytes, 0.52 ms (0.57 avg, 0% loss)
    10.7.224.100 : [2], 156 bytes, 0.45 ms (0.53 avg, 0% loss)
    10.7.224.100 : [3], 156 bytes, 0.31 ms (0.47 avg, 0% loss)
    10.7.224.100 : [4], 156 bytes, 0.32 ms (0.44 avg, 0% loss)
    10.7.224.100 : xmt/rcv/%loss = 5/5/0%, min/avg/max = 0.31/0.44/0.62
    Ping is ok, but zabbix all the time show me a 0ms on the graph

    Solved: icmpping is running from zabbix server. I would check ping between two different servers where I have zabbix_agent
    Last edited by ufocek; 07-04-2011, 12:30.
  • ufocek
    Senior Member
    • Aug 2006
    • 161

    #2
    Script for zabbix_agentd, using with UserParameter

    Code:
    #!/usr/bin/perl
    
    # take care for tcp:hostname or TCP:ip@
    $host = $ARGV[0];
    $host =~ s/tcp:/$1/gis;
    
    # old linux version use "icmp_seq"
    # newer use "icmp_req" instead
    open(PROCESS, "ping -c 1 $host | grep 'icmp_[s|r]eq' | grep time |");
    $ping = <PROCESS>;
    close(PROCESS);
    $ping =~ m/(.*time=)(.*) (ms|usec)/;
    
    if ($2 == "") {
            print "U";              # avoid cacti errors, but do not fake rrdtool stats
    }elsif ($3 eq "usec") {
            print $2/1000;  # re-calculate in units of "ms"
    }else{
            print $2;
    }

    Comment

    Working...