Wrapper scripts

Commands to be executed can be specified in the Zabbix agent daemon configuration file on a single line only. Pushing whole scripts there can be very messy and sometimes it can be hard to figure out the quotation. In such cases, a wrapper script has to be written. Such a script can be useful if parsing data requires more complex actions, or if parsing out multiple different values can't be easily done with flexible user parameters.

It's important to remember that using user parameters and custom scripts requires these to be distributed on all monitored hoststhat involves the scripts themselves and changes to the Zabbix agent daemon's configuration file.

This can soon become hard to manage. Various systems will require different user parameters, so you'll either end up with a messy agent configuration file containing all of them or a myriad of different combinations. There's a quite widespread feature to help with this problem: configuration file inclusion. You can specify the inclusion of individual files by adding to zabbix_agentd.conf entries such as these:

Include=/etc/zabbix/zabbix_agentd.d/zabbix_lm_sensors.conf 
Include=/etc/zabbix/zabbix_agentd.d/zabbix_md_raid.conf 

If such a file is missing, Zabbix will complain but will still start up. Inclusions can be nestedyou can include one file that, in turn, includes several others, and so on.

It's also possible to include whole directoriesin that case, all files placed there will be used. This method allows other packages to place, for example, user parameter configuration in a specific directory, which will then be automatically used by Zabbix:

Include=/etc/zabbix/zabbix_agentd.d/ 

Or, to be sure that only files ending with conf are included, use this:

Include=/etc/zabbix/zabbix_agentd.d/*.conf 

Then, other packages would only need to place files such as zabbix_lm_sensors.conf or zabbix_md_raid.conf in the /etc/zabbix/userparameters directory, and they would be used without any additional changes to the agent daemon configuration file. Installing the Apache web server would add one file, installing Postfix another, and so on.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.137.213.128