Skip to content

Commit d7f1c84

Browse files
author
Florian Schaal
committed
FS#3885 - LSI MegaRaid monitoring (code) (cwispy)
1 parent 248d0ee commit d7f1c84

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

server/lib/classes/cron.d/100-monitor_raid.inc.php

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,27 @@ public function onRunJob() {
275275
}
276276
}
277277

278+
/*
279+
* LSI MegaRaid
280+
*/
281+
system('which megacli', $retval);
282+
system('which megacli64', $retval64);
283+
if($retval === 0 || $retval64 === 0) {
284+
$binary=@($retval === 0)?'megacli':'megacli64';
285+
$state = 'ok';
286+
$data['output'] = shell_exec($binary.' -LDInfo -Lall -aAll');
287+
if (strpos($data['output'], 'Optimal') !== false) {
288+
$this->_tools->_setState($state, 'ok');
289+
} else if (strpos($data['output'], 'Degraded') !== false) {
290+
$this->_tools->_setState($state, 'critical');
291+
} else if (strpos($data['output'], 'Offline') !== false) {
292+
$this->_tools->_setState($state, 'critical');
293+
} else {
294+
$this->_tools->_setState($state, 'critical');
295+
}
296+
}
297+
298+
278299
$res = array();
279300
$res['server_id'] = $server_id;
280301
$res['type'] = $type;

0 commit comments

Comments
 (0)