Monitor VMware ESXi?

Post general support questions here that do not specifically fall into the Linux or Windows categories.

Moderators: Developers, Moderators

User avatar
bmarofsky
Posts: 49
Joined: Tue Aug 28, 2007 8:35 am
Location: Southington, CT

Post by bmarofsky »

Did you get these to work?

I am trying them on a ESXi4 box with SNMP enabled and get these errors:

01/04/2010 09:13:21 AM - CMDPHP: Poller[0] Host[34] DS[545] WARNING: Result from CMD not valid. Partial Result: U
01/04/2010 09:13:21 AM - CMDPHP: Poller[0] Host[34] DS[533] WARNING: Result from SNMP not valid. Partial Result: U

SNMPWALK results in this:

C:\net-snmp>snmpwalk -v1 -c community name server name
SNMPv2-MIB::sysDescr.0 = STRING: VMware ESX 4.0.0 build-208167 VMware, Inc. x86_
64
SNMPv2-MIB::sysObjectID.0 = OID: SNMPv2-SMI::enterprises.6876.4.1
DISMAN-EVENT-MIB::sysUpTimeInstance = Timeticks: (103317237) 11 days, 22:59:32.3
7
SNMPv2-MIB::sysContact.0 = STRING: not set
SNMPv2-MIB::sysName.0 = STRING: servername
SNMPv2-MIB::sysLocation.0 = STRING: not set
SNMPv2-MIB::sysServices.0 = INTEGER: 72
SNMPv2-MIB::sysORLastChange.0 = Timeticks: (0) 0:00:00.00
SNMPv2-MIB::sysORID.1 = OID: SNMPv2-MIB::snmpMIB
SNMPv2-MIB::sysORID.2 = OID: IF-MIB::ifMIB
SNMPv2-MIB::sysORID.3 = OID: SNMPv2-SMI::enterprises.6876.1.10
SNMPv2-MIB::sysORID.4 = OID: SNMPv2-SMI::enterprises.6876.2.10
SNMPv2-MIB::sysORID.5 = OID: SNMPv2-SMI::enterprises.6876.3.10
SNMPv2-MIB::sysORDescr.1 = STRING: SNMPv2-MIB, RFC 3418
SNMPv2-MIB::sysORDescr.2 = STRING: IF-MIB, RFC 2863
SNMPv2-MIB::sysORDescr.3 = STRING: VMWARE-SYSTEM-MIB, REVISION 200801120000Z
SNMPv2-MIB::sysORDescr.4 = STRING: VMWARE-VMINFO-MIB, REVISION 200810230000Z
SNMPv2-MIB::sysORDescr.5 = STRING: VMWARE-RESOURCES-MIB, REVISION 200810150000Z
SNMPv2-MIB::sysORUpTime.1 = Timeticks: (0) 0:00:00.00
SNMPv2-MIB::sysORUpTime.2 = Timeticks: (0) 0:00:00.00
SNMPv2-MIB::sysORUpTime.3 = Timeticks: (0) 0:00:00.00
SNMPv2-MIB::sysORUpTime.4 = Timeticks: (0) 0:00:00.00
SNMPv2-MIB::sysORUpTime.5 = Timeticks: (0) 0:00:00.00
IF-MIB::ifNumber.0 = INTEGER: 1
IF-MIB::ifDescr.1 = STRING: Device vmnic0 at 03:07.0 e1000
IF-MIB::ifType.1 = INTEGER: ethernetCsmacd(6)
IF-MIB::ifMtu.1 = INTEGER: 1500
IF-MIB::ifSpeed.1 = Gauge32: 1000000000
IF-MIB::ifPhysAddress.1 = STRING: 0:14:22:b:86:50
IF-MIB::ifAdminStatus.1 = INTEGER: up(1)
IF-MIB::ifOperStatus.1 = INTEGER: up(1)
IF-MIB::ifLastChange.1 = Timeticks: (0) 0:00:00.00
SNMPv2-MIB::snmpInPkts.0 = Counter32: 171540
SNMPv2-MIB::snmpInBadVersions.0 = Counter32: 0
SNMPv2-MIB::snmpInBadCommunityNames.0 = Counter32: 0
SNMPv2-MIB::snmpInBadCommunityUses.0 = Counter32: 0
SNMPv2-MIB::snmpInASNParseErrs.0 = Counter32: 32
SNMPv2-MIB::snmpEnableAuthenTraps.0 = INTEGER: disabled(2)
SNMPv2-MIB::snmpSilentDrops.0 = Counter32: 0
SNMPv2-MIB::snmpProxyDrops.0 = Counter32: 0
Brian

