AW: [SNMP4J] is there something special about a SET command?
Laux Thorsten Com ESY HD 733
thorsten.laux at siemens.com
Tue Apr 12 10:45:16 CEST 2005
Sorry Noel!
I currently don't have an idea of a location of an online-tutorial. Most of
my knowledge stems from the book SNMPv1, SNMPv2.... by William Stallings.
Thorsten
-----Ursprüngliche Nachricht-----
Von: Noel Grandin [mailto:noel at peralex.com]
Gesendet: Dienstag, 12. April 2005 10:31
An: Laux Thorsten Com ESY HD 733
Cc: snmp4j at agentpp.org
Betreff: Re: [SNMP4J] is there something special about a SET command?
Hi
Thank you very much!
A days worth of debugging fixed in 5 minutes!
Is there some kind of SNMP programming tutorial on the web?
Perhaps a link to it in the documentation might be useful for newbies like
myself.
I have the RFCs, but wading through 21 different documents is a tough job
:-)
Regards,
Noel
Laux Thorsten Com ESY HD 733 wrote:
> Hi Noel!
>
> Seems to me, you might not have set the fully-qualified OID. You write,
that
> you use GETNEXT to retrieve the element. For setting it you need to
> fully-qualify the OID:
>
> Example:
>
> A GETNEXT on sysName 1.3.6.1.2.1.1.5 provides the fully-qualified element
> 1.3.6.1.2.1.1.5.0 with a value.
> So if you try to set this value, you have to provide the OID
> 1.3.6.1.2.1.1.5.0 with a value in your SET-command.
>
> For your code this means: add a ".0" (the instance's index) to your OID
to
> set the value.
>
> I hope this helps you out...
>
> Greetings,
> Thorsten
>
> P.S. This won't work for tabular elements, because there the indices are
> somewhat different.
>
>
> -----Ursprüngliche Nachricht-----
> Von: Noel Grandin [mailto:noel at peralex.com]
> Gesendet: Dienstag, 12. April 2005 10:06
> An: snmp4j at agentpp.org
> Betreff: [SNMP4J] is there something special about a SET command?
>
> Hi
>
> My code basically looks like:
>
> final PDU pdu = new PDU();
> pdu.add(new VariableBinding(new OID(oid), new Integer32(val)));
> pdu.setType(PDU.SET);
>
> final CommunityTarget target = new CommunityTarget(new
> UdpAddress(ipAddress + "/161"), new OctetString(community));
> target.setVersion(SnmpConstants.version2c);
> target.setRetries(0);
> target.setTimeout(60000);
>
> final ResponseEvent responseEvent = snmp.send(pdu, target);
>
> But the device keeps responding "No such name", but I know the OID name
> exists because I can do a GETNEXT to retrieve
> it's value.
> Is there something special one needs to do for SET commands?
>
> Thanks,
> Noel
>
> NOTICE: Please note that this email, and the contents thereof,
> are subject to the standard Peralex email disclaimer, which may
> be found at: http://www.peralex.com/disclaimer.html
>
> If you cannot access the disclaimer through the URL attached
> and you wish to receive a copy thereof please send
> an email to email at peralex.com
> _______________________________________________
> SNMP4J mailing list
> SNMP4J at agentpp.org
> http://lists.agentpp.org/mailman/listinfo/snmp4j
>
NOTICE: Please note that this email, and the contents thereof,
are subject to the standard Peralex email disclaimer, which may
be found at: http://www.peralex.com/disclaimer.html
If you cannot access the disclaimer through the URL attached
and you wish to receive a copy thereof please send
an email to email at peralex.com
More information about the SNMP4J
mailing list