Wordpress template for zabbix
Discovering all wordpress instances and checking for updates.
- Add userparameter_wp.config to /etc/zabbix/zabbix_agentd.d/
- Copy wp_find_updates.sh and dicover_file.py to /etc/zabbix/scripts
- Import Wordpress template to Zabbix
- Configure checking times in WP Template->Discovery rules->Items prototypes as needed
- Files should be accessible and executable by user "zabbix"
mkdir /etc/zabbix/scripts
cp wp_find_updates.sh /etc/zabbix/scripts/
cp dicover_file.py /etc/zabbix/scripts/
chmod 755 /etc/zabbix/scripts/wp*
cp userparameter_wp.conf /etc/zabbix/zabbix_agentd.d/
dicover_file.py is made as universal file discovery script. parameter 1 is search path. parameter 2 is base64 encoded file name regex. It will return finded files array with full filename, basename, dirname, basename of dirname. base64 is used due to UnsafeUserParameters in zabbix.
For update search in wp_find_updates.sh, wp-cli is used https://wp-cli.org/
Many thanks to laacz for https://gist.github.com/laacz/9952926