Skip to content

Instantly share code, notes, and snippets.

@eidantoei
Created September 4, 2012 09:46
Show Gist options
  • Save eidantoei/3619253 to your computer and use it in GitHub Desktop.
Save eidantoei/3619253 to your computer and use it in GitHub Desktop.
Nagios Log Readable
#!/bin/bash
# Naigos Log Readable
# usage: ``$ tail /usr/local/nagios/var/nagios.log | /usr/local/nagiosutils/nagios-log-readable``
while read L
do
M=$(cut -f2- -d" "<<<"${L}")
T=$(cut -f1 -d" " <<<"${L}" | tr -d '[]' | awk '{print strftime("%F-%T",$1)}')
echo "[${T}] ${M}"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment