mirror of
https://github.com/eLvErDe/hwraid.git
synced 2025-07-26 23:34:02 +02:00
Make ROC and drive temp printouts selectable..
This commit is contained in:
parent
a6a07a154c
commit
2b47e20115
@ -26,6 +26,7 @@ nagiosbaddisk = 0
|
|||||||
printarray = True
|
printarray = True
|
||||||
printcontroller = True
|
printcontroller = True
|
||||||
debugmode = False
|
debugmode = False
|
||||||
|
notempmode = False
|
||||||
totaldrivenumber = 0
|
totaldrivenumber = 0
|
||||||
|
|
||||||
# Hardcode a max of 16 HBA and 128 LDs for now. LDTable must be initialized to accept populating list of LD's into each ctlr's list.
|
# Hardcode a max of 16 HBA and 128 LDs for now. LDTable must be initialized to accept populating list of LD's into each ctlr's list.
|
||||||
@ -39,7 +40,7 @@ Outputs = {}
|
|||||||
|
|
||||||
# Startup
|
# Startup
|
||||||
def print_usage():
|
def print_usage():
|
||||||
print 'Usage: megaraid-status [--nagios|--debug]'
|
print 'Usage: megaraid-status [--nagios|--debug|--notemp]'
|
||||||
|
|
||||||
# We need root access to query
|
# We need root access to query
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
@ -61,6 +62,8 @@ if len(sys.argv) > 1:
|
|||||||
nagiosmode = True
|
nagiosmode = True
|
||||||
elif sys.argv[1] == '--debug':
|
elif sys.argv[1] == '--debug':
|
||||||
debugmode = True
|
debugmode = True
|
||||||
|
elif sys.argv[1] == '--notemp':
|
||||||
|
notempmode = True
|
||||||
else:
|
else:
|
||||||
print_usage()
|
print_usage()
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
@ -192,6 +195,9 @@ def returnFirmwareVersion(output):
|
|||||||
def returnROCTemp(output):
|
def returnROCTemp(output):
|
||||||
ROCtemp = ''
|
ROCtemp = ''
|
||||||
tmpstr = ''
|
tmpstr = ''
|
||||||
|
if (notempmode):
|
||||||
|
return str('N/A')
|
||||||
|
else:
|
||||||
for line in output:
|
for line in output:
|
||||||
if re.match(r'^ROC temperature :.*$',line.strip()):
|
if re.match(r'^ROC temperature :.*$',line.strip()):
|
||||||
tmpstr = line.split(':')[1].strip()
|
tmpstr = line.split(':')[1].strip()
|
||||||
@ -453,6 +459,9 @@ def returnDiskInfo(output,controllerid):
|
|||||||
elif re.match(r'Device Speed: .*$',line.strip()):
|
elif re.match(r'Device Speed: .*$',line.strip()):
|
||||||
speed = line.split(':')[1].strip()
|
speed = line.split(':')[1].strip()
|
||||||
elif re.match(r'Drive Temperature :.*$',line.strip()):
|
elif re.match(r'Drive Temperature :.*$',line.strip()):
|
||||||
|
if (notempmode):
|
||||||
|
temp = 'N/A'
|
||||||
|
else:
|
||||||
# Drive temp is amongst the last few lines matched, decide here if we add information to the table..
|
# Drive temp is amongst the last few lines matched, decide here if we add information to the table..
|
||||||
temp = line.split(':')[1].strip()
|
temp = line.split(':')[1].strip()
|
||||||
temp = re.sub(' \(.*\)', '', temp)
|
temp = re.sub(' \(.*\)', '', temp)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user