Ad Widget

Collapse

Zabbix watchdog

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • frater
    Senior Member
    • Oct 2010
    • 340

    #1

    Zabbix watchdog

    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
    Code:
    *   *   * * *   root    cd / && run-parts --report /etc/cron.1min
    cat /etc/cron.1min/zabbix_watchdog
    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 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"].
    Zabbix agents on Linux, FreeBSD, Windows, AVM-Fritz!box, DD-WRT and QNAP
  • Farzad FARID
    Member
    • Apr 2007
    • 79

    #2
    Hi,

    Originally posted by frater
    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.
    You're right in saying that Zabbix itself should be monitored but I think that, like you said, it's a bad idea to restart the server without trying to know why in the first place it stopped or crashed You may be hiding a more serious problem by doing this.

    Regards.

    Comment

    • frater
      Senior Member
      • Oct 2010
      • 340

      #3
      I'm not hiding anything....
      My Zabbix-server never crashes.
      I had a version that did this a year ago.

      If it ever does this again, I will see in Zabbix that the server restarted xx times in the last half hour... and I can start investigating.....

      Just a matter of being prepared.
      I will probably have changed something (new version) and can revert..
      In the mean time Zabbix keeps running.
      Zabbix agents on Linux, FreeBSD, Windows, AVM-Fritz!box, DD-WRT and QNAP

      Comment

      Working...