diff options
| author | Kaleb S. KEITHLEY <kkeithle@redhat.com> | 2015-08-18 02:51:00 -0400 | 
|---|---|---|
| committer | Kaleb KEITHLEY <kkeithle@redhat.com> | 2015-08-23 22:55:55 -0700 | 
| commit | d804b17f2fe92b1516f85f03978072c42ddc6f19 (patch) | |
| tree | 7a637c2ef32307fa394753564b5f6584719bbc34 | |
| parent | 1b603f17a75b4d41d8d7eb9d832321dd7387dd31 (diff) | |
common-ha: concise output for HA status
filter out unnecessary detail from the HA status
Change-Id: I407fbec1c61aa35afa7a433187a122975bf3e04d
BUG: 1250628
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>
| -rw-r--r-- | extras/ganesha/scripts/ganesha-ha.sh | 27 | 
1 files changed, 26 insertions, 1 deletions
diff --git a/extras/ganesha/scripts/ganesha-ha.sh b/extras/ganesha/scripts/ganesha-ha.sh index 37b90e4718a..42e28cf5788 100644 --- a/extras/ganesha/scripts/ganesha-ha.sh +++ b/extras/ganesha/scripts/ganesha-ha.sh @@ -854,6 +854,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()  { @@ -987,7 +1010,9 @@ $HA_CONFDIR/ganesha-ha.conf          ;;      status | --status) -        exec pcs status +        determine_servers "status" + +        status ${HA_SERVERS}          ;;      refresh-config | --refresh-config)  | 
