Page MenuHomePhabricator

SNMP: non verbose error message on wrong listen-address
Closed, DuplicatePublicBUG

Description

This just happened to me, my setup is:

cpo@CR1# show interfaces loopback lo
 address 172.16.254.101/32
 description Loopback

And I wanted to bind the SNMP server to the IP address 172.16.254.30 which is not available on my system.

Reproduce:

set service snmp community VyOSroxx authorization ro
set service snmp community VyOSroxx network 172.16.100.0/24
set service snmp contact 'Admin <noc@fancy-corp.com>'
set service snmp listen-address 172.16.254.30 port 161
set service snmp location 'Milkyway, Mars, Northpole'
commit
[[service snmp]] failed
Commit failed

When checking the system log I see:

Dec  1 18:14:49 CR1 snmpd[3916]: Error opening specified endpoint "udp:172.16.254.30:161"
Dec  1 18:14:49 CR1 snmpd[3916]: Server Exiting with code 1
Dec  1 18:14:49 CR1 systemd[1]: snmpd.service: control process exited, code=exited status=1
Dec  1 18:14:49 CR1 systemd[1]: Failed to start LSB: SNMP agents.
Dec  1 18:14:49 CR1 systemd[1]: Unit snmpd.service entered failed state.

Which halped me alot.

@dmbaturin shouldn't there be a generic way to support only available IP addresses on the system at all, like any +cough+ Perl script?

Details

Difficulty level
Unknown (require assessment)
Version
VyOS 999.201712011703
Why the issue appeared?
Will be filled on close
c-po created this task.Dec 1 2017, 5:23 PM
syncer triaged this task as Normal priority.Dec 21 2017, 9:11 PM
syncer assigned this task to c-po.Oct 13 2018, 7:15 PM
c-po added a comment.Sat, Oct 20, 9:21 PM

I will implement at least a warning message for the user. Enforcing proper IP addresses could break old comfigurations - or they should be deleted by a migration script and then we can print proper error messages.