Page 1 of 1

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

Posted: Thu Jul 13, 2023 10:40 am
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

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

Posted: Fri Jul 21, 2023 1:05 am
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.