No subject


Thu May 4 07:32:04 CEST 2017


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


More information about the SNMP4J mailing list