[Nagios-devel] timestamp in macro and log files

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
Guest

[Nagios-devel] timestamp in macro and log files

Post by Guest »

Hi,

I'm currently trying to get the timestamp of a service check with the
event handler.

But I fail to get the same timestamp as the one on the nagios log file.

if I have this handler:

define command{
command_name event-test
command_line /bin/echo $LASTSERVICECHECK$
$LASTSERVICESTATECHANGE$ $SERVICEEXECUTIONTIME$ >> /tmp/nagios.test
}

with this result on my tmp file:

chaos:/etc/nagios2# tail -f /tmp/nagios.test
1240264409 1240264409 0.014
1240264469 1240264409 0.014

and this on the nagios log file:
[1240264411] SERVICE ALERT: localhost;http test;CRITICAL;SOFT;
1;CRITICAL - string not found
[1240264411] SERVICE EVENT HANDLER: localhost;http test;CRITICAL;SOFT;
1;event-test
[1240264471] SERVICE ALERT: localhost;http test;CRITICAL;HARD;
2;CRITICAL - string not found
[1240264471] SERVICE EVENT HANDLER: localhost;http test;CRITICAL;HARD;
2;event-test

there are 2 seconds between them.

I want to put the data on a database and report the same date as the
nagios web interface.

Do you know where I can have the same timestamp as the log file ?
Why there are two differents values ?

I'm using nagios 2.6 (debian)





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