[SNMP4J] how to SET?
Daniel Gyorfi
gd425 at hszk.bme.hu
Wed Apr 4 15:01:27 CEST 2007
Hi all!
Just for the record, the community string was the problem.
Always make sure, you are using the correct community string.
regards,
Daniel
On 20/03/07, Daniel Gyorfi <gd425 at hszk.bme.hu> wrote:
> Hi!
> Yes.
> It works just fine with the snmp4j_tool:
> SNMP4J.exe -c public -v 2c -p SET udp:192.168.2.1/161 "1.3.6....5.0={s}MyDevice"
>
> On 3/19/07, Frank Fock <fock at agentpp.com> wrote:
> > Hi Daniel,
> >
> > Have you checked your access rights for write
> > access to the agent?
> >
> > Best regards,
> > Frank
> >
> > Daniel Gyorfi wrote:
> > > Hi All!
> > >
> > > I want to send a PDU with SET type.
> > > I have a working method, which returns a perfect result for a single
> > > GET type and I changed the type and added a value for the single
> > > variablebinding:
> > >
> > > PDU request = new PDU();
> > > if (set){
> > > request.add(new VariableBinding(new OID(oid), new
> > > OctetString(setValue)));
> > > request.setType(PDU.SET);
> > > } else{
> > > request.add(new VariableBinding(new OID(oid)));
> > > request.setType(pduType);
> > > }
> > > ResponseEvent responseEvent = snmp.send(request, target);
> > >
> > > PDU response = null;
> > > if (responseEvent != null) {
> > > response = responseEvent.getResponse();
> > > } else response = null;
> > > snmp.close();
> > > return response;
> > >
> > > I didnt changed anything else, but Im not able to receive valid (not
> > > null) response.
> > > Do I have to change something also?
> > > Am I missing something else?
> > >
> > > Many thanks,
> >
> > --
> > AGENT++
> > http://www.agentpp.com
> > http://www.mibexplorer.com
> > http://www.mibdesigner.com
> >
> >
>
>
> --
> Daniel Gyorfi
> xn--gyrfidniel-x4a35k
>
--
Daniel Gyorfi
xn--gyrfidniel-x4a35k
More information about the SNMP4J
mailing list