Windows
banshee/windows-collection/windows/snmp/
cpu
The load of each processor of a Windows and their average, by SNMP
by banshee1 installation2 versions
v2Latest
Published on October 28, 2026. One naming convention across collections; documentation completed.
// The processor load of a Windows, by SNMP: each logical processor and their average, from
// hrProcessorLoad (HOST-RESOURCES-MIB), which the agent itself averages over the last minute.
need('protocol:snmp');
per('core', 'Processors');
output('cpu-busy', 'number', array('label' => 'Overall processor usage', 'unit' => '%'));
output('core-busy', 'number', array('label' => 'Processor usage', 'unit' => '%', 'per' => 'core'));
output('cores', 'number', array('label' => 'Number of processors'));
watch.above('cpu-high', 'Processor saturated', 'cpu-busy', array('warning' => 85, 'critical' => 95, 'for' => '3 runs'));
watch.above('core-hot', 'A processor saturated', 'core-busy', array('warning' => 95, 'for' => '3 runs', 'enabled' => false));
watch.deviate('core-neglected', 'A processor left idle', 'core-busy', array('side' => 'below', 'warning' => 30, 'enabled' => false));
watch.expect('core-count', 'Unexpected number of processors', 'cores');
// hrProcessorLoad, one row per logical processor, indexed by hrDeviceIndex: the load in percent.
// The index means nothing to a reader; the processors are named cpu0, cpu1... in the agent's order.
$loads = snmp.walk('1.3.6.1.2.1.25.3.3.1.2');
$cores = 0;
$total = 0;
foreach ($loads as $load) {
value('core-busy', $load, 'cpu' . $cores);
$total = $total + $load;
$cores = $cores + 1;
}
if ($cores == 0) {
fail('misconfigured', 'The agent does not serve the processor table (hrProcessorTable)');
}
value('cpu-busy', number.round($total / $cores, 1));
value('cores', $cores);