How to configure SNMP traps for ESXi/ESX 3.5, 4.x, and ESXi 5.x hosts
Monitoring the health of older ESX/ESXi systems can be implemented by enabling SNMP and setting up SNMP traps to track performance events. Learn how to set it up.
Note: This article assumes, that you have access to Remote CLI or vSphere CLI. Also, the SNMP firewall port 161 is open on ESX 5.0 by default, and earlier versions did not include the firewall.
-
Run Remote CLI for ESXi 3.5 or vSphere CLI for ESXi 4.x+ and navigate to the directory where
vicfg-snmp.pl
is stored. By default it's located in:C:\Program Files\VMware\VMware vSphere CLI\bin
-
Run the following command:
vicfg-snmp.pl --server <HOSTNAME> --username <USERNAME> --password <PASSWORD> --show
Side-note: You can always use
vicfg-snmp.pl --help
command for the full list of options. -
Specify the SNMP communities and SNMP Trap targets:
vicfg-snmp.pl --server <HOSTNAME> --username <USERNAME> --password <PASSWORD> -t <HOSTNAME@PORT> -c <COMMUNITY>
Side-note: for ESXi 3.5 you may need to use a little bit different syntax:
vicfg-snmp.pl --server <HOSTNAME> --username <USERNAME> --password <PASSWORD> -t <HOSTNAME@PORT/COMMUNITY>
Example: Let's say we are trying to send SNMP traps from the host host.example.com to port 162 on target.example.com, using the public community. In such a case, the command should look as below:
vicfg-snmp.pl --server host.example.com --username root --password password -t target.example.com@162 -c public
or like this:
vicfg-snmp.pl --server host.example.com --username root --password password -t target.example.com@162/public
depending on the ESX/ESXi version you have configured on your host.
-
Now, to enable SNMP service use this command:
vicfg-snmp.pl --server <HOSTNAME> --username <USERNAME> --password <PASSWORD> --enable
-
Finally, send a test
warmStart
trap to ensure that everything works correctly:vicfg-snmp.pl --server <HOSTNAME> --username <USERNAME> --password <PASSWORD> --test
It is worth noting that all changes to the SNMP configuration are stored on the ESXi/ESX host in /etc/vmware/snmp.xml
, and the ESX/ESXi SNMP agent log messages are saved in /var/log/syslog.log
.
Remember that you can always remove --password <PASSWORD>
element from the commands shown above, to prevent displaying user passwords in plain text. You will be prompted to enter the password instead, and the entry will remain hidden. Safety first!
- [26.03.2020]Enabling SNMP on a Windows machine
Despite the fact, that Microsoft depreciated SNMP for the Windows Server 2012 onwards, it is sometimes necessary to enable SNMP in this system. Below you will find a simple walkthrough how to do it.
- [15.12.2019] How To Monitor Any Device With SNMP
Here's an SNMP primer for any junior person on your IT team - they may actually be younger than the protocol itself. After all these years, for most devices that you need to monitor, starting with SNMP before you try anything else is a safe bet.
- [08.02.2019]SNMP monitoring features in NetCrunch
There is a lot of the ways of how we can monitor the condition, performance and availability of the devices with available SNMP service running on them. Learn how to gather the counters and states from various devices with the tools available in the NetCrunch.
- [24.01.2019]Monitoring complex instances of the SNMP counters
Sometimes the SNMP counter identifier is placed in a different table than a counter. NetCrunch 10.5 introduced a new way of monitoring such complex instances.
- [17.08.2018]Printer monitoring in NetCrunch
Use NetCrunch printer sensor to get information about the status of the printer and the ink level.
- [25.06.2018]How to start monitoring of new SNMP device with NetCrunch
Is your device monitorable? Read the article to learn how to approach configuring monitoring for a new device.
- [05.04.2017] Using NetCrunch to track Port Security status of Cisco switches.
Cisco port security is a great feature to make your network safer. Learn how to configure NetCrunch to display the status of Cisco Port Security on the switch interfaces.
- [21.04.2016] Monitoring External Events in NetCrunch
Using multiple tools to catch every SNMP trap or SYSLOG message might be hard. NetCrunch simplifies this task with the External Events window and lets you fine-tune your log and SNMP monitoring:
- [07.04.2016] Optimizing SNMP Monitoring in NetCrunch
This article will explain reasons for most common SNMP monitoring problems, describing ways to fine-tune SNMP monitoring settings in NetCrunch. Learn how to monitor without stressing your SNMP device.
- [****] How to receive events from VMware in NetCrunch
One of the ways to receive information in NetCrunch about events from VMware are SNMP traps. In the following article, we will show you how to configure them.