Quantcast
Channel: THWACK: All Content - All Communities
Viewing all articles
Browse latest Browse all 19875

SWQL Syntax Rules for Alert Messages - no carriage returns?

$
0
0

Hi!  I was just wondering if someone can confirm this.  Do SWQL statements in an alert message NOT allow carriage returns?  I am writing an Advanced Alert email message using a query ${SQL:SELECT ...} which was quite long, joining 3 tables and a subquery.  However, I could never get any results nor error messages until today.  When I pasted the SQL into the database manager, it worked fine.  I removed all of the carriage return characters & extra spaces, which were there to make it readable.  It finally works!!

 

p.s.  This returns the member name (or shelf) for an EqualLogic 6510e device that triggered an alert.  This Custom Node Poller alert is based on UnDP poller for the eqlMemberReadAvgLatency or eqlMemberWriteAvgLatency > ##.  The member name is in a different UnDP table from where the UnDP latency data is stored.

${SQL:SELECT cs2.status from CustomPollerStatus cs2, CustomPollerAssignment ca2 , CustomPollers cp2 WHERE ca2.CustomPollerId=cp2.CustomPollerId and  ca2.CustomPollerAssignmentId =  cs2.CustomPollerAssignmentId and ca2.NodeId=${Node.NodeID} and cp2.UniqueName = 'eqlMemberName' and cs2.RowId = (Select top 1 cs.RowId from CustomPollers cp, CustomPollerAssignment ca, CustomPollerStatus cs where cp.uniquename ='${CustomPollerName}' and ca.NodeId=${Node.NodeID} and cp.custompollerid=ca.custompollerid and ca.custompollerassignmentid=cs.custompollerassignmentid)}

 

This version, using JOIN's also works.:

${SQL:SELECT cs2.Status FROM CustomPollerStatus cs2 JOIN CustomPollerAssignment ca2 ON ca2.CustomPollerAssignmentId =  cs2.CustomPollerAssignmentId JOIN CustomPollers cp2 ON ca2.CustomPollerId=cp2.CustomPollerId WHERE  ca2.NodeId=${Node.NodeID} and cp2.UniqueName = 'eqlMemberName' and cs2.RowId = (Select TOP 1 cs.RowId FROM CustomPollers cp JOIN CustomPollerAssignment ca ON cp.CustomPollerId=ca.CustomPollerId  JOIN CustomPollerStatus cs ON ca.CustomPollerAssignmentId=cs.CustomPollerAssignmentId WHERE cp.UniqueName ='${CustomPollerName}' and ca.NodeId=${Node.NodeID} )}


Viewing all articles
Browse latest Browse all 19875

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>