Failover implementation help
Terry
td3201 at gmail.com
Mon Sep 19 23:38:36 CEST 2005
#!/bin/bash
MASTER=foobar
FILE="/var/log/nagios/rw/nagios.cmd"
/usr/lib/nagios/plugins/check_nrpe -H $MASTER -p 3211 -c check_nagios
if [ $? = "0" ];then
TIME=`date +%s`
echo "[$TIME] STOP_EXECUTING_SVC_CHECKS" >> $FILE
TIME=`date +%s`
echo "[$TIME] DISABLE_NOTIFICATIONS" >> $FILE
else
sleep 60
/usr/lib/nagios/plugins/check_nrpe -H $MASTER -p 3211 -c check_nagios
if [ $? = "0" ];then
TIME=`date +%s`
echo "[$TIME] DISABLE_NOTIFICATIONS" >> $FILE
else
TIME=`date +%s`
echo "[$TIME] START_EXECUTING_SVC_CHECKS" >> $FILE
TIME=`date +%s`
echo "[$TIME] ENABLE_NOTIFICATIONS" >> $FILE
fi
fi
On 9/19/05, Paul Singh <psingh at inforelay.com> wrote:
> I'm currently trying to write a script to check to see if my primary
> instance of Nagios is running. That part is easy. I'm having trouble sending
> the appropriate commands to the external command file though.
>
> Can anyone give me the syntax they used to achieve this or maybe send me the
> script they wrote?
>
> Paul Singh
>
>
>
>
>
-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server.
Download it for free - -and be entered to win a 42" plasma tv or your very
own Sony(tm)PSP. Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue.
::: Messages without supporting info will risk being sent to /dev/null
More information about the Users
mailing list