Ad Widget

Collapse

CRLF in zabbix notifications

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • amish1975
    Junior Member
    • Jul 2013
    • 14

    #1

    CRLF in zabbix notifications

    Could somebody help me with this small issue?

    Zabbix 2.0.8, RHEL.
    Notification is set according to:
    https://www.zabbix.com/forum/showthread.php?t=1323, Post#1
    Reason - smtp server policies request to authenticate in order to send messages. As I could understand, standard Zabbix "EMail notifications" does not support this (what is highly surprising.... O_o)

    Typical zabbix notification.
    *************
    This is an automated alert from Zabbix Network Monitoring. The message is:
    Trigger: Audit on mydbserver\r\nTrigger status: OK\r\nTrigger severity: High\r\nTrigger URL: \r\n\r\nItem values:\r\n\r\n1. Audit (mydbserver:audit): none\r\n2. *UNKNOWN* (*UNKNOWN*:*UNKNOWN*): *UNKNOWN*\r\n3. *UNKNOWN* (*UNKNOWN*:*UNKNOWN*): *UNKNOWN*
    *************

    How to make zabbix correctly convert these "\r\n" to normal Windows-like CRLFs in notifications so that the messages would be nice-looking?

    Any clues?
    Thanks in advance...
    Last edited by amish1975; 25-11-2013, 07:58.
  • amish1975
    Junior Member
    • Jul 2013
    • 14

    #2
    For anyone who hit the same: the resolution is quite simple:
    https://www.zabbix.com/forum/showthread.php?t=1323, Post#1:
    smtp-auth.sh
    ...
    echo "This is an automated alert from Zabbix Network Monitoring. The mess
    age is $zabbixbody" >> /tmp/mymailinput
    ...
    should be replaced with:
    ...
    echo -e "This is an automated alert from Zabbix Network Monitoring. The mess
    age is $zabbixbody" >> /tmp/mymailinput
    ...

    -e = enable interpretation of backslash escapes

    Comment

    Working...