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:
ping.loss.sh:
I use to test it with zabbix_get from host A this way:
The issue is I always get ZBX_NOTSUPPORTED, and each time I see in agent log something like this:
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:
Agent was configured with following options:
Please advise.
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
Code:
#!/bin/bash
A=`/bin/ping -q -s 32 -c $1 $2 | /usr/bin/awk '/packet loss/ { print int($(NF-4)) }'`
echo $A
Code:
zabbix_get -s host.B.ip.address -k ping.loss[10,www.xxx.yyy.zzz]
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
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
Code:
./configure --enable-agent --with-libxml2 --with-jabber --with-libcurl --with-net-snmp --with-ssh2 --with-openipmi --with-ldap
Comment