SNMP not working (version: 201908050337)

Hello there,

I try to monitor my VyOS with Zabbix, but not get any data.

If i run:

show snmp mib ifmib

I get this:

lo:     ifIndex = 1
        ifAlias = lo
        ifDescr = lo
eth0:   ifIndex = 2
        ifAlias = OUTSIDE
Traceback (most recent call last):
  File "/usr/libexec/vyos/op_mode/snmp_ifmib.py", line 126, in <module>
    print('\t{0}'.format(show_ifdescr(i)))
  File "/usr/libexec/vyos/op_mode/snmp_ifmib.py", line 82, in show_ifdescr
    vendor = string[3]
IndexError: list index out of range

Here my SNMP settings:

set service snmp community public
set service snmp community routers authorization 'ro'
set service snmp community routers client '192.168.31.105'
set service snmp contact 'xy@gmail.com'
set service snmp location 'city'
set service snmp trap-target 192.168.31.105

Do you query it directly on the vyos host or from 192.168.31.105?

i try it on the vyos.

What if you’ll do snmpwalk from your zabbix server to that VyOS?

@Vamp can you provide full interfaces configuration? I think problem may be with interface descriptions.
show configuration commands | strip-private | match inter
And also provide please output of commands

sudo cat /sys/class/net/eth0/device/vendor
sudo cat /sys/class/net/eth0/device/device

/usr/bin/lspci -mm -d RETURNED_VALUE_VENDOR:RETURNED_VALUE_DEVICE
as example
/usr/bin/lspci -mm -d 0x8086:0x100f

set interfaces ethernet eth0 description 'OUTSIDE'
set interfaces ethernet eth0 duplex 'auto'
set interfaces ethernet eth0 firewall in name 'OUTSIDE-IN'
set interfaces ethernet eth0 firewall local name 'OUTSIDE-LOCAL'
set interfaces ethernet eth0 pppoe 1 default-route 'auto'
set interfaces ethernet eth0 pppoe 1 mtu '1492'
set interfaces ethernet eth0 pppoe 1 name-server 'auto'
set interfaces ethernet eth0 pppoe 1 password xxxxxx
set interfaces ethernet eth0 pppoe 1 policy
set interfaces ethernet eth0 pppoe 1 user-id xxxxxx
set interfaces ethernet eth0 smp-affinity 'auto'
set interfaces ethernet eth0 speed 'auto'
set interfaces ethernet eth1 address 'xxx.xxx.31.1/24'
set interfaces ethernet eth1 description 'INSIDE'
set interfaces ethernet eth1 duplex 'auto'
set interfaces ethernet eth1 policy route 'pppoe-out'
set interfaces ethernet eth1 smp-affinity 'auto'
set interfaces ethernet eth1 speed 'auto'
set interfaces loopback lo
set interfaces wireguard wg0 address 'xxx.xxx.32.1/16'
set interfaces wireguard wg0 description 'VPN'
set interfaces wireguard wg0 peer notebook allowed-ips 'xxx.xxx.32.2/32'
set interfaces wireguard wg0 peer notebook pubkey ''
set interfaces wireguard wg0 peer notebook-new allowed-ips 'xxx.xxx.32.5/32'
set interfaces wireguard wg0 peer notebook-new pubkey ''
set interfaces wireguard wg0 peer phone allowed-ips 'xxx.xxx.32.3/32'
set interfaces wireguard wg0 peer phone pubkey ''
set interfaces wireguard wg0 peer tablet allowed-ips 'xxx.xxx.32.4/32'
set interfaces wireguard wg0 peer tablet pubkey ''
set interfaces wireguard wg0 port '12345'
set nat destination rule 10 inbound-interface 'pppoe1'
set nat destination rule 11 inbound-interface 'pppoe1'
set nat destination rule 12 inbound-interface 'pppoe1'
set nat destination rule 13 inbound-interface 'pppoe1'
set nat destination rule 14 inbound-interface 'pppoe1'
set nat destination rule 15 inbound-interface 'pppoe1'
set nat source rule 100 outbound-interface 'pppoe1'
set protocols static interface-route xxx.xxx.31.0/24 next-hop-interface wg0
set service dns dynamic interface pppoe1 service afraid host-name xxxxxx
set service dns dynamic interface pppoe1 service afraid login ''
set service dns dynamic interface pppoe1 service afraid password xxxxxx

/usr/bin/lspci -mm -d 0x1af4:0x0001

Can you show output this command?
/usr/bin/lspci -mm -d 0x1af4:0x0001

