[SNMP4J] snmp agent setValue not being called
David Morales de Frías
dmorales at paradigmatecnologico.com
Wed Feb 5 17:34:36 CET 2014
Thanks Frank, your help is greatly appreciated but still not working and i
have no idea why... I can read all values but i can't write anything.
I don't see anything special in snmp4j logs... and there is no log output
when i try to set a value.
Here is the output when i register the moScalar extended objects (
with MOAccessImpl.ACCESS_READ_WRITE access)
INFO - Registered MO
es.binding.snmpserver.model.SnmpExporterParameter[oid=1.3.6.1.4.1.32275.2.1.1.4.6.54.0,access=org.snmp4j.agent.mo.MOAccessImpl at 4fb7a0d3,value=1391617684351,volatile=false]
in default context with scope
es.binding.snmpserver.model.SnmpExporterParameter[oid=1.3.6.1.4.1.32275.2.1.1.4.6.54.0,access=org.snmp4j.agent.mo.MOAccessImpl at 4fb7a0d3
,value=1391617684355,volatile=false]
And here is the code:
*EXTENDED BASE AGENT*
public void *start()* throws Exception {
init();
addShutdownHook();
getServer().addContext(new OctetString(community));
finishInit();
run();
sendColdStartNotification();
}
@Override
protected void *addCommunities(SnmpCommunityMIB communityMIB) {*
if (snmpVersion != SnmpConstants.version3) {
Variable[] com2sec = new Variable[] { new OctetString(community), //
community name
new OctetString(username), // security name
getAgent().getContextEngineID(), // local engine ID
new OctetString(community), // 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);
}
}
@Override
protected void* addViews(VacmMIB vacm) { *
vacm.addGroup(securityModel, new OctetString(username), new
OctetString(_uuid), StorageType.nonVolatile);
vacm.addAccess(new OctetString(_uuid),
new OctetString(community),
SecurityModel.SECURITY_MODEL_ANY,
authenticationType,
VacmMIB.vacmExactMatch,
new OctetString("fullReadView"),
new OctetString("fullWriteView"),
new OctetString("fullNotifyView"),
StorageType.nonVolatile);
vacm.addViewTreeFamily(new OctetString("fullWriteView"),
new OID("1.3"),
new OctetString(),
VacmMIB.vacmViewIncluded,
StorageType.nonVolatile);
vacm.addViewTreeFamily(new OctetString("fullReadView"),
new OID("1.3"),
new OctetString(),
VacmMIB.vacmViewIncluded,
StorageType.nonVolatile);
}
public void *registerManagedObject(ManagedObject mo) {*
try {
server.register(mo, new OctetString());
} catch (DuplicateRegistrationException ex) {
throw new RuntimeException(ex);
}
}
2014-02-04 Frank Fock <fock at agentpp.com>:
> OIDs do NOT start with a dot!
>
> Have you analyzed the log output of the agent? There you should find
> the exact reason.
>
> Best regards,
> Frank
>
> Am 04.02.2014 18:52, schrieb David Morales de Frías:
>
> Thanks for your quick reply Frank.
>
> I'm just creating the MOScalar extended objects
> with MOAccessImpl.ACCESS_READ_WRITE access.
>
> and this is my addViews method in snmp agent, sorry for posting code but
> i can't see where is the problem.
>
>
>
> @Override
> protected void addViews(VacmMIB vacm) {
> vacm.addGroup(securityModel, new OctetString(username), new
> OctetString(_uuid), StorageType.nonVolatile);
> vacm.addAccess(new OctetString(_uuid),
> new OctetString(community),
> SecurityModel.SECURITY_MODEL_ANY,
> authenticationType,
> VacmMIB.vacmExactMatch,
> new OctetString("fullReadView"),
> new OctetString("fullWriteView"),
> new OctetString("fullNotifyView"),
> StorageType.nonVolatile);
> vacm.addViewTreeFamily(new OctetString("fullReadView"),
> new OID("1.3"),
> new OctetString(),
> VacmMIB.vacmViewIncluded,
> StorageType.nonVolatile);
> vacm.addViewTreeFamily(new OctetString("fullWriteView"),
> new OID(".1.3.6.1.4.1.32275.2.1.2.1.1.1.0"),
> new OctetString(),
> VacmMIB.vacmViewIncluded,
> StorageType.nonVolatile);
> vacm.addViewTreeFamily(new OctetString("fullWriteView"),
> new OID("1.3"),
> new OctetString(),
> VacmMIB.vacmViewIncluded,
> StorageType.nonVolatile);
>
> }
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> 2014-02-04 Frank Fock <fock at agentpp.com>:
>
>> Hi,
>>
>> Then you might have to check your security configuration (VACM MIB).
>> Maybe you are not allowed to set the value. Also check the access rights
>> for the value.
>>
>> Best regards,
>> Frank
>>
>> Am 04.02.2014 16:44, schrieb David Morales de Frías:
>>
>>> Hi there,
>>>
>>> I'm trying to setup a snmp agent, by registering several MOScalar
>>> extended
>>> objects.
>>>
>>> I have overwritten getValue and it's working nicely but when can't say
>>> the
>>> same about the setValue.
>>>
>>> This method is never being called when i set a value from a snmp client.
>>>
>>> Any idea? Maybe the agent is not properly configured?
>>>
>>>
>>> Regards.
>>> _______________________________________________
>>> SNMP4J mailing list
>>> SNMP4J at agentpp.org
>>> https://s16675406.onlinehome-server.info/mailman/listinfo/snmp4j
>>>
>>
>> --
>> ---
>> AGENT++
>> Maximilian-Kolbe-Str. 10
>> 73257 Koengen, Germany
>> https://agentpp.com
>> Phone: +49 7024 8688230
>> Fax: +49 7024 8688231
>>
>> _______________________________________________
>> SNMP4J mailing list
>> SNMP4J at agentpp.org
>> https://s16675406.onlinehome-server.info/mailman/listinfo/snmp4j
>>
>
>
> --
> ---
> AGENT++
> Maximilian-Kolbe-Str. 10
> 73257 Koengen, Germanyhttps://agentpp.com
> Phone: +49 7024 8688230
> Fax: +49 7024 8688231
>
>
More information about the SNMP4J
mailing list