Compare commits

..

6 Commits

@ -16,6 +16,6 @@ copy:
rsync -avu /home/nagios/princeton/failover/ /home/nagios/bin/ rsync -avu /home/nagios/princeton/failover/ /home/nagios/bin/
release: release-%:
rm -f release.zip rm -f $@.zip
zip -r release.zip colors.sh failover.sh nagios_startstop.sh rsync_xi.sh START STOP SYNC local/ zip -r $@.zip colors.sh failover.sh nagios_startstop.sh rsync_xi.sh START STOP SYNC local/

@ -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

@ -1,7 +0,0 @@
#header {
background: rgb(59,234,2);
background: -moz-linear-gradient(90deg, rgba(59,234,2,1) 0%, rgba(8,124,8,1) 35%);
background: -webkit-linear-gradient(90deg, rgba(59,234,2,1) 0%, rgba(8,124,8,1) 35%);
background: linear-gradient(90deg, rgba(59,234,2,1) 0%, rgba(8,124,8,1) 35%);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr="#3bea02",endColorstr="#087c08",GradientType=1);
}

@ -1,7 +0,0 @@
#header {
background: rgb(0,0,255);
background: -moz-linear-gradient(90deg, rgba(0,0,255,1) 0%, rgba(0,0,0,1) 50%);
background: -webkit-linear-gradient(90deg, rgba(0,0,255,1) 0%, rgba(0,0,0,1) 50%);
background: linear-gradient(90deg, rgba(0,0,255,1) 0%, rgba(0,0,0,1) 50%);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr="#0000ff",endColorstr="#000000",GradientType=1);
}

@ -1,7 +0,0 @@
#header {
background: rgb(0,255,0);
background: -moz-linear-gradient(90deg, rgba(0,255,0,1) 0%, rgba(0,0,0,1) 50%);
background: -webkit-linear-gradient(90deg, rgba(0,255,0,1) 0%, rgba(0,0,0,1) 50%);
background: linear-gradient(90deg, rgba(0,255,0,1) 0%, rgba(0,0,0,1) 50%);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr="#00ff00",endColorstr="#000000",GradientType=1);
}

Binary file not shown.

@ -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() {
@ -353,7 +354,7 @@ if [ $res != 0 ]; then
exit 1 exit 1
fi fi
# Restore old Program URL # Restore old Program URL
echo "update xi_options set value='$old_url' where nam=e'url'" | mysql -h "$ndoutils_dbserver" --port="$ndoutils_dbport" -u root --password=$mysqlpass -N nagiosxi) echo "update xi_options set value='$old_url' where name='url'" | mysql -h "$ndoutils_dbserver" --port="$ndoutils_dbport" -u root --password=$mysqlpass -N nagiosxi
if [[ "$cfg__db_info__nagiosql__dbserver" == *":"* ]]; then if [[ "$cfg__db_info__nagiosql__dbserver" == *":"* ]]; then
nagiosql_dbport=`echo "$cfg__db_info__nagiosql__dbserver" | cut -f2 -d":"` nagiosql_dbport=`echo "$cfg__db_info__nagiosql__dbserver" | cut -f2 -d":"`

Loading…
Cancel
Save