Skip to content

Commit b6775cf

Browse files
committed
Add check_gpfs_verbs_status check
1 parent 986e63f commit b6775cf

File tree

2 files changed

+69
-1
lines changed

2 files changed

+69
-1
lines changed

README.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -771,6 +771,7 @@ _**Example**_: `check_fs_used / 98%`
771771
772772
<br />
773773
774+
774775
##### check_gpfs_health
775776
`check_gpfs_health [-0] [-a] [-l] [-s] [-e <action>] <component>`
776777
@@ -789,6 +790,22 @@ _**Example**_: `check_gpfs_health NETWORK`
789790
<br />
790791
791792
793+
##### check_gpfs_verbs_status
794+
`check_gpfs_verbs_status [-0] [-l] [-s]`
795+
796+
Checks that GPFS has started Verbs and is using RDMA.
797+
798+
| **Check&nbsp;Option** | **Purpose** |
799+
| ---------------- | ----------- |
800+
| `-0` | Non-fatal. Failure of this check will be ignored. |
801+
| `-l` | Log if verbs is not started to NHC log (`$LOGFILE`). |
802+
| `-s` | Log if verbs is not started to the syslog. |
803+
804+
_**Example**_: `check_gpfs_verbs_status`
805+
806+
<br />
807+
808+
792809
##### check_hw_cpuinfo
793810
`check_hw_cpuinfo [sockets] [cores] [threads]`
794811

scripts/osc_gpfs.nhc

Lines changed: 52 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ GPFS_COMPONENT=()
88
GPFS_ENTITY=()
99
GPFS_STATUS=()
1010
MMHEALTH="${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

1314
function 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

Comments
 (0)