Cacti Version 0.8.7g
Plugin Architecture 2.8
Poller Type Cactid v
Server Info Linux 2.6.9-89.29.1.plus.c4
Web Server Apache/2.0.63 (CentOS)
PHP Version 5.1.6
MySQL Version 5.0.82sp1
RRDTool Version 1.2.23
SNMP Version 5.1.2
Plugins:
Global Plugin Settings (settings - v0.7)
Cycle Graphs (Cycle Graphs - v0.7+)
Thresholds (thold - v0.4.2)
Create Aggregate Graphs (aggregate - v0.75)
Device Monitoring (monitor - v1.2)
Network Tools (tools - v0.3)
Update Checker (update - v0.4)
Host Info (hostinfo - v0.2)
Error Images (errorimage - v0.1)
Cacti-ReportIt (reportit - v0.7.2)
WMI Query (wmi - v0.1)
Realtime Graph Viewer (realtime - v0.42)
Watermark (watermark - v0.1)
Pak
Posts: 1
Joined: Wed Jan 13, 2010 9:31 am

Post by Pak »

nickb
Posts: 3
Joined: Thu Jan 14, 2010 12:41 pm

Post by nickb »

SNMP doesn't work with the free license. You can enable it though, with this trick http://salawank.performance-weaver.com/?p=66

However, the templates originally posted to this thread will not work. They depend on the check_esxi3.pl script, which I can't find anywhere, and then function through the API - not via SNMP.

It looks like http://docs.cacti.net/usertemplate:graph:vmware:esx should work with ESXi v4.
nickb
Posts: 3
Joined: Thu Jan 14, 2010 12:41 pm

Post by nickb »

I've enabled the SNMP as it says in the link above (note: try esxcfg-snmp.pl instead of vicfg-snmp.pl), and cacti sees that SNMP is talking on the server, but no queries can retrieve any data.

I think that ESXi is crippled in this way...
The DareDevil
Posts: 1
Joined: Thu Feb 04, 2010 8:24 am
Location: Montreal, Quebec

Post by The DareDevil »

nickb wrote:I've enabled the SNMP as it says in the link above (note: try esxcfg-snmp.pl instead of vicfg-snmp.pl), and cacti sees that SNMP is talking on the server, but no queries can retrieve any data.

I think that ESXi is crippled in this way...
Same issue here.
neop26
Posts: 2
Joined: Fri May 23, 2008 11:11 pm

Enabling SNMP and SSH on Esxi

Post by neop26 »

Just finished writing a blog post on enabling ssh and snmp for esxi both via SSH or RCLI

http://wellytonian.com/2010/03/enabling ... 4-vsphere/
godsyn
Posts: 11
Joined: Mon Sep 03, 2007 1:27 am

Post by godsyn »

The DareDevil wrote: Same issue here.
add me to the list.
helleon
Posts: 2
Joined: Thu Jun 10, 2010 1:31 am

Post by helleon »

ESXi 4.0 actually enabled on my system, I got full tree with .1.3.6.1.4.1.6876 by snmpwalk:
[root@cacti script_server]# snmpwalk -v1 -c public x.x.x.x .1.3.6.1.4.1.6876
SNMPv2-SMI::enterprises.6876.1.1.0 = STRING: "VMware ESXi"
SNMPv2-SMI::enterprises.6876.1.2.0 = STRING: "4.0.0"
SNMPv2-SMI::enterprises.6876.1.4.0 = STRING: "164009"

but all templates I found work abnormal
imro
Posts: 48
Joined: Thu Jun 15, 2006 11:36 am

Post by imro »

According to my research SNMP in ESXi 4.x provides no statistically useful information.

I have enabled SNMP on my ESXi based on this article:
http://wellytonian.com/2010/03/enabling ... 4-vsphere/

downloaded MIBs from here:
http://downloads.vmware.com/d/info/data ... vers_tools

I have then loaded all MIBs into a MIB browser and started poking around, only to find that all useful data (mem usage, cpu usage, interface statistics) are all in VMWARE-OBSOLETE-MIB.mib. Which based on this "VMWARE-OBSOLETE-MIB.mib -- load if you have previous versions of ESX prior to ESX 4" from Readme, does not mean anything good.

All snmp based templates I have been able to find rely on VMWARE-OBSOLETE-MIB.mib

