Monitor Vmware ESX

Templates, scripts for templates, scripts and requests for templates.

Moderators: Developers, Moderators

Post Reply
m10
Posts: 7
Joined: Wed Feb 15, 2006 6:19 am
Location: HK, China

Post by m10 »

updated snmp_queries/interface.xml "<oid_index>.1.3.6.1.2.1.2.2.1.1</oid_index>" to "<oid_index>.1.3.6.1.2.1.2.2.1</oid_index>" for SNMP - Interface Statistics Verbose query to work property.

Code: Select all

        <name>Get SNMP Interfaces</name>
        <description>Queries a host for a list of monitorable interfaces</description>
        <oid_index>.1.3.6.1.2.1.2.2.1</oid_index>
        <oid_num_indexes>.1.3.6.1.2.1.2.1.0</oid_num_indexes>
        <index_order>ifDescr:ifName:ifHwAddr:ifIndex</index_order>
        <index_order_type>numeric</index_order_type>
        <index_title_format>|chosen_order_field|</index_title_format>
But vmware_esx_cacti_0.8.7[x]-20091009 is not working on my ESX 4i :cry: ( Cacti 0.87e, PIA 2.5, FC12 i386, VMware ESX 4.0.0 build-193498 VMware, Inc. x86_64)

Code: Select all

PHP Notice:  Undefined offset: 10 in /var/lib/cacti/scripts/ss_vmware_net.php on line 89
PHP Notice:  Undefined offset: 10 in /var/lib/cacti/scripts/ss_vmware_net.php on line 89
PHP Notice:  Undefined offset: 11 in /var/lib/cacti/scripts/ss_vmware_net.php on line 89
PHP Notice:  Undefined offset: 11 in /var/lib/cacti/scripts/ss_vmware_net.php on line 89
rszebin
Posts: 4
Joined: Thu Jul 10, 2008 6:43 am

ESX 4.0 template

Post by rszebin »

ok, i want to adapt the template of 3.5 to 4.0, but i never did a template in my life and i tried to read on docs, but it does not make too much sense to me :(

the thing is i configured snmp on the ESX using the vicfg-snmp command and the strange thing is, if i snmpwalk, i get some data, but if i specify a value, like .1.3.6.1.4.1.6876.2.1.1.2, the ESX will return data, correct data. If i do it from the template, it will return no data. what am i doing wrong ?

Data Query Debug Information
+ Running data query [11].
+ Found type = '6 '[script query].
+ Found data query XML file at '/var/www/html/resource/script_server/vmware_cpu.xml'
+ XML file parsed ok.
+ Executing script for list of indexes '/usr/bin/php -q /var/www/html/scripts/ss_vmware_cpu.php xxx.xxx.xxx.xxx 14 1:161:500:1:50:community:admin:cacti:MD5::DES: index'
+ Executing script query '/usr/bin/php -q /var/www/html/scripts/ss_vmware_cpu.php xxx.xxx.xxx.xxx 14 1:161:500:1:50:community:admin:cacti:MD5::DES: query index'
+ Executing script query '/usr/bin/php -q /var/www/html/scripts/ss_vmware_cpu.php xxx.xxx.xxx.xxx 14 1:161:500:1:50:community:admin:cacti:MD5::DES: query displayname'
+ Executing script query '/usr/bin/php -q /var/www/html/scripts/ss_vmware_cpu.php xxx.xxx.xxx.xxx 14 1:161:500:1:50:community:admin:cacti:MD5::DES: query vmid'
+ Executing script query '/usr/bin/php -q /var/www/html/scripts/ss_vmware_cpu.php xxx.xxx.xxx.xxx 14 1:161:500:1:50:community:admin:cacti:MD5::DES: query gueststate'
+ Executing script query '/usr/bin/php -q /var/www/html/scripts/ss_vmware_cpu.php xxx.xxx.xxx.xxx 14 1:161:500:1:50:community:admin:cacti:MD5::DES: query vmstate'
+ Found data query XML file at '/var/www/html/resource/script_server/vmware_cpu.xml'
+ Found data query XML file at '/var/www/html/resource/script_server/vmware_cpu.xml'
+ Found data query XML file at '/var/www/html/resource/script_server/vmware_cpu.xml'

debug for disk, for instance

but

snmpwalk -v2c -c community xxx.xxx.xxx.xxx .1.3.6.1.4.1.6876.2 will return results.
toni
Posts: 3
Joined: Thu Jan 14, 2010 5:39 am

solved some data queries for ESX 4.0

Post by toni »

hello,

i've bit playing around the template because i also want to monitor ESX 4.0 servers.

i've seen the MIB differences between ESX 3.5 and ESX 4.0 and i solved the problem for 2 Data Queries:
Data Query [VMware ESX - Get VM CPU usage]
Data Query [VMware ESX - Get VM memory usage]

they has been solved by changing the OID [b].1.3.6.1.4.1.6876.2.1.1.1[/b] to [b].1.3.6.1.4.1.6876.2.1.1.7[/b] (the OID .1.3.6.1.4.1.6876.2.1.1.1 seems to be obsoleted in ESX 4.0 while this other is valid for ESX 3.5 and 4.0).

i will try to get running the other 2 Data Queries:
Data Query [VMware ESX - Get VM disk statistics]
Data Query [VMware ESX - Get VM NIC statistics]

if anyone has more ideas, please tell us to get a good template for both ESX 3.5 and 4.0.

regards,

toni
User avatar
Hyperlord
Cacti User
Posts: 211
Joined: Tue Feb 10, 2009 3:24 am
Location: Frankfurt (a.M.), Germany

Post by Hyperlord »

Hi toni,

you progressed any further with that? I follow that topic since months and haven't been able to get this working. I guess the approach via VMware SDK & vCenter is the one that could work for me but I don't find any time to have a look at that stuff.

brgds
Om Tat Sat
LightMan
Posts: 5
Joined: Wed Apr 06, 2005 7:28 am

Post by LightMan »

somebody got new templates for vsphere?
gvidals
Posts: 3
Joined: Tue Jun 24, 2008 1:34 pm

Monitoring individual VM traffic?

Post by gvidals »

OK, I think I'm corned and the only option I can find that works with ESX 4 (ESXi) is SolarWinds Orion Network Manager for about $1,500. I've been using Cacti for a couple of years and much prefer to stay with it, but it doesn't seem possible to monitor the traffic on each virtual machine (VM).

Am I wrong? Can anyone provide instructions on how to get Cacti to work with ESXi Version 4 (vSphere)?

I've searched the net like crazy and can't find any indication that it is possible or that anyone has been able to do it.

Thanks,
Gil Vidals / VMRacks.com
http://www.nixracks.com - linux dedicated and esx hosting
Voiper99
Cacti User
Posts: 276
Joined: Thu Mar 01, 2007 5:43 pm
Location: Melbourne, Australia

Post by Voiper99 »

Hi all, I am having a similar issue in that I cannot graph certain things after having upgraded to ESX4.

I have done some researching and came across this page - http://downloads.vmware.com/d/details/e ... QqaCVidGR3

VMware® ESX 4.0 includes a Simple Network Management Protocol (SNMP) agent that is embedded in hostd. This embedded SNMP agent supports VMware Management Information Base (MIB) files and extends SNMP functionality from sending traps only (as in ESXi 3.5) to also receiving polling requests.

In past releases, VMware ESX used Net‐SNMP as its SNMP agent. Although VMware no longer supports Net‐SNMP, you can still use Net‐SNMP with ESX 4.0 if your management agent requires it. ESX 4.0 allows Net‐SNMP to proxy through the VMware SNMP agent, which enables access to VMware MIBs.


I then found this page which tells you how to enable SNMP Proxy - http://www.vmware.com/pdf/vsp_4_snmp_config.pdf

I have not had a chance to give it a go myself but would like to hear from anyone that has?

Without the above changes I have found that I cannot SNMP walk any VMWare OIDs ( 1.3.6.1.4.1. 6876 )
nuzzy
Posts: 42
Joined: Mon Feb 23, 2009 10:33 am

Post by nuzzy »

imro
Posts: 48
Joined: Thu Jun 15, 2006 11:36 am

Post by imro »

OIDs that provided CPU utilization (.1.3.6.1.4.1.6876.3.1.2), Mem usage (.1.3.6.1.4.1.6876.3.2.4), storage info (.1.3.6.1.4.1.6876.3.5.2) and network interface stats (.1.3.6.1.4.1.6876.3.4) are no longer available in ESX/ESXi 4.0/4.1.

If you have ESX you can enable NET-SNMP and access HOST-RESOURCES-MIB (.1.3.6.1.2.1.25) which can give you similar information.
got
Posts: 3
Joined: Mon Aug 03, 2009 7:07 am

Short HowTo make ESX4 work with Cacti

Post by got »

Configure SNMP on ESX4 for Cacti

This is a tiny little guide to make an ESX4 host work with Cacti, basically make ESX4 host answer SNMP requests and include data from HOST-RESOURCES-MIB into the output.

There will only be a SNMP v1 / v2 available with a "public" community with read only access. For a more enhanced SNMP configuration you might want to check net-snmp documentation. The Net-SNMP agent comes with a perl script to aid with configuration. This script, snmpconf, helps configure some of the basic configuration options offered by snmpd.
Use 'snmpconf -r none -g basic_setup' to create a snmp.conf with a more enhanced configuration interactively.

Most of the information is taken from http://knowledgebase.solarwinds.com/kb/ ... +version+4 - basically the same source as mentioned some posts above.

Here we go:

Get root access to the ESX host's console (for SSH access you will need to enable root ssh access first).

Make sure SNMP is not running
# service snmpd stop

Create backup copy of /etc/vmware/snmp.xml
# cp /etc/vmware/snmp.xml /etc/vmware/snmp.xml.original

Edit snmp.xml
# nano /etc/vmware/snmp.xml

Code: Select all

<config>
  <snmpSettings>
    <communities>public</communities>
    <enable>true</enable>
    <port>171</port>
    <targets>127.0.0.1@162/public</targets>
  </snmpSettings>
</config>
Create backup copy of /etc/snmp/snmpd.conf
# cp /etc/snmp/snmpd.conf /etc/snmp/snmpd.conf.original

The original snmpd.conf is pretty large and filld up with commenst and information we do not need here. So it is easier to delete it and create a new file from scratch.

Delete snmpd.conf
# rm /etc/snmp/snmpd.conf

Create new snmpd.conf
# nano /etc/snmp/snmpd.conf

Code: Select all

load  99 99 99
syslocation Serverraum
syscontact  "ESX Administrator"
rocommunity  public
view systemview included .1.3.6.1.4.1.6876
proxy -v 1 -c public 127.0.0.1:171 .1.3.6.1.4.1.6876
Restart the mgmt-vmware service
# service mgmt-vmware restart

Start the SNMP service
# service snmpd start

Make SNMP start automatically on host reboot
# chkconfig snmpd on

Allow SNMP through the ESX Server firewall
# esxcfg-firewall -e snmpd

Testing
# snmpwalk -v1 -c public localhost .1.3.6.1.4.1.6876 -> should show some EXS specific data
# snmpwalk -v1 -c public localhost .1.3.6.1.2.1.25 -> should show lots of HOST-RESOURCES-MIB data but not only some few lines
i2umi
Posts: 1
Joined: Sat Sep 11, 2010 11:52 am

Post by i2umi »

Any solutions for Cacti to work with ESXi 4.1?

I'm able to get the Host's NIC traffic.. But is unable to have the VM's NIC traffic.

ESXi 4.1 doesn't have Net-SNMP installed.. thus unable to follow the steps above..

Anyone managed to have it working?

Thanks so much! :oops:
skneo
Posts: 16
Joined: Thu Jun 10, 2010 7:41 am

Post by skneo »

snmp must enabeld befor activating the esxi.
But i can only brwose the status of the virtual server ( on off vmtools installed hdd size and so on ), non important things ( no traffic, no cpu, no mem, ... ). I forund nothing with the MIB Files and MIB Browser.
ehall
Cacti User
Posts: 246
Joined: Fri Dec 09, 2005 3:42 pm

Re: Monitor Vmware ESX

Post by ehall »

Some confusion here.... vSphere / ESXi 4.x does not have the old-style MIBs, because it no longer provides full-blown Linux for the local console OS, with the full-blown Net-SNMP agent and MIBs. Now it only has skinny Linux-based OS with a (very) thin SNMP agent, with management moving to other interfaces. The default SNMP agent does not even support polling, and can only issue traps. This extension (which is NOT the same as the link that is provided in the VMware knowledge base or in Google) provides the ability to query for a small amount of generic host data (network interfaces and a little bit more, but not CPU utilization or even load averages), and there is NO data related to guest resource usage (there is some data for eg floppy drive image path and if the image is mounted, but nothing for memory allocated or the like [fwiw, the OID provided above is not related to guest activity at all]). In short, vSphere / ESXi is not manageable with SNMP anymore.

There *IS* a programmable interface to the data, however, at this extension, which is essentially a C headers. If somebody wants to turn that into a scriptable front-end, that would be awesome, but in the meantime I wanted to point out the above, so that people would not bang their heads on the unworkable any longer.
Devroush
Posts: 27
Joined: Sun Jan 22, 2006 7:35 am

Re: Monitor Vmware ESX

Post by Devroush »

I managed to enable SNMP on my 4.1 ESXi server and get some interface statistics. I'd like to use 64-bit counters for In/OutOctets but there's something strange: the 64-bit counters act exactly as the 32-bit counters. Both variables have the same value and cycle at ~4.2 billion (2^32). Did somebody else notice this?

Example output:
IF-MIB::ifInOctets.1 = Counter32: 632624603
IF-MIB::ifInOctets.2 = Counter32: 0
IF-MIB::ifInOctets.3 = Counter32: 2254224120

IF-MIB::ifHCInOctets.1 = Counter64: 632624603
IF-MIB::ifHCInOctets.2 = Counter64: 0
IF-MIB::ifHCInOctets.3 = Counter64: 2254224120
ldjones48
Posts: 17
Joined: Tue Feb 15, 2011 6:33 am

Re: Monitor Vmware ESX

Post by ldjones48 »

Hi Guys,

Can I ask why you are trying to use SNMP to gather the interface stats? I have configured my cacti to use a script written by OP5 which utilizes the VMWare Client SDK kit to poll the vcentre servers or esx servers. The script then pulls the info it needs and graphs it in cacti.

I have this running on 60+ machines.

Any questions, be glad to help.

Lee
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests