Fixed bug with Alerta notification. I forgot to add /alert method to webhook url. Better explication about API URL
Fixed bug with Alerta notification. I forgot to add /alert method to webhook url. Better explication about API URL
Christian Pradelli committed
Jan 10, 2018 at 21:14 UTC
19d76c59be8a4aa407f058cf79de1af5aee1f588
2 files changed
+6
-5
conf.d/health_alarm_notify.conf
+5
-4
@@ -287,13 +287,14 @@ DEFAULT_RECIPIENT_SLACK=""
287
# enable/disable sending alerta notifications
288
SEND_ALERTA="YES"
289
290
-# set your alerta server API url
291
-# this is the API url you define when install Alerta server, it is the same for
292
-# all users.
290
+# here set your alerta server API url
291
+# this is the API url you defined when installed Alerta server,
292
+# it is the same for all users. Do not include last slash.
293
+# ALERTA_WEBHOOK_URL="https://<server>/alerta/api"
294
ALERTA_WEBHOOK_URL=""
295
296
# Login with an administrative user to you Alerta server and create an API KEY
296
-# with write permisions.
297
+# with write permissions.
298
ALERTA_API_KEY=""
299
300
# you can define environments in /etc/alertad.conf option ALLOWED_ENVIRONMENTS
plugins.d/alarm-notify.sh
+1
-1
@@ -1304,7 +1304,7 @@ send_alerta() {
1304
content="$content }"
1305
1306
1307
- httpcode=$(docurl -X POST "${webhook}" -H "Content-Type: application/json" -H "Authorization: Key $ALERTA_API_KEY" -d "$content" )
1307
+ httpcode=$(docurl -X POST "${webhook}/alert" -H "Content-Type: application/json" -H "Authorization: Key $ALERTA_API_KEY" -d "$content" )
1308
1309
if [[ "${httpcode}" = "200" || "${httpcode}" = "201" ]]
1310
then