|
|
@@ -294,7 +294,12 @@ func (m *InterfaceMIB) addIfEntry(iface *api.InterfaceCounters, idx int) {
|
|
|
|
// ifInUcastPkts (.11)
|
|
|
|
// ifInUcastPkts (.11)
|
|
|
|
item = m.handler.Add(fmt.Sprintf("%s.11.%d", ifEntryOID, idx))
|
|
|
|
item = m.handler.Add(fmt.Sprintf("%s.11.%d", ifEntryOID, idx))
|
|
|
|
item.Type = pdu.VariableTypeCounter32
|
|
|
|
item.Type = pdu.VariableTypeCounter32
|
|
|
|
item.Value = uint32(iface.RxUnicast.Packets)
|
|
|
|
// iface.Rx*cast.Packets is only set if "set interface feature X stats-collect-rx arc device-input" is configured
|
|
|
|
|
|
|
|
if iface.RxUnicast.Packets == 0 {
|
|
|
|
|
|
|
|
item.Value = uint32(iface.Rx.Packets)
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
item.Value = uint32(iface.RxUnicast.Packets)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// ifInNUcastPkts (.12) - multicast + broadcast
|
|
|
|
// ifInNUcastPkts (.12) - multicast + broadcast
|
|
|
|
item = m.handler.Add(fmt.Sprintf("%s.12.%d", ifEntryOID, idx))
|
|
|
|
item = m.handler.Add(fmt.Sprintf("%s.12.%d", ifEntryOID, idx))
|
|
|
@@ -324,7 +329,12 @@ func (m *InterfaceMIB) addIfEntry(iface *api.InterfaceCounters, idx int) {
|
|
|
|
// ifOutUcastPkts (.17)
|
|
|
|
// ifOutUcastPkts (.17)
|
|
|
|
item = m.handler.Add(fmt.Sprintf("%s.17.%d", ifEntryOID, idx))
|
|
|
|
item = m.handler.Add(fmt.Sprintf("%s.17.%d", ifEntryOID, idx))
|
|
|
|
item.Type = pdu.VariableTypeCounter32
|
|
|
|
item.Type = pdu.VariableTypeCounter32
|
|
|
|
item.Value = uint32(iface.TxUnicast.Packets)
|
|
|
|
// iface.Tx*cast.Packets is only set if "set interface feature X stats-collect-tx arc interface-output" is configured
|
|
|
|
|
|
|
|
if iface.TxUnicast.Packets == 0 {
|
|
|
|
|
|
|
|
item.Value = uint32(iface.Tx.Packets)
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
item.Value = uint32(iface.TxUnicast.Packets)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// ifOutNUcastPkts (.18) - multicast + broadcast
|
|
|
|
// ifOutNUcastPkts (.18) - multicast + broadcast
|
|
|
|
item = m.handler.Add(fmt.Sprintf("%s.18.%d", ifEntryOID, idx))
|
|
|
|
item = m.handler.Add(fmt.Sprintf("%s.18.%d", ifEntryOID, idx))
|
|
|
@@ -385,7 +395,11 @@ func (m *InterfaceMIB) addIfXTable(iface *api.InterfaceCounters, idx int) {
|
|
|
|
// ifHCInUcastPkts (.7)
|
|
|
|
// ifHCInUcastPkts (.7)
|
|
|
|
item = m.handler.Add(fmt.Sprintf("%s.7.%d", ifXTableOID, idx))
|
|
|
|
item = m.handler.Add(fmt.Sprintf("%s.7.%d", ifXTableOID, idx))
|
|
|
|
item.Type = pdu.VariableTypeCounter64
|
|
|
|
item.Type = pdu.VariableTypeCounter64
|
|
|
|
item.Value = iface.RxUnicast.Packets
|
|
|
|
if iface.RxUnicast.Packets == 0 {
|
|
|
|
|
|
|
|
item.Value = iface.Rx.Packets
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
item.Value = iface.RxUnicast.Packets
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// ifHCInMulticastPkts (.8)
|
|
|
|
// ifHCInMulticastPkts (.8)
|
|
|
|
item = m.handler.Add(fmt.Sprintf("%s.8.%d", ifXTableOID, idx))
|
|
|
|
item = m.handler.Add(fmt.Sprintf("%s.8.%d", ifXTableOID, idx))
|
|
|
@@ -405,7 +419,11 @@ func (m *InterfaceMIB) addIfXTable(iface *api.InterfaceCounters, idx int) {
|
|
|
|
// ifHCOutUcastPkts (.11)
|
|
|
|
// ifHCOutUcastPkts (.11)
|
|
|
|
item = m.handler.Add(fmt.Sprintf("%s.11.%d", ifXTableOID, idx))
|
|
|
|
item = m.handler.Add(fmt.Sprintf("%s.11.%d", ifXTableOID, idx))
|
|
|
|
item.Type = pdu.VariableTypeCounter64
|
|
|
|
item.Type = pdu.VariableTypeCounter64
|
|
|
|
item.Value = iface.TxUnicast.Packets
|
|
|
|
if iface.TxUnicast.Packets == 0 {
|
|
|
|
|
|
|
|
item.Value = iface.Tx.Packets
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
item.Value = iface.TxUnicast.Packets
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// ifHCOutMulticastPkts (.12)
|
|
|
|
// ifHCOutMulticastPkts (.12)
|
|
|
|
item = m.handler.Add(fmt.Sprintf("%s.12.%d", ifXTableOID, idx))
|
|
|
|
item = m.handler.Add(fmt.Sprintf("%s.12.%d", ifXTableOID, idx))
|
|
|
|