Examples
banshee/examples-collection/examples/protocols/
snmp-table
Example: snmp.table, columns lined up by index; the state of each interface.
par banshee1 installation1 version
Publiée le 27 octobre 2026. First version in this collection.
Protocol: snmp.table
snmp.table reads several columns of a table and lines them up by their index: one row per index, each row an array of the columns named. Here, the name and the state of each interface.
How to read it
snmp.table(array('name' => '…', 'status' => '…')): each key names a column, each value is its OID. The answer isarray(index => array('name' => …, 'status' => …)).- A row holds the columns the agent serves for its index: a column missing for an index is absent from its row.
list.get($row, 'name', 'if' . $index)names the interface by its index when it has no name. ifOperStatusis a number: 1 up, 2 down, 7 lowerLayerDown. The watch raises critical on'2'.
To adapt it
- Add a column:
'speed' => '1.3.6.1.2.1.31.1.1.1.15'(ifHighSpeed, Mbit/s), an output and itsvalue. - To watch the traffic, read
ifHCInOctetsandifHCOutOctetswithcounter.rate(seeexamples/mechanics/counter-rate).