Skip to content

Commit 4d84ee0

Browse files
author
Till Brehm
committed
Merge branch 'master' into 'master'
Master See merge request ispconfig/ispconfig3!768
2 parents 2910de6 + 23c8613 commit 4d84ee0

File tree

1 file changed

+46
-0
lines changed

1 file changed

+46
-0
lines changed

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

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

278+
/*
279+
* HP Proliant new HPE Command Line Smart Storage Administration Utility
280+
*/
281+
system('which ssacli', $retval);
282+
if($retval === 0) {
283+
$state = 'ok';
284+
$data['output'] = shell_exec('/usr/sbin/ssacli ctrl all show config');
285+
$tmp = explode("\n", $data['output']);
286+
if(is_array($tmp)) {
287+
foreach ($tmp as $item) {
288+
if (strpos($item, 'logicaldrive') !== false) {
289+
if (strpos($item, 'OK') !== false) {
290+
$this->_tools->_setState($state = 'ok');
291+
} elseif (strpos($item, 'Recovery Mode') !== false) {
292+
$this->_tools->_setState($state = 'critical');
293+
break;
294+
} elseif (strpos($item, 'Failed') !== false) {
295+
$this->_tools->_setState($state = 'error');
296+
break;
297+
} elseif (strpos($item, 'Recovering') !== false) {
298+
$this->_tools->_setState($state = 'info');
299+
break;
300+
} else {
301+
$this->_tools->_setState($state = 'critical');
302+
}
303+
}
304+
if (strpos($item, 'physicaldrive') !== false) {
305+
if (strpos($item, 'physicaldrive') !== false) {
306+
if (strpos($item, 'OK') !== false) {
307+
$this->_tools->_setState($state = 'ok');
308+
} elseif (strpos($item, 'Failed') !== false) {
309+
$this->_tools->_setState($state = 'critical');
310+
break;
311+
} elseif (strpos($item, 'Rebuilding') !== false) {
312+
$this->_tools->_setState($state = 'info');
313+
break;
314+
} else {
315+
$this->_tools->_setState($state = 'critical');
316+
break;
317+
}
318+
}
319+
}
320+
}
321+
}
322+
}
323+
278324
/*
279325
* LSI MegaRaid
280326
*/

0 commit comments

Comments
 (0)