[PATCH 1/2] base/commands: Don't forget output in passive host checks

robin.sonefors at op5.com robin.sonefors at op5.com
Mon Nov 12 15:33:39 CET 2012


From: Robin Sonefors <robin.sonefors at op5.com>

The passive host checks weren't assigning several of the variables that
it was supposed to, including output. As the output is quite interesting
in nagios checks, we should put that back in there.

While I'm at it, reorder and sync the assignments in passive host check
result with those in the passive service check result, so it's easier to
see if they're similar enough or not. This also makes it clear that we
were missing source and engine assignments.

Signed-off-by: Robin Sonefors <robin.sonefors at op5.com>
---
 base/commands.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/base/commands.c b/base/commands.c
index 99ec72f..b7b8ff4 100644
--- a/base/commands.c
+++ b/base/commands.c
@@ -2307,11 +2307,14 @@ int process_passive_host_check(time_t check_time, char *host_name, int return_co
 		return ERROR;
 
 	memset(&cr, 0, sizeof(cr));
-	cr.host_name = temp_host->name;
 	cr.exited_ok = 1;
 	cr.check_type = CHECK_TYPE_PASSIVE;
-	cr.return_code = return_code;
+	cr.host_name = temp_host->name;
+	cr.output = output;
 	cr.start_time.tv_sec = cr.finish_time.tv_sec = check_time;
+	cr.engine = &nagios_check_engine;
+	cr.source = command_wproc;
+	cr.return_code = return_code;
 
 	/* calculate latency */
 	gettimeofday(&tv, NULL);
-- 
1.7.11.7


------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_nov




More information about the Developers mailing list