When setting up SNMP for the very first time this error will happen:
cpo@BR1# show service snmp +community baz { + authorization ro + network 172.31.0.0/24 +} +contact "FooBar <foo@bar.com>" +listen-address 172.16.254.20 { +} +location "Foo City, Bar Ave 666" [edit] cpo@BR1# commit [ service snmp ] Traceback (most recent call last): File "/usr/libexec/vyos/conf_mode/snmp.py", line 843, in <module> apply(c) File "/usr/libexec/vyos/conf_mode/snmp.py", line 796, in apply with open(config_file_user, 'r') as f: FileNotFoundError: [Errno 2] No such file or directory: '/var/lib/snmp/snmpd.conf' [[service snmp]] failed
Configuration file exists after this failed commit.
cpo@BR1# ls -al /var/lib/snmp/snmpd.conf -rw------- 1 snmp snmp 1521 Jan 2 16:57 /var/lib/snmp/snmpd.conf
A second commit will fix this
cpo@BR1# show service snmp +community baz { + authorization ro + network 172.31.0.0/24 +} +contact "FooBar <foo@bar.com>" +listen-address 172.16.254.20 { +} +location "Foo City, Bar Ave 666" [edit] cpo@BR1# commit