[SNMP4J] RE: change community problem

Alexander Fooks afooks at allot.com
Sun Dec 21 09:44:53 CET 2008


Hi, 

I have problem to define community other than "public" SNMP4J Agent for
SNMP version 2 and call off "public".

All my manipulations have no effect:

      getServer().addContext(new OctetString("other"));

	protected void addViews(VacmMIB vacm) {

	    vacm.addGroup(SecurityModel.SECURITY_MODEL_SNMPv2c,
		                new OctetString("other"),
		                new OctetString("other2other"),
		                StorageType.nonVolatile);

	    vacm.addAccess(new OctetString("other2other"), 
			    		new OctetString("other"),
		                SecurityModel.SECURITY_MODEL_SNMPv2c,
		                SecurityLevel.NOAUTH_NOPRIV,
		                MutableVACM.VACM_MATCH_EXACT,
		                new OctetString("fullReadView"),
		                new OctetString("fullWriteView"),
		                new OctetString("fullNotifyView"),
		                StorageType.nonVolatile);
               ......

      }

     protected void addCommunities(SnmpCommunityMIB communityMIB) {

		Variable[] com2sec = new Variable[] {
	            new OctetString("other"),              // community
name
	            new OctetString("other"),             // security
name
	            getAgent().getContextEngineID(),        // local
engine ID
	            new OctetString("other"),              // default
context name
	            new OctetString(),                      // transport
tag
	            new Integer32(StorageType.nonVolatile), // storage
type
	            new Integer32(RowStatus.active)         // row
status
	        };
		MOTableRow row =
	            communityMIB.getSnmpCommunityEntry().createRow(
	              new OctetString("other2other").toSubIndex(true),
com2sec);
	    communityMIB.getSnmpCommunityEntry().addRow(row);

            ......
     }
  

Could you advise how to do this.

Thank you in advance


BR
Alex Fooks



More information about the SNMP4J mailing list