Then I found this document:
http://www.vmware.com/pdf/vsp_4_snmp_config.pdf
Which basically states that there is a possibility to gain access to standard Linux SNMP information (HOST‐RESOURCES‐MIB) via NET-SNMP, but this seems to be limited to ESX only.

So this seems to be a dead end.
nickb
Posts: 3
Joined: Thu Jan 14, 2010 12:41 pm

Post by nickb »

I just did a fresh install of ESXi 4.1, and made sure to configure snmp *BEFORE* installing my license key - in this way, it's running in full-feature trial mode.

I was able to use the various howtos and RCLI to configure snmpd (http://wellytonian.com/2010/03/enabling ... 4-vsphere/ works).

Now when I point cacti at that server, I'm at least getting network interfaces. I'm not able to get CPU or memory information yet, but that may just be a matter of finding the right OID.

Unfortunately looking at the MIB's (http://pubs.vmware.com/vsp40/admin/wwhe ... ingle=true) there doesn't seem to be an OID for CPU usage. Rather unfortunate.

What I am quite curious to find out is if snmp will keep working once i go into "free mode". I have read elsewhere that it WILL work in "free mode" IF you configure it BEFORE you install your "free mode" license!

This whole thing is quite frustrating; all I want is a graph of CPU usage and a graph of Memory usage.
anglet
Posts: 16
Joined: Mon May 16, 2011 3:53 am

Re: Monitor VMware ESXi?

Post by anglet »

This is what i've done so far:
  • Install vmware vcli in client
  • Import ESXi host_template
  • Copy esxi_cpu.pl esxi_mem.pl esxi_net.pl esxi_vmfs.pl in scripts/
  • Copy check_esx3.pl in scripts/
I've had to install this perl libraries:

yum install perl-Params-Validate
yum install perl-Nagios-Plugin perl-Nagios-Object

To check Vmware CLi is working:

/usr/lib/vmware-vcli/apps/general/connect.pl --server 10.57.223.161 --username root --password PASS
To check op5 check_esx3.pl is working:

./check_esx3.pl -H 10.57.223.161 -l mem -s usage -u root -p PASS

To check ESXi wrapper:

./esxi_net.pl 10.57.223.161 PASS

The last one doesn't work for me....
anglet
Posts: 16
Joined: Mon May 16, 2011 3:53 am

Re: Monitor VMware ESXi?

Post by anglet »

My mistake: I had cacti installed in a path diferent to /var/www/cacti so this scripts didn't work.

Code: Select all

$response = `/var/www/cacti/scripts/check_esx3.pl -H $ARGV[0] -u root -p $ARGV[1] -l mem -s usage`;
chomp $response;
($load) = ($response =~ /mem_usage=(\d+\.\d\d)\%/);
print "$load\n";
anglet
Posts: 16
Joined: Mon May 16, 2011 3:53 am

Re: Monitor VMware ESXi?

Post by anglet »

Finally I have it working, but i had to edit the wrappers.

Import ESXi host template

Console > Import Templates

Install and test vmware API

Test vmware api:

/usr/lib/vmware-vcli/apps/general/connect.pl --server SERVER --username root --password PASS

Test check_esx3

./check_esx3.pl -H IP ADDRESS-u root -p PASS -l cpu -s usagemhz

Test ESXi scripts

Check correct path: /var/www/cacti

./esxi_net.pl IP_ADDRESS PASSWD
./esxi_cpu.pl IP_ADDRESS PASSWD
./esxi_mem.pl IP_ADDRESS PASSWD

I attach my modified scripts.

Configure devices and create graphs.

Console > Devices > New
Attachments
esxi_monitor_20110719.tar.gz
(22.48 KiB) Downloaded 1720 times
X505
Posts: 39
Joined: Fri Jun 29, 2007 3:53 pm
Contact:

Re: Monitor VMware ESXi?

Post by X505 »

Hi Guys, the updated version has just came out : http://vm.lc/1w
Much more efficient thanks to Steve Shipway check_vmware.pl script http://vm.lc/1y

2 packages are available :

cluster monitoring :
Image
Image
Image
Image

host monitoring :
Image
Image
Image
Image

Enjoy 8)
anglet
Posts: 16
Joined: Mon May 16, 2011 3:53 am

Re: Monitor VMware ESXi?

Post by anglet »

thx, I'm trying them right now!!! :)
Post Reply

Who is online

Users browsing this forum: No registered users and 7 guests