Appending Acknowledgement to system logging

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
edimusrex
Posts: 2
Joined: Mon Jun 23, 2014 11:32 am

Appending Acknowledgement to system logging

Post by edimusrex »

I am using nagios core 4.3.2 to monitor many servers and services and rely on it daily. As of right now all services get written to the system log (currently CentOS 6.9) and sys admins get notified when services are failing. However, services that have been acknowledged still write to the system log and so I am constantly being notified by services that I have already acknowledged. Is there a way to add ACKNOWLEDGED to the log entry so that I may filter there out via logcheck? Here is an example of the current log entry:

Aug 16 00:00:00 nagios[4711]: CURRENT SERVICE STATE: ;Apache Servers;CRITICAL;HARD;4;CRITICAL - Socket timeout

And what I would like to accomplish is:

Aug 16 00:00:00 nagios[4711]: CURRENT SERVICE STATE: ACKNOWLEDGED; Apache Servers;CRITICAL;HARD;4;CRITICAL - Socket timeout

or something similar. Thanks in advance.
dwhitfield
Former Nagios Staff
Posts: 4583
Joined: Wed Sep 21, 2016 10:29 am
Location: NoLo, Minneapolis, MN
Contact:

Re: Appending Acknowledgement to system logging

Post by dwhitfield »

It's not exactly clear what you are doing and what you want to happen, but if you want things to go to nagios.log and not the system log, the following directive should suffice:

Format: use_syslog=<0/1>
Example: use_syslog=1

This variable determines whether messages are logged to the syslog facility on your local host. Values are as follows:

0 = Don't use syslog facility
1 = Use syslog facility
edimusrex
Posts: 2
Joined: Mon Jun 23, 2014 11:32 am

Re: Appending Acknowledgement to system logging

Post by edimusrex »

yea, I am aware of that option, however I like my servers to notify of all events the write to the system log. Since nagios seems to like to write any warnings (even when marked as acknowledged) to the system log my inbox gets flooded with these warnings I am already aware of. If I could append Acknowledged to the log entry I could filter them out using logcheck. Does that make it clearer?

Thanks
dwasswa

Re: Appending Acknowledgement to system logging

Post by dwasswa »

Just to be sure that your going through the right process...I did i a test on notifications and acknowledgements on my core....please follow the below
and don't mind the Nagios Core UI am using,everything is the same..am just using a template from nagios exchange.

This is a critical service and circled in red is the acknowledge link...
This is a critical service and circled in red is the acknowledge link...
Acknowledge problem from here
Acknowledge problem from here
ack2.png (6.8 KiB) Viewed 2264 times
The are the system/nagios logs
The are the system/nagios logs
After acknowledging you should stop receiving notifications and there should be a log saying acknowledged........ Look at the last image above.
dwasswa

Re: Appending Acknowledgement to system logging

Post by dwasswa »

Hi @edimusrex,

Just a follow up,did you manage to accomplish what you wanted?
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Appending Acknowledgement to system logging

Post by tmcdonald »

We will leave this thread open, but please note our holiday office hours.
Former Nagios employee
Locked