Extension:NagVis

Check extension with Icinga

NagVis is an extension for add NagVis maps to MediaWiki pages. Icons map will be updated automatically and status will be pull from Nagios/Icinga/NagVis servers. NagVis is a visualization addon for the well known network management systems Nagios and Icinga.

Introduction
Usually people monitor a lot of host/services, system administrators spend a lot of time solving trivial problems and a lot alarms/warning can be solved by end user.

If we join a wiki (Mediawiki) for documentation and Icinga/Nagios/NagVis for monitoring, we obtain a powerful tool. System administrator can create instructions, Icinga/Nagios/NagVis reports status and end user can adapt instructions to their needs.

Check usage

 * Mediawiki (1.24.1), Icinga (2.3.2), NagVis (1.8.1) and extension 1.08)

Installation

 * 1) Download the extension (tgz) or (zip).
 * 2) Upload NagVis directory to your extensions directory from the root of your MediaWiki installation.
 * 3) Add   to your LocalSettings.php file (near the end).
 * 4) Done

Usage
To insert a NagVis map add the tag on any page (only one tag per wiki page):

 Header map title 

Tag attributes
The following arguments (tag attributes) can be used to control  tags:
 * showheader (yes/no)
 * Show header with time to refesh map, links to NagVis map and Nagios/Icinga server.


 * urlnagvis
 * NagVis url (Extension will check if it's a correct NagVis site)


 * urlmonitor
 * Nagios/Icinga url ( Mandatory from NagVis 1.6 )


 * map
 * Map name in NagVis


 * mapBackground
 * NagVis map background (if map name and map background are different, see example)


 * nagvispath
 * Web path to NagVis


 * cgibinpath
 * cgi-bin path (Param htmlcgi in nagvis.ini.php)


 * system
 * Icon for monitoring system. (Values: nagios/icinga and default value is icinga) ( optional )



Example
 Title map (NagVis with Mediawiki) 

Notes about authentication
* Important: Before making changes you must read Apache, Nagios, Icinga and NagVis about security risks and recomendations.

MediaWiki must be able to pull status without user authentication so you must change your webserver setup. There are several solutions and your configuration could be different depending on your security needs.

Configuration: example for connecting NagVis without password

 * 1) Create a NagVis user with role Users (read only)
 * 2) Add user to nagvis.conf (in Debian/Ubuntu is located on /etc/apache/conf.d)  SetEnv REMOTE_USER user

...    SetEnv REMOTE_USER user

See NagVis FAQ

1. Create guest user for Icinga (Debian/Ubuntu)
Add guest user:

htpasswd /usr/local/icinga/etc/htpasswd.users guest

Enable guest user for Icinga at /usr/local/icinga/etc/cgi.cfg, uncomment following:

default_user_name=guest

add guest in followings lines:

authorized_for_all_services=icingaadmin,guest authorized_for_all_hosts=icingaadmin,guest

Restart icinga:

/etc/init.d/icinga restart

2. Create guest user for icinga2-classicui (Debian/Ubuntu)
Add guest user:

htpasswd /etc/icinga2-classicui/htpasswd.users guest

Add guest in /etc/icinga2-classicui/cgi.cfg:

authorized_for_all_services=icingaadmin,guest authorized_for_all_hosts=icingaadmin,guest

3. Create guest user for Nagios (Debian/Ubuntu)
Add guest user:

htpasswd /usr/local/nagios/etc/htpasswd.users guest

Enable guest user for Nagios at /usr/local/nagios/etc/cgi.cfg, uncomment following:

default_user_name=guest

add guest in followings lines:

authorized_for_all_services=nagiosadmin,guest authorized_for_all_hosts=nagiosadmin,guest

Restart nagios:

/etc/init.d/nagios restart

Configuration: example for connecting Nagios/Icinga without password
Modify nagios.conf or icinga.conf for apache (ex: Debians servers: /etc/apache2/conf.d/nagios.conf) in all your Nagios/Icinga servers:

ScriptAlias /nagios/cgi-bin "/usr/local/nagios/sbin"  Options ExecCGI AllowOverride All Order allow,deny AuthName "Nagios Access" AuthType Basic AuthUserFile /usr/local/nagios/etc/htpasswd.users Require valid-user Allow from  MediaWiki_Server_IP, Authorized_Users_IP SetEnv REMOTE_USER guest Satisfy Any  Alias /nagios "/usr/local/nagios/share"  Options None AllowOverride All Order allow,deny AuthName "Nagios Access" AuthType Basic AuthUserFile /usr/local/nagios/etc/htpasswd.users Require valid-user Allow from  MediaWiki_Server_IP, Authorized_Users_IP SetEnv REMOTE_USER guest Satisfy Any 

Allow From:
 * MediaWiki_Server_IP : IP address of your MediaWiki Server
 * Authorized_Users_IP : IP address of users who connect to Nagios/Icinga without password

IP's not included in Allow from  should introduce an authorized (Nagios/Icinga) user for pages with NagVis Tag

Screenshots (Examples)

 * NagVis tag with argument showheader=yes:


 * NagVis tag with argument showheader=no


 * When you move the mouse over icons in the maps you get data from Nagios/Icinga/NagVis server:

Versions
Download

1.08:
 * Updated to:
 * NagVis:   1.7 and 1.8 branches


 * Tested on:
 * Mediawiki: 1.24.1

1.06:


 * Updated to:
 * NagVis:   1.6 branch


 * Tested on:
 * Mediawiki: 1.18

1.04:


 * Updated to:
 * NagVis:   1.4 branch


 * Tested on:
 * Mediawiki: 1.14

1.02:


 * Updated to:
 * NagVis:   1.3 branch

1.0:


 * Tested on:
 * Mediawiki: 1.7 and 1.13
 * NagVis: 1.3rc3

If you test other versions, please send an email to