AppDynamics Knowledge Base

How do I receive SMS alerts using HTTP request template?

How do I receive SMS alerts using HTTP request template?

SMS alerts rely by default on gateways with an email to SMS support. This means that the gateway should be able to send an SMS when an email is sent to <phone-number>@smsgatewayprovider.com.

In case there isn't a supported carrier in your country, you can instead use the HTTP Request templates with the gateways that support API calls. Here is a small example using the Nexmo SMS gateway.

  1. Go to nexmo.com and sign up for a new account.

  2. Go to the AppDynamics Controller and navigate to Alert & Respond.

  3.  Choose HTTP Request Templates in the left menu.

  4. Click New to add new template.

  5. Add a custom variable for the recipient number. You can choose a default value.

    image.png

  6. Configure request URL to use POST and the endpoint https://rest.nexmo.com/sms/json

    image.png

  7. Set payload MIME type to application/json and the payload to

    {
    "api_key":"<INSERT_NEXMO_API_KEY>",
    "api_secret":"<INSERT_NEXMO_API_SECRET>",
    "to":"${mobile}",
    "from":"AppDynamics",
    "text":"${latestEvent.displayName}: ${latestEvent.eventMessage}"
    }


    image.png

  8. Click Save.

  9. You can then click Test and Add event type to send a test SMS and see that Nexmo is not reporting any errors.
  10. Create new action by navigating to Alerts & Respond > Actions > New and choose Make an HTTP request.

    image.png

  11. Create new policy by navigating to Alerts & Respond > Policy > Create Policy and choose the events that you like to trigger an action on.

  12. Click Actions and choose the newly created request Action.
Tags (3)
Comments

We've done the same thing with the STIX service here in Norway. See example:

image.png

image.png

You can have more recipients, just add numers like this: ["number1","number2","number3"]

Hi,

I have tried the same steps as mentioned above, however not receiving any sms alerts. 

As suggested i have signed up on  nexmo.com also used the key and secret on the payload like this: {"api_key":"40b3a6e1","api_secret":"yQZJqPKU9IuecaFJ","to":"${mobile}","from":"AppDynamics","text":"${latestEvent.displayName}: ${latestEvent.eventMessage}"}

Also tried with :

{"api_key":"40b3a6e1","api_secret":"yQZJqPKU9IuecaFJ","message":"check your mail","recipients":["9916204132"]}

Post creating the http template i have received no errors., it shows success post running the test.

Can anyone please let me know if any additional settings to be done.

Regards,

Rahul

AppDynamics has introduced a bug that stops this from working... ETA on bugfix is version 4.5 according to support.

Hi,



Does this bug also causes issues with custom carrier options under email/sms configuration, because I am not able to send sms using that as well. Can you please help with some options that I can use?



Regards,

Rahul

Hi,

Can  you please let me know if this issue is resolved? I am looking for options to trigger SMS alerts for UK and India based users. Please share your inputs.

Thanks,

Vithal

We have already integrated with SMTP for email notification, So please let me know it will work for SMS ?

Hi @Dinesh.Choudhary,

I did a search for "SMS" in our Docs area. Please take a look at the results: https://docs.appdynamics.com/22.6/search?q=SMS+alerts&max=10

Version history
Last update:
‎02-15-2017 12:36 PM
Updated by: