This tutorial provides step-by-step instructions on how to extend the functionality of Zabbix agent with the use of a user parameter.
Write a script or command line to retrieve required parameter.
For example, we may write the following command in order to get total number of queries executed by a MySQL server:
When executed, the command returns total number of SQL queries.
Add the command to zabbix_agentd.conf:
mysql.questions is a unique identifier. It can be any valid key identifier, for example, queries.
Test this parameter by using Zabbix agent with "-t" flag (if running under root, however, note that the agent may have different permissions when launched as a daemon):
Reload user parameters from the configuration file by running:
You may also restart the agent instead of the runtime control command.
Test the parameter by using zabbix_get utility.
Add new item with Key=mysql.questions to the monitored host. Type of the item must be either Zabbix Agent or Zabbix Agent (active).
Be aware that type of returned values must be set correctly on Zabbix server. Otherwise Zabbix won't accept them.