Skip to content

Commit ade8dcd

Browse files
author
Till Brehm
committed
Merge branch 'master' into 'master'
Added very simple LSI PERC H200 check using sas2ircu tool. See merge request ispconfig/ispconfig3!764
2 parents b10d02f + 4987f38 commit ade8dcd

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

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

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -315,6 +315,29 @@ public function onRunJob() {
315315
}
316316
}
317317

318+
/*
319+
* SAS2IRCU
320+
*/
321+
system('which sas2ircu', $retval);
322+
if($retval === 0) {
323+
$state = 'ok';
324+
$data['output'] = shell_exec('sas2ircu 0 DISPLAY');
325+
if(is_array($data['output'])) {
326+
foreach ($data['output'] as $item) {
327+
if (strpos($item, 'Optimal (OPT)') !== false) {
328+
$this->_tools->_setState($state, 'ok');
329+
} else {
330+
$this->_tools->_setState($state, 'critical');
331+
}
332+
if (strpos($item, 'Okay (OKY)') !== false) {
333+
$this->_tools->_setState($state, 'ok');
334+
} else {
335+
$this->_tools->_setState($state, 'critical');
336+
}
337+
}
338+
}
339+
}
340+
318341
$res = array();
319342
$res['server_id'] = $server_id;
320343
$res['type'] = $type;

0 commit comments

Comments
 (0)