Page 1 of 1

[Nagios-devel] [PATCH 1/2] base/commands: Don't forget output in

Posted: Mon Nov 12, 2012 2:34 pm
by Guest
From: Robin Sonefors

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
---
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






This post was automatically imported from historical nagios-devel mailing list archives
Original poster: [email protected]