Scheduling downtimes with external command?

Ulf Gunnarson Ulf.Gunnarson at kau.se
Mon Apr 3 15:32:55 CEST 2006


I use a simple script in crontab which in turn invokes another script made
by Sam Tilders.

Example of crontab script:
---------------------------------------------------------------
[nagios at computer bin]$ crontab -l
00 00 * * * /usr/local/nagios/bin/sched_downtime
[nagios at computer bin]$ more sched_downtime  
#!/bin/sh

#Today variable
tday=`date +%a`

/usr/local/nagios/bin/down_time XXX "`date --iso-8601` 23:30:00" "`date
--iso-8601` 23:59:59" 1 3600 nagios "scheduled downtime"
/usr/local/nagios/bin/down_time XXX "`date --iso-8601` 00:00:30" "`date
--iso-8601` 01:00:00" 1 3600 nagios "scheduled downtime"
/usr/local/nagios/bin/down_time YYY "`date --iso-8601` 01:38:00" "`date
--iso-8601` 06:30:00" 1 3600 nagios "scheduled downtime"
if [ "$tday" = "Fri" ]; then
        /usr/local/nagios/bin/down_time ZZZ "`date +%F` 06:55:00" "`date
+%F` 07:15:00" 1 3600 nagios "Scheduled reboot time"
fi
[nagios at computer bin]$ 
---------------------------------------------------------------

Ive attached the script made by Sam as down_time

Also make sure that external command is enabled in config and that the
proper permissions is set on nagios/var/rw/nagios.cmd

Hope this helps


/Ulf

 

-----Original Message-----
From: nagios-users-admin at lists.sourceforge.net
[mailto:nagios-users-admin at lists.sourceforge.net] On Behalf Of Matthias
Eichler
Sent: den 3 april 2006 13:09
To: nagios-users at lists.sourceforge.net
Subject: [Nagios-users] Scheduling downtimes with external command?

Dear List,

maybe I am just blind, but I cant find any documented
external command for scheduling downtimes from an external
application.

Has anybody experiences with this?

Thanks,

Matthias Eichler



-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: down_time
Type: application/octet-stream
Size: 2929 bytes
Desc: not available
URL: <https://www.monitoring-lists.org/archive/users/attachments/20060403/6461ebd8/attachment.obj>


More information about the Users mailing list