link
Configurando o SNMP Traps para ESXi / ESX 3.5, 4.xe 5.0
Detalhes
Para gerar traps de máquina virtual e ambientais a partir dos hosts ESX / ESXi 3.5, 4.xe 5.0, é necessário configurar e ativar o agente SNMP incorporado. Você não pode usar o agente baseado em Net-SNMP para gerar essas interceptações, embora possa receber transações GET e gerar outros tipos de interceptações.
Isso representa uma alteração no comportamento do ESX 3.0.x, no qual o arquivo de configuração do agente baseado em Net-SNMP controlava a geração de interceptações da máquina virtual. Para obter mais informações, consulte Configurando o SNMP em um host ESX 3.0.x (1008186).
Solução
Use o comando vicfg-snmp.pl na CLI Remota ou na vSphere CLI para ativar o agente SNMP e configurar os destinos das interceptações. Cada vez que você especifica um alvo com o comando vicfg-snmp.pl, as configurações especificadas sobrescrevem todas as configurações especificadas anteriormente. Para especificar vários destinos, especifique-os em um único comando, separados por vírgulas.
Para ativar e configurar traps SNMP:
Notas:
Prior to ESXi 5, ESXi did not include a firewall
Ensure that the SNMP protocol is open in the ESX firewall. For more information, see:
ESX 4.x: 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 the ESXi Firewall Configuration section of the ESXi and vCenter Server 5.0 Documentation.
To implement these steps:
ESX/ESXi 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.
ESX/ESXi 4.x and ESXi 5.0: Run this procedure using vSphere CLI, not vSphere PowerCLI.
For more information, see the vSphere Command-Line Interface Documentation.
If you have a My VMware profile, you can download vSphere CLI from:
vSphere 4.x – http://www.vmware.com/download/download.do?downloadGroup=VCLI41
vSphere 5.0 – http://www.vmware.com/download/download.do?downloadGroup=VCLI50
Note: If you do not have a My VMware profile, you must create one. For more information, see Creating a My VMware profile (2007005).
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 the vicfg-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/community
Note: In ESX 4.x or ESXi 5.0, you may need to use the -c community flag.
Example: To send SNMP traps from the host host.example.com, to port 162 on target.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/public
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 a warmStart trap.