Hi
I'm trying to create a custom table for HSRP monitoring that I'd like to look something like this
HSRP address is polled via undp as is the state. Is anyone able to assist with SWQL code for this?
Thanks.
To build a custom HSRP status matrix table in SolarWinds Orion Platform using UNDP-polled HSRP address and state, you will need a SWQL query that:
Because SWQL does not support native PIVOT, we simulate it using conditional aggregation.
Assumptions: You have two UNDP custom pollers:
HSRP_Address
HSRP_State
And they are assigned at the Node level. If they are interface-level pollers, the query will require modification.
SWQL Query - HSRP Matrix Table:
SELECT addr.CurrentValue AS [HSRP Address],
MAX(CASE WHEN n.Caption = 'router1' THEN state.CurrentValue END) AS [router1], MAX(CASE WHEN n.Caption = 'router2' THEN state.CurrentValue END) AS [router2], MAX(CASE WHEN n.Caption = 'router3' THEN state.CurrentValue END) AS [router3], MAX(CASE WHEN n.Caption = 'router4' THEN state.CurrentValue END) AS [router4], MAX(CASE WHEN n.Caption = 'router5' THEN state.CurrentValue END) AS [router5], MAX(CASE WHEN n.Caption = 'router6' THEN state.CurrentValue END) AS [router6]
FROM Orion.Nodes n
JOIN Orion.NPM.CustomPollerStatistics addr ON n.NodeID = addr.NodeID
JOIN Orion.NPM.CustomPollerStatistics state ON n.NodeID = state.NodeID
JOIN Orion.NPM.CustomPollers addrDef ON addr.CustomPollerID = addrDef.CustomPollerID
JOIN Orion.NPM.CustomPollers stateDef ON state.CustomPollerID = stateDef.CustomPollerID
WHERE addrDef.UniqueName = 'HSRP_Address' AND stateDef.UniqueName = 'HSRP_State'
GROUP BY addr.CurrentValue
ORDER BY addr.CurrentValue
What this does:
If UNDP is attached to interfaces instead of nodes, replace:
Orion.Nodes
with:
Orion.NPM.Interfaces
and join appropriately on InterfaceID.
InterfaceID
You can add HTML formatting:
CASE WHEN state.CurrentValue = 'Active Router' THEN CONCAT('<span style="color:green;font-weight:bold;">', state.CurrentValue, '</span>') ELSE state.CurrentValueEND
(Enable “Allow HTML” in table resource.)
Instead of hardcoding router1–router6, you can:
HSRPCluster = 'Core'
SWQL cannot dynamically create columns. Router columns must be explicitly defined.
If you want fully dynamic pivot behavior, that requires:
For operational clarity:
Most HSRP stuff is already polled within the tables already by Solarwinds. They don't usually do much with it, but you can find it there. Its in the Orion.NodeCdpEntry table. There is another table for LLDP also, Orion.NodeLldpEntry.
Thanks for the replies! I had already created undp's, I just needed assistance with swql code for displaying the information. I ended up creating a custom table using build in config. Then used Hubble to get the SQL code for it and then I used AI to lay it out as I needed.
Where do I find this check box?
I tried looking in the Custom Table & Custom Query widgets. Neither has this option.