3ware controller in ISPConfig3 monitor 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
I have 3ware controller's in my serves and will give your code a test later today. I'll report back when done.
Sorry.. I can not test it as I'm not using the beta version on a server with 3ware controller's. I only have the 3ware controller's in my production servers.
Code: $state = 'no_state'; $data['output']= ''; } /* * Insert the data into the database */ $sql = "INS not in /* part, but between } and $sql
Hi again Sry for the doublepost... Anybody had trouble with the code? If everything is fine i will open a ticket for implementation into ISPConfig. I had no trouble, i implemented it for tests into 2 servers. xaver
I've added it as feature request in the bugtracker. http://bugtracker.ispconfig.org/index.php?do=details&task_id=1390