public class get_next
extends java.lang.Object
implements java.util.Observer
The get_next application does a MIB tree walk, using the GetNextPdu. It will start with the OID as configured in the properties file.
It walks the tree by creating a new GetNextPdu out off the previous one. All information will be printed to System.out.
The host, port, oid and community name can be configured in the
properties file.
The name of the properties file can be passed as first argument to
this application. If there is no such argument, it will look for
get_next.properties
. If this file does not exist, the
application will use default parameters.
GetNextPdu
,
Util
Constructor and Description |
---|
get_next(java.lang.String propertiesFilename)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
protected SnmpContext |
createContext(java.lang.String host,
int port,
java.lang.String socketType,
java.lang.String bindAddr,
java.lang.String community) |
protected GetNextPdu |
createPdu(SnmpContext context,
varbind var,
java.util.Observer obs) |
void |
init() |
static void |
main(java.lang.String[] args)
Main.
|
void |
update(java.util.Observable obs,
java.lang.Object ov)
Implementing the Observer interface.
|
public get_next(java.lang.String propertiesFilename)
propertiesFilename
- The name of the properties file. Can be
null.public void init()
protected SnmpContext createContext(java.lang.String host, int port, java.lang.String socketType, java.lang.String bindAddr, java.lang.String community) throws java.io.IOException
java.io.IOException
protected GetNextPdu createPdu(SnmpContext context, varbind var, java.util.Observer obs)
public void update(java.util.Observable obs, java.lang.Object ov)
update
in interface java.util.Observer
obs
- the GetNextPdu variableov
- the varbindGetNextPdu
,
varbind
public static void main(java.lang.String[] args)
get_next.properties
, pass the name as first argument.