Hallo Zusammen,
da wir ausschließlich HP ProliantServer einsetzen, habe ich mir mal die Mühe gemacht, den ISPConfig Raid-Status für die SmartArray Controler zu implementieren. Das Tool hpacucli muss auf dem Server installiert sein (Unterstützung für nahezu alle HP Proliant-Server mit SmartArray Controller )
Dazu habe ich in
nachfolgenden Code in die Datei
bei Zeile 1171 vor:
hinzugefügt: Evtl kanns ja jemand gebrauchen oder es findet sich soagr in einer der nächsten ISPConfig-Versionen wieder:
Code:
Viele Grüße
da wir ausschließlich HP ProliantServer einsetzen, habe ich mir mal die Mühe gemacht, den ISPConfig Raid-Status für die SmartArray Controler zu implementieren. Das Tool hpacucli muss auf dem Server installiert sein (Unterstützung für nahezu alle HP Proliant-Server mit SmartArray Controller )
Dazu habe ich in
Code:
/usr/local/ispconfig/server/lib/classes
Code:
monitor_tools.inc.php
PHP:
/*
* Return the Result
*/
Code:
PHP:
/*
* HP SmartArray Controller -> use hpacucli software
*/
if (file_exists('/usr/sbin/hpacucli')) {
/*
* Initial State - ok
*/
$state = 'ok';
/*
* Fetch the output
*/
$data['output'] = shell_exec('/usr/sbin/hpacucli ctrl all show config');
$tmp = explode("\n", $data['output']);
/*
* Then set the state.
*/
if(is_array($tmp)) {
foreach ($tmp as $item) {
/*
* The output contains information for every RAID and every HDD.
* We check primary the state of the RAID and secondary the state of HDD.
*/
if (strpos($item, 'logicaldrive') !== false) {
/*
* We found a raid... process the state of it
*/
if (strpos($item, 'OK') !== false) {
$this->_setState($state = 'ok');
} elseif (strpos($item, 'Recovery Mode') !== false) {
$this->_setState($state = 'critical');
break;
} elseif (strpos($item, 'Failed') !== false) {
$this->_setState($state = 'error');
break;
} elseif (strpos($item, 'Recovering') !== false) {
$this->_setState($state = 'info');
break;
} else {
/* unknown state. so we set the state to critical, that the
* admin is warned, that something is wrong. this will only set if there are no physicaldrives detected
*/
$this->_setState($state = 'critical');
}
}
if (strpos($item, 'physicaldrive') !== false) {
/*
* We found HDD... process the state of it
*/
if (strpos($item, 'OK') !== false) {
$this->_setState($state = 'ok');
} elseif (strpos($item, 'Failed') !== false) {
$this->_setState($state = 'critical');
break;
} elseif (strpos($item, 'Rebuilding') !== false) {
$this->_setState($state = 'info');
break;
} else {
/* unknown state. so we set the state to critical, that the
* admin is warned, that something is wrong
*/
$this->_setState($state = 'critical');
break;
}
}
}
}
}
Viele Grüße