Bug with agents.conf for snmpm config in R13B03

Per Hedeland <>
Thu Feb 11 22:05:47 CET 2010


Unless I'm missing something, using agents.conf to configure agents for
the SNMP manager in R13B03 produces agent registrations that are invalid
at least for trap reception, since there is no 'reg_type' config item -
the snmpm_config:get_agent_user_info(Addr, Port) call in
snmpm_server:do_handle_snmp_trap/4 fails with

The patch below (sorry, no git at this time) fixes the problem, but is
not obviously correct - it "forces" "new style" snmpm_user callbacks.
Then again, if the "old style" isn't documented anymore, and this has
been broken for a while (since R13A/R13B?), maybe this is better than
changing the file format to allow a choice of old/new (where at least
"new" would presumably be different from the current, i.e.
sort-of-non-backwards-compat at this point).

About "missing something", it is possible to provide the 'reg_type' via
the DefaultAgentConfig in users.conf - but I assume that this is not the
intent, since I can't find 'reg_type' documented anywhere. (That
solution is fine by me though, I just don't want to use it without
"official blessing".)

--Per Hedeland

--- lib/snmp/src/manager/snmpm_config.erl.orig	2009-11-20 09:48:36.000000000 +0100
+++ lib/snmp/src/manager/snmpm_config.erl	2010-02-11 21:01:15.000000000 +0100
@@ -1618,7 +1618,8 @@
 	{ok, Addr} ->
 	    snmp_conf:check_integer(Port, {gt, 0}),
 	    Conf = 
-		[{address,          Addr},
+		[{reg_type,         target_name},
+		 {address,          Addr},
 		 {port,             Port},
 		 {community,        Comm}, 
 		 {engine_id,        EngineId},

More information about the erlang-patches mailing list