Details
This represents a change in behavior from ESX 3.0.x, in which the configuration file for the Net-SNMP-based agent controlled the generation of virtual machine traps. For more information, see Configuring SNMP on an ESX 3.0.x host (1008186).
In ESXi 5.1, SNMP is configured using esxcli rather than vicfg-snmp. In addition, you have the option to configure SNMP v3 traps and informs as well as the SNMP v1 and v2c traps available with previous versions of ESXi.
For instructions on:
- Configuring SNMP v1 and v2c traps, see Configure ESXi for SNMP v1 and v2c in the vSphere Monitoring and Performance Guide.
- Configuring SNMP v3, see Configuring and troubleshooting SNMPv3 informs in vSphere 5.1 (2033343).
Solution
vicfg-snmp.pl
command from the Remote CLI or vSphere CLI to enable the SNMP agent and configure trap destinations. Each time you specify a target with the vicfg-snmp.pl
command, the settings you specify overwrite all previously specified settings. To specify multiple targets, specify them in a single command, separated by commas.To enable and configure SNMP traps:
Notes:
- Prior to ESXi 5.0, ESXi did not include a firewall.
- Ensure that the SNMP protocol is open in the ESXi/ESX firewall. For more information, see:
- ESX 4.x: Open an SSH session to the host and run the command
esxcfg-firewall -e snmpd
. See Working with firewall rules in ESX 4.x (1021779). - ESXi 5.0: By default, the SNMP firewall port 161 is open. If it is not, see ESXi Firewall Configuration in the ESXi and vCenter Server 5.0 Documentation.
- ESX 4.x: Open an SSH session to the host and run the command
- To implement these steps:
- ESXi/ESX 3.5: Use the Remote CLI. For more information, see the Remote Command-Line Interface Documentation. You can download the VMware Infrastructure Remote CLI from the VMware Download Center.
- ESXi/ESX 4.x and ESXi 5.0: Run this procedure using the vSphere CLI, not the vSphere PowerCLI.
For more information, see the vSphere Command-Line Interface Documentation.
If you have a My VMware profile, you can download the vSphere CLI from:
vSphere 4.x: https://my.vmware.com/group/vmware/details?downloadGroup=VCLI41&productId=230
vSphere 5.0: https://my.vmware.com/group/vmware/details?downloadGroup=VCLI50U1&productId=268
Note: If you do not have a My VMware profile, you must create one. For more information, see Creating a My VMware profile (2007005).
- ESXi/ESX 3.5: Use the Remote CLI. For more information, see the Remote Command-Line Interface Documentation. You can download the VMware Infrastructure Remote CLI from the VMware Download Center.
- Navigate to the directory where
vicfg-snmp.pl
is stored. By default,vicfg-snmp.pl
is located in:C:\Program Files\VMware\VMware vSphere CLI\bin
- Run this command:
vicfg-snmp.pl --server hostname --username username --password password --show
Note: Run thevicfg-snmp.pl --help
command for a full list of options. - Specify the communities and trap targets with this command:
vicfg-snmp.pl --server hostname --username username --password password -t hostname@port -c community
Note: In ESX 3.5, you may need to usevicfg-snmp.pl --server hostname --username username --password password -t hostname@port/community
.
Example: To send SNMP traps from the hosthost.example.com
to port 162 ontarget.example.com
, using the public community, use this command:vicfg-snmp.pl --server host.example.com --username root --password password -t target.example.com@162 -c public
For ESXi 5.0:vicfg-snmp.pl --server host.example.com --username root --password password -t target.example.com@162/community
Note: To prevent clear text display of the user password, remove the--password password
portion. You are then prompted to enter the password, and the entry is hidden. - To enable the SNMP service, run this command:
vicfg-snmp.pl --server hostname --username username --password password --enable
Note: To verify SNMP settings, run this command:vicfg-snmp.pl --server hostname --username username --password password --show
- (Optional) To send a test trap to verify that the agent is configured correctly, run this command:
vicfg-snmp.pl --server hostname --username username --password password --test
The test trap generated is awarmStart
trap.
Note: Changes to the SNMP configuration are stored on the ESXi/ESX host in/etc/vmware/snmp.xml
.
Source:-
No comments:
Post a Comment