https://github.com/sapcc/esxi-exporter
Prometheus ESXi exporter, which utilises the VMware SDK
https://github.com/sapcc/esxi-exporter
Last synced: about 1 year ago
JSON representation
Prometheus ESXi exporter, which utilises the VMware SDK
- Host: GitHub
- URL: https://github.com/sapcc/esxi-exporter
- Owner: sapcc
- License: apache-2.0
- Created: 2021-02-23T09:05:01.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2023-12-15T20:09:14.000Z (over 2 years ago)
- Last Synced: 2025-03-30T16:46:46.051Z (about 1 year ago)
- Language: Python
- Size: 96.7 KB
- Stars: 6
- Watchers: 50
- Forks: 1
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ESXi-exporter
Prometheus exporter, which utilises the _VMware SDK_ and _SSH_ to get metrics from _VMware ESXi-HostSystems_.
## About
This exporter contains a `critical service collector` and a `overall state collector`. It monitors the service state of services like `hostd` or `ntpd` and gathers the _ESXi-HostSystem_ `overallState` from _vCenters_.
## Getting started
1. Configure the project
- Credentials are passed by environment variables.
- `config.yaml` contains some static configuration
- There are command-line options for more console output
2. Run `exporter.py` with _python3_
**Environment variables**
- `VCENTER_USER` the vCenter username.
- `VCENTER_PASSWORD` the vCenter password.
- `VCENTER_MPW` if set, master_password mechanism will be used.
- `ESXI_USER` the ESXi-host ssh username.
- `ESXI_PASSWORD` the ESXi-host ssh password.
- `ATLAS_FILE` the path to the [atlas file](https://github.com/sapcc/atlas) containing esxi_hosts and vcenters.
- `CONFIG_FILE` path to config file.
**Command-line arguments**
- `-v` sets logger to info output
- `-vv` sets logger to debug output
## Atlas
https://github.com/sapcc/atlas
This is an atlas scheme reduced to the information required by this exporter.
```json
[
{
"labels": {
"job": "vmware-esxi or vcenter",
"name": "",
"server_name": "",
"status": "Active",
"site": ""
}
},
]
```
## Structure
- All collectors inherit from the `BaseCollector`
- _Interfaces_ are used to provide a common exchange data type. Eg it defines how a _Host_ and a _Vcenter_ should be passed around. (the term _interface_ is used as in _Angular/Typescript_ vocabular)
- _Modules_ provide shared core functionality
- _api_ → very basic functionality. Enables connectivity to ESXi-hosts etc. They are designed in an interchangeable manner. See helpers which are some kind of wrapper.
- _helper_ → Are some kind of wrapper which combine different APIs in order to provide a unified interface. If an api-file gets interchanged, the helper/wrapper still expects the same format as before. For instance if you want to use a different SSH-library than paramiko then change the ssh-api-file in the api folder and make sure it still returns the console output of the remote host as before.
- _configuration_ → some small models that collect configuration from yaml, environment and commandline arguments in order to provide configuration in a dynamic and scoped manner to specific parts of the exporter.
- exporter.py is the entry point. It dynamicly invokes collectors based on the configuration and sets up the whole program.