Zabbix – Automatic Filesystem Discovery Update

By jbayer - Last updated: Saturday, May 4, 2013 - Save & Share - Leave a Comment

On our systems, we use a standard Linux template.  However, many of our systems have different filesystem layouts, and I didn’t want to have to customize each system as it was installed into Zabbix.

I wrote the attached script to solve this problem.  Once the Zabbix client is installed and configured, simply run the attached script and the host will be updated on the Zabbix server.  The script is written in Python, a

 

It requires that two packages (Redhat packages are listed) be installed, using the following command:

yum -y install python-simplejson python-hashlib

 

It also requires the following file:

https://github.com/gescheit/scripts/blob/master/zabbix/zabbix_api.py

The script assumes that it and the zabbix_api.py file both live in /etc/zabbix/python;  if you install it somewhere else, adjust line 9 appropriately.

This works and has been tested on Zabbix 2.0.  It _should_ work on 1.8, but I haven’t tested it there.

It requires a username and password for a Zabbix user who has access to the JSON interface.

You will need to update the three lines near the top of the file which list the username, password and Zabbix server.

 

  zabbix_updatefs.py (1.9 KiB, 459 hits)

 

Posted in Zabbix • Tags: , , Top Of Page
2,268 views

asd