Recurring downtime: necessary to restart nagio s to reread the downtime.log?
Ned Hanks
ndhanks at geneva.com
Thu Aug 12 18:03:39 CEST 2004
I ran into the same problem and figured out that I needed to send a downtime
command to the command file, /usr/local/var/rw/nagios.cmd
I got this script from somebody of this list Sorry, can't remember who but
would like to thank that person.
#!/bin/bash
# $1 host scheduled for downtime
# $2 time to start scheduled downtime
# $3 length in minutes of downtime
# $4 fixed flag - see Nagios documentation - defaults to 0
USER1=/usr/nagios
now=$(date +%s)
host=$1
from=$(date --date="$2" +%s)
duration=$3
till=$(($from+$duration))
fixed=0
if [ ! -z "$4" ]
then
fixed=$4
fi
echo "[$now]
SCHEDULE_HOST_DOWNTIME;$host;$from;$till;$fixed;$duration;Nagios
Cron;Scheduled Downtime" >> $USER1/var/rw/nagios.cmd
--------------------------------------
Ned D Hanks
IT Manager
Geneva Steel, LLC
10 South Geneva Rd
Vineyard, UT 84058
Office: 801-227-9182
Fax: 801-227-9400
-----Original Message-----
From: nagios-users-admin at lists.sourceforge.net
[mailto:nagios-users-admin at lists.sourceforge.net]On Behalf Of
lhill at groupit.com
Sent: Wednesday, August 11, 2004 1:43 PM
To: nagios-users at lists.sourceforge.net
Subject: [Nagios-users] Recurring downtime: necessary to restart nagios to
reread the downtime.log?
I have a cronjob append a new downtime to the downtime.log and comments.log
each night. Although the log is getting updated correctly, Nagios does not
recognize the downtime until I restart the service. OTOH, it does reread the
comment.log, so those messages get added to the comments list each night. I
understand the need for restart to reread cfg files, but am I missing
something concerning getting Nagios to reread the downtime.log?
Thanks,
Lance Hill
GroupIT
______________________________
Tel.: 416.703.2896 ext. 107
Fax: 416.703.2987
http://www.groupit.com
IBM Premier Business and Lotus Partner
e-firm certified
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.monitoring-lists.org/archive/users/attachments/20040812/8f8a5bb9/attachment.html>
More information about the Users
mailing list