-----------------------------------------------------------------------

	"@(#)README 3.5 99/03/23 SMI"

	Copyright (c) 03/23/99, by Sun Microsystems, Inc.
	All rights reserved.

-----------------------------------------------------------------------

			SNMP Agent Example
			==================


-----------------------------------------------------------------------
1. Example overview
-----------------------------------------------------------------------
This example shows how to build an SNMP agent.

The current directory contains the following source files:
    * Agent.java:
 	- Initializes the framework.
	- Adds an HTML adaptor and an RMI adaptor to the framework.
	- Adds an SNMP adaptor. The adaptor is bound to a nonstandard
	  SNMP port (8085). This avoids having to start the agent as 
	  root, as is required by some operating systems for binding to a
	  standard SNMP port.
	- Creates and initializes a SNMP MIB. Every group in the MIB
	  is registered with  framework. This enables them to be managed
	  through the other adaptors in the agent (namely HTML and RMI).

   * SecureAgent.java:
	- Same content as Agent.java showing an example of a simple 
	  use of the SnmpPduFactoryIf. The SecureAgent can take as
	  input a list of host names whose request pdus will be rejected.

   * StandAloneSnmpAgent.java:
	- Implements a standalone SNMP agent. A standalone SNMP agent
	  does not contain the framework. The only component of the Java
	  DMK required is the SNMP adaptor.
	- Adds an SNMP adaptor. The adaptor is bound to a nonstandard
	  SNMP port (8085). This avoids having to start the agent as 
	  root, as is required by some operating systems for binding to a
	  standard SNMP port.
	- Creates and initializes a SNMP MIB.

   * patchfiles/RFC1213_MIB.java:
        - Originally generated by mibgen for representing the subset MIB II.
	- Then modified to instantiate InterfacesImpl, SnmpImpl
	  and SystemImpl objects instead of Interfaces, Snmp and
	  System objects.
	- All the modifications that have been made are contained
	  between the 2 following tags:

		// MODIF_BEGIN
		...
		// MODIF_END	

   * InterfacesImpl.java:
        - Is a dummy implementation of the interfaces group defined in
	  MIB-II.
	- Declares TableEntryListenerImpl as listener to added/removed table entries

   * SnmpImpl.java:
        - Is a dummy implementation of the Snmp group defined in
	  MIB-II.
   * SystemImpl.java:
        - Is a real implementation of the system group defined in MIB-II.

   * IfEntryImpl.java:
        - Is a dummy implementation of the ifEntry entry defined in MIB-II.
        - Registers each entry of an SNMP table with the framework.
	- Sends SNMP traps.

   * TableEntryListenerImpl.java :
	- Is a dummy implementation of a SnmpTableEntryListener allowing to 
	  receive SnmpTableEntryEvent events when an entry is added or removed 
	  from ifTable table.

   * SnmpPduFactoryImpl.java :
	- Is a simple implementation of the SnmpPduFactoryIf interface which
	  rejects the pdus sent by certain hosts.	

   * LinkTrapGenerator.java:
        - Is a dummy implementation of an SNMP trap generator for
          a given interface.

   * jaw.acl:
	- Is an ACL file that you must customize to enable the agent 
	  to send SNMP traps (see Section 3).

   * mib_II.txt:
	- Contains the standard definition of MIB II.

   * mib_II_subset.txt:
 	- Contains the subset of mib_II.txt that defines the system,
	  snmp, and interfaces groups.

   * mib_core.txt:
	- Contains a set of common definitions required by mibgen for
	  compiling MIB II.

  Note : For more information on the specification of the SnmpPduFactoryIf 
	 interface you can refer to SnmpPduFactoryIfSpec.html.
	

-----------------------------------------------------------------------
2. Building and running the example
-----------------------------------------------------------------------
To build the snmp agent example, copy the example source files to your 
working directory and type the following commands:

   cd <WORKING_DIR>

   mibgen -d . mib_II_subset.txt mib_core.txt

   # Replace the generated file RFC1213_MIB.java by the one provided
   # under the patchfiles directory and then compile:

   javac -d . *.java


To run the version of the example you have just built, type the
following commands:

   # Make sure that no agents are already running 
   # and start the agent:

   java Agent
 -or-
   java StandAloneSnmpAgent
 -or-
   java SecureAgent

-----------------------------------------------------------------------
3. Enabling SNMP traps (optional)
-----------------------------------------------------------------------
To enable SNMP traps, type the following commands:

   # Log in as root or become superuser: 

   su

   # Copy the ACL file into a predefined location:

   # Running the example on a Solaris platform:
   cp jaw.acl /opt/SUNWconn/jaw/etc/conf/jaw.acl
-or-
   # Running the example on a Windows platform:
   copy jaw.acl c:\PROGRA~1\SUNWconn\jaw\etc\conf\jaw.acl

   # Customize the ACL file by replacing "yourmanager" 
   # with the hostname of your manager.

