Creating an mptutil raid status and notifications

  • I noticed patches to update the gmirror widget, diagnostics to manipulate the raid, and notifications in 2.2.  I do have some systems using gmirror so that is awesome.

    I have some systems using Dell SAS controllers that can use the mptutil command to check raid status and manipulate the raid volumes.  mptutil is included in pfsense 2.2 so I am glad about that.  I am seriously thinking about duplicating the gmirror code/widget and adjust it for the mptutil tool renaming all the files but I wonder if it would be better to have a generic widget tool and have different backend .inc files so that someone could just put additional .inc files in without needing to adjust the gui .php code.  I wouldn't even attempt this if someone didn't recently contribute the code to make gmirror a whole lot more function so that I have something to look at for a beginning template.

    I have experience in embedded C code where I work even though I have been out of that role for awhile now.  I have tinkered with php and other languages like it but I am far from fluent in them.  Using the existing gmirror code though I certainly can use that to learn from.  The chances of me making the existing gui code modular so that it can work with gmirror and mptutil though would be more than I can achieve though I am sure.

    I am used to SVN and not Git also so there is a learning curve there too.

    I am sure it would take me 50 times longer than someone who knows PHP and familiar with pfsense gui development so it might take a looooong time for me to have all the time to do it but I am seriously thinking about it.

    Has anyone thought about this before?

    Example output (not from my systems… just a google search for an example):

    mptutil show config

    mpt0 Configuration: 2 volumes, 4 drives
        volume 0 (136G) RAID-1 OPTIMAL spans:
            drive 1 (137G) ONLINE <ibm-esxs mbd2147rc="" sb18="">SAS
            drive 0 (137G) ONLINE <ibm-esxs mbd2147rc="" sb18="">SAS
            spare pools: 0
        volume 0 (29G) RAID-1 OPTIMAL spans:
            drive 2 (30G) ONLINE <ssdsa2sh032g1gn 8850="">SATA
            drive 3 (30G) ONLINE <ssdsa2sh032g1gn 8850="">SATA
            spare pools: 0</ssdsa2sh032g1gn></ssdsa2sh032g1gn></ibm-esxs></ibm-esxs>

  • Rebel Alliance Developer Netgate

    While generalization is good, unfortunately a lot of the RAID controller utilities work in such a wildly different fashion I'm not sure it could be effectively pulled off here.

    When I made the new gmirror code I tried to make things a little generalized so that the same style could be copied for other controllers and s/gmirror/myraidadapterutility/g

    Sounds like a job for OO and some class/inheritance mojo in the long run so that it could be made controller-independent.

    For now you can copy the files, adjust for the utility, and make a package that would install them and add the menu entry.