Exports patch status in Prometheus-compatible format.
Project description
This queries the current patch status of the system from Zypper and exports it in a format compatible with the Prometheus Node Exporter’s textfile collector.
Usage
> zypper-patch-status-collector # HELP zypper_applicable_patches The current count of applicable patches # TYPE zypper_applicable_patches gauge zypper_applicable_patches{category="security",severity="critical"} 0 zypper_applicable_patches{category="security",severity="important"} 2 zypper_applicable_patches{category="security",severity="moderate"} 0 zypper_applicable_patches{category="security",severity="low"} 0 zypper_applicable_patches{category="security",severity="unspecified"} 0 zypper_applicable_patches{category="recommended",severity="critical"} 0 zypper_applicable_patches{category="recommended",severity="important"} 0 zypper_applicable_patches{category="recommended",severity="moderate"} 0 zypper_applicable_patches{category="recommended",severity="low"} 0 zypper_applicable_patches{category="recommended",severity="unspecified"} 0 zypper_applicable_patches{category="optional",severity="critical"} 0 zypper_applicable_patches{category="optional",severity="important"} 0 zypper_applicable_patches{category="optional",severity="moderate"} 1 zypper_applicable_patches{category="optional",severity="low"} 0 zypper_applicable_patches{category="optional",severity="unspecified"} 0 zypper_applicable_patches{category="feature",severity="critical"} 0 zypper_applicable_patches{category="feature",severity="important"} 0 zypper_applicable_patches{category="feature",severity="moderate"} 0 zypper_applicable_patches{category="feature",severity="low"} 0 zypper_applicable_patches{category="feature",severity="unspecified"} 0 zypper_applicable_patches{category="document",severity="critical"} 0 zypper_applicable_patches{category="document",severity="important"} 0 zypper_applicable_patches{category="document",severity="moderate"} 0 zypper_applicable_patches{category="document",severity="low"} 0 zypper_applicable_patches{category="document",severity="unspecified"} 0 zypper_applicable_patches{category="yast",severity="critical"} 0 zypper_applicable_patches{category="yast",severity="important"} 0 zypper_applicable_patches{category="yast",severity="moderate"} 0 zypper_applicable_patches{category="yast",severity="low"} 0 zypper_applicable_patches{category="yast",severity="unspecified"} 0 # HELP zypper_scrape_success Whether the last scrape for zypper data was successful. # TYPE zypper_scrape_success gauge zypper_scrape_success 1
To get this picked up by the Prometheus Node Exporter’s textfile collector dump the output into a zypper.prom file in the textfile collector directory:
> zypper-patch-status-collector > /var/lib/node_exporter/collector/zypper.prom
Installation
Running this requires Python. Legacy Python (2.7) is also supported.
Install as any python software via pip:
pip install zypper-patch-status-collector
Tests
The tests are based on pytest. Running them on multiple Python versions can be done via tox. Just run the following in the project root:
tox
License
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You can find a full version of the license in the LICENSE file. If not, see https://www.gnu.org/licenses/.
Project details
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
Hashes for zypper-patch-status-collector-0.1.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 71b98303a37c5579abcbc1ba424aa921d048148c29ab8ff4775916ecd1fc5e31 |
|
MD5 | 5da88a04eed4dcff9ace36afdd34d6ed |
|
BLAKE2b-256 | 0d25f4afe56ba1bb700e94e29eba828c47f7ea5d0a5e7d26181f484cd489b7cd |
Hashes for zypper_patch_status_collector-0.1.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 96c8b47e4feb62de4e78e1d96b8e96a63f454b8caeb692c3db3ff31206a54ce8 |
|
MD5 | f40f20226e92ebe3613be0bbb74bd1e1 |
|
BLAKE2b-256 | 1fc6057908003305c609ee91be9ee3c76d9730aa0382f139d60e53367943dfa2 |