[SNMP4J] community name in agent
Jeff Ramin
ramin at berbee.com
Fri Aug 1 16:11:12 CEST 2008
Thanks Frank.
So, just to be completely explicit about this - the community
name of a V2 agent would be changed by modifying rows in the
snmpCommunityTable?
Frank Fock wrote:
> Jeff,
>
> These objects are standard SNMP objects and
> are therefore documented in the corresponding
> RFCs. For the SNMP-COMMUNITY-MIB
> see RFC 3584.
>
> Best regards,
> Frank
>
> Jeff Ramin schrieb:
>>
>> As I've posted before, I'm trying to figure out how to change the
>> community name of an existing MOServer...
>>
>> I've been looking at the source code, and came across this method
>> in the TestAgent:
>>
>> protected void addCommunities(SnmpCommunityMIB communityMIB) {
>> Variable[] com2sec = new Variable[] {
>> new OctetString("public"), // community name
>> new OctetString("cpublic"), // security name
>> getAgent().getContextEngineID(), // local engine ID
>> new OctetString("public"), // 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("public2public").toSubIndex(true), com2sec);
>> communityMIB.getSnmpCommunityEntry().addRow(row);
>> // snmpCommunityMIB.setSourceAddressFiltering(true);
>> }
>>
>>
>> Is this how a community name is added/changed in an existing agent?
>>
>> I was hoping it would be a simple setCommunityName(String) type of call,
>> but apparently not.
>>
>> Is there any documentation that explains the various objects above?
>> Things
>> like "security name", "local engine id", "context name", etc. don't mean
>> anything to me. I'd like to understand the relationship between these
>> objects/concepts, but looking at the javadoc doesn't suffice.
>>
>> Thanks!
>>
>>
--
Jeffrey Ramin
Berbee
ramin at berbee.com
608.298.1024
More information about the SNMP4J
mailing list