The availability data is generated on-the-fly so direct DB access to the data is not possible (and it's pulled from the
/usr/local/nagios/var/nagios.log and
/usr/local/nagios/var/archives/* files)
Actually, you should be able to construct the URL and parse the data as CSV (which includes the percentages):
For all hostgroups:
http://YOURXISERVER/nagios/cgi-bin/avai ... tgroup=all[/b]&timeperiod=last7days&smon=8&sday=1&syear=2016&shour=0&smin=0&ssec=0&emon=8&eday=3&eyear=2016&ehour=24&emin=0&esec=0&rpttimeperiod=24x7&assumeinitialstates=yes&assumestateretention=yes&assumestatesduringnotrunning=yes&includesoftstates=no&initialassumedhoststate=3&initialassumedservicestate=0&backtrack=4&csvoutput=
For a single hostgroup:
http://YOURXISERVER/nagios/cgi-bin/avai ... ux-servers[/b]&timeperiod=last7days&smon=8&sday=1&syear=2016&shour=0&smin=0&ssec=0&emon=8&eday=3&eyear=2016&ehour=24&emin=0&esec=0&rpttimeperiod=24x7&assumeinitialstates=yes&assumestateretention=yes&assumestatesduringnotrunning=yes&includesoftstates=no&initialassumedhoststate=3&initialassumedservicestate=0&backtrack=4&csvoutput=
For all hosts:
http://YOURXISERVER/nagios/cgi-bin/avai ... ]&host=all[/b]&timeperiod=last7days&smon=8&sday=1&syear=2016&shour=0&smin=0&ssec=0&emon=8&eday=3&eyear=2016&ehour=24&emin=0&esec=0&rpttimeperiod=24x7&assumeinitialstates=yes&assumestateretention=yes&assumestatesduringnotrunning=yes&includesoftstates=no&initialassumedhoststate=3&initialassumedservicestate=6&backtrack=4&csvoutput=
For a single host:
http://YOURXISERVER/nagios/cgi-bin/avai ... =localhost[/b]&timeperiod=last7days&smon=8&sday=1&syear=2016&shour=0&smin=0&ssec=0&emon=8&eday=3&eyear=2016&ehour=24&emin=0&esec=0&rpttimeperiod=24x7&assumeinitialstates=yes&assumestateretention=yes&assumestatesduringnotrunning=yes&includesoftstates=no&initialassumedhoststate=3&initialassumedservicestate=6&backtrack=4&csvoutput=
For all servicegroups:
http://YOURXISERVER/nagios/cgi-bin/avai ... egroup=all[/b]&timeperiod=last7days&smon=8&sday=1&syear=2016&shour=0&smin=0&ssec=0&emon=8&eday=3&eyear=2016&ehour=24&emin=0&esec=0&rpttimeperiod=&assumeinitialstates=yes&assumestateretention=yes&assumestatesduringnotrunning=yes&includesoftstates=no&initialassumedhoststate=3&initialassumedservicestate=6&backtrack=4&csvoutput=
For a single servicegroup:
http://YOURXISERVER/nagios/cgi-bin/avai ... rvicegroup[/b]&timeperiod=last7days&smon=8&sday=1&syear=2016&shour=0&smin=0&ssec=0&emon=8&eday=3&eyear=2016&ehour=24&emin=0&esec=0&rpttimeperiod=&assumeinitialstates=yes&assumestateretention=yes&assumestatesduringnotrunning=yes&includesoftstates=no&initialassumedhoststate=3&initialassumedservicestate=6&backtrack=4&csvoutput=
For a single service:
http://YOURXISERVER/nagios/cgi-bin/avai ... =localhost[/b]
&service=SSH&timeperiod=last7days&smon=8&sday=1&syear=2016&shour=0&smin=0&ssec=0&emon=8&eday=3&eyear=2016&ehour=24&emin=0&esec=0&rpttimeperiod=&assumeinitialstates=yes&assumestateretention=yes&assumestatesduringnotrunning=yes&includesoftstates=no&initialassumedservicestate=6&backtrack=4&csvoutput=
But to be honest, you're really better off doing this:
- Go to
http://YOURXISERVER/nagios/cgi-bin/avail.cgi
- Select if you want hostgroups, hosts, servicesgroups, or services
- Continue through your selection until you get to the Select Report Options page
- Set all the report options to what you want
- Hit the F12 key which will bring up the Firefox/Chrome inspector
- Click the Network tab
- Click the Create Availability Report! button
- Right-click on the avail.cgi entry and choose Copy URL and it will give you the URLs that you can use to query that information (see attached image).
Inspector.png
Note that you can add
&csvoutput= on the end of the URL if you want the CSV.
You do not have the required permissions to view the files attached to this post.