hwraid
hwraid copied to clipboard
sas2ircu-status misses disks with multiple volumes on same controller
arraymap is indexed by controller id but a single controller can have multiple arrays causing sas2ircu-status to only list disks on the last volume
the following fixed it for my situation (1 controller, 2 volumes) but i don't have multiple controllers to test it
@@ -138,8 +138,8 @@ if not nagiosmode:
print '-- Arrays informations --'
print '-- ID | Type | Size | Status'
for ctrl in ctrls:
- for array in getArrayList(ctrl[0]):
- arraymap[ctrl[0]]=array
+ arraymap[ctrl[0]]=getArrayList(ctrl[0])
+ for array in arraymap[ctrl[0]]:
if not array[3] in ['Okay (OKY)', 'Inactive, Okay (OKY)']:
bad=True
nagiosbadarray=nagiosbadarray+1
@@ -156,7 +156,7 @@ if not nagiosmode:
for ctrl in ctrls:
for disk in getDiskList(ctrl[0]):
# Compare disk enc/slot to array's ones
- for array in [arraymap.get(ctrl[0])]:
+ for array in arraymap[ctrl[0]]:
for arraydisk in array[4]:
if arraydisk == disk[4]:
if not disk[1] == 'Optimal (OPT)':
Hello,
You patch seem to makes sense. Would you be available for testing and provide output example if I update the package ?
Regards, Adam.
We're on CentOS so I won't be able to test the package itself, I can run the updated script and provide you with the output though.
I have fixed this in PR #87 because I ran into the same issue on my server. I modified the script and tested it so it should be safe to merge and publish.