Nagios Core 4.4.6 Notice Error.

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.
Locked
zpayne
Posts: 2
Joined: Tue Nov 30, 2021 10:43 am

Nagios Core 4.4.6 Notice Error.

Post 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.
User avatar
mcapra
Posts: 3739
Joined: Thu May 05, 2016 3:54 pm

Re: Nagios Core 4.4.6 Notice Error.

Post 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.
Former Nagios employee
https://www.mcapra.com/
gmalsack
Posts: 3
Joined: Fri Dec 04, 2015 12:57 pm

Re: Nagios Core 4.4.6 Notice Error.

Post 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?
zpayne
Posts: 2
Joined: Tue Nov 30, 2021 10:43 am

Re: Nagios Core 4.4.6 Notice Error.

Post by zpayne »

I was able to get this to work with downgrading the PHP to 7.3 and all is fine now.
benjaminsmith
Posts: 5324
Joined: Wed Aug 22, 2018 4:39 pm
Location: saint paul

Re: Nagios Core 4.4.6 Notice Error.

Post 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.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked