Skip to content

Commit 65aeb3f

Browse files
authored
fix(alerts): show Matrix and ntfy alerts in details and stats (#5123)
Both alert types are dispatched by alert.sh but were never added to the details output or the stats report, so an enabled Matrix or ntfy alert was invisible in details and uncounted in stats.
1 parent b9bcc88 commit 65aeb3f

2 files changed

Lines changed: 20 additions & 0 deletions

File tree

‎lgsm/modules/info_messages.sh‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -557,6 +557,8 @@ fn_info_messages_script() {
557557
# Email alert: off
558558
# Gotify alert: off
559559
# IFTTT alert: off
560+
# Matrix alert: off
561+
# ntfy alert: off
560562
# Pushbullet alert: off
561563
# Pushover alert: off
562564
# Rocketchat alert: off
@@ -608,6 +610,14 @@ fn_info_messages_script() {
608610
if [ "${iftttalert}" == "on" ]; then
609611
echo -e "${lightblue}IFTTT alert:\t${default}${iftttalert}"
610612
fi
613+
# Matrix alert
614+
if [ "${matrixalert}" == "on" ]; then
615+
echo -e "${lightblue}Matrix alert:\t${default}${matrixalert}"
616+
fi
617+
# ntfy alert
618+
if [ "${ntfyalert}" == "on" ]; then
619+
echo -e "${lightblue}ntfy alert:\t${default}${ntfyalert}"
620+
fi
611621
# Pushbullet alert
612622
if [ "${pushbulletalert}" == "on" ]; then
613623
echo -e "${lightblue}Pushbullet alert:\t${default}${pushbulletalert}"

‎lgsm/modules/info_stats.sh‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,16 @@ if [ "${iftttalert}" == "on" ]; then
132132
fn_alert_payload
133133
curl -X POST "https://www.google-analytics.com/mp/collect?api_secret=${apisecret}&measurement_id=${measurementid}" -H "Content-Type: application/json" -d "${alertpayload}"
134134
fi
135+
if [ "${matrixalert}" == "on" ]; then
136+
alerttype="matrix"
137+
fn_alert_payload
138+
curl -X POST "https://www.google-analytics.com/mp/collect?api_secret=${apisecret}&measurement_id=${measurementid}" -H "Content-Type: application/json" -d "${alertpayload}"
139+
fi
140+
if [ "${ntfyalert}" == "on" ]; then
141+
alerttype="ntfy"
142+
fn_alert_payload
143+
curl -X POST "https://www.google-analytics.com/mp/collect?api_secret=${apisecret}&measurement_id=${measurementid}" -H "Content-Type: application/json" -d "${alertpayload}"
144+
fi
135145
if [ "${pushbulletalert}" == "on" ]; then
136146
alerttype="pushbullet"
137147
fn_alert_payload

0 commit comments

Comments
 (0)