I have a web server that is running the Zabbix Agent (3.4.x), reporting the normal stuff back to a Zabbix Server. The web server runs a number of websites based on common software (Drupal, Magento etc). I'd like to track their update status and version number in Zabbix.
I've created a bash script that checks the numbers, then pushes it to Zabbix using zabbix_sender
. However, I'm not sure of the best way to structure the host settings.
I was considering setting up each website as a "host" with a template with 2 items (version number, update status), then creating a bash script to push data into these keys.
The downside is I have to manually setup each new website as a host into Zabbix, then adjust my bash script to find the data on the webserver.
Is there a way to control the list of sites from Zabbix server, adding a new website, setting it's path somehow, then letting a script on the web server grab the data?
This is a bit of an opinion based question, but I'd consider using low level discovery (LLD) for this. Have a script that knows how to discover websites, push custom JSON to an LLD rule as per the manual page and have item, trigger and other prototypes created.
This way adding a new website will require no manual intervention for it to be monitored, it will "just happen". Note that this method will create all items on the same host, I'd suggest that over individual host manual creation or LLD.