It not show anything.

What HW you have got? Is it VM?
Show please command output sudo lspci -v
I created task in phabricator ⚓ T1575 `show snmp mib ifmib` crashes with IndexError.

Yes, it is a VM.

00:00.0 Host bridge: Intel Corporation 440FX - 82441FX PMC [Natoma] (rev 02)
        Subsystem: Red Hat, Inc Qemu virtual machine
        Flags: fast devsel

00:01.0 ISA bridge: Intel Corporation 82371SB PIIX3 ISA [Natoma/Triton II]
        Subsystem: Red Hat, Inc Qemu virtual machine
        Flags: medium devsel

00:01.1 IDE interface: Intel Corporation 82371SB PIIX3 IDE [Natoma/Triton II] (prog-if 80 [Master])
        Subsystem: Red Hat, Inc Qemu virtual machine
        Flags: bus master, medium devsel, latency 0
        [virtual] Memory at 000001f0 (32-bit, non-prefetchable) [size=8]
        [virtual] Memory at 000003f0 (type 3, non-prefetchable)
        [virtual] Memory at 00000170 (32-bit, non-prefetchable) [size=8]
        [virtual] Memory at 00000370 (type 3, non-prefetchable)
        I/O ports at e100 [size=16]
        Kernel driver in use: ata_piix

00:01.2 USB controller: Intel Corporation 82371SB PIIX3 USB [Natoma/Triton II] (rev 01) (prog-if 00 [UHCI])
        Subsystem: Red Hat, Inc QEMU Virtual Machine
        Flags: bus master, fast devsel, latency 0, IRQ 11
        I/O ports at e080 [size=32]
        Kernel driver in use: uhci_hcd

00:01.3 Bridge: Intel Corporation 82371AB/EB/MB PIIX4 ACPI (rev 03)
        Subsystem: Red Hat, Inc Qemu virtual machine
        Flags: medium devsel, IRQ 9
        Kernel driver in use: piix4_smbus

00:02.0 VGA compatible controller: Device 1234:1111 (rev 02) (prog-if 00 [VGA controller])
        Subsystem: Red Hat, Inc Device 1100
        Flags: fast devsel
        Memory at fd000000 (32-bit, prefetchable) [size=16M]
        Memory at fea90000 (32-bit, non-prefetchable) [size=4K]
        Expansion ROM at 000c0000 [disabled] [size=128K]

00:03.0 Unclassified device [00ff]: Red Hat, Inc Virtio memory balloon
        Subsystem: Red Hat, Inc Device 0005
        Physical Slot: 3
        Flags: bus master, fast devsel, latency 0, IRQ 10
        I/O ports at e0a0 [size=32]
        Memory at fe400000 (64-bit, prefetchable) [size=16K]
        Capabilities: [84] Vendor Specific Information: Len=14 <?>
        Capabilities: [70] Vendor Specific Information: Len=14 <?>
        Capabilities: [60] Vendor Specific Information: Len=10 <?>
        Capabilities: [50] Vendor Specific Information: Len=10 <?>
        Capabilities: [40] Vendor Specific Information: Len=10 <?>
        Kernel driver in use: virtio-pci

00:05.0 SCSI storage controller: Red Hat, Inc Virtio SCSI
        Subsystem: Red Hat, Inc Device 0008
        Physical Slot: 5
        Flags: bus master, fast devsel, latency 0, IRQ 10
        I/O ports at e000 [size=64]
        Memory at fea91000 (32-bit, non-prefetchable) [size=4K]
        Memory at fe404000 (64-bit, prefetchable) [size=16K]
        Capabilities: [98] MSI-X: Enable+ Count=4 Masked-
        Capabilities: [84] Vendor Specific Information: Len=14 <?>
        Capabilities: [70] Vendor Specific Information: Len=14 <?>
        Capabilities: [60] Vendor Specific Information: Len=10 <?>
        Capabilities: [50] Vendor Specific Information: Len=10 <?>
        Capabilities: [40] Vendor Specific Information: Len=10 <?>
        Kernel driver in use: virtio-pci

