My requirement is to trigger an event when the interface Rx utilization shoots over 50 % averaged over 30 secs. I can think of two possible ways of doing this with EEM applet:
1. event interface name GigabitEthernet0/0 parameter rxload entry-op ge entry-val 128 entry-type value poll-interval 1 average-factor 30
2. event interface name GigabitEthernet0/0 parameter receive_rate_bps entry-op ge entry-val 500000000 entry-type rate average-factor 30 poll-interval 1
The first one doesn't seem to work because EEM requires entry-type be 'rate' when average-factor is specified.
I would also like to know how rxload and txload parameters are calculated. How often the byte counters are sampled to calculate rxload/txload values ?
The txload and rxload are calculated based on the per-interface load-interval. You can configured this down to 30 seconds:
Then just use:
event interface name name gi0/0 parameter rxload entry-op ge entry-val 128 entry-type value poll-interval 30
Considering load-interval to be 30.
How is the calculation done ?
[ifInOctets(t+30) ~ ifInOctects(t)]*8 / [30*ifSpeed] quantized to 8 bit value
Moving average of latest 30 samples - sampled every second ?
I see almost immediate change in txload and rxload values as soon as I change the interface bandwidth using the bandwidth command under the interface. So, I am wondering how the exact calculation is done ?
If the requirement is to take action based on the average of say 5 recent values that exceed 128, How can we do this with EEM applet ?
I haven't looked at this in a long time, but as I recall, this is a decaying exponential average calculated over the load-interval.