[op5-users] Guide to installing Nagvis on Nija

"Mike" mike at mikehobbs.co.uk
Fri Jul 17 14:36:55 CEST 2009


HI All

as I've been looking at installing Nagvis on Ninja I thought I would list
the process here in case anyone else wanted to do it

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

==Setup==

This install assumes Ninja and Merlin are already installed, some paths may
need to be adjusted for your own setup

===Suggested paths===

######
	Nagios root = /usr/local/nagios
	Nagvis install directory = /usr/local/nagios/etc/addons
######

==Preinstall checklist==

Nagvis requires the following software to be installed

######
	php 5.2
	php5-gd
	php5-gettext
	php5-mysql
	php5-mbstring
	php5-session
	php5-xml
	graphviz

######

==How to install==

Unpack the archive to the webroot you require and rename

######
	tar xvzf nagvis-1.4*.tar.gz /usr/local/nagios/etc/addons
	cd /usr/local/nagios/etc/addons
	mv nagvis-1.4 nagvis
	cd nagvis

######

change perms for nagvis directory


######
	chown -R nagios:nagios nagvis

	cp /usr/local/nagios/etc/addons/nagvis/etc/nagvis.ini.php-sample
/usr/local/nagios/etc/addons/nagvis/etc/nagvis.ini.php

######

create httpd conf file for nagvis and link it to Nagios's htpasswd file

######
	vi /etc/httpd/conf.d/nagvis.conf


	Alias /nagvis "/usr/local/nagios/etc/addons/nagvis"
	<Directory "/usr/local/nagios/etc/addons/nagvis">
		Order allow,deny
		Allow from all
		DirectoryIndex index.php
		AuthName "Nagvis Access Required"
		AuthType Basic
		AuthUserFile /usr/local/nagios/etc/htpasswd.users
		Require valid-user
		Options None
		AllowOverride None
	</Directory>

######

create symlink to nagvis config file in nagios etc (just to make editing it
easier)

######
	cd /usr/local/nagios/etc/
	ln -s /usr/local/nagios/etc/addons/nagvis/etc/nagvis.ini.php .

######

edit the nagvis config file

######

	vi /usr/local/nagios/etc/addons/nagvis/etc/nagvis.ini.php

######

enter these values (change to match your merlin DB setup

######
set paths
	; Path definitions
	[paths]
	; absolute physical NagVis path
	base="/usr/local/nagios/etc/addons/nagvis/"
	; absolute html NagVis path
	htmlbase="/nagvis
        ; absolute html NagVis cgi path
        htmlcgi="/ninja/index.php"

;default values to get maps to link back to Ninja

        ; target for the icon links
        urltarget="new"
        ; URL template for host object links
        hosturl="[htmlcgi]/status/host/[host_name]"
        ; URL template for hostgroup object links
        hostgroupurl="[htmlcgi]/status/hostgroup/[hostgroup_name]"
        ; URL template for service object links

serviceurl="[htmlcgi]/extinfo/details/service/[host_name]?service=[service_d
escription]"
        ; URL template for servicegroup object links

servicegroupurl="[htmlcgi]/status/servicegroup/[servicegroup_name]?style=det
ail"

; default backend (id of the default backend)
	backend="merlinmy_1"

	; in this example the ID of the Backend is "merlinmy_1" you can define
another ID.
	[backend_merlinmy_1]
	; type of backend - MUST be set
	backendtype="merlinmy"
	; hostname for Merlin db
	dbhost="localhost"
	; portname for Merlin db
	dbport=3306
	; database name for Merlin db
	dbname="merlin"
	; username for Merlin db
	dbuser="merlin"
	; password for Merlin db
	dbpass="XXXXX"
	; maximum delay of the Merlin Database in seconds
	maxtimewithoutupdate=180
	; path to the cgi-bin of this backend
	htmlcgi="/ninja/index.php"

hash out all entries for
	;[backend_ndomy_1]
	;[backend_ndo2fs_1]

######


check file perms for nagvis

######
	chmod 664 /usr/local/nagios/etc/addons/nagvis/etc/nagvis.ini.php
	chmod 775 /usr/local/nagios/etc/addons/nagvis/nagvis/images/maps
	chmod 664 /usr/local/nagios/etc/addons/nagvis/nagvis/images/maps/*
	chmod 777 /usr/local/nagios/etc/addons/nagvis/etc/maps
	chmod 666 /usr/local/nagios/etc/addons/nagvis/etc/maps/*
	chmod 777 /usr/local/nagios/etc/addons/nagvis/var
	chmod 664 /usr/local/nagios/etc/addons/nagvis/var/*

######

Edit Ninja's config

######
	vi /usr/local/nagios/etc/addons/ninja/application/config/config.php


	/**
	 * Do we use NagVis?
	 * If path differs from the one below but still installed
	 * you could simply change it.
	 */
	$config['nagvis_real_path'] = '/usr/local/nagios/etc/addons/nagvis/';
	if (is_dir($config['nagvis_real_path'])) {
		$config['nagvis_path'] = '/usr/local/nagios/etc/addons/nagvis';
	} else {
		$config['nagvis_path'] = false;
	}

######

restart httpd

######
	service httpd restart

######

if you don't care about securing nagvis change the http.conf


######
	vi /etc/httpd/conf.d/nagvis.conf

	Alias /nagvis "/usr/local/nagios/etc/addons/nagvis"
	<Directory "/usr/local/nagios/etc/addons/nagvis">
		Order allow,deny
		Allow from all
		DirectoryIndex index.php
		AllowOverride All
	</Directory>


	vi /usr/local/nagios/etc/addons/nagvis/.htaccess

	SetEnv REMOTE_USER admin

######

now nagvis should be working in your ninja instance and you can also browse
to nagvis via

######
http://IP ADDRESS/nagvis
######

cheers

Mike


More information about the op5-users mailing list