Skip to content

Commit

Permalink
Merge pull request #2 from Klintrup:update-tr-for-multiple-locales
Browse files Browse the repository at this point in the history
Changed tr A-Z a-z to tr [:upper:] [:lower:]
  • Loading branch information
Klintrup authored Dec 3, 2023
2 parents 6d70a23 + bb9a5fa commit 1f43f2c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions check_smartarray.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/sh
# NRPE check for Proliant SmartArray Controllers (ciss)
# Written by: Søren Klintrup <soren at klintrup.dk>
# version 1.4.2
# Written by: Søren Klintrup <soren at klintrup.dk>
# version 1.4.3

PATH="/sbin:/bin:/usr/sbin:/usr/bin"
DEVICES="$(camcontrol devlist|grep "COMPAQ RAID"|sed -Ee 's/.*(pass[0-9]{1,3}).*/\1/')"
Expand All @@ -13,12 +13,12 @@ for DEVICE in ${DEVICES}
do
DEVICENAME="$(camcontrol devlist|grep ${DEVICE}|sed -Ee 's/.*(da[0-9]{1,3}).*/\1/')"
DEVICESTRING="$(camcontrol inquiry ${DEVICE} -D|sed -n -e 's/^[^<]*<\([^>]*\)>.*$/\1/p')"
if [ "$(echo ${DEVICESTRING}|tr A-Z a-z|sed -Ee 's/.*(rea|int|rec|fai|ok).*/\1/')" = "" ]
if [ "$(echo ${DEVICESTRING}|tr [:upper:] [:lower:]|sed -Ee 's/.*(rea|int|rec|fai|ok).*/\1/')" = "" ]
then
ERRORSTRING="${ERRORSTRING} / ${DEVICENAME}: unknown state"
if ! [ "${ERR}" = 2 ];then ERR=3;fi
else
case $(echo ${DEVICESTRING}|tr A-Z a-z|sed -Ee 's/.*(rea|int|rec|fai|ok).*/\1/') in
case $(echo ${DEVICESTRING}|tr [:upper:] [:lower:]|sed -Ee 's/.*(rea|int|rec|fai|ok).*/\1/') in
int)
ERR=2
ERRORSTRING="${ERRORSTRING} / ${DEVICENAME}: DEGRADED"
Expand Down

0 comments on commit 1f43f2c

Please sign in to comment.