[SNMP4J] Community String has to be equal to security name, is this supposed behavior?

Guang Yang guyang at bea.com
Tue Jan 30 05:38:33 CET 2007


Dear Friends,

 

I am recently using SNMP4J Agent. 

As we know actually SNMP4J using v3 mechanism to simulate v1/v2
community behavior, thus a community will be mapped with a security
name, which is full complied with SNMP-COMMUNITY-MIB.

 

Just found an interesting issue. That is, in case the community String
does not equals to Security Name everything will be confusing. 

To be more detail:

 

I created a security named "mysecurity" by

*          vacm.addAccess

*          vacmMib.addGroup()

 

Tried to map it with a specified community String by operation of 

 

        Variable[] com2secReadOnly = new Variable[] {

             new OctetString("mycommunity"), // community

                // name

                new OctetString("mysecurity"), //  security

                // name

                getAgent().getContextEngineID(), // local engine ID

                new OctetString(WlcsSnmpConfiguration.getInstance()

                        .getContext()), // default context name

                new OctetString(), // transport tag

                new Integer32(StorageType.nonVolatile), // storage type

                new Integer32(RowStatus.active) // row status

        };

 

        communityMIB.getSnmpCommunityEntry().addRow(

             communityMIB.getSnmpCommunityEntry().createRow(

                        new
OctetString("readonlySec2ReadCom").toSubIndex(true), com2secReadOnly));
//this name is not important, right?

 

SNMP does not response. This shall be nothing to do with wrong
community, for I get following statement on console if I test with wrong
community

*          "Community name "wrongcommunity" not found in
SNMP-COMMUNITY-MIB"

 

But mycommunity does not have this report.

 

However, when I create a security named "mycommunity" with SAME API, and
change code like this,

        Variable[] com2secReadOnly = new Variable[] {

             new OctetString("mycommunity"), // community

                // name

                new OctetString("mycommunity"),   //  security

                // name

 

It works without any problem...

Therefore...I am a bit confused. 

 

I will be very appreciated if there is any expert could provide me a
hint. Although this workaround works fine I still would like to know, is
this a supposed behavior?

 

With best regards,

Yang Guang.

Guang Yang (Grant)

----------------------------------------
BEA Telecommunication Technique Center
Software Engineer
----------------------------------------

 

_______________________________________________________________________
Notice:  This email message, together with any attachments, may contain
information  of  BEA Systems,  Inc.,  its subsidiaries  and  affiliated
entities,  that may be confidential,  proprietary,  copyrighted  and/or
legally privileged, and is intended solely for the use of the individual
or entity named in this message. If you are not the intended recipient,
and have received this message in error, please immediately return this
by email and then delete it.



More information about the SNMP4J mailing list