There is limited support for synchronizing files between peers, and between masters and pollers.
For example, when a new user has been added in op5 Monitor on one of your masters, this function can be used to automatically synchronize the user database files on all other peers and pollers.
Although the setup is the same configuration-wise, there are two common but different ways of synchronization:
- Peered masters synchronizing files with one another (two-way).
- Masters synchronizing files to pollers (one-way).
The example and the described procedure below applies to both of these cases. However, it is recommended to repeat the procedure for all peers in case of file synchronization between peers.
Configuring the sync directive
In this example, the master will synchronize files to its poller called poller01.
The following files will be synchronized:
The contents of the following directory will also be synchronized.
- Log on to the source node via SSH (in this case the master), as root.
- Edit the file /opt/monitor/op5/merlin/merlin.conf using a text editor:
Find the configuration block related to the destination node (in this case poller01). Within this block, a new sync sub-block is inserted.
The trailing slash at the end of /opt/plugins/custom/ in the example above indicates that the contents of the directory should be synchronized, rather than the directory itself. This is the recommended way of synchronizing directories.
The files will be synchronized using the monitor system user ? not root. This means that:
- Files and directories set up for synchronization must be readable and owned by the monitor user. For instance, root-only readable files cannot be synchronized.
- All file paths and their corresponding directories, must be writable by the monitor user on the destination node.
Triggering the synchronization
The file and directory synchronization occurs during a configuration push, which is triggered as a new configuration is saved in the web interface. For instance, adding a new host in Monitor and then saving the configuration will trigger this.
A configuration push to pollers is only triggered if the new configuration affects objects on the poller. A manual configuration push can be triggered using the command: asmonitor mon oconf push