NagVis, each() function is deprecated


#1

Hi all,

I’m trying to do network topology on Check_MK 1.4.0p23 (same error on version 1.4.0p19) and I’m getting errors about PHP each function:

Error: (0) The each() function is deprecated. This message will be suppressed on further calls
URL: /LESSOR/nagvis/frontend/nagvis-js/index.php?mod=Map&header_template=on-demand-filter&header_menu=1&label_show=1&sources=automap&act=view&backend_id=LESSOR&render_mode=undirected&url_target=main&filter_group=&width=2266&height=1236
File: /opt/omd/versions/1.4.0p23.cre/share/nagvis/htdocs/frontend/nagvis-js/ext/dwoo-1.1.0/Dwoo/Compiler.php
Line: 2942
#0 [internal function]: nagvisExceptionErrorHandler(8192, ‘The each() func…’, ‘/opt/omd/versio…’, 2942, Array)
#1 /opt/omd/versions/1.4.0p23.cre/share/nagvis/htdocs/frontend/nagvis-js/ext/dwoo-1.1.0/Dwoo/Compiler.php(2942): each(Array)
#2 /opt/omd/versions/1.4.0p23.cre/share/nagvis/htdocs/frontend/nagvis-js/ext/dwoo-1.1.0/Dwoo/Compiler.php(985): Dwoo_Compiler->mapParams(Array, Array, 0)
#3 /opt/omd/versions/1.4.0p23.cre/share/nagvis/htdocs/frontend/nagvis-js/ext/dwoo-1.1.0/Dwoo/Compiler.php(668): Dwoo_Compiler->addBlock(‘topLevelBlock’, Array, 0)
#4 /opt/omd/versions/1.4.0p23.cre/share/nagvis/htdocs/frontend/nagvis-js/ext/dwoo-1.1.0/Dwoo/Template/String.php(369): Dwoo_Compiler->compile(Object(Dwoo), Object(Dwoo_Template_File))
#5 /opt/omd/versions/1.4.0p23.cre/share/nagvis/htdocs/frontend/nagvis-js/ext/dwoo-1.1.0/Dwoo.php(363): Dwoo_Template_String->getCompiledTemplate(Object(Dwoo), Object(Dwoo_Compiler))
#6 /opt/omd/versions/1.4.0p23.cre/share/nagvis/htdocs/frontend/nagvis-js/classes/NagVisHeaderMenu.php(85): Dwoo->get(Object(Dwoo_Template_File), Array)
_#7 /opt/omd/versions/1.4.0p23.cre/share/nagvis/htdocs/frontend/nagvis-js/classes/FrontendModMap.php(117): NagVisHeaderMenu->_toString()
#8 /opt/omd/versions/1.4.0p23.cre/share/nagvis/htdocs/frontend/nagvis-js/classes/FrontendModMap.php(80): FrontendModMap->showViewDialog()
#9 /opt/omd/versions/1.4.0p23.cre/share/nagvis/htdocs/server/core/functions/index.php(120): FrontendModMap->handleAction()
#10 /opt/omd/versions/1.4.0p23.cre/share/nagvis/htdocs/frontend/nagvis-js/index.php(53): require(’/opt/omd/versio…’)
#11 {main}

Does anyone know how to fix? :expressionless: |


(Philipp Näther) #2

That has nothing to do with pnp4nagios or check_mk. That is a bug in NagVis in combination with python 7.2 and it has already been reported:

Even in NagVis 1.9.6 (check_mk uses 1.9.2 or 1.9.1) the problem still persists. Make sure your system uses php 5.4.

I am going to move this topic to Visualization/Maps category. I think it fits better :slight_smile:


#3

Thanks.

And unfortunately I’m using PHP 7 on my system…


(watermelon) #4

Unsure if you’re still having this issue, but the developer of NagVis just pushed out an update regarding this problem and should be fixed now!


#5

Thanks!

But unfortunately after updating to latest Check_MK, pnp4nagios still fails :frowning:

This time with the error:

sizeof(): Parameter must be an array or an object that implements Countable


#6

PNP4Nagios itself is fixed so replacing some (or all) files of the PNP tree should solve the problem.