Page 1 of 1
Where to find/query current and historical alert data?
Posted: Thu Aug 27, 2015 2:30 pm
by gormank
I'm looking for a way to gather info on the current and historical status of some hosts and services in my system. The goal is to send a very brief status email to users telling them that the vital systems we monitor are in good shape or if they need attention.
I'm not looking for a standard report that attaches a pdf or provides a link to fetch a pdf, or log into the system. This doesn't need to be a standard part of Nagios. I'm happy to locate the data, query it, and send the email myself via a script.
The question is where is the data?
Re: Where to find/query current and historical alert data?
Posted: Thu Aug 27, 2015 3:36 pm
by jdalrymple
The *convenient* place is /usr/local/nagios/var/status.dat - but that's only realtime.
The historical (and realtime) data is in a couple of spots:
1) mysql database 'nagios'
2) /usr/local/nagios/var/nagios.log and /usr/local/nagios/var/archives/
Re: Where to find/query current and historical alert data?
Posted: Fri Aug 28, 2015 10:24 am
by gormank
Thanks. I'll look at status.dat and in archives.
I also see that tables nagios_hoststatus and nagios_servicestatus (I guess in the nagios DB) should have most of the info I need. If I can join on hostgroup_members, I think I'll also be able to limit to my hosts.
Re: Where to find/query current and historical alert data?
Posted: Fri Aug 28, 2015 10:32 am
by jdalrymple
Nailing the DB would be the best way to do it, that was in fact the intended purpose of implementing NDO2db in the first place.
Re: Where to find/query current and historical alert data?
Posted: Fri Aug 28, 2015 12:38 pm
by gormank
My preference is also via SQL.
Sorry to have asked yet another dumb question but the documentation style isn't really conducive to figuring out how to do things creatively.
I eventually found a pointer to the NDOUtils docs via google.
http://assets.nagios.com/downloads/nagi ... /ndoutils/
This can be closed.