<html>
<head>
<meta content="text/html; charset=windows-1252"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">Hello,<br>
<br>
Try this:<br>
<br>
-module(snmp_test).<br>
<br>
-compile(export_all).<br>
<br>
start() -><br>
snmpm:start(),<br>
snmpm:register_user(?MODULE, snmpm_user_default, undefined).<br>
<br>
t() -><br>
Opts = [<br>
{engine_id, "test"},<br>
{community, "public"},<br>
{version, v2},<br>
{address, {127,0,0,1}}<br>
],<br>
ok = snmpm:register_agent(?MODULE, "test123", Opts),<br>
Reply = snmpm:sync_get(?MODULE, "test123",
[[1,3,6,1,2,1,1,1,0]]),<br>
ok = snmpm:unregister_agent(?MODULE, "test123"),<br>
Reply.<br>
<br>
$ erlc snmp_test.erl<br>
$ erl<br>
Erlang/OTP 17 [erts-6.3] [source] [64-bit] [smp:8:8]
[async-threads:10] [hipe] [kernel-poll:false]<br>
<br>
Eshell V6.3 (abort with ^G)<br>
1> snmp_test:start().<br>
ok<br>
2> snmp_test:t().<br>
{ok,{noError,0,<br>
[{varbind,[1,3,6,1,2,1,1,1,0],<br>
'OCTET STRING',<br>
"Linux ates-desktop 3.13.0-46-generic
#76-Ubuntu SMP Thu Feb 26 18:52:13 UTC 2015 x86_64",<br>
1}]},<br>
4993}<br>
3> snmp_test:t().<br>
{ok,{noError,0,<br>
[{varbind,[1,3,6,1,2,1,1,1,0],<br>
'OCTET STRING',<br>
"Linux ates-desktop 3.13.0-46-generic
#76-Ubuntu SMP Thu Feb 26 18:52:13 UTC 2015 x86_64",<br>
1}]},<br>
4999}<br>
<br>
<br>
On 03/03/2015 01:00 AM, Frederic Bonfanti wrote:<br>
</div>
<blockquote
cite="mid:C743D4D0-61EE-42FF-BE3B-EF1500BD9F35@gmail.com"
type="cite">
<meta http-equiv="Content-Type" content="text/html;
charset=windows-1252">
Hi,
<div class=""><br class="">
</div>
<div class="">I have been playing around with snmp but this giving
me a hard time...</div>
<div class=""><br class="">
</div>
<div class="">here is the error I get:</div>
<div class=""><br class="">
</div>
<blockquote style="margin: 0 0 0 40px; border: none; padding:
0px;" class="">
<div class=""><span class="Apple-tab-span"
style="white-space:pre"> </span><span style="font-family:
Menlo; font-size: 11px;" class="">>
snmp_ex2_simple_standard_test:start({192,168,1,1}).</span></div>
<div style="margin: 0px; font-size: 11px; font-family: Menlo;"
class="">snmpm:snmpm:mk_target_name(snmpUDPDomain,
{{192,168,1,1},161}, [{community, "public"}]) ->
"192.168.1.1:161-v1".</div>
<div style="margin: 0px; font-size: 11px; font-family: Menlo;
min-height: 13px;" class=""><br class="">
</div>
<div style="margin: 0px; font-size: 11px; font-family: Menlo;"
class="">Command 1 (get-next [1,1]): error</div>
<div style="margin: 0px; font-size: 11px; font-family: Menlo;"
class=""> {command_failed,not_found}</div>
<div style="margin: 0px; font-size: 11px; font-family: Menlo;"
class="">... </div>
</blockquote>
<div class=""><br class="">
</div>
<div class="">SNMP works fine from both Mac OS X / snmpget and
remote agent perspectives... Only erlang SNMP toolkit refuses to
operate properly.</div>
<div class=""><br class="">
</div>
<div class="">Any hint appreciated</div>
<div class=""><br class="">
</div>
<div class="">+F</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
erlang-questions mailing list
<a class="moz-txt-link-abbreviated" href="mailto:erlang-questions@erlang.org">erlang-questions@erlang.org</a>
<a class="moz-txt-link-freetext" href="http://erlang.org/mailman/listinfo/erlang-questions">http://erlang.org/mailman/listinfo/erlang-questions</a>
</pre>
</blockquote>
<br>
</body>
</html>