[icinga-checkins] icinga.org: icinga-core/master: fix scheduling downtime for all services AND the host (cgi url, external commands)

git at icinga.org git at icinga.org
Wed May 19 13:41:54 CEST 2010


Module: icinga-core
Branch: master
Commit: 1e10c8d640f4f50556f08c1f6950c589997770c0
URL:    https://git.icinga.org/?p=icinga-core.git;a=commit;h=1e10c8d640f4f50556f08c1f6950c589997770c0

Author: Michael Friedrich <michael.friedrich at univie.ac.at>
Date:   Fri May 14 21:33:11 2010 +0200

fix scheduling downtime for all services AND the host (cgi url, external commands)

no-one got this patched, finally it is into the core.
Works as expected - by e.g. scheduling a downtime

nagios/cgi-bin/cmd.cgi?cmd_typ=86&host=test_host_001

both the host AND all the services are affected.

fixes #354

---

 Changelog       |    1 +
 base/commands.c |    4 ++++
 cgi/cmd.c       |    2 +-
 3 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/Changelog b/Changelog
index e58d040..3280d30 100644
--- a/Changelog
+++ b/Changelog
@@ -18,6 +18,7 @@ ENHANCEMENTS
 * idoutils: add syslog output, if ido2db is unable to do initial db query
 
 FIXES
+* core: fix scheduling downtime for all services AND the host (cgi url, external commands)
 * core: fix spurious dollar signs added to command_lines (Alexander Wirt)
 * core: fix for choosing next valid time on day of DST change when clocks go one hour backwards (Ton Voon)
 * core: fix for nagios now erroring when "Error: Could not find any contactgroup matching..." displayed (Ton Voon)
diff --git a/base/commands.c b/base/commands.c
index e0160b5..c963ccc 100644
--- a/base/commands.c
+++ b/base/commands.c
@@ -2514,6 +2514,10 @@ int cmd_schedule_downtime(int cmd, time_t entry_time, char *args){
 				continue;
 			schedule_downtime(SERVICE_DOWNTIME,host_name,temp_service->description,entry_time,author,comment_data,start_time,end_time,fixed,triggered_by,duration,&downtime_id);
 	                }
+		
+		/* schedule downtime for the host itsself too */
+		schedule_downtime(HOST_DOWNTIME,host_name,NULL,entry_time,author,comment_data,start_time,end_time,fixed,triggered_by,duration,&downtime_id);
+
 		break;
 
 	case CMD_SCHEDULE_HOSTGROUP_HOST_DOWNTIME:
diff --git a/cgi/cmd.c b/cgi/cmd.c
index f2acafd..950aae1 100644
--- a/cgi/cmd.c
+++ b/cgi/cmd.c
@@ -799,7 +799,7 @@ void request_command_data(int cmd){
 		break;
 
 	case CMD_SCHEDULE_HOST_SVC_DOWNTIME:
-		printf("schedule downtime for all services for a particular host");
+		printf("schedule downtime for all services for a particular host and the host itsself");
 		break;
 
 	case CMD_PROCESS_HOST_CHECK_RESULT:





More information about the icinga-checkins mailing list