VMware Cloud Community
hakach
Contributor
Contributor

Enabling the SNMP ESX 4.1

Hi smart people:

I have followed the guidelines of enabling snmp VMWare ESX Server 4. I edited the /etc/vmware/snmp.xml and /etc/snmp/snmpd.conf files. I defined the port as 171 in /etc/vmware/snmp.xml file and set the targets to 127.0.0.1@162/cstring.  I also add the two lines in /etc/snmp/snmpd.conf

view systemview included .1.3.6.1.4.1.6876
proxy -v 1 -c cstring 127.0.0.1:171 .1.3.6.1.4.1.6876

I restarted the all the services mgmt-vmware, snmpd and enable esxcfg-firewall. When I type this line:

snmpwalk -v1 -c cstring localhost  .1.3.6.1.4.1.6876 | grep 6876.1

I have no response from localost

But when I tried to adding the port in, I got the result.

snmpwalk -v1 -c cstring localhost:171.1.3.6.1.4.1.6876 | grep 6876.1

I am trying to enable to snmp so I can use the monitoring tools to poll data from the host. Please help me in any way as I desparetly need to get the snmp working in a correct manner.

Thanks in advance.

FV

0 Kudos
10 Replies
tpennington
Contributor
Contributor

Your snmpd.conf file probably contains a lot of BS stuff that is shipped with the Net-SNMP agent.  Get to a bare bones snmpd.conf file:

# Sample snmpd.conf containing VMware MIB module entries.

# This is a simple snmpd.conf that may help you test SNMP.
# It is not recommended for production use. Consult the
# snmpd.conf(5) man pages to set up a secure installation.

syscontact root@localhost (edit snmpd.conf)
syslocation room1 (edit snmpd.conf)
rocommunity public

proxy -v 1 -c public udp:127.0.0.1:171 .1.3.6.1.4.1.6876
proxy -v 2c -c public udp:127.0.0.1:171 .1.3.6.1.4.1.6876

Don't forget to restart the two agents and you should be good to go.

0 Kudos
bulletprooffool
Champion
Champion

are you using ESX, or ESXi?

If you are using ESXi, do you have the vendor provided image?

for setup instructions, have a look at :

http://www.get-virtual.info/2011/02/02/monitoring-hp-esxi-host-hardware/

One day I will virtualise myself . . .
0 Kudos
hakach
Contributor
Contributor

Thanks for the reply. But I am running the ESX 4.1 not ESX 4.0. Thus there is rocommunity public on the snmpd.conf file. I did add the two lines for proxy settings at the bottom of the snmpd.conf file. Still nto working.

0 Kudos
hakach
Contributor
Contributor

I am running ESX 4.1  I did not use the CLI to configure the SNMP. I just login to host and then edit the conf file directly. What I am trying to do is to get Solarwinds to montior the host. I previously had two ESX 4.0 host successfully added to the Orion for monitoring. But this time we  use ESX 4.1 for two new hosts and I was not able to get it working. Any help will be much appreicated. Thanks.

0 Kudos
tpennington
Contributor
Contributor

Couple of questions:

1. Did you start the Net-SNMP agent?

     -   snmpd service start

2.  Can you just do a plain snmpwalk without trying to query the VMWare portions?

Tom

0 Kudos
hakach
Contributor
Contributor

I have started the snmpd service already via the host. I have tried to do snmpwalk -v -2c cstring IP address .1 and it didn't return anything. However if I put the port number at the end of the IP address. It will return result. Why is that?

0 Kudos
tpennington
Contributor
Contributor

most likely its because you don't have the Net-SNMP agent configured correctly.

I sent you previously a bare bones version of the snmpd.conf file, which works for me.  After you make the changes, you have to restart the Net-SNMP agent and you shoudl be good to go.

BTW, drop the -v 2c from your snmpwalk, let the tool decide what version decide what version of v1/2c to use.

Tom

0 Kudos
hakach
Contributor
Contributor

Hi Tom,

           The bare bone version of snmp.conf file you provided is for Version 4.0 not for Version 4.1. What version you are running on your side?

FV

0 Kudos
tpennington
Contributor
Contributor

actually that snmpd.conf file I sent is generic and not specific to v4.0 or v4.1, it should work.

0 Kudos
venkyVM
Enthusiast
Enthusiast

Please issue the folllowing commands from your Remote CLI one by one. Also you could change the port number in step 2 :::

vicfg-snmp -server <hostname> --username <username> --password <password> -c public

vicfg-snmp -server <hostname> --username <username> --password  <password>  -t <IP_of_trap_listener>@162/private

vicfg-snmp -server <hostname>  --username <username> --password <password> -E

0 Kudos