IBM Z HMC Prometheus Exporter
Project description
IBM Z HMC Prometheus Exporter
The IBM Z HMC Prometheus Exporter is a [Prometheus exporter](https://prometheus.io/docs/instrumenting/exporters written in Python that retrieves metrics from the IBM Z Hardware Management Console (HMC) and exports them to the Prometheus monitoring system.
The exporter supports all metrics provided by the Z HMC and in addition a number of useful metrics that are based on properties of HMC resources (e.g. memory or CPU weight of LPARs). The resource property based metrics are obtained in the background via change notifications emitted by the HMC and via asynchronous retrieval for properties where change notifications are not supported. This keeps the time for providing the metric data to Prometheus short (sub-second to a few seconds).
The exporter attempts to stay up as much as possible, for example it performs automatic session renewals with the HMC if the logon session expires, and it survives HMC reboots and automatically picks up metrics collection again once the HMC come back up.
Documentation
Quickstart
-
Install the exporter and all of its Python dependencies as follows:
$ pip install zhmc-prometheus-exporter
-
Provide an HMC credentials file for use by the exporter.
The HMC credentials file tells the exporter which HMC to talk to for obtaining metrics, and which userid and password to use for logging on to the HMC.
It also defines whether HTTP or HTTPS is used for Prometheus, and HTTPS related certificates and keys.
Download the sample HMC credentials file as
hmccreds.yaml
and edit that copy accordingly.For details, see HMC credentials file.
-
Provide a metric definition file for use by the exporter.
The metric definition file maps the metrics returned by the HMC to metrics exported to Prometheus.
Furthermore, the metric definition file allows optimizing the access time to the HMC by disabling the fetching of metrics that are not needed.
Download the sample metric definition file as
metrics.yaml
. It can be used as it is and will have all metrics enabled and mapped properly. You only need to edit the file if you want to adjust the metric names, labels, or metric descriptions, or if you want to optimize access time by disabling metrics not needed.For details, see Metric definition file.
-
Run the exporter as follows:
$ zhmc_prometheus_exporter -c hmccreds.yaml -m metrics.yaml Exporter is up and running on port 9291
Depending on the number of CPCs managed by your HMC, and dependent on how many metrics are enabled, it will take some time until the exporter reports to be up and running. You can see what it does in the mean time by using the
-v
option. Subsequent requests to the exporter will be sub-second. -
Direct your web browser at http://localhost:9291 (or https://localhost:9291 when using HTTPS) to see the exported Prometheus metrics. Refreshing the browser will update the metrics.
Reporting issues
If you encounter a problem, please report it as an issue on GitHub.
License
This package is licensed under the Apache 2.0 License.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file zhmc_prometheus_exporter-1.7.0.tar.gz
.
File metadata
- Download URL: zhmc_prometheus_exporter-1.7.0.tar.gz
- Upload date:
- Size: 78.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.0 CPython/3.12.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1ec0ccfcc73c5466d764718f6d55f6d2512a49ab0893ab1c57c351a598aae6e4 |
|
MD5 | d38234c368b83e42d48449836d0b3927 |
|
BLAKE2b-256 | 2abd653f0e371292a52153594547273e8daf48131e4e5e41aa38d3f0bc57caf8 |
File details
Details for the file zhmc_prometheus_exporter-1.7.0-py2.py3-none-any.whl
.
File metadata
- Download URL: zhmc_prometheus_exporter-1.7.0-py2.py3-none-any.whl
- Upload date:
- Size: 84.4 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.0 CPython/3.12.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1ccc2e198853a96d5587c3ad9d27dd621cfbb07ed1a3e828785c36837e62ef42 |
|
MD5 | 423a396ccfff904a20ca9f623de6a83f |
|
BLAKE2b-256 | 1941608664744711f2a133c22ac8bea08b44a272d0ba825aec9eec33b9ac40c0 |