Solved

Retrieving Cluster info from "MSCluster.Cluster"

Posted on 2012-04-11
4
1,663 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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Issue: One Windows 2008 R2 64bit server on the network unable to connect to a buffalo Device (Linkstation) with firmware version 1.56. There are a total of four servers on the network this being one of them. Troubleshooting Steps: Connect via h…
Deploying a Microsoft Access application in a Citrix environment is not difficult but takes a few steps. However, Citrix system people are often of little help, as they typically know next to nothing about Access. The script provided here will take …
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
Suggested Courses

634 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