Rotten mud: ESXI enables the SNMP service, and esxi enables snmp

Source: Internet
Author: User
Tags snmp solarwinds orion

Rotten mud: ESXI enables the SNMP service, and esxi enables snmp

This article was sponsored by Xiuyi linfeng and first launched in the dark world.

To monitor ESXI, we plan to monitor it through snmp, which is relatively simple. However, to use SNMP for monitoring, you must enable the esxi snmp service. The methods for enabling SNMP vary depending on the version number of ESXI.

Let's first introduce how to enable ESXI5.0. Before enabling it, we should first use the tool provided by ESXI for detection. This tool is VMware vSphere CLI, which needs to be downloaded and installed separately.

Here I have downloaded and installed the VMware vSphere CLI tool, which we primarily use to provide a vicfg-snmp.pl script. Under the system command line, switch to the installation directory of the tool. As follows:

Cd "C: \ Program Files (x86) \ VMware vSphere CLI \ bin"

Then, run the following command to perform Detection. As follows:

Vicfg-snmp.pl -- server 192.168.1.247 -- username root -- password lianzhou! @ # -- Show

The result is as follows:

Note the yellow part marked in the figure: Enabled: 0. ESXI5.0 does not currently enable the SNMP service.

Note that the vicfg-snmp.pl is used as follows:

Vicfg-snmp.pl -- server [ESXi Host IP] -- username [root Account] -- password [root Account password] -- show

The following describes how to Enable SNMP. log on to ESXI5.0 through SSH and edit the/etc/vmware/snmp. xml file. As follows:

Vi/etc/vmware/snmp. xml

<Config> <snmpSettings> <enable> true </enable> <communities> public </communities> <targets> 192.168.1.247 @ 161 public </targets> </snmpSettings> </config>

Note the yellow part marked in the figure. "True" indicates that the SNMP service is enabled, "public" indicates the group name of snmp, and "192.168.1.247 @ 161" indicates that the snmp uses port 161, which indicates the management IP address of 192.168.1.247esxi.

After the preceding modification, the SNMP service does not take effect immediately. You must restart the system to make the modification take effect. To restart the service, run the following command:

/Sbin/services. sh restart

Note that after ESXI5.0 executes this command, SSH and vsphere connections are disconnected.

After the restart, we use the vicfg-snmp.pl script again for detection, as shown below:

We can see the yellow part: Enabled: 1. ESXI5.0 has enabled the SNMP service.

Now we can monitor ESXI5.0 through other monitoring software. Here I use nagios for monitoring, as follows:

Maybe you will say, why can't you simply enable the SNMP service through vsphere?

This is where ESXI5.0 is different from ESXI5.1 and later versions. Let's take a look at ESXI5.0, log on to Vsphere, configure-software, as shown below:

We can see that there is no SNMP service in the "service" option, so there is no way to enable it.

However, in ESXI5.1 and later versions, we log on to vsphere to view the details as follows:

We can see that ESXI5.1 has integrated the snmp service. However, an error is reported when I Enable SNMP in vsphere. Later, I started SNMP using ESXI5.0 and directly modified the/etc/vmware/snmp. xml file. After the service is restarted, it can be enabled in vsphere as follows:

We can see that ESXI5.1's SNMP service has been started properly.

Note that ESXI5.1 will not disconnect the SSH connection but the vsphere connection will be disconnected when the/sbin/services. sh restart command is used to restart the service. This is also different from ESXI5.0.

Now we can monitor ESXI5.1 through nagios, as shown below:

The above describes how to enable the SNMP service in ESXI.


How does one enable the snmp service on the ESXi41 host, and how does SolarWinds Orion add an Esxi host to monitor its status?

What is your NPM version? Before 10.0, it seems that the support for virtual machines is not very good. 10.4 dedicated virtual machine menu
 
When the vm snmp service is enabled, "HostServiceSystemStart" of the "serviceSystem" object fails to be called on ESXi.

Environment: esxi 5
Use ssh to log on to the exsi host.
Vi/etc/vmware/snmp. xml
Find the <enable> false </enable> string and change it to <enable> true </enable>.
Find the <communities> </communities> string and change it to <communities> public </communities>.
Save
Restart exsi.


Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.