VMware Cloud Community
darkfriend
Contributor
Contributor

SNMP in ESX 4

I was using ESX 3.0 and ESX 3.5 and polling SNMP data as to the VMs current state.

I have running now ESX 4 and the SNMP polling is incomplete. I had to modify the /etc/snmp/snmpd.conf file just to get it to poll beyond the simplistic, but I still don't get everything.

I changed the file in such a way as to add the line "view systemview all included .1" in addition to the default .1.3.6.1.2.1.1 & .1.3.6.1.2.1.25.1.1. So I get what appears to be all MIB objects. It went from 32 objects to about 5500.

Now, the problem is the OID for VMware, that is in the MIB itself provided by VMware staff, is not returning any values. The OID is:

1.3.6.1.4.1.6876 - this is the one that has all the VM information. But my MIB walker skips from 2021 to 8072.

Has anyone been able to return the 6876 SNMP MIB objects in ESX 4?

0 Kudos
1 Reply
darkfriend
Contributor
Contributor

OK here's the answer then! VMware created their own SNMP agent, disabled it by default, and removed the .6876 OIDs from the snmpd agent built into the 3.5 version of the OS.

To turn on VMware SNMP OIDs (6876) in ESX 4.0

Turn off the built-in SNMP server (if you turned it on)

> service snmpd stop

Ensure that it never starts again (if you set it up to always start)

> chkconfig -level 2345 snmpd off

Download and install on Windows (or Linux) machine:

"VMware vSphere Command-Line Interface - Windows Installer"

Or 32-bit Linux Installer

Or 64-bit Linux Installer

Open vSphere CLI:

cd bin

C:\Program Files (x86)\VMware\VMware vSphere CLI\bin> vicfg-snmp.pl --server 192.168.1.100 --username root --password esx_password -c public (where public is the community string you choose now)

'chcp' is not recognized as an internal or external command, operable program or batch file.

Changing community list to: public...

Complete.

C:\Program Files (x86)\VMware\VMware vSphere CLI\bin> vicfg-snmp.pl --server 192.168.1.100 --username root --password esx_password --show

'chcp' is not recognized as an internal or external command, operable program or batch file.

Current SNMP agent settings:

Enabled : 0

UDP port : 161

Communities :

public

Notification targets :

C:\Program Files (x86)\VMware\VMware vSphere CLI\bin> vicfg-snmp.pl --server 192.168.1.100 --username root --password esx_password --enable

'chcp' is not recognized as an internal or external command, operable program or batch file.

Enabling agent...

Complete.

C:\Program Files (x86)\VMware\VMware vSphere CLI\bin> vicfg-snmp.pl --server 192.168.1.100 --username root --password esx_password --show

'chcp' is not recognized as an internal or external command, operable program or batch file.

Current SNMP agent settings:

Enabled : 1

UDP port : 161

Communities :

public

Notification targets :

Of course, I already have done the following at the console (also you can do in Infrastructure Client Security Profile):

esxcfg-firewall -o 161, udp,in,SNMP

And now you can get the 6876 OIDs, but not the other OIDs from the base OS SNMP agent (snmpd). Apparently you can run both simultaneously but not on the same port. But how many MIB walkers have configurable polling ports...configurable TRAP ports some, but not many for walking.

Most of this info is found in:

vSphere Basic System Administration (vsp_40_admin_guide.pdf) - page 52.

and vSphere Command-Line Interface Installation and Reference Guide (vsp_40_vcli.pdf)

0 Kudos