Closed tomaszdubiel18 closed 1 year ago
This problem makes naemon's log grow very quickly. Can you look at this? Is this bug or some configuration issue?
Hello.
Bump
Is this bug or some configuration issue?
That's probably a bug because Naemon is logging the external command first, but flagging it as NSLOG_PASSIVE_CHECK
:
https://github.com/naemon/naemon-core/blob/f62b741eec55012197ddebbd31c6ecda96abc479/src/naemon/commands.c#L3395-L3399
This will write
EXTERNAL COMMAND: PROCESS_SERVICE_CHECK_RESULT;hplj2605dn;PING;0;This is an example plugin output.
to the naemon.log.
Later in the process, Naemon will log the actual processing of the passive check result: https://github.com/naemon/naemon-core/blob/f62b741eec55012197ddebbd31c6ecda96abc479/src/naemon/checks_service.c#L578 This is the
PASSIVE SERVICE CHECK: hplj2605dn;PING;0;This is an example plugin output.
message.
PS: Your spamy bump comments are annoying.
I bump, because it causes significant difference in log files in my environment and if it was my configuration error, I would be grateful to stress where the error is. Thank you for confirming a bug. Now I will patiently wait for the fix.
if you don't what those logs, why don't you set log_passive_checks=0
?
I want those logs, but I get the same twice.
for example:
[1651743734] EXTERNAL COMMAND: PROCESS_SERVICE_CHECK_RESULT;
and THE SAME:
[1651743734] PASSIVE SERVICE CHECK:
I get the same info, first as external command: process_service_check_result and then, as passive service check. @nook24 explained that.
I remind I have set: log_external_commands=0 but still external_commands are written to log
I'd suggest to set:
log_external_commands=1
log_passive_checks=0
There is usually no need to log each passive result comming in. But logging external commands is usually a good idea.
I can try this and probably duplicates will disappear, but still I think that's a bug. Thanks.
No, that's not a solution. With those settings Naemon doesn't write to log any info about result checks. I want to check service history and no data! I returned to original settings.
Do you parse the log file to get history information instead of using a database for this?
Here you can see, since 12:12:03 there was no logs in service history. I reverted settings, restarted naemon and results from 12:28:04 got logged. That's a Thruk and I could get rid of those dupplicates by: logcache_import_exclude = "EXTERNAL COMMAND: PROCESS_SERVICE_CHECK_RESULT" but anyway, log gets bigger and bigger with those dupplicates. @nook24, no. I use database for this.
In logfile then, I had only warnings logged about external commands, but the actual results were missing.
As mentioned in my comment above https://github.com/naemon/naemon-core/issues/377#issuecomment-1029361547, for some reason Naemon is logging the external command as NSLOG_PASSIVE_CHECK
when it get's passed via naemon.cmd and naemon.qh.
Maybe @sni can bring some light in the dark why it is done this way.
But according to git blame this is the way it works for more than 21 years now https://github.com/naemon/naemon-core/blame/7e61a03ca1c46ee8ded5704fe083317400fa1232/base/commands.c#L515-L531
Man i feel old now.
how should i know why something happened 21 years ago. Don't even know what i did last week. Anyway, changing
line 3398 to something like
if (log_passive_checks == TRUE && log_external_commands == TRUE)
should do the trick.
Hello. Although I have set: log_external_commands=0 log_passive_checks=1 Naemon still writes to log: EXTERNAL COMMAND: PROCESS_SERVICE_CHECK_RESULT................. PASSIVE SERVICE CHECK I want only passive service checks to be logged, not external command. Naemon 1.3.0. Debian 10.11