Cacti (home)ForumsDocumentation
Cacti: offical forums and support
It is currently Mon Mar 27, 2017 3:18 pm

All times are UTC - 5 hours




Post new topic Reply to topic  [ 51 posts ]  Go to page 1, 2, 3, 4  Next
Author Message
 Post subject: ESXi 5.x template - no perl SDK, pure snmp
PostPosted: Tue Mar 11, 2014 10:15 am 
Offline
Cacti User

Joined: Tue Mar 18, 2008 2:30 am
Posts: 90
Location: Czech
Hi,
I prepared template for ESXi. It works with 5.0, 5.1 and 5.5. You can graph:
    vhosts - number of hosts, running, installed vm client tools
    Logged in Users and number of processes
    Real Memory - on 5.1 and higher
    Processor load for every CPU core (strange works on 5.0, better on 5.1, fine on 5.5)
    HW - state of Logical volumes, FANs, … (does not make sense graphs hw with state unknown (only running(2), warninkg(3)) and make threshold)
    Disk usage
    Interface statistics

You need enable snmp (yes, ESXi include snmp), read readme.txt


Attachments:
File comment: version 0.2
cacti_esxi_template.tar.gz [102.15 KiB]
Downloaded 5011 times
File comment: Screenshot - processes
esxi_ps.png
esxi_ps.png [ 14.96 KiB | Viewed 21496 times ]
File comment: Screenshot - vhosts
esxi_vhosts.png
esxi_vhosts.png [ 23.15 KiB | Viewed 21496 times ]
File comment: Screenshot - Real memory
esxi_memory.png
esxi_memory.png [ 18.69 KiB | Viewed 21496 times ]
File comment: Screenshot - CPU
esxi_cpu.png
esxi_cpu.png [ 20.98 KiB | Viewed 21496 times ]

_________________
Author of:
FreeBSD template
ESXi template
Intropage plugin
Multicore CPU average graph
HP MSM wifi controller 7xx
TopX plugin


Last edited by macan on Thu Apr 24, 2014 3:59 am, edited 1 time in total.
Top
 Profile  
 
 Post subject: Re: ESXi 5.x template - no perl SDK, pure snmp
PostPosted: Wed Mar 19, 2014 11:47 am 
Offline

Joined: Wed Mar 19, 2014 11:39 am
Posts: 1
This is great -thank you!!

One small problem, though - the PHP script getting the VM info (ss_esxi_vhosts.php) is hardcoded for SNMPv3. Could someone help me get this to work with SNMPv3?

The script calls cacti_snmp_walk, and changing that to use SNMPv3 seems possible. However, I do not know enough about the inner workings of Cacti to send all required information to the script - it will need a username, password, priv_pass, etc.

Thank you!

[ Edit: there seems to be something wrong with the script (or with my ESXi server). Even after enabling SNMPv2 on the host, there is no vmwVirtMachines OID (enterprises.vmware.2) - and since the script uses it to get all info related to VMs, there's nothing there.

[root@localhost scripts]# snmpwalk -v2c -c TestCommunity 10.1.1.1 .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: "5.5.0"
SNMPv2-SMI::enterprises.6876.1.4.0 = STRING: "1331820"
SNMPv2-SMI::enterprises.6876.1.5.0 = STRING: "0"
SNMPv2-SMI::enterprises.6876.1.6.0 = STRING: "0"
SNMPv2-SMI::enterprises.6876.3.1.1.0 = Gauge32: 2
SNMPv2-SMI::enterprises.6876.3.2.1.0 = Gauge32: 83818332
SNMPv2-SMI::enterprises.6876.3.2.2.0 = Gauge32: 0
SNMPv2-SMI::enterprises.6876.3.2.3.0 = Gauge32: 83818332
SNMPv2-SMI::enterprises.6876.3.5.1.0 = INTEGER: 7
SNMPv2-SMI::enterprises.6876.3.5.2.1.2.1 = STRING: "vmhba0"
SNMPv2-SMI::enterprises.6876.3.5.2.1.2.2 = STRING: "vmhba1"
SNMPv2-SMI::enterprises.6876.3.5.2.1.2.3 = STRING: "vmhba2"
SNMPv2-SMI::enterprises.6876.3.5.2.1.2.4 = STRING: "vmhba32"
SNMPv2-SMI::enterprises.6876.3.5.2.1.2.5 = STRING: "vmhba33"
SNMPv2-SMI::enterprises.6876.3.5.2.1.2.6 = STRING: "vmhba34"
SNMPv2-SMI::enterprises.6876.3.5.2.1.2.7 = STRING: "vmhba35"

[root@localhost scripts]# snmpwalk -v2c -c TestCommunity 10.1.1.1 .1.3.6.1.4.1.6876.2
SNMPv2-SMI::enterprises.6876.2 = No Such Object available on this agent at this OID

]


