@@ -8,7 +8,8 @@ GPFS_COMPONENT=()
88GPFS_ENTITY=()
99GPFS_STATUS=()
1010MMHEALTH="${MMHEALTH:-/usr/lpp/mmfs/bin/mmhealth}"
11- export GPFS_COMPONENT GPFS_ENTITY GPFS_STATUS MMHEALTH
11+ MMFSADM="${MMFSADM:-/usr/lpp/mmfs/bin/mmfsadm}"
12+ export GPFS_COMPONENT GPFS_ENTITY GPFS_STATUS MMHEALTH MMFSADM
1213
1314function nhc_gpfs_health_gather_data() {
1415 local LINE_CNT
@@ -120,3 +121,53 @@ function check_gpfs_health() {
120121 fi
121122 return 0
122123}
124+
125+ # Checks GPFS verbs status
126+ # check_gpfs_verbs_status [-0] [-l] [-s]
127+ function check_gpfs_verbs_status() {
128+ local NONFATAL=0 LOG=0 SYSLOG=0 MSG=''
129+ local RET OUTPUT OLD_DEBUG
130+
131+ OPTIND=1
132+ while getopts ":0ls" OPTION ; do
133+ case "$OPTION" in
134+ 0) NONFATAL=1 ;;
135+ l) LOG=1 ;;
136+ s) SYSLOG=1 ;;
137+ :) die 1 "$CHECK: Option -$OPTARG requires an argument." ; return 1 ;;
138+ \?) die 1 "$CHECK: Invalid option: -$OPTARG" ; return 1 ;;
139+ esac
140+ done
141+ shift $((OPTIND-1))
142+
143+ OLD_DEBUG=$DEBUG
144+ unset DEBUG
145+ check_cmd_output -t ${CMD_TIMEOUT:-5} -C "$FUNCNAME" -O OUTPUT -m '/status/' $MMFSADM test verbs status
146+ RET=$?
147+ export DEBUG=$OLD_DEBUG
148+ if [[ $RET -ne 0 ]]; then
149+ return $RET
150+ fi
151+
152+ dbg "$MMFSADM test verbs status: \"$OUTPUT\""
153+
154+ if [[ "$OUTPUT" == *": started" ]]; then
155+ continue
156+ else
157+ MSG="$FUNCNAME: GPFS verbs is not started"
158+ fi
159+ if [[ "$LOG" == "1" ]]; then
160+ log $MSG
161+ fi
162+ if [[ "$SYSLOG" == "1" ]]; then
163+ syslog $MSG
164+ fi
165+ if [[ $NONFATAL == 1 ]]; then
166+ if [[ -n "$MSG" ]]; then
167+ log "$MSG (non-fatal)"
168+ fi
169+ return 0
170+ fi
171+ die 1 "$MSG"
172+ return 1
173+ }
0 commit comments