Vmware ESX: Graph VMFS Volumes

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

Moderators: Developers, Moderators

Post Reply
computer_guru
Cacti User
Posts: 141
Joined: Thu Apr 10, 2008 6:52 pm

Vmware ESX: Graph VMFS Volumes

Post by computer_guru »

Prerequisites:

- Cacti Version 0.8.7e
- SSH v2 (most linux boxes already have this)


Install Steps:
- Import all templates.

- Put .pl file in scripts folder (make sure apache user has access to the script)

- SSH trust setup (with keys ) between your cacti server and each ESX box.

- Please read this on how to setup the SSH Trust
(http://www.puddingonline.com/~dave/publ ... html#ss4.3)
*See notes below before the next step!!

- Add data query to each ESX host in cacti

- Graph the new VMFS volumes



SSH Trust Notes:
I am using cactiEZ, so I had to copy /root/.ssh/* to /var/www/.shh/. This makes all hosts that the root user trusts as trusted for the user apache.
Be sure that you setup SSH finger print trusts (the "known_hosts" file) with each ESX box using exact name cacti uses.
If cacti uses ip to talk with ESX box then you must connect once with root user using ip and say "yes" to the "Do you want to trust?" message. Then copy the "known_hosts" file to the .ssh folder for the user apache.


Here are some sample steps and commands used to setup the SSH trust. Use the link above for more detail:

On cacti server:
ssh-keygen -t rsa (hit enter at all prompts)
copy the .pub file to each ESX box.

On each ESX box:
mkdir /root/.ssh
cd .ssh
touch authorized_keys2
chmod 600 authorized_keys2
cat ../id_rsa.pub >> authorized_keys2 (using the .pub file you copied from your cacti box)
rm ../id_rsa.pub (remove .put file from ESX box, not needed now that it is authorized)

on cacti server:
1. ssh ESX box: ssh -2 root@host.domain.tld (using the exact name/ip/fqdn that cacti uses)
2. say "yes" to any prompts
3. repeat steps 1 and 2 for all ESX boxes.
4. copy ssh files to apache user:
-- cp /root/.ssh/* /var/www/.ssh/ (where /var/www is the $HOME for user apache)
5. change ownership: chown apache:apache /var/www/.ssh/*

All done with SSH Trust.

don't forget to add the query to your ESX host in Cacti and create the graphs.

I used "Included Dependencies" while exporting. I'm not sure how that will affect people who import.

Updated 8/10/10: For ESXi 4.1 you have to edit the attached .pl script. Replace "vdf -P" with just "df"
Attachments
Data-Query_ESX - Get Mounted VMFS Volumes.xml
data query
(13.66 KiB) Downloaded 233 times
Data-Template_ESX - Hard Disk Space.xml
data template
(4.63 KiB) Downloaded 195 times
Graph-Template_ESX - Used Disk Space.xml
graph template
(11.9 KiB) Downloaded 207 times
query_esx_partitions.pl
perl script
(1.17 KiB) Downloaded 211 times
Last edited by computer_guru on Tue Aug 10, 2010 5:58 pm, edited 1 time in total.
computer_guru
Cacti User
Posts: 141
Joined: Thu Apr 10, 2008 6:52 pm

sample graphs

Post by computer_guru »

sample graphs
Attachments
data_query_sample.jpg
data_query_sample.jpg (37.53 KiB) Viewed 3540 times
sample1.jpg
sample1.jpg (86.29 KiB) Viewed 3543 times
sample2.jpg
sample2.jpg (79.97 KiB) Viewed 3543 times
phantagom
Posts: 1
Joined: Fri Jan 29, 2010 4:56 am

Post by phantagom »

Looks great,

but I am missing esx_partition.xml

+ Could not find data query XML file at '/usr/share/cacti/site/resource/script_queries/esx_partition.xml'

could you post this one?
computer_guru
Cacti User
Posts: 141
Joined: Thu Apr 10, 2008 6:52 pm

Post by computer_guru »

I thought the data query .xml file was the one you mentioned.

Oh well, just shows that I have not shared this type of information before.

I've attached the file you need.
Attachments
esx_partition.xml
resource/script_queries/
(1.37 KiB) Downloaded 176 times
Post Reply

Who is online

Users browsing this forum: No registered users and 7 guests