Hi,
first test of 3ware controller status:
Added in /usr/local/ispconfig/server/mods-available/monitor_core_module.inc.php (ispconfig v. 3.0.3 beta @ line 1114) v. 3.0.2 line 737
Code:
system('which tw_cli', $retval);
if($retval === 0) {
$data['output'] = shell_exec('tw_cli info c0');
$state = 'ok';
foreach ($data['output'] as $item) {
if (strpos($item, 'RAID') !== false) {
if (strpos($item, ' VERIFYING ') !== false) {
$this->_setState($state, 'info');
}
else if (strpos($item, ' MIGRATE-PAUSED ') !== false) {
$this->_setState($state, 'info');
}
else if (strpos($item, ' MIGRATING ') !== false) {
$this->_setState($state, 'ok');
}
else if (strpos($item, ' INITIALIZING ') !== false) {
$this->_setState($state, 'info');
}
else if (strpos($item, ' INIT-PAUSED ') !== false) {
$this->_setState($state, 'info');
}
else if (strpos($item, ' REBUILDING ') !== false) {
$this->_setState($state, 'info');
}
else if (strpos($item, ' REBUILD-PAUSED ') !== false) {
$this->_setState($state, 'warning');
}
else if (strpos($item, ' RECOVERY ') !== false) {
$this->_setState($state, 'warning');
}
else if (strpos($item, ' DEGRADED ') !== false) {
$this->_setState($state, 'critical');
}
else if (strpos($item, ' UNKNOWN ') !== false) {
$this->_setState($state, 'critical');
}
else if (strpos($item, ' OK ') !== false) {
$this->_setState($state, 'ok');
}
else if (strpos($item, ' OPTIMAL ') !== false) {
$this->_setState($state, 'ok');
}
else {
$this->_setState($state, 'critical');
}
}
}
}
(Maybe some _setStates not perfect)
If you have a Problem type
tw_cli info and replace c0 with your controller.
If you have 2 cards:
$data['output'][] = shell_exec('tw_cli info c0');
$data['output'][] = shell_exec('tw_cli info c1');
and replace last lines with
Code:
else {
$this->_setState($state, 'critical');
}
$pack .= $item."\n";
}
}
$data['output'] = $pack;
}
bye
Recent comments
8 hours 45 min ago
13 hours 50 min ago
18 hours 15 min ago
20 hours 4 min ago
1 day 10 hours ago
1 day 10 hours ago
1 day 15 hours ago
1 day 21 hours ago
1 day 22 hours ago
2 days 2 min ago