The output of the “show snmp v3” command and its sub commands contain unnecessary data
I was able to confirm this with the following command:
show snmp v3
show snmp v3 group
show snmp v3 trap-target
show snmp v3 user
show snmp v3 view
testing environment
$ show version
Version: VyOS 1.5-rolling-202405280020
Release train: current
Release flavor: iso
Built by: [email protected]
Built on: Tue 28 May 2024 03:11 UTC
Build UUID: e42d9cb2-26e1-4736-b508-b119b9a640ad
Build commit ID: b809886538eaad
Architecture: x86_64
Boot via: installed image
System type: KVM guest
Hardware vendor: innotek GmbH
Hardware model: VirtualBox
Hardware S/N: 0
Hardware UUID: 6c4524b7-02b6-a045-83ab-a8a3abb082b3
Copyright: VyOS maintainers and contributors
reproduction procedure
$ show snmp v3 user
SNMP v3 is not configured
# set service snmp v3 engineid '000000000000000000000002'
# set service snmp v3 group default mode 'ro'
# set service snmp v3 group default view 'default'
# set service snmp v3 user vyos auth plaintext-password 'vyos12345678'
# set service snmp v3 user vyos auth type 'sha'
# set service snmp v3 user vyos group 'default'
# set service snmp v3 user vyos privacy plaintext-password 'vyos12345678'
# set service snmp v3 user vyos privacy type 'aes'
# set service snmp v3 view default oid 1
# commit
vyos@vyos:~$ show snmp v3 group
{'group': [{'name': 'default', 'mode': 'ro', 'view': 'default'}], 'trap': [], 'user': [{'name': 'vyos', 'mode': None, 'a
uth': 'sha', 'priv': 'aes', 'group': 'default'}], 'view': [{'name': 'default', 'oids': ['1']}]}
SNMPv3 Groups:
Group View
----- ----
default default(ro)
expected output
vyos@vyos:~$ show snmp v3 group
SNMPv3 Groups:
Group View
----- ----
default default(ro)
The cause seems to be the following code: github
print(data)