Zabbix needs to be customized to add RABBITMQ monitoring to respond to RABBITMQ problems in a timely manner, so a zabbix_agented.conf is added
#UserParameter =rabbitmq,rabbitmqctl status &>/dev/null && echo ' 0 ' | | Echo ' 1 '
Then restart the agent test
#/usr/local/zabbix/sbin/zabbix_agentd-t RABBITMQ
Show results as
RABBITMQ [T|0]
However in the server break test
#./zabbix_get-s "IP"-K RABBITMQ
The resulting return value is
1
The results of the agent-side and server-side tests are different.
After analysis, the server side in obtaining the agent return value, using the Zabbix user, and the rabbitmqctl command only root and RABBITMQ user can execute, so, regardless of how the server side gets the value is "1". Therefore, the other Zabbix user can execute the command to monitor, then the agent side and server side test results are normal.
Conclusion: In the future, when adding custom monitoring items to Zabbix, whether you add a command directly or add a script, it is important to note that all commands Zabbix the user must have execute permissions.
This article is from the "Bole Lemon" blog, please be sure to keep this source http://bolemon.blog.51cto.com/10275874/1834298
Questions about Zabbix custom monitoring items, insufficient user rights