Change system date/time stamps from epoch to YYYYMMDDHHMMSS

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
luczynj
Posts: 88
Joined: Wed Dec 03, 2014 6:47 pm

Change system date/time stamps from epoch to YYYYMMDDHHMMSS

Post 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
User avatar
vtrac
Posts: 903
Joined: Tue Oct 27, 2020 1:35 pm

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

Post 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
luczynj
Posts: 88
Joined: Wed Dec 03, 2014 6:47 pm

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

Post 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
User avatar
vtrac
Posts: 903
Joined: Tue Oct 27, 2020 1:35 pm

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

Post 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
Locked