martedì 29 marzo 2011

Install Merlin 0.9 on Nagios 3.2.4

Download Merlin from here

Requirements:

Merlin requires Nagios 3.2.4 or later.

Since (at the time of this writing), Nagios 3.2.4 is not yet released, you'll have to use the latest sources cloned from git, using the following command:

git clone git://git.op5.org/nagios.git

and follow the common Nagios installation istructions.

Dependencies:
- libdbi- dbd-mysql
- mysql-libs
- php-mysql
- php-cli

Installation:

Type:
$ make CPPFLAGS="-I/usr/local/include"

Type:
$ sudo sh install-merlin.sh --dest-dir=/usr/local/merlin --nagios-cfg=/usr/local/nagios/etc/nagios.cfg --db-type=mysql --db-user=merlin --db-pass=merlin --db-name=merlin

The output allows you to check the configuration before to start the setup:

Database settings:
Type (--db-type): mysql
Name (--db-name): merlin
Username (--db-user): merlin
Password (--db-pass): merlin
Root Password (--db-root-pass):

Path settings:
Nagios config file (--nagios-cfg): /usr/local/nagios/etc/nagios.cfg
Destination directory (--dest-dir): /usr/local/merlin
libexecdir (--libexecdir): /usr/libexec/merlin
bindir (--bindir): /usr/bin
Base root (--root):

I was unable to install Merlin using a database root password. In case of errors, just keep in mind that could be a problem related to the password.

Stop Nagios typing the following command:

$ /etc/init.d/nagios stop

Start Nagios again

/etc/init.d/nagios start

The output should be:

Starting nagios:Logging to '/usr/local/merlin/logs/neb.log'
[1301427946] 6: Merlin Module Loaded
[1301427946] 6: Coredumps in /home/sidel
[1301427946] 6: Merlin module initialized successfully
[1301427946] 6: Handled 0 events from/to ipc in 0.012s. in: 0, out: 0
[1301427946] 6: Handled 0 bytes from/to ipc in 0.012s. in: 0 bytes, out: 0 bytes
[1301427946] 6: Creating binary backlog for ipc. On-disk location: /opt/monitor/op5/merlin/binlogs/module.ipc.binlog
done.

Otherwise it will state:
[1301427937] 6: Unloading Merlin module