Page 1 of 1

[Nagios-devel] [PATCH] Fix for "hosts too" when scheduling

Posted: Wed Aug 20, 2008 4:46 am
by Guest
This is a multi-part message in MIME format.
--------------050107050009040708010303
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 7bit

This patch just inserts a "trigger-id" field of 0 into the command,
fixing its formatting and thus preventing the Nagios daemon from
rejecting the command as being malformed.

It applies to latest cvs, and, at least in spirit, also to nagios-2.x,
which also needs it to work properly.

--
Andreas Ericsson [email protected]
OP5 AB www.op5.se
Tel: +46 8-230225 Fax: +46 8-230231

--------------050107050009040708010303
Content-Type: text/plain;
name="nagios-servicegroup-and-hosts-downtime-fix.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
filename="nagios-servicegroup-and-hosts-downtime-fix.patch"

diff --git a/cgi/cmd.c b/cgi/cmd.c
index 71439ac..91600ff 100644
--- a/cgi/cmd.c
+++ b/cgi/cmd.c
@@ -2212,7 +2212,7 @@ int commit_command(int cmd){
if(affect_host_and_services==FALSE)
snprintf(command_buffer,sizeof(command_buffer)-1,"[%lu] SCHEDULE_SERVICEGROUP_SVC_DOWNTIME;%s;%lu;%lu;%d;0;%lu;%s;%s\n",current_time,servicegroup_name,start_time,end_time,(fixed==TRUE)?1:0,duration,comment_author,comment_data);
else
- snprintf(command_buffer,sizeof(command_buffer)-1,"[%lu] SCHEDULE_SERVICEGROUP_SVC_DOWNTIME;%s;%lu;%lu;%d;0;%lu;%s;%s\n[%lu] SCHEDULE_SERVICEGROUP_HOST_DOWNTIME;%s;%lu;%lu;%d;0;%lu;%s;%s\n",current_time,servicegroup_name,start_time,end_time,(fixed==TRUE)?1:0,duration,comment_author,comment_data,current_time,servicegroup_name,start_time,end_time,(fixed==TRUE)?1:0,duration,comment_author,comment_data);
+ snprintf(command_buffer,sizeof(command_buffer)-1,"[%lu] SCHEDULE_SERVICEGROUP_SVC_DOWNTIME;%s;%lu;%lu;%d;0;%lu;%s;%s\n[%lu] SCHEDULE_SERVICEGROUP_HOST_DOWNTIME;%s;%lu;%lu;%d;%lu;%s;%s\n",current_time,servicegroup_name,start_time,end_time,(fixed==TRUE)?1:0,duration,comment_author,comment_data,current_time,servicegroup_name,start_time,end_time,(fixed==TRUE)?1:0,duration,comment_author,comment_data);
break;

default:

--------------050107050009040708010303--





This post was automatically imported from historical nagios-devel mailing list archives
Original poster: [email protected]