From 3d42b66593a90384f3440e482f5c8f6a1e45e080 Mon Sep 17 00:00:00 2001 From: Eric Loyd Date: Thu, 13 Jan 2022 12:00:02 -0500 Subject: [PATCH] Slight tweak to readme and now failover works without having a valid sync file (with a manual override) --- failover/README.md | 6 +++--- failover/failover.sh | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/failover/README.md b/failover/README.md index ed66ec0..10722f6 100644 --- a/failover/README.md +++ b/failover/README.md @@ -6,9 +6,9 @@ Failover from primary Nagios XI to secondary Nagios XI is a Disaster Recovery ef * The syncing process will delete files that it does not believe should be on the secondary, so all work must be performed on the primary. Any work performed on the secondary will be overwritten when the next synchronization process occurs. Note that this includes SSH keys, as /home/nagios will be synced from the parimary to the secondary. * /home/nagios/bin exists and contains the files needed for this process. Note that the sync process will sync these from the primary to the secondary, so like all other files, they must only be modified on the primary. - /home/nagios/bin/failover.sh - /home/nagios/bin/nagios_startstop.sh - /home/nagios/bin/rsync_xi.sh + * /home/nagios/bin/failover.sh + * /home/nagios/bin/nagios_startstop.sh + * /home/nagios/bin/rsync_xi.sh * The root user has the ability to SSH from the primary to the secondary as the nagios user without entering a passphrase. This is how the rsync and database copies are performed * root on primary (and root on secondary) has crontab requirements that will be detailed separately. diff --git a/failover/failover.sh b/failover/failover.sh index 2186436..af06fb1 100755 --- a/failover/failover.sh +++ b/failover/failover.sh @@ -7,6 +7,7 @@ # EverWatch Global, Inc. PATH=/usr/sbin:/sbin:/usr/bin:/bin +. /home/nagios/bin/colors.sh #primary="nagiosxi-p.princeton.edu" #secondary="nagiosxi-f.princeton.edu" @@ -22,8 +23,6 @@ cssDir="/usr/local/nagiosxi/html/includes/components/custom-includes/css" hostname=`/bin/hostname` -. ./colors.sh - while [ -n "$1" ]; do case "$1" in -H | --hostname) hostname="$2"; shift 2;; @@ -116,6 +115,7 @@ do_secondary() { warning "***" error "***" warning "This is intended to be manually executed when needed, so we assume you want to start Nagios..." -n + sleep 3 start_nagios rm -f ${syncfile} verbose "Done."