mplugin 2.0.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- mplugin-2.0.0/PKG-INFO +108 -0
- mplugin-2.0.0/README.rst +75 -0
- mplugin-2.0.0/pyproject.toml +58 -0
- mplugin-2.0.0/src/mplugin/__init__.py +2315 -0
- mplugin-2.0.0/src/mplugin/py.typed +2 -0
- mplugin-2.0.0/src/mplugin/testing.py +96 -0
mplugin-2.0.0/PKG-INFO
ADDED
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
Metadata-Version: 2.3
|
|
2
|
+
Name: mplugin
|
|
3
|
+
Version: 2.0.0
|
|
4
|
+
Summary: Class library for writing monitoring (Nagios/Icinga) plugins
|
|
5
|
+
Keywords: Nagios,Icinga,plugin,check,monitoring
|
|
6
|
+
Author: Christian Kauhaus, Matthew Pounsett, Josef Friedrich
|
|
7
|
+
Author-email: Christian Kauhaus <kc@flyingcircus.io>, Matthew Pounsett <matt@conundrum.com>, Josef Friedrich <josef@friedrich.rocks>
|
|
8
|
+
License: ZPL-2.1
|
|
9
|
+
Classifier: Development Status :: 5 - Production/Stable
|
|
10
|
+
Classifier: Environment :: Plugins
|
|
11
|
+
Classifier: Intended Audience :: Developers
|
|
12
|
+
Classifier: Intended Audience :: System Administrators
|
|
13
|
+
Classifier: Operating System :: Microsoft :: Windows
|
|
14
|
+
Classifier: Operating System :: POSIX
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
21
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
22
|
+
Classifier: Topic :: System :: Monitoring
|
|
23
|
+
Requires-Dist: typing-extensions>=4.15.0
|
|
24
|
+
Maintainer: Josef Friedrich
|
|
25
|
+
Maintainer-email: Josef Friedrich <josef@friedrich.rocks>
|
|
26
|
+
Requires-Python: >=3.10
|
|
27
|
+
Project-URL: Documentation, https://mplugin.readthedocs.io/
|
|
28
|
+
Project-URL: Download, https://pypi.org/project/mplugin/
|
|
29
|
+
Project-URL: Source, https://github.com/Josef-Friedrich/mplugin
|
|
30
|
+
Project-URL: Issues, https://github.com/Josef-Friedrich/mplugin/issues
|
|
31
|
+
Project-URL: Changelog, https://github.com/Josef-Friedrich/mplugin/blob/main/CHANGELOG.rst
|
|
32
|
+
Description-Content-Type: text/x-rst
|
|
33
|
+
|
|
34
|
+
The m(onitoring)plugin library
|
|
35
|
+
==============================
|
|
36
|
+
|
|
37
|
+
This is a fork of the `nagiosplugin`_. Changes:
|
|
38
|
+
|
|
39
|
+
- Drop support for Python versions 3.9 and below
|
|
40
|
+
- Add type hints
|
|
41
|
+
- Remove deprecated code: ``ScalarResult``
|
|
42
|
+
- Rename all four service state objects to lower-class names. For example,
|
|
43
|
+
``Ok`` was renamed to ``ok``, and so on
|
|
44
|
+
- Rename the warning state from ``warn`` to ``warning``
|
|
45
|
+
- Export the class ``ServiceState``
|
|
46
|
+
- Convert all namped tuples in classes (``Metric``, ``Performance``, ``ServiceState``)
|
|
47
|
+
- Remove ``compat.py``
|
|
48
|
+
- Replace the ``result_cls`` attribute with a ``result`` method
|
|
49
|
+
- Add helper methods ``ok()``, ``warning()``, ``critical()``, ``unknown()`` in ``Context``
|
|
50
|
+
- Add the ``setup_argparse`` function
|
|
51
|
+
- Add the ``timespan()`` function to convert time interval strings, such as ``2h30min``, into seconds.
|
|
52
|
+
- Merge all code into a single source file,
|
|
53
|
+
- Merge the entire code base into a single file to make it easier to embed the code
|
|
54
|
+
in a monitoring plugin instead of importing it. This allows a plugin to be
|
|
55
|
+
implemented without dependencies.
|
|
56
|
+
|
|
57
|
+
About
|
|
58
|
+
-----
|
|
59
|
+
|
|
60
|
+
**mplugin** is a Python class library which helps writing Nagios or Icinga
|
|
61
|
+
compatible plugins easily in Python. It cares for much of the boilerplate code
|
|
62
|
+
and default logic commonly found in monitoring checks, including:
|
|
63
|
+
|
|
64
|
+
- Monitoring Plugin API compliant parameters and output formatting
|
|
65
|
+
- Full monitoring range syntax support
|
|
66
|
+
- Automatic threshold checking
|
|
67
|
+
- Multiple independend measures
|
|
68
|
+
- Custom status line to communicate the main point quickly
|
|
69
|
+
- Long output and performance data
|
|
70
|
+
- Timeout handling
|
|
71
|
+
- Persistent "cookies" to retain state information between check runs
|
|
72
|
+
- Resume log file processing at the point where the last run left
|
|
73
|
+
- No dependencies beyond the Python standard library.
|
|
74
|
+
|
|
75
|
+
**mplugin** runs on POSIX and Windows systems. It is compatible with
|
|
76
|
+
and Python 3.10 and later.
|
|
77
|
+
|
|
78
|
+
Feedback and Suggestions
|
|
79
|
+
------------------------
|
|
80
|
+
|
|
81
|
+
mplugin is currently maintained by Josef Friedrich <josef@friedrich.rocks>. A
|
|
82
|
+
public issue tracker can be found at
|
|
83
|
+
<https://github.com/Josef-Friedrich/mplugin/issues> for bugs, suggestions, and
|
|
84
|
+
patches.
|
|
85
|
+
|
|
86
|
+
License
|
|
87
|
+
-------
|
|
88
|
+
|
|
89
|
+
The mplugin package is released under the Zope Public License 2.1 (ZPL), a
|
|
90
|
+
BSD-style Open Source license.
|
|
91
|
+
|
|
92
|
+
Documentation
|
|
93
|
+
-------------
|
|
94
|
+
|
|
95
|
+
Comprehensive documentation is `available online`_. The examples mentioned in
|
|
96
|
+
the `tutorials`_ can also be found in the `examples` directory of
|
|
97
|
+
the source distribution.
|
|
98
|
+
|
|
99
|
+
.. _available online: https://mplugin.readthedocs.io/
|
|
100
|
+
.. _tutorials: https://mplugin.readthedocs.io/en/stable/tutorial/
|
|
101
|
+
.. _nagiosplugin: https://github.com/mpounsett/nagiosplugin
|
|
102
|
+
|
|
103
|
+
Acknowledgements
|
|
104
|
+
----------------
|
|
105
|
+
|
|
106
|
+
mplugin was originally written and maintained by Christian Kauhaus
|
|
107
|
+
<kc@flyingcircus.io>. Additional contributions from the community are
|
|
108
|
+
acknowledged in the file CONTRIBUTORS.txt
|
mplugin-2.0.0/README.rst
ADDED
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
The m(onitoring)plugin library
|
|
2
|
+
==============================
|
|
3
|
+
|
|
4
|
+
This is a fork of the `nagiosplugin`_. Changes:
|
|
5
|
+
|
|
6
|
+
- Drop support for Python versions 3.9 and below
|
|
7
|
+
- Add type hints
|
|
8
|
+
- Remove deprecated code: ``ScalarResult``
|
|
9
|
+
- Rename all four service state objects to lower-class names. For example,
|
|
10
|
+
``Ok`` was renamed to ``ok``, and so on
|
|
11
|
+
- Rename the warning state from ``warn`` to ``warning``
|
|
12
|
+
- Export the class ``ServiceState``
|
|
13
|
+
- Convert all namped tuples in classes (``Metric``, ``Performance``, ``ServiceState``)
|
|
14
|
+
- Remove ``compat.py``
|
|
15
|
+
- Replace the ``result_cls`` attribute with a ``result`` method
|
|
16
|
+
- Add helper methods ``ok()``, ``warning()``, ``critical()``, ``unknown()`` in ``Context``
|
|
17
|
+
- Add the ``setup_argparse`` function
|
|
18
|
+
- Add the ``timespan()`` function to convert time interval strings, such as ``2h30min``, into seconds.
|
|
19
|
+
- Merge all code into a single source file,
|
|
20
|
+
- Merge the entire code base into a single file to make it easier to embed the code
|
|
21
|
+
in a monitoring plugin instead of importing it. This allows a plugin to be
|
|
22
|
+
implemented without dependencies.
|
|
23
|
+
|
|
24
|
+
About
|
|
25
|
+
-----
|
|
26
|
+
|
|
27
|
+
**mplugin** is a Python class library which helps writing Nagios or Icinga
|
|
28
|
+
compatible plugins easily in Python. It cares for much of the boilerplate code
|
|
29
|
+
and default logic commonly found in monitoring checks, including:
|
|
30
|
+
|
|
31
|
+
- Monitoring Plugin API compliant parameters and output formatting
|
|
32
|
+
- Full monitoring range syntax support
|
|
33
|
+
- Automatic threshold checking
|
|
34
|
+
- Multiple independend measures
|
|
35
|
+
- Custom status line to communicate the main point quickly
|
|
36
|
+
- Long output and performance data
|
|
37
|
+
- Timeout handling
|
|
38
|
+
- Persistent "cookies" to retain state information between check runs
|
|
39
|
+
- Resume log file processing at the point where the last run left
|
|
40
|
+
- No dependencies beyond the Python standard library.
|
|
41
|
+
|
|
42
|
+
**mplugin** runs on POSIX and Windows systems. It is compatible with
|
|
43
|
+
and Python 3.10 and later.
|
|
44
|
+
|
|
45
|
+
Feedback and Suggestions
|
|
46
|
+
------------------------
|
|
47
|
+
|
|
48
|
+
mplugin is currently maintained by Josef Friedrich <josef@friedrich.rocks>. A
|
|
49
|
+
public issue tracker can be found at
|
|
50
|
+
<https://github.com/Josef-Friedrich/mplugin/issues> for bugs, suggestions, and
|
|
51
|
+
patches.
|
|
52
|
+
|
|
53
|
+
License
|
|
54
|
+
-------
|
|
55
|
+
|
|
56
|
+
The mplugin package is released under the Zope Public License 2.1 (ZPL), a
|
|
57
|
+
BSD-style Open Source license.
|
|
58
|
+
|
|
59
|
+
Documentation
|
|
60
|
+
-------------
|
|
61
|
+
|
|
62
|
+
Comprehensive documentation is `available online`_. The examples mentioned in
|
|
63
|
+
the `tutorials`_ can also be found in the `examples` directory of
|
|
64
|
+
the source distribution.
|
|
65
|
+
|
|
66
|
+
.. _available online: https://mplugin.readthedocs.io/
|
|
67
|
+
.. _tutorials: https://mplugin.readthedocs.io/en/stable/tutorial/
|
|
68
|
+
.. _nagiosplugin: https://github.com/mpounsett/nagiosplugin
|
|
69
|
+
|
|
70
|
+
Acknowledgements
|
|
71
|
+
----------------
|
|
72
|
+
|
|
73
|
+
mplugin was originally written and maintained by Christian Kauhaus
|
|
74
|
+
<kc@flyingcircus.io>. Additional contributions from the community are
|
|
75
|
+
acknowledged in the file CONTRIBUTORS.txt
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
|
|
2
|
+
[project]
|
|
3
|
+
name = "mplugin"
|
|
4
|
+
version = "2.0.0"
|
|
5
|
+
description = "Class library for writing monitoring (Nagios/Icinga) plugins"
|
|
6
|
+
authors = [
|
|
7
|
+
{ name = "Christian Kauhaus", email = "kc@flyingcircus.io" },
|
|
8
|
+
{ name = "Matthew Pounsett", email = "matt@conundrum.com" },
|
|
9
|
+
{ name = "Josef Friedrich", email = "josef@friedrich.rocks" }
|
|
10
|
+
]
|
|
11
|
+
maintainers = [
|
|
12
|
+
{ name = "Josef Friedrich", email = "josef@friedrich.rocks" }
|
|
13
|
+
]
|
|
14
|
+
readme = "README.rst"
|
|
15
|
+
license = { text = "ZPL-2.1" }
|
|
16
|
+
keywords = ["Nagios", "Icinga", "plugin", "check", "monitoring"]
|
|
17
|
+
requires-python = ">= 3.10"
|
|
18
|
+
classifiers = [
|
|
19
|
+
'Development Status :: 5 - Production/Stable',
|
|
20
|
+
'Environment :: Plugins',
|
|
21
|
+
'Intended Audience :: Developers',
|
|
22
|
+
'Intended Audience :: System Administrators',
|
|
23
|
+
'Operating System :: Microsoft :: Windows',
|
|
24
|
+
'Operating System :: POSIX',
|
|
25
|
+
'Programming Language :: Python :: 3.9',
|
|
26
|
+
'Programming Language :: Python :: 3.10',
|
|
27
|
+
'Programming Language :: Python :: 3.11',
|
|
28
|
+
'Programming Language :: Python :: 3.12',
|
|
29
|
+
'Programming Language :: Python :: 3.13',
|
|
30
|
+
'Programming Language :: Python :: 3.14',
|
|
31
|
+
'Topic :: Software Development :: Libraries :: Python Modules',
|
|
32
|
+
'Topic :: System :: Monitoring',
|
|
33
|
+
]
|
|
34
|
+
dependencies = [
|
|
35
|
+
"typing-extensions>=4.15.0",
|
|
36
|
+
]
|
|
37
|
+
|
|
38
|
+
[build-system]
|
|
39
|
+
requires = ["uv_build>=0.10.7,<0.11.0"]
|
|
40
|
+
build-backend = "uv_build"
|
|
41
|
+
|
|
42
|
+
[dependency-groups]
|
|
43
|
+
dev = [
|
|
44
|
+
"mypy>=1.19.1",
|
|
45
|
+
"pytest>=8.4.2",
|
|
46
|
+
]
|
|
47
|
+
|
|
48
|
+
[project.urls]
|
|
49
|
+
Documentation = "https://mplugin.readthedocs.io/"
|
|
50
|
+
Download = "https://pypi.org/project/mplugin/"
|
|
51
|
+
Source = "https://github.com/Josef-Friedrich/mplugin"
|
|
52
|
+
Issues = "https://github.com/Josef-Friedrich/mplugin/issues"
|
|
53
|
+
Changelog = "https://github.com/Josef-Friedrich/mplugin/blob/main/CHANGELOG.rst"
|
|
54
|
+
|
|
55
|
+
[tool.ruff]
|
|
56
|
+
|
|
57
|
+
[tool.ruff.format]
|
|
58
|
+
docstring-code-format = true
|