I’ve been trying to get graphs to show up in selected email alerts (network threshold and port error) and I think I’ve got everything right for creating the graphs other than what variable to use for the time frame. Here’s the alert template that I’m using:
<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><br>
{foreach %faults}<a href="http://MYSERVER/device/device=%hostname/">%hostname</a>: %value.ifName (%value.ifAlias) is running errors<br><img src="http://MYSERVER/graph.php?to=%value.poll_time&id=%value.port_id&type=port_errors&from={calc(%value.poll_time-(6*3600))}&legend=no&height=150&width=500"/><br>{/foreach}{/if}
The result that I get is a blank graph and when I look at the URL for the graph and compare it to what should be the same time frame in the web interface the time is WAY off. In fact if I compare the graph URL from several different alerts they all have the same timestamp like this:
http://MYSERVER/graph.php?to=1482505266&id=6329&type=port_errors&from=1482483666&legend=no&height=150&width=500
So is %value.poll_time
not the correct variable that I want to use? Or is it just giving me bad times?