Hello,
We have a report that show the unmanaged and muted nodes. The report is working fine but some reason some user are not able to view the data and only have a message:
"No activity to report"
The report is a SWQL query as follow:
SELECT
'Unmanaged' as [Maintenance]
, n.Caption AS [Node], n.Status, n.ChildStatus
, 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]
, CASE
WHEN ae.accountID IS NULL THEN 'Audit Log Not Found'
ELSE ae.AccountID
END AS [Account]
, nn.Note
FROM Orion.Nodes n
left JOIN orion.NodeNotes nn on nn.NodeID = n.NodeID
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
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.caption like '%${SEARCH_STRING}%' or ae.accountid like '%${SEARCH_STRING}%')
union all (
SELECT
'Muted' as [Maintenance]
, n.caption, n.Status, n.ChildStatus
, tostring(tolocal(SuppressFrom)) as [From]
, case
when SuppressUntil is null or SuppressUntil = '9999-01-01 00:00:00' then 'Not set'
else tostring(tolocal(SuppressUntil ))
end AS [Until]
, case
when SuppressUntil is null or SuppressUntil = '9999-01-01 00:00:00' then '-'
else tostring(daydiff(getutcdate(), asup.SuppressUntil))
end as [Days Left]
, ae.AccountID AS [Account]
, nn.Note
FROM Orion.AlertSuppression asup
join orion.nodes n on asup.entityuri=n.uri
left join orion.NodeNotes nn on nn.NodeID = n.NodeID
join (
SELECT ae.NetObjectID, max(ae.timeloggedutc) as recent
FROM Orion.AuditingEvents ae
WHERE ae.auditingactiontype.actiontype in ('Orion.AlertSuppressionChanged','Orion.AlertSuppressionAdded')
group BY ae.netobjectid
) mostrecent ON mostrecent.NetObjectID = n.NodeID
join (
SELECT ae.NetObjectID, ae.AccountID, ae.timeloggedutc
FROM Orion.AuditingEvents ae
WHERE ae.auditingactiontype.actiontype in ('Orion.AlertSuppressionChanged','Orion.AlertSuppressionAdded')
Order BY ae.TimeLoggedUtc desc
) ae ON ae.NetObjectID = n.NodeID and ae.timeloggedutc=mostrecent.recent
)
Have anyone already had the same behavior ? Are there specific permission to assign to a user to be able to access this kind of report ?