summaryrefslogtreecommitdiffstats
path: root/extras
diff options
context:
space:
mode:
authorKaleb S. KEITHLEY <kkeithle@redhat.com>2015-08-18 02:51:00 -0400
committerKaleb KEITHLEY <kkeithle@redhat.com>2016-03-14 21:23:01 -0700
commit8a5b697456c6d5b849fff117a8150c319d850a5c (patch)
tree847786a85e4b8a8e72690671aa7c64d0c54343ae /extras
parent4bf4bab995307a87487abf3cb0808f81bf198ecd (diff)
common-ha: concise output for HA status
filter out unnecessary detail from the HA status BUG: 1250628 Change-Id: I85fb3aaa3dacee2b1c48f46fb7eef6dc255168bc Signed-off-by: Kaleb S. KEITHLEY <kkeithle@redhat.com> Reviewed-on: http://review.gluster.org/11942 Tested-by: NetBSD Build System <jenkins@build.gluster.org> Reviewed-by: soumya k <skoduri@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Meghana M <mmadhusu@redhat.com> Reviewed-on: http://review.gluster.org/13718 Smoke: Gluster Build System <jenkins@build.gluster.com> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> CentOS-regression: Gluster Build System <jenkins@build.gluster.com>
Diffstat (limited to 'extras')
-rw-r--r--extras/ganesha/scripts/ganesha-ha.sh27
1 files changed, 26 insertions, 1 deletions
diff --git a/extras/ganesha/scripts/ganesha-ha.sh b/extras/ganesha/scripts/ganesha-ha.sh
index 7fac2cee881..0df2a710412 100644
--- a/extras/ganesha/scripts/ganesha-ha.sh
+++ b/extras/ganesha/scripts/ganesha-ha.sh
@@ -867,6 +867,29 @@ setup_state_volume()
}
+status()
+{
+ local regex_str="^ ${1}"; shift
+ local status_file=$(mktemp)
+
+ while [[ ${1} ]]; do
+
+ regex_str="${regex_str}|^ ${1}"
+
+ shift
+ done
+
+ pcs status | egrep "^Online:" > ${status_file}
+
+ echo >> ${status_file}
+
+ pcs status | egrep "${regex_str}" | sed -e "s/\t/ /" | cut -d ' ' -f 2,4 >> ${status_file}
+
+ cat ${status_file}
+
+ rm -f ${status_file}
+}
+
main()
{
@@ -1000,7 +1023,9 @@ $HA_CONFDIR/ganesha-ha.conf
;;
status | --status)
- exec pcs status
+ determine_servers "status"
+
+ status ${HA_SERVERS}
;;
refresh-config | --refresh-config)