We've moved to a new support system!

The Nagios Answer Hub is a place where you can get help with technical questions from our experts. There, you can quickly open tickets and join discussion boards.

Request Nagios Answer Hub access here: https://info.nagios.com/answer-hub-access-new-users

After completing the access form, you will be given access to a portal where new tickets can be created. We will keep the old customer forum sections and ticket system available for current cases to be resolved.

Go to the Answer Hub

Warning: Trying to access array offset on value of type bool

Engage with the community of users including those using the open source solutions.
Includes Nagios Core, Plugins, and NCPA

Warning: Trying to access array offset on value of type bool

Postby Helmut » Sat Feb 19, 2022 6:22 am

Hi,

I just upgraded FreeBSD 12.3 from php74 to php80. When I access Nagios 4.4.6 I get

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

Code: Select all
if($s[0]=='#')
   continue;

I checked the output of $s with

Code: Select all
echo "Value " . $s . "<BR>";

The result:

    Value main_config_file=/usr/local/etc/nagios/nagios.cfg
    Value #physical_html_path=/usr/local/www/nagios
    Value physical_html_path=/var/www/nagios
    Value #url_html_path=/nagios
    Value url_html_path=/
    Value show_context_help=0
    Value #nagios_check_command=/usr/local/libexec/nagios/check_nagios /var/spool/nagios/status.dat 5 '/usr/local/bin/nagios'
    Value use_authentication=1
    Value #default_user_name=guest
    Value #authorized_for_system_information=nagiosadmin,theboss,jdoe
    Value #authorized_for_configuration_information=nagiosadmin,jdoe
    Value #authorized_for_system_commands=nagiosadmin
    Value #authorized_for_all_services=nagiosadmin,guest
    Value #authorized_for_all_hosts=nagiosadmin,guest
    Value #authorized_for_all_service_commands=nagiosadmin
    Value #authorized_for_all_host_commands=nagiosadmin
    Value #statusmap_background_image=smbackground.gd2
    Value default_statusmap_layout=5
    Value default_statuswrl_layout=4
    Value #statuswrl_include=myworld.wrl
    Value ping_syntax=/bin/ping -n -U -c 5 $HOSTADDRESS$
    Value refresh_rate=90
    Value result_limit=250
    Value #host_unreachable_sound=hostdown.wav
    Value #host_down_sound=hostdown.wav
    Value #service_critical_sound=critical.wav
    Value #service_warning_sound=warning.wav
    Value #service_unknown_sound=warning.wav
    Value #normal_sound=noproblem.wav
    Value default_user_name=guest
    Value authorized_for_system_information=helmut
    Value authorized_for_configuration_information=helmut
    Value authorized_for_system_commands=helmut
    Value authorized_for_all_service_commands=helmut
    Value authorized_for_all_host_commands=helmut
    Value authorized_for_all_services=*
    Value authorized_for_all_hosts=*
    Value

Notice the empty "Value" at the end.

While this can be fixed by

Code: Select all
if($s) {
  if($s[0]=='#')
    continue;
}

I'm wondering if this is related to PHP8 or anything else. Apart from that Nagios works fine.

Thank you!
Helmut
 
Posts: 2
Joined: Thu Feb 11, 2021 8:40 am

Re: Warning: Trying to access array offset on value of type

Postby ClaudeSj456 » Thu Mar 17, 2022 12:38 am

I am getting a similar message with a different plugin, not in the admin panel but on almost every page of my actual website, unfortunately.

Notice: Trying to access array offset on value of type bool in /var/www/html/lib_sites/or/main/wp-content/plugins/advanced-custom-fields-pro/includes/api/api-template.php on line 499

Here is the line of code in api-template.php:
$name = $field[‘name’];

The plugin developer said he would look into it, but meanwhile, I would welcome any suggestions.
ClaudeSj456
 
Posts: 8
Joined: Sun Feb 13, 2022 6:06 am


Return to Community Support

Who is online

Users browsing this forum: No registered users and 18 guests