Skip to content

 Threejs and TypeScript
 SocketIO and TypeScript
 Blender Topological Earth
 Sweet Home 3D
 Design Patterns Python
 Design Patterns TypeScript
 Course Coupon Codes
Three.js and TypeScript
Kindle Edition
$6.99 $9.99 Paperback 
$22.99 $29.99

Design Patterns in TypeScript
Kindle Edition
$6.99 $9.99 Paperback
$11.99 $19.99

Design Patterns in Python
Kindle Edition
$6.99 $9.99 Paperback
$11.99 $19.99

Create SMS Alert Channel using a Custom Webhook and AWS SNS

Video Lecture

Create SMS Alert Channel using a Custom Webhook and AWS SNS Create SMS Alert Channel using a Custom Webhook and AWS SNS Create SMS Alert Channel using a Custom Webhook and AWS SNS


In this video, I show you how you can create an alert channel using a custom webhook that sends SMS. The SMS gateway I will use is AWS SNS.

You will need an AWS account. Log in and create an IAM user, and add it to a group with the AmazonSNSFullAccess policy. Take note of the Access Key and Secret given to you by AWS.

Go to the SNS Service console, select the Region you desire. I use us-east-1 in the video.

Press the link Start with an Overview and the press the link Text Messaging (SMS)

See video for more details

On your Grafana server.

Install python pip

sudo apt install python-pip

Install Flask and Boto3

pip install flask boto3

start new screen session


add a new file called

sudo nano

and add the python script below

#Copyright 2020 Sean Bradley MIT License
from flask import Flask, request
import boto3

APP = Flask(__name__)

CLIENT = boto3.client(

@APP.route('/sendsms', methods=['POST'])
def sendsms():
    number = "+" + request.args.get('number')
    message = request.json["message"]

    response = CLIENT.publish(
                'DataType': 'String',
                'StringValue': 'Grafana'
    return response

Start the python script using

You should see a response similar to
root@grafana:~# python
 * Serving Flask app "sendsms" (lazy loading)
 * Environment: production
   WARNING: This is a development server. Do not use it in a production deployment.
   Use a production WSGI server instead.
 * Debug mode: off
 * Running on (Press CTRL+C to quit)

Press CTRL A then CTRL D to exit the screen session without closing it. You can come back to a screen session at anytime by typing

screen -r

Go into the Grafana UI

Select Alerting-->Notification Channels and add a New Channel

Key Value
Name SMS
Type webhook
Url telephone number
Http Method POST


In the above table, the telephone number added to the URL should be in E.164 format but without the + symbol.

eg. Country code +44, with mobile number 07700 900123 should be written as 447700900123.

So the URL would now be

Now press the Send Test button. You should get an SMS on your mobile telephone.

AWS SNS SMS Webhook GitHub Repository


Request AWS SMS Limit Increase