====== Installing the NDOUtils addon ======
The NDOutils addon stores Nagios related data to MySQL database.
===== Prepare the database =====
Make sure MySQL is installed:
yum install mysql mysql-server mysql-devel perl-DBD-MySQL
chkconfig mysqld on
service mysqld start
# /usr/bin/mysqladmin -u root password ''
Create Database (skip if using Centreon):
create database nagios default character set='utf8' default collate='utf8_general_ci';
grant SELECT, INSERT, UPDATE, DELETE on nagios.* to 'nagios'@'localhost' identified by 'secret';
Create tables (skip if using Centreon):
cd /unpacked-src-folder/db
./installdb -u root -p rootpw -h localhost -d nagios
===== Compile =====
Source used: ndoutils-1.4b9
cd /unpacked-src-folder
./configure \
--enable-mysql \
--disable-pgsql \
--with-ndo2db-user=nagios \
--with-ndo2db-group=nagios
make
As told by the README file, manual install the compiled programs and config files((However, the Makefile support make install methods)):
cp src/ndomod-3x.o /usr/local/bin/ndomod.o
cp src/ndo2db-3x /usr/local/bin/ndo2db
cp config/ndomod.cfg-sample /etc/nagios/ndomod.cfg
cp config/ndo2db.cfg-sample /etc/nagios/ndo2db.cfg
#
cp daemon-init /etc/init.d/ndo2db
chmod 755 /etc/init.d/ndo2db
chkconfig --add ndo2db
chkconfig ndo2db on
Edit the init script ''/etc/init.d/ndo2db'':
...
servicename=ndo2db
prefix=/usr
exec_prefix=/usr
Ndo2dbBin=/usr/local/bin/ndo2db
Ndo2dbCfgFile=/etc/nagios/ndo2db.cfg
Ndo2dbVarDir=/var/run
Ndo2dbRunFile=$Ndo2dbVarDir/ndo2db.pid
Ndo2dbLockDir=/var/lock/subsys
Ndo2dbLockFile=ndo2db
Ndo2dbUser=nagios
Ndo2dbGroup=nagios
...
===== Configuration =====
**Skip this entire section if using Centreon**
Edit the ''/etc/nagios/ndomod.cfg'' to your needs. Normally set these:
output_type=unixsocket
output=/var/lib/nagios/ndo2db.sock
buffer_file=/var/lib/nagios/ndomod.tmp
data_processing_options=-1
Edit the ''/etc/nagios/ndo2db.cfg'' to your needs. Normally set these:
socket_name=/var/lib/nagios/ndo2db.sock
db_pass=secret
Enable Nagios to use NDO2DB addon by settings these in ''/etc/nagios/nagios.cfg'':
event_broker_options=-1
broker_module=/usr/local/bin/ndomod.o config_file=/etc/nagios/ndomod.cfg
----