上海哲涛网络科技有限公司欢迎您,联系电话:021-52765253,QQ:1055532045
首页 >> 技术文章 >> SNMP配置 >> 全文
VMWare ESX SNMP配置
发布日期 2009-12-3 17:40:46 点击 785 次
Installing the ESX Server SNMP Agents

The default master snmpd daemon and the VMware-specific vmware-snmpd daemon are automatically installed when you install ESX Server.

If you want to see ESX Server MIB items, then you must configure the ESX Server SNMP subagent (vmware-snmpd). If you aren't interested in ESX Server-specific SNMP items, then you do not configure vmware-snmpd.

Configure the ESX Server SNMP subagent after you have installed and configured ESX Server through the VMware Management Interface. You can configure the ESX Server SNMP subagent by using a script or through the VMware Management Interface.

Depending on your preference, complete one of the following:

  • Configuring the ESX Server Agent through the VMware Management Interface
  • Configuring the ESX Server Agent from the Service Console

Then, configure your SNMP trap destinations. See Configuring SNMP Trap Destinations.

Configuring the ESX Server Agent

Configuring the ESX Server Agent through the VMware Management Interface

To configure the ESX Server SNMP subagent, complete the following steps.

  1. Log in to the VMware Management Interface as root.

    The Status Monitor page appears.

  2. Click the Options tab.

    The Options page appears.

  3. Click SNMP Configuration.

    The options in this page act as toggle between two choices. To change an option, click the link.

  4. Make sure the paths to the snmpd daemon startup script and its configuration file are correct. If either of these is incorrect, then click Change and type the correct path.
  5. Make sure that the status of the master SNMP agent is Running.
  6. If you're interested in VMware-specific SNMP MIBs, then make sure the status and VMware traps of the VMware SNMP subagent is Enabled.
  7. Optional: If you want the master SNMP agent (and the VMware SNMP subagent, if its status is Enabled) to start automatically upon booting, then make sure the Startup Type is Automatic.
  8. Configure your traps. See Configuring SNMP Trap Destinations.

Configuring the ESX Server Agent from the Service Console

Use the snmpsetup.sh script to configure the ESX Server SNMP subagent to work with the default snmpd or with a third party management application.

Note: If you're not interested in VMware-specific SNMP modules, then you shouldn't run this script. This script sets up a connection, between the master snmpd daemon and the vmware-snmpd daemon, which enables access to ESX Server MIB items.

Caution: Do not use the snmpsetup.sh script to set up third-party SNMP daemons.

Using the VMware SNMP Daemon with the Default SNMP Daemon

  1. Log into the service console as the root user and run the script as follows.
  2. Type the following

    snmpsetup.sh default

    The default option sets up the snmpd.conf file for the default master SNMP daemon. This connects snmpd to vmware-snmpd, enabling you to query for ESX Server MIB items.

  3. The script then starts both the master and subagent SNMP daemons.

Using the VMware SNMP Daemon with Third Party Management Applications

  1. Install your third party management application. Refer to your management application documentation and the ESX Server release notes at www.vmware.com/support/esx21/doc/releasenotes_esx21.html.
  2. Log into the service console as the root user and run the script as follows.
  3. Type the following:

    snmpsetup.sh connect

    The connect option configures exporting ESX Server MIB items through your third party SNMP daemon. You should use this option if you want to enable the export of ESX Server MIB items after installing the third party management application.

    The script connects the third party application snmpd daemon with the vmware-snmpd subagent daemon.

  4. The script then starts both daemons.

Starting the SNMP Agents Automatically

You can set the master and subagent SNMP daemons to start automatically whenever ESX Server boots by logging in as the root user in the service console and running the chkconfig commands:

chkconfig snmpd on
chkconfig vmware-snmpd on

The first command enables starting the master SNMP daemon (either the default SNMP daemon shipped with ESX Server or your third party management application SNMP daemon) on boot.

The second command enables starting the subagent vmware-snmpd daemon on boot.

Note: The master snmpd daemon can run by itself or together with the subagent vmware-snmpd daemon. However, the subagent daemon cannot run alone.

Starting the SNMP Agents Manually

If you need to start the SNMP agents manually, log in as root in the service console and run the following commands:

/etc/rc.d/init.d/snmpd start
/etc/rc.d/init.d/vmware-snmpd start

The first command starts the master SNMP daemon (either the default SNMP daemon shipped with ESX Server or your third party management application SNMP daemon).

The second command starts the subagent vmware-snmpd daemon.

By default, the agents start and run as background processes.

Note: As described previously, the master snmpd daemon can run by itself or together with the subagent vmware-snmpd daemon. However, the subagent daemon cannot run alone.

Configuring SNMP

Configuring SNMP Trap Destinations

Currently, you cannot configure trap destinations through the VMware Management Interface. To configure traps, log into the service console as the root user and modify the /etc/snmp/snmpd.conf file as follows:

  1. Using a text editor, add the following line, replacing mercury.solar.com with the name of the host on your network that will receive traps. You may repeat this line to specify more than one destination.

    trapsink mercury.solar.com

  2. Add the following line, replacing public with a community name of your choice. There can only be one instance of this line.

    trapcommunity public

  3. Save your changes.

Configuring SNMP Management Client Software

To use your SNMP management software with the ESX Server agent, take the normal steps needed to accomplish the following:

  • In your management software, specify the ESX Server machine as an SNMP-based managed device.
  • Set up appropriate community names in the management software. These must correspond to the values set in the master SNMP agent's configuration file, for example, rocommunity, trapcommunity and trapsink.
  • Load the ESX Server MIBs into the management software so you can view the symbolic names for the ESX Server variables. You can find the MIB files on VMware ESX Server, in the /usr/lib/vmware/snmp/mibs directory.