diff options
author | thiagoftsm <thiagoftsm@gmail.com> | 2019-11-07 15:57:27 +0000 |
---|---|---|
committer | Chris Akritidis <43294513+cakrit@users.noreply.github.com> | 2019-11-07 07:57:27 -0800 |
commit | e3ba4c14d1f1c9ae43062a00e0157e30c15ed78f (patch) | |
tree | 0271705bb6a1f96ed8b25a7d36da257675450571 /health/notifications | |
parent | 1a1ed63fab47b7620f071f14dc29fe69f5f2603a (diff) |
fix_irc_notification: Remove line break from message (#7243)
* fix_irc_notification: Remove line break from message
The line break present on netdata alarms are creating 421 errors on the server,
this is happening because according RFC1459 this is the end of the message
* fix_irc_notification: Adjust tabulatin
the script 'alarm-notify.sh' is not following our default format,
this commit returns to old format the newest line brought
Diffstat (limited to 'health/notifications')
-rwxr-xr-x | health/notifications/alarm-notify.sh.in | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/health/notifications/alarm-notify.sh.in b/health/notifications/alarm-notify.sh.in index 757819afcc..0f43508349 100755 --- a/health/notifications/alarm-notify.sh.in +++ b/health/notifications/alarm-notify.sh.in @@ -1628,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 |