Git Product home page Git Product logo

vsphere-influxdb-go's Introduction

Go Report Card

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

External dependencies

You'll need to go get them both for the script to work:

go get github.com/vmware/govmomi
go get github.com/influxdata/influxdb/client/v2

Run


go get github.com/oxalide/vsphere-influxdb-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-influxdb-go

or :

$GOBIN/vsphere-influxdb-go

Configure

You'll need a JSON file with all your vCenters/ESXi to connect to, the InfluxDB connection details(url, username/password, database to use), and the metrics to collect.

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. To see all available metrics, check out this page.

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 PowerCLI script that changes the collect level here

An example of configuration file is here.

You need to place it at /etc/binaryname.json (/etc/vsphere-influxdb.json by default) or you can specify a different location using the config flag.

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).

* * * * * $HOME/work/go/bin/vsphere-influxdb-go

TODO

  • Add service discovery(or probably something like Viper for easier and more flexible configuration with multiple backends)
  • Add extra tags(cluster for the hosts, etc.)

Contributing

You are welcome to contribute!

License

The original project, upon which this one is based, is written by cblomart, sends the data to Graphite, and is available here.

This one is licensed under GPLv3. You can find a copy of the license in LICENSE.txt

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.