I’m trying to get the percentage values for CPU and Memory usage to show up in my alert templates but all I am able to get is a blank space in place of the values. For the memory one I copied the template and used:
%value.mempool_perc
I also tried what I’m actually checking:
%mempools.mempool_perc
And both of them show up blank. For CPU I’m trying:
%value.processor_usage
Am I missing something?
You need to use this in the faults foreach loop as per the examples.
I knew that just putting the little snippet in would be a problem
{if %transport == mail}<b>%title</b><br>
<b>Severity:</b> %severity<br>
{if %state == 0}<b>Time elapsed:</b> %elapsed<br>{/if}
<b>Timestamp:</b> %timestamp<br>
<b>Rule:</b> {if %name}%name{else}%rule{/if}<br>
{if %faults}<b>Faults:</b>
%hostname is at %value.processor_usage percent processor<br>{/if}
{/if}
{if %transport == mail}<b>%title</b><br>
<b>Severity:</b> %severity<br>
{if %state == 0}<b>Time elapsed:</b> %elapsed<br>{/if}
<b>Timestamp:</b> %timestamp<br>
<b>Rule:</b> {if %name}%name{else}%rule{/if}<br>
{if %faults}<b>Faults:</b>
%hostname is at %value.mempool_perc percent memory<br>{/if}
{/if}
There are at least the full mail transport versions. It fails in the same way with Slack and MS Teams transports as well.
You haven’t put it in a foreach still, the examples in our docs have that to show you.
1 Like