I have seen the light! This make life so much easier (in some parts anyway).
Have you, like me, struggled with getting the correct status icons when writing SWQL for Custom Query widgets? Created long CASE statements or complex JOIN’s to translate the statusID of Nodes, Components, applications etc into icon url's. If so this will make life so much easier.
There is a ”web-function” (probably wrong name but you understand, right) that gives us the correct icon for our entity, ”/Orion/StatusIcon.ashx”.
This ”function” need what type of entity it is, ”entity=Orion.APM.Component”, and the status id, ”status=1”.
Optionally it seems you can send the EntityUri instead of statusid, ”EntityUri=swis://……”. Other options are ”size=small”, even thought ”size=large” does not seem to work always.
Full example: ”MyOrionURL/.../StatusIcon.ashx
How to use this en real life? Lets test it with below script. A script for a Custom Query widget that displays all applications, components and nodes with correct status icons. Uncomment the last line when used in the search query and you get a widget where you easy and fast can search for all components and applications.
SELECT
A.Name AS [Application]
,A.Components.Name AS [Component]
,A.Node.Caption AS [Server]
--- Links and icons
,A.DetailsUrl AS [_LinkFor_Application]
,A.Components.DetailsUrl AS [_LinkFor_Component]
,A.Node.DetailsUrl AS [_LinkFor_Server]
,CONCAT('/Orion/StatusIcon.ashx?entity=Orion.APM.Application&status=',A.Status) AS [_IconFor_Application]
,CONCAT('/Orion/StatusIcon.ashx?entity=Orion.APM.Component&status=',A.Components.Status) AS [_IconFor_Component]
,CONCAT('/Orion/StatusIcon.ashx?entity=Orion.Nodes&status=',A.Node.Status) AS [_IconFor_Server]
FROM ORION.APM.Application AS A
WHERE
A.Components.Status!=27
--AND (A.Name LIKE '%${SEARCH_STRING}%' OR A.Components.Name LIKE '%${SEARCH_STRING}%' OR A.Node.Caption LIKE '%${SEARCH_STRING}%')
