[SNMP4J] MOScalar question

Jose Ignacio jicenteno.listas at gmail.com
Fri Aug 18 12:37:58 CEST 2006


Hello, i'm new to SNMP and I'm making examples to understand snmp4j from
TestAgent, my constructor is:

    public MyAgent(File bootCounterFile, File configFile) throws IOException
{
        super(bootCounterFile, configFile, new CommandProcessor(
                new OctetString(MPv3.createLocalEngineID())));
        // Alternatively: OctetString.fromHexString("00:00:00:00:00:00:02",
        // ':');
        agent.setThreadPool(ThreadPool.create("RequestPool", 4));

        OID oidParamTest1 = new OID(new int[] { 1, 3, 6, 1, 4, 1, 1, 1, 2,
                1, 0 });
        MOScalar paramTest1 = new MOScalar(oidParamTest1,
                MOAccessImpl.ACCESS_READ_ONLY, getValue());
        try {
            server.register(paramTest1, null);

        } catch (DuplicateRegistrationException e) {
            e.printStackTrace();
        }
    }

and getValue method:

    private Variable getValue() {
        return new OctetString(""+System.currentTimeMillis());
    }


The problem is that the agent's response is the same always. What I have to
do to change the agent response?


Thanks much in advance, and sorry for my english,
JiCa.



More information about the SNMP4J mailing list