LSI MegaRaid monitoring

Discussion in 'Developers' Forum' started by cwispy, May 1, 2015.

  1. cwispy

    cwispy Active Member

    Hi,

    I have added the below code to server/lib/classes/monitor_tools.inc.php to return the raid status for our LSI raid controllers.

    PHP:
                    /*
                    * LSI MegaSAS Controller
                    */

                    
    if (file_exists('/usr/sbin/megacli')) {

                            
    $data['output'] = shell_exec('megacli -LDInfo -Lall -aAll');

                            
    $state 'ok';

                            if (
    strpos($data['output'], 'Optimal') !== false) {
                                    
    $this->_setState($state'ok');
                            }
                            else if (
    strpos($data['output'], 'Degraded') !== false) {
                                    
    $this->_setState($state'critical');
                            }
                            else if (
    strpos($data['output'], 'Offline') !== false) {
                                    
    $this->_setState($state'critical');
                            } else {
                                    
    $this->_setState($state'critical');
                            }
                    }
    raidstatus.png
     
    till and webguyz like this.
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    Thanks for the code. I'll add it to the bugtracker.
     

Share This Page