Author: glen                         Date: Wed Mar  9 10:23:45 2011 GMT
Module: packages                      Tag: HEAD
---- Log message:
- improve ipmi check, chassis status exited with 0 if /dev/ipmi0 existed but 
pointed to wrong device (like gdth driver)
- LC_ALL=C to avoid localized output side effects
- version 1.14

---- Files affected:
packages/nagios-plugin-check_ipmi:
   check_ipmi (1.13 -> 1.14) , nagios-plugin-check_ipmi.spec (1.15 -> 1.16) 

---- Diffs:

================================================================
Index: packages/nagios-plugin-check_ipmi/check_ipmi
diff -u packages/nagios-plugin-check_ipmi/check_ipmi:1.13 
packages/nagios-plugin-check_ipmi/check_ipmi:1.14
--- packages/nagios-plugin-check_ipmi/check_ipmi:1.13   Fri Jan 21 12:19:24 2011
+++ packages/nagios-plugin-check_ipmi/check_ipmi        Wed Mar  9 11:23:40 2011
@@ -86,10 +86,11 @@
 
 # checks if ipmitool is even usable on this system
 check_ipmitool() {
-       echo "Checking for IPMI..."
-       $ipmitool chassis status >/dev/null 2>&1
-       if [ $? != 0 ]; then
-               echo "Chassis status failed, modprobing"
+       local status
+       echo "IPMI chassis selftest..."
+       status=$(LC_ALL=C $ipmitool chassis selftest 2>/dev/null | awk '/Self 
Test Results/{print $NF}')
+       if [ "$status" != "passed" ]; then
+               echo "Chassis selftest failed, modprobing"
                $modprobe ipmi_si
                if [ $? != 0 ]; then
                        echo "ERROR: ipmi_si module did not load, probably IPMI 
not present"
@@ -102,13 +103,13 @@
                        exit 1
                fi
        else
-               echo "Seems OK"
+               echo "OK: $status"
                return
        fi
 
        # check again, maybe static dev needs device updating
-       $ipmitool chassis status >/dev/null 2>&1
-       if [ $? != 0 ]; then
+       status=$(LC_ALL=C $ipmitool chassis selftest 2>/dev/null | awk '/Self 
Test Results/{print $NF}')
+       if [ "$status" != "passed" ]; then
                echo "Still fails, checking ipmi /dev node"
                major=$(awk '$2 == "ipmidev" {print $1}' /proc/devices)
                if [ -z "$major" ]; then
@@ -120,8 +121,8 @@
                mknod $dev c $major 0
        fi
 
-       $ipmitool chassis status >/dev/null 2>&1
-       if [ $? != 0 ]; then
+       status=$(LC_ALL=C $ipmitool chassis selftest 2>/dev/null | awk '/Self 
Test Results/{print $NF}')
+       if [ "$status" != "passed" ]; then
                echo "ERROR: Can't get it to work, I give up"
                exit 1
        fi
@@ -216,7 +217,7 @@
 fi
 
 t=$(mktemp) || die CRITICAL "Can't create tempfile"
-$sudo $ipmitool -S $cache_filename sdr > $t || die CRITICAL "Can't run 
ipmitool sdr"
+LC_ALL=C $sudo $ipmitool -S $cache_filename sdr > $t || die CRITICAL "Can't 
run ipmitool sdr"
 # VRD 1 Temp       | 34 degrees C      | ok
 # CMOS Battery     | 3.12 Volts        | ok
 # VCORE            | 0x01              | ok

================================================================
Index: packages/nagios-plugin-check_ipmi/nagios-plugin-check_ipmi.spec
diff -u packages/nagios-plugin-check_ipmi/nagios-plugin-check_ipmi.spec:1.15 
packages/nagios-plugin-check_ipmi/nagios-plugin-check_ipmi.spec:1.16
--- packages/nagios-plugin-check_ipmi/nagios-plugin-check_ipmi.spec:1.15        
Thu Feb  3 10:49:51 2011
+++ packages/nagios-plugin-check_ipmi/nagios-plugin-check_ipmi.spec     Wed Mar 
 9 11:23:40 2011
@@ -2,8 +2,8 @@
 %define                plugin  check_ipmi
 Summary:       Nagios plugin to check IPMI status
 Name:          nagios-plugin-%{plugin}
-Version:       1.13
-Release:       2
+Version:       1.14
+Release:       1
 License:       GPL v2
 Group:         Networking
 Source0:       %{plugin}
@@ -79,6 +79,11 @@
 All persons listed below can be reached at <cvs_login>@pld-linux.org
 
 $Log$
+Revision 1.16  2011/03/09 10:23:40  glen
+- improve ipmi check, chassis status exited with 0 if /dev/ipmi0 existed but 
pointed to wrong device (like gdth driver)
+- LC_ALL=C to avoid localized output side effects
+- version 1.14
+
 Revision 1.15  2011/02/03 09:49:51  glen
 - requires ipmi-init on boot
 
================================================================

---- CVS-web:
    
http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/packages/nagios-plugin-check_ipmi/check_ipmi?r1=1.13&r2=1.14&f=u
    
http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/packages/nagios-plugin-check_ipmi/nagios-plugin-check_ipmi.spec?r1=1.15&r2=1.16&f=u

_______________________________________________
pld-cvs-commit mailing list
pld-cvs-commit@lists.pld-linux.org
http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit

Reply via email to