Monitor Vmware ESX

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

Moderators: Moderators, Developers

Post Reply
Author
Message
acacord
Posts: 12
Joined: Fri Oct 27, 2006 1:31 pm
Location: San Antonio, TX

#46 Post by acacord » Mon Apr 09, 2007 5:14 pm

Well, I seem to have mine working. Our ESX 3.0.1 server cluster is online and going into production in a couple weeks. I wanted to get this all out of the way before then. So far, I'm pretty pleased.

I did find one thing in the VMware ESX Admin Guide that I felt should be mentioned in this thread:
To start the SNMP agents automatically
You can set the SNMP daemon to start whenever ESX Server boots by logging on as the root user on the service console and running the chkconfig command:

Code: Select all

chkconfig snmpd on
I would still like to see examples of snmp.conf files. I'm really wanting to lock mine down, but don't have a lot of time to mess with it.

I'll continue to post as I make changes...

carlilek
Posts: 18
Joined: Thu Jun 22, 2006 1:51 pm

#47 Post by carlilek » Wed Apr 25, 2007 11:38 am

Hi, I'm a bit new to both ESX and Cacti. I have ESX 3.x talking to Cacti, no problem, but my graphs for the vms are showing up as identical. I know my domain controller isn't using as much CPU as my Landesk server, but they are showing up identically. Also, my percentages are all off--it's using 100m percent? I initially used the package on the first page of this thread, but I just switched it to the package on page 2. Is there something else I need to do to get the CPU graphs correct?

Thanks!
Ken

geofs
Posts: 6
Joined: Wed Jun 13, 2007 7:42 am

#48 Post by geofs » Wed Jun 13, 2007 8:16 am

Hi,

This is quite old but I tought i'd share what i found.
ymartin59 wrote:
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.
I think this error is caused by the use of 'vmID' as a search term for different templates.

Code: Select all

