Grafana Dashboard for vCloud Director

One of the points on my bucket list for 2018 was to learn more about Grafana. So I decided to create my own Grafana Dashboard for vCloud Director. Like my vCloud Director Tenant HTML Report should the Dashboard also work from Tenant perspective. As further requirements I have decided that Ubuntu should be the platform and no external data sources should be required.

With this list of requirement I did some research to find the best fitting tools. I decided to use InfluxDB as Data Source for Grafana and Telegraf as Collector Agent. Telegraf uses Input Plugins to gather data. With the Exec Input Plugin Telegraf is able to execute a script and use the output as metric data. With PowerShell Core multi-platform support also a PowerShell script is possible, which is my preferred scripting language.

Collection Process:

  1. PowerShell Script utilizes the vCloud Director RESTful API to create metrics and tags
  2. Telegraf collects output of the Script
  3. Telegraf pushed the metrics and tags  into InfluxDB
  4. Grafana Dashboard used metrics and tags from InfluxDB

Jorge de la Cruz created a great diagram of the Grafana collection workflow in his blog post: Looking for the Perfect Dashboard: InfluxDB, Telegraf and Grafana – Part VIII (Monitoring Veeam using Veeam Enterprise Manager)

Backend of the Grafana Dashboard for vCloud Director

I will give a quick wrap up of my installation on my Ubuntu 16.04 box.

InfluxDB

Add repository:

Install InfluxDB:

Start and enable service:

Create InfluxDB user and database:

You need to enter Influx Shell first: influx

Grafana Dashboard for vCloud Director - Create User and DB

Configure connection:

Connection details need to be configured in influxdb.conf :  sudo vi /etc/influxdb/influxdb.conf

Grafana Dashboard for vCloud Director - Configure Connection

Restart service:

Telegraf

Install Telegraf and prerequirements:

Use all installed MIBs:

You need to modify the snmp.confsudo vi /etc/snmp/snmp.conf

Configure output:

The output setting in telegraf.conf must match the InfluxDB configuration:  sudo vi /etc/telegraf/telegraf.conf

Grafana Dashboard for vCloud Director - Configure output

Grafana

Add repository:

Install Grafana:

You are now able to access the Grafana site via http://<Yout IP>:3000 and configure the InfluxDB data source:

Grafana Dashboard for vCloud Director - Configure InfluxDB Data Source

Grafana Dashboard for vCloud Director - Configure InfluxDB Data Source Details

PowerShell

Add repository:

Install PowerShell:

Configuration of the Grafana Dashboard for vCloud Director

Telegraf

Just append a new section to the telegraf.conf :  sudo vi /etc/telegraf/telegraf.conf

PowerShell Script

To run the Script a json file for the configuration is needed in addition. Both files (config only as example) are available in my GitHub Repository Grafana-Telegraf-vCloud-PsCore. I typically use git to sync the script between my workstation and the Grafana box: just use initially   git clone https://github.com/mycloudrevolution/Grafana-Telegraf-vCloud-PsCore.git and for updates  git pull

The json configuration contains the FQDN of the vCloud Director instance and the Base64 Hash of Username and Password.

Note:

The un-hashed username format needs to be: <User>@<Org>

The Base64 hash can be created with a simple PowerShell Script:

Details of Grafana Dashboard for vCloud Director

The Dashboard has at the moment four different sections, Summary, OrgVdc Usage, vApp Usage and Org Network / Edge Gateway Usage.

Summary

The Summary section shows the most import stats of your organization.

Grafana Dashboard for vCloud Director - Dashboard Summary

OrgVdc Usage

In this section the resource usage per OrgVdc is visualized.

Grafana Dashboard for vCloud Director - Dashboard OrgVdc

vApp Usage

In this section the storage usage of all vApp and CPU und RAM usage of powered on vApps is visualized.

Grafana Dashboard for vCloud Director - Dashboard vApp

Org Network and Edge Gateway Usage

This sections visualizes the IP allocation per Org Network and number of connected networks per Edge Gateway.

Grafana Dashboard for vCloud Director - Dashboard Org Net and Edge Gateway

 

2 Comments

  1. Dany 11. April 2018

Leave a Reply