Looking for watchdog to take care of nagios process
Hello There,
I'm looking for a watchdog program that would take care of nagios process and restart it if it hangs or quit unexpectedly. I was thinking using CRONTAB to do so. Is it a good idea, or is there a better solution? Does anyone already done this? Best regards, Angel. |
Hi,
This one was posted on the Nagios Users list a while ago but still does the trick. Code:
#!/bin/bash Kind regards, Eric |
Quote:
|
Thanks alot to you both.
I think I'll use check_nagios for now, but I'll keep monit in my pocket for later ;) Angel |
Monit is good choice
|
Hi,
You're welcome. If you've used them both for a while it would be appreciated if you could post your experiences here at LQ. Kind regards, Eric |
Hi EricTRA,
After some test it's working find using your script: 1. I create a new file with your script inside in /usr/local/nagios/bin/nagios_watchdog 2. Change the right and owner to make it executable to 750 and nagios:nagios respectively. 3. I add a new line in my /etc/crontab file (This will run the script every 2 minutes) Code:
*/2 * * * * nagios /usr/local/nagios/bin/nagios_watchdog Code:
# reload cron For testing I did the following: Code:
# killall nagios new attempt after 2 minutes ==>> result, Nagios is back on track ;) |
Hello,
That's good news. Have fun with Linux. Kind regards, Eric |
Quote:
Code:
./check_nagios -e 5 -F /usr/local/nagios/var/nagios.log -C /usr/local/nagios/bin/nagios | awk '{ print $2 }' Code:
# ./check_nagios -e 5 -F /usr/local/nagios/var/nagios.log -C /usr/local/nagios/bin/nagios |
Quote:
That's why NTP has been invented, to avoid wrong system times :) Since correct time is crucial when monitoring I always set up my servers with NTP to synchronize time. Of course if there's no possibility to sync time, or the admin is not aware of a 'wrong' system time then your solution is more adequate. Kind regards, Eric |
All times are GMT -5. The time now is 07:16 AM. |