Top
 Profile  
 
 Post subject: Re: ESXi 5.x template - no perl SDK, pure snmp
PostPosted: Wed Mar 26, 2014 2:30 am 
Offline
Cacti User

Joined: Tue Mar 18, 2008 2:30 am
Posts: 90
Location: Czech
bogd wrote:
This is great -thank you!!

One small problem, though - the PHP script getting the VM info (ss_esxi_vhosts.php) is hardcoded for SNMPv3. Could someone help me get this to work with SNMPv3?

The script calls cacti_snmp_walk, and changing that to use SNMPv3 seems possible. However, I do not know enough about the inner workings of Cacti to send all required information to the script - it will need a username, password, priv_pass, etc.

Thank you!

[ Edit: there seems to be something wrong with the script (or with my ESXi server). Even after enabling SNMPv2 on the host, there is no vmwVirtMachines OID (enterprises.vmware.2) - and since the script uses it to get all info related to VMs, there's nothing there.

[root@localhost scripts]# snmpwalk -v2c -c TestCommunity 10.1.1.1 .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: "5.5.0"
SNMPv2-SMI::enterprises.6876.1.4.0 = STRING: "1331820"
SNMPv2-SMI::enterprises.6876.1.5.0 = STRING: "0"
SNMPv2-SMI::enterprises.6876.1.6.0 = STRING: "0"
SNMPv2-SMI::enterprises.6876.3.1.1.0 = Gauge32: 2
SNMPv2-SMI::enterprises.6876.3.2.1.0 = Gauge32: 83818332
SNMPv2-SMI::enterprises.6876.3.2.2.0 = Gauge32: 0
SNMPv2-SMI::enterprises.6876.3.2.3.0 = Gauge32: 83818332
SNMPv2-SMI::enterprises.6876.3.5.1.0 = INTEGER: 7
SNMPv2-SMI::enterprises.6876.3.5.2.1.2.1 = STRING: "vmhba0"
SNMPv2-SMI::enterprises.6876.3.5.2.1.2.2 = STRING: "vmhba1"
SNMPv2-SMI::enterprises.6876.3.5.2.1.2.3 = STRING: "vmhba2"
SNMPv2-SMI::enterprises.6876.3.5.2.1.2.4 = STRING: "vmhba32"
SNMPv2-SMI::enterprises.6876.3.5.2.1.2.5 = STRING: "vmhba33"
SNMPv2-SMI::enterprises.6876.3.5.2.1.2.6 = STRING: "vmhba34"
SNMPv2-SMI::enterprises.6876.3.5.2.1.2.7 = STRING: "vmhba35"

[root@localhost scripts]# snmpwalk -v2c -c TestCommunity 10.1.1.1 .1.3.6.1.4.1.6876.2
SNMPv2-SMI::enterprises.6876.2 = No Such Object available on this agent at this OID

]


SNMP v3 isn't hardcoded. I used "universal" script for all version of snmp. It will be used version, which is selected in cacti. I think, that ESXi use 1/2c only. You cannot use v3.

I haven't problem with your snmp example. I tested it on 5.1 and 5.5:
root@kaktus ~ # snmpwalk -v2c -c xxx u.v.w.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: "5.5.0"
SNMPv2-SMI::enterprises.6876.1.4.0 = STRING: "1331820"
SNMPv2-SMI::enterprises.6876.1.5.0 = STRING: "0"
SNMPv2-SMI::enterprises.6876.1.6.0 = STRING: "0"

