fmttime macro function in html email template does not expand

XMLWordPrintable

    • Type: Problem report
    • Resolution: Unsupported version
    • Priority: Trivial
    • None
    • Affects Version/s: 7.0.26
    • Component/s: Server (S)
    • None

      Using a HTML template with a macro function to format the date does not resolve the macro.

      Macro function:

      {{EVENT.TIMESTAMP}.fmttime(%d-%m-%Y %H:%M:%S)} 

      In email HTML template: 

       

      <html>
      <body style="font-family: Arial, sans-serif; font-size: 12px;">
      <h2 style="color: #d00;">⚠️ PROBLEM ALERT</h2>
      <table border="0" cellpadding="10" style="border-collapse: collapse;">
        <tr>
          <td style="background: #f5f5f5; font-weight: bold; width: 150px;">Event Name:</td>
          <td>{EVENT.NAME}</td>
        </tr>
        <tr>
          <td style="background: #f5f5f5; font-weight: bold;">Host:</td>
          <td>{HOST.NAME} ({HOST.IP})</td>
        </tr>
        <tr>
          <td style="background: #f5f5f5; font-weight: bold;">Severity:</td>
          <td style="color: #d00; font-weight: bold;">{EVENT.SEVERITY}</td>
        </tr>
        <tr>
          <td style="background: #f5f5f5; font-weight: bold;">Date/Time:</td>     <td>{{EVENT.TIMESTAMP}.fmttime(%d-%m-%Y %H:%M:%S)}</td>   </tr>
        <tr>
          <td style="background: #f5f5f5; font-weight: bold;">Trigger:</td>
          <td>{TRIGGER.NAME}</td>
        </tr>
        <tr>
          <td style="background: #f5f5f5; font-weight: bold;">Operational Data:</td>
          <td>{EVENT.OPDATA}</td>
        </tr>
        <tr>
          <td style="background: #f5f5f5; font-weight: bold;">Event ID:</td>
          <td>{EVENT.ID}</td>
        </tr>
        <tr>
          <td style="background: #f5f5f5; font-weight: bold;">Event URL:</td>
          <td><span style="font-family: Consolas, 'Courier New', monospace;">https://zabbix/tr_events.php?triggerid={TRIGGER.ID}&amp;eventid={EVENT.ID}</span></td>
        </tr>
        <tr>
          <td style="background: #f5f5f5; font-weight: bold;">Tags:</td>
          <td>{EVENT.TAGS}</td>
        </tr>
      </table>
      </body>
      </html>
       

      Renders: 

      <td>{{EVENT.RECOVERY.TIMESTAMP}.fmttime(%d-%m-%Y %H:%M:%S)}</td> 

      Full output as copied from Action:

       

       

      
      RESOLVED | High | host-01 | Alert Test: trigger file reports NOK
      
      <html>
      <body style="font-family: Arial, sans-serif; font-size: 12px;">
      <h2 style="color: #0a0;">✓ PROBLEM RESOLVED</h2>
      <table border="0" cellpadding="10" style="border-collapse: collapse;">
      <tr>
      <td style="background: #f5f5f5; font-weight: bold; width: 150px;">Event Name:</td>
      <td>Alert Test: trigger file reports NOK</td>
      </tr>
      <tr>
      <td style="background: #f5f5f5; font-weight: bold;">Host:</td>
      <td>fnnd-ems-01 (10.156.14.100)</td>
      </tr>
      <tr>
      <td style="background: #f5f5f5; font-weight: bold;">Severity:</td>
      <td>High</td>
      </tr>
      <tr>
      <td style="background: #f5f5f5; font-weight: bold;">Resolved At:</td>
      <td>{{EVENT.RECOVERY.TIMESTAMP}.fmttime(%d-%m-%Y %H:%M:%S)}</td>
      </tr>
      <tr>
      <td style="background: #f5f5f5; font-weight: bold;">Duration:</td>
      <td>9m 0s</td>
      </tr>
      <tr>
      <td>{{EVENT.UPDATE.TIMESTAMP}.fmttime(%d-%m-%Y %H:%M:%S)}</td>
      <td>Alert Test: trigger file reports NOK</td>
      </tr>
      <tr>
      <td style="background: #f5f5f5; font-weight: bold;">Original Event ID:</td>
      <td>378305</td>
      </tr>
      <tr>
      <td style="background: #f5f5f5; font-weight: bold;">Event URL:</td>
      <td><span style="font-family: Consolas, 'Courier New', monospace;">https://zabbix/tr_events.php?triggerid=69400&amp;eventid=378305</span></td>
      </tr>
      <tr>
      <td style="background: #f5f5f5; font-weight: bold;">Tags:</td>
      <td>component:alert-test, custom check: Alert Test, env:prd, network:corp12, platform:virtual, project:monitoring</td>
      </tr>
      </table>
      </body>
      </html>   

            Assignee:
            Zabbix Support Team
            Reporter:
            Lars Van Casteren
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: