4 Replies Latest reply on Apr 19, 2017 2:11 PM by tdanner

    Execute external script updating ${N=Alerting;M=Notes} with results for email alerting


      HI..  I'm new to building Alerts.  I need an alert that that executes an external script when triggered and takes the output and places it in the email that gets sent.   Is that even possible?   So far I noticed running any of the canned *.exe  out of the box (ie. APM\SolarWinds.APM.RealTimeProcessPoller.exe -n=${NodeID} -alert=${N=Alerting;M=AlertDefID} -alertId=${N=Alerting;M=AlertID})    I can find the results in  ${N=Alerting;M=Notes}  for email. 


      I know of  OrionSDK and its ability to go into the scheme  but  I'm not sure however what objects match up at the time of the alert  (ie. NodeId  =  AlertActiveID?  or AlertObjectID?) and or how to update the Notes field..so I guess basically I'm asking if anyone's ever tried this and or if so what are the basic steps.. and what is the SWQL  query necessary to update the field.      here is what I found so far:


      SELECT AlertObjectID, AlertID, EntityUri, EntityType, EntityCaption, EntityDetailsUrl, EntityNetObjectId, RelatedNodeUri, RelatedNodeId, RelatedNodeDetailsUrl, RelatedNodeCaption, RealEntityUri, RealEntityType, TriggeredCount, LastTriggeredDateTime, Context, AlertNote

      FROM Orion.AlertObjects

      Where RelatedNodeId = 14



      That produced the correct host I was looking for since 'RelatedNodeId'  matches with NodeID  and I can see the 'AlertNode' field all I need to do now is place my data there..    so is it a simple query to update that field to all me to see results in ${N=Alerting;M=Notes} ?


      Thanks much!