Widget that shows how many licenses are available on each DPA server

I am trying to make a widget for my orion dashboard that will show me the server name and how many Licenses have been allocated. Can anyone help here?

  • I couldn't find how many licenses that are left in SWQL but here is a query to show the number of licenses used and how many instances that are not licensed. Also the code tried to find the node in orion that DPA is installed on, if it is monitored by Orion and has the same name. Hope that helps.

    SELECT      
        COUNT(D.IsLicensed) AS [Licensed]
        ,COUNT(D2.DatabaseInstanceID) AS [NotLicensed]
        ,D.DpaServer.OrionHostname AS [DPA NodeName]
        ,N.Nodeid AS [NodeID]
    FROM Orion.DPA.DatabaseInstance AS D
    LEFT OUTER JOIN Orion.Nodes AS N ON D.DpaServer.OrionHostname=N.Caption
    LEFT OUTER JOIN Orion.DPA.DatabaseInstance AS D2 ON D.DpaServer.DpaServerId=D2.DpaServer.DpaServerId AND D2.IsLicensed=FALSE
    WHERE D.IsLicensed=TRUE
    GROUP BY D.DpaServer.OrionHostname, N.Nodeid