descriptionnagios-merlin is an eventbroker module / daemon pair which acts as an event transport layer. Transporting events between multiple Nagios instances allows building loadbalanced, redundant and distributed monitoring solutions quite easily.
homepage URLhttp://www.op5.org/community/projects/merlin
repository URLgit://git.op5.org/nagios/merlin.git
ownerdavid.voit@lfst.bayern.de
last changeWed, 9 Jul 2014 12:44:12 +0000 (9 14:44 +0200)
content tags
add:
README
Requirements
------------
Merlin requires Nagios 4, and needs the libnagios-devel package
for building, as well as for running.

For running merlin with its default configuration, you'll need
to have libdbi-dbd-mysql and all of its dependencies (generally
libdbi-drivers, libdbi and mysql-libs) installed.

You will ofcourse also need an sql database supported by libdbi
(refer to the libdbi documentation for further information about
supported databases), as well as a Nagios installation that the
merlin module can plug in to. The import script is currently
limited to MySQL only, so that's currently the only database
supported.

For the import script to work, you need to have php-cli and
php-mysql installed. They may be named differently in your
distribution, but I'm sure you get the idea.

The install script requires administration privileges to create
its installation directories and copy files there, as well as
sql administration privileges in order to create the database
that merlin will populate for you.

GNU sed 4.0.9 or better is required for the install script to
be able to modify your nagios configuration files.


Compilation
-----------
Merlin doesn't support autoconf (and I'm reluctant to take
patches that makes it do so). You'll need to have libdbi-devel
installed. If it's not in a default location, please amend the
CPPFLAGS manually while running make, like so:

     make CPPFLAGS="-I/usr/local/include"


Installation
------------
There is an install-script provided here which will attempt to
make all the necessary modifications to your nagios.cfg file
as well as installing merlin on your system. Please run

  sh install-merlin.sh --dest-dir=/path/to/merlin \
           --nagios-cfg=/path/to/nagios.cfg \
		   --db-type=mysql --db-user=merlin --db-pass=merlin \
		   --db-name=merlin

Note that the install-merlin.sh script requires write access to
whatever directory you choose as --dest-dir, as well as access
to write to your nagios.cfg file.
Also note that the install script can only handle setting up
mysql databases at the moment. Patches welcome to make it also
handle postgresql and whatever else you feel there is a need for.
If a different database type is selected, the install script will
still work, but it will not create the database for you.

Configuration
-------------
Configuring merlin is pretty straight-forward. Check the example.conf
file that accompanies this release and you'll see most of the common
examples available.

