summaryrefslogtreecommitdiffstats
path: root/health/notifications/alarm-notify.sh.in
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2019-04-26 16:22:17 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2019-04-26 16:22:17 +0000
commit58b482856cf37b0519e516ab8dc1105ba958f8b2 (patch)
tree0c46396e98741dfae4ce907bc8ef8c54418b3753 /health/notifications/alarm-notify.sh.in
parentAdding upstream version 1.14.0~rc0. (diff)
downloadnetdata-58b482856cf37b0519e516ab8dc1105ba958f8b2.tar.xz
netdata-58b482856cf37b0519e516ab8dc1105ba958f8b2.zip
Adding upstream version 1.14.0.upstream/1.14.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'health/notifications/alarm-notify.sh.in')
-rwxr-xr-xhealth/notifications/alarm-notify.sh.in9
1 files changed, 5 insertions, 4 deletions
diff --git a/health/notifications/alarm-notify.sh.in b/health/notifications/alarm-notify.sh.in
index 763b1d224..16e5f08ad 100755
--- a/health/notifications/alarm-notify.sh.in
+++ b/health/notifications/alarm-notify.sh.in
@@ -1740,7 +1740,7 @@ send_syslog() {
# SMS sender
send_sms() {
- local recipients="${1}" exitcode sent=0
+ local recipients="${1}" errcode errmessage sent=0
# Human readable SMS
local msg="${host} ${status_message}: ${chart} (${family}), ${alarm}"
@@ -1751,12 +1751,13 @@ send_sms() {
if [ "${SEND_SMS}" = "YES" ] && [ -n "${sendsms}" ] && [ -n "${recipients}" ] && [ -n "${msg}" ]; then
# http://api.kavenegar.com/v1/{API-KEY}/sms/send.json
for phone in ${recipients}; do
- exitcode=$($sendsms $phone "$msg")
- if [ ${exitcode} -eq 0 ]; then
+ errmessage=$($sendsms $phone "$msg" 2>&1)
+ errcode=$?
+ if [ ${errcode} -eq 0 ]; then
info "sent smstools3 SMS for: ${host} ${chart}.${name} is ${status} to '${user}'"
sent=$((sent + 1))
else
- error "failed to send smstools3 SMS for: ${host} ${chart}.${name} is ${status} to '${user}' with error code ${exitcode}."
+ error "failed to send smstools3 SMS for: ${host} ${chart}.${name} is ${status} to '${user}' with error code ${errcode}: ${errmessage}."
fi
done