Alert Template Adding Additional Fields to Alert Email

I think Im just having a senior moment but I have a UPS Alert for when power is lost and the UPS switches to battery.

Alert Rule:

What I want to do is have the alert template include the battery run time in the alert email. Which is recorded in the sensors.sensor_current field for sensors.sensor_descr “Runtime”. Below is the template I have so far I’m just not sure how to get it to read the “Runtime” instead of the “upsBasicOutputStatus” which is used in the rule.

Alert Template Fault:

<table border="1" width="50%">
	<col style="width:20%">
	<col style="width:20%">
        <col style="width:10%">
	<thead>
	<tr>
		<th>Host Name</th>
		<th><font color=red>Alert Name</th>
		<th><font color=orange>Run Time</th>
	</tr>
	</thead>
	<tbody>
        {foreach %faults} 
	<tr>
		<td align="center">%hostname </td>
		<td align="center"><font color=red>{if %name}%name{else}%rule{/if}</td>
		<td align="center">"I would imagine Im missing somthing here just not sure what" %value.sensor_descr</td>
	</tr>
        {/foreach}{/if}
	</tbody>
</table>

This is what the alert looks like without the Runtime
image

Thanks for reading and advice.

You can’t do that, if the rule doesn’t actually touch the sensor you need data from then it’s not available.

Will the rule work if its structured like

%sensors.sensor_type = “upsBasicOutputStatus” &&
%sensors.sensor_current = 3 &&
%sensors.sensor_descr = “Runtime” &&
%sensors.sensor_current ~ “*” &&

Can it associate each sensor_current with the type and desc?
Would there be a way to do it with a macro? Have the alert just query the Runtime sensor_current value?

You can’t match against two entries within the same table at the same time and no, a macro won’t help you here.

That’s what I figured, thanks for the clarification.