Skip to content
Snippets Groups Projects
Commit d7f1c84e authored by Florian Schaal's avatar Florian Schaal
Browse files

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

parent 248d0eeb
No related branches found
No related tags found
No related merge requests found
......@@ -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;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment