I've been running a simple but effective watchdog in Zabbix for quite a while and wanted it to share with all of you.
One shouldn't use this watchdog without any monitoring.
Of course it's Zabbix itself that monitors it....
The script:
grep cron.1min /etc/crontab
cat /etc/cron.1min/zabbix_watchdog
I'm monitoring /var/log/zabbix-server/zabbix_server.log for the text "Starting Zabbix Server"
I'm using my own item-function "regcount" for this...
Maybe we can get that function into Zabbix
[/var/log/zabbix-server/zabbix_server.log,"Starting Zabbix Server"].
One shouldn't use this watchdog without any monitoring.
Of course it's Zabbix itself that monitors it....
The script:
grep cron.1min /etc/crontab
Code:
* * * * * root cd / && run-parts --report /etc/cron.1min
Code:
#!/bin/sh netstat -lntp | grep -q zabbix_server && exit 0 sleep 5 netstat -lntp | grep -q zabbix_server && exit 0 /etc/init.d/zabbix-server start exit 1
I'm using my own item-function "regcount" for this...
Maybe we can get that function into Zabbix
[/var/log/zabbix-server/zabbix_server.log,"Starting Zabbix Server"].
You may be hiding a more serious problem by doing this.
Comment