Metadata-Version: 2.1
Name: zhmc_prometheus_exporter
Version: 1.5.2
Summary: IBM Z HMC Prometheus Exporter
Home-page: https://github.com/zhmcclient/zhmc-prometheus-exporter
Author: Jakob Naucke
Author-email: jakob.naucke@ibm.com
Maintainer: Andreas Maier, Kathir Velusamy
Maintainer-email: maiera@de.ibm.com, kathir.velu@in.ibm.com
License: Apache License, Version 2.0
Project-URL: Bug Tracker, https://github.com/zhmcclient/zhmc-prometheus-exporter/issues
Project-URL: Documentation, https://zhmc-prometheus-exporter.readthedocs.io/en/stable/
Project-URL: Change Log, https://zhmc-prometheus-exporter.readthedocs.io/en/stable/changes.html
Platform: any
Classifier: Development Status :: 5 - Production/Stable
Classifier: Environment :: Console
Classifier: Intended Audience :: Information Technology
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Requires-Python: >=3.6
Description-Content-Type: text/x-rst
License-File: LICENSE
Requires-Dist: zhmcclient >=1.9.1
Requires-Dist: urllib3 >=1.25.18
Requires-Dist: jsonschema >=3.2.0
Requires-Dist: prometheus-client >=0.17.1 ; python_version <= "3.7"
Requires-Dist: Jinja2 >=3.0.3 ; python_version == "3.6"
Requires-Dist: pyrsistent >=0.17.3 ; python_version == "3.6"
Requires-Dist: PyYAML !=5.4.0,!=5.4.1,!=6.0.0,>=5.3.1 ; python_version >= "3.12"
Requires-Dist: PyYAML !=5.4.0,!=5.4.1,>=5.3.1 ; python_version >= "3.6" and python_version <= "3.11"
Requires-Dist: Jinja2 >=3.1.3 ; python_version >= "3.7"
Requires-Dist: pyrsistent >=0.18.1 ; python_version >= "3.7"
Requires-Dist: prometheus-client >=0.19.0 ; python_version >= "3.8"

.. Copyright 2018 IBM Corp. All Rights Reserved.
..
.. Licensed under the Apache License, Version 2.0 (the "License");
.. you may not use this file except in compliance with the License.
.. You may obtain a copy of the License at
..
..    http://www.apache.org/licenses/LICENSE-2.0
..
.. Unless required by applicable law or agreed to in writing, software
.. distributed under the License is distributed on an "AS IS" BASIS,
.. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
.. See the License for the specific language governing permissions and
.. limitations under the License.

IBM Z HMC Prometheus Exporter
=============================

.. image:: https://img.shields.io/pypi/v/zhmc-prometheus-exporter.svg
    :target: https://pypi.python.org/pypi/zhmc-prometheus-exporter/
    :alt: Version on Pypi

.. image:: https://github.com/zhmcclient/zhmc-prometheus-exporter/actions/workflows/test.yml/badge.svg?branch=master
    :target: https://github.com/zhmcclient/zhmc-prometheus-exporter/actions/workflows/test.yml?query=branch%3Amaster
    :alt: Test status (master)

.. image:: https://readthedocs.org/projects/zhmc-prometheus-exporter/badge/?version=latest
    :target: https://readthedocs.org/projects/zhmc-prometheus-exporter/builds/
    :alt: Docs status (master)

.. image:: https://coveralls.io/repos/github/zhmcclient/zhmc-prometheus-exporter/badge.svg?branch=master
    :target: https://coveralls.io/github/zhmcclient/zhmc-prometheus-exporter?branch=master
    :alt: Test coverage (master)

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.

.. _IBM Z: https://www.ibm.com/it-infrastructure/z
.. _Prometheus exporter: https://prometheus.io/docs/instrumenting/exporters/
.. _Prometheus: https://prometheus.io

Documentation
-------------

* `Documentation`_
* `Change log`_

.. _Documentation: https://zhmc-prometheus-exporter.readthedocs.io/en/stable/
.. _Change log: https://zhmc-prometheus-exporter.readthedocs.io/en/stable/changes.html

Quickstart
----------

* Install the exporter and all of its Python dependencies as follows:

  .. code-block:: bash

      $ 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`_.

.. _HMC credentials file: https://zhmc-prometheus-exporter.readthedocs.io/en/stable/usage.html#hmc-credentials-file
.. _sample HMC credentials file: https://zhmc-prometheus-exporter.readthedocs.io/en/stable/usage.html#sample-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`_.

.. _Metric definition file: https://zhmc-prometheus-exporter.readthedocs.io/en/stable/usage.html#metric-definition-file
.. _sample metric definition file: https://zhmc-prometheus-exporter.readthedocs.io/en/stable/usage.html#sample-metric-definition-file

* Run the exporter as follows:

  .. code-block:: bash

      $ 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`_.

.. _issue on GitHub: https://github.com/zhmcclient/zhmc-prometheus-exporter/issues

License
-------

This package is licensed under the `Apache 2.0 License`_.

.. _Apache 2.0 License: http://apache.org/licenses/LICENSE-2.0
