Quantcast
Channel: THWACK: Message List
Viewing all articles
Browse latest Browse all 20396

Re: Re: Re: Help on getting HTML links into a Custom Query

$
0
0

Figured it out!

 

The issue stems from how Orion uses conventional ID numbers for most objects, but for Custom Node Pollers it uses what looks like unique identifiers (such as 01d8de05-4b07-4d07-98bc-32349f7820b4).  Thus, when it tries to use one in a comparison it bombs out.  To resolve this, I wrapped each Join On in a ToString when it comes from another table:

 

SELECT  tolocal(AStat.TriggerTimeStamp) AS [Time of Alert],  AStat.ObjectName AS [Alert],  ADefs.Name AS [Category],  tolocal(AStat.AcknowledgedTime) AS [Acked Time],  AStat.AcknowledgedBy AS [Acked By],  AStat.Notes,  CASE      WHEN AStat.ObjectType = 'Node' THEN ('/Orion/NetPerfMon/NodeDetails.aspx?NetObject=N%3a' + ToString(Nodes.NodeID))      WHEN AStat.ObjectType = 'Volume' THEN ('/Orion/NetPerfMon/VolumeDetails.aspx?NetObject=V%3a' + ToString(Volumes.VolumeID))      WHEN AStat.ObjectType = 'Hardware Sensor' THEN ('/Orion/NetPerfMon/NodeDetails.aspx?NetObject=N%3a' + ToString(Hardware.NodeID))      WHEN AStat.ObjectType = 'APM: Component' THEN ('/Orion/View.aspx?NetObject=AM%3a' + ToString(APMC.ComponentID))      WHEN AStat.ObjectType = 'Custom Node Poller' THEN ('/Orion/View.aspx?NetObject=N%3a' + ToString(CusPol.NodeID))  END AS [_LinkFor_Alert]
FROM Orion.AlertStatus  AS AStat
INNER JOIN Orion.AlertDefinitions  AS ADefs  ON AStat.AlertDefID = ADefs.AlertDefID
LEFT OUTER JOIN Orion.Nodes  AS Nodes  ON ToString(Nodes.NodeID) = AStat.ActiveObject AND AStat.ObjectType = 'Node'
LEFT OUTER JOIN Orion.Volumes  AS Volumes  ON ToString(Volumes.VolumeID) = AStat.ActiveObject AND AStat.ObjectType = 'Volume'
LEFT OUTER JOIN Orion.HardwareHealth.HardwareItem  AS Hardware  ON ToString(Hardware.ID) = AStat.ActiveObject AND AStat.ObjectType = 'Hardware Sensor'
LEFT OUTER JOIN Orion.APM.Component  AS APMC  ON ToString(APMC.ComponentID) = AStat.ActiveObject AND AStat.ObjectType = 'APM: Component'
LEFT OUTER JOIN Orion.NPM.CustomPollerAssignment  AS CusPol  ON ToString(CusPol.CustomPollerAssignmentID) = AStat.ActiveObject AND AStat.ObjectType = 'Custom Node Poller'
WHERE  Acknowledged = 1
ORDER BY TriggerTimeStamp

 

As far as I can tell, this would only affect you if you currently have an alert that is based off of a Custom Node Poller, or on any object that uses a identifier like 01d8de05-4b07-4d07-98bc-32349f7820b4.

 

Thank you for your help; looking into that log got the gears turning in my head and got me thinking along the lines of "Hey, maybe the data isn't sane ... somehow?".


Viewing all articles
Browse latest Browse all 20396

Trending Articles



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