How to access Nagios Availability-Report files to retrieve "UP Time Percent" and so other information about Hosts and Services?

I know It can be accessed through Nagios CGI but I want to use it on a custom interface. Can I use those CGI Script to achieve what I want?

  • Which custom interface are you using?
    – Epaphus
    Dec 29 '12 at 21:18
  • Thank you. I wrote one in PHP myself. actually It's just something to fulfill my needs. Dec 29 '12 at 21:35

Looks like the Nagios Availability-Report is generated using the cgi-bin/avail.cgi script looking at the source code for the cgi script it reads the nagios log files and generates the reports on the fly.

You could either pass the arguments to the avail.cgi script or you could parse the nagios.log file and the archives which on my system is located in nagios/var/archives to generate your own reports.

A report for all host groups for the last 7 days with first assumed state as up/ok would look like the following


Just as another thought, you could download the CGI script source code and edit it so the output matches your requirement and then compile the CGI and use it.

  • Thanks, You mean using the command line options? How can I get the exact value? Dec 31 '12 at 8:21
  • I mean via a web request, you would then either have to just display the web page the script returns or do some thing which would pull out the data you need so that it can be in the same style as the custom UI. You can get the values by going direct to the script in a web browser as all the options look to be passed as a get request.
    – Epaphus
    Dec 31 '12 at 11:33
  • updated answer.
    – Epaphus
    Dec 31 '12 at 11:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.