Quantcast
Channel: THWACK: All Content - Orion SDK
Viewing all articles
Browse latest Browse all 2677

Alerts Triggered (Year to Date) with counters

$
0
0

Hello, I found this alerts triggered report, however, when I run this; it's only showing last 30 days.  Is there a way to show year to date?

 

Thanks!

 

 

select ac.Name 

,ah.Message 

,'/Orion/NetPerfMon/ActiveAlertDetails.aspx?NetObject=AAT:'+ToString(AlertObjectID) as [_linkfor_Name] 

,EntityCaption as [Trigger Object] 

,EntityDetailsUrl as [_linkfor_Trigger Object] 

,case  

WHEN RelatedNodeCaption=EntityCaption THEN 'Self' 

When RelatedNodeCaption!=EntityCaption THEN RelatedNodeCaption 

End as [Parent Node] 

,RelatedNodeDetailsUrl as [_linkfor_Parent Node] 

,'/Orion/images/StatusIcons/Small-' + p.StatusIcon AS [_IconFor_Parent Node] 

,tostring(tolocal(ah.TimeStamp)) as [Trigger Time] 

,case when ack.timestamp is null then 'N/A' 

else tostring(minutediff(ah.TimeStamp,ack.timestamp)) 

end as [Minutes Until Acknowledged] 

,ack.Message as [Note] 

,case when reset.timestamp is null then 'N/A' 

else tostring(minutediff(ah.TimeStamp,reset.timestamp)) 

end as [Minutes Until Reset],

 

t1.SuppressFrom as [Mute From], t1.SuppressUntil as [Mute Until],

 

p.Status as [Status]

,'/Orion/NetPerfMon/NodeDetails.aspx?NetObject=' + ToString(p.nodeid) AS [_LinkFor_Status] 

,Case 

WHEN p.status = '0' THEN ('/Orion/images/StatusIcons/Critical.gif') 

WHEN p.status = '1' THEN ('/Orion/images/StatusIcons/up.gif') 

WHEN p.status = '2' THEN ('/Orion/images/StatusIcons/Down.gif') 

WHEN p.status = '9' THEN ('/Orion/images/StatusIcons/Unmanaged.gif') 

WHEN p.status = '6' THEN ('/Orion/images/StatusIcons/Unplugged.gif') 

End as [_IconFor_Status], 

 

p.StatusLED, p.ChildStatus, p.DetailsUrl, p.caption as [NodeName]

 

,'/Orion/NetPerfMon/NodeDetails.aspx?NetObject=' + ToString(p.nodeid) AS [_LinkFor_NodeName] 

,Case 

WHEN p.status = '0' THEN ('/Orion/images/StatusIcons/Critical.gif') 

WHEN p.status = '1' THEN ('/Orion/images/StatusIcons/up.gif') 

WHEN p.status = '2' THEN ('/Orion/images/StatusIcons/Down.gif') 

WHEN p.status = '9' THEN ('/Orion/images/StatusIcons/Unmanaged.gif') 

WHEN p.status = '6' THEN ('/Orion/images/StatusIcons/Unplugged.gif') 

End as [_IconFor_NodeName], 

 

p.ip_address

 

FROM Orion.AlertHistory ah 

left join Orion.AlertObjects ao on ao.alertobjectid=ah.alertobjectid 

left join Orion.AlertConfigurations ac on ac.alertid=ao.alertid 

left join Orion.Actions a on a.actionid=ah.actionid 

left join Orion.Nodes p on p.nodeid=RelatedNodeID

left join orion.NodesCustomProperties cp on p.NodeID = cp.NodeID

left join (select timestamp, AlertActiveID, AlertObjectID,message from orion.alerthistory ah where eventtype=2) ack on ack.alertactiveid=ah.AlertActiveID and ack.alertobjectid=ah.AlertObjectID 

left join (select timestamp, AlertActiveID, AlertObjectID from orion.alerthistory ah where eventtype=1) reset on reset.alertactiveid=ah.AlertActiveID and reset.alertobjectid=ah.AlertObjectID 

 

 

left join orion.AlertSuppression T1 on T1.EntityUri = p.Uri

 

 

WHERE  

(ao.AlertConfigurations.Name = 'Critical' ) and ah.eventtype=0  and cp.asset_type = 'server'

 

 

 

order by ah.timestamp desc 


Viewing all articles
Browse latest Browse all 2677

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>