Icinga Web 2 module with NagVis 1.9.5 and default map & overview

nagvis
icingaweb2

#1

Hi Comunity
I’m stuck with NagVis 1.9.5 running on Icinga2. There are two issues.

Starting NagVis, the Demomap opens. I deleted almost all Demo maps.
I’d like to start the overview instead of the map https://[hostname]/icingaweb2/nagvis/show/map
This should be the link : https://[hostname]/nagvis/frontend/nagvis-js/index.php

Selecting a status icon on the NagVis map results in the following error.
Not Found
The requested URL /nagios/cgi-bin/status.cgi was not found on this server.

Any help is aprechiated, regards


#2
  1. Specify a different default map: https://github.com/icinga/icingaweb2-module-nagvis#map-path-demo-overviewcfg-doesnt-exist

  2. Ensure to have the corresponding settings in your nagvis.ini.php, *url: https://github.com/icinga/icingaweb2-module-nagvis#nagvis-configuration


#3

Hi Michi thanks a lot for the answer. But have no success.

Don’t find default-map=“Overview” in NagVis config description
http://docs.nagvis.org/1.9/en_US/map_config_format_description.html#global

As soon as I add htmlcgi="/icingaweb2" in nagvis.ini.php I get

Fatal error: Uncaught ErrorException: Undefined variable: messages in zend.view:///usr/share/icingaweb2/application/views/scripts/error/error.phtml:15 Stack trace: 
#0 zend.view:///usr/share/icingaweb2/application/views/scripts/error/error.phtml(15): Icinga\Application\ApplicationBootstrap->Icinga\Application\{closure}(8, 'Undefined varia...', 'zend.view:///us...', 15, Array) 
#1 /usr/share/php/Icinga/Web/View.php(270): include('zend.view:///us...') 
#2 /usr/share/icingaweb2/library/vendor/Zend/View/Abstract.php(877): Icinga\Web\View->_run('/usr/share/icin...') 
#3 /usr/share/icingaweb2/library/vendor/Zend/Controller/Action/Helper/ViewRenderer.php(904): Zend_View_Abstract->render(NULL) 
#4 /usr/share/icingaweb2/library/vendor/Zend/Controller/Action/Helper/ViewRenderer.php(925): Zend_Controller_Action_Helper_ViewRenderer->renderScript('error/error.pht...', NULL) 
#5 /usr/share/icingaweb2/library/vendor/Zend/Controller/Action/Helper/ViewRenderer.php(964): Zend_Controller_Action_Helper_ViewRenderer->render() #6 /usr/share/icingawe in /usr/share/icingaweb2/library/vendor/Zend/Controller/Plugin/Broker.php on line 332

#4

You can create such an overview map by yourself. Or you’ll copy the default into your own name. I used to do that inside the Vagrant boxes, but I’ve dropped that integration until it works ootb.

The NagVis one is called demo-overview.cfg and holds a lot of static maps. You still want to modify that in a certain way. https://github.com/NagVis/nagvis/blob/master/etc/maps/demo-overview.cfg

In terms of the exception, it would help to see the entire nagvis.ini.php without whitespaces and comments.

egrep -v "^;|^$" nagvis.ini.php

#5

Hey Thanks
Modified my demo-overview.cfg. Added one Map. How to get the object-id of my map ?

define map {
object_id=858487
map_name=Server
y=85
}

and here is my short :smile: nagvis.ini.php

[global]
file_group="www-data"
language="de_DE"
dateformat="d-m-Y H:i:s"
[paths]
[defaults]
backend="ndomy_1"
showinlists=1
[index]
headermenu=1
showmaps=1
showmapthumbs=1
showrotations=0
[automap]
defaultroot="localhost"
[wui]
[worker]
[backend_live_1]
backendtype="mklivestatus"
[backend_ndomy_1]
backendtype="ndomy"
dbhost="localhost"
dbport=3306
dbname="icinga2"
dbuser="nagvis"
dbpass="xxxxxxxxx"
dbprefix="icinga_"
[states]

#6

AFAIK you can choose any id as long as its unique within your NagVis system.


#7

Please use the three backticks or markdown code block formatting, more details in the FAQ.

As @Wolfgang correctly added, these IDs are auto-generated by the web form. You can just leave them away in your manual configuration. The next time you edit it via the web form, such an ID will be generated and added. No idea, why, but if it works.

In terms of the URLs - that configuration file doesn’t list the defaults section attributes required for them. You should proceed as highlighted in the docs.

[defaults]
; This selects the backend_ndomy_1 defined below
backend = "ndomy_1"

urltarget = "_top"
hosturl="[htmlcgi]/monitoring/host/show?host=[host_name]"
hostgroupurl="[htmlcgi]/monitoring/list/hostgroups?hostgroup_name=[hostgroup_name]"
serviceurl="[htmlcgi]/monitoring/service/show?host=[host_name]&service=[service_description]"
servicegroupurl="[htmlcgi]/monitoring/list/servicegroups?servicegroup_name=[servicegroup_name]"
mapurl="[htmlcgi]/nagvis/show/map?map=[map_name]"
headermenu="0"
stylesheet="icingaweb-nagvis-integration.css"

#8

Hi again

I added the following to nagvis.ini.php

[global]
file_group="www-data"
language="de_DE"
dateformat="d-m-Y H:i:s"
[paths]
[defaults]
backend="ndomy_1"
urltarget = "_top"
hosturl="[htmlcgi]/monitoring/host/show?host=[host_name]"
hostgroupurl="[htmlcgi]/monitoring/list/hostgroups?hostgroup_name=[hostgroup_name]"
serviceurl="[htmlcgi]/monitoring/service/show?host=[host_name]&service=[service_description]"
servicegroupurl="[htmlcgi]/monitoring/list/servicegroups?servicegroup_name=[servicegroup_name]"
mapurl="[htmlcgi]/nagvis/show/map?map=[map_name]"
headermenu="0"
stylesheet="icingaweb-nagvis-integration.css"
[index]
backgroundcolor=#ffffff
headermenu="1"
showmaps=1
showrotations=0
showmapthumbs=1
[automap]
defaultroot="localhost"
[wui]
[worker]
[backend_ndomy_1]
backendtype="ndomy"
dbhost="localhost"
dbport=3306
dbname="icinga2"
dbuser="nagvis"
dbpass="13nagvis97"
dbprefix="icinga_"
[states]

and

[paths]
htmlcgi = "/icingaweb2"

JUST GREAT, WORKS NOW !!