vSummary is an open source tool for collecting and displaying a summary of your vSphere Environment(s).
For a LIVE DEMO, please click this link:
vSummary is essentially a web application with both a frontend and backend. The backend accepts HTTP POST data in json format which it then normalizes and inserts/updates into various mysql tables. The frontend is where it displays this data for users to see. Here is a basic architectural diagram to visualize this:
Quick start - Docker
For a quicker deployment, a docker image is available (which does steps 1 to 6) with preinstalled nginx, php-fpm, mariadb, and vsummary source code. To run it please execute these commands:
Start container and bind it to port 80 on local machine
docker run --name vsummary -p 80:80 -d gbolo/vsummary
(optional) Load sample data into the database for testing
if you would like to load sample data into vsummary for testing, you may execute a php script inside the conatiner to do so:
docker exec -it vsummary php /data/gen_sample_data.php POSTING RANDOM SAMPLE DATA FOR VSUMMARY API: http://localhost/api/update.php --- [vcenter] SUCCESS! RESPONSE: 200 TIME: 0.101012s [datacenter] SUCCESS! RESPONSE: 200 TIME: 0.086264s [cluster] SUCCESS! RESPONSE: 200 TIME: 0.121073s [resourcepool] SUCCESS! RESPONSE: 200 TIME: 0.133168s [esxi] SUCCESS! RESPONSE: 200 TIME: 0.247572s [dvs] SUCCESS! RESPONSE: 200 TIME: 0.094093s [datastore] SUCCESS! RESPONSE: 200 TIME: 0.145601s [vm] SUCCESS! RESPONSE: 200 TIME: 0.359076s [portgroup] SUCCESS! RESPONSE: 200 TIME: 0.143704s [pnic] SUCCESS! RESPONSE: 200 TIME: 0.316546s [vnic] SUCCESS! RESPONSE: 200 TIME: 0.27136s [vdisk] SUCCESS! RESPONSE: 200 TIME: 0.277328s [folder] SUCCESS! RESPONSE: 200 TIME: 0.175527s
The following requirements for vSummary have been identified so far:
- WEB SERVER (nginx,apache,...)
- PHP 5.3+ (datatables php lib)
- MYSQL 5.0+ (support create views)
- POWERSHELL 3.0+ (convert-json, http-request)
- PYTHON 2.7+ OR POWERCLI 5.5+ (depending on collector chosen)
- vCenter 5.5+ (check api calls)
Installation (PowerShell Collector)
- Use an existing, or prepare a new web server that is able to execute php code. Ensure php can handle: pdo-mysql, json.
- Use an existing, or prepare a new mysql database that is at least version 5.0.
- Create a new database called vsummary with the following schema: mysql_schema
- Create a new mysql user and grant permissions to this database.
- Deploy vsummary source code (src folder) to the web root of the web server.
- Modify the file mysql_config.php with the correct database information.
- Prepare a Windows environment which has powershell version 3+ and vSphere PowerCLI 5.5+ installed
- Allow execution of powershell files that are not signed:
Set-ExecutionPolicy -Scope "CurrentUser" -ExecutionPolicy "unrestricted"
- Download the powershell script vsummary_collect.ps1 and modify the vcenter server list and api endpoint located near the end of the script.
- Execute the powershell script, then once complete visit your webserver address to see the results.
- Create an automated job to run this script X amount of times per day.
Installation (Python Collector)
Instructions comming soon...
This tool is under much development. ANY CONTRIBUTIONS WILL BE GREATLY APPRECIATED
The development of this tool was made possible by leveraging these other really cool opensource software:
Free Software, Hell Yeah!