Created
December 5, 2011 06:57
-
-
Save n0ts/1432626 to your computer and use it in GitHub Desktop.
check_aacraid.py Patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
http://exchange.nagios.org/index.php?option=com_mtree&task=viewlink&link_id=2087&Itemid=74 | |
--- check-aacraid.py-org 2011-12-05 04:05:38.000000000 +0900 | |
+++ check-aacraid.py 2011-12-05 15:53:10.000000000 +0900 | |
@@ -31,6 +31,7 @@ | |
# v0.2 - checks logical volume status & wipes log | |
# v0.3 - strips trailing "," & tells you the logical volume with | |
# the failure | |
+# v0.4 - fixed c_degraded_re regex pattern | |
import sys, os, re, string | |
@@ -38,7 +39,7 @@ | |
c_status_re = re.compile('^\s*Controller Status\s*:\s*(.*)$') | |
l_status_re = re.compile('^\s*Status of logical device\s*:\s*(.*)$') | |
l_device_re = re.compile('^Logical device number ([0-9]+).*$') | |
-c_defunct_re = re.compile('^\s*Defunct disk drive count\s:\s*([0-9]+).*$') | |
+c_defunct_re = re.compile('^\s*Defunct disk drive count\s*:\s*([0-9]+).*$') | |
c_degraded_re = re.compile('^\s*Logical devices/Failed/Degraded\s*:\s*([0-9]+)/([0-9]+)/([0-9]+).*$') | |
b_status_re = re.compile('^\s*Status\s*:\s*(.*)$') | |
b_temp_re = re.compile('^\s*Over temperature\s*:\s*(.*)$') | |
@@ -85,7 +86,7 @@ | |
if verbose > 0 : | |
print "cdefunct > 0" | |
check_status = 2 | |
- result += "Defunct drives " + cdefunct_group(1) + "," | |
+ result += "Defunct drives " + cdefunct.group(1) + "," | |
continue | |
cdegraded = c_degraded_re.match(line) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment