Page MenuHomeSoftware Heritage

No OneTemporary

diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
deleted file mode 100644
index 9a2f1da..0000000
--- a/.github/workflows/ci.yml
+++ /dev/null
@@ -1,36 +0,0 @@
----
-name: CI
-
-# yamllint disable-line rule:truthy
-on:
- push:
- branches:
- - main
- - develop
- tags:
- - v*
- pull_request:
- branches:
- - main
- - develop
-
-jobs:
- lint:
- name: Lint
- runs-on: ubuntu-latest
-
- steps:
- - name: Checkout code
- uses: actions/checkout@v2
-
- - name: Install pylint / pyflakes
- run: sudo apt-get install --yes pylint pyflakes3
-
- - name: Install pve_exporter
- run: sudo pip install -e .
-
- - name: Run pylint
- run: pylint pve_exporter
-
- - name: Run pyflakes
- run: pyflakes3 src/pve_exporter
diff --git a/.github/workflows/pypi.yml b/.github/workflows/pypi.yml
deleted file mode 100644
index bc57d13..0000000
--- a/.github/workflows/pypi.yml
+++ /dev/null
@@ -1,24 +0,0 @@
----
-name: Upload Python Package
-
-# yamllint disable-line rule:truthy
-on:
- release:
- types: [created]
-
-jobs:
- deploy:
- runs-on: ubuntu-latest
- steps:
- - uses: actions/checkout@v2
-
- - name: Install dependencies
- run: sudo apt-get install --yes python3-wheel twine
-
- - name: Build and publish
- env:
- TWINE_USERNAME: __token__
- TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
- run: |
- python3 setup.py sdist bdist_wheel
- twine upload dist/*
diff --git a/.gitignore b/.gitignore
deleted file mode 100644
index 8fd5c32..0000000
--- a/.gitignore
+++ /dev/null
@@ -1,4 +0,0 @@
-build/
-dist/
-*.pyc
-*.egg-info
diff --git a/CHANGELOG.rst b/CHANGELOG.rst
deleted file mode 100644
index af45923..0000000
--- a/CHANGELOG.rst
+++ /dev/null
@@ -1,181 +0,0 @@
-Changelog
-=========
-
-All notable changes to this project will be documented in this file.
-
-The format is based on `Keep a Changelog`_ and this project adheres to
-`Semantic Versioning`_.
-
-`Unreleased`_
--------------
-
-`2.1.2`_ - 2021-04-04
----------------------
-
-Changed
-~~~~~~~
-
-- Migrate from travis to github actions (#68)
- Also switch to dockerhub automated builds
-- Update docker image to alpine 3.13.4 (#67)
-- Update docker image to alpine 3.13.3 (#65)
-
-`2.1.1`_ - 2021-03-05
----------------------
-
-Changed
-~~~~~~~
-
-- Do not fail scrape if some node is unresponsive (#63)
-
-`2.1.0`_ - 2021-02-19
----------------------
-
-Added
-~~~~~
-
-- Add command line flags to enable/disable individual collectors (#62)
-
-Changed
-~~~~~~~
-
-- Update docker base image
-
-`2.0.3`_ - 2020-12-17
----------------------
-
-Changed
-~~~~~~~
-
-- Fix version number
-
-`2.0.2`_ - 2020-12-17
----------------------
-
-Changed
-~~~~~~~
-
-- Update docker base image
-- Remove dead code (#52)
-
-`2.0.1`_ - 2020-10-21
----------------------
-
-Changed
-~~~~~~~
-
-- Update docker image to alpine 3.12.1 (#50)
-- Complete Python 3 transition (#49)
-- Fix packaging (#48)
-
-`2.0.0`_ - 2020-10-19
----------------------
-
-Added
-~~~~~
-
-- Add `pve_storage_shared` metric (#44)
-
-Removed
-~~~~~~~
-
-- Remove `ip` and `local` labels from `pve_node_info` gauge (#41)
-- Dropped support for Python 2
-
-`1.3.2`_ - 2020-07-02
----------------------
-
-Changed
-~~~~~~~
-
-- Fix pypi autopublishing
-
-`1.3.1`_ - 2020-07-02
----------------------
-
-Changed
-~~~~~~~
-
-- Fix pypi / dockerhub autopublishing (#40)
-
-`1.3.0`_ - 2020-07-02
----------------------
-
-Added
-~~~~~
-
-- Autopublish to pypi (#39)
-- Add dockerfile and autopublish to dockerhub (#38)
-- Move repo to prometheus-pve github org (#36, #37)
-
-
-`1.2.2`_ - 2020-05-18
----------------------
-
-Changed
-~~~~~~~
-
-- Fix failure when some node is unavailable (#31)
-
-`1.2.1`_ - 2020-05-03
----------------------
-
-Changed
-~~~~~~~
-
-- Refuse to start with invalid configuration (#29)
-- Log exceptions thrown during view rendering (#28)
-
-`1.2.0`_ - 2020-04-20
----------------------
-
-Added
-~~~~~
-
-- Add pve_onboot_status read from vm/container config (#22)
-
-`1.1.2`_ - 2018-10-17
----------------------
-
-Changed
-~~~~~~~
-
-- Fixed issues with VM names when PVE is down. (#14, #15)
-
-`1.1.1`_ - 2018-02-28
----------------------
-
-Changed
-~~~~~~~
-
-- Fix for target/module URL parameters being ignored, fixes #9 and #11
-
-
-`1.1.0`_ - 2018-01-22
----------------------
-
-Added
-~~~~~
-
-- IPv6 support
-
-
-.. _Keep a Changelog: http://keepachangelog.com/en/1.0.0/
-.. _Semantic Versioning: http://semver.org/spec/v2.0.0.html
-.. _Unreleased: https://github.com/prometheus-pve/prometheus-pve-exporter/compare/v2.1.2...HEAD
-.. _2.1.2: https://github.com/prometheus-pve/prometheus-pve-exporter/compare/v2.1.1...v2.1.2
-.. _2.1.1: https://github.com/prometheus-pve/prometheus-pve-exporter/compare/v2.1.0...v2.1.1
-.. _2.1.0: https://github.com/prometheus-pve/prometheus-pve-exporter/compare/v2.0.3...v2.1.0
-.. _2.0.3: https://github.com/prometheus-pve/prometheus-pve-exporter/compare/v2.0.2...v2.0.3
-.. _2.0.2: https://github.com/prometheus-pve/prometheus-pve-exporter/compare/v2.0.1...v2.0.2
-.. _2.0.1: https://github.com/prometheus-pve/prometheus-pve-exporter/compare/v2.0.0...v2.0.1
-.. _2.0.0: https://github.com/prometheus-pve/prometheus-pve-exporter/compare/v1.3.2...v2.0.0
-.. _1.3.2: https://github.com/prometheus-pve/prometheus-pve-exporter/compare/v1.3.1...v1.3.2
-.. _1.3.1: https://github.com/prometheus-pve/prometheus-pve-exporter/compare/v1.3.0...v1.3.1
-.. _1.3.0: https://github.com/prometheus-pve/prometheus-pve-exporter/compare/v1.2.2...v1.3.0
-.. _1.2.2: https://github.com/prometheus-pve/prometheus-pve-exporter/compare/v1.2.1...v1.2.2
-.. _1.2.1: https://github.com/prometheus-pve/prometheus-pve-exporter/compare/v1.2.0...v1.2.1
-.. _1.2.0: https://github.com/prometheus-pve/prometheus-pve-exporter/compare/v1.1.2...v1.2.0
-.. _1.1.2: https://github.com/prometheus-pve/prometheus-pve-exporter/compare/v1.1.1...v1.1.2
-.. _1.1.1: https://github.com/prometheus-pve/prometheus-pve-exporter/compare/v1.1.0...v1.1.1
-.. _1.1.0: https://github.com/prometheus-pve/prometheus-pve-exporter/compare/v1.0.0...v1.1.0
diff --git a/Dockerfile b/Dockerfile
deleted file mode 100644
index 95086d4..0000000
--- a/Dockerfile
+++ /dev/null
@@ -1,40 +0,0 @@
-ARG alpine_version=3.13.4
-
-FROM alpine:${alpine_version} as base
-RUN apk update && apk upgrade
-
-RUN apk add --no-cache \
- ca-certificates \
- py3-paramiko \
- py3-pip \
- py3-prometheus-client \
- py3-requests \
- py3-werkzeug \
- py3-wheel \
- py3-yaml \
- python3 \
- tini
-
-FROM base as builder
-
-ARG proxmoxer_version=1.1.1
-ENV proxmoxer_version=${proxmoxer_version}
-
-ADD . /src
-WORKDIR /opt
-RUN pip3 wheel --no-deps /src proxmoxer==${proxmoxer_version}
-
-FROM base as runtime
-
-COPY --from=builder /opt /opt
-
-RUN pip3 install --no-cache-dir --no-index /opt/*py3-none-any.whl && \
- rm /opt/*py3-none-any.whl
-
-USER nobody
-
-EXPOSE 9221
-
-ENTRYPOINT [ "/sbin/tini", "--", "/usr/bin/pve_exporter" ]
-
-CMD [ "/etc/pve.yml" ]
diff --git a/LICENSE b/LICENSE
deleted file mode 100644
index 261eeb9..0000000
--- a/LICENSE
+++ /dev/null
@@ -1,201 +0,0 @@
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- 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.
diff --git a/PKG-INFO b/PKG-INFO
new file mode 100644
index 0000000..66e401f
--- /dev/null
+++ b/PKG-INFO
@@ -0,0 +1,202 @@
+Metadata-Version: 1.2
+Name: prometheus-pve-exporter
+Version: 2.1.2
+Summary: Proxmox VE exporter for the Prometheus monitoring system.
+Home-page: https://github.com/prometheus-pve/prometheus-pve-exporter
+Author: Lorenz Schori
+Author-email: lo@znerol.ch
+License: Apache Software License 2.0
+Description: Prometheus Proxmox VE Exporter
+ ==============================
+
+ |Build Status| |Package Version|
+
+ This is an exporter that exposes information gathered from Proxmox VE
+ node for use by the Prometheus monitoring system.
+
+ Installation
+ ------------
+
+ Note: Python 2 is not supported anymore as of version 2.0.0. Instead use Python 3.6 or better.
+
+ Using pip:
+ ==========
+
+ .. code:: shell
+
+ python3 -m pip install prometheus-pve-exporter
+
+ Using docker:
+ =============
+
+ .. code:: shell
+
+ docker pull prompve/prometheus-pve-exporter
+
+ Example: Display usage message:
+
+ .. code:: shell
+
+ docker run -it --rm prompve/prometheus-pve-exporter --help
+
+
+ Example: Run the image with a mounted configuration file and published port:
+
+ .. code:: shell
+
+ docker run --name prometheus-pve-exporter -d -p 127.0.0.1:9221:9221 -v /path/to/pve.yml:/etc/pve.yml prompve/prometheus-pve-exporter
+
+ Prometheus PVE Exporter will now be reachable at http://localhost:9221/.
+
+ Usage
+ -----
+
+ ::
+
+ usage: pve_exporter [-h] [--collector.status] [--collector.version]
+ [--collector.node] [--collector.cluster]
+ [--collector.resources] [--collector.config]
+ [config] [port] [address]
+
+ positional arguments:
+ config Path to configuration file (pve.yml)
+ port Port on which the exporter is listening (9221)
+ address Address to which the exporter will bind
+
+ optional arguments:
+ -h, --help show this help message and exit
+ --collector.status, --no-collector.status
+ Exposes Node/VM/CT-Status (default: True)
+ --collector.version, --no-collector.version
+ Exposes PVE version info (default: True)
+ --collector.node, --no-collector.node
+ Exposes PVE node info (default: True)
+ --collector.cluster, --no-collector.cluster
+ Exposes PVE cluster info (default: True)
+ --collector.resources, --no-collector.resources
+ Exposes PVE resources info (default: True)
+ --collector.config, --no-collector.config
+ Exposes PVE onboot status (default: True)
+
+
+ Use `::` for the `address` argument in order to bind to both IPv6 and IPv4
+ sockets on dual stacked machines.
+
+ Visit http://localhost:9221/pve?target=1.2.3.4 where 1.2.3.4 is the IP
+ of the Proxmox VE node to get metrics from. Specify the ``module``
+ request parameter, to choose which module to use from the config file.
+
+ The ``target`` request parameter defaults to ``localhost``. Hence if
+ ``pve_exporter`` is deployed directly on the proxmox host, ``target``
+ can be omitted.
+
+ Use the `--collector.X` / `--no-collector.X` flags to enable disable selected
+ collectors.
+
+ Note that that the config collector results in one API call per guest VM/CT.
+ It is therefore recommended to disable this collector using the
+ `--no-collector.config` flag on big deployments.
+
+ See the wiki_ for more examples and docs.
+
+ Authentication
+ --------------
+
+ Example ``pve.yml`` for password authentication:
+
+ .. code:: yaml
+
+ default:
+ user: prometheus@pve
+ password: sEcr3T!
+
+ Example ``pve.yml`` for `token authentication`_:
+
+ .. code:: yaml
+
+ default:
+ user: prometheus@pve
+ token_name: "..."
+ token_value: "..."
+
+ The configuration is passed directly into `proxmoxer.ProxmoxAPI()`_.
+
+ Note: When operating PVE with self-signed certificates, then it is necessary to
+ either import the certificate into the local trust store (see this `SE answer`_
+ for Debian/Ubuntu) or add ``verify_ssl: false`` to the config dict as a sibling
+ to the credentials. Note that PVE `supports Let's Encrypt`_ out ouf the box. In
+ many cases setting up trusted certificates is the better option than operating
+ with self-signed certs.
+
+ Proxmox VE Configuration
+ ------------------------
+
+ For security reasons it is essential to add a user with read-only access
+ (PVEAuditor role) for the purpose of metrics collection.
+
+ Prometheus Configuration
+ ------------------------
+
+ The PVE exporter can be deployed either directly on a Proxmox VE node or
+ onto a separate machine.
+
+ Example config for PVE exporter running on PVE node:
+
+ .. code:: yaml
+
+ scrape_configs:
+ - job_name: 'pve'
+ static_configs:
+ - targets:
+ - 192.168.1.2:9221 # Proxmox VE node with PVE exporter.
+ - 192.168.1.3:9221 # Proxmox VE node with PVE exporter.
+ metrics_path: /pve
+ params:
+ module: [default]
+
+ Example config for PVE exporter running on Prometheus host:
+
+ .. code:: yaml
+
+ scrape_configs:
+ - job_name: 'pve'
+ static_configs:
+ - targets:
+ - 192.168.1.2 # Proxmox VE node.
+ - 192.168.1.3 # Proxmox VE node.
+ metrics_path: /pve
+ params:
+ module: [default]
+ relabel_configs:
+ - source_labels: [__address__]
+ target_label: __param_target
+ - source_labels: [__param_target]
+ target_label: instance
+ - target_label: __address__
+ replacement: 127.0.0.1:9221 # PVE exporter.
+
+ Grafana Dashboards
+ ------------------
+
+ * `Proxmox via Prometheus by Pietro Saccardi`_
+
+ .. |Build Status| image:: https://github.com/prometheus-pve/prometheus-pve-exporter/actions/workflows/ci.yml/badge.svg
+ :target: https://github.com/prometheus-pve/prometheus-pve-exporter/actions/workflows/ci.yml
+ .. |Package Version| image:: https://img.shields.io/pypi/v/prometheus-pve-exporter.svg
+ :target: https://pypi.python.org/pypi/prometheus-pve-exporter
+ .. _wiki: https://github.com/prometheus-pve/prometheus-pve-exporter/wiki
+ .. _`token authentication`: https://pve.proxmox.com/wiki/User_Management#pveum_tokens
+ .. _`proxmoxer.ProxmoxAPI()`: https://pypi.python.org/pypi/proxmoxer
+ .. _`SE answer`: https://askubuntu.com/a/1007236
+ .. _`supports Let's Encrypt`: https://pve.proxmox.com/pve-docs/pve-admin-guide.html#sysadmin_certificate_management
+ .. _`Proxmox via Prometheus by Pietro Saccardi`: https://grafana.com/dashboards/10347
+
+Keywords: prometheus exporter network monitoring proxmox
+Platform: UNKNOWN
+Classifier: Development Status :: 3 - Alpha
+Classifier: Intended Audience :: Information Technology
+Classifier: Intended Audience :: System Administrators
+Classifier: Topic :: System :: Monitoring
+Classifier: Topic :: System :: Networking :: Monitoring
+Classifier: License :: OSI Approved :: Apache Software License
+Requires-Python: >=3.4
diff --git a/README.rst b/README.rst
index eb51a34..bd7ac6c 100644
--- a/README.rst
+++ b/README.rst
@@ -1,186 +1,184 @@
Prometheus Proxmox VE Exporter
==============================
|Build Status| |Package Version|
This is an exporter that exposes information gathered from Proxmox VE
node for use by the Prometheus monitoring system.
Installation
------------
Note: Python 2 is not supported anymore as of version 2.0.0. Instead use Python 3.6 or better.
Using pip:
==========
.. code:: shell
python3 -m pip install prometheus-pve-exporter
Using docker:
=============
.. code:: shell
docker pull prompve/prometheus-pve-exporter
Example: Display usage message:
.. code:: shell
docker run -it --rm prompve/prometheus-pve-exporter --help
Example: Run the image with a mounted configuration file and published port:
.. code:: shell
docker run --name prometheus-pve-exporter -d -p 127.0.0.1:9221:9221 -v /path/to/pve.yml:/etc/pve.yml prompve/prometheus-pve-exporter
Prometheus PVE Exporter will now be reachable at http://localhost:9221/.
Usage
-----
::
usage: pve_exporter [-h] [--collector.status] [--collector.version]
[--collector.node] [--collector.cluster]
[--collector.resources] [--collector.config]
[config] [port] [address]
positional arguments:
config Path to configuration file (pve.yml)
port Port on which the exporter is listening (9221)
address Address to which the exporter will bind
optional arguments:
-h, --help show this help message and exit
--collector.status, --no-collector.status
Exposes Node/VM/CT-Status (default: True)
--collector.version, --no-collector.version
Exposes PVE version info (default: True)
--collector.node, --no-collector.node
Exposes PVE node info (default: True)
--collector.cluster, --no-collector.cluster
Exposes PVE cluster info (default: True)
--collector.resources, --no-collector.resources
Exposes PVE resources info (default: True)
--collector.config, --no-collector.config
Exposes PVE onboot status (default: True)
Use `::` for the `address` argument in order to bind to both IPv6 and IPv4
sockets on dual stacked machines.
Visit http://localhost:9221/pve?target=1.2.3.4 where 1.2.3.4 is the IP
of the Proxmox VE node to get metrics from. Specify the ``module``
request parameter, to choose which module to use from the config file.
The ``target`` request parameter defaults to ``localhost``. Hence if
``pve_exporter`` is deployed directly on the proxmox host, ``target``
can be omitted.
Use the `--collector.X` / `--no-collector.X` flags to enable disable selected
collectors.
Note that that the config collector results in one API call per guest VM/CT.
It is therefore recommended to disable this collector using the
`--no-collector.config` flag on big deployments.
See the wiki_ for more examples and docs.
Authentication
--------------
Example ``pve.yml`` for password authentication:
.. code:: yaml
default:
user: prometheus@pve
password: sEcr3T!
- # Optional: set to false to skip SSL/TLS verification
- verify_ssl: true
Example ``pve.yml`` for `token authentication`_:
.. code:: yaml
default:
user: prometheus@pve
token_name: "..."
token_value: "..."
The configuration is passed directly into `proxmoxer.ProxmoxAPI()`_.
Note: When operating PVE with self-signed certificates, then it is necessary to
either import the certificate into the local trust store (see this `SE answer`_
for Debian/Ubuntu) or add ``verify_ssl: false`` to the config dict as a sibling
to the credentials. Note that PVE `supports Let's Encrypt`_ out ouf the box. In
many cases setting up trusted certificates is the better option than operating
with self-signed certs.
Proxmox VE Configuration
------------------------
For security reasons it is essential to add a user with read-only access
(PVEAuditor role) for the purpose of metrics collection.
Prometheus Configuration
------------------------
The PVE exporter can be deployed either directly on a Proxmox VE node or
onto a separate machine.
Example config for PVE exporter running on PVE node:
.. code:: yaml
scrape_configs:
- job_name: 'pve'
static_configs:
- targets:
- 192.168.1.2:9221 # Proxmox VE node with PVE exporter.
- 192.168.1.3:9221 # Proxmox VE node with PVE exporter.
metrics_path: /pve
params:
module: [default]
Example config for PVE exporter running on Prometheus host:
.. code:: yaml
scrape_configs:
- job_name: 'pve'
static_configs:
- targets:
- 192.168.1.2 # Proxmox VE node.
- 192.168.1.3 # Proxmox VE node.
metrics_path: /pve
params:
module: [default]
relabel_configs:
- source_labels: [__address__]
target_label: __param_target
- source_labels: [__param_target]
target_label: instance
- target_label: __address__
replacement: 127.0.0.1:9221 # PVE exporter.
Grafana Dashboards
------------------
* `Proxmox via Prometheus by Pietro Saccardi`_
.. |Build Status| image:: https://github.com/prometheus-pve/prometheus-pve-exporter/actions/workflows/ci.yml/badge.svg
:target: https://github.com/prometheus-pve/prometheus-pve-exporter/actions/workflows/ci.yml
.. |Package Version| image:: https://img.shields.io/pypi/v/prometheus-pve-exporter.svg
:target: https://pypi.python.org/pypi/prometheus-pve-exporter
.. _wiki: https://github.com/prometheus-pve/prometheus-pve-exporter/wiki
.. _`token authentication`: https://pve.proxmox.com/wiki/User_Management#pveum_tokens
.. _`proxmoxer.ProxmoxAPI()`: https://pypi.python.org/pypi/proxmoxer
.. _`SE answer`: https://askubuntu.com/a/1007236
.. _`supports Let's Encrypt`: https://pve.proxmox.com/pve-docs/pve-admin-guide.html#sysadmin_certificate_management
.. _`Proxmox via Prometheus by Pietro Saccardi`: https://grafana.com/dashboards/10347
diff --git a/pve.yml b/pve.yml
deleted file mode 100644
index 766e639..0000000
--- a/pve.yml
+++ /dev/null
@@ -1,4 +0,0 @@
-default:
- user: prometheus@pve
- password: sEcr3T!
- verify_ssl: false
diff --git a/pylintrc b/pylintrc
deleted file mode 100644
index e2749ae..0000000
--- a/pylintrc
+++ /dev/null
@@ -1,595 +0,0 @@
-[MASTER]
-
-# A comma-separated list of package or module names from where C extensions may
-# be loaded. Extensions are loading into the active Python interpreter and may
-# run arbitrary code.
-extension-pkg-whitelist=
-
-# Specify a score threshold to be exceeded before program exits with error.
-fail-under=10
-
-# Add files or directories to the blacklist. They should be base names, not
-# paths.
-ignore=CVS
-
-# Add files or directories matching the regex patterns to the blacklist. The
-# regex matches against base names, not paths.
-ignore-patterns=
-
-# Python code to execute, usually for sys.path manipulation such as
-# pygtk.require().
-#init-hook=
-
-# Use multiple processes to speed up Pylint. Specifying 0 will auto-detect the
-# number of processors available to use.
-jobs=1
-
-# Control the amount of potential inferred values when inferring a single
-# object. This can help the performance when dealing with large functions or
-# complex, nested conditions.
-limit-inference-results=100
-
-# List of plugins (as comma separated values of python module names) to load,
-# usually to register additional checkers.
-load-plugins=
-
-# Pickle collected data for later comparisons.
-persistent=yes
-
-# When enabled, pylint would attempt to guess common misconfiguration and emit
-# user-friendly hints instead of false-positive error messages.
-suggestion-mode=yes
-
-# Allow loading of arbitrary C extensions. Extensions are imported into the
-# active Python interpreter and may run arbitrary code.
-unsafe-load-any-extension=no
-
-
-[MESSAGES CONTROL]
-
-# Only show warnings with the listed confidence levels. Leave empty to show
-# all. Valid levels: HIGH, INFERENCE, INFERENCE_FAILURE, UNDEFINED.
-confidence=
-
-# Disable the message, report, category or checker with the given id(s). You
-# can either give multiple identifiers separated by comma (,) or put this
-# option multiple times (only on the command line, not in the configuration
-# file where it should appear only once). You can also use "--disable=all" to
-# disable everything first and then reenable specific checks. For example, if
-# you want to run only the similarities checker, you can use "--disable=all
-# --enable=similarities". If you want to run only the classes checker, but have
-# no Warning level messages displayed, use "--disable=all --enable=classes
-# --disable=W".
-disable=print-statement,
- parameter-unpacking,
- unpacking-in-except,
- old-raise-syntax,
- backtick,
- long-suffix,
- old-ne-operator,
- old-octal-literal,
- import-star-module-level,
- non-ascii-bytes-literal,
- raw-checker-failed,
- bad-inline-option,
- locally-disabled,
- file-ignored,
- suppressed-message,
- useless-suppression,
- deprecated-pragma,
- use-symbolic-message-instead,
- apply-builtin,
- basestring-builtin,
- buffer-builtin,
- cmp-builtin,
- coerce-builtin,
- execfile-builtin,
- file-builtin,
- long-builtin,
- raw_input-builtin,
- reduce-builtin,
- standarderror-builtin,
- unicode-builtin,
- xrange-builtin,
- coerce-method,
- delslice-method,
- getslice-method,
- setslice-method,
- no-absolute-import,
- old-division,
- dict-iter-method,
- dict-view-method,
- next-method-called,
- metaclass-assignment,
- indexing-exception,
- raising-string,
- reload-builtin,
- oct-method,
- hex-method,
- nonzero-method,
- cmp-method,
- input-builtin,
- round-builtin,
- intern-builtin,
- unichr-builtin,
- map-builtin-not-iterating,
- zip-builtin-not-iterating,
- range-builtin-not-iterating,
- filter-builtin-not-iterating,
- using-cmp-argument,
- eq-without-hash,
- div-method,
- idiv-method,
- rdiv-method,
- exception-message-attribute,
- invalid-str-codec,
- sys-max-int,
- bad-python3-import,
- deprecated-string-function,
- deprecated-str-translate-call,
- deprecated-itertools-function,
- deprecated-types-field,
- next-method-defined,
- dict-items-not-iterating,
- dict-keys-not-iterating,
- dict-values-not-iterating,
- deprecated-operator-function,
- deprecated-urllib-function,
- xreadlines-attribute,
- deprecated-sys-function,
- exception-escape,
- comprehension-escape
-
-# Enable the message, report, category or checker with the given id(s). You can
-# either give multiple identifier separated by comma (,) or put this option
-# multiple time (only on the command line, not in the configuration file where
-# it should appear only once). See also the "--disable" option for examples.
-enable=c-extension-no-member
-
-
-[REPORTS]
-
-# Python expression which should return a score less than or equal to 10. You
-# have access to the variables 'error', 'warning', 'refactor', and 'convention'
-# which contain the number of messages in each category, as well as 'statement'
-# which is the total number of statements analyzed. This score is used by the
-# global evaluation report (RP0004).
-evaluation=10.0 - ((float(5 * error + warning + refactor + convention) / statement) * 10)
-
-# Template used to display messages. This is a python new-style format string
-# used to format the message information. See doc for all details.
-#msg-template=
-
-# Set the output format. Available formats are text, parseable, colorized, json
-# and msvs (visual studio). You can also give a reporter class, e.g.
-# mypackage.mymodule.MyReporterClass.
-output-format=text
-
-# Tells whether to display a full report or only the messages.
-reports=no
-
-# Activate the evaluation score.
-score=yes
-
-
-[REFACTORING]
-
-# Maximum number of nested blocks for function / method body
-max-nested-blocks=5
-
-# Complete name of functions that never returns. When checking for
-# inconsistent-return-statements if a never returning function is called then
-# it will be considered as an explicit return statement and no message will be
-# printed.
-never-returning-functions=sys.exit
-
-
-[BASIC]
-
-# Naming style matching correct argument names.
-argument-naming-style=snake_case
-
-# Regular expression matching correct argument names. Overrides argument-
-# naming-style.
-#argument-rgx=
-
-# Naming style matching correct attribute names.
-attr-naming-style=snake_case
-
-# Regular expression matching correct attribute names. Overrides attr-naming-
-# style.
-#attr-rgx=
-
-# Bad variable names which should always be refused, separated by a comma.
-bad-names=foo,
- bar,
- baz,
- toto,
- tutu,
- tata
-
-# Bad variable names regexes, separated by a comma. If names match any regex,
-# they will always be refused
-bad-names-rgxs=
-
-# Naming style matching correct class attribute names.
-class-attribute-naming-style=any
-
-# Regular expression matching correct class attribute names. Overrides class-
-# attribute-naming-style.
-#class-attribute-rgx=
-
-# Naming style matching correct class names.
-class-naming-style=PascalCase
-
-# Regular expression matching correct class names. Overrides class-naming-
-# style.
-#class-rgx=
-
-# Naming style matching correct constant names.
-const-naming-style=UPPER_CASE
-
-# Regular expression matching correct constant names. Overrides const-naming-
-# style.
-#const-rgx=
-
-# Minimum line length for functions/classes that require docstrings, shorter
-# ones are exempt.
-docstring-min-length=-1
-
-# Naming style matching correct function names.
-function-naming-style=snake_case
-
-# Regular expression matching correct function names. Overrides function-
-# naming-style.
-#function-rgx=
-
-# Good variable names which should always be accepted, separated by a comma.
-good-names=i,
- j,
- k,
- ex,
- Run,
- _
-
-# Good variable names regexes, separated by a comma. If names match any regex,
-# they will always be accepted
-good-names-rgxs=
-
-# Include a hint for the correct naming format with invalid-name.
-include-naming-hint=no
-
-# Naming style matching correct inline iteration names.
-inlinevar-naming-style=any
-
-# Regular expression matching correct inline iteration names. Overrides
-# inlinevar-naming-style.
-#inlinevar-rgx=
-
-# Naming style matching correct method names.
-method-naming-style=snake_case
-
-# Regular expression matching correct method names. Overrides method-naming-
-# style.
-#method-rgx=
-
-# Naming style matching correct module names.
-module-naming-style=snake_case
-
-# Regular expression matching correct module names. Overrides module-naming-
-# style.
-#module-rgx=
-
-# Colon-delimited sets of names that determine each other's naming style when
-# the name regexes allow several styles.
-name-group=
-
-# Regular expression which should only match function or class names that do
-# not require a docstring.
-no-docstring-rgx=^_
-
-# List of decorators that produce properties, such as abc.abstractproperty. Add
-# to this list to register other decorators that produce valid properties.
-# These decorators are taken in consideration only for invalid-name.
-property-classes=abc.abstractproperty
-
-# Naming style matching correct variable names.
-variable-naming-style=snake_case
-
-# Regular expression matching correct variable names. Overrides variable-
-# naming-style.
-#variable-rgx=
-
-
-[FORMAT]
-
-# Expected format of line ending, e.g. empty (any line ending), LF or CRLF.
-expected-line-ending-format=
-
-# Regexp for a line that is allowed to be longer than the limit.
-ignore-long-lines=^\s*(# )?<?https?://\S+>?$
-
-# Number of spaces of indent required inside a hanging or continued line.
-indent-after-paren=4
-
-# String used as indentation unit. This is usually " " (4 spaces) or "\t" (1
-# tab).
-indent-string=' '
-
-# Maximum number of characters on a single line.
-max-line-length=100
-
-# Maximum number of lines in a module.
-max-module-lines=1000
-
-# List of optional constructs for which whitespace checking is disabled. `dict-
-# separator` is used to allow tabulation in dicts, etc.: {1 : 1,\n222: 2}.
-# `trailing-comma` allows a space between comma and closing bracket: (a, ).
-# `empty-line` allows space-only lines.
-no-space-check=trailing-comma,
- dict-separator
-
-# Allow the body of a class to be on the same line as the declaration if body
-# contains single statement.
-single-line-class-stmt=no
-
-# Allow the body of an if to be on the same line as the test if there is no
-# else.
-single-line-if-stmt=no
-
-
-[LOGGING]
-
-# The type of string formatting that logging methods do. `old` means using %
-# formatting, `new` is for `{}` formatting.
-logging-format-style=old
-
-# Logging modules to check that the string format arguments are in logging
-# function parameter format.
-logging-modules=logging
-
-
-[MISCELLANEOUS]
-
-# List of note tags to take in consideration, separated by a comma.
-notes=FIXME,
- XXX,
- TODO
-
-# Regular expression of note tags to take in consideration.
-#notes-rgx=
-
-
-[SIMILARITIES]
-
-# Ignore comments when computing similarities.
-ignore-comments=yes
-
-# Ignore docstrings when computing similarities.
-ignore-docstrings=yes
-
-# Ignore imports when computing similarities.
-ignore-imports=no
-
-# Minimum lines number of a similarity.
-min-similarity-lines=4
-
-
-[SPELLING]
-
-# Limits count of emitted suggestions for spelling mistakes.
-max-spelling-suggestions=4
-
-# Spelling dictionary name. Available dictionaries: none. To make it work,
-# install the python-enchant package.
-spelling-dict=
-
-# List of comma separated words that should not be checked.
-spelling-ignore-words=
-
-# A path to a file that contains the private dictionary; one word per line.
-spelling-private-dict-file=
-
-# Tells whether to store unknown words to the private dictionary (see the
-# --spelling-private-dict-file option) instead of raising a message.
-spelling-store-unknown-words=no
-
-
-[STRING]
-
-# This flag controls whether inconsistent-quotes generates a warning when the
-# character used as a quote delimiter is used inconsistently within a module.
-check-quote-consistency=no
-
-# This flag controls whether the implicit-str-concat should generate a warning
-# on implicit string concatenation in sequences defined over several lines.
-check-str-concat-over-line-jumps=no
-
-
-[TYPECHECK]
-
-# List of decorators that produce context managers, such as
-# contextlib.contextmanager. Add to this list to register other decorators that
-# produce valid context managers.
-contextmanager-decorators=contextlib.contextmanager
-
-# List of members which are set dynamically and missed by pylint inference
-# system, and so shouldn't trigger E1101 when accessed. Python regular
-# expressions are accepted.
-generated-members=
-
-# Tells whether missing members accessed in mixin class should be ignored. A
-# mixin class is detected if its name ends with "mixin" (case insensitive).
-ignore-mixin-members=yes
-
-# Tells whether to warn about missing members when the owner of the attribute
-# is inferred to be None.
-ignore-none=yes
-
-# This flag controls whether pylint should warn about no-member and similar
-# checks whenever an opaque object is returned when inferring. The inference
-# can return multiple potential results while evaluating a Python object, but
-# some branches might not be evaluated, which results in partial inference. In
-# that case, it might be useful to still emit no-member and other checks for
-# the rest of the inferred objects.
-ignore-on-opaque-inference=yes
-
-# List of class names for which member attributes should not be checked (useful
-# for classes with dynamically set attributes). This supports the use of
-# qualified names.
-ignored-classes=optparse.Values,thread._local,_thread._local
-
-# List of module names for which member attributes should not be checked
-# (useful for modules/projects where namespaces are manipulated during runtime
-# and thus existing member attributes cannot be deduced by static analysis). It
-# supports qualified module names, as well as Unix pattern matching.
-ignored-modules=
-
-# Show a hint with possible names when a member name was not found. The aspect
-# of finding the hint is based on edit distance.
-missing-member-hint=yes
-
-# The minimum edit distance a name should have in order to be considered a
-# similar match for a missing member name.
-missing-member-hint-distance=1
-
-# The total number of similar names that should be taken in consideration when
-# showing a hint for a missing member.
-missing-member-max-choices=1
-
-# List of decorators that change the signature of a decorated function.
-signature-mutators=
-
-
-[VARIABLES]
-
-# List of additional names supposed to be defined in builtins. Remember that
-# you should avoid defining new builtins when possible.
-additional-builtins=
-
-# Tells whether unused global variables should be treated as a violation.
-allow-global-unused-variables=yes
-
-# List of strings which can identify a callback function by name. A callback
-# name must start or end with one of those strings.
-callbacks=cb_,
- _cb
-
-# A regular expression matching the name of dummy variables (i.e. expected to
-# not be used).
-dummy-variables-rgx=_+$|(_[a-zA-Z0-9_]*[a-zA-Z0-9]+?$)|dummy|^ignored_|^unused_
-
-# Argument names that match this expression will be ignored. Default to name
-# with leading underscore.
-ignored-argument-names=_.*|^ignored_|^unused_
-
-# Tells whether we should check for unused import in __init__ files.
-init-import=no
-
-# List of qualified module names which can have objects that can redefine
-# builtins.
-redefining-builtins-modules=six.moves,past.builtins,future.builtins,builtins,io
-
-
-[CLASSES]
-
-# List of method names used to declare (i.e. assign) instance attributes.
-defining-attr-methods=__init__,
- __new__,
- setUp,
- __post_init__
-
-# List of member names, which should be excluded from the protected access
-# warning.
-exclude-protected=_asdict,
- _fields,
- _replace,
- _source,
- _make
-
-# List of valid names for the first argument in a class method.
-valid-classmethod-first-arg=cls
-
-# List of valid names for the first argument in a metaclass class method.
-valid-metaclass-classmethod-first-arg=cls
-
-
-[DESIGN]
-
-# Maximum number of arguments for function / method.
-max-args=5
-
-# Maximum number of attributes for a class (see R0902).
-max-attributes=7
-
-# Maximum number of boolean expressions in an if statement (see R0916).
-max-bool-expr=5
-
-# Maximum number of branch for function / method body.
-max-branches=12
-
-# Maximum number of locals for function / method body.
-max-locals=15
-
-# Maximum number of parents for a class (see R0901).
-max-parents=7
-
-# Maximum number of public methods for a class (see R0904).
-max-public-methods=20
-
-# Maximum number of return / yield for function / method body.
-max-returns=6
-
-# Maximum number of statements in function / method body.
-max-statements=50
-
-# Minimum number of public methods for a class (see R0903).
-min-public-methods=2
-
-
-[IMPORTS]
-
-# List of modules that can be imported at any level, not just the top level
-# one.
-allow-any-import-level=
-
-# Allow wildcard imports from modules that define __all__.
-allow-wildcard-with-all=no
-
-# Analyse import fallback blocks. This can be used to support both Python 2 and
-# 3 compatible code, which means that the block might have code that exists
-# only in one or another interpreter, leading to false positives when analysed.
-analyse-fallback-blocks=no
-
-# Deprecated modules which should not be used, separated by a comma.
-deprecated-modules=optparse,tkinter.tix
-
-# Create a graph of external dependencies in the given file (report RP0402 must
-# not be disabled).
-ext-import-graph=
-
-# Create a graph of every (i.e. internal and external) dependencies in the
-# given file (report RP0402 must not be disabled).
-import-graph=
-
-# Create a graph of internal dependencies in the given file (report RP0402 must
-# not be disabled).
-int-import-graph=
-
-# Force import order to recognize a module as part of the standard
-# compatibility libraries.
-known-standard-library=
-
-# Force import order to recognize a module as part of a third party library.
-known-third-party=enchant
-
-# Couples of modules and preferred modules, separated by a comma.
-preferred-modules=
-
-
-[EXCEPTIONS]
-
-# Exceptions that will emit a warning when being caught. Defaults to
-# "BaseException, Exception".
-overgeneral-exceptions=BaseException,
- Exception
diff --git a/setup.cfg b/setup.cfg
new file mode 100644
index 0000000..8bfd5a1
--- /dev/null
+++ b/setup.cfg
@@ -0,0 +1,4 @@
+[egg_info]
+tag_build =
+tag_date = 0
+
diff --git a/src/prometheus_pve_exporter.egg-info/PKG-INFO b/src/prometheus_pve_exporter.egg-info/PKG-INFO
new file mode 100644
index 0000000..66e401f
--- /dev/null
+++ b/src/prometheus_pve_exporter.egg-info/PKG-INFO
@@ -0,0 +1,202 @@
+Metadata-Version: 1.2
+Name: prometheus-pve-exporter
+Version: 2.1.2
+Summary: Proxmox VE exporter for the Prometheus monitoring system.
+Home-page: https://github.com/prometheus-pve/prometheus-pve-exporter
+Author: Lorenz Schori
+Author-email: lo@znerol.ch
+License: Apache Software License 2.0
+Description: Prometheus Proxmox VE Exporter
+ ==============================
+
+ |Build Status| |Package Version|
+
+ This is an exporter that exposes information gathered from Proxmox VE
+ node for use by the Prometheus monitoring system.
+
+ Installation
+ ------------
+
+ Note: Python 2 is not supported anymore as of version 2.0.0. Instead use Python 3.6 or better.
+
+ Using pip:
+ ==========
+
+ .. code:: shell
+
+ python3 -m pip install prometheus-pve-exporter
+
+ Using docker:
+ =============
+
+ .. code:: shell
+
+ docker pull prompve/prometheus-pve-exporter
+
+ Example: Display usage message:
+
+ .. code:: shell
+
+ docker run -it --rm prompve/prometheus-pve-exporter --help
+
+
+ Example: Run the image with a mounted configuration file and published port:
+
+ .. code:: shell
+
+ docker run --name prometheus-pve-exporter -d -p 127.0.0.1:9221:9221 -v /path/to/pve.yml:/etc/pve.yml prompve/prometheus-pve-exporter
+
+ Prometheus PVE Exporter will now be reachable at http://localhost:9221/.
+
+ Usage
+ -----
+
+ ::
+
+ usage: pve_exporter [-h] [--collector.status] [--collector.version]
+ [--collector.node] [--collector.cluster]
+ [--collector.resources] [--collector.config]
+ [config] [port] [address]
+
+ positional arguments:
+ config Path to configuration file (pve.yml)
+ port Port on which the exporter is listening (9221)
+ address Address to which the exporter will bind
+
+ optional arguments:
+ -h, --help show this help message and exit
+ --collector.status, --no-collector.status
+ Exposes Node/VM/CT-Status (default: True)
+ --collector.version, --no-collector.version
+ Exposes PVE version info (default: True)
+ --collector.node, --no-collector.node
+ Exposes PVE node info (default: True)
+ --collector.cluster, --no-collector.cluster
+ Exposes PVE cluster info (default: True)
+ --collector.resources, --no-collector.resources
+ Exposes PVE resources info (default: True)
+ --collector.config, --no-collector.config
+ Exposes PVE onboot status (default: True)
+
+
+ Use `::` for the `address` argument in order to bind to both IPv6 and IPv4
+ sockets on dual stacked machines.
+
+ Visit http://localhost:9221/pve?target=1.2.3.4 where 1.2.3.4 is the IP
+ of the Proxmox VE node to get metrics from. Specify the ``module``
+ request parameter, to choose which module to use from the config file.
+
+ The ``target`` request parameter defaults to ``localhost``. Hence if
+ ``pve_exporter`` is deployed directly on the proxmox host, ``target``
+ can be omitted.
+
+ Use the `--collector.X` / `--no-collector.X` flags to enable disable selected
+ collectors.
+
+ Note that that the config collector results in one API call per guest VM/CT.
+ It is therefore recommended to disable this collector using the
+ `--no-collector.config` flag on big deployments.
+
+ See the wiki_ for more examples and docs.
+
+ Authentication
+ --------------
+
+ Example ``pve.yml`` for password authentication:
+
+ .. code:: yaml
+
+ default:
+ user: prometheus@pve
+ password: sEcr3T!
+
+ Example ``pve.yml`` for `token authentication`_:
+
+ .. code:: yaml
+
+ default:
+ user: prometheus@pve
+ token_name: "..."
+ token_value: "..."
+
+ The configuration is passed directly into `proxmoxer.ProxmoxAPI()`_.
+
+ Note: When operating PVE with self-signed certificates, then it is necessary to
+ either import the certificate into the local trust store (see this `SE answer`_
+ for Debian/Ubuntu) or add ``verify_ssl: false`` to the config dict as a sibling
+ to the credentials. Note that PVE `supports Let's Encrypt`_ out ouf the box. In
+ many cases setting up trusted certificates is the better option than operating
+ with self-signed certs.
+
+ Proxmox VE Configuration
+ ------------------------
+
+ For security reasons it is essential to add a user with read-only access
+ (PVEAuditor role) for the purpose of metrics collection.
+
+ Prometheus Configuration
+ ------------------------
+
+ The PVE exporter can be deployed either directly on a Proxmox VE node or
+ onto a separate machine.
+
+ Example config for PVE exporter running on PVE node:
+
+ .. code:: yaml
+
+ scrape_configs:
+ - job_name: 'pve'
+ static_configs:
+ - targets:
+ - 192.168.1.2:9221 # Proxmox VE node with PVE exporter.
+ - 192.168.1.3:9221 # Proxmox VE node with PVE exporter.
+ metrics_path: /pve
+ params:
+ module: [default]
+
+ Example config for PVE exporter running on Prometheus host:
+
+ .. code:: yaml
+
+ scrape_configs:
+ - job_name: 'pve'
+ static_configs:
+ - targets:
+ - 192.168.1.2 # Proxmox VE node.
+ - 192.168.1.3 # Proxmox VE node.
+ metrics_path: /pve
+ params:
+ module: [default]
+ relabel_configs:
+ - source_labels: [__address__]
+ target_label: __param_target
+ - source_labels: [__param_target]
+ target_label: instance
+ - target_label: __address__
+ replacement: 127.0.0.1:9221 # PVE exporter.
+
+ Grafana Dashboards
+ ------------------
+
+ * `Proxmox via Prometheus by Pietro Saccardi`_
+
+ .. |Build Status| image:: https://github.com/prometheus-pve/prometheus-pve-exporter/actions/workflows/ci.yml/badge.svg
+ :target: https://github.com/prometheus-pve/prometheus-pve-exporter/actions/workflows/ci.yml
+ .. |Package Version| image:: https://img.shields.io/pypi/v/prometheus-pve-exporter.svg
+ :target: https://pypi.python.org/pypi/prometheus-pve-exporter
+ .. _wiki: https://github.com/prometheus-pve/prometheus-pve-exporter/wiki
+ .. _`token authentication`: https://pve.proxmox.com/wiki/User_Management#pveum_tokens
+ .. _`proxmoxer.ProxmoxAPI()`: https://pypi.python.org/pypi/proxmoxer
+ .. _`SE answer`: https://askubuntu.com/a/1007236
+ .. _`supports Let's Encrypt`: https://pve.proxmox.com/pve-docs/pve-admin-guide.html#sysadmin_certificate_management
+ .. _`Proxmox via Prometheus by Pietro Saccardi`: https://grafana.com/dashboards/10347
+
+Keywords: prometheus exporter network monitoring proxmox
+Platform: UNKNOWN
+Classifier: Development Status :: 3 - Alpha
+Classifier: Intended Audience :: Information Technology
+Classifier: Intended Audience :: System Administrators
+Classifier: Topic :: System :: Monitoring
+Classifier: Topic :: System :: Networking :: Monitoring
+Classifier: License :: OSI Approved :: Apache Software License
+Requires-Python: >=3.4
diff --git a/src/prometheus_pve_exporter.egg-info/SOURCES.txt b/src/prometheus_pve_exporter.egg-info/SOURCES.txt
new file mode 100644
index 0000000..e801531
--- /dev/null
+++ b/src/prometheus_pve_exporter.egg-info/SOURCES.txt
@@ -0,0 +1,13 @@
+README.rst
+setup.py
+src/prometheus_pve_exporter.egg-info/PKG-INFO
+src/prometheus_pve_exporter.egg-info/SOURCES.txt
+src/prometheus_pve_exporter.egg-info/dependency_links.txt
+src/prometheus_pve_exporter.egg-info/entry_points.txt
+src/prometheus_pve_exporter.egg-info/requires.txt
+src/prometheus_pve_exporter.egg-info/top_level.txt
+src/pve_exporter/__init__.py
+src/pve_exporter/cli.py
+src/pve_exporter/collector.py
+src/pve_exporter/config.py
+src/pve_exporter/http.py
\ No newline at end of file
diff --git a/src/prometheus_pve_exporter.egg-info/dependency_links.txt b/src/prometheus_pve_exporter.egg-info/dependency_links.txt
new file mode 100644
index 0000000..8b13789
--- /dev/null
+++ b/src/prometheus_pve_exporter.egg-info/dependency_links.txt
@@ -0,0 +1 @@
+
diff --git a/src/prometheus_pve_exporter.egg-info/entry_points.txt b/src/prometheus_pve_exporter.egg-info/entry_points.txt
new file mode 100644
index 0000000..b02e198
--- /dev/null
+++ b/src/prometheus_pve_exporter.egg-info/entry_points.txt
@@ -0,0 +1,3 @@
+[console_scripts]
+pve_exporter = pve_exporter.cli:main
+
diff --git a/src/prometheus_pve_exporter.egg-info/requires.txt b/src/prometheus_pve_exporter.egg-info/requires.txt
new file mode 100644
index 0000000..b3c6172
--- /dev/null
+++ b/src/prometheus_pve_exporter.egg-info/requires.txt
@@ -0,0 +1,5 @@
+Werkzeug
+prometheus_client>=0.0.11
+proxmoxer
+pyyaml
+requests
diff --git a/src/prometheus_pve_exporter.egg-info/top_level.txt b/src/prometheus_pve_exporter.egg-info/top_level.txt
new file mode 100644
index 0000000..aa9cf2d
--- /dev/null
+++ b/src/prometheus_pve_exporter.egg-info/top_level.txt
@@ -0,0 +1 @@
+pve_exporter
diff --git a/test-requirements.txt b/test-requirements.txt
deleted file mode 100644
index 7988217..0000000
--- a/test-requirements.txt
+++ /dev/null
@@ -1,2 +0,0 @@
-pylint
-pyflakes

File Metadata

Mime Type
text/x-diff
Expires
Fri, Jul 4, 3:24 PM (6 d, 9 h ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3333225

Event Timeline