I created a uddashboard to extract vmware cluster info real time. Not successful with get-stat realtime due to authentication issues. This script is working but not reloading … its static … i want the report whenever i refresh the web page… gurus, can you please help me… thanks
If you’re running UD 2.7, it should automatically find that function. If not, you’ll need to use New-UDEndpointInitialization to get that function defined in the PS runspace.
Thanks Adam!
I updated to UD2.7 but still the function is not recognized.
It is giving me this error instead.
You have modified the global:DefaultVIServer and global:DefaultVIServers system variables. This is not allowed. Please reset them to $null and reconnect to the vSphere server.
The moment I modify the script back to old way it works.
Hi @vishnu when you upgraded, I take it you deleted/moved all previous files…there have been a few people on here just copy stuff over, and it doesn’t work properly, just want to rule that out.
I always use the -AutoRefresh followed by the -RefreshInterval 10 so that would refresh the grid every 10 seconds…Or change it to a value you want the grid to refresh on…
I tried this as well but still not working… it keeps on showing the same data until i re run the script…
I am thinking of creating schedule task to run this script every 10 mins until we get some solution.
I take it you ctrl+F5 your browser to make sure getting latest version? I’m sure on poshud.com there is grid example with reloading random numbers. Can you please verify that works ok for you? Thank you
I am getting the latest version. But the problem still persists.
This is due to the $obj get the data first and the same data shows up even after ctrl+f5 as the $obj was cached and displays the same value.
There is a solution for your issue which is by implementing $cache and $Schedule1 = New-UDEndpointSchedule -Every 10 -Minute
for example
$Task = New-UDEndpoint -Schedule $Schedule1 -Endpoint {
$Cache:Task = ("what ever function or script you need to run every 10 minutes")
{
Start-UDDashboard -Wait -Endpoint @($Task)......
this way your command will execute every 10 minutes and update the values
Apologies I have been off work today and tried my best to keep away from the keyboard. Both methods mentioned would work…but I am assuming you would ‘call’ your function inside the endpoint as @adam described…then you can refresh that individual endpoint with the autorefresh and refreshinterval parameters…Or quite rightly as @wsl2001 has mentioned the sacred $Cache variable with a scheduled enpoint described here:- https://docs.universaldashboard.io/endpoints/scheduled-endpoints
Or as I was assuming import the function into UD then be able to call it from within any endpoint in your dashboard:- https://docs.universaldashboard.io/endpoints/endpoint-initialization