summaryrefslogtreecommitdiffstats
path: root/health/notifications/alarm-notify.sh.in
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2019-11-28 04:53:29 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2019-11-28 04:53:29 +0000
commit17c93e2be4ad7b3af0cd6878bdd5d8a4a3e6da99 (patch)
tree3e0c96613972e8bb4afdeeb97a034806363ddfa9 /health/notifications/alarm-notify.sh.in
parentReleasing debian version 1.18.1-1. (diff)
downloadnetdata-17c93e2be4ad7b3af0cd6878bdd5d8a4a3e6da99.tar.xz
netdata-17c93e2be4ad7b3af0cd6878bdd5d8a4a3e6da99.zip
Merging upstream version 1.19.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.in5
1 files changed, 4 insertions, 1 deletions
diff --git a/health/notifications/alarm-notify.sh.in b/health/notifications/alarm-notify.sh.in
index b56c67e65..0f4350834 100755
--- a/health/notifications/alarm-notify.sh.in
+++ b/health/notifications/alarm-notify.sh.in
@@ -29,6 +29,7 @@
# - hipchat notifications by @ktsaou #1561
# - fleep notifications by @Ferroin
# - prowlapp.com notifications by @Ferroin
+# - irc notifications by @manosf
# - custom notifications by @ktsaou
# - syslog messages by @Ferroin
# - Microsoft Team notification by @tioumen
@@ -164,6 +165,7 @@ custom
msteam
kavenegar
prowl
+irc
awssns
rocketchat
sms
@@ -1626,9 +1628,10 @@ send_irc() {
*) color="#777777" ;;
esac
+ SNDMESSAGE="${MESSAGE//$'\n'/", "}"
for CHANNEL in ${CHANNELS}; do
error=0
- send_alarm=$(echo -e "USER ${NICKNAME} guest ${REALNAME} ${SERVERNAME}\\nNICK ${NICKNAME}\\nJOIN ${CHANNEL}\\nPRIVMSG ${CHANNEL} :${MESSAGE}\\nQUIT\\n" \ | nc "${NETWORK}" 6667)
+ send_alarm=$(echo -e "USER ${NICKNAME} guest ${REALNAME} ${SERVERNAME}\\nNICK ${NICKNAME}\\nJOIN ${CHANNEL}\\nPRIVMSG ${CHANNEL} :${SNDMESSAGE}\\nQUIT\\n" \ | nc "${NETWORK}" 6667)
reply_codes=$(echo "${send_alarm}" | cut -d ' ' -f 2 | grep -o '[0-9]*')
for code in ${reply_codes}; do
if [ "${code}" -ge 400 ] && [ "${code}" -le 599 ]; then