Network
banshee/network-collection/network/mikrotik/snmp/
poe
Power over Ethernet on a MikroTik RouterOS or SwitchOS device by SNMP: the state, power, voltage and current of each port.
par banshee1 installation2 versions
v2Dernière
Publiée le 28 octobre 2026. One naming convention across collections; documentation completed.
// Power over Ethernet on a MikroTik device, by SNMP (MIKROTIK-MIB, mtxrPOETable), which RouterOS and
// SwitchOS serve: on each PoE port, its state, the power it delivers, its voltage and its current, and the
// power delivered by the whole device. A port is named by its interface name ("ether2").
need('protocol:snmp');
per('port', 'Ports');
output('status', 'text', array('label' => 'PoE state', 'per' => 'port'));
output('power', 'number', array('label' => 'Power delivered', 'unit' => 'W', 'per' => 'port'));
output('voltage', 'number', array('label' => 'Voltage', 'unit' => 'V', 'per' => 'port'));
output('current', 'number', array('label' => 'Current', 'unit' => 'mA', 'per' => 'port'));
output('total-power', 'number', array('label' => 'Total power delivered', 'unit' => 'W'));
watch.state('fault', 'PoE fault', 'status', array(
'warning' => array('voltage-too-low', 'current-too-low', 'low-voltage-too-low', 'power-reset'),
'critical' => array('overload', 'short-circuit', 'voltage-too-high', 'controller-error', 'no-valid-psu'),
));
watch.state('unpowered', 'Device unpowered', 'status', array(
'help' => 'Warning when a port waits for a device to power: the camera or the access point behind it is gone. Choose the ports in the selection first.',
'warning' => array('waiting-for-load'),
'enabled' => false,
));
watch.above('budget', 'Power budget', 'total-power', array(
'help' => 'Raises beyond the power set on the probe: the budget of a device depends on its model and its power supply.',
'enabled' => false,
));
watch.missing('missing', 'PoE port missing', 'status', array('enabled' => false));
// mtxrPOETable, by mtxrPOEInterfaceIndex: mtxrPOEName, mtxrPOEStatus, mtxrPOEVoltage (in tenths of a
// volt), mtxrPOECurrent (in mA) and mtxrPOEPower (in tenths of a watt).
$ports = snmp.table(array(
'name' => '1.3.6.1.4.1.14988.1.1.15.1.1.2',
'status' => '1.3.6.1.4.1.14988.1.1.15.1.1.3',
'voltage' => '1.3.6.1.4.1.14988.1.1.15.1.1.4',
'current' => '1.3.6.1.4.1.14988.1.1.15.1.1.5',
'power' => '1.3.6.1.4.1.14988.1.1.15.1.1.6',
));
if (list.count($ports) == 0) {
fail('misconfigured', 'The device serves no PoE port (mtxrPOETable, MIKROTIK-MIB)',
'A device without PoE out, or a view that does not grant MIKROTIK-MIB to the poller.');
}
// mtxrPOEStatus in words.
$states = array(
1 => 'disabled', 2 => 'waiting-for-load', 3 => 'powered-on', 4 => 'overload', 5 => 'short-circuit',
6 => 'voltage-too-low', 7 => 'current-too-low', 8 => 'power-reset', 9 => 'voltage-too-high',
10 => 'controller-error', 11 => 'controller-upgrade', 12 => 'poe-in-detected', 13 => 'no-valid-psu',
14 => 'controller-init', 15 => 'low-voltage-too-low',
);
$total = 0;
foreach ($ports as $index => $row) {
$name = list.get($row, 'name', '');
if ($name == '') {
$name = 'port ' . $index;
}
$state = list.get($states, list.get($row, 'status', 0), 'unknown');
value('status', $state, $name);
// The measures of a port that powers nothing mean nothing.
if ($state != 'powered-on') {
continue;
}
if (list.has($row, 'power')) {
value('power', number.round($row['power'] / 10, 1), $name);
$total = $total + $row['power'] / 10;
}
if (list.has($row, 'voltage')) {
value('voltage', number.round($row['voltage'] / 10, 1), $name);
}
if (list.has($row, 'current')) {
value('current', $row['current'], $name);
}
}
value('total-power', number.round($total, 1));