Solved

Retrieving Cluster info from "MSCluster.Cluster"

Posted on 2012-04-11
4
1,640 Views
Last Modified: 2012-06-27
I can retrieve all the info about the Nodes from "MSCluster.Cluster", but I can't seem to be able to get the info about the Virtual IP address or any other properties ?

Wscript.Echo objCluster.Resources.Item(1).Name     'Works

But how do I get the virtual address and stats ?
0
Comment
Question by:sidwelle
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
4 Comments
 
LVL 22

Assisted Solution

by:65td
65td earned 500 total points
ID: 37835148
0
 

Author Comment

by:sidwelle
ID: 37835259
Nice snip,  but the "PowerON Hours" did not populate ?

and There is no info about the virtual address ?
0
 

Accepted Solution

by:
sidwelle earned 0 total points
ID: 37839442
Here is what I came up with. Can someone please run this on there cluster to see if it works and how portable it is ?

I am interested to see what the "getGroupName" function returns.

Thanks

Option Explicit

Dim msg
Dim objArgs, objCluster
Set objArgs = WScript.Arguments
Set objCluster = CreateObject("MSCluster.Cluster")
If objArgs.Count > 0 Then
    objCluster.Open(objArgs(0))
Else
    objCluster.Open("")	'Local Cluster ...
End If

'WScript.Echo "Successfully opened " & objCluster.Name

Dim ver 
ver = objCluster.Version.MajorVersion & "." & _
	objCluster.Version.MinorVersion 

msg = msg & "Cluster Name: " & objCluster.Name & "" & vbCr
msg = msg & "Group Name: " & getGroupName(objCluster) & vbCr
msg = msg & "Cluster Address: " & getClusterAddress(objCluster) & vbCr
msg = msg & "Node Count: " & objCluster.Nodes.Count & vbCr
msg = msg & "Version: " & ver & vbCr

Dim owner
owner = objCluster.ResourceGroups.Item("Cluster Group").OwnerNode.Name
msg = msg & "Owner Node: " & owner & vbCr
msg = msg & "=================================" & vbCr

WScript.Echo msg

Set objCluster = Nothing
Set objArgs = Nothing

Function getClusterAddress(objCluster)
	Dim Msg3  , Pname, ClusterAddress, x, i,j, name
	
	'WScript.Echo objCluster.Resources.Count
	X = objCluster.Resources.Count
	For I = 1 To X
		name = objCluster.Resources.Item(i).Name
		'WScript.Echo "Rescurces (" & I & ") " &  name
		
		If name = "Cluster IP Address" Then		'we found the resource ...
			For J = 1 To objCluster.Resources.Item(I).PrivateProperties.Count
				Pname = objCluster.Resources.Item(I).PrivateProperties(J).Name
				'WScript.Echo Pname
				
				If Pname = "Address" Then
					'WScript.Echo "Address: " & objCluster.Resources.Item(I).PrivateProperties(J).Value
					
					getClusterAddress = objCluster.Resources.Item(I).PrivateProperties(J).Value
				End If
				
			Next
		End If
	Next

End Function

Function getGroupName(objCluster)
	Dim X, I, J, Y
	
	X = objCluster.ResourceGroups.Count
'	For I = 1 To X
		'rtype = objCluster.ResourceGroups.Item(I).
		''WScript.Echo "(" & I & ") " & objCluster.ResourceGroups.Item(I).Name '& ", Type: " '& rtype
		'WScript.Echo objCluster.ResourceGroups.Item(I).Resources.
		
		'Y = objCluster.ResourceGroups.Item(I).PrivateProperties.Count
		'	Y = objCluster.ResourceGroups.Item(I).Cluster.ResourceTypes.Count
		'	WScript.Echo ".Cluster.ResourceGroups.Count: " & Y
		'	For J = 1 To Y
		'	 	WScript.Echo "(" & J & ") " & objCluster.ResourceGroups.Item(I).Cluster.ResourceTypes.Item(J).Name
		'Next
'	Next

	getGroupName = objCluster.ResourceGroups.Item(x).Name

End Function

Open in new window

0
 

Author Closing Comment

by:sidwelle
ID: 37932271
thanks for replying.
0

Featured Post

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Background Information Recently I have fixed file server permission issues for one of my client. The client has 1800 users and one Windows Server 2008 R2 domain joined file server with 12 TB of data, 250+ shared folders and the folder structure i…
While rebooting windows server 2003 server , it's showing "active directory rebuilding indices please wait" at startup. It took a little while for this process to complete and once we logged on not all the services were started so another reboot is …

738 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question