Ad Widget

Collapse

UserParameter issues

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • art_emius
    Junior Member
    • Mar 2014
    • 5

    #1

    UserParameter issues

    Greetings.

    Recently I've encountered issues with UserParatemer options in Zabbix Agent. In my case I have a network of two local and one remote hosts: local host A runs Zabbix server ; local host B runs Zabbix Agent; remote host C is a router maintaned by other person.
    I need to check if host C is available from host B by ICMP and estimate packet loss rate. For this purpose I've decided to use UserParameter and bash script.

    Here is part of agent config:
    Code:
    UnsafeUserParameters=1
    UserParameter=ping.loss[*],/etc/zabbix/scripts/ping.loss.sh $1 $2 2>/dev/null
    DebugLevel=4
    LogFile=/var/log/zabbix-agent.log
    ping.loss.sh:
    Code:
    #!/bin/bash
    A=`/bin/ping -q -s 32 -c $1 $2 | /usr/bin/awk '/packet loss/ { print int($(NF-4)) }'`
    echo $A
    I use to test it with zabbix_get from host A this way:
    Code:
    zabbix_get -s host.B.ip.address -k ping.loss[10,www.xxx.yyy.zzz]
    The issue is I always get ZBX_NOTSUPPORTED, and each time I see in agent log something like this:
    Code:
      8290:20140317:082805.694 Requested [ping.loss[10,www.xxx.yyy.zzz]]
      8290:20140317:082805.694 In zbx_popen() command:'/etc/zabbix/scripts/ping.loss.sh 10 www.xxx.yyy.zzz 2>/dev/null'
      8290:20140317:082805.694 End of zbx_popen():8
    I've tried to look for typical issues, and found that permissions are okay. "zabbix" user is able to run agent, and script. Also if I try to run script from shell as "zabbix" user I get adequate value. So I see the problem is agent can't pass it to server somehow.

    Hosts A and B both runs Debian Linux(Linux 3.2.0-4-amd64 #1 SMP Debian 3.2.51-1 x86_64 GNU/Linux), Zabbix server version is v2.2.1, Zabbix agentd version is v2.2.1 (revision 40808).

    Server was configured with following options:
    Code:
    ./configure --enable-server --enable-agent --with-mysql --with-libxml2 --with-jabber --with-libcurl --with-net-snmp --with-ssh2 --with-openipmi --with-ldap
    Agent was configured with following options:
    Code:
    ./configure --enable-agent --with-libxml2 --with-jabber --with-libcurl --with-net-snmp --with-ssh2 --with-openipmi --with-ldap
    Please advise.
  • steveboyson
    Senior Member
    • Jul 2013
    • 582

    #2
    10 pings last a time. Could it be that this time is longer than the defined timeout value in the config file so the agent just runs into a timeout?

    Comment

    • art_emius
      Junior Member
      • Mar 2014
      • 5

      #3
      Originally posted by steveboyson
      10 pings last a time. Could it be that this time is longer than the defined timeout value in the config file so the agent just runs into a timeout?
      It happened right the way as you told. Thank you.

      Issue is resolved.

      Comment

      Working...