ltm rule command cpu
iRule(1) BIG-IP TMSH Manual iRule(1)
cpu
Returns the average TMM cpu load for the given interval.
SYNOPSIS
cpu usage (
'1sec' | '5secs' | '15secs' |
'1min' | '5mins' | '15mins' |
'all_seconds' | 'all_minutes'
)?
DESCRIPTION
The cpu usage command returns the average TMM cpu load for the given
interval. All averages are exponential weighted moving averages over
the interval.
Syntax
cpu usage [1sec | 5secs | 15secs | 1min | 5mins | 15mins | all_seconds
| all_minutes]
* Returns the average TMM cpu load for the given interval
RETURN VALUE
VALID DURING
ANY_EVENT, GLOBAL_GTM
EXAMPLES
when HTTP_REQUEST {
if{ [cpu usage 5sec] <= 1} {
pool1
} else {
HTTP::redirect "http://anotherpool.com"
}
}
when RULE_INIT {
foreach slice [split "1sec|5secs|15secs|1min|5mins|15mins|all_seconds|all_minutes" "|"] {
log local0. "\[cpu usage $slice\]: [cpu usage $slice]"
}
}
# Log output (from an unloaded LTM unit):
[cpu usage 1sec]: 0
[cpu usage 5secs]: 0
[cpu usage 15secs]: 0
[cpu usage 1min]: 0
[cpu usage 5mins]: 0
[cpu usage 15mins]: 0
[cpu usage all_seconds]: 0 0 0
[cpu usage all_minutes]: 0 0 0
HINTS
SEE ALSO
CHANGE LOG
@BIGIP-9.2.0 --First introduced the command.
BIG-IP 2017-01-31 iRule(1)