0 Replies Latest reply on Sep 21, 2016 11:49 AM by kamano

    Sending GET or POST URL as trigger action but variables are not consistently parsed

    kamano

      Hello

      I am using the alert trigger action "Send a GET or POST request to a URL" trigger action to interface with other APIs. This is on NPM 11.5 and NPM 12

       

      The request gets sent but the variables do not always get populated. Instead of the value of the variable being sent, only the variable name is sent.

      It is as if it is not being parsed by the alert engine before getting sent.

       

      For example

      One of the URLs I am posting to is "https://events.pagerduty.com/generic/2010-04-15/create_event.json"

       

      The payload is

      {

          "service_key": "~",

          "event_type": "trigger",

          "description": "An issue has been detected at ${N=Alerting;M=AlertTriggerTime;F=DateTime} on ${N=SwisEntity;M=MachineType} device named ${N=SwisEntity;M=Caption} (IP: ${N=SwisEntity;M=IP_Address}, DNS: ${N=SwisEntity;M=DNS})The Last Boot values are below: The old value is : ${SQL: SELECT PreviousValue FROM solarwinds.dbo.AlertValueChanges order by Changed desc} The new value is:  ${SQL: SELECT NewValue FROM solarwinds.dbo.AlertValueChanges order by Changed desc} The change was detected at : ${SQL: SELECT Changed FROM solarwinds.dbo.AlertValueChanges order by Changed desc}",

          "details": {},

          "client": "Solarwinds Orion",

          "client_url": "",

          "contexts": []

      }

       

      The result actually sent to the URL is below. The variables that show up are in blue, the ones that do not are in red.

       

       

      An issue has been detected at Never on symmetraUPS 16kVA device named 217-ServerRm-UPS 2 (IP: ##.###.###.###, DNS: )The Last Boot values are below: The old value is : ${SQL: SELECT PreviousValue FROM solarwinds.dbo.AlertValueChanges order by Changed desc} The new value is: ${SQL: SELECT NewValue FROM solarwinds.dbo.AlertValueChanges order by Changed desc} The change was detected at : ${SQL: SELECT Changed FROM solarwinds.dbo.AlertValueChanges order by Changed desc}

       

       

       

      When this same payload is sent via email, all variables are parsed and populated with values.

      Below is an actual email received from the email action earlier this week.

       

      An issue has been detected at Monday, September 19, 2016 1:17 PM on symmetraUPS 16kVA device named 217-ServerRm-UPS 2 (IP: ##.###.###.###, DNS: )

      This alert is triggered when the "Last Boot" value on the device changes. The implication is that the device has rebooted, but that may not be the case.
      Please investigate.

      The Last Boot values are below:
      The old value is : Sep 19 2016 1:01PM
      The new value is: Sep 19 2016 1:13PM
      The change was detected at : 9/19/2016 1:17:24 PM

      There is another API I have been testing with that puts this info in Splunk.

      In that case not even the non SQL variables are parsed and show up as just the variable names.

       

      {"solarwinds_event":{"key":"value","AlertMessage":"An issue has been detected at ${N=Alerting;M=AlertTriggerTime;F=DateTime} on ${N=SwisEntity;M=MachineType} device named ${N=SwisEntity;M=Caption} (IP: ${N=SwisEntity;M=IP_Address}, DNS: ${N=SwisEntity;M=DNS})","client":"Solarwinds NPM","client_url":""}}

       

       

       

       

      I looked in the NPM admin guide https://support.solarwinds.com/Success_Center/Network_Performance_Monitor_(NPM)/NPM_Administrator_Guide/0P0_Available_al…  

      to see if there was any info on escape chars, variable usage in the payload, or anything that might help but the information is very basic.

       

      Has anyone figured out how to get variables to consistently populate using this action?

       

      While I could use the run script or exe action and send the data that way, it would be nice if I could just use the built-in action seemingly created for this purpose.