Why does zabbix agent UserParameter not work when it is on the same machine with zabbix server

jiacheo picture jiacheo · Apr 10, 2013 · Viewed 17.8k times · Source

thanks for viewing this question!

I use zabbix to monitor my servers;

There are totally 15 servers;

But one of the agentd not work for UserParameter when the one is on the same machine with the zabbix server proccess

The architecture is like below:

enter image description here

As you see in the picture, the zabbix agentd which is deploy on the same machine with the server, not work well of the UserParameter configuration

the config code I added is like below

UserParameter=mongo.queue[*],/home/admin/tool/queue_monitor.sh $1 | awk '{if($$2 ~  /^[0-9]+/){print $$2}}'
UserParameter=mongo.status[*],/home/admin/tool/mongo-serverStatus.sh $1 | awk '{if($$1 ~ /^[0-9]+/){ print $$1}}'

It is absolutely the same as other agentds's config...

Then I test it with:

zabbix_agentd -t mongo.queue[delayQueue]

It response :

mongo.queue[delayQueue]                   [m|ZBX_NOTSUPPORTED]

This test run well on the other agentds machine, and will reply a integer number...

zabbix_agentd -t mongo.queue[delayQueue]
mongo.queue[delayQueue]                   [t|0]

So is it that I should not deploy zabbix agentd on the same machine with the zabbix server?

But that agentd work well on its original tools, such as CPU LOADS, Disk space...

My zabbix version is v2.0.3

./zabbix_agentd -V
Zabbix Agent (daemon) v2.0.3 (revision 30485) (03 October 2012)
Compilation time: Dec  5 2012 17:11:46

Answer

Michael Tabolsky picture Michael Tabolsky · Apr 10, 2013

You are trying to guess what the problem is. Look at the agent's log, for execs (scripts) the answer is most probably there. If it isn't, disable the passive monitoring of this agent, enable full debug output (DebugLevel=4), then run the zabbix_get of the param and look again at the log. If it's still not there, then strace is your friend.