Nagvis: Trying to access array offset on value of type int

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
AirBank_HD
Posts: 7
Joined: Tue Aug 16, 2016 8:46 am

Nagvis: Trying to access array offset on value of type int

Post by AirBank_HD »

Hi, I updated nagiosxi to 5.8.7 and php to 7.4. After the update I can't create a new map. Where could be the problem?
OS: CentOS 7
PHP: PHP 7.4.25
Nagiosxi: 5.8.7
Nagvis: 1.9.8

Code: Select all

Error: (0) Trying to access array offset on value of type int
URL: /nagvis/server/core/ajax_handler.php?mod=Map&act=getMapObjects&show=ITSECURITY&header_menu=1&hover_menu=1&context_menu=1&zoom=100&_ajaxid=1636008386
File: /usr/local/nagvis/share/server/core/classes/GlobalMapCfg.php
Line: 970
#0 /usr/local/nagvis/share/server/core/classes/GlobalMapCfg.php(970): nagvisExceptionErrorHandler()
#1 /usr/local/nagvis/share/server/core/classes/GlobalMapCfg.php(489): GlobalMapCfg->verifyObjectIds()
#2 /usr/local/nagvis/share/server/core/classes/CoreModMap.php(319): GlobalMapCfg->readMapConfig()
#3 /usr/local/nagvis/share/server/core/classes/CoreModMap.php(105): CoreModMap->getMapObjects()
#4 /usr/local/nagvis/share/server/core/functions/index.php(120): CoreModMap->handleAction()
#5 /usr/local/nagvis/share/server/core/ajax_handler.php(59): require('/usr/local/nagv...')
#6 {main}
You do not have the required permissions to view the files attached to this post.
benjaminsmith
Posts: 5324
Joined: Wed Aug 22, 2018 4:39 pm
Location: saint paul

Re: Nagvis: Trying to access array offset on value of type i

Post by benjaminsmith »

HI,

Welcome to the Nagios Customer Support Forum!

It looks like you are hitting the issue below after the upgrade.

Fix: php7.4 Trying to access array offset on value of type int

Please try making the proposed change to the GlobalMapCfg.php in the following directory.

Code: Select all

/usr/local/nagvis/share/server/core/classes/GlobalMapCfg.ph
And let us know if that resolves the issue. If not, please send us the system profile. Thanks, Benjamin

To send us your system profile.
Login to the Nagios XI GUI using a web browser.
Click the "Admin" > "System Profile" Menu
Click the "Download Profile" button
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!
AirBank_HD
Posts: 7
Joined: Tue Aug 16, 2016 8:46 am

Re: Nagvis: Trying to access array offset on value of type i

Post by AirBank_HD »

Thanks! I changed the GlobalMapCfg.php lines

Code: Select all

if($id[0] == '_')
     $todo = true;
to

Code: Select all

if($id !== 0 && isset($id[0]) && $id[0] == '_') {
            $todo = true;
        }
Nagvis started working.
benjaminsmith
Posts: 5324
Joined: Wed Aug 22, 2018 4:39 pm
Location: saint paul

Re: Nagvis: Trying to access array offset on value of type i

Post by benjaminsmith »

Hi,

Great, glad that's working for you now.

We'll go ahead and close this out, but feel free to reach out again if you need help with anything else.

Have a great weekend!
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