Scheduled Downtime

Downtime Scheduler

Description:

This addon consists of a Perl script and two configuration files to implement recurring schedule downtime of hosts and services in Nagios.

Current Version

Last Release Date

May 27, 2009

Compatible With

Owner


Project Files
Project Notes
Reviews (7) Add a Review
nagios.cmd
by chdong, May 31, 2014

In the perl script, the Nagios command file MUST be written in the default directory and with the default name, e.g., for Nagios 4.0.1 (I installed Nagios under /sfw): $NagiosCMD = "/sfw/nagios/var/rw/nagios.cmd"; It works well. Thanks!



Add new parameter
by s1n0, February 28, 2014

nagios 4.0.2: downtimeschedhst.cfg # Daysfield,Hostname,StartTime(HH:MM:ss),duration(seconds),fixed/dynamic,Trigger ID,Dynamic time ( if dynamic = 1 ),Name(user posting downtime),Comments # 0:1:1:1:1:1:0,host1.co.za,23:59:00,14400,1,0,7200,Nagios,Scheduled Daily Downtime (Backups) downtimeschedsvc.cfg #Daysfield,Hostname,service-name,StartTime(HH:MM:ss),duration(seconds),fixed/dynamic,Trigger ID(often=0 ),Dynamic time ( if dynamic = 1 ),Name(user posting downtime),Comments #0:1:1:1:1:1:0,host1.co.za,Host Service,23:59:00,14400,1,0,7200,Nic le Roux,Scheduled Daily Downtime (Backups) in perl script: add this variable: my $TriggerId; # Id is to the ID of another scheduled downtime entry.If TriggerId( =0 ) then it should not be trigged by another downtime entry. and modify: # Read variable in ($DaysOfWeek,$Hostname,$ServiceName,$DownStartNormal,$DownDuration,$Fixed,$TriggerId,$DynDownDuration,$Username,$Comments)=split(/,/); #Read Variables in ($DaysOfWeek,$Hostname,$DownStartNormal,$DownDuration,$Fixed,$TriggerId,$DynDownDuration,$Username,$Comments)=split(/,/);



Looks Nice
by luke1733, December 31, 2013

Nice interface and easy to setup. I am getting the following error on 3.4.1 so the scheduler does not work for me. The host name is valid and resolves from nagios. I removed the actual host name from the comment. Any ideas on how to address this? Any help would be very much appreciated. Reading in configuration Reading in status log to get list of services Reading in list of already scheduled downtime Checking for downtime due in next 10080 minutes ERROR: Invalid host REMOVED.com[NOT FOUND]! ERROR: Invalid host REMOVED.com[NOT FOUND]! ERROR: Invalid host REMOVED.com[NOT FOUND]!



had to modify slightly
by rendicott, December 31, 2012

At first this wasn't working on 3.2.1 I could see it trying to process the command when I tail nagios.log but it wasn't actually setting the downtime. I manually set a downtime through the web interface while watching the nagios.log and saw that the web interface was adding an extra parameter [0] (in between FIXED[1] and DYNDOWNDURATION[7200]) to the command that the perl script wasn't. Perl Script: SCHEDULE_HOST_DOWNTIME;ATLSQL1;1356546900;1356552400;1;7200;Nagios;ScheduledDowntime_TEST_ATLSQL1 SCHEDULE_HOST_DOWNTIME;ATLSQL1;1356546900;1356552400;1;0;7200;Nagios;ScheduledDowntime_TEST_ATLSQL1 So I modified the printf line of the "sched_downtime" perl script to hard code that extra zero: Before: printf $CMD "[$EpochTime] SCHEDULE_HOST_DOWNTIME;$Hostname;$DownStartEpoch;$DownEndEpoch;$Fixed;$DynDownDuration;$Username;$Commentsn"; After: printf $CMD "[$EpochTime] SCHEDULE_HOST_DOWNTIME;$Hostname;$DownStartEpoch;$DownEndEpoch;$Fixed;0;$DynDownDuration;$Username;$Commentsn"; Now it works great, thanks!



works like it should
by steffan, December 31, 2011

Works great! I like the feature with the button in the web UI to administrate the downtimes. have been running with this for half a year now, and no problems at all (except i had to increase my "external commands allowed at the same time" in the nagios config because i had too many downtimes ;D) 5/5



awesome stuff
by box2, August 31, 2010

I like this method better than the built into web UI methods (firstly, I don't use the default nagios UI) and because this is much simpler for me to configure in less than extremely standard ways. Very portable code and with the update given by sam_pointer it works great in a nightly cron to make sure my backup schedule doesn't create a cascade of alerting failure three times a day.



Patch for Nagios 3.x
by sam_pointer, January 31, 2010

The script fails for me on Nagios 3.0.6. I've created a patch that corrects this: http://sam-pointer.com/2010/01/29/nagios-recurring-scheduled-downtime



Add a Review

You must be logged in to submit a review.

Thank you for your review!

Your review has been submitted and is pending approval.

Recommend

To:


From:


Thank you for your recommendation!

Your recommendation has been sent.

Project Stats
Rating
4.5 (8)
Favorites
1
Views
119,359