NagVis / nagvis

Visualization addon for your open source monitoring core
http://nagvis.org/
GNU General Public License v2.0
115 stars 73 forks source link

exclude_members not working in global section #373

Open kleinski opened 8 months ago

kleinski commented 8 months ago

Hello Nagvis-Team,

1st up: Thank you for your work, it's highly appreciated!

I have a bug here at least in the regarding the exclusion of services:

Using the docker version of Checkmk 2.2.0p20 the exclusion works fine and excludes the Uptime service on a per host basis, here is the whole config file of the map:

define global {
alias=Default
object_id=0
}

define host {
host_name=localhost
x=370
y=166
object_id=e14771
label_text=[name]
label_show=1
exclude_members=^Uptime$
only_hard_states=1
}

When I use the same exclude config line in the global section...

define global {
alias=Default
object_id=0
exclude_members=^Uptime$
}

... it leads to an error:

Error: (0) explode(): Passing null to parameter #2 ($string) of type string is deprecated
URL: /cmk/nagvis/server/core/ajax_handler.php?mod=Map&act=getMapObjects&show=default&header_menu=1&hover_menu=1&context_menu=1&zoom=100&_ajaxid=1711445287
File: /opt/omd/versions/2.2.0p20.cee/share/nagvis/htdocs/server/core/classes/objects/NagVisMapObj.php
Line: 389
#0 [internal function]: nagvisExceptionErrorHandler()
#1 /opt/omd/versions/2.2.0p20.cee/share/nagvis/htdocs/server/core/classes/objects/NagVisMapObj.php(389): explode()
#2 /opt/omd/versions/2.2.0p20.cee/share/nagvis/htdocs/server/core/classes/objects/NagVisMapObj.php(238): NagVisMapObj->excludeMapObject()
#3 /opt/omd/versions/2.2.0p20.cee/share/nagvis/htdocs/server/core/classes/objects/NagVisMapObj.php(621): NagVisMapObj->getStateRelevantMembers()
#4 /opt/omd/versions/2.2.0p20.cee/share/nagvis/htdocs/server/core/classes/objects/NagVisMapObj.php(332): NagVisMapObj->fetchSummaryState()
#5 /opt/omd/versions/2.2.0p20.cee/share/nagvis/htdocs/server/core/classes/NagVisMap.php(59): NagVisMapObj->applyState()
#6 /opt/omd/versions/2.2.0p20.cee/share/nagvis/htdocs/server/core/classes/CoreModMap.php(326): NagVisMap->__construct()
#7 /opt/omd/versions/2.2.0p20.cee/share/nagvis/htdocs/server/core/classes/CoreModMap.php(107): CoreModMap->getMapObjects()
#8 /opt/omd/versions/2.2.0p20.cee/share/nagvis/htdocs/server/core/functions/index.php(120): CoreModMap->handleAction()
#9 /opt/omd/versions/2.2.0p20.cee/share/nagvis/htdocs/server/core/ajax_handler.php(59): require('...')
#10 {main}