Change epoch time to date in nagios.log

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
anish
Posts: 161
Joined: Tue Jul 19, 2016 5:29 am

Change epoch time to date in nagios.log

Post 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
User avatar
cdienger
Support Tech
Posts: 5045
Joined: Tue Feb 07, 2017 11:26 am

Re: Change epoch time to date in nagios.log

Post 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.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Locked