/* get VM ID from the snmp cache since it is faster */
                        $vmid = eregi_replace("[^0-9]", "", db_fetch_cell("select field_value from host_snmp_cache where host_id=$host_id and
 field_name='vmID' and snmp_index=$index"));
This should return only one value, right? But it retruns more...

This SQL req (from ss_vmware_cpu.php) retruns the wrong vmID because the VM index (snmp_index) is different for disk, cpu, mem and net. for example:

Code: Select all

mysql> select q.name, c.field_value, c.snmp_index from host_snmp_cache c, snmp_query q where c.snmp_query_id=q.id and host_id='40' and field_name='vmID' and snmp_index=1;
+-------------------------------------+-------------+------------+
| name                                | field_value | snmp_index |
+-------------------------------------+-------------+------------+
| VMware ESX - Get VM NIC statistics  | 188         | 1          |
| VMware ESX - Get VM memory usage    | 217         | 1          |
| VMware ESX - Get VM disk statistics | 141         | 1          |
| VMware ESX - Get VM CPU usage       | 217         | 1          |
+-------------------------------------+-------------+------------+
4 rows in set (0.01 sec)
index 1 is VMID 188 for net, 217 for cpu and mem and 141 for disk query.

I just tried to use specific field names like 'cpuvmID', 'netvmID'... in the xmls and changing the above line in the phps to match the new field name.

It seems to work.

Bye...

AcquaCow
Posts: 10
Joined: Fri May 11, 2007 2:04 pm

#49 Post by AcquaCow » Wed Jun 20, 2007 3:11 pm

Care to share your seemingly working scripts? ;)

Thanks!

-- Dave

geofs
Posts: 6
Joined: Wed Jun 13, 2007 7:42 am

#50 Post by geofs » Thu Jun 21, 2007 4:46 am

Sure, I was just waiting to see if they really work :wink: They do.

Here are the patched scripts:
Attachments
vmware_esx_cacti_0.8.6j-20070621.tgz
VMware ESX templates
(27.69 KiB) Downloaded 4816 times

AcquaCow
Posts: 10
Joined: Fri May 11, 2007 2:04 pm

#51 Post by AcquaCow » Thu Jun 21, 2007 8:24 am

geofs wrote:Sure, I was just waiting to see if they really work :wink: They do.

Here are the patched scripts:
Thanks!

I'll double check that it works ;)

-- Dave

AcquaCow
Posts: 10
Joined: Fri May 11, 2007 2:04 pm

#52 Post by AcquaCow » Thu Jun 21, 2007 12:30 pm

AcquaCow wrote:
geofs wrote:Sure, I was just waiting to see if they really work :wink: They do.

Here are the patched scripts:
Thanks!

I'll double check that it works ;)

-- Dave
Alright...it works, I get data, it's graphed, but something is up....

I dunno if the CPU units are right on VM CPU usage, as I'm seeing numbers like "622.98" "590.32" and so on... I'm wondering if that's 62% and 59%...

Also, under the ESX Mem usage, I'm not sure if that's supposed to be combined for all running VM's, or just the service console.

I see:
Total current: 15.99G
Console current: 272M
Free current: 15.67G

The Vm's themselves are allocated 2gb each, and there are 4 running, so I was expecting to see more here maybe?

I'm gonna hack through the xml files and scripts to see what I can figure out.

Thanks,

-- Dave

geofs
Posts: 6
Joined: Wed Jun 13, 2007 7:42 am

#53 Post by geofs » Mon Jun 25, 2007 1:53 am

AcquaCow wrote:Alright...it works, I get data, it's graphed, but something is up....

I dunno if the CPU units are right on VM CPU usage, as I'm seeing numbers like "622.98" "590.32" and so on... I'm wondering if that's 62% and 59%...
It may be related to ymartin59's post on page 2. Have a look at it... My graphs are ok...
Also, under the ESX Mem usage, I'm not sure if that's supposed to be combined for all running VM's, or just the service console.
I think it's the console mem usage. Compare with what you get in vmkusage or the web UI.

-- geof

mna
Posts: 3
Joined: Wed Jun 27, 2007 4:38 am

vmware template does not work for me

#54 Post by mna » Wed Jun 27, 2007 5:04 am

morning folks,

am using cacti 0.86j, i have add vmware_esx_cacti_0.8.6j-20070621.tgz template and this does not work properly.
am using vmware :

vmwProdName.0 "VMware ESX Server"
vmwProdVersion.0 "3.0.1"
vmwProdOID.0 oidESX.3.0.1
vmwProdBuild.0 "32039"


i have no data in all vmware graphs except usage memory which is false.

the snmpd process work on my vmware host machine and i can get information from it like :

$oids = array(
"usage" => ".1.3.6.1.4.1.6876.3.1.2.1.3",
"vmid" => ".1.3.6.1.4.1.6876.2.1.1.7",
"displayname" => ".1.3.6.1.4.1.6876.2.1.1.2",
"index" => ".1.3.6.1.4.1.6876.2.1.1.1",
"vmstate" => ".1.3.6.1.4.1.6876.2.1.1.6",
"gueststate" => ".1.3.6.1.4.1.6876.2.1.1.8"
);
# snmpwalk -Os -v1 -c "public" host .1.3.6.1.4.1.6876.3.1.2.1.3
cpuUtil.16 25480308
cpuUtil.32 66386812
cpuUtil.48 26177812
cpuUtil.64 30685808
cpuUtil.80 3843309
cpuUtil.96 3787854
cpuUtil.112 60210448
cpuUtil.144 46963520
cpuUtil.160 29545022

# snmpwalk -Os -v1 -c "public" host ".1.3.6.1.4.1.6876.2.1.1.7"
vmVMID.0 112
vmVMID.1 144
vmVMID.2 16
vmVMID.3 160
vmVMID.4 32
vmVMID.5 48
vmVMID.6 64
vmVMID.7 80
vmVMID.8 96

..... all the vmware mib is seen and response to a query.

if you have any idear ....
thanks in advance
mna.
Attachments
debug2.jpg
screen copy
debug2.jpg (167.54 KiB) Viewed 21128 times

mna
Posts: 3
Joined: Wed Jun 27, 2007 4:38 am

Re: vmware template does not work for me

#55 Post by mna » Tue Jul 24, 2007 3:22 am

mna wrote:morning folks,

am using cacti 0.86j, i have add vmware_esx_cacti_0.8.6j-20070621.tgz template and this does not work properly.
am using vmware ...
Ok i have found the bug .... it'a arround the snmp V1 community, if you try to use some specials char the snmp query does not work !!!

you can try to set a comunity with char like &"#' ... and you can see the vmware does not work properly.

i don't know how to make correction to the wmvare template but am sure about the explanation.

if somebody can do it or add a restriction to use to this template.

read you soon.
bye.

User avatar
TheWitness
Developer
Posts: 14804
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

#56 Post by TheWitness » Tue Jul 24, 2007 6:02 am

We are escaping most characters from the user interface to prevent injection exploits. However, first try the lib/snmp.php in SVN and provide feedback. That would be branch 0.8.6.

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

Life is an adventure, let yours begin with Cacti!

Author of MacTrack, Boost, CLog, SpikeKill, Platform RTM, DSStats, maintainer of Spine, lot's of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Central Plugin Repository
Central Templates Repository


I'm still out there people. Getting excited for Cacti 1.2. I think it will be a great release.

mna
Posts: 3
Joined: Wed Jun 27, 2007 4:38 am

#57 Post by mna » Wed Jul 25, 2007 2:13 am

TheWitness wrote:We are escaping most characters from the user interface to prevent injection exploits. However, first try the lib/snmp.php in SVN and provide feedback. That would be branch 0.8.6.

TheWitness
1rst of all thanks for your answer.

i have try the last version of snmp.php but there is no change.

I want to precise that the trouble using special char in the V1 snmp sommunity is only on the vmware template NOT on the other template, i can use generic ucd/snmp, net/snmp or some personal without any trouble.

The error is in the vmware template.
that it for the first point (special chars like &" in V1 community).

now, i have try to use vmware template on ESX server V2.X and 3.X.

- i have found trouble on ESV V3 with the VCPU graph, the "CPU Seconds As Percentage" CDEF seem to wrong and all VCPU are about 10* more compare to vmware virtual infra structure values.
- on both ESX version 2.x and 3.x some values are not graph (apparently hazardeous index),
a manual snmpwalk respond with corrects values, but graphs says there are problem with NAN (cf example screen copy).

hope this will help.
mna.
Attachments
VCPU_trouble.jpg
nan screen copy
VCPU_trouble.jpg (46.26 KiB) Viewed 20671 times

zkenton
Posts: 47
Joined: Fri Jun 29, 2007 2:22 pm

#58 Post by zkenton » Thu Sep 13, 2007 9:59 am

what OIDs do I need to add to my snmpd.conf in order to poll the correct information...right now an snmpwalk gives me a very limited list of information

paintcheck200
Posts: 2
Joined: Thu Oct 28, 2004 10:00 pm

#59 Post by paintcheck200 » Fri Oct 05, 2007 11:52 pm

def. needs some updates for 3.x

rvd
Posts: 34
Joined: Wed Nov 21, 2007 10:09 am
Location: France

#60 Post by rvd » Fri Nov 30, 2007 5:46 am

geofs wrote:Sure, I was just waiting to see if they really work :wink: They do.

Here are the patched scripts:
Hi,
I use it with v0.8.7a and have to say it works great if of course you modify the php scripts with
include_once(dirname(__FILE__) . "/../include/global.php");
instead of
include_once(dirname(__FILE__) . "/../include/config.php");

Post Reply