installatie NDOUtils

Met NDOUtils is het mogelijk de nagios data in een MySQL database te stoppen.

Dit is nodig voor bijvoorbeeld nagvis

Hier de stappen die wel werken :-)

Installeer de volgende onderdelen

apt-get install libmysqlclient15-dev

apt-get mysql-server

apt-get phpmyadmin

nu kun je de standaard stappen doorlopen

bron: http://nagios.sourceforge.net/docs/ndoutils/NDOUtils.pdf

Last Updated: April 18, 2007 Page 2 of 15 Copyright (c) 2005-2007 Ethan Galstad

4. INSTALLATION

1. Prerequisites

In order to use the NDOUtils addon you'll need to have the following installed and working on your system:

Nagios (see below for versions)

MySQL

2. Version Compatability

In order to use the NDOUtils addon, you'll need to be running at least Nagios 2.0 (stable). NDOUtils will not work

with beta releases of Nagios 2.0. NDOUtils also works with updates to the Nagios 2.x branch, and the current

development branch of Nagios 3.

3. Obtaining New Versions

You can always obtain the latest version of the NDOUtils addon by visiting the Nagios download site at:

http://www.nagios.org/download/

Bugs are bound to be present in this daemon, and updates are always being made to Nagios, so its important that

you stay up to date with the latest version of NDOUtils that works with the version of Nagios you have.

4. Compiling

Compiling should be easy as pie.

If you haven't already, unpack the NDOUtils tarball:

tar xzf ndoutils-1.4.tar.gz

Change to the ndoutils-<version> directory that has been created and run the configure script:

cd ndoutils-1.4

Compile the components of the addon with the following command:

./configure

make

Last Updated: April 18, 2007 Page 12 of 15 Copyright (c) 2005-2007 Ethan Galstad

NDOUTILS

Documentation

5. Installation

There isn't currently a "make install" functionality, so you'll have to manually install the various components of the

addon. Don't worry – its pretty easy...

There are two versions of the ndomod.o NEB module and ndo2db daemon that get compiled. One for Nagios 2.x

and one for Nagios 3.x. Each Nagios-specific binary is named after the version it works with:

ndomod-2x.o <- These work with Nagios 2.x

ndo2db-2x

ndomod-3x.o <- These work with Nagios 3.x

ndo2db-3x

There are two other binaries that come with the NDOUtils addon that are not (Nagios) version-specific. They are

file2sock

log2ndo

In order to install the NDOUtils components on your system, you'll need to copy the compiled binaries into your

Nagios binary directory (usually /usr/local/nagios/bin) like so:

cp ndomod-2x ndo2db-2x log2ndo file2sock /usr/local/nagios/bin

If you're using Nagios 3.x, make sure you use "ndomod-3x" and "ndo2db-3x" in the command shown above.

Note: This assumes that you're running the NDO2DB daemon on the same server that runs Nagios. If you plan

on running the NDO2DB daemon on another machine, you'll need to install the daemon binary on the remote

machine.

That's it! Now its time to configure everything...

optie die ook kan is

cp ./src/ndomod-3x.o /usr/local/nagios/bin/ndomod.o

cp ./src/ndo2db-3x /usr/local/nagios/bin/ndo2db

cp ./config/ndo2db.cfg /usr/local/nagios/etc/

cp ./config/ndomod.cfg /usr/local/nagios/etc/

sudo chmod 774 /usr/local/nagios/bin/ndo*

sudo chown nagios:nagios /usr/local/nagios/bin/ndo*

6. Initializing the Database

Currently, the NDOUtils addon only supports MySQL as a database backed. Support for PostgresQL will likely be

added in the future.

NOTE: If you aren't already using it, I would suggest installing phpMyAdmin (

http://www.phpmyadmin.net) to help

manage your MySQL server and databases.

1. First, you'll need to create a new database called "nagios", or whatever you'd like.

2. Next, add a user that as SELECT, INSERT, UPDATE, and DELETE privileges on the database you just

created. Keep this information handy, as you'll need it when you configure things.

3. Finally, run the installation script to create the database tables necessary to hold the data the NDO2DB

daemon. The script for doing this (installdb) can be found in the db/ subdirectory of the NDOUtils

distribution.

cd db

./installdb

Deze stappen heb bij mij veel problemen gegeven lees meldinging als unable to sink

Dit zijn de stappen die ik gedaan heb.

mysql -u root -p

mysql> CREATE DATABASE `ndo` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;

mysql> exit

mysql -u root ndo < /createNDODB.sql <dit sql script staat onderaan deze site>

mysql -u root

mysql> CREATE USER 'nagiosuser'@'localhost' IDENTIFIED BY '***';

mysql>GRANT USAGE ON * . * TO 'nagiostest'@'localhost' IDENTIFIED BY '***' WITH MAX_QUERIES_PER_HOUR 0 MAX_CONNECTIONS_PER_HOUR 0MAX_UPDATES_PER_HOUR 0 MAX_USER_CONNECTIONS 0 ;

mysql> GRANT SELECT , INSERT , UPDATE , DELETE ON `ndo` . * TO 'nagiosuser'@'localhost';

mysql> SET PASSWORD FOR 'nagiostest'@'localhost' = PASSWORD( '<password>' )

mysql> flush privileges;

mysql> exit

NDOUTILS

Documentation

7. Configuration

Its time to configure the NDOUtils addon components. Sample config files are included in the config/ subdirectory

of the NDOUtils distribution.

1. First, add the entries from the sample nagios.cfg file (located in the config/ subdirectory) to your main

Nagios configuration file (usually /usr/local/nagios/etc/nagios.cfg). Uncomment the appropriate config file

entry as noted to match the version of Nagios that you're running.

2. Next, copy the sample NDOUtils config files to the Nagios etc/ directory:

cp ndomod.cfg ndo2db.cfg /usr/local/nagios/etc

3. Edit the ndomod.cfg and ndo2db.cfg config files to match your setup. You'll need to specify things like the

database name, prefix, username/password, etc.

4. Make sure the following entry appears in your main Nagios configuration file (nagios.cfg). If you don't

specify this option, Nagios may not pass any data to the addon for storage in the database.

event_broker_options=-1

8. Getting Things Running

make install-init

service ndo2db start

9. Patch

mochten applications nog steeds niet goed werken voor dan de sql querys uit

ALTER TABLE `nagios_hostchecks` ADD COLUMN `long_output` varchar(8192) NOT NULL default '' AFTER `output`;

ALTER TABLE `nagios_hoststatus` ADD COLUMN `long_output` varchar(8192) NOT NULL default '' AFTER `output`;

ALTER TABLE `nagios_servicechecks` ADD COLUMN `long_output` varchar(8192) NOT NULL default '' AFTER `output`;

ALTER TABLE `nagios_servicestatus` ADD COLUMN `long_output` varchar(8192) NOT NULL default '' AFTER `output`;

ALTER TABLE `nagios_statehistory` ADD COLUMN `long_output` varchar(8192) NOT NULL default '' AFTER `output`;

ALTER TABLE `nagios_eventhandlers` ADD COLUMN `long_output` varchar(8192) NOT NULL default '' AFTER `output`;

ALTER TABLE `nagios_systemcommands` ADD COLUMN `long_output` varchar(8192) NOT NULL default '' AFTER `output`;

ALTER TABLE `nagios_notifications` ADD COLUMN `long_output` varchar(8192) NOT NULL default '' AFTER `output`;