Closed mkellerman closed 3 years ago
New-UDMonitor does not exist in the UDv3 framework. You need to include the chart component and use New-UDChartJSMonitor: https://docs.ironmansoftware.com/dashboard/components/data-visualization/charts#monitors
I did try that too..
[01-28-21 09:30:38 PM] An error occurred: The term 'New-UDChartJSMonitor' is not recognized as the name of a cmdlet, function, script file, or operable program.
Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
Endpoint: b917af6d-c406-4848-8833-aef54a44ccab
Session: 0ca9fd42-dd4a-4663-a84e-e01f46142b74
File: /data/Repository/SQL Monitor.ps1
Endpoint Start Line: 1
Endpoint End Line: 9
Stack Trace: at <ScriptBlock>, <No file>: line 2
I got it working by forcing the import of the module inside the endpoint:
New-UDDashboard -Title "Hello, World!" -Content {
Import-Module ./data/UniversalDashboard/Components/UniversalDashboard.Charts/1.3.2/UniversalDashboard.Charts.psd1
New-UDChartJSMonitor -LoadData {
$cache:sqlcounters = Invoke-RestMethod http://localhost:5000/api/sqlcounters
$cache:sqlcounters.PageLookupsPerSecond | Out-UDChartJSMonitorData
} -Labels "PageLookupsPerSecond" -ChartBackgroundColor "#297741" -RefreshInterval 10
}
I think the issue is that it's pointing to './data/UniversalDashboard/Components/UniversalDashboard.Charts/1.3.2' but not the 'UniversalDashboard.Charts.psd1'
Description
Same setup as #92
But this time, create a dashboard, add the Charts component, and add New-UDMonitor:
Logs:
Version Information
Internal Issue
We'll fill this out when we create an internal issue in our repository.