Skip to content

Commit c4af3f4

Browse files
committed
Update README.md
1 parent 26d1787 commit c4af3f4

1 file changed

Lines changed: 137 additions & 164 deletions

File tree

README.md

Lines changed: 137 additions & 164 deletions
Original file line numberDiff line numberDiff line change
@@ -56,195 +56,168 @@ To call the script to run infinitely, waiting 5 minutes between each iteration,
5656
- [ ] Ability to read from non-clustered ESX implementations.
5757

5858
## Syntax
59-
`VMPerf-To-Graphite.ps1 [[-Server] <String>] [[-User] <String>] [[-Password] <String>] [[-Protocol] <String>] [[-Datacenter] <String[]>] [[-Cluster] <String[]>] [[-Graphiteserver] <String>] [[-Graphiteserverport] <Int32>] [[-Group] <String>] [[-Sleepseconds] <Int32>] [[-Iterations] <Int32>] [[-FromLastPoll] <String>] [-Whatif] [[-EventLogLevel] <String>] [<CommonParameters>]`
59+
`VMPerf-To-Graphite.ps1 [[-Server] <String>] [[-User] <String>] [[-Password] <String>] [[-Protocol] <String>] [[-Datacenter] <String[]>] [[-Cluster] <String[]>] [[-Graphiteserver] <String[]>] [[-Graphiteserverport] <Int32>] [[-Group] <String>] [[-Iterations] <Int32>] [[-FromLastPoll] <String>] [[-Sleepseconds] <Int32>] [-Whatif] [[-EventLogLevel] <String>] [<CommonParameters>]`
6060

