Where to find/query current and historical alert data?

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
gormank
Posts: 1114
Joined: Tue Dec 02, 2014 12:00 pm

Where to find/query current and historical alert data?

Post 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?
jdalrymple
Skynet Drone
Posts: 2620
Joined: Wed Feb 11, 2015 1:56 pm

Re: Where to find/query current and historical alert data?

Post 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/
gormank
Posts: 1114
Joined: Tue Dec 02, 2014 12:00 pm

Re: Where to find/query current and historical alert data?

Post 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.
jdalrymple
Skynet Drone
Posts: 2620
Joined: Wed Feb 11, 2015 1:56 pm

Re: Where to find/query current and historical alert data?

Post 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.
gormank
Posts: 1114
Joined: Tue Dec 02, 2014 12:00 pm

Re: Where to find/query current and historical alert data?

Post 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.
Locked