虽然我不熟悉node.js,但它不能检索表,而不仅仅是走树的那部分,例如
snmptable -M +. -m +ALL -v 2c -c public -Pu -Ci 127.0.0.1 IF-MIB:ifXTable
SNMP table: IF-MIB::ifXTable
index ifName ifInMulticastPkts ifInBroadcastPkts ifOutMulticastPkts ifOutBroadcastPkts ifHCInOctets ifHCInUcastPkts ifHCInMulticastPkts ifHCInBroadcastPkts ifHCOutOctets ifHCOutUcastPkts ifHCOutMulticastPkts ifHCOutBroadcastPkts ifLinkUpDownTrapEnable ifHighSpeed ifPromiscuousMode ifConnectorPresent ifAlias ifCounterDiscontinuityTime
1 lo 0 0 0 0 3675102238172 2759723359 0 0 3675102238172 2759723359 0 0 ? 10 false ? 0:0:00:00.00
2 bond0 959 0 0 0 21395174710 43909149 959 0 5835176503 49589529 0 0 ? 1000 false true 0:0:00:00.00
<not showing my other interfaces>
提取相关值....
snmptable -M +. -m +ALL -v 2c -c public -Pu -Ci 127.0.0.1 IF-MIB:ifXTable | grep bond0 | awk '{print $11}'
5835176503