Page 1 of 1

Accessing Performance data

Posted: Fri Apr 08, 2016 8:48 am
by matthewk2
Hi there,

We currently retrieve status information via JSON queries to our Nagios XI installation to give us status information on our monitoring screens, and it works great.

I would like to now extend this to displaying graphing data, and so my question is; is there any way to access the underlying performance data via a JSON type query ?

Thanks,


Matthew

Re: Accessing Performance data

Posted: Fri Apr 08, 2016 10:30 am
by lmiltchev
Try:

Code: Select all

http://<ip address>/nagios/cgi-bin/statusjson.cgi?query=performancedata
Is this what you were looking for?

Re: Accessing Performance data

Posted: Wed Apr 13, 2016 7:31 am
by matthewk2
Hi there,

I had already spotted that one. It gives me the current performance data for the Nagios server, I was more interested in getting the historic performance data for a service.

Thanks,


Matthew

Re: Accessing Performance data

Posted: Wed Apr 13, 2016 9:41 am
by rkennedy
The historic performance data actually isn't stored in the databse, but rather RRD files. I don't think there is a way to access this information through the API.

The information can be pulled from the /usr/local/nagios/share/perfdata/ directory on the XI server, though.

You could use a command similar to this to grab it, rrdtool fetch /usr/local/nagios/share/perfdata/myhost/myservice.rrd AVERAGE -s <starttime> -e <endtime>