This is our first post on VMWARE Vsphere.
Today, we will discuss how to install SNMP on Esxi 5.1. To install SNMP on Esxi, we need to login to the Shell of Esxi. Esxi is a baremetal hypervisor, so we need to connect to the shell directly first. Then we run some commands to install SNMP.
Enabling Local ESXi Shell Access
You can enable the ESXi Shell from the direct console or from the vSphere Client.
If you have access to the direct console, you can enable the ESXi Shell from there.
To enable the ESXi Shell in the direct console
1. At the direct console of the ESXi host, press F2 and provide credentials when prompted.
2. Scroll to Troubleshooting Options and press Enter.
3. Choose Enable ESXi Shell and press Enter.
On the left, Enable ESXi Shell changes to Disable ESXi Shell. On the right, ESXi Shell is Disabled changes to ESXi Shell is Enabled.
4. Press Esc until you return to the main direct console screen.
If you do not have access to the direct console, you can enable the ESXi Shell from the vSphere Client.
To enable the local or remote ESXi Shell from the vSphere Client
1. Select the host, click the Configuration tab, and click Security Profile in the Software panel.
2. In the Services section, click Properties.
3. Select ESXi Shell and click Options.
4. Change the ESXi Shell options.
To change the Startup policy across reboots, click Start and stop with host and reboot the host.
To temporarily start or stop the service, click the Start or Stop button.
5. Click OK.
Now, the esxi shel is enabled. We can use ssh, I mean putty or any other ssh client as well to configure SNMP.
Using the Local ESXi Shell
After you enable the ESXi Shell in the direct console, you can use it from main direct console screen or remotely through a serial port.
To use the local ESXi Shell
1. At the main direct console screen, press Alt-F1 to open a virtual console window to the host.
2. Provide credentials when prompted.When you type the password, characters are not displayed on the console.
3. Enter shell commands to perform management tasks.
4. To log out, type exit in the shell.
5. To return to the direct console, type Alt-F2.
Now, we are ready to configure SNMP on Esxi.
# Configure SNMP Communities
Type esxcli system snmp set –communities com1.
Replace com1 with the community name you want to set. Each time you specify a community with this command, the settings you specify overwrite the previous configuration. To specify multiple communities, separate the community names with a comma.
For example, to set the communities public and internal on a host, you might type esxcli system snmp set -communities public,internal.
#Configure the SNMP Agent to Send SNMP v1 or v2c Traps
1. Type esxcli system snmp set –targets target_address@port/community.
Replace target_address, port, and community with the address of the target system, the port number to send the traps to, and the community name, respectively. Each time you specify a target with this command, the settings you specify overwrite all previously specified settings. To specify multiple targets, separate them with a comma.
For example, to send SNMP traps from the host host.example.com to port 162 on target.example.com using the public community, type esxcli system snmp set –targets target.example.com@162/public.
2. (Optional) If the SNMP agent is not enabled, enable it by typing esxcli system snmp set –enable true.
3. (Optional) Send a test trap to verify that the agent is configured correctly by typing esxcli system snmp test.
The agent sends a warmStart trap to the configured target.
When you configure the ESXi SNMP agent for SNMP v3, the agent supports sending informs as well as traps. SNMP v3 also provides stronger security than v1 or v2c, including key authentication and encryption.
# Configure the SNMP Agent for GETs
1. Type esxcli system snmp set –port port.
Replace port with the port for the SNMP agent to use for listening for polling requests.
2. (Optional) If the SNMP agent is not enabled, enable it by typing esxcli system snmp set –enable true.