Nagvis integration Icingaweb2

Hi all,

I really need help inegrating the nagvis module in icinga2. Been trying to do this for 2 weeks but everytime i fix something there is a new error. I basically followed this guide to integrate nagvis:
https://dokuwiki.nausch.org/doku.php/centos:web_c7:icinga:nagvis and of course a lot of other sources including the documentation.

This is what it currently looks like in icingaweb2:

My system information:

Fedora Red Hat enterprise linux 7.5 (Maipo)

This is what my configs look like:

  • Apache config in etc/httpd/conf.d/nagvis.conf (reduced) :

      Alias /nagvis "usr/share/nagvis/share"
    
      <Directory "usr/share/nagvis/share">
        Options FollowSymLinks
        AllowOverride None
    
       <IfModule mod_authz_core.c>
          #Apache >= 2.4
          Require all granted
        </IfModule>
        <IfModule !mod_authz_core.c>
           #Apache < 2.4
          Order allow,deny
          Allow from all
        </IfModule>
      <IfModule mod_rewrite.c>
      RewriteEngine On
      RewriteBase /nagvis
      # Redirect old regular map links
      RewriteCond %{REQUEST_URI} ^/nagvis/frontend/(wui|nagvis-js)
      RewriteCond %{QUERY_STRING} map=(.*)
      RewriteRule ^(.*)$ /nagvis/frontend/nagvis-js/index.php?mod=Map&act=view&show=%1 [R=301,L]
    
      # Without map= param
      RewriteCond %{REQUEST_URI} ^/nagvis/frontend(/wui)?/?(index.php)?$
      RewriteRule ^(.*)$ /nagvis/frontend/nagvis-js/index.php [R=301,L]
    
      # Redirect old rotation calls
      RewriteCond %{REQUEST_URI} ^/nagvis/frontend/nagvis-js
      RewriteCond %{QUERY_STRING} !mod
      RewriteCond %{QUERY_STRING} rotation=(.*)
      RewriteRule ^(.*)$ /nagvis/frontend/nagvis-js/index.php?mod=Rotation&act=view&show=%1 [R=301,L]
        </IfModule>
      </Directory>
    
  • nagvis.ini.php in /usr/share/nagvis/etc/nagvis.ini.php (reduced) :

      [global]
    
      file_group="apache"
      
      language="de_DE"
     
      ; Path definitions
      [paths]
      ; absolute physical NagVis path
      ;base="/usr/local/nagvis/"
      base="/usr/share/nagvis/"
      ; absolute html NagVis path
      ;htmlbase="/nagvis"
      ; absolute html NagVis cgi path
      htmlcgi="/icingaweb2/monitoring"
    
      ; Default values which get inherited to the maps and its objects
      [defaults]
      urltarget="_parent"
      hosturl="[htmlcgi]/host/show?host=[host_name]"
      hostgroupurl="[htmlcgi]/list/hosts?hostgroup=[hostgroup_name]"
      serviceurl="[htmlcgi]/service/show?host=[host_name]&service=[service_description]"
      servicegroupurl="[htmlcgi]/list/services?servicegroup=[servicegroup_name]"
    
     
      [index]
    
      [automap]
    
     
      [wui]
    
      [worker]
     
      [backend_live_1]
      backendtype="mklivestatus"
     
      socket="unix:/var/run/icinga2/cmd/livestatus"
    
      ; Example definition for a MySQL backend
      ; in this example the ID of the Backend is "ndomy_1" you can define another ID.
      [backend_ndomy_1]
      ; type of backend - MUST be set
      backendtype="ndomy"
     
      [states]
     
    
      ; -------------------------
      ; EOF
      ; -------------------------
    
  • The nagvis module is located in usr/share/icingaweb2/nagvis.

  • it is enabled in the icingaweb2 frontend, config like this:

I have tried lots of approaches to make it work.

Would be so nice if someone could push me in the right direction/ give me a hint. I am out of ideas atm. If you need more information i am happy to upload more!

Thanks in advance, cheers!

Is there any reason why the paths are relative instead of absolute like
Alias /nagvis "/usr/share/nagvis/share"
<Directory "/usr/share/nagvis/share">

2 Likes

Hello all,
I’m a new comer with Icinga (while I worked with nagios and Centreon in the past.
I have installed Icingaweb2 and Nagvis by folowwing this procedure.

Nagvis Module installed and enable. I can reach it from Icinga web page.
I can creat new objects BUT I have the folwoing message:
“Unable to fetch data from backend - falling back to input field”. So I understand that Nagvis is not able to fetch the data stored in the DB.

image

Please find here after my config.

[paths]
; absolute physical NagVis path
;base="/usr/share/nagvis/"
; absolute html NagVis path
;htmlbase="/nagvis"
; absolute html NagVis cgi path
htmlcgi="/icingaweb2"

[defaults]
backend=“ndomy_1”

[backend_ndomy_1]
backendtype=“ndomy”
statushost=""
dbhost=“localhost”
dbport=3306
dbname=“icingadb”
dbuser="*****"
dbpass="****"
dbprefix=“icinga_”
dbinstancename=“icinga”
; maximum delay of the NDO Database in seconds
;maxtimewithoutupdate=180
;htmlcgi="/icinga/cgi-bin"
;htmlcgi="/icingaweb2"

Check with instancename=default