root@kaktus ~ # snmpwalk -v2c -c xxx u.v.w.x .1.3.6.1.4.1.6876.2
SNMPv2-SMI::enterprises.6876.2.1.1.2.5 = STRING: "Cust1 SQL and AD"
SNMPv2-SMI::enterprises.6876.2.1.1.2.6 = STRING: "Cust1 Terminal"
SNMPv2-SMI::enterprises.6876.2.1.1.2.7 = STRING: "Cust2 SQL"
SNMPv2-SMI::enterprises.6876.2.1.1.2.8 = STRING: "Cust2 Terminal"
SNMPv2-SMI::enterprises.6876.2.1.1.2.10 = STRING: "Cust3 BSD"

_________________
Author of:
FreeBSD template
ESXi template
Intropage plugin
Multicore CPU average graph
HP MSM wifi controller 7xx
TopX plugin


Last edited by macan on Thu Mar 27, 2014 4:53 am, edited 1 time in total.

Top
 Profile  
 
 Post subject: Re: ESXi 5.x template - no perl SDK, pure snmp
PostPosted: Wed Mar 26, 2014 8:03 am 
Offline

Joined: Wed Mar 26, 2014 7:59 am
Posts: 5
Could you please export this template that this would work on Cacti version 8.7g?
Thx

Alex


Top
 Profile  
 
 Post subject: Re: ESXi 5.x template - no perl SDK, pure snmp
PostPosted: Wed Mar 26, 2014 8:14 am 
Offline
Cacti User

Joined: Tue Mar 18, 2008 2:30 am
Posts: 90
Location: Czech
alkocelj wrote:
Could you please export this template that this would work on Cacti version 8.7g?
Thx

Alex


You can try change template version hash. Howto is here http://docs.cacti.net/howto:determine_cacti_template_version.

Please let me know, if it works. Thank you :-)

_________________
Author of:
FreeBSD template
ESXi template
Intropage plugin
Multicore CPU average graph
HP MSM wifi controller 7xx
TopX plugin


Top
 Profile  
 
 Post subject: Re: ESXi 5.x template - no perl SDK, pure snmp
PostPosted: Mon Apr 07, 2014 6:28 pm 
Offline

Joined: Wed Mar 26, 2014 7:59 am
Posts: 5
I have tried and did not work. Maybe I am doing something wrong but I cannot import it.


Top
 Profile  
 
 Post subject: Re: ESXi 5.x template - no perl SDK, pure snmp
PostPosted: Tue Apr 15, 2014 6:24 pm 
Offline

Joined: Tue Apr 15, 2014 6:15 pm
Posts: 1
The vhosts graph looks great except the running hosts measurement always shows 0. I have 5 virtual machines running, 3 with tools 2 without.

Running ESXi 5.0

Attachment:
graph_image.png
graph_image.png [ 24.92 KiB | Viewed 21108 times ]


Top
 Profile  
 
 Post subject: Re: ESXi 5.x template - no perl SDK, pure snmp
PostPosted: Thu Apr 17, 2014 2:50 am 
Offline
Cacti User

Joined: Tue Mar 18, 2008 2:30 am
Posts: 90
Location: Czech
alkocelj wrote:
I have tried and did not work. Maybe I am doing something wrong but I cannot import it.


Try attached template. I reimported template only, It isn't tested on 0.8.7. If it fails, update your cacti instalation.


Attachments:
File comment: Template version 0.8.7g
cacti_host_template_esxi_5_x.xml [194.64 KiB]
Downloaded 1493 times

_________________
Author of:
FreeBSD template
ESXi template
Intropage plugin
Multicore CPU average graph
HP MSM wifi controller 7xx
TopX plugin
Top
 Profile  
 
 Post subject: Re: ESXi 5.x template - no perl SDK, pure snmp
PostPosted: Thu Apr 24, 2014 3:54 am 
Offline
Cacti User

Joined: Tue Mar 18, 2008 2:30 am
Posts: 90
Location: Czech
biohazard wrote:
The vhosts graph looks great except the running hosts measurement always shows 0. I have 5 virtual machines running, 3 with tools 2 without.

Running ESXi 5.0

Attachment:
graph_image.png


You are right. ESXI 5.0 uses different status. I fixed it, please download version 0.2 and overwrite file ss_esxi_vhosts.php in cacti_instalation/scripts/.

_________________
Author of:
FreeBSD template
ESXi template
Intropage plugin
Multicore CPU average graph
HP MSM wifi controller 7xx
TopX plugin


Top
 Profile  
 
 Post subject: Re: ESXi 5.x template - no perl SDK, pure snmp
PostPosted: Sun May 11, 2014 1:52 pm 
Offline

