Nagios4: avail.cgi: Retrieve availability statistics from within a script

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Post Reply
Alphaphi
Posts: 1
Joined: Thu Jul 13, 2023 10:18 am

Nagios4: avail.cgi: Retrieve availability statistics from within a script

Post by Alphaphi »

Hi all,

I want to generate availability statistics with a perl script, and I want to avoid to parse the logfiles myself. To me it looks as if avail.cgi was my friend for this, but I cannot figure out how to set up authentication.

On the GUI all works fine, I can see all sorts of Availability Reports. This tells me that my user (nagiosadmin) has the neccessary rights to generate those. How can I retrieve this data from within a (perl) script?

One thing I found is nagios-report.pl, which sets the environment variable "REMOTE_USER", in my case to "nagiosadmin". It does not set any password whatsoever. And so the result is always a nicely formatted html document telling sth like "permission denied".

Long story short - there must be an easy way to retrieve statistics in a script, and I can't find it. Pls point me to the right place.

If it's important: Nagios 4.4.6 on Debian bookworm

Cheers
Andre
kg2857
Posts: 236
Joined: Wed Apr 12, 2023 5:48 pm

Re: Nagios4: avail.cgi: Retrieve availability statistics from within a script

Post by kg2857 »

I'd be looking for the report .php files and the args or avail.cgi and the same. From my experience this could take some dedication or pain.
Post Reply