EPOCH time – Nagios Time convert

The Unix epoch (or Unix time or POSIX time or Unix timestamp) is the number of seconds that have elapsed since January 1, 1970 (midnight UTC/GMT), not counting leap seconds (in ISO 8601: 1970-01-01T00:00:00Z).

to convert epoch time:

perl -le ‘print scalar localtime $ARGV[0]’ 1510686308
Tue Nov 14 14:05:08 2017

to See nagios logs in Human Readable Format:

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

 

Leave a Reply

Your email address will not be published. Required fields are marked *

Categories

Best Buy Co, Inc.
Best Buy Co, Inc.
Best Buy Co, Inc.