00:08.0 Communication controller: Red Hat, Inc Virtio console
        Subsystem: Red Hat, Inc Device 0003
        Physical Slot: 8
        Flags: bus master, fast devsel, latency 0, IRQ 11
        I/O ports at e040 [size=64]
        Memory at fea92000 (32-bit, non-prefetchable) [size=4K]
        Memory at fe408000 (64-bit, prefetchable) [size=16K]
        Capabilities: [98] MSI-X: Enable+ Count=2 Masked-
        Capabilities: [84] Vendor Specific Information: Len=14 <?>
        Capabilities: [70] Vendor Specific Information: Len=14 <?>
        Capabilities: [60] Vendor Specific Information: Len=10 <?>
        Capabilities: [50] Vendor Specific Information: Len=10 <?>
        Capabilities: [40] Vendor Specific Information: Len=10 <?>
        Kernel driver in use: virtio-pci

00:12.0 Ethernet controller: Red Hat, Inc Virtio network device
        Subsystem: Red Hat, Inc Device 0001
        Physical Slot: 18
        Flags: bus master, fast devsel, latency 0, IRQ 11
        I/O ports at e0c0 [size=32]
        Memory at fea93000 (32-bit, non-prefetchable) [size=4K]
        Memory at fe40c000 (64-bit, prefetchable) [size=16K]
        Expansion ROM at fea00000 [disabled] [size=256K]
        Capabilities: [98] MSI-X: Enable+ Count=3 Masked-
        Capabilities: [84] Vendor Specific Information: Len=14 <?>
        Capabilities: [70] Vendor Specific Information: Len=14 <?>
        Capabilities: [60] Vendor Specific Information: Len=10 <?>
        Capabilities: [50] Vendor Specific Information: Len=10 <?>
        Capabilities: [40] Vendor Specific Information: Len=10 <?>
        Kernel driver in use: virtio-pci

00:13.0 Ethernet controller: Red Hat, Inc Virtio network device
        Subsystem: Red Hat, Inc Device 0001
        Physical Slot: 19
        Flags: bus master, fast devsel, latency 0, IRQ 10
        I/O ports at e0e0 [size=32]
        Memory at fea94000 (32-bit, non-prefetchable) [size=4K]
        Memory at fe410000 (64-bit, prefetchable) [size=16K]
        Expansion ROM at fea40000 [disabled] [size=256K]
        Capabilities: [98] MSI-X: Enable+ Count=3 Masked-
        Capabilities: [84] Vendor Specific Information: Len=14 <?>
        Capabilities: [70] Vendor Specific Information: Len=14 <?>
        Capabilities: [60] Vendor Specific Information: Len=10 <?>
        Capabilities: [50] Vendor Specific Information: Len=10 <?>
        Capabilities: [40] Vendor Specific Information: Len=10 <?>
        Kernel driver in use: virtio-pci

00:1e.0 PCI bridge: Red Hat, Inc. QEMU PCI-PCI bridge (prog-if 00 [Normal decode])
        Flags: 66MHz, fast devsel
        Memory at fea95000 (64-bit, non-prefetchable) [size=256]
        Bus: primary=00, secondary=01, subordinate=01, sec-latency=0
        I/O behind bridge: 0000d000-0000dfff
        Memory behind bridge: fe800000-fe9fffff
        Prefetchable memory behind bridge: 00000000fe200000-00000000fe3fffff
        Capabilities: [4c] MSI: Enable- Count=1/1 Maskable+ 64bit+
        Capabilities: [48] Slot ID: 0 slots, First+, chassis 01
        Capabilities: [40] Hot-plug capable

00:1f.0 PCI bridge: Red Hat, Inc. QEMU PCI-PCI bridge (prog-if 00 [Normal decode])
        Flags: 66MHz, fast devsel
        Memory at fea96000 (64-bit, non-prefetchable) [size=256]
        Bus: primary=00, secondary=02, subordinate=02, sec-latency=0
        I/O behind bridge: 0000c000-0000cfff
        Memory behind bridge: fe600000-fe7fffff
        Prefetchable memory behind bridge: 00000000fe000000-00000000fe1fffff
        Capabilities: [4c] MSI: Enable- Count=1/1 Maskable+ 64bit+
        Capabilities: [48] Slot ID: 0 slots, First+, chassis 02
        Capabilities: [40] Hot-plug capable

Can you try next rolling release? I will waiting feedback from you

Now is good :slight_smile:

vyos@vyos:~$ show snmp mib ifmib
lo:     ifIndex = 1
        ifAlias = lo
        ifDescr = lo
eth0:   ifIndex = 2
        ifAlias = OUTSIDE
        ifDescr =
eth1:   ifIndex = 3
        ifAlias = INSIDE
        ifDescr =
pppoe1: ifIndex = 4
        ifAlias = pppoe1
        ifDescr = pppoe1
wg0:    ifIndex = 5
        ifAlias = VPN
        ifDescr = wg0