Monitoring RAID on DL380 G4 by hpacucli

Discussion in 'Developers' Forum' started by raczkowski1, Feb 14, 2015.

  1. raczkowski1

    raczkowski1 New Member

    Hi
    I wrote small PHP code for ISPConfig 3 to check and show status RAID on Smart Array 6i using hpacucli and added to file /usr/local/ispconfig/server/lib/classes/monitor_tools.inc.php in line 1208.

    PHP:
                   /*
                     * For HP raid with /usr/sbin/hpacucli
                     */
                    
    if (file_exists('/usr/sbin/hpacucli')) {
                            
    /*
                             * Fetch the output
                             */
                            
    $data['output'] = shell_exec('hpacucli controller all show config');

                            
    /*
                             * Then calc the state.
                             */
                            
    $tmp explode("\n"$data['output']);
                            
    $state 'ok';

                            for (
    $i 0$i sizeof($tmp); $i++) {
                                    
    /* fetch the next line */
                                    
    $line $tmp[$i];
                  
                                    if ((
    strpos($line'logicaldrive') == true) && (strpos($line'OK') == false)) {
                            
    //      $debug = 'Error logical  drive '."\n";
                                            
    $state $this->_setState($state'critical');
                                    }
                                    if ((
    strpos($line'physicaldrive') == true) && (strpos($line'OK') == false)) {
                            
    //              $debug .= 'Error physilca  drive '."\n";
                                            
    $state $this->_setState($state'critical');
                                    }
                          
                            }


                    }
    Maybe some needed something like this or add more options to this script.
    Thanks
     
    till likes this.
  2. till

    till Super Moderator Staff Member ISPConfig Developer

  3. orfi

    orfi New Member

    hi , i have ISPC 3.0.5.3 , hpacucli installed and working but the code hasno effect .Please specify the line after we have to insert the code .
    thank you
     

Share This Page