{"id":25515228,"url":"https://github.com/cblomart/vsphere-graphite","last_synced_at":"2025-04-10T19:25:28.741Z","repository":{"id":5803927,"uuid":"53964348","full_name":"cblomart/vsphere-graphite","owner":"cblomart","description":"VMware vSphere stats to storage backends as graphite, influxdb, elasticsearch or prometheus","archived":false,"fork":false,"pushed_at":"2023-05-08T21:07:18.000Z","size":9777,"stargazers_count":62,"open_issues_count":19,"forks_count":20,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-03-24T17:01:55.904Z","etag":null,"topics":["dashboard","elasticsearch","fluent","fluentd","grafana","graphite","influx","influxdb","kafka","monitoring","prometheus","statistics","vsphere"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cblomart.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-03-15T17:23:07.000Z","updated_at":"2025-02-21T20:41:07.000Z","dependencies_parsed_at":"2024-06-20T04:39:30.345Z","dependency_job_id":"145fb652-07d1-4126-a199-66a10f7189ff","html_url":"https://github.com/cblomart/vsphere-graphite","commit_stats":null,"previous_names":[],"tags_count":22,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cblomart%2Fvsphere-graphite","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cblomart%2Fvsphere-graphite/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cblomart%2Fvsphere-graphite/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cblomart%2Fvsphere-graphite/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cblomart","download_url":"https://codeload.github.com/cblomart/vsphere-graphite/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248281388,"owners_count":21077423,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["dashboard","elasticsearch","fluent","fluentd","grafana","graphite","influx","influxdb","kafka","monitoring","prometheus","statistics","vsphere"],"created_at":"2025-02-19T13:19:38.609Z","updated_at":"2025-04-10T19:25:28.719Z","avatar_url":"https://github.com/cblomart.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# vSphere Graphite [![Tweet](https://img.shields.io/twitter/url/http/shields.io.svg?style=social)](Open+up++your+%20vmware+%20vsphere+statistics+with+https://github.com/cblomart/vsphere-graphite)\n\n[![Build Status](https://cloud.drone.io/api/badges/cblomart/vsphere-graphite/status.svg)](https://cloud.drone.io/cblomart/vsphere-graphite) [![Go Report Card](https://goreportcard.com/badge/github.com/cblomart/vsphere-graphite)](https://goreportcard.com/report/github.com/cblomart/vsphere-graphite) [![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Fcblomart%2Fvsphere-graphite.svg?type=shield)](https://app.fossa.io/projects/git%2Bgithub.com%2Fcblomart%2Fvsphere-graphite?ref=badge_shield)\n\nMonitors VMware vSphere stats using govmomi. Sinks metrics to one of many time series backends.\n\nWritten in go to achieve fast sampling rates and high throughput sink. Successfully benchmarked against 3000 VM's, logging 150,000 metrics per minute to an ElasticSearch backend.\n\nCompatible backends:\n\n* [prometheus](https://prometheus.io/)\n* [influxdb](https://www.influxdata.com/)\n* [fluentd](https://www.fluentd.org/)\n* [elasticsearch](https://www.elastic.co/)\n* [graphite](https://graphiteapp.org/)\n* [kafka](https://kafka.apache.org)\n\n## Example dashboard\n\nThe dashboard example below is using the grafana UI. The backend is using ElasticSearch.\n\n![Example Dashboard](./imgs/vsphere-graphite-elastic-grafana-dashboard-1.png)\n\n## Configuration\n\nDefine vSphere credentials and collection metrics in the JSON config file. An example configuration for the Contoso domain is found [here](./vsphere-graphite-example.json).\n\nCopy this config file to /etc/*binaryname*.json and modify as needed. \nAs in windows \"/etc\" doesn't exist, the configuration file should be placed in the same directory as the vsphere-graphite binary.\n\nExample:\n\u003e cp vsphere-graphite-example.json /etc/vsphere-graphite.json\n\n\n\n\u003c!-- provide link to vcenter roles and permissions --\u003e\n\nMetrics collection is performed by associating ObjectType groups with Metric groups.\nThese are expressed via the vsphere scheme: *group*.*metric*.*rollup*\n\nObjectTypes are explained in [this](https://code.vmware.com/web/dp/explorer-apis?id=196) vSphere doc.\n\nPerformance metrics are explained in [this](https://docs.vmware.com/en/VMware-vSphere/6.5/com.vmware.vsphere.monitoring.doc/GUID-E95BD7F2-72CF-4A1B-93DA-E4ABE20DD1CC.html) vSphere doc.\n\nYou can select the extra data collected by using the \"Properties\" property:\n\n* datastore: reports the datastores associated with a virtual machine\n* host: reports the host the virtual machine runs on\n* cluster: reports the cluster the virtual machine is in\n* network: reports the network the virtual machine is connected to\n* resourcepool: reports the resourcepool the virtual machine is in\n* folder: reports the folder the virtual machine is in\n* tags: reports the tags associated with the virtual machine\n* numcpu: reports the number of virtual cpus the virtual machine has\n* memorysizemb: reports the quantity of memory the virtual machine has\n* disks: reports the logical disks capacity inside the virtual machine\n* **all**: reports all the information\n\n### vCenter parameters\n\nvCenter parameters can be set in the configuration file or via environment variable.\n\nThe configuration file needs the username, password and hostname of the vCenter (from [sample config](./vsphere-graphite-example.json)):\n\n```json\n\"VCenters\": [\n    { \"Username\": \"CONTOSO\\\\Administrator\", \"Password\": \"$P@ssw0rd\", \"Hostname\": \"vc1.contoso.com\" },\n    { \"Username\": \"CONTOSO\\\\Administrator\", \"Password\": \"$P@ssw0rd\", \"Hostname\": \"vc2.contoso.com\" }\n]\n```\n\nIf set via environment variable you can set multiple vcenters via ```VCENTER_*=\u003cusername\u003e:\u003cpassword\u003e@\u003chostname\u003e```\n\nTo follow the example given in the sample file:\n```\nVCENTER_VC1=CONTOSO\\\\Administrator:$P@ssw0rd@vc1.consoso.com\nVCENTER_VC2=CONTOSO\\\\Administrator:$P@ssw0rd@vc2.consoso.com\n```\n\n### Backend parameters\n\nBackend parameters can be set in the config and will always be overridden by environment variables.\nThis allows to use a generic config in a container image and set the backend by environment variables.\n\n* Type (CONFIG_TYPE): \n\n  Type of backend to use.\n\n  Currently \"graphite\", \"influxdb\", \"thinfluxdb\" (embeded influx client), \"elastic\", \"prometheus\", \"thinprometheus\" (embedded prometheus) \"fluentd\" and \"kafka\"\n\n* Hostname (CONFIG_HOSTNAME):\n\n  Hostname were the backend is running.\n\n  Prometheus will use this information to choose which interface (ip address) it listens to. An empty value means all interfaces. \n  \n  i.e: 127.0.0.1 would limit to localhost.\n\n* Port (CONFIG_PORT):\n\n  Port to connect to for the backend.\n\n  Prometheus will use this to choose which port to listen to. By default it listens to port 9155.\n\n* Encrypted (CONFIG_ENCRYPTED):\n\n  Enable or disable TLS to the backend (true, false).\n\n  Only supported by \"influx\", \"thininflux\" and \"elastic\" backends.\n\n\u003e\n\u003e Prometheus support for this would require certificate management.\n\u003e\n\n* Username (CONFIG_USERNAME):\n\n  Username to connect to the backend.\n\n  Only supported by \"influx\" and \"thininflux\" backends.\n  \n* Password (CONFIG_PASSWORD):\n\n  Password to connect to the backend.\n\n  Only supported by \"influx\" and \"thininflux\" backends.\n\n* Database (CONFIG_DATABASE):\n\n  Database to use in the backend.\n\n  Only supported by \"influx\", \"thininflux\", \"elastic\" and \"kafka\" (kafka topic name)\n\n* NoArray (CONFIG_NOARRAY):\n\n  Multiple values metadata will be send as csv 'array' by default (NoArray is true by default).\n  If set to false, only the first element is sent.\n\n* Prefix (CONFIG_PREFIX):\n\n  Prefix to use in the backend.\n\n### Advanced parameters ###\n\n\u003e **MOST OF THESE PARAMETERS SHOULDN'T BE TOUCHED**\n\nvCenter has limits on the quantity of data that can be returned in a request.\nThe configuration following configuraiton file parameters can modify when to split permormance request into multiple requests:\n\n* VCenterResultLimit: the limit of elements that can be returned in a request (defaults to  500000)\n* VCenterInstanceRatio: a metric can return multiple results related to the object instances connected to the host or VM. (disks, network interfaces; the default ratio is 3.0)\n\n## Execute vsphere-graphite as a container\n\nAll builds are pushed to docker:\n\n* [cblomart/vsphere-graphite](https://hub.docker.com/r/cblomart/vsphere-graphite/)\n* [cblomart/rpi-vsphere-graphite](https://hub.docker.com/r/cblomart/rpi-vsphere-graphite/)\n\nDefault tags includes:\n\n* commit for specific commit in the branch (useful to run from tip)\n* latest for latest release\n* specific release tag or version\n\nThe JSON configuration file can be passed by mounting to /etc. Edit the configuration file and set it in the place you like here $(pwd)\n\n  \u003e docker run -t -v $(pwd)/vsphere-graphite.json:/etc/vsphere-graphite.json cblomart/vsphere-graphite:latest\n\nBackend parameters can be set via environment variables to make docker user easier (having graphite or influx as another container).\n\n## Execute vsphere-graphite in swarm (docker-compose)\n\nA sample [docker compose file](./compose/vsphere-graphite-graphite-test.yml) is provided in the project.\nthis sample will start:\n\n* vcsim ([vCenter simulator by govmomi](https://github.com/vmware/govmomi/tree/master/vcsim))\n* graphite ([\"Official\" Graphite docker image](https://hub.docker.com/r/graphiteapp/graphite-statsd/)) the port 80 will be published to access the web interface.\n* vsphere-graphite with the necessary environment parameters to address the started backend and vcenter\n\nTo start this with swarm:\n\n```bash\n\u003e docker stack deploy -v vsphere-graphite-graphite-test.yml vsphere-graphite\n```\n\n\u003e Did you know that you can run docker stack on a standalone host... so no need for docker-compose. Just:\n\u003e\n\u003e ```bash\n\u003e \u003e docker swarm init\n\u003e ```\n\n## Execute vsphere-graphite in shell\n\nHeavily based on [govmomi](https://github.com/vmware/govmomi) but also on [daemon](github.com/takama/daemon) which provides simple daemon/service integration.\n\n### Install golang\n\nOf course [golang](https://golang.org) is needed.\nrefer to [install](https://golang.org/doc/install) and don't forget to set `$GOPATH`.\n\nGopath example:\n\n```bash\nmkdir /etc/golang\nexport GOPATH=/etc/golang\n```\n\nThen install vsphere-graphite with GO:\n\n  \u003e go get github.com/cblomart/vsphere-graphite\n\nThe executable should be `$GOPATH/bin/vsphere-graphite` and is now a binary for your architecture/OS\n\n### Run on Commandline\n\n  \u003e vsphere-graphite\n\n### Install as a service\n\n  \u003e vsphere-graphite install\n\n### Run as a service\n\n  \u003e vsphere-graphite start\n  \u003e\n  \u003e vsphere-graphite status\n  \u003e\n  \u003e vsphere-graphite stop\n\n### Remove service\n\n  \u003e vsphere-graphite remove\n\n## Contributors\n\nNo open source projects would live and thrive without common effort. Here is the section were the ones that help are thanked:\n\n* [sofixa](https://github.com/sofixa)\n* [BlueAceTS](https://github.com/BlueAceTS)\n* [NoMotion](https://github.com/NoMotion)\n* [korservick](https://github.com/korservick)\n* [MnrGreg](https://github.com/mnrgreg)\n* [fdmsantos](https://github.com/fdmsantos)\n* [dupondje](https://github.com/dupondje)\n* [jlothian](https://github.com/jlothian)\n\nAlso keep in mind that if you can't contribute code, issues and improvement requests are also a key part of a project evolution!\nSo don't hesitate and tell us what doesn't work or what you miss.\n\n## Donations\n\nThis project is largely alive because of the aforementioned contributors. Our time is precious bet it is even more precious to us when we can spend it on our beloved projects. So don't hesitate to make a donation (see badge)\n\n## License\n\nThe MIT License (MIT)\n\nCopyright (c) 2016 cblomart\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n## Licenses dependencies\n\n[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Fcblomart%2Fvsphere-graphite.svg?type=large)](https://app.fossa.io/projects/git%2Bgithub.com%2Fcblomart%2Fvsphere-graphite?ref=badge_large)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcblomart%2Fvsphere-graphite","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcblomart%2Fvsphere-graphite","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcblomart%2Fvsphere-graphite/lists"}