Nagios/nag2web

From Segfault
Jump to: navigation, search

Installation

nag2web needs a few prerequisites:

sudo apt-get install httpd php5-mysql php5-cli mysql-server nagios3

Check out the source:

svn co svn://svn.code.sf.net/p/nag2web/code/Trunk nag2web-svn

Create the databse:

$ mysql -u admin -p
mysql> create database nag2web;
mysql> create user nag2web;
mysql> grant select, insert, update, delete on nag2web.* to nag2web@localhost identified by 's3cr3t';
^D

$ mysql -D nag2web -u admin -p < mysqldump-nag2web.sql

There's no install routine:

mkdir -p /opt/nag2web/test
cp -a etc/ share/ /opt/nag2web/

cp /etc/nagios3/resource.cfg /opt/nag2web/test/             # ??

Adjust the configuration:

$ grep ^\\$ /opt/nag2web/share/config-ng.inc
$cfg['host']            = 'localhost';   // MySQL hostname or IP address
$cfg['database']        = 'nag2web';     // MySQL database
$cfg['user']            = 'nag2web';     // MySQL username
$cfg['passwd']          = 's3cr3t';      // MySQL user password
$cfg['system']          = 'nagios';      // Monitoring system nagios or icinga
$cfg['n2w_lnk']         = '/nag2web';    // Web link to nag2web

FIXME: the URLs are still garbled, we need to create an alias or something:

 nagios/cgi-bin/extinfo.cgi       <-- nag2web
 cgi-bin/nagios3/extinfo.cgi      <-- Our Nagios3 installation