Compare commits

...

2 Commits

@ -21,3 +21,11 @@ Failover from primary Nagios XI to secondary Nagios XI is a Disaster Recovery ef
* Make sure any ramdisk (such as /ramdisk) is copied if it exists * Make sure any ramdisk (such as /ramdisk) is copied if it exists
* Note that any gearman addons such as /etc/mod_gearman or whatever are NOT copied as part of this procedure. These types of things need to be set up on both boxes the same way before this process is set up. * Note that any gearman addons such as /etc/mod_gearman or whatever are NOT copied as part of this procedure. These types of things need to be set up on both boxes the same way before this process is set up.
## Running from cron
The synchronization script should run on the primary at regular intervals to keep the secondary as up-to-date as possible. It is recommended to run the script from cron to accomplish this. At the simplest level, one could do this:
* */30 * * * * /home/nagios/bin/SYNC >> /home/nagios/sync.log
To include a timestamp, this would work:
* */30 * * * * (date; time /home/nagios/bin/SYNC; echo "") >> /home/nagios/sync.log

@ -18,6 +18,7 @@ execute="-n"
syncfile="" syncfile=""
isP=/bin/false isP=/bin/false
isS=/bin/false isS=/bin/false
rsync_opts="-a --delete --delete-after --rsync-path=\"sudo /bin/rsync\" --exclude=/usr/local/nagiosxi/html/includes/components/custom-includes/css/header-gradient.css"
# Import Nagios XI and xi-sys.cfg config vars # Import Nagios XI and xi-sys.cfg config vars
. $BASEDIR/../var/xi-sys.cfg . $BASEDIR/../var/xi-sys.cfg
@ -120,8 +121,8 @@ do_rsync() {
verbose "Syncing $*..." verbose "Syncing $*..."
src="$1" src="$1"
[ ! -e "$src" ] && warning " OK: No such file or directory: $src" && return [ ! -e "$src" ] && warning " OK: No such file or directory: $src" && return
[ -d "$src" ] && sudo rsync -a --delete --delete-after --rsync-path="sudo /bin/rsync" ${execute} ${src}/ nagios@${sName}:${src}/ [ -d "$src" ] && sudo rsync ${rsync_opts} ${execute} ${src}/ nagios@${sName}:${src}/
[ -f "$src" ] && sudo rsync -a --delete --delete-after --rsync-path="sudo /bin/rsync" ${execute} ${src} nagios@${sName}:${src} [ -f "$src" ] && sudo rsync ${rsync_opts} ${execute} ${src} nagios@${sName}:${src}
} }
do_backup_files() { do_backup_files() {

Loading…
Cancel
Save