Sun Java System Web Server 6.1 SP11 Administrator's Guide

Enabling and Starting the SNMP Master Agent

Master agent operation is defined in an agent configuration file named CONFIG. You can edit the CONFIG file using the Server Manager, or you can edit the file manually. You must install the master SNMP agent before you can enable the SNMP subagent.

If you get a bind error similar to “System Error: Could not bind to port,” when restarting the master agent, use ps -ef | grep snmp to check if magt is running. If it is running, use the command kill -9 pid to end the process. The CGIs for SNMP will then start working again.

This section includes the following topics:

Starting the Master Agent on Another Port

The Administration Interface will not start the SNMP master agent on ports other than 161. However, you can manually start the master agent on another port using the following steps

ProcedureTo manually start the master agent on another port

  1. Edit /server_root/plugins/snmp/magt/CONFIG to specify the desired port.

  2. Run the start script as follows:

    cd /server_root/https-admserv

    ./start -shell /server_root/plugins/snmp/magt/magt

    /server_root/plugins/snmp/magt/CONFIG

    /server_root/plugins/snmp/magt/INIT

    The master agent will then start on the desired port. However, the user interface will be able to detect that the master agent is running.

Manually Configuring the SNMP Master Agent

To configure the master SNMP agent manually

ProcedureTo configure the master SNMP agent manually

  1. Log in as superuser.

  2. Check to see if there is an SNMP daemon (snmpd) running on port 161.

    If an SNMP daemon is running, make sure you know how to restart it and which MIB trees it supports. Kill its process.

  3. Edit the CONFIG file located in plugins/snmp/magt in the server root directory.

  4. (Optional) Define sysContact and sysLocation variables in the CONFIG file.

Editing the Master Agent CONFIG File

The CONFIG file defines the community and the manager that master agent will work with. The manager value should be a valid system name or an IP address.

Here is an example of a basic CONFIG file:

COMMUNITY          public
                        ALLOW ALL OPERATIONS
MANAGER            manager_station_name 
                   SEND ALL TRAPS TO PORT 162 
                    WITH COMMUNITY public

Defining sysContact and sysLocation Variables

You can edit the CONFIG file to add initial values for sysContact and sysLocation, which specify the sysContact and sysLocation MIB-II variables. The strings for sysContact and sysLocation in this example are enclosed in quotes. Any string that contains spaces, line breaks, and tabs must be enclosed in quotes. You can also specify the value in hexadecimal notation.

Here is an example of a CONFIG file with sysContract and sysLocation variables defined:

COMMUNITY          public
                        ALLOW ALL OPERATIONS
MANAGER            nms2                   
                   SEND ALL TRAPS TO PORT 162
                   WITH COMMUNITY public

INITIAL            sysLocation “Server room
501 East Middlefield Road
Mountain View, CA 94043USA”

INITIAL            sysContact “John Doe
email: jdoe@netscape.com”

Configuring the SNMP Subagent

You can configure the SNMP subagent to monitor your server.

To configure the SNMP subagent, perform the following steps

ProcedureTo configure the SNMP subagent

  1. From the Administration Server, select the server instance and click Manage.

  2. Select the Monitor tab.

  3. Select SNMP Subagent Configuration.

  4. (UNIX only) Enter the name and domain of the server in the Master Host field.

  5. Enter the Description of the server, including operating system information.

  6. Enter the Organization responsible for the server.

  7. Enter the absolute path for the server in the Location field.

  8. Enter the name of the person responsible for the server and the person’s contact information in the Contact field.

  9. Select On to Enable the SNMP Statistics Collection.

  10. Click OK.

  11. Click Apply.

  12. Select Apply Changes to restart your server for changes to take effect.

Starting the SNMP Master Agent

After you have installed the SNMP master agent, you can start it manually or by using the Administration Server.

Manually Starting the SNMP Master Agent

To start the master agent manually, enter the following at the command prompt:

# magt CONFIG INIT&

The INIT file is a nonvolatile file that contains information from the MIB-II system group, including system location and contact information. If INIT does not already exist, starting the master agent for the first time will create it. An invalid manager name in the CONFIG file will cause the master agent start-up to fail.

To start a master agent on a nonstandard port, use one of two methods:

Method one: In the CONFIG file, specify a transport mapping for each interface over which the master agent listens for SNMP requests from managers. Transport mappings allow the master agent to accept connections at the standard port and at a nonstandard port. The master agent can also accept SNMP traffic at a nonstandard port. The maximum number of concurrent SNMP is limited by your target system’s limits on the number of open sockets or file descriptors per process. Here is an example of a transport mapping entry:

TRANSPORT extraordinary SNMP OVER UDP SOCKET AT PORT 11161

After editing the CONFIG file manually, you should start the master agent manually by typing the following at the command prompt:

# magt CONFIG INIT&

Method two: Edit the /etc/services file to allow the master agent to accept connections at the standard port as well as a nonstandard port.

Starting the SNMP Master Agent Using the Administration Server

To start the SNMP master agent using the Administration Server, perform the following steps

ProcedureTo start the SNMP master agent

  1. Log in to the Administration Server.

  2. In the Server Manager, choose the SNMP Master Agent Control page from the Global Settings tab. The SNMP Master Agent Control page appears.

  3. Click Start.

    You can also stop and restart the SNMP master agent from the SNMP Master Agent Control page.