adding new values to nagios.log

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
sattanathan
Posts: 23
Joined: Tue Oct 23, 2012 8:10 am

adding new values to nagios.log

Post by sattanathan »

Hi,

I am in need of finding the notification status(acknowledged) for the service/host alert that are generated and logged in nagios.log .

Please let me know can we add $NOTIFICATIONTYPE$ macro to nagios.log

Thanks,
Sattanathan.S
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: adding new values to nagios.log

Post by abrist »

You should get ack in logs if you enabled the logging of external commands in nagios.cfg:

Code: Select all

log_external_commands=1
You should then see a line similar to the following for acks in your nagios.log:

Code: Select all

[1406152012] EXTERNAL COMMAND: ACKNOWLEDGE_HOST_PROBLEM;somehost.tld;2;1;0;Nagios Administrator;TEST
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
sattanathan
Posts: 23
Joined: Tue Oct 23, 2012 8:10 am

Re: adding new values to nagios.log

Post by sattanathan »

Hi Abrist,

Thanks..

But still i need to have the notification status along with the service alert / host alert (as shown in the below example) that are being logged in nagios.log

Original service alert in nagios.log
[1405473494] SERVICE ALERT: somehost ;Net-SNMP - critical processes;CRITICAL;HARD;3;SNMP-PROCS CRITICAL - nagios: OK - 9 processess

my requirement to be in nagios.log
[1405473494] SERVICE ALERT: somehost ;Net-SNMP - critical processes;CRITICAL;HARD;3;SNMP-PROCS CRITICAL - nagios: OK - 9 processess;ACKNOWLEDGE_HOST_PROBLEM;somehost;2;1;0;Nagios Administrator;TEST

Regards,
Sattanathan.S
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: adding new values to nagios.log

Post by abrist »

sattanathan wrote:[1405473494] SERVICE ALERT: somehost ;Net-SNMP - critical processes;CRITICAL;HARD;3;SNMP-PROCS CRITICAL - nagios: OK - 9 processess;ACKNOWLEDGE_HOST_PROBLEM;somehost;2;1;0;Nagios Administrator;TEST
These are technically 2 different metaphysical objects. One is a "Service Alert" while the other is an "External Command". You would have to modify the nagios source to change how this logs.
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
Locked