Has anyone been able to use UD with Sql Server?

Looking to monitor SQL Server Instance data from several instances. I can’t figure out how to get the data from an invoke-sqlcmd cal to display in UD properly.

Hey @dennisa95 please have a look at this https://github.com/psDevUK/psUniversalDashboard?files=1
This is a dashboard linked to sql

I use https://github.com/ctigeek/InvokeQueryPowershellModule with a Postgres DB and haven’t had much issue at all beyond my learning how to use SQL.

I’m looking for a way to return data from the Invoke-Sqlcmd to the Out-UDMonitor cdmlet. I’m querying several sql server dmvs to get performance data

I figured it out. My query returns a column value so I needed to reference that value when passing it to Out-UDMonitorData. This may not be the best way to do this but here’s what I came up with:

New-UdRow {
$SQLInstance = ‘host,port’
$query = “select cntr_value FROM sys.dm_os_performance_counters WHERE counter_name = ‘Buffer cache hit ratio’”
New-UdColumn -size 12 {
New-UDMonitor -Title “Hit Ratio” -Type Line -DataPointHistory 20 -RefreshInterval 30 -ChartBackgroundColot ‘#80E8611D’ -ChartBorderColor ‘#FFE8611D’ -Endpoint {
try {
(invoke-sqlcmd -serverinstance $SQLInstance -database master -query $query).cntr_value | Out-UDMonitorData
}
catch {
0 | Out-UDMonitorData
}
}
}