Search Exchange

Search All Sites

Nagios Live Webinars

Let our experts show you how Nagios can help your organization.

Contact Us

Phone: 1-888-NAGIOS-1
Email: sales@nagios.com

Login

Remember Me

Directory Tree

Downtime Scheduler

Rating
8 votes
Favoured:
1
Hits
119476
Files:
FileDescription
sched_downtime.tar.gzsched_downtime.tar.gz
Nagios CSP

Meet The New Nagios Core Services Platform

Built on over 25 years of monitoring experience, the Nagios Core Services Platform provides insightful monitoring dashboards, time-saving monitoring wizards, and unmatched ease of use. Use it for free indefinitely.

Monitoring Made Magically Better

  • Nagios Core on Overdrive
  • Powerful Monitoring Dashboards
  • Time-Saving Configuration Wizards
  • Open Source Powered Monitoring On Steroids
  • And So Much More!
This addon consists of a Perl script and two configuration files to implement recurring schedule downtime of hosts and services in Nagios.
Reviews (7)
bychdong, May 28, 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!
bys1n0, February 4, 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(/,/);
byluke1733, December 19, 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]!
byrendicott, December 26, 2012
0 of 1 people found this review helpful
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;$Comments\n";

After:
printf $CMD "[$EpochTime] SCHEDULE_HOST_DOWNTIME;$Hostname;$DownStartEpoch;$DownEndEpoch;$Fixed;0;$DynDownDuration;$Username;$Comments\n";

Now it works great, thanks!
bysteffan, December 2, 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
bybox2, August 10, 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.
bysam_pointer, January 29, 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