Hi..

I tried the testAgent demo supplied by the Snmp4jAgent.
Not really sure how it works yet. Kinda complicated at least for me.

Anyway,
I've created a simple apps. One is the agent and the other is client which 
sends the pdu and get the response from agent.
>From what I've told earlier, I would like to add in all the oids and its value 
>to the agent.

I've done that but not sure it's correct or incorrect (I can't find sample code 
for what I've wanted). The code for that is as follow

    public void registerCustomMO() {

        String key = "";
        Iterator iterator = oid_values.keySet().iterator();
        while(iterator.hasNext()) {
            key = (String) iterator.next();    
        try {
            server.register( new MOScalar(new OID("."+key),
                             MOAccessImpl.ACCESS_READ_ONLY, 
                             new OctetString((String) oid_values.get(key))),
                             new OctetString((String) oid_values.get(key)));
        } catch (DuplicateRegistrationException e) {
            e.printStackTrace();
        }
    
        }                        
    }


For example in my agent, I registered 
oid = 1.3.6.1.2.1.1.1.0 = Hardware: x86 Family 15 Model 6 Stepping 5 AT/AT 
COMPATIBLE - Software: Windows Version 5.2 (Build 3790 Multiprocessor Free)
       1.3.6.1.2.1.1.3.0 = 65 days, 0:21:29.42

Once I've started the Agent. I ran the client.

In the GET PDU, I requested value for oid "1.3.6.1.2.1.1.1.0".
What I get is "Windows XP .....".

For oid "1.3.6.1.2.1.1.3.0", I got like "0:00:3.xxxx". (Coincidentally reflect 
the duration that the agent has been running).

So I guess it's still not registering or I'm doing something wrong here?
Do guide me.

Thx.
Simon









                                          
_________________________________________________________________
Hotmail: Trusted email with powerful SPAM protection.
https://signup.live.com/signup.aspx?id=60969
_______________________________________________
SNMP4J mailing list
SNMP4J@agentpp.org
http://lists.agentpp.org/mailman/listinfo/snmp4j

Reply via email to