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
Manually Configuring the SNMP Master Agent
Editing the Master Agent CONFIG File
Defining sysContact and sysLocation Variables
Configuring the SNMP Master Agent
Starting the SNMP Master Agent
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
Edit /server_root/plugins/snmp/magt/CONFIG to specify the desired port.
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.
To configure the master SNMP agent manually
Log in as superuser.
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.
Edit the CONFIG file located in plugins/snmp/magt in the server root directory.
(Optional) Define sysContact and sysLocation variables in the 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
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”
You can configure the SNMP subagent to monitor your server.
To configure the SNMP subagent, perform the following steps
From the Administration Server, select the server instance and click Manage.
Select the Monitor tab.
Select SNMP Subagent Configuration.
(UNIX only) Enter the name and domain of the server in the Master Host field.
Enter the Description of the server, including operating system information.
Enter the Organization responsible for the server.
Enter the absolute path for the server in the Location field.
Enter the name of the person responsible for the server and the person’s contact information in the Contact field.
Select On to Enable the SNMP Statistics Collection.
Click OK.
Click Apply.
Select Apply Changes to restart your server for changes to take effect.
After you have installed the SNMP master agent, you can start it manually or by using the Administration Server.
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.
To start the SNMP master agent using the Administration Server, perform the following steps