[Nagios-devel] DNX patch for Nagios 3.0 rc2
Posted: Tue Jan 29, 2008 12:25 pm
This is a multi-part message in MIME format.
--------------010404070600000700020301
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Hi Ethan,
I realize you're probably still looking over my changes to 3.0 rc1. But
I had to post a patch for rc2 on the dnx-devel list so that people
wanting to play with dnx on nagios 3 could move ahead with rc2.
Since you didn't take the critical portions of my rc1 patch, I assume
you have some issues with it. No doubt, I broke something.
I've attached the rc2 version of my patch (same design). I'll continue
to wait for your comments.
Thanks!
John
--------------010404070600000700020301
Content-Type: text/plain;
name="nagios-3.0rc2-dnx.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
filename="nagios-3.0rc2-dnx.patch"
diff -Naur nagios-3.0rc2/base/checks.c nagios-3.0rc2-patched/base/checks.c
--- nagios-3.0rc2/base/checks.c 2008-01-29 09:05:33.000000000 -0700
+++ nagios-3.0rc2-patched/base/checks.c 2008-01-29 13:01:45.000000000 -0700
@@ -380,12 +380,6 @@
*preferred_time+=(svc->check_interval*interval_length);
return ERROR;
}
-
- /* neb module wants to override (or cancel) the service check - perhaps it will check the service itself */
- /* NOTE: if a module does this, it has to do a lot of the stuff found below to make sure things don't get whacked out of shape! */
- /* NOTE: if would be easier for modules to override checks when the NEBTYPE_SERVICECHECK_INITIATE event is called (later) */
- if(neb_result==NEBERROR_CALLBACKOVERRIDE)
- return OK;
#endif
@@ -435,6 +429,32 @@
/* set the execution flag */
svc->is_executing=TRUE;
+ /* start save check info */
+ check_result_info.object_check_type=SERVICE_CHECK;
+ check_result_info.check_type=SERVICE_CHECK_ACTIVE;
+ check_result_info.check_options=check_options;
+ check_result_info.scheduled_check=scheduled_check;
+ check_result_info.reschedule_check=reschedule_check;
+ check_result_info.start_time=start_time;
+ check_result_info.finish_time=start_time;
+ check_result_info.early_timeout=FALSE;
+ check_result_info.exited_ok=TRUE;
+ check_result_info.return_code=STATE_OK;
+ check_result_info.output=NULL;
+
+#ifdef USE_EVENT_BROKER
+ /* send data to event broker */
+ neb_result=broker_service_check(NEBTYPE_SERVICECHECK_INITIATE,NEBFLAG_NONE,NEBATTR_NONE,svc,SERVICE_CHECK_ACTIVE,start_time,end_time,svc->service_check_command,svc->latency,0.0,service_check_timeout,FALSE,0,processed_command,NULL);
+
+ /* neb module wants to override the service check - perhaps it will check the service itself */
+ if(neb_result==NEBERROR_CALLBACKOVERRIDE){
+ svc->latency=old_latency;
+ my_free(processed_command);
+ my_free(raw_command);
+ return OK;
+ }
+#endif
+
/* open a temp file for storing check output */
old_umask=umask(new_umask);
asprintf(&output_file,"%s/checkXXXXXX",temp_path);
@@ -450,21 +470,10 @@
log_debug_info(DEBUGL_CHECKS|DEBUGL_IPC,1,"Check result output will be written to '%s' (fd=%d)\n",output_file,check_result_info.output_file_fd);
- /* save check info */
- check_result_info.object_check_type=SERVICE_CHECK;
+ /* finish save check info */
check_result_info.host_name=(char *)strdup(svc->host_name);
check_result_info.service_description=(char *)strdup(svc->description);
- check_result_info.check_type=SERVICE_CHECK_ACTIVE;
- check_result_info.check_options=check_options;
- check_result_info.scheduled_check=scheduled_check;
- check_result_info.reschedule_check=reschedule_check;
check_result_info.output_file=(check_result_info.output_file_fd<0 || output_file==NULL)?NULL:strdup(output_file);
- check_result_info.start_time=start_time;
- check_result_info.finish_time=start_time;
- check_result_info.early_timeout=FALSE;
- check_result_info.exited_ok=TRUE;
- check_result_info.return_code=STATE_OK;
- check_result_info.output=NULL;
/* free memory */
my_free(output_file);
@@ -496,11 +505,6 @@
dbuf_init(&checkresult_dbuf,dbuf_chunk);
-#ifdef USE_EVENT_BROKER
- /* send data to event broker */
- broker_service_check(NEBTYPE_SERVICECHECK_INITIATE,NEBFLAG_NONE,NEBATTR_NONE,svc,SERVICE_CH
...[email truncated]...
This post was automatically imported from historical nagios-devel mailing list archives
Original poster: [email protected]
--------------010404070600000700020301
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Hi Ethan,
I realize you're probably still looking over my changes to 3.0 rc1. But
I had to post a patch for rc2 on the dnx-devel list so that people
wanting to play with dnx on nagios 3 could move ahead with rc2.
Since you didn't take the critical portions of my rc1 patch, I assume
you have some issues with it. No doubt, I broke something.
I've attached the rc2 version of my patch (same design). I'll continue
to wait for your comments.
Thanks!
John
--------------010404070600000700020301
Content-Type: text/plain;
name="nagios-3.0rc2-dnx.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
filename="nagios-3.0rc2-dnx.patch"
diff -Naur nagios-3.0rc2/base/checks.c nagios-3.0rc2-patched/base/checks.c
--- nagios-3.0rc2/base/checks.c 2008-01-29 09:05:33.000000000 -0700
+++ nagios-3.0rc2-patched/base/checks.c 2008-01-29 13:01:45.000000000 -0700
@@ -380,12 +380,6 @@
*preferred_time+=(svc->check_interval*interval_length);
return ERROR;
}
-
- /* neb module wants to override (or cancel) the service check - perhaps it will check the service itself */
- /* NOTE: if a module does this, it has to do a lot of the stuff found below to make sure things don't get whacked out of shape! */
- /* NOTE: if would be easier for modules to override checks when the NEBTYPE_SERVICECHECK_INITIATE event is called (later) */
- if(neb_result==NEBERROR_CALLBACKOVERRIDE)
- return OK;
#endif
@@ -435,6 +429,32 @@
/* set the execution flag */
svc->is_executing=TRUE;
+ /* start save check info */
+ check_result_info.object_check_type=SERVICE_CHECK;
+ check_result_info.check_type=SERVICE_CHECK_ACTIVE;
+ check_result_info.check_options=check_options;
+ check_result_info.scheduled_check=scheduled_check;
+ check_result_info.reschedule_check=reschedule_check;
+ check_result_info.start_time=start_time;
+ check_result_info.finish_time=start_time;
+ check_result_info.early_timeout=FALSE;
+ check_result_info.exited_ok=TRUE;
+ check_result_info.return_code=STATE_OK;
+ check_result_info.output=NULL;
+
+#ifdef USE_EVENT_BROKER
+ /* send data to event broker */
+ neb_result=broker_service_check(NEBTYPE_SERVICECHECK_INITIATE,NEBFLAG_NONE,NEBATTR_NONE,svc,SERVICE_CHECK_ACTIVE,start_time,end_time,svc->service_check_command,svc->latency,0.0,service_check_timeout,FALSE,0,processed_command,NULL);
+
+ /* neb module wants to override the service check - perhaps it will check the service itself */
+ if(neb_result==NEBERROR_CALLBACKOVERRIDE){
+ svc->latency=old_latency;
+ my_free(processed_command);
+ my_free(raw_command);
+ return OK;
+ }
+#endif
+
/* open a temp file for storing check output */
old_umask=umask(new_umask);
asprintf(&output_file,"%s/checkXXXXXX",temp_path);
@@ -450,21 +470,10 @@
log_debug_info(DEBUGL_CHECKS|DEBUGL_IPC,1,"Check result output will be written to '%s' (fd=%d)\n",output_file,check_result_info.output_file_fd);
- /* save check info */
- check_result_info.object_check_type=SERVICE_CHECK;
+ /* finish save check info */
check_result_info.host_name=(char *)strdup(svc->host_name);
check_result_info.service_description=(char *)strdup(svc->description);
- check_result_info.check_type=SERVICE_CHECK_ACTIVE;
- check_result_info.check_options=check_options;
- check_result_info.scheduled_check=scheduled_check;
- check_result_info.reschedule_check=reschedule_check;
check_result_info.output_file=(check_result_info.output_file_fd<0 || output_file==NULL)?NULL:strdup(output_file);
- check_result_info.start_time=start_time;
- check_result_info.finish_time=start_time;
- check_result_info.early_timeout=FALSE;
- check_result_info.exited_ok=TRUE;
- check_result_info.return_code=STATE_OK;
- check_result_info.output=NULL;
/* free memory */
my_free(output_file);
@@ -496,11 +505,6 @@
dbuf_init(&checkresult_dbuf,dbuf_chunk);
-#ifdef USE_EVENT_BROKER
- /* send data to event broker */
- broker_service_check(NEBTYPE_SERVICECHECK_INITIATE,NEBFLAG_NONE,NEBATTR_NONE,svc,SERVICE_CH
...[email truncated]...
This post was automatically imported from historical nagios-devel mailing list archives
Original poster: [email protected]