Checking Bandwidth of Specific Device > Specific Port for X amount of time

As mentioned above you can run php code in the alert templates. Try using the php function number_format() - this is what I use to round disk spaces on my disk space alert template, otherwise I would get about 10 decimal places. :smiley:

@foreach ($alert->faults as $key => $value)
Download: {{ number_format((($value['ifOutOctets_rate']*8)/$value['ifSpeed'])*100*100,1) }} Mbps
Upload  : {{ number_format((($value['ifInOctets_rate']*8)/$value['ifSpeed'])*100*100,1) }} Mbps
@endforeach 

The second argument to number_format() specifies how many decimal places you want.

PS yes I know I’m replying to a 2 year old thread but someone may find this useful.

1 Like