Hi,
I would like to display alerts using custom query and change text colour based on severity can you please advise how this can be achieved.
The custom query resource does not provide a way to control text color.
The custom query custom table (reporting) resource allows unquoted HTML. You can use this to set the text color, perhaps by using a CASE ... WHEN ... END to choose the color based on some condition.
Edit 2017-05-26: I mixed up which resource type allows HTML tags.
There are ways of incorporating color into custom queries but they are difficult. The example below is generated by the custom sql that follows afterwards
select top 25
EventTime,
NetObjectID,
Events.EventType,
'<img src=/NetPerfMon/images/Event-' + LTRIM(STR(Events.EventType,10)) + '.gif> ' + '<a href=/Orion/View.aspx?View=NodeDetails&NetObject=N:' + LTRIM(STR(NetObjectID,10)) + '><font color=' + Icon + '>' + Message + '</font></a>' as Message
from
events join EventTypes on Events.EventType=EventTypes.EventType
where
NetObjectID in (select nodeid from nodes) and
EventTypes.EventType in (1,2,5,8,9,14,40,41,100,940,941,942,3701)
order by
EventTime desc
NOTE: I removed a portion of the sql where clause to protect the guilty (me!)
Chris
You say this works in the custom query, you sure thats not just in custom table/report? When I try this code in a custom query resource I get this
I can use it successfully in a custom table by checking the allow HTML box.
Is there a bit I'm missing?
And if that is WAI, how many cases of what liquor do I have to buy your devs to get an Allow HTML check box added to the custom query resource? (i'm only slightly joking)
SolarWinds solutions are rooted in our deep connection to our user base in the THWACK® online community. More than 195,000 members are here to solve problems, share technology and best practices, and directly contribute to our product development process.