6161
### Parameters and Description
6262
```
6363
-Server <String>
64-
Specifies the IP address or the DNS name of the vCenter server to which you want to connect.
65-
66-
Required? false
67-
Position? 1
68-
Default value your_default_vcenter_server
69-
Accept pipeline input? false
70-
Accept wildcard characters? false
71-
64+
Specifies the IP address or the DNS name of the vCenter server to which you want to connect.
65+
66+
Required? false
67+
Position? 1
68+
Default value your_default_vcenter_server
69+
Accept pipeline input? false
70+
Accept wildcard characters? false
71+
7272
-User <String>
73-
Specifies the user name you want to use for authenticating with the vCenter server.
74-
75-
Required? false
76-
Position? 2
77-
Default value vcenter_user
78-
Accept pipeline input? false
79-
Accept wildcard characters? false
80-
73+
Specifies the user name you want to use for authenticating with the vCenter server.
74+
75+
Required? false
76+
Position? 2
77+
Default value vcenter_user
78+
Accept pipeline input? false
79+
Accept wildcard characters? false
80+
8181
-Password <String>
82-
Specifies the password you want to use for authenticating with the vCenter server.
83-
84-
Required? false
85-
Position? 3
86-
Default value vcenter_password
87-
Accept pipeline input? false
88-
Accept wildcard characters? false
89-
82+
Specifies the password you want to use for authenticating with the vCenter server.
83+
84+
Required? false
85+
Position? 3
86+
Default value vcenter_password
87+
Accept pipeline input? false
88+
Accept wildcard characters? false
89+
9090
-Protocol <String>
91-
Specifies the Internet protocol you want to use for the connection. It can be either http or https.
92-
93-
Required? false
94-
Position? 4
95-
Default value https
96-
Accept pipeline input? false
97-
Accept wildcard characters? false
98-
91+
Specifies the Internet protocol you want to use for the connection. It can be either http or https.
92+
93+
Required? false
94+
Position? 4
95+
Default value https
96+
Accept pipeline input? false
97+
Accept wildcard characters? false
98+
9999
-Datacenter <String[]>
100-
Specifies the VMWare Datacenters you want to receive data from. Default is to read all Clusters managed by
101-
VCenter server.
102-
103-
Required? false
104-
Position? 5
105-
Default value *
106-
Accept pipeline input? false
107-
Accept wildcard characters? false
108-
100+
Specifies the VMWare Datacenters you want to receive data from. Default is to read all Clusters managed by VCenter server.
101+
102+
Required? false
103+
Position? 5
104+
Default value *
105+
Accept pipeline input? false
106+
Accept wildcard characters? false
107+
109108
-Cluster <String[]>
110-
Specifies the VMWare Clusters you want to receive data from. Default is to read all Clusters managed by
111-
VCenter server or, if -Datacenter is specified, all Clusters in this Datacenter.
112-
113-
Required? false
114-
Position? 6
115-
Default value *
116-
Accept pipeline input? false
117-
Accept wildcard characters? false
118-
119-
-Graphiteserver <String>
120-
Specifies the IP address or the DNS name of the Graphite server to which you want to connect.
121-
122-
Required? false
123-
Position? 7
124-
Default value your_default_grafana_server
125-
Accept pipeline input? false
126-
Accept wildcard characters? false
127-
109+
Specifies the VMWare Clusters you want to receive data from. Default is to read all Clusters managed by VCenter server or, if -Datacenter is specified, all Clusters in this Datacenter.
110+
111+
Required? false
112+
Position? 6
113+
Default value *
114+
Accept pipeline input? false
115+
Accept wildcard characters? false
116+
117+
-Graphiteserver <String[]>
118+
Specifies one or more (separated by comma) IP addresses or the DNS names of the Graphite servers which you want to connect to.
119+
You can also add the Portnumber to each Server like "grafana.acme.com:2003"
120+
121+
Required? false
122+
Position? 7
123+
Default value your_default_grafana_server
124+
Accept pipeline input? false
125+
Accept wildcard characters? false
126+
128127
-Graphiteserverport <Int32>
129-
Specifies the port on the Graphite server you want to use for the connection. Defaults to 2003.
130-
131-
Required? false
132-
Position? 8
133-
Default value 2003
134-
Accept pipeline input? false
135-
Accept wildcard characters? false
136-
128+
Specifies the port on the Graphite server you want to use for the connection. Defaults to 2003. You can also add the portnumber to the servers hostname or IP address in the -Graphiteserver parameter.
129+
130+
Required? false
131+
Position? 8
132+
Default value 2003
133+
Accept pipeline input? false
134+
Accept wildcard characters? false
135+
137136
-Group <String>
138-
Specifies the Group, an additional prefix for the metrics path in Graphite. The metrics path will be
139-
"vmperf.<Group>."
140-
141-
Required? false
142-
Position? 9
143-
Default value Default
144-
Accept pipeline input? false
145-
Accept wildcard characters? false
146-
147-
-Sleepseconds <Int32>
148-
Specifies the number of seconds to wait between iterations. The counter starts after the last statistics have
149-
been sent to Graphite.
150-
Note that VCenter is collecting its performance statistics every 20 seconds and saves an average of the
151-
collected counters. It makes no sense to specify a value below 20 seconds here. The script reads the so called
152-
"Realtime" counters from VCenter which will be kept there for one hour. So do not use anything above 3600
153-
seconds.
154-
The script requests all statistics data from VCenter server since the last time they were requested,
155-
regardless of how long the Sleepseconds parameter was set. You wont miss any data.
156-
157-
Required? false
158-
Position? 10
159-
Default value 60
160-
Accept pipeline input? false
161-
Accept wildcard characters? false
162-
137+
Specifies the Group, an additional prefix for the metrics path in Graphite. The metrics path will be "vmperf.<Group>."
138+
139+
Required? false
140+
Position? 9
141+
Default value Default
142+
Accept pipeline input? false
143+
Accept wildcard characters? false
144+
163145
-Iterations <Int32>
164-
Specifies the number of iterations. 0 = indefinitely.
165-
166-
Required? false
167-
Position? 11
168-
Default value 0
169-
Accept pipeline input? false
170-
Accept wildcard characters? false
171-
146+
Specifies the number of iterations. 0 = indefinitely.
147+
148+
Required? false
149+
Position? 10
150+
Default value 0
151+
Accept pipeline input? false
152+
Accept wildcard characters? false
153+
172154
-FromLastPoll <String>
173-
Optional path and name of an .xml file where the date and time of the last poll will be saved.
174-
If the file does not exist, it will be created and overwritten after each poll.
175-
If this parameter is set, the script will try to receive all metrics from the VCenter Server starting at the
176-
date and time of the last poll up to the most recent data (Real-Time).
177-
This is useful if you want to schedule the script externally (with Task Scheduler, for instance) and you want
178-
to use the "-Iterations 1" parameter.
179-
But be careful, VCenter stores the Real-Time statistics just for a limited number of time (1 day per default).
180-
181-
Required? false
182-
Position? 12
183-
Default value
184-
Accept pipeline input? false
185-
Accept wildcard characters? false
186-
155+
Optional path and name of an .xml file where the date and time of the last poll will be saved. If the file does not exist, it will be created and overwritten after each poll.
156+
If this parameter is set, the script will try to receive all metrics from the VCenter Server starting at the date and time of the last poll up to the most recent data (Real-Time).
157+
This is useful if you want to schedule the script externally (with Task Scheduler, for instance) and you want to use the "-Iterations 1" parameter.
158+
But be careful, VCenter stores the Real-Time statistics just for a limited number of time (1 day per default).
159+
160+
Required? false
161+
Position? 11
162+
Default value
163+
Accept pipeline input? false
164+
Accept wildcard characters? false
165+
166+
-Sleepseconds <Int32>
167+
Specifies the number of seconds to wait between iterations. The counter starts after the last statistics have been sent to Graphite.
168+
Note that VCenter is collecting its performance statistics every 20 seconds and saves an average of the collected counters. It makes no sense to specify a value below 20 seconds here. The script reads the so called
169+
"Realtime" counters from VCenter which will be kept there for one hour. So do not use anything above 3600 seconds.
170+
The script requests all statistics data from VCenter server since the last time they were requested, regardless of how long the Sleepseconds parameter was set. You wont miss any data.
171+
172+
Required? false
173+
Position? 12
174+
Default value 60
175+
Accept pipeline input? false
176+
Accept wildcard characters? false
177+
187178
-Whatif [<SwitchParameter>]
188-
Indicate that the cmdlet will process but will NOT send any metrics to Graphite, instead display a list of
189-
metrics that would be sent to Graphite.
190-
191-
Required? false
192-
Position? named
193-
Default value False
194-
Accept pipeline input? false
195-
Accept wildcard characters? false
196-
179+
Indicate that the cmdlet will process but will NOT send any metrics to Graphite, instead display a list of metrics that would be sent to Graphite.
180+
181+
Required? false
182+
Position? named
183+
Default value False
184+
Accept pipeline input? false
185+
Accept wildcard characters? false
186+
197187
-EventLogLevel <String>
198-
Set the Log-Level for writing events to the Windows Aplication log. Valid values are Error, Warning,
199-
Information, and None. The default value is Warning.
200-
Note that if you like to use logging to the Windows Event Log, you have to run this script at least once with
201-
administrative privileges on this computer!
202-
203-
Required? false
204-
Position? 13
205-
Default value Warning
206-
Accept pipeline input? false
207-
Accept wildcard characters? false
208-
188+
Set the Log-Level for writing events to the Windows Aplication log. Valid values are Error, Warning, Information, and None. The default value is Warning.
189+
Note that if you like to use logging to the Windows Event Log, you have to run this script at least once with administrative privileges on this computer!
190+
191+
Required? false
192+
Position? 13
193+
Default value Warning
194+
Accept pipeline input? false
195+
Accept wildcard characters? false
196+
209197
<CommonParameters>
210-
This cmdlet supports the common parameters: Verbose, Debug,
211-
ErrorAction, ErrorVariable, WarningAction, WarningVariable,
212-
OutBuffer, PipelineVariable, and OutVariable. For more information, see
213-
about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216).
214-
198+
This cmdlet supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, WarningVariable,
199+
OutBuffer, PipelineVariable, and OutVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216).
215200
```
216201

