Has anyone worked out an effective, scriptable method to sync ONLY performance and state data between two Nagios instances.
We use Mod-Gearman with a set of Nagios servers separated over WAN links. This works fine so long as all the Nagios servers are available to receive data from the workers.
However, there occasionally arises a situation where one or more servers in the set are taken offline and no longer receive performance and state information from the workers and fall out of sync with the other servers.
What I would like is an effective way to resync ONLY the performance and state data from the most up-to-date Nagios servers to those that have fallen behind. Preferably some method that can be automated via scripting.
Thanks,
Jaimie Livingston
Syncing Performance and State Data between Nagios instances
-
jaimie.livingston
- Posts: 59
- Joined: Wed Nov 23, 2016 10:41 am
-
npolovenko
- Support Tech
- Posts: 3457
- Joined: Mon May 15, 2017 5:00 pm
Re: Syncing Performance and State Data between Nagios instan
Hello, @jaimie.livingston. I do not have an efficient tested method but I can provide with some tips that can help you with setting this up.
To sync performance data between two servers you'll need to synchronize rrd and xml files in the /perfdata/ folder on one XI server with another.
You can possibly look into rsync to sync the folder above or host perfdata on a shared network storage device and create symlinks to the folder on both XI servers.
Synchronizing state data will be a bit more challenging as it is stored in the database. (nagios_statehistory table in the nagios database). You'd need to dump the table on one XI and import it into another XI. Provided you don't want to backup-restore everything. Some users are using DB clustering software that syncs two db instances, but Nagios is known to not be 100% compatible with clustered DB and I've seen Nagios process crashing during backups.
Also, state history data used in Nagios reports is stored in the archived log files which are stored in /usr/local/nagios/var/archives So if you want to sync the state history data to run reports, then you'll need to sync all files in that folder as well, plus the most recent nagios.log file located in:
To sync performance data between two servers you'll need to synchronize rrd and xml files in the /perfdata/ folder on one XI server with another.
Code: Select all
/usr/local/nagios/share/perfdata/Synchronizing state data will be a bit more challenging as it is stored in the database. (nagios_statehistory table in the nagios database). You'd need to dump the table on one XI and import it into another XI. Provided you don't want to backup-restore everything. Some users are using DB clustering software that syncs two db instances, but Nagios is known to not be 100% compatible with clustered DB and I've seen Nagios process crashing during backups.
Also, state history data used in Nagios reports is stored in the archived log files which are stored in /usr/local/nagios/var/archives So if you want to sync the state history data to run reports, then you'll need to sync all files in that folder as well, plus the most recent nagios.log file located in:
Code: Select all
/usr/local/nagios/var/nagios.logAs of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
-
jaimie.livingston
- Posts: 59
- Joined: Wed Nov 23, 2016 10:41 am
Re: Syncing Performance and State Data between Nagios instan
Thanks for the info.
From what you've provided, the perfdata probably won't pose a huge challenge.
I may just have to abandon syncing state data for now.
Thanks again.
From what you've provided, the perfdata probably won't pose a huge challenge.
I may just have to abandon syncing state data for now.
Thanks again.
-
npolovenko
- Support Tech
- Posts: 3457
- Joined: Mon May 15, 2017 5:00 pm
Re: Syncing Performance and State Data between Nagios instan
@jaimie.livingston. No problem. I'll be marking this thread as resolved.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.