Advanced Alert Custom SQL Variable For Alerted On Object

In my advanced alert, I am trying to build a custom SQL variable that returns data for the specific object I'm alerting on but every time I get the alert, it returns the first value that would show if I ran the Select statement against the database.  It is not refining it to the alerted on object.  Can I use variables in the Select statement or how do I refine the results of the Advanced Alert Custom SQL variable to only the object that is being alerted on and not just execute the Select statement?

 

Thanks,
Jason Henson
Loop1 Systems
www.Loop1Systems.com

  • To be clear, are you trying to create a Custom SQL Alert for the trigger condition or one to be included in an e-mail alert?

  • I love digging up old threads. Anyway, I am replying here because I had the same question as the OP. I found what I needed by combining what I learned from several other threads that are similar.

    This was my original query that was based on the example in the Solarwinds online help.

    ${SQL:Select MachineType From Nodes}

    You can see why it didn't pull the right info...because there is no filtering (WHERE x=x statement).

    This is the format that works:

    ${SQL:Select MachineType From Nodes WHERE Caption='${NodeName}'}

    The tricky part here really was just knowing to put quotes around the inner variable ${NodeName}.