This discussion has been locked. The information referenced herein may be inaccurate due to age, software updates, or external references.
You can no longer post new replies to this discussion. If you have a similar question you can start a new discussion in this forum.

SWQL Variable in Action Message

FormerMember
FormerMember

For a node reboot alert, I'm trying to add the field "WhyReload" from the NCM.CiscoChassis table. Below is what I've tried but unsuccessfully.

WhyReload: ${N=SWQL;M=SELECT n.NodeProperties.CiscoChassis.WhyReload FROM Orion.Nodes AS n WHERE n.Caption = '${NodeName}'}

In the message, it simply displays the SWQL command instead of the result. I can successfully query this using SWQL Studio, but not as a SWQL variable inside an action message. The following actually does display a result, but it's just the first row and doesn't align with the actual Node which is why I added the WHERE logic to match the node.

WhyReload: ${N=SWQL;M=SELECT n.NodeProperties.CiscoChassis.WhyReload FROM Orion.Nodes AS n}

Thanks... Jim

WhyReload.png

  • I will say I've had a lot more difficult getting custom SWQL variables to show compared to SQL, you might try that, just for a bit of validation.  I also avoid using the legacy variable formats like "{$nodename}" and instead always use the insert variable button to the the newer variable formats (the ones with swisentity=whaterver)because I find those are also more consistent/flexible for my purposes.

  • FormerMember
    0 FormerMember in reply to mesverrum

    Thanks for the suggestions!  You were right.  Legacy variable name was the issue.  Below worked like a charm:

    WhyReload: ${N=SWQL;M=SELECT n.NodeProperties.CiscoChassis.WhyReload FROM Orion.Nodes AS n WHERE n.Caption = '${N=SwisEntity;M=Caption}'}