[Nagios-devel] Comment associated with scheduled downtime
Posted: Wed May 07, 2003 4:47 am
--------------Boundary-00=_8LOIMOU1L4AVEITQDRA8
Content-Type: text/plain;
charset="us-ascii"
Content-Transfer-Encoding: 8bit
Hi,
When I schedule downtime for a service or host, the form displays a field
where a comment must be entered. But after I have scheduled the downtime
and I view the comment associated with the service, the comment I entered
doesn't appear; instead, the comment is:
"This service has been scheduled for downtime starting between %s and %s for
a period of %d hours and %d minutes. Notifications for the service will
not be sent out during that time period."
Also, the author is shown as "(Nagios Process)" instead of the person who
really scheduled the downtime.
I know that the real comment and the real author can be viewed by clicking
on the "Downtime" button in the side-panel, but I feel that the real
comment and the real author should also be displayed when viewing the
service details.
I attach a suggested patch that causes the real comment, combined with the
above message about the scheduled downtime, to be displayed. Also, the
person who scheduled the downtime is shown instead of "(Nagios Process)".
Thanks,
Rob Pitman
--------------Boundary-00=_8LOIMOU1L4AVEITQDRA8
Content-Type: text/x-diff;
charset="us-ascii";
name="downtime.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename="downtime.patch"
diff -r -u3 nagios-1-x-cvs/common/downtime.c nagios-1-x-downtime/common/downtime.c
--- nagios-1-x-cvs/common/downtime.c Fri Oct 18 02:07:05 2002
+++ nagios-1-x-downtime/common/downtime.c Wed May 7 14:23:20 2003
@@ -275,24 +275,24 @@
minutes=((temp_downtime->duration-(hours*3600))/60);
if(temp_downtime->fixed==TRUE){
if(temp_downtime->type==HOST_DOWNTIME)
- snprintf(temp_buffer,sizeof(temp_buffer)-1,"This host has been scheduled for downtime from %s to %s. Notifications for the host will not be sent out during that time period.",start_time_string,end_time_string);
+ snprintf(temp_buffer,sizeof(temp_buffer)-1,"%sThis host has been scheduled for downtime from %s to %s. Notifications for the host will not be sent out during that time period.",temp_downtime->comment,start_time_string,end_time_string);
else
- snprintf(temp_buffer,sizeof(temp_buffer)-1,"This service has been scheduled for downtime from %s to %s. Notifications for the service will not be sent out during that time period.",start_time_string,end_time_string);
+ snprintf(temp_buffer,sizeof(temp_buffer)-1,"%sThis service has been scheduled for downtime from %s to %s. Notifications for the service will not be sent out during that time period.",temp_downtime->comment, start_time_string,end_time_string);
}
else{
if(temp_downtime->type==HOST_DOWNTIME)
- snprintf(temp_buffer,sizeof(temp_buffer)-1,"This host has been scheduled for downtime starting between %s and %s for a period of %d hours and %d minutes. Notifications for the host will not be sent out during that time period.",start_time_string,end_time_string,hours,minutes);
+ snprintf(temp_buffer,sizeof(temp_buffer)-1,"%sThis host has been scheduled for downtime starting between %s and %s for a period of %d hours and %d minutes. Notifications for the host will not be sent out during that time period.",temp_downtime->comment,start_time_string,end_time_string,hours,minutes);
else
- snprintf(temp_buffer,sizeof(temp_buffer)-1,"This service has been scheduled for downtime starting between %s and %s for a period of %d hours and %d minutes. Notifications for the service will not be sent out during that time period.",start_time_string,end_time_string,hours,minutes);
+ snprintf(temp_buffer,sizeof(temp_buffer)-1,"%sThis service has been scheduled for downtime starting between %s and %s for a period of %d hours and %d minutes. Notifications for the service will not be sent out during that time period.",temp_downtime->comment,start_time_string,end_time_string,hours,minutes);
}
temp_buffer[sizeof(temp_buffer)-1]='\x0';
/* add a non-persistent comment to the host or service regarding the scheduled outage */
if(temp_downtime->type==SERVICE_DOW
...[email truncated]...
This post was automatically imported from historical nagios-devel mailing list archives
Original poster: [email protected]
Content-Type: text/plain;
charset="us-ascii"
Content-Transfer-Encoding: 8bit
Hi,
When I schedule downtime for a service or host, the form displays a field
where a comment must be entered. But after I have scheduled the downtime
and I view the comment associated with the service, the comment I entered
doesn't appear; instead, the comment is:
"This service has been scheduled for downtime starting between %s and %s for
a period of %d hours and %d minutes. Notifications for the service will
not be sent out during that time period."
Also, the author is shown as "(Nagios Process)" instead of the person who
really scheduled the downtime.
I know that the real comment and the real author can be viewed by clicking
on the "Downtime" button in the side-panel, but I feel that the real
comment and the real author should also be displayed when viewing the
service details.
I attach a suggested patch that causes the real comment, combined with the
above message about the scheduled downtime, to be displayed. Also, the
person who scheduled the downtime is shown instead of "(Nagios Process)".
Thanks,
Rob Pitman
--------------Boundary-00=_8LOIMOU1L4AVEITQDRA8
Content-Type: text/x-diff;
charset="us-ascii";
name="downtime.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename="downtime.patch"
diff -r -u3 nagios-1-x-cvs/common/downtime.c nagios-1-x-downtime/common/downtime.c
--- nagios-1-x-cvs/common/downtime.c Fri Oct 18 02:07:05 2002
+++ nagios-1-x-downtime/common/downtime.c Wed May 7 14:23:20 2003
@@ -275,24 +275,24 @@
minutes=((temp_downtime->duration-(hours*3600))/60);
if(temp_downtime->fixed==TRUE){
if(temp_downtime->type==HOST_DOWNTIME)
- snprintf(temp_buffer,sizeof(temp_buffer)-1,"This host has been scheduled for downtime from %s to %s. Notifications for the host will not be sent out during that time period.",start_time_string,end_time_string);
+ snprintf(temp_buffer,sizeof(temp_buffer)-1,"%sThis host has been scheduled for downtime from %s to %s. Notifications for the host will not be sent out during that time period.",temp_downtime->comment,start_time_string,end_time_string);
else
- snprintf(temp_buffer,sizeof(temp_buffer)-1,"This service has been scheduled for downtime from %s to %s. Notifications for the service will not be sent out during that time period.",start_time_string,end_time_string);
+ snprintf(temp_buffer,sizeof(temp_buffer)-1,"%sThis service has been scheduled for downtime from %s to %s. Notifications for the service will not be sent out during that time period.",temp_downtime->comment, start_time_string,end_time_string);
}
else{
if(temp_downtime->type==HOST_DOWNTIME)
- snprintf(temp_buffer,sizeof(temp_buffer)-1,"This host has been scheduled for downtime starting between %s and %s for a period of %d hours and %d minutes. Notifications for the host will not be sent out during that time period.",start_time_string,end_time_string,hours,minutes);
+ snprintf(temp_buffer,sizeof(temp_buffer)-1,"%sThis host has been scheduled for downtime starting between %s and %s for a period of %d hours and %d minutes. Notifications for the host will not be sent out during that time period.",temp_downtime->comment,start_time_string,end_time_string,hours,minutes);
else
- snprintf(temp_buffer,sizeof(temp_buffer)-1,"This service has been scheduled for downtime starting between %s and %s for a period of %d hours and %d minutes. Notifications for the service will not be sent out during that time period.",start_time_string,end_time_string,hours,minutes);
+ snprintf(temp_buffer,sizeof(temp_buffer)-1,"%sThis service has been scheduled for downtime starting between %s and %s for a period of %d hours and %d minutes. Notifications for the service will not be sent out during that time period.",temp_downtime->comment,start_time_string,end_time_string,hours,minutes);
}
temp_buffer[sizeof(temp_buffer)-1]='\x0';
/* add a non-persistent comment to the host or service regarding the scheduled outage */
if(temp_downtime->type==SERVICE_DOW
...[email truncated]...
This post was automatically imported from historical nagios-devel mailing list archives
Original poster: [email protected]