the aim of this project is to send alarm notification from grafana alert manager via kavenegar api.
In testing stage
For running this project you can use docker and should set ADMIN_PASS enviroment variable for sending sms.
docker image build -t notifier .
docker run -d -e ADMIN_PASS=${admin_pass} -e KAVENEGAR_API_KEY=${kavenevgar_api_key} notifier
for test the project you can use this example
curl -X GET notifier:5000/api/v1/notifier
should gave you the below response
{"status" : "ok"}
In the notification channel you should set method in POST and admin user in 'admin' and password with your pass in ADMIN_PASS set in environment.
for config alert rule in dashboard in getting sms you need config this two tags:
in receptor tags you can config the mobile number you want to receive the alert. you should seperated number with comma ','.
For using with Alertmanager you should set labels and annotations in alerts rule.
sample alert rule config:
{
"receiver": "team-sms",
"status": "firing",
"alerts": [
{
"status": "firing",
"labels": {
"alertname": "test-123",
"sms": "true",
"receptor": "09xxxxxxxxx,09xxxxxxxxx"
},
"annotation": {
"summary": "sample message"
}
}
],
"commonLabels": {
"key": "value"
}
}