mirror of https://github.com/eLvErDe/hwraid.git
Very minor bugfixes (Rev 1.28)
This commit is contained in:
parent
4a3ed5921b
commit
7319f6803b
|
@ -1,5 +1,5 @@
|
||||||
#!/usr/bin/python
|
#!/usr/bin/python
|
||||||
# $Id: megaclisas-status,v 1.27 2015/03/28 03:00:34 root Exp $
|
# $Id: megaclisas-status,v 1.28 2015/04/01 21:39:31 root Exp $
|
||||||
|
|
||||||
import os
|
import os
|
||||||
import re
|
import re
|
||||||
|
@ -141,6 +141,7 @@ def returnArrayInfo(output,controllerid,arrayid):
|
||||||
size = ''
|
size = ''
|
||||||
state = ''
|
state = ''
|
||||||
strpsz = ''
|
strpsz = ''
|
||||||
|
dskcache = ''
|
||||||
properties = ''
|
properties = ''
|
||||||
for line in output:
|
for line in output:
|
||||||
if re.match(r'^RAID Level.*?:.*$',line.strip()):
|
if re.match(r'^RAID Level.*?:.*$',line.strip()):
|
||||||
|
@ -170,9 +171,17 @@ def returnArrayInfo(output,controllerid,arrayid):
|
||||||
if re.match('WriteThrough', props):
|
if re.match('WriteThrough', props):
|
||||||
properties += 'WT'
|
properties += 'WT'
|
||||||
if re.search('ReadAdaptive', props):
|
if re.search('ReadAdaptive', props):
|
||||||
|
properties += ',Adapt'
|
||||||
|
if re.search('ReadAhead', props):
|
||||||
properties += ',RA'
|
properties += ',RA'
|
||||||
if re.match('ReadAheadNone', props):
|
if re.match('ReadAheadNone', props):
|
||||||
properties += ',NoRA'
|
properties += ',NoRA'
|
||||||
|
if re.match(r'^Disk Cache Policy.*?:.*$',line.strip()):
|
||||||
|
props = line.strip().split(':')[1].strip()
|
||||||
|
if re.search('Disabled', props):
|
||||||
|
dskcache = 'Disabled'
|
||||||
|
if re.search('Enabled', props):
|
||||||
|
dskcache = 'Enabled'
|
||||||
if re.match(r'^Ongoing Progresses.*?:.*$',line.strip()):
|
if re.match(r'^Ongoing Progresses.*?:.*$',line.strip()):
|
||||||
operationlinennumber = linenumber
|
operationlinennumber = linenumber
|
||||||
linenumber += 1
|
linenumber += 1
|
||||||
|
@ -180,7 +189,7 @@ def returnArrayInfo(output,controllerid,arrayid):
|
||||||
inprogress = output[operationlinennumber+1]
|
inprogress = output[operationlinennumber+1]
|
||||||
else:
|
else:
|
||||||
inprogress = 'None'
|
inprogress = 'None'
|
||||||
return [id,type,size,strpsz,properties,state,inprogress]
|
return [id,type,size,strpsz,properties,dskcache,state,inprogress]
|
||||||
|
|
||||||
def returnDiskInfo(output,controllerid):
|
def returnDiskInfo(output,controllerid):
|
||||||
arrayid = False
|
arrayid = False
|
||||||
|
@ -376,10 +385,10 @@ if printarray:
|
||||||
cmd = '%s -LDInfo -l%d -a%d -NoLog' % (megaclipath, arrayid, controllerid)
|
cmd = '%s -LDInfo -l%d -a%d -NoLog' % (megaclipath, arrayid, controllerid)
|
||||||
output = getOutput(cmd)
|
output = getOutput(cmd)
|
||||||
arrayinfo = returnArrayInfo(output,controllerid,arrayid)
|
arrayinfo = returnArrayInfo(output,controllerid,arrayid)
|
||||||
ldfmt = str('%-5s | %-6s | %7s | %7s | %'+str(mlen)+'s | %8s | %-12s ')
|
ldfmt = str('%-5s | %-6s | %7s | %7s | %'+str(mlen)+'s | %8s | %-7s | %-12s ')
|
||||||
# Header
|
# Header
|
||||||
if ( i == 0 ):
|
if ( i == 0 ):
|
||||||
print ldfmt % ("-- ID", "Type", "Size", "Strpsz", "Flags", "Status", "InProgress" )
|
print ldfmt % ("-- ID", "Type", "Size", "Strpsz", "Flags", "DskCache", "Status", "InProgress" )
|
||||||
print ldfmt % (
|
print ldfmt % (
|
||||||
arrayinfo[0],
|
arrayinfo[0],
|
||||||
arrayinfo[1],
|
arrayinfo[1],
|
||||||
|
@ -387,8 +396,9 @@ if printarray:
|
||||||
arrayinfo[3],
|
arrayinfo[3],
|
||||||
arrayinfo[4],
|
arrayinfo[4],
|
||||||
arrayinfo[5],
|
arrayinfo[5],
|
||||||
arrayinfo[6])
|
arrayinfo[6],
|
||||||
if not arrayinfo[5] == 'Optimal':
|
arrayinfo[7])
|
||||||
|
if not arrayinfo[6] == 'Optimal':
|
||||||
bad = True
|
bad = True
|
||||||
arrayid += 1
|
arrayid += 1
|
||||||
i += 1
|
i += 1
|
||||||
|
|
Loading…
Reference in New Issue