poshprotools icon indicating copy to clipboard operation
poshprotools copied to clipboard

Example to include PowerCLI data

Open ibeerens opened this issue 7 years ago • 5 comments
trafficstars

Are there examples to include VMware PowerCLI data in tables and diagrams?

ibeerens avatar Mar 14 '18 20:03 ibeerens

@ibeerens There is actually a problem with PowerCLI and UD at the moment. See https://github.com/ironmansoftware/universal-dashboard/issues/25

Once this is resolved, I'll make sure to put together some examples.

It probably possible to work around this by using Invoke-Command to use local remoting to run all the PowerCLI commands but it will be slow.

adamdriscoll avatar Mar 19 '18 15:03 adamdriscoll

Any update on this one? Because I'm facing the exact same bug...

apetitjean avatar May 24 '18 07:05 apetitjean

I found a solution. The New-UDDashboard function has a EndpointInitializationScript parameter to define scripts to be executed only once per runscape:

New-UDDashboard -Title $Title -Content {
	New-UdMonitor -Title "CPU (% processor time)" -Type Line -DataPointHistory 20 -RefreshInterval 5 -ChartBackgroundColor '#80FF6B63' -ChartBorderColor '#FFFF6B63'  -Endpoint {
		(get-vmhost host1 | get-stat -stat mem.usage.average -MaxSamples 10|measure Value -Average)| Select-Object -ExpandProperty Average| Out-UDMonitorData
	}
} -EndpointInitializationScript {
	connect-viserver <viserver>
}

jorioux avatar May 29 '18 14:05 jorioux

@jorioux the sample code works prefectly prior to version 2.0.0 (I have tested it on version 1.7.0), but as of version 2.0.0 the "EndpointInitializationScript" is removed

fitsegreat avatar Sep 23 '18 11:09 fitsegreat

Any update ?

Deurnieur avatar Oct 24 '18 12:10 Deurnieur