mirror of https://github.com/eLvErDe/hwraid.git
Very minor bugfixes (Rev 1.4)
This commit is contained in:
parent
6c8f7630ba
commit
90b59f414d
|
@ -1,5 +1,5 @@
|
||||||
#!/usr/bin/python
|
#!/usr/bin/python
|
||||||
# $Id: megaclisas-status,v 1.3 2012/01/27 11:59:08 root Exp $
|
# $Id: megaclisas-status,v 1.4 2012/01/27 12:13:18 root Exp $
|
||||||
|
|
||||||
import os
|
import os
|
||||||
import re
|
import re
|
||||||
|
@ -87,6 +87,7 @@ def returnDiskInfo(output,controllerid):
|
||||||
table = []
|
table = []
|
||||||
state = 'Offline'
|
state = 'Offline'
|
||||||
model = 'Unknown'
|
model = 'Unknown'
|
||||||
|
speed = 'Unknown'
|
||||||
for line in output:
|
for line in output:
|
||||||
if re.match(r'^Virtual Drive: [0-9]+.*$',line.strip()):
|
if re.match(r'^Virtual Drive: [0-9]+.*$',line.strip()):
|
||||||
arrayid = line.split('(')[0].split(':')[1].strip()
|
arrayid = line.split('(')[0].split(':')[1].strip()
|
||||||
|
@ -101,9 +102,11 @@ def returnDiskInfo(output,controllerid):
|
||||||
if re.match(r'Inquiry Data: .*$',line.strip()):
|
if re.match(r'Inquiry Data: .*$',line.strip()):
|
||||||
model = line.split(':')[1].strip()
|
model = line.split(':')[1].strip()
|
||||||
model = re.sub(' +', ' ', model)
|
model = re.sub(' +', ' ', model)
|
||||||
|
if re.match(r'Device Speed: .*$',line.strip()):
|
||||||
|
speed = line.split(':')[1].strip()
|
||||||
if model != 'Unknown':
|
if model != 'Unknown':
|
||||||
#### print str(arrayid)+' '+str(diskid)+' '+str(olddiskid)
|
#### print str(arrayid)+' '+str(diskid)+' '+str(olddiskid)
|
||||||
table.append([str(arrayid), str(diskid), state, model])
|
table.append([str(arrayid), str(diskid), state, model, speed])
|
||||||
return table
|
return table
|
||||||
|
|
||||||
cmd = 'megacli -adpCount -NoLog'
|
cmd = 'megacli -adpCount -NoLog'
|
||||||
|
@ -160,7 +163,7 @@ while controllerid < controllernumber:
|
||||||
output = getOutput(cmd)
|
output = getOutput(cmd)
|
||||||
arraydisk = returnDiskInfo(output,controllerid)
|
arraydisk = returnDiskInfo(output,controllerid)
|
||||||
for array in arraydisk:
|
for array in arraydisk:
|
||||||
print 'c'+str(controllerid)+'u'+array[0]+'p'+array[1]+' | '+array[3]+' | '+array[2]
|
print 'c'+str(controllerid)+'u'+array[0]+'p'+array[1]+' | '+array[3]+' | '+array[2]+' ('+array[4]+')'
|
||||||
controllerid += 1
|
controllerid += 1
|
||||||
|
|
||||||
if bad:
|
if bad:
|
||||||
|
|
Loading…
Reference in New Issue