The syntax is fairly standard, being made up of a key without
spaces and a value containing arbitrary characters (although no
semi-colons). A configuration statement is terminated either by a
newline or a semi-colon. A configuration statement starting with a
hash-character (#) is considered a comment. Thus,

  key = value; # comment

makes "key" the key, "value" the value, terminated by the semi-colon,
and "# comment" all of the comment.
Leading and trailing whitespace is ignored.

The thing it doesn't really cover very well is how to configure masters,
peers and pollers, which is described more in-depth here.

In order to set up a loadbalanced system (ie, 2 or more peers), all
you need to do is add a section similar to the following to your
merlin configuration files on your merlin-empowered Nagios systems.
Let's pretend we have "nagios1" and "nagios2" in the network and
you wish for them to be set up in loadbalanced/redundancy mode.
nagios1 has 192.168.1.1 as IP. nagios2 has 192.168.1.2. Both use
port 15551 (the default).

On nagios1, add the following section to your merlin.conf file:
  --------------
  peer nagios2 {
    address = 192.168.1.2;
    port = 15551; # optional, since 15551 is the default
  }
  --------------

On nagios2, add the following section to your merlin.conf file:
  --------------
  peer nagios1 {
    address = 192.168.1.1;
    port = 15551; # optional, since 15551 is the default
  }
  --------------

Assuming nagios2 is a poller-node instead, responsible for checking
hosts in germany, you need to create a hostgroup in Nagios containing
all the hosts in germany that you want nagios2 to check for you. Let's
assume you call that hostgroup "germany-hosts". Then you need to add
following sections to your merlin.conf files.

On nagios1 (the "master" server), add the following section:
  --------------
  poller nagios2 {
    address = 192.168.1.2;
	port = 15551;
	hostgroup = germany-hosts; # name of the hostgroup containing all
	                           # the hosts you want this poller to check
  }
  --------------

On nagios2 (the slave server), add the following section:
  --------------
  master nagios1 {
    address = 192.168.1.1;
	port = 15551;
  }
  --------------

Note that these configuration sections need to be in the base section
of the configuration file. They must *not* be inside the daemon section.
This is because the master server will disable checks for all its pollers
once those pollers connect, and therefore it needs to read the list of
available nodes at configuration time.

A merlin node can have up to 65534 neighbours (assuming your system
lets a single program have that many file-descriptors open). A neighbour
is, in merlin terminology, a node that merlin connects to directly, so
you can build arbitrarily large networks by just specifying multiple
tiers of pollers.

A single merlin node can have pollers, peers and master nodes in its own
neighbourhood. As such, a single merlin node can, at the same time be
a peer (to its peers), a master (to its pollers) and a poller (to its
masters). One section has to be added to the merlin.conf file for each
of the hosts in its neighbourhood. The section must contain the
address of the neighbour, the port the neighbour is listening to
(unless it's the default port 15551) and, if the neighbour is a poller,
the section *must* contain a hostgroup statement declaring which
hostgroup the poller is responsible for checking.
shortlog
2014-07-09 Robin Soneforsdb_updater: Put parentheses backmaster
2014-07-09 Robin Soneforsdb_updater: Allocate space for trailing NULL byte for...
2014-07-08 Robin SoneforsMerge changes Iafc81c17,I43eba719v2.1.2-beta5
2014-07-08 Max SikstromMerge "daemon: Delete max sync attempts feature"
2014-07-08 Robin Soneforsdaemon: Delete max sync attempts feature
2014-07-07 Philip Eklöfmon: Rename main script to "op5"
2014-07-07 Philip Eklöfmon: Make oneself aware of one's own program name
2014-07-04 Philip Eklöfmon query ls: Simplify list filtering
2014-07-02 Mikael Falkviddspec: Add merlin to chkconfig on clean installv2.1.2-beta4
2014-06-27 Robin Soneforsnet: Compare config before resetting memory
2014-06-26 Robin SoneforsFix notification counters, again
2014-06-26 Robin Soneforsdb_updater: Remove harmful callbacks
2014-06-25 Mattias RyrlenMerge changes I9ef0097d,Ib9f094de,I2c7797dc,Ia462fddcv2.1.2-beta3
2014-06-25 Mattias RyrlenMerge "Revert "module hooks: Enable handler for notific...
2014-06-25 Robin SoneforsMerge "daemon: Implement much-logged-about negotiations"
2014-06-25 Robin Soneforstest: Make mon test dist possible to run as root
...
tags
10 years ago v2.1.2-beta6 Monitor 7.0 beta
10 years ago v2.1.1.2-beta1 Primarily a fix for bug 8903
10 years ago v2.1.2-beta5 Monitor 7.0 beta
10 years ago v2.1.2-beta4 Monitor 7.0 beta
10 years ago v2.1.2-beta3 v2.1.2-beta3
10 years ago v2.1.2-beta2 Monitor 7.0 beta
10 years ago v2.1.1.1 v2.1.1.1
10 years ago v2.1.1.1-beta1 v2.1.1.1-beta1
10 years ago v2.1.2-beta1 v2.1.2-beta1
10 years ago v2.1.1 v2.1.1
10 years ago v2.1.1-beta9 v2.1.1-beta9
10 years ago v2.1.0.2 v2.1.0.2
10 years ago v2.1.1-beta8 v2.1.1-beta8
10 years ago v2.1.1-beta7 v2.1.1-beta7
10 years ago v2.1.1-beta6 v2.1.1-beta6
10 years ago v2.1.1-beta5 v2.1.1-beta5
...
heads
10 years ago master
10 years ago dev/4481
10 years ago dev/5408
10 years ago dev/protobuf
10 years ago maint-6.2
10 years ago dev/test-fewer-nodes
10 years ago dev/merlin-posttest
10 years ago for/master
10 years ago dev/for-robin
11 years ago dev-patchfail
11 years ago dev-Change-I0e5a74f4
11 years ago dev-bug-7970
11 years ago dev-7994
11 years ago dev-bug-6498
11 years ago maint-5.8
11 years ago maint-6.1
...