Ausgabe verbessert
This commit is contained in:
parent
ddf6514b41
commit
1bc7e243c0
@ -144,6 +144,12 @@ then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
#Vorbereitung für das Perfdata-Result
|
||||
if [ -n "$PERFDATA" ]
|
||||
then
|
||||
PERFRESULT="|"
|
||||
fi
|
||||
|
||||
|
||||
for device in ${DEVICES[@]}
|
||||
do
|
||||
@ -156,13 +162,13 @@ do
|
||||
fi
|
||||
|
||||
OUTDEV=$(echo "$RESULT" | awk -F: '{print $1}')
|
||||
OUTMODEL=$(echo "$RESULT" | awk -F: '{print $2}' | tr -cd '[:print:]' | tr -s ' ' ' ' )
|
||||
OUTMODEL=$(echo "$RESULT" | awk -F: '{print $2}' | tr -cd '[:print:]' | tr -s ' ' ' ' | sed -e 's/^ //')
|
||||
OUTTEMP=$(echo "$RESULT" | awk -F: '{print $3}')
|
||||
OUTTEMPCLEAN=$(echo "$OUTTEMP" | tr -dc '0-9')
|
||||
|
||||
#Debug
|
||||
#echo -e "OUTDEV:\t$\"OUTDEV\""
|
||||
#echo -e "OUTMODEL:\t$OUTMODEL\""
|
||||
#echo -e "OUTDEV:\t$\"$OUTDEV\""
|
||||
#echo -e "OUTMODEL:\t\"$OUTMODEL\""
|
||||
#echo -e "OUTTEMP:\t\"$OUTTEMP\""
|
||||
#echo -e "OUTTEMPCLEAN:\t\"$OUTTEMPCLEAN\""
|
||||
|
||||
@ -187,7 +193,7 @@ do
|
||||
if [ "$OUTTEMPCLEAN" -lt "$WARNING" ]
|
||||
then
|
||||
# OK - Status
|
||||
ausgabe+="$OUTMODEL on $OUTDEV is $OUTTEMP "
|
||||
ausgabe+="\n$OUTMODEL on $OUTDEV is $OUTTEMP "
|
||||
if [ "$exitausgabe" -gt "0" ]
|
||||
then
|
||||
echo do nothing
|
||||
@ -197,7 +203,7 @@ do
|
||||
elif [ "$OUTTEMPCLEAN" -ge "$WARNING" ] && [ "$OUTTEMPCLEAN" -lt "$CRITICAL" ]
|
||||
then
|
||||
# WARNING - Status
|
||||
ausgabe+="$OUTMODEL on $OUTDEV is $OUTTEMP "
|
||||
ausgabe+="\n$OUTMODEL on $OUTDEV is $OUTTEMP "
|
||||
if [ "$exitausgabe" -gt "1" ]
|
||||
then
|
||||
echo do nothing
|
||||
@ -207,7 +213,7 @@ do
|
||||
elif [ "$OUTTEMPCLEAN" = "999" ]
|
||||
then
|
||||
#CRITICAL - Status (kein S.M.A.R.T. verfügbar)
|
||||
ausgabe+="$OUTMODEL on $OUTDEV - no S.M.A.R.T.-Status "
|
||||
ausgabe+="\n$OUTMODEL on $OUTDEV - no S.M.A.R.T.-Status "
|
||||
if [ "$exitausgabe" -gt "2" ]
|
||||
then
|
||||
echo do nothing
|
||||
@ -217,7 +223,7 @@ do
|
||||
elif [ "$OUTTEMPCLEAN" -ge "$CRITICAL" ]
|
||||
then
|
||||
#CRITICAL - Status
|
||||
ausgabe+="$OUTMODEL on $OUTDEV is $OUTTEMP "
|
||||
ausgabe+="\n$OUTMODEL on $OUTDEV is $OUTTEMP "
|
||||
if [ "$exitausgabe" -gt "2" ]
|
||||
then
|
||||
echo do nothing
|
||||
@ -226,7 +232,7 @@ do
|
||||
fi
|
||||
else
|
||||
#UNKNOWN - Status
|
||||
ausgabe+="$OUTMODEL on $OUTDEV is $OUTTEMP "
|
||||
ausgabe+="\n$OUTMODEL on $OUTDEV is $OUTTEMP "
|
||||
if [ "$exitausgabe" -gt "3" ]
|
||||
then
|
||||
echo do nothing
|
||||
@ -243,19 +249,19 @@ done
|
||||
|
||||
case $exitausgabe in
|
||||
"0")
|
||||
echo -e "OK - $ausgabe |$PERFRESULT"
|
||||
echo -e "OK $ausgabe $PERFRESULT"
|
||||
exit 0
|
||||
;;
|
||||
"1")
|
||||
echo -e "WARNING - $ausgabe |$PERFRESULT"
|
||||
echo -e "WARNING $ausgabe $PERFRESULT"
|
||||
exit 1
|
||||
;;
|
||||
"2")
|
||||
echo -e "CRITICAL - $ausgabe |$PERFRESULT"
|
||||
echo -e "CRITICAL $ausgabe $PERFRESULT"
|
||||
exit 2
|
||||
;;
|
||||
"3")
|
||||
echo -e "UNKNOWN - $ausgabe |$PERFRESULT"
|
||||
echo -e "UNKNOWN $ausgabe $PERFRESULT"
|
||||
exit 3
|
||||
;;
|
||||
*)
|
||||
|
Loading…
Reference in New Issue
Block a user