Fix a few typos, improve debugging output

This commit is contained in:
Vincent S. Cojot 2018-02-27 22:34:28 -05:00
parent 548d321240
commit 49be830f6d
1 changed files with 11 additions and 3 deletions

View File

@ -101,10 +101,10 @@ def which(program):
# Find MegaCli # Find MegaCli
for megabin in "MegaCli64","MegaCli","megacli", "MegaCli.exe", "perccli64", "perccli", "storcli64", "storcli": for megabin in "MegaCli64","MegaCli","megacli", "MegaCli.exe", "perccli64", "perccli", "storcli64", "storcli":
dbgprint ('Looking for '+str(megabin)+' in PATH next..') dbgprint ('Looking for '+str(megabin)+' in PATH...')
megaclipath = which(megabin) megaclipath = which(megabin)
if (megaclipath != None): if (megaclipath != None):
dbgprint ('Will use MegaCLI from here: '+str(megaclipath)) dbgprint ('Will use this executable: '+str(megaclipath))
break break
# Check binary exists (and +x), if not print an error message # Check binary exists (and +x), if not print an error message
@ -118,7 +118,7 @@ if (megaclipath != None):
print 'Cannot find ' + megaclipath + 'in your PATH. Please install it.' print 'Cannot find ' + megaclipath + 'in your PATH. Please install it.'
sys.exit(3) sys.exit(3)
else: else:
print 'Cannot find "MegaCli64","MegaCli" or "megacli" or "MegaCli.exe" in your PATH. Please install it.' print 'Cannot find "MegaCli{64,}", "megacli{64,}", "perccli{64,}" or "storcli{64,}" in your PATH. Please install one of them.'
sys.exit(3) sys.exit(3)
@ -878,6 +878,14 @@ if totalunconfdrivenumber:
if not nagiosmode: if not nagiosmode:
print '' print ''
if (debugmode):
dbgprint ('Printing Outputs[][]')
for myl in Outputs:
dbgprint(myl+'\n')
sys.stderr.write("\n".join("".join(map(str,myd)) for myd in Outputs[myl])+'\n')
dbgprint ('Printing arraydisk[]')
sys.stderr.write("\n".join(" | ".join(map(str,myd)) for myd in arraydisk)+'\n')
if nagiosmode: if nagiosmode:
if bad: if bad:
print 'RAID ERROR - Arrays: OK:'+str(nagiosgoodarray)+' Bad:'+str(nagiosbadarray)+' - Disks: OK:'+str(nagiosgooddisk)+' Bad:'+str(nagiosbaddisk) print 'RAID ERROR - Arrays: OK:'+str(nagiosgoodarray)+' Bad:'+str(nagiosbadarray)+' - Disks: OK:'+str(nagiosgooddisk)+' Bad:'+str(nagiosbaddisk)