Theodore Baschak

BOFH. Open Source Guru. Founder/Operator of Hextet Systems, AS395089 and Network Architect for Daemon Defense Systems, AS55101.

Nagios Logs, Handy One-Liner

Sat, 05 Sep 2015 18:25:11 -0500 » Nerd Projects, Nagios, Network Monitoring, CLI, Programming, Networking, System Administration

Nagios is an amazing network monitoring tool, and its logs are a greppable goldmine of information. Most of us aren’t able to convert timestamps into local dates on the fly. GeekPeek offers the following one-liner which you can add into a pipe to convert timestamps into human-readable format on the fly.

perl -pe 's/(\d+)/localtime($1)/e'

I’ve used variations on this to convert the timestamps of BGP advertisements in JSON objects outputted from exabgp. It is a very handy chunk of a one-liner to keep handy.

© Theodore Baschak - https://github.com/tbaschak - Powered by Jekyll.
Powered by Les.net.
CiscoDude.net is a personal website. Opinions expressed are not necessarily those of his employer.