1.1. What this package provides
The IBM Z HMC Prometheus Exporter is a Prometheus exporter written in Python that retrieves metrics from the IBM Z Hardware Management Console (HMC) and exports them to the Prometheus monitoring system.
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.
The exporter supports HTTP and HTTPS (with and without mutual TLS) for Prometheus.
1.2. Supported environments
Operating systems: Linux, macOS, Windows
Python versions: 3.6 and higher
HMC versions: 2.11.1 and higher
Install the exporter and all of its Python dependencies as follows:
$ pip install zhmc-prometheus-exporter
Note that an installation of Python packages using setup.py install is no longer recommended by the Python packaging community. For details, see https://blog.ganssle.io/articles/2021/10/setup-py-deprecated.html. Installation with setup.py install is no longer supported by this package.
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.yamland 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
-voption. Subsequent requests to the exporter will be sub-second.