Re: Problem with external commands
"Tom DE BLENDE" <[email protected]>
| Newsgroups | gmane.network.netsaint.user |
|---|---|
| Organization | DHL GCC |
| Message-ID | <[email protected]> |
Jens Kruse wrote: > Hi Atle, hi list, > > Atle Veka wrote: > > > In Netsaint this is not possible without your own trickery, I think > > someone has scripts that will "rebuild" your scheduled downtimes upon > > reload. I do believe this is fixed in Nagios however. :) > > Does anyone have such scripts or have an idea where this information is > stored, so we could write a script on our own if there's no script so far? This script was posted a while ago by Matthew Garrett <[email protected]>: Subject: [netsaint] Re-submit downtime for Netsaint 0.0.7 Date: Thu, 4 Jul 2002 11:49:43 +0200 From: "Garrett, Matt M SITI-ITDSEL314" <[email protected]> To: "Netsaint (E-mail)" <[email protected]> Folks I know that by default Netsaint 0.0.7 does not remember downtime that was submitted after netsaint has been restarted I have made the following simple script that gets run any time netsaint is restarted This will look at old downtime entries and work out if they are still valid e.g end time is in the future and will then submit it. Note should be run as the Netsaint process owner as write access is needed to netsaint.cmd file Matt ---------------------------------------------------------------------------- ----------------- #!/bin/ksh # Script to re-submit downtime after restart # Get EPOCH Time via perl TIME=`perl -e 'print time();'` # Get the hosts that all ready have down time from the log file DONWTIME=`grep SCHEDULE_HOST_DOWNTIME /local/netsaint/var/netsaint.log | awk -F: '{print $2}'| sort -u` # Do one host at a time for LOOP in `echo $DONWTIME` do # Work out the ENDTIME of that hosts downtime ENDTIME=`echo $LOOP | awk -F\; '{print $4}'` # If the time now and END time is less then process it if [ $TIME -le $ENDTIME ] then echo "[$TIME] $LOOP" > /local/netsaint/var/rw/netsaint.cmd echo "[$TIME] $LOOP" fi done ------------------------------------------------------- This sf.net email is sponsored by: OSDN - Tired of that same old cell phone? Get a new here for FREE! https://www.inphonic.com/r.asp?r=sourceforge1&refcode1=vs3390