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:55 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2019-04-26 16:22:55 +0000
commitcaf1a5281f9e974ba73ceded3a782db3d0142c5f (patch)
treea09197b1fd2e984a0e8598e7007deb2a8e1969d7 /health/notifications/alarm-notify.sh.in
parentReleasing debian version 1.14.0~rc0-1. (diff)
downloadnetdata-caf1a5281f9e974ba73ceded3a782db3d0142c5f.tar.xz
netdata-caf1a5281f9e974ba73ceded3a782db3d0142c5f.zip
Merging upstream version 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