make the status.dat file easier to read
Posted: Fri May 27, 2016 5:46 pm
I looked at the status.dat file, which is located by the status_file directive in nagios.cfg.
In it, I see that nagios logs events and time stamps them with UNIX epochs, which is a counter of seconds since Midnight, January 1st, 1971.
It is very easy to convert from timestamps to real ASCII time strings that can be easily parsed by human beings. For example
or
Could the nagios software to be modified to do that?
Many thanks,
Jeff
In it, I see that nagios logs events and time stamps them with UNIX epochs, which is a counter of seconds since Midnight, January 1st, 1971.
It is very easy to convert from timestamps to real ASCII time strings that can be easily parsed by human beings. For example
Code: Select all
[nagios@nagios-test etc]$ perl -le 'print scalar localtime 1463616608;'
Wed May 18 17:10:08 2016
[nagios@nagios-test etc]$
Code: Select all
[nagios@nagios-test ~]$ python -c "from datetime import datetime; print datetime.fromtimestamp(1463616608)"
2016-05-18 17:10:08
[nagios@nagios-test ~]$
Many thanks,
Jeff