[SNMP4J] Re: subclassing Variable

Jeff Ramin ramin at berbee.com
Mon Jun 23 20:34:41 CEST 2008


I've been looking at the javadoc some more, looking for a Variable class
that I could extend...

I was hoping to see an abstract method for all Variables that could be used
for retrieving a value, but one doesn't seem to exist.

Is my only option here to create my own direct descendant of Variable, which
would implement all abstract methods?


 > Hi folks.
 >
 > I want to be able to monitor an application, so I'm using SNMP4J-agent
 > to provide that functionality (from within the application).
 >
 > My question is - how would I subclass Variable (or maybe ManagedObject?)
 > do provide data that changes over time? My plan is to create a ManagedObject
 > using MOFactory.createScalar() and handing it a Variable.
 >
 > Let's say I want to provide an OID that returns the number of rows in
 > a DB table. I'd like to have a Variable that grabs that number when a
 > request for it is made; in other words, it would support polling. As
 > opposed to having a Variable that is updated every X seconds.
 >
 > Is there a clean way to do this? Thanks!

-- 
Jeffrey Ramin
Berbee
ramin at berbee.com
608.298.1024



More information about the SNMP4J mailing list