Skip to content

Commit f384524

Browse files
authored
Create get-clusterinfo.ps1 (Azure#337)
1 parent 0e1c8a2 commit f384524

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#Run this script to gather cluster roles` information.
2+
#No parameters required. Script needs to be run on any cluster node.
3+
$clusterOutputFile="cluster-config.csv"
4+
$groups=Get-ClusterGroup
5+
"RoleName,ResourceName,IP,ProbePort,ServicePort,NewIP" | out-file $clusterOutputFile
6+
$probePort=59999 # initial probe port number.
7+
foreach ($g in $groups)
8+
{
9+
$resources=$g | Get-ClusterResource | Where-Object {$_.ResourceType -eq 'IP Address'}
10+
foreach ($r in $resources)
11+
{
12+
$params=$r | Get-ClusterParameter | Where-Object {$_.Name -eq "Address"}
13+
"$($g.name),$($r.Name),$($params.Value),$probePort,," | out-file $clusterOutputFile -append
14+
$probePort++
15+
}
16+
}

0 commit comments

Comments
 (0)