hwraid icon indicating copy to clipboard operation
hwraid copied to clipboard

sas2ircu-status misses disks with multiple volumes on same controller

Open margana opened this issue 8 years ago • 3 comments

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)':

margana avatar Aug 11 '16 15:08 margana

Hello,

You patch seem to makes sense. Would you be available for testing and provide output example if I update the package ?

Regards, Adam.

eLvErDe avatar Nov 01 '16 18:11 eLvErDe

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.

margana avatar Nov 01 '16 19:11 margana

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.

gravufo avatar Apr 02 '18 23:04 gravufo