Error in NagVis after upgrading checkmk 1.6.0p22 to 2.0.0

Hello,
we just upgraded our checkmk RAW edition to latest version 2.0.0.
After successfully upgrade we get an error in NagVis:

Error: (0) in_array() expects parameter 2 to be array, bool given
URL: /mysite/nagvis/frontend/nagvis-js/index.php
File: /opt/omd/versions/2.0.0.cre/share/nagvis/htdocs/server/core/classes/GlobalMapCfg.php
Line: 1028
#0 [internal function]: nagvisExceptionErrorHandler(2, 'in_array() expe...', '/opt/omd/versio...', 1028, Array) #1 /opt/omd/versions/2.0.0.cre/share/nagvis/htdocs/server/core/classes/GlobalMapCfg.php(1028): in_array('worldmap', false) #2 /opt/omd/versions/2.0.0.cre/share/nagvis/htdocs/server/core/classes/GlobalMapCfg.php(488): GlobalMapCfg->checkMapConfigIsValid() #3 /opt/omd/versions/2.0.0.cre/share/nagvis/htdocs/server/core/classes/GlobalCore.php(450): GlobalMapCfg->readMapConfig(true) #4 /opt/omd/versions/2.0.0.cre/share/nagvis/htdocs/frontend/nagvis-js/classes/NagVisHeaderMenu.php(324): GlobalCore->getListMaps() #5 /opt/omd/versions/2.0.0.cre/share/nagvis/htdocs/frontend/nagvis-js/classes/NagVisHeaderMenu.php(82): NagVisHeaderMenu->getMacros() #6 /opt/omd/versions/2.0.0.cre/share/nagvis/htdocs/frontend/nagvis-js/classes/FrontendModOverview.php(77): NagVisHeaderMenu->__toString() #7 /opt/omd/versions/2.0.0.cre/share/nagvis/htdocs/frontend/nagvis-js/classes/FrontendModOverview.php(55): FrontendModOverview->showViewDialog() #8 /opt/omd/versions/2.0.0.cre/share/nagvis/htdocs/server/core/functions/index.php(120): FrontendModOverview->handleAction() #9 /opt/omd/versions/2.0.0.cre/share/nagvis/htdocs/frontend/nagvis-js/index.php(53): require('/opt/omd/versio...') #10 {main}

When I comment the line 1028 in GlobalMapCfg.php the problem disapire.

if(isset($val[‘source_param’]) && !in_array($val[‘source_param’], $this->getValue(0, ‘sources’)))
continue;

Is there any other solution to resolve this error?

Thanks,
Marko

Hi Marko,
we will fix this with Checkmk 2.0.0p1.

BR
Anastasios

hello, when will the version be available?

According to this BUG?: Wrong graph units with new interface check - #12 by moritz post it is possible this week.

Thank you for the quick reply.

Bug concerning Nagvis on version 2.0 of check_mk

Hello, it seems that the problem is still present in version 2.0.0p1:
Error: (0) in_array() expects parameter 2 to be array, boolean given
URL: /semitan/nagvis/frontend/nagvis-js/index.php?mod=Map&act=view&show=Semitan
File: /omd/versions/2.0.0p1.cee/share/nagvis/htdocs/server/core/classes/GlobalMapCfg.php
Line: 1026
#0 [internal function]: nagvisExceptionErrorHandler(2, ‘in_array() expe…’, ‘/omd/versions/2…’, 1026, Array)
#1 /omd/versions/2.0.0p1.cee/share/nagvis/htdocs/server/core/classes/GlobalMapCfg.php(1026): in_array(‘worldmap’, false)
#2 /omd/versions/2.0.0p1.cee/share/nagvis/htdocs/server/core/classes/GlobalMapCfg.php(480): GlobalMapCfg->checkMapConfigIsValid()
#3 /omd/versions/2.0.0p1.cee/share/nagvis/htdocs/frontend/nagvis-js/classes/NagVisHeaderMenu.php(164): GlobalMapCfg->readMapConfig(true)
#4 /omd/versions/2.0.0p1.cee/share/nagvis/htdocs/frontend/nagvis-js/classes/NagVisHeaderMenu.php(305): NagVisHeaderMenu->getMapList()
#5 /omd/versions/2.0.0p1.cee/share/nagvis/htdocs/frontend/nagvis-js/classes/NagVisHeaderMenu.php(82): NagVisHeaderMenu->getMacros()
#6 /omd/versions/2.0.0p1.cee/share/nagvis/htdocs/frontend/nagvis-js/classes/FrontendModMap.php(117): NagVisHeaderMenu->__toString()
#7 /omd/versions/2.0.0p1.cee/share/nagvis/htdocs/frontend/nagvis-js/classes/FrontendModMap.php(80): FrontendModMap->showViewDialog()
#8 /omd/versions/2.0.0p1.cee/share/nagvis/htdocs/server/core/functions/index.php(120): FrontendModMap->handleAction()
#9 /omd/versions/2.0.0p1.cee/share/nagvis/htdocs/frontend/nagvis-js/index.php(53): require(‘/omd/versions/2…’)
#10 {main}

This is from the NagVis changelog.

1.9.25
  * FIX: Fix map corruption regression introduced with 1.9.24
  This issue was triggered by objects on a map having a numeric "object_id"
  attribute. The issue resulted in map configuration files without "define
  global" object at the beginning of the map. In this situation NagVis will
  show an error like "Error: (0) in_array() expects parameter 2 to be array, bool given".
  You will have to find the problematic map config (.cfg) and readd the global
  section.

You will need to add manually the global section to the defect map.
It is possible to search your maps inside “~/etc/nagvis/maps/” and look there for any map without a [global] section.
Take a map with a [global] section and use this as a template for your defect map.
Yes this problem is not only a little bit annoying it can also be much work :slight_smile: i had to fix around 10 maps in over 100.

1 Like

also in my enviroment … but this works !!

Hello,
can you tell me the procedure?
thank you in advance

move to
/opt/omd/sites/yoursite/etc/nagvis/maps/

open a Map an take a look if the global header is inside
Example:

define global {
alias=Overview-Asia
object_id=0
event_sound=0
map_image=asia.png
}

this has to check in all maps then Nagvis starts again !!

there can be more options inside the global header

http://docs.nagvis.org/1.7/en_US/map_config_format_description.html

or copy all Maps from your backup to this folder

Greetz Bernd

1 Like

great thanks a lot
a map did not contain the global
1 out of 198!

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed. Contact @fayepal if you think this should be re-opened.