Page 1 of 1
Service check history question.
Posted: Tue Mar 29, 2016 2:34 pm
by JakeHatMacys
I'd like to know how long and if there's a file I can pull service check history on per server.... I've looked in:
/usr/local/nagios/share/perfdata
And found all our hosts. The checks I'm wanting history on have an rrd file & XML file in their directory. But I'm not sure that's what I'm looking for. They seem pretty small and I haven't looked at how to properly consume those files yet. We basically just want a complete status history as far back as we can get on this service:
Capture.JPG
The reports I run only show status changes... we just want to see each run and report on it... what would be the best way to get this done assuming it's possible?
Thanks.
Re: Service check history question.
Posted: Tue Mar 29, 2016 3:39 pm
by bwallace
Are you looking for state history, performance data, or both?
The rrd & XML files you mentioned, in /usr/local/nagios/share/perfdata, contain performance data only. State history, on the other hand, is found in:
/usr/local/nagios/var/nagios.log
/usr/local/nagios/var/archives/
Sorry if I'm stating the obvious here, but have you already tried running a State History report? Reports > Available Reports > State History
Re: Service check history question.
Posted: Wed Mar 30, 2016 7:49 am
by JakeHatMacys
bwallace wrote:Are you looking for state history, performance data, or both?
The rrd & XML files you mentioned, in /usr/local/nagios/share/perfdata, contain performance data only. State history, on the other hand, is found in:
/usr/local/nagios/var/nagios.log
/usr/local/nagios/var/archives/
Sorry if I'm stating the obvious here, but have you already tried running a State History report? Reports > Available Reports > State History
It looks like /usr/local/nagios/var/archives/ is more or less what we're looking for.
And yes on state history, unless I'm missing something state history will only give you state changes though correct? The scripts we're running for metrics always come back green, just gather information with no alerting.
Plus we want to reference this information across all servers and run reports on it... We were sending each run over to our HP BSM for storage but we had a problem during the holidays and for whatever reason sending more metric data ended up destabilizing the connector daemon. Long story short we stopped feeding BSM and sort of forgot to turn it back on *Whistles* so these logs in archives will save our butts.
Re: Service check history question.
Posted: Wed Mar 30, 2016 11:07 am
by bwallace
Its always interesting to hear what other purposes Nagios data can be used for. You are correct on state history, you get state changes (for a host, service or both) or you can report on a specific state only. Below is a state history report I ran real quick on localhost. Sounds like we may be good to lock this thread now, but did you have any other questions?
Re: Service check history question.
Posted: Fri Apr 08, 2016 12:46 pm
by JakeHatMacys
Hello, so circling back to this. What we're finding is only one entry per box for our service check in the log files in:
/usr/local/nagios/var/archives/
nagios-12-31-2015-00.log for example.... we were hoping to get a record of every run specifically the Status information of each run:
Capture.JPG
Now we did not have retain status information on this check turned on.... I just switched it on:
Capture1.JPG
Let me know if you guys can bail us out O.o
Re: Service check history question.
Posted: Fri Apr 08, 2016 2:32 pm
by ssax
The retain status information is just retaining the status of the just through nagios process restarts and is unrelated.
The state history report, /usr/local/nagios/var/nagios.log, and /usr/local/nagios/var/archives/ are the only places that you will find them.
Re: Service check history question.
Posted: Fri Apr 08, 2016 2:54 pm
by JakeHatMacys
ssax wrote:The retain status information is just retaining the status of the just through nagios process restarts and is unrelated.
The state history report, /usr/local/nagios/var/nagios.log, and /usr/local/nagios/var/archives/ are the only places that you will find them.
And it looks like it's only logging hard states or service alerts.... if I'm correct on that. We're looking for every run, even all the good ones. Are those stored anywhere??? Or am I wrong and are they stored there, we're just grepping the log for particular hosts running the check and only seeing one entry or so...
Re: Service check history question.
Posted: Mon Apr 11, 2016 1:03 pm
by ssax
I don't think that is available, not every check result is logged, only state changes. Here is a good reference (ignore the stalking and look at the table of when it's logged):
https://assets.nagios.com/downloads/nag ... lking.html