#1  
Old 29th July 2010, 00:42
xaver xaver is offline
Member
 
Join Date: May 2009
Posts: 77
Thanks: 10
Thanked 24 Times in 14 Posts
Default 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

Last edited by xaver; 29th July 2010 at 16:20.
Reply With Quote
The Following 2 Users Say Thank You to xaver For This Useful Post:
edge (1st August 2010), till (27th October 2010)
Sponsored Links
  #2  
Old 29th July 2010, 06:55
edge edge is offline
Moderator
 
Join Date: Dec 2005
Location: The Netherlands
Posts: 2,033
Thanks: 260
Thanked 145 Times in 127 Posts
Default

I have 3ware controller's in my serves and will give your code a test later today.

I'll report back when done.
__________________
Never execute code written on a Friday or a Monday.
Reply With Quote
  #3  
Old 1st August 2010, 09:12
edge edge is offline
Moderator
 
Join Date: Dec 2005
Location: The Netherlands
Posts: 2,033
Thanks: 260
Thanked 145 Times in 127 Posts
Default

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.
__________________
Never execute code written on a Friday or a Monday.
Reply With Quote
  #4  
Old 1st August 2010, 15:15
xaver xaver is offline
Member
 
Join Date: May 2009
Posts: 77
Thanks: 10
Thanked 24 Times in 14 Posts
Default

On a Productive System its line 737.
No Problem at all. I hope 3.0.3 will stabel in next weeks.
Reply With Quote
The Following User Says Thank You to xaver For This Useful Post:
edge (1st August 2010)
  #5  
Old 1st August 2010, 16:42
edge edge is offline
Moderator
 
Join Date: Dec 2005
Location: The Netherlands
Posts: 2,033
Thanks: 260
Thanked 145 Times in 127 Posts
Default

Okay. Insalled it, and looks like it's working great
Thank you
__________________
Never execute code written on a Friday or a Monday.

Last edited by edge; 1st August 2010 at 16:51.
Reply With Quote
  #6  
Old 1st August 2010, 16:47
xaver xaver is offline
Member
 
Join Date: May 2009
Posts: 77
Thanks: 10
Thanked 24 Times in 14 Posts
Default

Code:
            $state = 'no_state';
            $data['output']= '';
        }

        /*
         * Insert the data into the database
         */
        $sql = "INS
not in /* part, but between } and $sql
Reply With Quote
The Following User Says Thank You to xaver For This Useful Post:
edge (1st August 2010)
  #7  
Old 27th October 2010, 01:43
xaver xaver is offline
Member
 
Join Date: May 2009
Posts: 77
Thanks: 10
Thanked 24 Times in 14 Posts
Default

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
Reply With Quote
  #8  
Old 27th October 2010, 08:09
edge edge is offline
Moderator
 
Join Date: Dec 2005
Location: The Netherlands
Posts: 2,033
Thanks: 260
Thanked 145 Times in 127 Posts
Default

For me it's working great.
Debian 5.

Thank you.
__________________
Never execute code written on a Friday or a Monday.
Reply With Quote
  #9  
Old 27th October 2010, 11:53
till till is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 34,586
Thanks: 792
Thanked 4,983 Times in 3,903 Posts
 
Default

I've added it as feature request in the bugtracker.

http://bugtracker.ispconfig.org/inde...s&task_id=1390
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
Reply

Bookmarks

Tags
3ware, monitoring

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem s RTL8111DL a BCM4311 - Ubuntu Server 10.04 32bit tio289 Installation/Configuration 0 17th June 2010 15:59
22" HP Monitor not working properly Musty Technical 7 18th June 2008 13:32
Verizon EVDO express card and Ubuntu 8.04 HH wesy2kn1 Installation/Configuration 9 5th June 2008 17:54
Installing Beryl On An Ubuntu Feisty Fawn Desktop With An ATI Radeon Graphic Card skyshock21 HOWTO-Related Questions 15 17th May 2007 16:10
Server sometimes (1 or 2 hrs) down :/ edge Server Operation 25 31st July 2006 13:44


All times are GMT +2. The time now is 10:15.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.