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.
Alert History - nagios.log file does not display alert date
-
slansing
- Posts: 7698
- Joined: Mon Apr 23, 2012 4:28 pm
- Location: Travelling through time and space...
Re: Alert History - nagios.log file does not display alert d
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
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
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 >> alertsFormer Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
Re: Alert History - nagios.log file does not display alert d
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
[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
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: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
Code: Select all
date -d @[unixtime]Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.