Search
j0ke.net Open Build Service
>
Projects
>
server:monitoring
>
icinga110
> icinga-core.git-66557d4cb65018b7a7d2aff0c47f866a90ad273e.txt
Sign Up
|
Log In
Username
Password
Cancel
Overview
Repositories
Revisions
Requests
Users
Advanced
Attributes
Meta
File icinga-core.git-66557d4cb65018b7a7d2aff0c47f866a90ad273e.txt of Package icinga110 (Revision 2)
Currently displaying revision
2
,
show latest
From: Michael Friedrich <Michael.Friedrich@netways.de> Date: Thu, 26 Sep 2013 19:53:03 +0000 (+0200) Subject: core: add check result source X-Git-Tag: v1.10.0-beta~38 X-Git-Url: https://git.icinga.org/?p=icinga-core.git;a=commitdiff_plain;h=66557d4cb65018b7a7d2aff0c47f866a90ad273e;hp=ec6c94e4dae5cc07da69fd068687c5e6807b0016 core: add check result source refs #4709 --- diff --git a/base/broker.c b/base/broker.c index d0408e4..b7d84f5 100644 --- a/base/broker.c +++ b/base/broker.c @@ -241,7 +241,7 @@ int broker_event_handler(int type, int flags, int attr, int eventhandler_type, v /* send host check data to broker */ -int broker_host_check(int type, int flags, int attr, host *hst, int check_type, int state, int state_type, struct timeval start_time, struct timeval end_time, char *cmd, double latency, double exectime, int timeout, int early_timeout, int retcode, char *cmdline, char *output, char *long_output, char *perfdata, struct timeval *timestamp) { +int broker_host_check(int type, int flags, int attr, host *hst, int check_type, int state, int state_type, struct timeval start_time, struct timeval end_time, char *cmd, double latency, double exectime, int timeout, int early_timeout, int retcode, char *cmdline, char *output, char *long_output, char *perfdata, struct timeval *timestamp, char *check_source) { char *command_buf = NULL; char *command_name = NULL; char *command_args = NULL; @@ -300,7 +300,7 @@ int broker_host_check(int type, int flags, int attr, host *hst, int check_type, /* send service check data to broker */ -int broker_service_check(int type, int flags, int attr, service *svc, int check_type, struct timeval start_time, struct timeval end_time, char *cmd, double latency, double exectime, int timeout, int early_timeout, int retcode, char *cmdline, struct timeval *timestamp) { +int broker_service_check(int type, int flags, int attr, service *svc, int check_type, struct timeval start_time, struct timeval end_time, char *cmd, double latency, double exectime, int timeout, int early_timeout, int retcode, char *cmdline, struct timeval *timestamp, char *check_source) { char *command_buf = NULL; char *command_name = NULL; char *command_args = NULL; diff --git a/base/checks.c b/base/checks.c index 16d1cd7..b092e81 100644 --- a/base/checks.c +++ b/base/checks.c @@ -541,7 +541,7 @@ int run_async_service_check(service *svc, int check_options, double latency, int end_time.tv_usec = 0L; /* send data to event broker */ - neb_result = broker_service_check(NEBTYPE_SERVICECHECK_ASYNC_PRECHECK, NEBFLAG_NONE, NEBATTR_NONE, svc, SERVICE_CHECK_ACTIVE, start_time, end_time, svc->service_check_command, svc->latency, 0.0, 0, FALSE, 0, NULL, NULL); + neb_result = broker_service_check(NEBTYPE_SERVICECHECK_ASYNC_PRECHECK, NEBFLAG_NONE, NEBATTR_NONE, svc, SERVICE_CHECK_ACTIVE, start_time, end_time, svc->service_check_command, svc->latency, 0.0, 0, FALSE, 0, NULL, NULL, NULL); if (neb_result == NEBERROR_CALLBACKCANCEL || neb_result == NEBERROR_CALLBACKOVERRIDE) { log_debug_info(DEBUGL_CHECKS, 0, "Check of service '%s' on host '%s' was %s by a module\n", @@ -610,7 +610,7 @@ int run_async_service_check(service *svc, int check_options, double latency, int #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_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, NULL); my_free(svc->processed_command); svc->processed_command = strdup(processed_command); @@ -1194,6 +1194,7 @@ int handle_async_service_check_result(service *temp_service, check_result *queue log_debug_info(DEBUGL_CHECKS, 2, "Short Output: %s\n", (temp_service->plugin_output == NULL) ? "NULL" : temp_service->plugin_output); log_debug_info(DEBUGL_CHECKS, 2, "Long Output: %s\n", (temp_service->long_plugin_output == NULL) ? "NULL" : temp_service->long_plugin_output); log_debug_info(DEBUGL_CHECKS, 2, "Perf Data: %s\n", (temp_service->perf_data == NULL) ? "NULL" : temp_service->perf_data); + log_debug_info(DEBUGL_CHECKS, 2, "Check Source: %s\n", (queued_check_result->source == NULL) ? "NULL" : queued_check_result->source); /* grab the return code */ temp_service->current_state = queued_check_result->return_code; @@ -1817,9 +1818,15 @@ int handle_async_service_check_result(service *temp_service, check_result *queue } } + /* set check source */ + if (queued_check_result->source != NULL) + temp_service->check_source = (char *)strdup(queued_check_result->source); + else + temp_service->check_source = (char *)strdup("(local)"); + #ifdef USE_EVENT_BROKER /* send data to event broker */ - broker_service_check(NEBTYPE_SERVICECHECK_PROCESSED, NEBFLAG_NONE, NEBATTR_NONE, temp_service, temp_service->check_type, queued_check_result->start_time, queued_check_result->finish_time, temp_service->service_check_command, temp_service->latency, temp_service->execution_time, service_check_timeout, queued_check_result->early_timeout, queued_check_result->return_code, temp_service->processed_command, NULL); + broker_service_check(NEBTYPE_SERVICECHECK_PROCESSED, NEBFLAG_NONE, NEBATTR_NONE, temp_service, temp_service->check_type, queued_check_result->start_time, queued_check_result->finish_time, temp_service->service_check_command, temp_service->latency, temp_service->execution_time, service_check_timeout, queued_check_result->early_timeout, queued_check_result->return_code, temp_service->processed_command, NULL, temp_service->check_source); #endif /* set the checked flag */ @@ -2848,7 +2855,7 @@ int run_sync_host_check_3x(host *hst, int *check_result_code, int check_options, /* send data to event broker */ end_time.tv_sec = 0L; end_time.tv_usec = 0L; - broker_host_check(NEBTYPE_HOSTCHECK_INITIATE, NEBFLAG_NONE, NEBATTR_NONE, hst, HOST_CHECK_ACTIVE, hst->current_state, hst->state_type, start_time, end_time, hst->host_check_command, hst->latency, 0.0, host_check_timeout, FALSE, 0, NULL, NULL, NULL, NULL, NULL); + broker_host_check(NEBTYPE_HOSTCHECK_INITIATE, NEBFLAG_NONE, NEBATTR_NONE, hst, HOST_CHECK_ACTIVE, hst->current_state, hst->state_type, start_time, end_time, hst->host_check_command, hst->latency, 0.0, host_check_timeout, FALSE, 0, NULL, NULL, NULL, NULL, NULL, NULL); #endif /* execute the host check */ @@ -2867,7 +2874,7 @@ int run_sync_host_check_3x(host *hst, int *check_result_code, int check_options, #ifdef USE_EVENT_BROKER /* send data to event broker */ - broker_host_check(NEBTYPE_HOSTCHECK_PROCESSED, NEBFLAG_NONE, NEBATTR_NONE, hst, HOST_CHECK_ACTIVE, hst->current_state, hst->state_type, start_time, end_time, hst->host_check_command, hst->latency, hst->execution_time, host_check_timeout, FALSE, hst->current_state, hst->processed_command, hst->plugin_output, hst->long_plugin_output, hst->perf_data, NULL); + broker_host_check(NEBTYPE_HOSTCHECK_PROCESSED, NEBFLAG_NONE, NEBATTR_NONE, hst, HOST_CHECK_ACTIVE, hst->current_state, hst->state_type, start_time, end_time, hst->host_check_command, hst->latency, hst->execution_time, host_check_timeout, FALSE, hst->current_state, hst->processed_command, hst->plugin_output, hst->long_plugin_output, hst->perf_data, NULL, hst->check_source); #endif return result; @@ -2909,7 +2916,7 @@ int execute_sync_host_check_3x(host *hst) { end_time.tv_usec = 0L; /* send data to event broker */ - neb_result = broker_host_check(NEBTYPE_HOSTCHECK_SYNC_PRECHECK, NEBFLAG_NONE, NEBATTR_NONE, hst, HOST_CHECK_ACTIVE, hst->current_state, hst->state_type, start_time, end_time, hst->host_check_command, hst->latency, 0.0, host_check_timeout, FALSE, 0, NULL, NULL, NULL, NULL, NULL); + neb_result = broker_host_check(NEBTYPE_HOSTCHECK_SYNC_PRECHECK, NEBFLAG_NONE, NEBATTR_NONE, hst, HOST_CHECK_ACTIVE, hst->current_state, hst->state_type, start_time, end_time, hst->host_check_command, hst->latency, 0.0, host_check_timeout, FALSE, 0, NULL, NULL, NULL, NULL, NULL, NULL); /* * neb module wants to cancel/override the host check @@ -2959,11 +2966,11 @@ int execute_sync_host_check_3x(host *hst) { /* send data to event broker */ end_time.tv_sec = 0L; end_time.tv_usec = 0L; - broker_host_check(NEBTYPE_HOSTCHECK_RAW_START, NEBFLAG_NONE, NEBATTR_NONE, hst, HOST_CHECK_ACTIVE, return_result, hst->state_type, start_time, end_time, hst->host_check_command, 0.0, 0.0, host_check_timeout, early_timeout, result, processed_command, hst->plugin_output, hst->long_plugin_output, hst->perf_data, NULL); + broker_host_check(NEBTYPE_HOSTCHECK_RAW_START, NEBFLAG_NONE, NEBATTR_NONE, hst, HOST_CHECK_ACTIVE, return_result, hst->state_type, start_time, end_time, hst->host_check_command, 0.0, 0.0, host_check_timeout, early_timeout, result, processed_command, hst->plugin_output, hst->long_plugin_output, hst->perf_data, NULL, NULL); #endif log_debug_info(DEBUGL_COMMANDS, 1, "Raw host check command: %s\n", raw_command); - log_debug_info(DEBUGL_COMMANDS, 0, "Processed host check ommand: %s\n", processed_command); + log_debug_info(DEBUGL_COMMANDS, 0, "Processed host check command: %s\n", processed_command); my_free(raw_command); /* clear plugin output and performance data buffers */ @@ -3030,9 +3037,12 @@ int execute_sync_host_check_3x(host *hst) { /* high resolution end time for event broker */ gettimeofday(&end_time, NULL); + /* set check source */ + hst->check_source = (char *)strdup("(local)"); + #ifdef USE_EVENT_BROKER /* send data to event broker */ - broker_host_check(NEBTYPE_HOSTCHECK_RAW_END, NEBFLAG_NONE, NEBATTR_NONE, hst, HOST_CHECK_ACTIVE, return_result, hst->state_type, start_time, end_time, hst->host_check_command, 0.0, exectime, host_check_timeout, early_timeout, result, processed_command, hst->plugin_output, hst->long_plugin_output, hst->perf_data, NULL); + broker_host_check(NEBTYPE_HOSTCHECK_RAW_END, NEBFLAG_NONE, NEBATTR_NONE, hst, HOST_CHECK_ACTIVE, return_result, hst->state_type, start_time, end_time, hst->host_check_command, 0.0, exectime, host_check_timeout, early_timeout, result, processed_command, hst->plugin_output, hst->long_plugin_output, hst->perf_data, NULL, hst->check_source); #endif log_debug_info(DEBUGL_CHECKS, 0, "** Sync host check done: state=%d\n", return_result); @@ -3177,7 +3187,7 @@ int run_async_host_check_3x(host *hst, int check_options, double latency, int sc end_time.tv_usec = 0L; /* send data to event broker */ - neb_result = broker_host_check(NEBTYPE_HOSTCHECK_ASYNC_PRECHECK, NEBFLAG_NONE, NEBATTR_NONE, hst, HOST_CHECK_ACTIVE, hst->current_state, hst->state_type, start_time, end_time, hst->host_check_command, hst->latency, 0.0, host_check_timeout, FALSE, 0, NULL, NULL, NULL, NULL, NULL); + neb_result = broker_host_check(NEBTYPE_HOSTCHECK_ASYNC_PRECHECK, NEBFLAG_NONE, NEBATTR_NONE, hst, HOST_CHECK_ACTIVE, hst->current_state, hst->state_type, start_time, end_time, hst->host_check_command, hst->latency, 0.0, host_check_timeout, FALSE, 0, NULL, NULL, NULL, NULL, NULL, NULL); /* neb module wants to cancel the host check - the check will be rescheduled for a later time by the scheduling logic */ if (neb_result == NEBERROR_CALLBACKCANCEL) @@ -3299,7 +3309,7 @@ int run_async_host_check_3x(host *hst, int check_options, double latency, int sc #ifdef USE_EVENT_BROKER /* send data to event broker */ - broker_host_check(NEBTYPE_HOSTCHECK_INITIATE, NEBFLAG_NONE, NEBATTR_NONE, hst, HOST_CHECK_ACTIVE, hst->current_state, hst->state_type, start_time, end_time, hst->host_check_command, hst->latency, 0.0, host_check_timeout, FALSE, 0, processed_command, NULL, NULL, NULL, NULL); + broker_host_check(NEBTYPE_HOSTCHECK_INITIATE, NEBFLAG_NONE, NEBATTR_NONE, hst, HOST_CHECK_ACTIVE, hst->current_state, hst->state_type, start_time, end_time, hst->host_check_command, hst->latency, 0.0, host_check_timeout, FALSE, 0, processed_command, NULL, NULL, NULL, NULL, NULL); #endif /* reset latency (permanent value for this check will get set later) */ @@ -3497,6 +3507,7 @@ int handle_async_host_check_result_3x(host *temp_host, check_result *queued_chec log_debug_info(DEBUGL_CHECKS, 2, "\tLatency: %.3f\n", temp_host->latency); log_debug_info(DEBUGL_CHECKS, 2, "\tReturn Status: %d\n", queued_check_result->return_code); log_debug_info(DEBUGL_CHECKS, 2, "\tOutput: %s\n", (queued_check_result == NULL) ? "NULL" : queued_check_result->output); + log_debug_info(DEBUGL_CHECKS, 2, "\tSource: %s\n", (queued_check_result == NULL) ? "NULL" : queued_check_result->source); /* decrement the number of host checks still out there... */ if (queued_check_result->check_type == HOST_CHECK_ACTIVE && currently_running_host_checks > 0) @@ -3652,6 +3663,11 @@ int handle_async_host_check_result_3x(host *temp_host, check_result *queued_chec result = HOST_DOWN; } + /* set check source */ + if (queued_check_result->source != NULL) + temp_host->check_source = (char *)strdup(queued_check_result->source); + else + temp_host->check_source = (char *)strdup("(local)"); /******************* PROCESS THE CHECK RESULTS ******************/ @@ -3671,7 +3687,7 @@ int handle_async_host_check_result_3x(host *temp_host, check_result *queued_chec #ifdef USE_EVENT_BROKER /* send data to event broker */ - broker_host_check(NEBTYPE_HOSTCHECK_PROCESSED, NEBFLAG_NONE, NEBATTR_NONE, temp_host, temp_host->check_type, temp_host->current_state, temp_host->state_type, start_time_hires, end_time_hires, temp_host->host_check_command, temp_host->latency, temp_host->execution_time, host_check_timeout, queued_check_result->early_timeout, queued_check_result->return_code, temp_host->processed_command, temp_host->plugin_output, temp_host->long_plugin_output, temp_host->perf_data, NULL); + broker_host_check(NEBTYPE_HOSTCHECK_PROCESSED, NEBFLAG_NONE, NEBATTR_NONE, temp_host, temp_host->check_type, temp_host->current_state, temp_host->state_type, start_time_hires, end_time_hires, temp_host->host_check_command, temp_host->latency, temp_host->execution_time, host_check_timeout, queued_check_result->early_timeout, queued_check_result->return_code, temp_host->processed_command, temp_host->plugin_output, temp_host->long_plugin_output, temp_host->perf_data, NULL, temp_host->check_source); #endif return OK; diff --git a/base/utils.c b/base/utils.c index 6a34123..29d28a7 100644 --- a/base/utils.c +++ b/base/utils.c @@ -2933,6 +2933,8 @@ int process_check_result_file(char *fname) { new_cr->return_code = atoi(val); else if (!strcmp(var, "output")) new_cr->output = (char *)strdup(val); + else if (!strcmp(var, "source")) + new_cr->source = (char *)strdup(val); } } @@ -3029,6 +3031,7 @@ int init_check_result(check_result *info) { info->exited_ok = TRUE; info->return_code = 0; info->output = NULL; + info->source = NULL; info->next = NULL; return OK; diff --git a/cgi/extinfo.c b/cgi/extinfo.c index 6e0054b..48fc917 100644 --- a/cgi/extinfo.c +++ b/cgi/extinfo.c @@ -1558,6 +1558,13 @@ void show_host_info(void) { else printf("<tr><td class='dataVar'>Check Type:</td><td class='dataVal'>DISABLED</td></tr>\n"); + printf("<tr><td class='dataVar' nowrap>Check Source:</td><td class='dataVal'>"); + if (temp_hoststatus->check_source != NULL) + printf("%s", temp_hoststatus->check_source); + else + printf("N/A"); + printf("</td></tr>\n"); + printf("<tr><td class='dataVar' nowrap>Check Latency / Duration:</td><td class='dataVal'>"); if (temp_hoststatus->checks_enabled == TRUE) printf("%.3f", temp_hoststatus->latency); @@ -2020,6 +2027,13 @@ void show_service_info(void) { else printf("<tr><td class='dataVar'>Check Type:</td><td class='dataVal'>DISABLED</td></tr>\n"); + printf("<tr><td class='dataVar' nowrap>Check Source:</td><td class='dataVal'>"); + if (temp_svcstatus->check_source != NULL) + printf("%s", temp_svcstatus->check_source); + else + printf("N/A"); + printf("</td></tr>\n"); + printf("<tr><td class='dataVar' nowrap>Check Latency / Duration:</td><td class='dataVal'>"); if (temp_svcstatus->checks_enabled == TRUE) printf("%.3f", temp_svcstatus->latency); diff --git a/common/objects.c b/common/objects.c index 3bb52bf..cb1bda2 100644 --- a/common/objects.c +++ b/common/objects.c @@ -848,6 +848,7 @@ host *add_host(char *name, char *display_name, char *alias, char *address, char my_free(new_host->plugin_output); my_free(new_host->long_plugin_output); my_free(new_host->perf_data); + my_free(new_host->check_source); #endif my_free(new_host->statusmap_image); my_free(new_host->vrml_image); @@ -1765,6 +1766,7 @@ service *add_service(char *host_name, char *description, char *display_name, cha my_free(new_service->perf_data); my_free(new_service->plugin_output); my_free(new_service->long_plugin_output); + my_free(new_service->check_source); #endif my_free(new_service->failure_prediction_options); my_free(new_service->notification_period); @@ -3487,6 +3489,7 @@ int free_object_data(void) { my_free(this_host->long_plugin_output); my_free(this_host->perf_data); my_free(this_host->processed_command); + my_free(this_host->check_source); free_objectlist(&this_host->hostgroups_ptr); #endif @@ -3688,6 +3691,7 @@ int free_object_data(void) { my_free(this_service->long_plugin_output); my_free(this_service->perf_data); my_free(this_service->processed_command); + my_free(this_service->check_source); my_free(this_service->event_handler_args); my_free(this_service->check_command_args); diff --git a/common/statusdata.c b/common/statusdata.c index 70334d5..9659de3 100644 --- a/common/statusdata.c +++ b/common/statusdata.c @@ -472,6 +472,7 @@ void free_status_data(void) { my_free(this_hoststatus->plugin_output); my_free(this_hoststatus->long_plugin_output); my_free(this_hoststatus->perf_data); + my_free(this_hoststatus->check_source); my_free(this_hoststatus); } @@ -483,6 +484,7 @@ void free_status_data(void) { my_free(this_svcstatus->plugin_output); my_free(this_svcstatus->long_plugin_output); my_free(this_svcstatus->perf_data); + my_free(this_svcstatus->check_source); my_free(this_svcstatus); } diff --git a/include/broker.h b/include/broker.h index 1fe29ad..7af32a4 100644 --- a/include/broker.h +++ b/include/broker.h @@ -193,8 +193,8 @@ void broker_log_data(int,int,int,char *,unsigned long,time_t,struct timeval *); int broker_event_handler(int,int,int,int,void *,int,int,struct timeval,struct timeval,double,int,int,int,char *,char *,char *,struct timeval *); void broker_ocp_data(int,int,int,void *,int,int,double,int,int,struct timeval *); void broker_system_command(int,int,int,struct timeval,struct timeval,double,int,int,int,char *,char *,struct timeval *); -int broker_host_check(int,int,int,host *,int,int,int,struct timeval,struct timeval,char *,double,double,int,int,int,char *,char *,char *,char *,struct timeval *); -int broker_service_check(int,int,int,service *,int,struct timeval,struct timeval,char *,double,double,int,int,int,char *,struct timeval *); +int broker_host_check(int,int,int,host *,int,int,int,struct timeval,struct timeval,char *,double,double,int,int,int,char *,char *,char *,char *,struct timeval *, char *); +int broker_service_check(int,int,int,service *,int,struct timeval,struct timeval,char *,double,double,int,int,int,char *,struct timeval *, char*); void broker_comment_data(int,int,int,int,int,char *,char *,time_t,char *,char *,int,int,int,time_t,unsigned long,struct timeval *); void broker_downtime_data(int,int,int,int,char *,char *,time_t,char *,char *,time_t,time_t,int,unsigned long,unsigned long,unsigned long,struct timeval *,int,time_t); void broker_flapping_data(int,int,int,int,void *,double,double,double,struct timeval *); diff --git a/include/icinga.h b/include/icinga.h index 40253ab..dba8d76 100644 --- a/include/icinga.h +++ b/include/icinga.h @@ -331,6 +331,7 @@ typedef struct check_result_struct{ int return_code; /* plugin return code */ char *output; /* plugin output */ struct check_result_struct *next; + char *source; }check_result; @@ -371,6 +372,7 @@ typedef struct passive_check_result_struct{ time_t check_time; double latency; struct passive_check_result_struct *next; + char *source; }passive_check_result; diff --git a/include/objects.h b/include/objects.h index 88da85c..6bfe2ad 100644 --- a/include/objects.h +++ b/include/objects.h @@ -421,6 +421,7 @@ struct host_struct{ $HOSTADDRESS6$ macro */ char *address6; time_t acknowledgement_end_time; + char *check_source; #ifdef NSCORE int current_down_notification_number; int current_unreachable_notification_number; @@ -565,6 +566,7 @@ struct service_struct{ PROCESSED state on host|service checks */ char *processed_command; time_t acknowledgement_end_time; + char *check_source; #ifdef NSCORE int current_warning_notification_number; int current_critical_notification_number; diff --git a/include/statusdata.h b/include/statusdata.h index 67e9452..890ad2a 100644 --- a/include/statusdata.h +++ b/include/statusdata.h @@ -106,6 +106,7 @@ typedef struct hoststatus_struct{ * we'll use compiler tricks again, putting this at the end, * invisible, in order to stay compatible with neb modules */ + char *check_source; int current_down_notification_number; int current_unreachable_notification_number; }hoststatus; @@ -165,6 +166,7 @@ typedef struct servicestatus_struct{ * we'll use compiler tricks again, putting this at the end, * invisible, in order to stay compatible with neb modules */ + char *check_source; int current_warning_notification_number; int current_critical_notification_number; int current_unknown_notification_number; diff --git a/xdata/xsddefault.c b/xdata/xsddefault.c index ecc507f..5d1c32d 100644 --- a/xdata/xsddefault.c +++ b/xdata/xsddefault.c @@ -444,6 +444,7 @@ int xsddefault_save_status_data(void) { fprintf(fp, "\tplugin_output=%s\n", (temp_host->plugin_output == NULL) ? "" : temp_host->plugin_output); fprintf(fp, "\tlong_plugin_output=%s\n", (temp_host->long_plugin_output == NULL) ? "" : temp_host->long_plugin_output); fprintf(fp, "\tperformance_data=%s\n", (temp_host->perf_data == NULL) ? "" : temp_host->perf_data); + fprintf(fp, "\tcheck_source=%s\n", (temp_host->check_source == NULL) ? "" : temp_host->check_source); fprintf(fp, "\tlast_check=%lu\n", temp_host->last_check); fprintf(fp, "\tnext_check=%lu\n", temp_host->next_check); fprintf(fp, "\tcheck_options=%d\n", temp_host->check_options); @@ -531,6 +532,7 @@ int xsddefault_save_status_data(void) { fprintf(fp, "\tplugin_output=%s\n", (temp_service->plugin_output == NULL) ? "" : temp_service->plugin_output); fprintf(fp, "\tlong_plugin_output=%s\n", (temp_service->long_plugin_output == NULL) ? "" : temp_service->long_plugin_output); fprintf(fp, "\tperformance_data=%s\n", (temp_service->perf_data == NULL) ? "" : temp_service->perf_data); + fprintf(fp, "\tcheck_source=%s\n", (temp_service->check_source == NULL) ? "" : temp_service->check_source); fprintf(fp, "\tlast_check=%lu\n", temp_service->last_check); fprintf(fp, "\tnext_check=%lu\n", temp_service->next_check); fprintf(fp, "\tcheck_options=%d\n", temp_service->check_options); @@ -1024,6 +1026,8 @@ int xsddefault_read_status_data(char *config_file, int options) { unescape_newlines(temp_hoststatus->long_plugin_output); } else if (!strcmp(var, "performance_data")) temp_hoststatus->perf_data = (char *)strdup(val); + else if (!strcmp(var, "check_source")) + temp_hoststatus->check_source = (char *)strdup(val); else if (!strcmp(var, "current_attempt")) temp_hoststatus->current_attempt = atoi(val); else if (!strcmp(var, "max_attempts")) @@ -1152,6 +1156,8 @@ int xsddefault_read_status_data(char *config_file, int options) { unescape_newlines(temp_servicestatus->long_plugin_output); } else if (!strcmp(var, "performance_data")) temp_servicestatus->perf_data = (char *)strdup(val); + else if (!strcmp(var, "check_source")) + temp_servicestatus->check_source = (char *)strdup(val); else if (!strcmp(var, "last_check")) temp_servicestatus->last_check = strtoul(val, NULL, 10); else if (!strcmp(var, "next_check"))