[erlang-questions] snmp security name problems
Daniel Goertzen
daniel.goertzen@REDACTED
Sun May 1 04:16:45 CEST 2011
Never mind, I got it to work (hooray for wireshark and erlang tracing.) The
problems were...
1. agent.conf is supposed to specify agent engine id, not manager engine id.
2. usm.conf is supposed to specify agent engine id and key generated from
agent engine id.
3. OID needed a ",0" tacked onto the end.
Dan.
On Sat, Apr 30, 2011 at 3:21 PM, Daniel Goertzen
<daniel.goertzen@REDACTED>wrote:
> I am playing with erlang snmp managers, and am having trouble making my
> first sync_get() command to a v3 agent work. I am getting
> "unknownSecurityName" (see below), and I am stumped as to what might be
> wrong.
>
>
> I have What's Up Gold polling my v3 agent device, so I know the agent's
> SNMP is working well.
>
> Any suggestions?
> Thanks,
> Dan.
>
>
>
> PS C:\cygwin\home\goertzen\bulk_config\srpc\ebin> C:\erlang\bin\erl.exe
> -config C:\erlsnmp\sys.config
> Eshell V5.8.2 (abort with ^G)
> 1> crypto:start().
> ok
> 2> snmp:start().
> ok
> 3> snmpm:which_agents().
> ["myagent"]
> 4> snmpm:which_usm_users().
> [{"hemi","abc123"}]
> 5> snmpm:usm_user_info("hemi", "abc123",sec_name).
> {ok,"abc123"}
> 6> snmpm:sync_get(defaultuser, "myagent", [[1,3,6,1,2,1,1,1]]).
>
> =ERROR REPORT==== 30-Apr-2011::15:15:46 ===
> [ snmp : manager : snmpm_mpd : <0.61.0> ]
> MPD: CONFIG ERROR: unknownSecurityName (message: {message,'version-3',
> {v3_hdr,1261510722,484,
> [7],
> 3,undefined,undefined},
>
> [48,65,4,32,56,48,58,48,48,
>
> 58,54,51,58,57,102,58,48,
>
> 51,58,48,48,58,52,48,58,53,
>
> 51,58,48,56,58,52,102,58,
> 55,51,4,0,160,27,2,4,92,
>
> 103,199,2,2,1,0,2,1,0,48,
>
> 13,48,11,6,7,43,6,1,2,1,1,
> 1,5,0]})
>
> {error,{send_failed,1550305026,unknownSecurityName}}
> 7>
>
>
> usm.conf:
> %% {EngineID, UserName, AuthP, AuthKey, PrivP, PrivKey}.
> %% {EngineID, UserName, SecName, AuthP, AuthKey, PrivP, PrivKey}.
> {"hemi", "abc123", "abc123",
> usmHMACMD5AuthProtocol,
> [122,254,237,74,242,75,191,73,255,25,189,190,102,250,156,25], % from
> snmp:passwd2localized_key(md5,"abc123456","hemi")
> usmDESPrivProtocol,
> [122,254,237,74,242,75,191,73,255,25,189,190,102,250,156,25] % from
> snmp:passwd2localized_key(md5,"abc123456","hemi")
> }.
>
> agents.conf:
> %% {UserId,
> %% TargetName, Comm, Ip, Port, EngineID, Timeout,
> %% MaxMessageSize, Version, SecModel, SecName, SecLevel}
> %%
> { defaultuser, "myagent", "", [192,168,1,50], 162, "engineid", infinity,
> 484, v3, usm, "abc123", authPriv }.
>
> users.conf:
> {defaultuser, snmpm_user_default, "dummy"}.
>
> manager.conf:
> {port, 5000}.
> {address, [192,168,1,104]}.
> {engine_id, "hemi"}.
> {max_message_size, 484}.
>
> sys.config:
> [{snmp,
> [
> {manager,
> [
> {priority, normal},
> {versions, [v3]},
> {config, [{dir, "c:/erlsnmp/"}, {verbosity, silence}, {db_dir,
> "c:/erlsnmp/data/"}, {repair, true}, {auto_save, 5000}]},
> {inform_request_behaviour, auto},
> {mibs, ["c:/erlang/lib/snmp-4.18/mibs/SNMPv2-MIB"]},
> {server, [{timeout,30000},{verbosity,silence}]},
> {note_store, [{timeout,30000},{verbosity,silence}]},
> {net_if,
> [{module,snmpm_net_if},{verbosity,silence},{options,[{bind_to,false},{no_reuse,false}]}]}
> ]
> }
> ]
> }
> ].
>
>
--
Daniel Goertzen
-----------------
dang@REDACTED (work)
daniel.goertzen@REDACTED (home)
-----------------
1 204 272 6149 (home/office)
1 204 470 8360 (mobile)
-----------------
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20110430/f5d8d80f/attachment.htm>
More information about the erlang-questions
mailing list