Joined: Fri May 31, 2013 2:06 pm
Posts: 19
Thanks for the templates. Much appreciated.

I'm having having trouble getting data on ESXi 5.5 U1 though

I seem to ge graphing logged in users and processes just fine.

For real memory, I had to increase the timeout on the host in order to get the used memory value.

The vhosts graph is reporting 0 for everything. I changed the log level to debug in cacti and there doesn't seem to be any errors. The values returned are all zero.

For the CPU, is there any way to get the % reported by the vmware client? I don't need to know the details of every core in my host, just want to see the % that is reported by vmware.

Do you take requests for more fun stats? :) I'm not good enough at making my own or figuring out how to read MIB files


Top
 Profile  
 
 Post subject: Re: ESXi 5.x template - no perl SDK, pure snmp
PostPosted: Wed May 14, 2014 5:35 am 
Offline
Cacti User

Joined: Tue Mar 18, 2008 2:30 am
Posts: 90
Location: Czech
ksdjfh wrote:
I'm having having trouble getting data on ESXi 5.5 U1 though
The vhosts graph is reporting 0 for everything. I changed the log level to debug in cacti and there doesn't seem to be any errors. The values returned are all zero.


I haven't 5.5 U1.Can you send me snmpwalk of your ESXI 5.5 U1?

ksdjfh wrote:
For the CPU, is there any way to get the % reported by the vmware client? I don't need to know the details of every core in my host, just want to see the % that is reported by vmware.

I didn't find this value :-(

ksdjfh wrote:
Do you take requests for more fun stats? :)

Ok, send me your requests

_________________
Author of:
FreeBSD template
ESXi template
Intropage plugin
Multicore CPU average graph
HP MSM wifi controller 7xx
TopX plugin


Top
 Profile  
 
 Post subject: Re: ESXi 5.x template - no perl SDK, pure snmp
PostPosted: Wed May 14, 2014 7:57 pm 
Offline

Joined: Fri May 31, 2013 2:06 pm
Posts: 19
macan wrote:
I haven't 5.5 U1.Can you send me snmpwalk of your ESXI 5.5 U1?


Using your snmpwalk suggestion, the info in this thread and a little luck, I figured this one out myself. Like another user, when I did an snmpwalk, I got something like this:

snmpwalk -v2c -c public 10.2.100.100 .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: "5.5.0"
SNMPv2-SMI::enterprises.6876.1.4.0 = STRING: "1746018"
SNMPv2-SMI::enterprises.6876.1.5.0 = STRING: "1"
SNMPv2-SMI::enterprises.6876.1.6.0 = STRING: "16"
SNMPv2-SMI::enterprises.6876.3.1.1.0 = Gauge32: 2
SNMPv2-SMI::enterprises.6876.3.2.1.0 = Gauge32: 201313300
SNMPv2-SMI::enterprises.6876.3.2.2.0 = Gauge32: 0
SNMPv2-SMI::enterprises.6876.3.2.3.0 = Gauge32: 201313300
SNMPv2-SMI::enterprises.6876.3.5.1.0 = INTEGER: 13
......

No 6876.2 which is what you're using to pull data. Originally I configured the /etc/vmware/snmp.conf file by hand which I guess ESXi didn't like.

To fix the problem I did:

esxcli system snmp set --reset
esxcli system snmp set --communities public
esxcli system snmp set --enable true

Then when I did an snmpwalk I got a lot more values and the graph started pulling data.

macan wrote:
I didn't find this value :-(


I think I have a workaround. Long story short, use your work to get the data, delete the graphs (but keep the data sources) and use something like this: https://bryanfullerton.com/2009/08/04/c ... e-machine/

I found that page about a year ago and used the info on it, and the page it links to in order to create the graphs I needed.

macan wrote:
Ok, send me your requests


