Page 1 of 1

Change system date/time stamps from epoch to YYYYMMDDHHMMSS

Posted: Tue Jun 22, 2021 3:25 pm
by luczynj
Hello,

Is it possible to change the way log files, NagiosXI backup file names, etc... anything that uses the Epoch time to use YYYYMMDDHHMMSS format instead?

Thanks,
JLu

Re: Change system date/time stamps from epoch to YYYYMMDDHHM

Posted: Wed Jun 23, 2021 1:32 pm
by vtrac
Hi JLu,
How are you doing?
I'm very sorry but there is not a way to change Epoch time to a "human readable" format in Nagios XI.

However, you can try using perl -pe 's/(\d+)/localtime($1)/e' to convert the time to a "human readable" format.

Example:

Code: Select all

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

or 

perl -pe 's/(\d+)/localtime($1)/e' < /usr/local/nagios/var/nagios.log | less
Here's another similar ticket:
https://support.nagios.com/forum/viewto ... 16&t=44154


Best Regards,
Vinh

Re: Change system date/time stamps from epoch to YYYYMMDDHHM

Posted: Fri Jun 25, 2021 8:28 am
by luczynj
Thank you for that.

Are there enough users who would qualify this for a new feature/option?

You can close the case.

Thanks again.
JLu

Re: Change system date/time stamps from epoch to YYYYMMDDHHM

Posted: Fri Jun 25, 2021 2:28 pm
by vtrac
Hi JLu,
Please feel free to open a "feature request" at the below URL ... :-)
https://github.com/NagiosEnterprises/nagioscore/issues


Closing ticket!! ... :-)


Regards,
Vinh