From 72e075ba0395f905e5b7f4eec394a9caa2028d4e Mon Sep 17 00:00:00 2001 From: Stefan Seidel Date: Thu, 22 Sep 2011 14:23:45 +0200 Subject: [PATCH] fixed some critical mistakes which caused the plugin to work on the command line but not when called from munin --- plugins/other/smart-by-id_ | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/plugins/other/smart-by-id_ b/plugins/other/smart-by-id_ index 14cf3b1e..04ae3a49 100755 --- a/plugins/other/smart-by-id_ +++ b/plugins/other/smart-by-id_ @@ -1,7 +1,7 @@ #!/bin/bash -DISK="${0/*smart-by-id_/}" -SMARTCTL="smartctl $SMARTOPTS" +DISK=${0/*smart-by-id_/} +SMARTCTL="`which smartctl | head -1` $SMARTOPTS" echo "# $DISK" @@ -28,7 +28,7 @@ config) OL=`echo -n ${OP[1]} | tr '_' ' '` echo ${ON}.label ${OL} echo ${ON}.draw LINE2 - echo ${ON}.critical $((${OP[5]})): + echo ${ON}.critical ${OP[5]}: done ;; suggest) @@ -45,7 +45,8 @@ suggest) if [ $((SES & 224)) -gt 0 ] ; then SES=1 ; fi fi 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 +#exit 0 \ No newline at end of file