Commit d7f1c84e authored by Florian Schaal's avatar Florian Schaal
Browse files

FS#3885 - LSI MegaRaid monitoring (code) (cwispy)

parent 248d0eeb
......@@ -275,6 +275,27 @@ class cronjob_monitor_raid extends cronjob {
}
}
/*
* LSI MegaRaid
*/
system('which megacli', $retval);
system('which megacli64', $retval64);
if($retval === 0 || $retval64 === 0) {
$binary=@($retval === 0)?'megacli':'megacli64';
$state = 'ok';
$data['output'] = shell_exec($binary.' -LDInfo -Lall -aAll');
if (strpos($data['output'], 'Optimal') !== false) {
$this->_tools->_setState($state, 'ok');
} else if (strpos($data['output'], 'Degraded') !== false) {
$this->_tools->_setState($state, 'critical');
} else if (strpos($data['output'], 'Offline') !== false) {
$this->_tools->_setState($state, 'critical');
} else {
$this->_tools->_setState($state, 'critical');
}
}
$res = array();
$res['server_id'] = $server_id;
$res['type'] = $type;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment