Ad Widget

Collapse

New line in notification mails

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Boghdan
    Junior Member
    • Jun 2012
    • 18

    #1

    New line in notification mails

    Hi
    Just started getting around Zabbix.
    Having a simple question about formatting text in e-mail notifications.
    When configuring a new notification in Actions i write each parameter+value combination at a new line, but when i get an e-mail, is everything in one line. Though when i make an empty line in between then i get this empty line also in my e-mail notification. How do i make these parameters just to be showb at their own line (with no additional empty line in between). Is there any kind of special code (like <br> or /n) i could use to tell that at certain point new line should start?
  • Boghdan
    Junior Member
    • Jun 2012
    • 18

    #2
    Forgot to mention the the version of Zabbix i'm using is 1.8.13 (latest in debian stable repository)

    Comment

    • storm
      Member
      • Jan 2012
      • 37

      #3
      Hi,

      I have been wondering this too. Have you ever found an answer to this?

      Thanks,
      Mike

      Comment

      • Davidus
        Senior Member
        • Dec 2010
        • 281

        #4
        I`m using zabbix 1.8.4 on RHEL 5.5 with MySQL
        This is my config

        Click image for larger version

Name:	zabbix.jpg
Views:	1
Size:	108.1 KB
ID:	309918



        and this is what I got as an email

        Click image for larger version

Name:	mail.jpg
Views:	1
Size:	20.3 KB
ID:	309919

        Comment

        • Boghdan
          Junior Member
          • Jun 2012
          • 18

          #5
          Thanks, sorry, for not saying anything back for some time. Have been away a while. Pretty possible it could be kind of several version specific bug. Reinstalled zabbix to the version available from packages on Debian Tweezy (1.8.11) and still get same issue. Well, not the most horrible issue, still can live with that. Just could be nice and get well formatted and easy viewable messages.

          Comment

          • Tekkell
            Junior Member
            • Mar 2011
            • 15

            #6
            I believe I had the same problem in 1.8.11. I added a 2nd <ENTER> which resolved it for me (If my memory does not betray me :-))

            Comment

            • mike@vtg
              Junior Member
              • Jan 2011
              • 28

              #7
              Are you pasting in the notification text? I seem to recal a similar problem, and after pasting I went back and inserted [enter] after each line and deleting the blank space leading to the next. It has been a while so I'm not entirely sure on this, but I no longer have that problem.

              Comment

              • anpat89
                Junior Member
                • Jun 2012
                • 17

                #8
                It works in 1.8.13 for all I know. Otherwise try like the previous post and place an [enter] tag with specifically square brackets in.
                Kind Regards,
                Andrew.

                Comment

                • mike@vtg
                  Junior Member
                  • Jan 2011
                  • 28

                  #9
                  Without brackets - I just used for emphasis

                  Comment

                  • dogbert831
                    Junior Member
                    • Mar 2014
                    • 13

                    #10
                    I know this is an old thread but I can't control new lines in notifications emails either. It all ends up on the same line regardless of how many blank lines I leave. I'm using Zabbix 2.0.11. There should be some way to put a new line in there.

                    Comment

                    • dogbert831
                      Junior Member
                      • Mar 2014
                      • 13

                      #11
                      So I just solved my own problem. I'm using an alert script to call sendEmail. It turns out that sendEmail requires \n for a new line like this:
                      Trigger: {TRIGGER.NAME}
                      \nTrigger status: {TRIGGER.STATUS}
                      \nTrigger severity: {TRIGGER.SEVERITY}
                      \nTrigger URL: {TRIGGER.URL}
                      \nItem values:
                      \n1. {ITEM.NAME1} ({HOST.NAME1}:{ITEM.KEY1}): {ITEM.VALUE1}

                      Also the script that calls sendEmail needs quotes around the message body like so:
                      sendEmail -m "message body"

                      Hopefully this helps someone else as I spent quite a bit of time figuring this out.

                      Comment

                      • zabbix_boy
                        Junior Member
                        • Jun 2014
                        • 4

                        #12
                        My existing actions are fine, but a new action doesn't have the line break in the email -- but it does have line breaks in the jabber alerts.

                        I don't think I have experienced in the past since I have been just cloning the existing Actions.

                        Even now, though if I clone the action, I still have no line breaks in the body.

                        If I paste the content into a notepad, I do see the line breaks.

                        zabbix 1.8.3
                        Last edited by zabbix_boy; 27-06-2014, 01:10.

                        Comment

                        • RPW
                          Junior Member
                          • Oct 2008
                          • 11

                          #13
                          Extra line breaks in EMAIL message were removed

                          Cause can be the default setting in Outlook:
                          Options - Message Format - Deselect "Removeextra line breaks in plain text Messages".

                          WORKAROUND
                          Indent each line three or more spaces.
                          That will tell a receiving copy of Outlook not to mess with the line breaks.

                          Comment

                          • Kpax
                            Member
                            • Dec 2013
                            • 52

                            #14
                            Works on 2.4.x as well

                            Originally posted by Tekkell
                            I believe I had the same problem in 1.8.11. I added a 2nd <ENTER> which resolved it for me (If my memory does not betray me :-))

                            This 'trick' works for 2.4.x as well, I been try various of syntax, none of them work for me except, 2nd <ENTER>

                            thanks for sharing.

                            Comment

                            • jluvs2ride
                              Member
                              • Jul 2015
                              • 85

                              #15
                              Originally posted by RPW
                              Cause can be the default setting in Outlook:
                              Options - Message Format - Deselect "Removeextra line breaks in plain text Messages".

                              WORKAROUND
                              Indent each line three or more spaces.
                              That will tell a receiving copy of Outlook not to mess with the line breaks.
                              This was the answer for me.

                              Comment

                              Working...