Page 1 of 1

Change epoch time to date in nagios.log

Posted: Tue Aug 01, 2017 11:50 am
by anish
Moderator Edit: This thread has been split from another - https://support.nagios.com/forum/viewto ... 16&t=44154
In the future, please create a new thread and link to the old one instead of adding on.


Hi ,

i have tried using the script

"tail -50 /usr/local/nagios/var/nagios.log | perl -pe 's/(\d+)/localtime($1)/e'"

But i am getting a message as

[root@SESKLNGLSIDV01 /]# tail -50 /usr/local/nagios/var/nagios.log | perl -pe 's/(\d+)/localtime($1)/e'
tail: cannot open `/usr/local/nagios/var/nagios.log' for reading: No such file or directory
[root@SESKLNGLSIDV01 /]#

There is no such file like Nagios.log in our environment . In this scenario how to change the time to readable format

Re: Change epoch time to date in nagios.log

Posted: Tue Aug 01, 2017 2:05 pm
by cdienger
You can check /usr/local/nagios/libexec/nagios.cfg with:

Code: Select all

grep log_file /usr/local/nagios/etc/nagios.cfg
This should show you where to find the file.