[PATCH 1/2] checks: Change service check state when there's a timeout

Robin Sonefors robin.sonefors at op5.com
Fri Sep 13 13:07:28 CEST 2013


When a service times out, it's supposed to set its check output to
service_check_timeout_state. This does just that.

Signed-off-by: Robin Sonefors <robin.sonefors at op5.com>
---
 base/checks.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/base/checks.c b/base/checks.c
index 84a31c8..04cd3ec 100644
--- a/base/checks.c
+++ b/base/checks.c
@@ -418,6 +418,7 @@ int handle_async_service_check_result(service *temp_service, check_result *queue
 	if(queued_check_result->early_timeout == TRUE) {
 		logit(NSLOG_RUNTIME_WARNING, TRUE, "Warning: Check of service '%s' on host '%s' timed out after %.3fs!\n", temp_service->description, temp_service->host_name, temp_service->execution_time);
 		asprintf(&temp_service->plugin_output, "(Service check timed out after %.2lf seconds)\n", temp_service->execution_time);
+		temp_service->current_state = service_check_timeout_state;
 		}
 	/* if there was some error running the command, just skip it (this shouldn't be happening) */
 	else if(queued_check_result->exited_ok == FALSE) {
-- 
1.8.3.1


------------------------------------------------------------------------------
How ServiceNow helps IT people transform IT departments:
1. Consolidate legacy IT systems to a single system of record for IT
2. Standardize and globalize service processes across IT
3. Implement zero-touch automation to replace manual, redundant tasks
http://pubads.g.doubleclick.net/gampad/clk?id=51271111&iu=/4140/ostg.clktrk




More information about the Developers mailing list