Does vmware expose anything from esxtop, specifically stuff from d (disk adapter) or u (disk device)? Maybe graph commands per disk adapter (I use software iSCSI so i only have one vmhba that gives me any data) or mb read/write? I tried to read the mib files and it seems like the answer might be no (I found this nagios page which seems to indicate I would have to go the api route to pull any more detailed info: http://exchange.nagios.org/directory/Pl ... pi/details


Top
 Profile  
 
 Post subject: Re: ESXi 5.x template - no perl SDK, pure snmp
PostPosted: Thu May 15, 2014 2:29 am 
Offline
Cacti User

Joined: Tue Mar 18, 2008 2:30 am
Posts: 90
Location: Czech
ksdjfh wrote:
No 6876.2 which is what you're using to pull data. Originally I configured the /etc/vmware/snmp.conf file by hand which I guess ESXi didn't like.

To fix the problem I did:

esxcli system snmp set --reset
esxcli system snmp set --communities public
esxcli system snmp set --enable true

Then when I did an snmpwalk I got a lot more values and the graph started pulling data.

Interesting


ksdjfh wrote:
I think I have a workaround. Long story short, use your work to get the data, delete the graphs (but keep the data sources) and use something like this: https://bryanfullerton.com/2009/08/04/c ... e-machine/
I found that page about a year ago and used the info on it, and the page it links to in order to create the graphs I needed.


Do you know http://docs.cacti.net/plugin:aggregate?


ksdjfh wrote:
Does vmware expose anything from esxtop, specifically stuff from d (disk adapter) or u (disk device)? Maybe graph commands per disk adapter (I use software iSCSI so i only have one vmhba that gives me any data) or mb read/write? I tried to read the mib files and it seems like the answer might be no (I found this nagios page which seems to indicate I would have to go the api route to pull any more detailed info: http://exchange.nagios.org/directory/Pl ... pi/details

I think, that answer is no. It isn't posibble to use SNMP for this. You have to use another way. Maybe ssh key exchange on cacti and pull data via script like:
ssh root@192.168.0.10 'uptime' | cut -d " " -f 9
0.17,

_________________
Author of:
FreeBSD template
ESXi template
Intropage plugin
Multicore CPU average graph
HP MSM wifi controller 7xx
TopX plugin


Top
 Profile  
 
 Post subject: Re: ESXi 5.x template - no perl SDK, pure snmp
PostPosted: Sat May 24, 2014 2:56 pm 
Offline

Joined: Fri May 31, 2013 2:06 pm
Posts: 19
macan wrote:
ksdjfh wrote:
I think I have a workaround. Long story short, use your work to get the data, delete the graphs (but keep the data sources) and use something like this: https://bryanfullerton.com/2009/08/04/c ... e-machine/
I found that page about a year ago and used the info on it, and the page it links to in order to create the graphs I needed.


Do you know http://docs.cacti.net/plugin:aggregate?


Do you know how to do this? I've been trying to get the graph I want but I'm going in circles. I can create a basic aggregate graph and convert the area to line graphs. My problem is I would like to see an extra line on there to show the average (or maybe even hide all the individual cpus and just show a line for the average). Also in the legend, I do not want to see CPU1, CPU2, CPU3, etc. It gets very long when you have 20+ cores. Just want to see the total average of all cpus.


Top
 Profile  
 
 Post subject: Re: ESXi 5.x template - no perl SDK, pure snmp
PostPosted: Fri Jun 06, 2014 1:54 am 
Offline
Cacti User

Joined: Tue Mar 18, 2008 2:30 am
Posts: 90
Location: Czech
ksdjfh wrote:
Do you know how to do this? I've been trying to get the graph I want but I'm going in circles. I can create a basic aggregate graph and convert the area to line graphs. My problem is I would like to see an extra line on there to show the average (or maybe even hide all the individual cpus and just show a line for the average). Also in the legend, I do not want to see CPU1, CPU2, CPU3, etc. It gets very long when you have 20+ cores. Just want to see the total average of all cpus.


Hi, I prepared multicpu avg tempate. There is one line line - avg load for all cores.
I created new topic for this graph template:
MultiCPU avg load


Attachments:
File comment: Screenshot of multicpu avg
multicpu_avg.png
multicpu_avg.png [ 22.34 KiB | Viewed 20440 times ]
File comment: Multicpu avg template
multicpu_avg_01.tgz [25.02 KiB]
Downloaded 727 times

_________________
Author of:
FreeBSD template
ESXi template
Intropage plugin
Multicore CPU average graph
HP MSM wifi controller 7xx
TopX plugin
Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 51 posts ]  Go to page 1, 2, 3, 4  Next

All times are UTC - 5 hours


Who is online

Users browsing this forum: Bing [Bot], juliangomezr and 4 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  

Protected by Anti-Spam ACP Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group