Nagios/NConf

From Segfault
Jump to: navigation, search

Installation

Nconf has the following requirements:

  • Webserver
  • PHP 5.x (with short_open_tag=on), php-mysql
  • MySQL 5.0.2 or higher, with InnoDB support
  • Perl 5.6 or higher, perl-DBI, perl-DBD-MySQL
  • Nagios 3.x or Icinga 0.8x

With that in place, let's install Nconf:

git clone git://github.com/nconf/development.git nconf-git
git archive --format=tar --prefix=nconf/ HEAD | (cd /opt && tar -xf -)

Set permissions, copy baseline configuration:

cd /opt/nconf
chmod 0770 config output static_cfg temp
cp config.orig/{.[a-z]*,*} config
chown -R root:www-data config output static_cfg temp

Create the database:

$ mysql -u admin -p
mysql> CREATE DATABASE nconf;
mysql> CREATE USER nconf;
mysql> GRANT SELECT, INSERT, UPDATE, DELETE, ON nconf.* TO 'nconf'@'localhost' IDENTIFIED BY 's3cr3t';
mysql> ^D

$ mysql -D nconf -u admin -p < INSTALL_/create_database.sql

Edit config/mysql.php:

$ grep ^define config/mysql.php
define('DBHOST', "localhost");
define('DBNAME', "nconf");
define('DBUSER', "nconf");
define('DBPASS', "s3cr3t");

Edit config/nconf.php

$ egrep 'NCONFDIR|NAGIOS_BIN' config/nconf.php
define('NCONFDIR',     "/opt/nconf");
define('NAGIOS_BIN',   "/usr/sbin/nagios3");

Create an URL alias on the webserver:

alias.url += (  "/nconf"  => "/opt/nconf" )   # lighttpd
Alias            /nconf      "/opt/nconf"     # Apache

Now Nconf should be accessible via http://example.org/nconf. If everything seems to be in order, the installation clutter can be removed:

cd /opt/nconf
rm -rf INSTALL* UPDATE* CHANGELOG COPYRIGHT LICENSE README ADD-ONS/