Ad Widget

Collapse

Coloured HTML Email Notification Templates

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • maand
    Junior Member
    • Mar 2019
    • 15

    #1

    Coloured HTML Email Notification Templates

    Hi,
    I just did some quick replacements for the HTML Email Problem/Recovery for better visibility and also added shortcuts to the triggered event and host dashboard

    https://share.zabbix.com/zabbix-tool...lmailtemplates

    Please feel free to use and please share if you use and improve the not so great design

    Happy monitoring
    //Mathias
    Last edited by maand; 21-11-2020, 17:08.
  • marmax
    Junior Member
    • Nov 2020
    • 2

    #2
    Yeah, it might come in handy Thank you!

    Comment

    • csmall
      Member
      • Jun 2020
      • 70

      #3
      I'd rather see it add instead of replace the existing ones.

      Comment


      • maand
        maand commented
        Editing a comment
        Just add them instead of replacing then
    • csmall
      Member
      • Jun 2020
      • 70

      #4
      Originally posted by csmall
      I'd rather see it add instead of replace the existing ones.
      My apologies, I just saw you word as a replacement and went off that. Thanks for contributing!

      Comment

      • sancho
        Senior Member
        Zabbix Certified SpecialistZabbix Certified Professional
        • Mar 2015
        • 295

        #5
        Hi maand

        First of all, thank you very much for your contribution and work.

        In the last values of Host information I had to change the following:

        HTML Code:
        <p><b>CPU usage:</b><br>
        Latest value: <i>{{HOST.HOST}:system.cpu.util.last()}</i><br>
        MAX for 15 minutes: <i>{{HOST.HOST}:system.cpu.util.max(900)}</i><br>
        MIN for 15 minutes: <i>{{HOST.HOST}:system.cpu.util.min(900)}</i></p>
        by
        HTML Code:
        <p><b>Uso CPU:</b><br>
        Latest value: <i>{{HOST.HOST}:system.cpu.util[,,avg1].last()}</i><br>
        MAX for 15 minutes: <i>{{HOST.HOST}:system.cpu.util[,,avg1].max(900)}</i><br>
        MIN for 15 minutes: <i>{{HOST.HOST}:system.cpu.util[,,avg1].min(900)}</i></p>
        If I didn't do that, I didn't recognize myself and gave me value: *UNKNOWN*

        I also added a line after line 49 to embed my company logo.

        Click image for larger version

Name:	logoemail.jpg
Views:	9987
Size:	31.4 KB
ID:	414050

        Greetings and congratulations on your contribution.

        Comment


        • maand
          maand commented
          Editing a comment
          Which version of zabbix are you using, its maybe some version differences on the cpu since it works for me? [,,avg1] is the default so it should be the same as not using it.

        • sancho
          sancho commented
          Editing a comment
          Hi, 5.0.5 version
      • DYProX
        Junior Member
        • Jun 2022
        • 1

        #6
        Anyone please still have this ??

        Comment

      • Jarbelix
        Junior Member
        • May 2021
        • 8

        #7
        Originally posted by maand
        Hi,
        I just did some quick replacements for the HTML Email Problem/Recovery for better visibility and also added shortcuts to the triggered event and host dashboard

        https://share.zabbix.com/zabbix-tool...lmailtemplates

        Please feel free to use and please share if you use and improve the not so great design

        Happy monitoring
        //Mathias
        Click image for larger version

Name:	Zabbix-Enviando-Emails-Profissionais-Atraentes.png
Views:	4542
Size:	126.6 KB
ID:	476428
        Here is a more detailed and updated model: https://wiki.tiozaodolinux.com/Guide...ssional-Emails
        Last edited by Jarbelix; 29-12-2023, 19:42. Reason: Put one screen shot

        Comment

        • markfree
          Senior Member
          • Apr 2019
          • 868

          #8
          Hey Jarbelix, your HTML model is really good. It has a wise use of Zabbix macros and smart HTML formatting.
          I really liked it.

          With minor changes, I tried to set up the e-mail message using the model you suggested, but Zabbix failed to update the DB.
          I tried using generic E-mail and Gmail media types and it failed to update the message.
          Click image for larger version

Name:	image.png
Views:	4487
Size:	84.3 KB
ID:	476687

          There seems to be a broken string somewhere in the HTML code, but I couldn't identify it.​
          Code:
          Error in query [UPDATE opmessage SET message='' WHERE operationid='56'] [Incorrect string value: '\xF0\x9F\xA4\x95 Z...' for column `zabbix`.`opmessage`.`message` at row 1]
          Did you get the same error?
          Attached Files
          Last edited by markfree; 08-01-2024, 03:16.

          Comment


          • Jarbelix
            Jarbelix commented
            Editing a comment
            In my version of Zabbix (6.4) this problem did not occur. In another Zabbix (6.0 LTS) this behavior occurs.
        • markfree
          Senior Member
          • Apr 2019
          • 868

          #9
          It seems that Zabbix DB does not handle emojis very well when converting them.

          By changing the emoji to HTML entity code, I was able to save the new message templates in Zabbix.

          Problem message:
          Click image for larger version

Name:	image.png
Views:	4578
Size:	28.2 KB
ID:	476692

          Resolved message:
          ​​
          Click image for larger version

Name:	image.png
Views:	4515
Size:	37.0 KB
ID:	476693

          A way to test out the messages and see how they are processed, is to save the code in an HTML file. Then, open it a browser.

          Thanks a lot​
          Last edited by markfree; 08-01-2024, 04:47.

          Comment

        • markfree
          Senior Member
          • Apr 2019
          • 868

          #10
          Forked from Julio Zanette,

          I've added a public GitHub repository for these HTML message templates.

          Comment

          Working...