srirams / unraid-enclosure-led

GNU General Public License v3.0
0 stars 0 forks source link

Support for NetApp DS-shelfs? #1

Open heinowalther opened 2 years ago

heinowalther commented 2 years ago

Hi there I know this hasn't been worked on for a few years, and I have been trying to look into the code to make it work with my setup which I think many have. (NetApp disk shelfs) The shelf reports as enclosure in "lsscsi" and some of the other checks you do in your script also seems to work OK, but never the less I just get an empty screen when clocking on the icon. (the plugin isn't listed under Tools... donno why?) Oh and I am on the latest version of unraid 6.11 which might be a part of why it is no longer working? I am willing to send debug information in order to get this plugin working :-)

/H

srirams commented 2 years ago

what's the output of lsscsi -t -g?

I haven't updated to 6.11 yet, hope to do it this weekend.

heinowalther commented 2 years ago
[0:0:0:0]    disk    usb:1-2:1.0                     /dev/sda   /dev/sg0 
[1:0:12:0]   disk                                    /dev/sdb   /dev/sg1 
[1:0:14:0]   disk                                    /dev/sdc   /dev/sg2 
[1:0:15:0]   disk                                    /dev/sdd   /dev/sg3 
[1:0:16:0]   disk                                    /dev/sde   /dev/sg4 
[2:0:0:0]    disk    sas:0x50000c900035492d          /dev/sdf   /dev/sg5 
[2:0:2:0]    disk    sas:0x50000c9000354959          /dev/sdh   /dev/sg7 
[2:0:3:0]    disk    sas:0x50000c9000354561          /dev/sdi   /dev/sg8 
[2:0:4:0]    disk    sas:0x50000c90003549ed          /dev/sdj   /dev/sg9 
[2:0:5:0]    enclosu sas:0x500a098006d1be7e          -          /dev/sg10
[2:0:6:0]    disk    sas:0x50000c9000354a4d          /dev/sdg   /dev/sg6 
[N:0:4:1]    disk    pcie 0x144d:0xa801                         /dev/nvme0n1  -   

The disks sg1 to 4 are inernal disks (not in the shelf), it is only sg5-9 that is... the shelf holds 24 disks.

(I have added the output of sg_ses that I can see in your script that you use...) sg_ses.txt

srirams commented 2 years ago

Can you try modifying line 21 of /usr/local/emhttp/plugins/enclosure-led/include/EnclosureQuery.php from:

            if (preg_match('/Slot (\d+) \[(\d+),(\d+)\]  Element type: Array device slot/', $line, $match)) {
                $dsn = $match[3];

to

            if (preg_match('/.*?\[(\d+),(\d+)\].*?device slot/i', $line, $match)) {  
                $dsn = $match[2];
heinowalther commented 2 years ago

Hi there, I think that did the trick :-) I can now see the disks in the shelf, and I will test to see if the LEDs work later on and let you know...