skip to main content

Load balanced monitoring

Load balanced monitoring
About the load balanced monitoring
This chapter covers the following topics:
Introduction
The op5 Monitor back end can easily be used as a load balanced monitoring solution. The load balanced model looks like this.
The load balanced solution
*
*
*
*
*
Before we start
There are a few things you need to take care of before you can start setting up an load balanced monitoring. You need to make sure
*
you have at least two op5 Monitor servers of the same architecture up and running.
*
*
*
15551, op5 Monitor back end communication port
*
22, ssh (for the configuration sync).
*
The configuration
Setting up the load balanced solution
This load balanced configuration will have two so called peers:
*
*
During the setup we will use the command:
mon
The mon command is used to make life a bit easier when it comes to setting up a load balanced solution. To get more detailed information about the command mon just execute like this:
mon --help
To setup a load balanced monitoring solution
1
2
3
Create and add ssh keys to and from the second peer by
as root user:
mon sshkey push --all
mon sshkey fetch --all
4
Add peer01 as a peer at peer02
mon node ctrl peer02 -- mon node add peer01 type=peer
5
6
Restart and push the logs from peer01 to peer02:
mon restart; sleep 3; mon oconf push
Adding a new peer
In this instruction we will have the following hosts:
*
*
*
peer03 (This is the new one.)
To add a new peer
1
2
3
Get all ssh keys in place
mon sshkey push --all
mon sshkey fetch --all
4
Add the peers to one and each other
mon node ctrl peer02 -- mon node add peer03 type=peer
mon node ctrl peer03 -- mon node add peer02 type=peer
mon node ctrl peer03 -- mon node add peer01 type=peer
5
6
 
Removing a peer
In this instruction we will remove a peer called:
peer02
The peer will be removed from all other peers configurations.
To remove a peer
1
2
Remove all peer configuration from peer02
mon node ctrl peer02 -- mon node remove peer01
mon node ctrl peer02 -- mon node remove peer03
3
Restart monitor on peer02
mon node ctrl peer02 -- mon restart
4
Remove peer02 from the rest of the peers, in this case peer03
mon node ctrl --type=peer -- mon node remove peer02
5
Restart the rest of the peers, in this case only peer03
mon node ctrl --type=peer -- mon restart
6
7
File synchronization
To synchronize files between servers add a sync paragraph in the file /opt/monitor/op5/merlin/merlin.conf
In the example below we will synchronize the htpasswd.users file to the peer “peer01”
peer peer01 {
address = <ip>
port = <port>
 
sync {
/opt/monitor/etc/htpasswd.users /opt/monitor/etc/htpasswd.users
}
}
Note that this is done per peer.
More information
For more information and a more complex example please take a look at the howto in the git repository of the opensource project of Merlin:
http://git.op5.org/git/?p=nagios/merlin.git;a=blob;f=HOWTO;hb=master#l171

Feedback on documentation Feedback on documentation