Uploaded image for project: 'ZABBIX BUGS AND ISSUES'
  1. ZABBIX BUGS AND ISSUES
  2. ZBX-18054

Zabbix/templates/app/nginx_agent new line in Subject

XMLWordPrintable

    • Sprint 66 (Jul 2020)
    • 0.25

      Using https://git.zabbix.com/projects/ZBX/repos/zabbix/browse/templates/app/nginx_agent if nginx version changes, I get such email (headers):

      Date: Sun, 12 Jul 2020 15:16:02 +0000
      Subject: PROBLEM: Nginx: Version has changed (new version: 1.19.1)
      MIME-Version: 1.0
      

       

      As you can see, Subject line is broken, so everything after it goes as email body and it is broken as well. It is because nginx response has Windows newlines (\r\n), as you can see by curl -v http://127.0.0.1/basic_status &> file.txt

       The following patch fixes email subjects:

       

      --- template_app_nginx_agent.xml.orig 2020-07-12 15:59:28.606663182 +0300
      +++ template_app_nginx_agent.xml 2020-07-12 21:20:17.321393095 +0300
      @@ -359,7 +359,7 @@
       <preprocessing>
       <step>
       <type>REGEX</type>
      - <params>Server: nginx/(.+)
      + <params>Server: nginx/(.+(?<!\r))
       \1</params>
       </step>
       <step>
      

            mchudinov Maxim Chudinov (Inactive)
            nerijus Nerijus Baliunas
            Team INT
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: