Code Monkey home page Code Monkey logo

vsphere-vcenter-influx-go's Introduction

Collect VMware vCenter and ESXi performance metrics and send them to InfluxDB

Screenshots of Grafana dashboards

screenshot screenshot screenshot screenshot screenshot screenshot screenshot screenshot

Description and Features

This is a tool written in Go that helps you do your own custom tailored monitoring, capacity planning and performance debugging of VMware based infrastructures. It collects all possible metrics from vCenters and ESXi hypervisors about hosts, clusters, resource pools, datastores and virtual machines and sends them to an InfluxDB database (a popular open source time series database project written in Go), which you can then visualise in Grafana (links to sample dashboards below) or Chronograf, and use Grafana, Kapacitor or custom scripts to do alerting based on your needs, KPIs, capacity plannings/expectations.

Install

Step 1: Download the latest release by executing below command

wget https://github.com/vikramjakhr/vsphere-vcenter-influx-go/releases/download/v1.0.0/vsphere-vcenter-influx-go

Step 2: Download the config json after executing below command, and do changes related to host and influx configuration

wget https://github.com/vikramjakhr/vsphere-vcenter-influx-go/blob/master/vsphere-influxdb.json

Step 3: Now make the binary executable by running below command

chmod 755 vsphere-vcenter-influx-go

Step 4: Now move the json file into /etc by executing below command

mv vsphere-influxdb.json /etc

Step 5: Start the binary by executing below command

./vsphere-vcenter-influx-go

Configure

The JSON configuration file in /etc/vsphere-influxdb-go.json contains all your vCenters/ESXi to connect to, the InfluxDB connection details(url, username/password, database to use), and the metrics to collect(full list here ).

Note: Not all metrics are available directly, you might need to change your metric collection level. A table with the level needed for each metric is availble here, and you can find a python script to change the collect level in the tools folder of the project.

Additionally you can provide a vCenter/ESXi server and InfluxDB connection details via environment variables, wich is extremly helpful when running inside a container:

For InfluxDB:

  • INFLUX_HOSTNAME
  • INFLUX_USERNAME
  • INFLUX_PASSWORD
  • INFLUX_DATABASE

For vSphere:

  • VSPHERE_HOSTNAME
  • VSPHERE_USERNAME
  • VSPHERE_PASSWORD

Keep in mind, that currently only one vCenter/ESXi can be added via environment variable.

If you set a domain, it will be automaticaly removed from the names of the found objects.

Metrics collected are defined by associating ObjectType groups with Metric groups.

There have been reports of the script not working correctly when the time is incorrect on the vsphere or vcenter. Make sure that the time is valid or activate the NTP service on the machine.

Run as a service

Create a crontab to run it every X minutes(one minute is fine - in our case, ~30 vCenters, ~100 ESXi and ~1400 VMs take approximately 25s to collect all metrics - rather impressive, i might add).

* * * * * /usr/local/bin/vsphere-influxdb-go

Example dashboards

Contributions welcome!

Compile from source

go get github.com/vikramjakhr/vsphere-vcenter-influx-go

This will install the project in your $GOBIN($GOPATH/bin). If you have appended $GOBIN to your $PATH, you will be able to call it directly. Otherwise, you'll have to call it with its full path. Example:

vsphere-vcenter-influx-go

or :

$GOBIN/vsphere-vcenter-influx-go

Contributing

You are welcome to contribute!

vsphere-vcenter-influx-go's People

Contributors

adongy avatar cedr-x avatar lucaszhangyz avatar mikerosile avatar sofixa avatar vikramjakhr avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.