solarwinds / OrionSDK

SDK for the SolarWinds Orion platform, including tools, documentation, and samples in PowerShell, C#, Go, Perl, and Java.
https://thwack.com/OrionSDK
Apache License 2.0
401 stars 144 forks source link

Help joining #243

Closed junaid360 closed 4 years ago

junaid360 commented 4 years ago

Hi, How can i use both together

SELECT VoipGatewayID, TrunkCount, RecordTime, MaxUtilization FROM Orion.IpSla.VoipGatewayDetailStats

SELECT VoipGatewayID, NodeID, DisplayName, DeviceName, DateTime FROM Orion.IpSla.VoipGateways

danjagnow commented 4 years ago

I don't have data to test this with at present, but you can potentially use a query like this:

SELECT
    g.NodeID,
    g.VoipGatewayID,
    g.DisplayName,
    g.DeviceName,
    g.DateTime,
    ds.ObservationTimestamp,
    ds.TrunkCount,
    ds.RecordTime,
    ds.MaxUtilization
FROM Orion.IpSla.VoipGatewayDetailStats AS ds
INNER JOIN Orion.IpSla.VoipGateways AS g ON g.VoipGatewayID = ds.VoipGatewayID

I added the ObservationTimestamp from Orion.IpSla.VoipGatewayDetailStats since that is part of the primary key. If you're only interested in the most recent observation, you'll have to do some additional filtering.