When I try to add a transport specifier to any trap sink statement, I get a 
failure.  The man page for snmpd.conf references LISTENING ADDRESSES in 
snmpd(8), so I assume the format should be [protocol:]address[:port]. The 
examples support this.  What am I missing?

The following sink statements which include a TCP transport specifier

# grep -n sink /etc/snmp/snmpd.conf
23:trap2sink 10.224.4.169:162 public
24:trap2sink fd20:327:327:0:250:56ff:fe87:bf30
25:trap2sink [fd20:327:327:0:250:56ff:fe87:bf30]:162
26:trap2sink tcp:10.224.4.169 public
27:trap2sink tcp:10.224.4.169:162 public

Note: the first three trap2sink statements are accepted.

# /usr/sbin/snmpd -f -Le
Turning on AgentX master support.
snmpd: create_trap_session:
/etc/snmp/snmpd.conf: line 26: Error: cannot create trap2sink: tcp:10.224.4.169
snmpd: create_trap_session:
/etc/snmp/snmpd.conf: line 27: Error: cannot create trap2sink: 
tcp:10.224.4.169:162
net-snmp: 2 error(s) in config file(s)
NET-SNMP version 5.7.3

I get the same errors for IPv6 addresses with transport specifiers before the 
opening bracket.  Using trapsink instead of trap2sink, as you would expect, 
doesn't change the behavior.

Side comment, the lack of meaningful logging, even with -Dtdomain,snmp_sess, 
makes this harder to understand.  "Cannot create" would benefit from including 
a reason.
Here's the debugging for just one address: tcp:10.224.4.169

# /usr/sbin/snmpd -f -Le  -Dtdomain,snmp_sess
registered debug token tdomain, 1
registered debug token snmp_sess, 1
tdomain: netsnmp_tdomain_init() called
tdomain: domain_list -> { iso.3.6.1.2.1.100.1.2, "udp6/ipv6/udpv6/udpipv6" } -> 
{ iso.3.6.1.2.1.100.1.6, "tcp6/tcpv6/tcpipv6" } -> { iso.3.6.1.6.1.1, "udp" } 
-> { iso.3.6.1.2.1.100.1.5, "tcp" } -> { iso.3.6.1.4.1.8072.3.3.7, "alias" } -> 
{ iso.3.6.1.2.1.100.1.13, "unix" } -> [NIL]
snmp_sess: opening transport: 0
snmp_sess: done opening transport: 20
snmp_sess_add: fd 3
Turning on AgentX master support.
tdomain: tdomain_transport_full("snmptrap", "tcp:10.224.4.169", 0, "[NIL]", 
"[NIL]")
tdomain: Found domain "tcp" from specifier "tcp"
tdomain: trying domain "tcp" address "10.224.4.169" default address ":162"
snmpd: create_trap_session:
/etc/snmp/snmpd.conf: line 26: Error: cannot create trap2sink: tcp:10.224.4.169
net-snmp: 1 error(s) in config file(s)
tdomain: tdomain_transport_full("snmp", "udp:0.0.0.0:161", 1, "[NIL]", "[NIL]")
tdomain: Found domain "udp" from specifier "udp"
tdomain: trying domain "udp" address "0.0.0.0:161" default address ":161"
snmp_sess: opening transport: 20
snmp_sess_add: fd 6
tdomain: tdomain_transport_full("snmp", "udp6:[::]:161", 1, "[NIL]", "[NIL]")
tdomain: Found domain "udp6" from specifier "udp6"
tdomain: trying domain "udp6" address "[::]:161" default address ":161"
snmp_sess: opening transport: 20
snmp_sess_add: fd 7
tdomain: tdomain_transport_full("agentx", "", 1, "[NIL]", "[NIL]")
tdomain: checking for host specific config hosts/
tdomain: Use application default domains "unix" "tcp"
tdomain: Found domain "unix" from specifier "unix"
tdomain: trying domain "unix" address "" default address "/var/agentx/master"
snmp_sess: opening transport: 0
snmp_sess: done opening transport: 20
snmp_sess_add: fd 8
NET-SNMP version 5.7.3

I'm using 5.7.3 from the Debian buster distro:

# uname -a
Linux host-adm1 4.19.0-13-amd64 #1 SMP Debian 4.19.160-2 (2020-12-08) x86_64 
GNU/Linux

# /usr/sbin/snmpd -v
NET-SNMP version:  5.7.3
Web:               http://www.net-snmp.org/
Email:             
net-snmp-cod...@lists.sourceforge.net<mailto:net-snmp-cod...@lists.sourceforge.net>


_______________________________________________
Net-snmp-users mailing list
Net-snmp-users@lists.sourceforge.net
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users

Reply via email to