public class getAllInterfaces
extends java.lang.Object
implements java.util.Observer, java.lang.Runnable
The getAllInterfaces application requests the interface information of all the current interfaces of a host, using the InterfaceGetNextPdu.
It walks the tree by creating a new InterfaceGetNextPdu out off the previous one, and it collects the values of all the interfaces. Since the application is Runnable, it will send requests continuously.
The 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
getAllInterfaces.properties
. If this file does not exist, the
application will use default parameters.
InterfaceGetNextPdu
Modifier and Type | Field and Description |
---|---|
static long |
sleepTime
Use 10 (sec) as interval
|
Constructor and Description |
---|
getAllInterfaces(java.lang.String propertiesFilename)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
init() |
static void |
main(java.lang.String[] args)
Main.
|
void |
run() |
void |
start() |
void |
update(java.util.Observable obs,
java.lang.Object ov)
Implementing the Observer interface.
|
public static final long sleepTime
public getAllInterfaces(java.lang.String propertiesFilename)
propertiesFilename
- The name of the properties file. Can be
null.public void init()
public void start()
public void run()
run
in interface java.lang.Runnable
public void update(java.util.Observable obs, java.lang.Object ov)
update
in interface java.util.Observer
obs
- the InterfaceGetNextPdu variableov
- the array of varbind (not used)InterfaceGetNextPdu
,
varbind
public static void main(java.lang.String[] args)
getAllInterfaces.properties
, pass the name as first argument.