217202
## Examples
218203
### Example 1
219-
`PS C:\>VMPerf-To-Graphite.ps1 -Verbose`
220-
204+
`C:\PS> VMPerf-To-Graphite.ps1 -Verbose`
221205
Use default values from within this script and display the status output on the screen.
222-
223206
### Example 2
224-
`PS C:\>VMPerf-To-Graphite.ps1 -Verbose -Server myvcenter.vienna.acme.com -User ACME\StatsReader -Password mypass
225-
-Sleepseconds 300 -Graphiteserver graphite1.it.acme.com -Group Vienna`
226-
227-
Read the counters from the VCenter server myvcenter.vienna.acme.com, send the metrics to graphite1.it.acme.com
228-
with a metrics path of "vmperf.Vienna." and then wait 5 minutes before the next iteration.
229-
207+
`C:\PS> VMPerf-To-Graphite.ps1 -Verbose -Server myvcenter.vienna.acme.com -User ACME\StatsReader -Password mypass -Graphiteserver graphite1.it.acme.com -Iterations 1 -FromLastPoll Vienna_Poll.xml`
208+
Run the cmdlet just once. Write the date and time of the Poll to Vienna_Poll.xml. The next time the script runs, it will read the file and gather the metrics from VCenter starting at the last poll.
230209
### Example 3
231-
`PS C:\>VMPerf-To-Graphite.ps1 -Verbose -Server myvcenter.vienna.acme.com -User ACME\StatsReader -Password mypass
232-
-Sleepseconds 300 -Graphiteserver graphite1.it.acme.com -Group Vienna -Cluster TESTDEV`
233-
234-
Read the counters from Cluster TESTDEV in the VCenter server myvcenter.vienna.acme.com, send the metrics to
235-
graphite1.it.acme.com with a metrics path of "vmperf.Vienna." and then wait 5 minutes before the next iteration.
236-
210+
`C:\PS> VMPerf-To-Graphite.ps1 -Verbose -Server myvcenter.vienna.acme.com -User ACME\StatsReader -Password mypass -Graphiteserver graphite1.it.acme.com,graphdev.it.acme.com:62033 -Iterations 1 -FromLastPoll Vienna_Poll.xml`
211+
Same as above but send the metrics to two servers, graphite1.it.acme.com at (default) port 2003 and graphdev.it.acme.com on port 62033.
237212
### Example 4
238-
`PS C:\>VMPerf-To-Graphite.ps1 -Verbose -Iterations 1 -WhatIf | Out-GridView`
239-
240-
Run the cmdlet just once, but do not send the metrics to Graphite, instead open a window and display the results.
241-
213+
`C:\PS> VMPerf-To-Graphite.ps1 -Verbose -Server myvcenter.vienna.acme.com -User ACME\StatsReader -Password mypass -Sleepseconds 300 -Graphiteserver graphite1.it.acme.com -Group Vienna`
214+
Read the counters from the VCenter server myvcenter.vienna.acme.com, send the metrics to graphite1.it.acme.com with a metrics path of "vmperf.Vienna." and then wait 5 minutes before the next iteration.
242215
### Example 5
243-
`PS C:\>VMPerf-To-Graphite.ps1 -Verbose -Server myvcenter.vienna.acme.com -User ACME\StatsReader -Password mypass
244-
-Graphiteserver graphite1.it.acme.com -Iterations 1 -FromLastPoll Vienna_Poll.xml`
245-
246-
Run the cmdlet just once. Write the date and time of the Poll to Vienna_Poll.xml. The next time the script runs,
247-
it will read the file and gather the metrics from VCenter starting at the last poll.
216+
`C:\PS> VMPerf-To-Graphite.ps1 -Verbose -Server myvcenter.vienna.acme.com -User ACME\StatsReader -Password mypass -Sleepseconds 300 -Graphiteserver graphite1.it.acme.com -Group Vienna -Cluster TESTDEV`
217+
Read the counters from Cluster TESTDEV in the VCenter server myvcenter.vienna.acme.com, send the metrics to graphite1.it.acme.com with a metrics path of "vmperf.Vienna." and then wait 5 minutes before the next iteration.
218+
### Example 6
219+
`C:\PS> VMPerf-To-Graphite.ps1 -Verbose -Iterations 1 -WhatIf | Out-GridView`
220+
Run the cmdlet just once, but do not send the metrics to Graphite, instead open a window and display the results.
248221

249222
## Licensing
250223
This work is licensed under a [Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License] (http://creativecommons.org/licenses/by-nc-sa/4.0/).

0 commit comments

Comments
 (0)