74

To start SNMP on Mac OS X 10.4 client computers by modifying the hostconfig file:

Mac OS X 10.4 client systems already have the SNMPSERVER:=-NO-line in their hostconfig file by default.

1Open the /etc/hostconfig file.

2Locate the line:

SNMPSERVER=-NO-

3Change NO to YES.

4Save the file.

Note: Systems running Mac OS X Server version 10.3 or earlier will need to have the line added.

Changing the SNMPSERVER line in the hostconfig file, causes snmpd to be executed during system startup, with no options, as dictated by the /System/Library/ StartupItems/SNMP/SNMP file. For further instruction on editing configuration files, including important precautionary statements, see technical document 106619, “Mac OS X Server: How to Edit Configuration Files”.

To start the snmp agent manually:

$ /usr/sbin/snmpd

Configuring SNMP

The configuration (conf) file for snmpd is typically in the /usr/share/snmp/ folder, and is named snmpd.conf or snmpd.local.conf. If you have an environment variable SNMPCONF, snmpd will read any files named snmpd.conf and snmpd.local.conf in these folders. The SNMP agent can be started with a -cflag to indicate other conf files. See the snmpd man page for more information about which conf files can be used.

Configuration files can be created and installed more easily using the included script /usr/bin/snmpconf. As root, use this script with the -iflag to install the file in the /usr/share/snmp/ folder. Otherwise, the default location for the file to be written is the user's home directory (~/). Only root has write permission for /usr/share/snmp/.

Because snmpd reads its conf files at startup, changes to the conf files require that the process be stopped and restarted. To do this, you must identify the process id.

To identify the process id:

$ ps aux grep snmpd

To stop snmpd :

$ kill <pid>

Once snmpd is stopped, you can customize the snmpd.conf file as needed.

Chapter 6 Setting Network Preferences

Page 74
Image 74
Apple Mac OS X Server Configuring Snmp, To start the snmp agent manually, To identify the process id, To stop snmpd