1
0
Fork 0
mirror of https://github.com/munin-monitoring/contrib.git synced 2025-07-25 18:38:30 +00:00

fixed some critical mistakes which caused the plugin to work on the command line but not when called from munin

This commit is contained in:
Stefan Seidel 2011-09-22 14:23:45 +02:00 committed by Steve Schnepp
parent 0767fa14ba
commit 72e075ba03

View file

@ -1,7 +1,7 @@
#!/bin/bash #!/bin/bash
DISK="${0/*smart-by-id_/}" DISK=${0/*smart-by-id_/}
SMARTCTL="smartctl $SMARTOPTS" SMARTCTL="`which smartctl | head -1` $SMARTOPTS"
echo "# $DISK" echo "# $DISK"
@ -28,7 +28,7 @@ config)
OL=`echo -n ${OP[1]} | tr '_' ' '` OL=`echo -n ${OP[1]} | tr '_' ' '`
echo ${ON}.label ${OL} echo ${ON}.label ${OL}
echo ${ON}.draw LINE2 echo ${ON}.draw LINE2
echo ${ON}.critical $((${OP[5]})): echo ${ON}.critical ${OP[5]}:
done done
;; ;;
suggest) suggest)
@ -45,7 +45,8 @@ suggest)
if [ $((SES & 224)) -gt 0 ] ; then SES=1 ; fi if [ $((SES & 224)) -gt 0 ] ; then SES=1 ; fi
fi fi
echo "smartctl_exit_class.value $SES" echo "smartctl_exit_class.value $SES"
$SMARTCTL -A /dev/disk/by-id/$DISK | awk '/0x/ { gsub(/[^a-Z0-9]/,"_",$2); print $2.".value",$4; }' $SMARTCTL -A /dev/disk/by-id/$DISK | awk '/0x/ { gsub(/[^a-zA-Z0-9]/,"_",$2); print $2.".value",$4; }'
;; ;;
esac esac
#exit 0