How to enable SNMP monitoring for VMware ESXi servers
(can be used with products like SolarWinds, Observium)
Install the VMware CLI utility
Launch the VMware CLI utility
Run the following commands...
vicfg-snmp.pl --server hostname --username root --password <password> –show
vicfg-snmp.pl --server hostname --username root --password <password> -communities <community string>
vicfg-snmp.pl --server hostname --username root --password >password> –enable
How to set the SNMP Location and System Contact
NOTE: This requires ESXi 5.1 and above. It will not work with ESXi 5.0 update 3.
Run the following command...
SSH into the server and run the following command.
esxcli system snmp set --syslocation=City,State --syscontact=Person2Contact
Enabling/Activating SNMP on ESXi 5.1 Host
Here is a quick tip:
SNMP it’s disabled by default on ESXi 5.1, and so you won’t be able to monitor your host through CA E-Health, Nagios, and stuff like that, so where are the steps to enable, configuring readonly comunities and setting firewall rules.
1’st of all, you’ll need VMWare VSphere CLI (Not Power CLI), and it’s available from VMware webSite for ESXi 4.x andESX 5.x. Download it and install. I’ll see that you’ll have a new item in your start menu:
Then you go to the bin (“cd bin”) directory that have all the Perl scripts that I’ll need, particularly the vicfg-snmp.pl.
You’ll be in C:\Program Files\VMware\VMware vSphere CLI\bin directory, righ? Nice… here are the commands:
- Show current config: vicfg-snmp.pl –server hostname –username username –password password –show
- Enable SNMP: vicfg-snmp.pl –server hostname –username username –password password –enable
- Reset SNMP Config to it’s defaults: vicfg-snmp.pl –server hostname –username username –password password–reset
- Set Readonly comunity: vicfg-snmp.pl –server hostname –username username –password password –communities community1,community2,…
Then I’ll have to allow SNMP Traffic though firewall, so …
- go to your VSphere Client, connecto to VCenter
- Select the host that you inform’d in the steps before
- Go to the Configuration tab, and click “Security Profile”
- Click on Properties
Then scroll down, find the “SNMP Server” option and click “Firewall” to allow connections from Any IP or to filter to just some IP addresses (for security).
Click OK. Make sure that SNMPd is running (you can click on “Options” as a shortcut to start the service and change the service activation policy.
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.