I had this email template active and working. Now when the alert occurs it doesn't send an alert email. If I create a default template without the macro %uniquehosts% it works again. Is there a recent known issue with the macro %uniquehosts%
Working template:
<p>%alertname% returned with a <b>%state%</b> state at <b>%time%</b></p>
<p>The alert was processed with the following thresholds:<br>
<ul>
<li>Lookback period: %lookback%</li>
<li>Warning: %warning%</li>
<li>Critical: %critical%</li>
</ul>
</p>
<p>
Here is the full alert output:
<div style="padding: 10px; background-color: #F9F9F9;">%output%</div>
</p>
<p>See the last %lookback% in the <a href="%url%">Nagios Log Server dashboard</a>.</p>
<p>Nagios Log Server</p>
Template that doesn't work.
<p>%alertname% returned with a <b>%state%</b> state at <b>%time%</b></p>
<p>The following IP had a OSPF router ID change:<br>
<ul>
<li>Lookback period: %lookback%</li>
<li>Warning: %warning%</li>
<li>Critical: %critical%</li>
<li>%uniquehosts%</li>
</ul>
</p>
<p>
Here is the full alert output:
<div style="padding: 10px; background-color: #F9F9F9;">%output%</div>
</p>
<p>See the last %lookback% in the <a href="%url%">Nagios Log Server dashboard</a>.</p>
<p>Nagios Log Server</p>
Email Template - %uniquehosts%
-
gwesterman
- Posts: 269
- Joined: Wed Aug 23, 2023 11:29 am
Re: Email Template - %uniquehosts%
Hi @rhaag,
I cannot replicate your issue at the moment, so I have a few troubleshooting questions:
1. Did this start happening seemingly at random or was it after a notable change (e.g. an update).
2. Are there any errors being logged when the alert is sent (look for console errors and php errors in particular).
3. Does this happen for all types of alerts?
4. Does it still happen if you remake everything fresh (i.e. make a new alert that uses a new template with the broken macro)?
5. For completeness, what NLS version and distro are you using?
Let us know what you find,
Thank you!
I cannot replicate your issue at the moment, so I have a few troubleshooting questions:
1. Did this start happening seemingly at random or was it after a notable change (e.g. an update).
2. Are there any errors being logged when the alert is sent (look for console errors and php errors in particular).
3. Does this happen for all types of alerts?
4. Does it still happen if you remake everything fresh (i.e. make a new alert that uses a new template with the broken macro)?
5. For completeness, what NLS version and distro are you using?
Let us know what you find,
Thank you!
Re: Email Template - %uniquehosts%
@gwesterman - Thank you for the response. see my replies below.
1. Did this start happening seemingly at random or was it after a notable change (e.g. an update).
This started happening randomly.
2. Are there any errors being logged when the alert is sent (look for console errors and php errors in particular).
I am not seeing any at this time.
3. Does this happen for all types of alerts?
No - This is the only alert we have <li>%uniquehosts%</li> implemented in the email template.
4. Does it still happen if you remake everything fresh (i.e. make a new alert that uses a new template with the broken macro)?
YES - Again whenever I remove <li>%uniquehosts%</li> from the email template. The email template is sent to my email everytime the alert is generated. With <li>%uniquehosts%</li> the alert is generated but no email gets sent out. It doesnt make senes.
5. For completeness, what NLS version and distro are you using?
Version: 2024R1 - What distro are you referring to?
I think we need to upgrade to the newest version. I see in version 2024R1.0.2 - 06/05/2024 - Fixed %uniquehosts% macro for alert emails [GL:NLS#159] – JS
Let me know what you think?
Thank you.
1. Did this start happening seemingly at random or was it after a notable change (e.g. an update).
This started happening randomly.
2. Are there any errors being logged when the alert is sent (look for console errors and php errors in particular).
I am not seeing any at this time.
3. Does this happen for all types of alerts?
No - This is the only alert we have <li>%uniquehosts%</li> implemented in the email template.
4. Does it still happen if you remake everything fresh (i.e. make a new alert that uses a new template with the broken macro)?
YES - Again whenever I remove <li>%uniquehosts%</li> from the email template. The email template is sent to my email everytime the alert is generated. With <li>%uniquehosts%</li> the alert is generated but no email gets sent out. It doesnt make senes.
5. For completeness, what NLS version and distro are you using?
Version: 2024R1 - What distro are you referring to?
I think we need to upgrade to the newest version. I see in version 2024R1.0.2 - 06/05/2024 - Fixed %uniquehosts% macro for alert emails [GL:NLS#159] – JS
Let me know what you think?
Thank you.
Last edited by rhaag on Mon Nov 04, 2024 11:21 am, edited 1 time in total.
- jmichaelson
- Posts: 383
- Joined: Wed Aug 23, 2023 1:02 pm
Re: Email Template - %uniquehosts%
I agree with you. You saw the change in the change log. Do the upgrade (as always, make appropriate backups of your system in the off chance there's a problem with it) and let us know if there's still a problem then.
Please let us know if you have any other questions or concerns.
-Jason
-Jason
Re: Email Template - %uniquehosts%
I did the upgrade and that resolved the issue.
Thanks
Thanks
Re: Email Template - %uniquehosts%
Glad to hear your issue was resolved! I'm going to go ahead and lock this thread.