Page 1 of 1
Alert History - nagios.log file does not display alert date
Posted: Wed Jan 02, 2013 3:12 pm
by fialae
Nagios Core v 3.2.2
Is there a file that lists the alert history? I select Reports - Alerts - History. From the display i see the file is /usr/local/nagios/var/nagios.log. When I access the log i do see the alerts - but not the date they occured.
How can i get this information? I need a listing of alerts going back 3 months.
Thank you.
Re: Alert History - nagios.log file does not display alert d
Posted: Wed Jan 02, 2013 3:22 pm
by slansing
The reports menu in core pulls directly from the nagios.log file as you said, but it is parsed before it is dumped to the Web UI, this is where you get the chronological lists/graph from.
Re: Alert History - nagios.log file does not display alert d
Posted: Wed Jan 02, 2013 3:35 pm
by fialae
Is there a alert history download that lists the alert as well as the date the alert occured?
Re: Alert History - nagios.log file does not display alert d
Posted: Wed Jan 02, 2013 3:35 pm
by abrist
Additionally, you can run a grep on the archives folder (with wildcard) for "ALERT" to get a full list of alerts.
Code: Select all
root@localhost$ cat /usr/local/nagios/var/archives/* | grep ALERT >> alerts
Re: Alert History - nagios.log file does not display alert d
Posted: Wed Jan 02, 2013 3:44 pm
by fialae
How can one get the date to appear next to the alert? Here is an example of what i receive. I need to see the date it occured with it.
[1329144231] SERVICE ALERT: dfw01-is02-006;cpu load maui;WARNING;HARD;4;WARNING - load average: 5.04, 4.67, 5.04
Re: Alert History - nagios.log file does not display alert d
Posted: Thu Jan 03, 2013 5:35 pm
by abrist
fialae wrote:How can one get the date to appear next to the alert? Here is an example of what i receive. I need to see the date it occured with it.
[1329144231] SERVICE ALERT: dfw01-is02-006;cpu load maui;WARNING;HARD;4;WARNING - load average: 5.04, 4.67, 5.04
You will need to script a solution, or convert all unix time codes to date/time by hand. You can convert a unix time code string in bash with: