Monitor Vmware ESX

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

Moderators: Developers, Moderators

Post Reply
User avatar
fmangeant
Cacti Guru User
Posts: 2345
Joined: Fri Sep 19, 2003 8:36 am
Location: Sophia-Antipolis, France
Contact:

Post by fmangeant »

Well, I just had to modify the "VMware ESX - ESX Memory Usage" graph template (some items didn't have a data source).

Thanks again for these templates, they're a lot easier to read !
[size=84]
[color=green]HOWTOs[/color] :
[list][*][url=http://forums.cacti.net/viewtopic.php?t=15353]Install and configure the Net-SNMP agent for Unix[/url]
[*][url=http://forums.cacti.net/viewtopic.php?t=26151]Install and configure the Net-SNMP agent for Windows[/url]
[*][url=http://forums.cacti.net/viewtopic.php?t=28175]Graph multiple servers using an SNMP proxy[/url][/list]
[color=green]Templates[/color] :
[list][*][url=http://forums.cacti.net/viewtopic.php?t=15412]Multiple CPU usage for Linux[/url]
[*][url=http://forums.cacti.net/viewtopic.php?p=125152]Memory & swap usage for Unix[/url][/list][/size]
ymartin59
Posts: 40
Joined: Fri Feb 17, 2006 7:42 am

Post by ymartin59 »

I have compared CPU graphs generated by vmktree and the CPU graph in cacti... there is something wrong with units/percent. Maybe a CDEF is required. I also have doubt about the way traffic (bits/sec) is graphed.
I hope that the two "hbaReference" and "diskReference" are enough to prevent mismatch when the ESX server reboots.

In fact, I just had troubles with CPU graphs mismatch when a new VM is added without server reboot... I think it is necessary to fix "Re-index method" to "Index Count Changed". And I'm sorry the re-index method is not part of the host template !!
ymartin59
Posts: 40
Joined: Fri Feb 17, 2006 7:42 am

Post by ymartin59 »

As promised a corrected version of the template.
CPU units were wrong. ESX snmp measure is the number of seconds consumed. Compared to HOST MIB CPU which is in centi-seconds. So I created a CDEF "* 100"
Attachments
vmware_esx_cacti_0.8.6i-20061117.zip
Template for ESX 2.5
(32.37 KiB) Downloaded 5253 times
User avatar
fmangeant
Cacti Guru User
Posts: 2345
Joined: Fri Sep 19, 2003 8:36 am
Location: Sophia-Antipolis, France
Contact:

Post by fmangeant »

ymartin59 wrote:As promised a corrected version of the template.
CPU units were wrong. ESX snmp measure is the number of seconds consumed. Compared to HOST MIB CPU which is in centi-seconds. So I created a CDEF "* 100"
Hi

thanks for the mod. Is the only change applied to the "VMware ESX - VM CPU usage" graph template ?
[size=84]
[color=green]HOWTOs[/color] :
[list][*][url=http://forums.cacti.net/viewtopic.php?t=15353]Install and configure the Net-SNMP agent for Unix[/url]
[*][url=http://forums.cacti.net/viewtopic.php?t=26151]Install and configure the Net-SNMP agent for Windows[/url]
[*][url=http://forums.cacti.net/viewtopic.php?t=28175]Graph multiple servers using an SNMP proxy[/url][/list]
[color=green]Templates[/color] :
[list][*][url=http://forums.cacti.net/viewtopic.php?t=15412]Multiple CPU usage for Linux[/url]
[*][url=http://forums.cacti.net/viewtopic.php?p=125152]Memory & swap usage for Unix[/url][/list][/size]
User avatar
hemul
Posts: 10
Joined: Mon Nov 20, 2006 7:57 am
Contact:

VMware ESX Query problem

Post by hemul »

Hello All .
I've added my esx server to cacti devices , but i all queries i cannot see results
1) VMware ESX - Get VM CPU usageSuccess [0 Items, 0 Rows]
my Snmp service is started on esc machine and configured in the Web Gui .

The Query result is :
Running data query [10].
+ Found type = '6 '[script query].
+ Found data query XML file at '/var/www/html/cacti/resource/script_server/vmware_cpu.xml'
+ XML file parsed ok.
+ Executing script for list of indexes '/usr/bin/php -q /var/www/html/cacti/scripts/ss_vmware_cpu.php 10.0.1.200 10 1:161:500:public:::MD5::[None] index'
+ Executing script query '/usr/bin/php -q /var/www/html/cacti/scripts/ss_vmware_cpu.php 10.0.1.200 10 1:161:500:public:::MD5::[None] query index'
+ Executing script query '/usr/bin/php -q /var/www/html/cacti/scripts/ss_vmware_cpu.php 10.0.1.200 10 1:161:500:public:::MD5::[None] query displayname'
+ Executing script query '/usr/bin/php -q /var/www/html/cacti/scripts/ss_vmware_cpu.php 10.0.1.200 10 1:161:500:public:::MD5::[None] query vmid'
+ Executing script query '/usr/bin/php -q /var/www/html/cacti/scripts/ss_vmware_cpu.php 10.0.1.200 10 1:161:500:public:::MD5::[None] query gueststate'
+ Executing script query '/usr/bin/php -q /var/www/html/cacti/scripts/ss_vmware_cpu.php 10.0.1.200 10 1:161:500:public:::MD5::[None] query vmstate'
+ Found data query XML file at '/var/www/html/cacti/resource/script_server/vmware_cpu.xml'
+ Found data query XML file at '/var/www/html/cacti/resource/script_server/vmware_cpu.xml'
+ Found data query XML file at '/var/www/html/cacti/resource/script_server/vmware_cpu.xml'
Attachments
Err:
Err:
CactiVmwareErr.JPG (49.68 KiB) Viewed 36926 times
ymartin59
Posts: 40
Joined: Fri Feb 17, 2006 7:42 am

Post by ymartin59 »

Hello,
You have to enable ESX snmpd agent !
http://www.vmware.com/support/esx21/doc ... gents.html

To sum up: /etc/snmp/snmpd.conf must contains "master agentx" and
/etc/init.d/snmpd start
/etc/init.d/vmware-snmpd start
It should work better.

Take care to change "Re-Index Method" for ESX data queries to "Index count changed" !
ymartin59
Posts: 40
Joined: Fri Feb 17, 2006 7:42 am

Post by ymartin59 »

Hello,
The "Re-Index method" makes me crazy. "Index count changes" is not enough.
I have had graph mismatches !
So I have changed for "Verify all fields" and do a "rebuild poller cache" to get my graph back !
ymartin59
Posts: 40
Joined: Fri Feb 17, 2006 7:42 am

Post by ymartin59 »

ymartin59 wrote:Hello,
The "Re-Index method" makes me crazy. "Index count changes" is not enough.
I have had graph mismatches !
So I have changed for "Verify all fields" and do a "rebuild poller cache" to get my graph back !
Argh. Still graph mismatches ! "Verify all fields" is not enough when some VMs are stopped and another one is started => newly started VM appears in the wrong graph, at least for CPU and Memory. A "rebuild poller cache" is necessary, what a mess !

I think it comes from the fact I read the VMID from the poller cache instead of querying the snmp tree each time.

Does the "verify all fields" re-index method really flush the poller cache for the concerned data query ?
Hiney
Cacti User
Posts: 56
Joined: Mon Oct 16, 2006 11:50 pm

vmware 3.01

Post by Hiney »

the snmp instructions above are quite old. for v3.01's all we need do is
vi /etc/snmp/snmpd.conf and change the rocommunity to the correct value

chkconfig snmpd on
/etc/init.d/snmpd start

go to the infrastructure client, click on the server name (top left).
go to configuration tab, security profile, properties and select the" snmp server" entry. hit ok.
this opens the firewall for snmp.


H
"The difference between theory and practice, is that in theory, there is no difference between theory and practice."

"The first 90% of a project takes 90% of the time, the last 10% takes the other 90% of the time" - Murphy's Law
Hiney
Cacti User
Posts: 56
Joined: Mon Oct 16, 2006 11:50 pm

way cool

Post by Hiney »

thanks very very much for those that have contributed. i've got graphs !!!

the cpu percent is reading 5.76k, i'll see if i can work out why. i think the number is correct, just out by a factor of 1000 (or is it 1024).

H
"The difference between theory and practice, is that in theory, there is no difference between theory and practice."

"The first 90% of a project takes 90% of the time, the last 10% takes the other 90% of the time" - Murphy's Law
ymartin59
Posts: 40
Joined: Fri Feb 17, 2006 7:42 am

Re: way cool

Post by ymartin59 »

Hiney wrote:thanks very very much for those that have contributed. i've got graphs !!!
the cpu percent is reading 5.76k, i'll see if i can work out why. i think the number is correct, just out by a factor of 1000 (or is it 1024).
Great.
I have done the work with ESX 2.5 and I have not tried with 3.0 yet, so maybe CPU unit has changed. Thank you for the SNMP configuration tip for ESX 3.0
m4tth3wv
Posts: 5
Joined: Mon Dec 11, 2006 4:42 pm

Excellent work

Post by m4tth3wv »

Graphs work amazingly well on VI3.

Big thanks!
ymartin59
Posts: 40
Joined: Fri Feb 17, 2006 7:42 am

Re: Excellent work

Post by ymartin59 »

m4tth3wv wrote:Graphs work amazingly well on VI3.
I had difficulties to enable VMware MIB myself (upgrade from ESX 2.5). First, add the following line in /etc/snmp/snmpd.conf if not present:

Code: Select all

dlmod SNMPESX /usr/lib/vmware/snmp/libSNMPESX.so
Run the command

Code: Select all

esxcfg-firewall -e snmpd
or use the graphical interface the way you described and restart snmpd daemon.
User avatar
TheWitness
Developer
Posts: 17047
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

ymartin,

Have you overcome issues with reindexing? My guess is that the wrong field is being used as the index field, which would cause the issues that you experienced.

Thanks in Advance,

TheWitness
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages


For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
mhtrim
Posts: 2
Joined: Thu Jan 25, 2007 12:23 pm

graph free

Post by mhtrim »

On ESX 3.0 I'm getting graphs for everything except for the VM CPU, VM Mem, VM Disk and VM Traffic.

Looks like it's polling and getting values, but it's not building the graphs just for those items.

But graph debug says:

Code: Select all

RRDTool Command:

/usr/bin/rrdtool graph - \
--imgformat=PNG \
--start=-86400 \
--end=-300 \
--title="ESX1 - VM Disk read/write (kB) - |query_vmDisplayName| - |query_hbaName|" \
--rigid \
--base=1000 \
--height=120 \
--width=500 \
--alt-autoscale-max \
--lower-limit=0 \
--vertical-label="kilobytes" \
DEF:a="/usr/share/cacti-0.8.6j/rra/esx1_esxdisk_kbread_3185.rrd":esxdisk_kbread:AVERAGE \
DEF:b="/usr/share/cacti-0.8.6j/rra/esx1_esxdisk_kbread_3185.rrd":esxdisk_kbwrite:AVERAGE \
AREA:a#00CF00:"Read"  \
GPRINT:a:LAST:" Current\:%8.2lf %s"  \
GPRINT:a:AVERAGE:"Average\:%8.2lf %s"  \
GPRINT:a:MAX:"Maximum\:%8.2lf %s\n"  \
LINE1:b#002A97:"Write"  \
GPRINT:b:LAST:"Current\:%8.2lf %s"  \
GPRINT:b:AVERAGE:"Average\:%8.2lf %s"  \
GPRINT:b:MAX:"Maximum\:%8.2lf %s" 

RRDTool Says:

ERROR: opening '/usr/share/cacti-0.8.6j/rra/esx1_esxdisk_kbread_3185.rrd': 
Any ideas?
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest