cancel
Showing results for 
Search instead for 
Did you mean: 
Create Post

Re: Report on Muted and Unmanaged Entities

Jump to solution

Was able to test it in a 12.1 environment and it works as expected

pastedImage_0.png

0 Kudos
Highlighted

Re: Report on Muted and Unmanaged Entities

Jump to solution

Submitted a support case for this. Not getting my hopes up but I'll let you know what the results are of the support case if any.

0 Kudos
Highlighted

Re: Report on Muted and Unmanaged Entities

Jump to solution

Ok - Maybe mesverrum​ will be able to shed some light as the original code is his.

- David Smith
0 Kudos
Highlighted

Re: Report on Muted and Unmanaged Entities

Jump to solution

I took a look in my lab, several of the queries I have written using Unions show this same behavior, but some of them still count like normal...  I'll need to spend some time pinning down what syntax exactly is breaking the page count mechanism in the Custom Query resource

- Marc Netterfield, Github
0 Kudos
Highlighted

Re: Report on Muted and Unmanaged Entities

Jump to solution

SolarWinds support got back to me today. They are sending the case to development as a bug with the custom query widget. As they update me I will update here.

Highlighted

Re: Report on Muted and Unmanaged Entities

Jump to solution

SolarWinds support got back to me today and said thanks for the bug report, with no timeline for fixing it. They recommended that I put in a feature request as well to raise awareness.

Here's the feature request for it.

0 Kudos
Highlighted
Level 13

Re: Report on Muted and Unmanaged Entities

Jump to solution

Such a beautiful resource!

Can a SQL genius add a custom property call Customer for this to the query?

I worship your Epicness! Coding is an art, a talent, something many of us mere mortals lack unfortunately.

0 Kudos
Highlighted

Re: Report on Muted and Unmanaged Entities

Jump to solution

This can be accomplished by adding in the appropriate custom property in the where statement, below is a modified one using your example as a node custom property called customer with a value of Test. I didn't test it for the interfaces and the applications portion, but because it's still referencing the node table you should still be able to insert it to their corresponding where statements and recreate it.

-- Unmanaged Nodes
SELECT
'Unmanaged' as [Status]
,n.Caption AS [Node]
,'Node' AS [Object]
,tostring(tolocal(n.UnManageFrom)) AS [From]
,case when n.UnManageUntil is null or n.UnManageUntil = '9999-01-01 00:00:00' then 'Not set'
else tostring(tolocal(n.UnManageUntil)) end AS [Until]
,case when n.UnManageUntil is null or n.UnManageUntil = '9999-01-01 00:00:00' then '-'
else tostring(daydiff(getutcdate(), n.unmanageuntil)) end as [Days Left]
,n.DetailsURL AS [_LinkFor_Node]
,n.DetailsURL AS [_LinkFor_Object]
,'/Orion/images/StatusIcons/Small-' + n.StatusLED AS [_IconFor_Node]
,'/Orion/images/StatusIcons/Small-' + n.StatusLED AS [_IconFor_Object]
,CASE
WHEN ae.accountID IS NULL THEN 'Audit Log Not Found'
ELSE ae.AccountID
END AS [Account]
FROM
Orion.Nodes n
FULL JOIN (
    SELECT rec.NetObjectID, max(rec.timeloggedutc) as recent
    FROM Orion.AuditingEvents rec
    WHERE rec.auditingactiontype.actiontype = 'Orion.NodeUnmanaged'
    group BY rec.NetObjectID) mostrecent ON mostrecent.NetObjectID = n.NodeID
FULL JOIN (
    SELECT ae.NetObjectID, ae.AccountID, ae.timeloggedutc
    FROM Orion.AuditingEvents ae
    WHERE ae.auditingactiontype.actiontype = 'Orion.NodeUnmanaged') ae ON ae.NetObjectID = n.NodeID and ae.timeloggedutc=mostrecent.recent


WHERE n.Status = 9 and n.customproperties.customer = 'Test'
0 Kudos
Highlighted
Level 13

Re: Report on Muted and Unmanaged Entities

Jump to solution

Thanks Chris - I'm actually looking to add the Customer custom property field in the SELECT statement.

This way we can pull all Customers and sort as needed, instead of doing the WHERE clause for each client.

I surmise the Customer property field needs to be placed correctly inside each Union portion of the query. Still hacking away at it, but not getting anywhere. SQL newbs.

  -- Unmanaged Nodes

    SELECT

    'Unmanaged' as [Status]

    ,n.Caption AS [Node] 
  ,n.customproperties.customer AS [Customer] 
    ,'Node' AS [Object]

0 Kudos
Highlighted

Re: Report on Muted and Unmanaged Entities

Jump to solution

Oh I understand now. To do that you'd have to put the line you have above in every select statement below is an example of it modified for every beginning select statement and a screenshot of it working

-- Unmanaged Nodes
SELECT
'Unmanaged' as [Status]
,n.Caption AS [Node]
,'Node' AS [Object]
,n.customproperties.customer as [Customer]
,tostring(tolocal(n.UnManageFrom)) AS [From]

union all
-- Muted Nodes
(SELECT
'Muted' as [Status]
,n.caption
,n.customproperties.customer as [Customer]
,'Node' AS [Object]

UNION ALL
-- Unmanaged Interfaces
(SELECT
'Unmanaged' as [Status]
,n.Caption AS [Node]
,n.customproperties.customer as [Customer]
,i.interfacename as [Interface]

UNION ALL
-- Muted Interfaces
(SELECT
'Muted' as [Status]
,n.Caption AS [Node]
,n.customproperties.customer as [Customer]
,i.interfacename as [Interface]

UNION ALL
-- Unmanaged Application monitors
(
SELECT
'Unmanaged' as [Status]
,n.Caption AS [Node]
,n.customproperties.customer as [Customer]
,A.DisplayName as [Application]

UNION ALL
-- Muted Application monitors
(SELECT
'Muted' as [Status]
,n.Caption AS [Node]
,n.customproperties.customer as [Customer]
,A.DisplayName as [Application]

pastedImage_2.png

0 Kudos