Search code examples
monitoringzabbix

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


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

Solution

  • Finally I found it was a humman error that my workmate had installed another zabbix_agentd on the server, so there's two zabbix agentds on it.

    Although I start the agentd process with -c parameter, but when I used -t to test the user parameters , the config file was default link to another file, so that the user parameters I config in the file dose not effect...