Page 1 of 1

Nagios Core 4.4.6 Notice Error.

Posted: Tue Nov 30, 2021 10:57 am
by zpayne
Hi,

I recently Nagios Core 4.4.6 with PHP74 on FreeBSD. When I enter the website I get a blank screen and:

Notice: Trying to access array offset on value of type bool in /var/www/nagios/includes/utils.inc.php on line 217

if(($fh=@fopen($fname,'r'))!=FALSE){
// read all lines in the config file
while(!feof($fh)){
$s=fgets($fh);

// skip comments
if($s[0]=='#')
continue;

217: if($s[0]=='#')

Is there any one that can help with this I am stumped on what happened here.

Re: Nagios Core 4.4.6 Notice Error.

Posted: Wed Dec 01, 2021 9:20 am
by mcapra
The official Nagios Core compilation/installation instructions, for Nagios Core 4.4.6 on FreeBSD, recommend using PHP 7.3. You appear to have PHP 7.4 installed. I would suggest trying PHP 7.3 instead and see if that improves things.

Re: Nagios Core 4.4.6 Notice Error.

Posted: Fri Dec 17, 2021 1:48 am
by gmalsack
I'm just performed a clean install of Nagios 4.4.6 on Ubuntu 20.04 using PHP 7.4. I'm able to see the main dashboard, but all of the pages respond with

It appears as though you do not have permission to view information for any of the services you requested...
If you believe this is an error, check the HTTP server authentication requirements for accessing this CGI
and check the authorization options in your CGI configuration file.

and I'm seeing errors in apache2/error.log

[Fri Dec 17 06:36:06.288494 2021] [php7:notice] [pid 6251] [client 10.31.30.155:52764] PHP Notice: Trying to access array offset on value of type bool in /usr/local/nagios/share/includes/utils.inc.php on line 217, referer: http://nagios.fvm.local/nagios/
[Fri Dec 17 06:36:06.291007 2021] [php7:notice] [pid 6255] [client 10.31.30.155:52762] PHP Notice: Trying to access array offset on value of type bool in /usr/local/nagios/share/includes/utils.inc.php on line 217, referer: http://nagios.fvm.local/nagios/

I performed a clean installation of Ubuntu, ran updates, then followed this process to install. Except I downloaded 4.4.6 rather than 4.4.5.

https://linuxhint.com/install_nagios_ubuntu/

Once I found that 4.4.6 didn't work (per a post from an alpine linux forum), I downloaded 4.4.5, recompiled and reinstalled. Main splash page says 4.4.5 but I'm still having the same issues.

Anyone have any luck with this yet?

Re: Nagios Core 4.4.6 Notice Error.

Posted: Fri Dec 17, 2021 10:35 am
by zpayne
I was able to get this to work with downgrading the PHP to 7.3 and all is fine now.

Re: Nagios Core 4.4.6 Notice Error.

Posted: Mon Dec 20, 2021 2:30 pm
by benjaminsmith
I was able to get this to work with downgrading the PHP to 7.3 and all is fine now.
Excellent!

And thank you for sharing the solution.