command_watcher 0.5.0__tar.gz → 0.6.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.
- {command_watcher-0.5.0 → command_watcher-0.6.0}/PKG-INFO +48 -44
- {command_watcher-0.5.0 → command_watcher-0.6.0}/README.rst +30 -26
- command_watcher-0.6.0/pyproject.toml +49 -0
- {command_watcher-0.5.0 → command_watcher-0.6.0/src}/command_watcher/__init__.py +88 -161
- command_watcher-0.6.0/src/command_watcher/channels/base_channel.py +11 -0
- command_watcher-0.6.0/src/command_watcher/channels/beep.py +47 -0
- command_watcher-0.6.0/src/command_watcher/channels/email.py +67 -0
- command_watcher-0.6.0/src/command_watcher/channels/icinga.py +72 -0
- command_watcher-0.6.0/src/command_watcher/config.py +58 -0
- {command_watcher-0.5.0 → command_watcher-0.6.0/src}/command_watcher/log.py +5 -5
- command_watcher-0.6.0/src/command_watcher/message.py +200 -0
- command_watcher-0.6.0/src/command_watcher/report.py +29 -0
- {command_watcher-0.5.0 → command_watcher-0.6.0/src}/command_watcher/utils.py +5 -0
- command_watcher-0.5.0/LICENSE +0 -22
- command_watcher-0.5.0/command_watcher/email.py +0 -42
- command_watcher-0.5.0/command_watcher/report.py +0 -353
- command_watcher-0.5.0/pyproject.toml +0 -34
- {command_watcher-0.5.0 → command_watcher-0.6.0/src}/command_watcher/py.typed +0 -0
|
@@ -1,24 +1,25 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: command_watcher
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.6.0
|
|
4
4
|
Summary: Module to watch the execution of shell scripts. Both streams (`stdout` and `stderr`) are captured.
|
|
5
|
-
Home-page: https://github.com/Josef-Friedrich/command-watcher
|
|
6
|
-
License: MIT
|
|
7
5
|
Author: Josef Friedrich
|
|
8
|
-
Author-email: josef@friedrich.rocks
|
|
9
|
-
|
|
6
|
+
Author-email: Josef Friedrich <josef@friedrich.rocks>
|
|
7
|
+
License-Expression: MIT
|
|
10
8
|
Classifier: Development Status :: 5 - Production/Stable
|
|
11
9
|
Classifier: License :: OSI Approved :: MIT License
|
|
10
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
12
11
|
Classifier: Programming Language :: Python :: 3
|
|
13
|
-
Classifier: Programming Language :: Python :: 3.10
|
|
14
|
-
Classifier: Programming Language :: Python :: 3.11
|
|
15
12
|
Classifier: Programming Language :: Python :: 3.12
|
|
16
|
-
Classifier: Programming Language :: Python :: 3
|
|
17
|
-
|
|
18
|
-
Requires-Dist: pretiac
|
|
19
|
-
Requires-Dist:
|
|
20
|
-
Requires-Dist:
|
|
21
|
-
Requires-Dist:
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
15
|
+
Requires-Dist: pretiac>=0.6.0
|
|
16
|
+
Requires-Dist: pydantic>=2.12.5
|
|
17
|
+
Requires-Dist: pyyaml>=6.0.3
|
|
18
|
+
Requires-Dist: termcolor>=3.3.0
|
|
19
|
+
Requires-Dist: types-pyyaml>=6.0.12.20250915
|
|
20
|
+
Requires-Dist: types-requests>=2.32.4.20260107
|
|
21
|
+
Requires-Dist: types-termcolor>=1.1.6.2
|
|
22
|
+
Requires-Python: >=3.12, <4
|
|
22
23
|
Project-URL: Repository, https://github.com/Josef-Friedrich/command-watcher
|
|
23
24
|
Description-Content-Type: text/x-rst
|
|
24
25
|
|
|
@@ -48,20 +49,22 @@ and `stderr`) are captured.
|
|
|
48
49
|
|
|
49
50
|
.. code-block:: python
|
|
50
51
|
|
|
52
|
+
#! /opt/venvs/command_watcher/bin/python
|
|
53
|
+
|
|
51
54
|
from command_watcher import Watch
|
|
52
55
|
watch = Watch(
|
|
53
|
-
config_file='/etc/command-watcher.
|
|
56
|
+
config_file='/etc/command-watcher.yml',
|
|
54
57
|
service_name='texlive_update'
|
|
55
58
|
)
|
|
56
59
|
|
|
57
60
|
tlmgr = '/usr/local/texlive/bin/x86_64-linux/tlmgr'
|
|
58
61
|
|
|
59
|
-
watch.run('{} update --self'
|
|
60
|
-
watch.run('{} update --all'
|
|
62
|
+
watch.run(f'{tlmgr} update --self')
|
|
63
|
+
watch.run(f'{tlmgr} update --all')
|
|
61
64
|
installed_packages = watch.run(
|
|
62
|
-
'{} info --only-installed'
|
|
65
|
+
f'{tlmgr} info --only-installed', log=False
|
|
63
66
|
)
|
|
64
|
-
all_packages = watch.run('{} info'
|
|
67
|
+
all_packages = watch.run(f'{tlmgr} info', log=False)
|
|
65
68
|
|
|
66
69
|
watch.final_report(
|
|
67
70
|
status=0,
|
|
@@ -71,28 +74,29 @@ and `stderr`) are captured.
|
|
|
71
74
|
},
|
|
72
75
|
)
|
|
73
76
|
|
|
74
|
-
.. code-block::
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
77
|
+
.. code-block:: yaml
|
|
78
|
+
|
|
79
|
+
---
|
|
80
|
+
email:
|
|
81
|
+
from_addr: logs@example.com
|
|
82
|
+
to_addr: logs@example.com
|
|
83
|
+
to_addr_critical: critical@example.com
|
|
84
|
+
smtp_login: mailer@mail.example.com
|
|
85
|
+
smtp_password: abcd
|
|
86
|
+
smtp_server: mail.example.com:587
|
|
87
|
+
|
|
88
|
+
icinga:
|
|
89
|
+
api_endpoint_host: localhost
|
|
90
|
+
api_endpoint_port: 5665
|
|
91
|
+
client_private_key: /etc/pretiac/api-client.key.pem
|
|
92
|
+
client_certificate: /etc/pretiac/api-client.cert.pem
|
|
93
|
+
ca_certificate: /etc/pretiac/ca.crt
|
|
94
|
+
new_host_defaults:
|
|
95
|
+
templates: [passive-host]
|
|
96
|
+
new_service_defaults:
|
|
97
|
+
templates: [passive-service]
|
|
98
|
+
attrs:
|
|
99
|
+
check_interval: monthly
|
|
100
|
+
|
|
101
|
+
beep:
|
|
102
|
+
activated: true
|
|
@@ -24,20 +24,22 @@ and `stderr`) are captured.
|
|
|
24
24
|
|
|
25
25
|
.. code-block:: python
|
|
26
26
|
|
|
27
|
+
#! /opt/venvs/command_watcher/bin/python
|
|
28
|
+
|
|
27
29
|
from command_watcher import Watch
|
|
28
30
|
watch = Watch(
|
|
29
|
-
config_file='/etc/command-watcher.
|
|
31
|
+
config_file='/etc/command-watcher.yml',
|
|
30
32
|
service_name='texlive_update'
|
|
31
33
|
)
|
|
32
34
|
|
|
33
35
|
tlmgr = '/usr/local/texlive/bin/x86_64-linux/tlmgr'
|
|
34
36
|
|
|
35
|
-
watch.run('{} update --self'
|
|
36
|
-
watch.run('{} update --all'
|
|
37
|
+
watch.run(f'{tlmgr} update --self')
|
|
38
|
+
watch.run(f'{tlmgr} update --all')
|
|
37
39
|
installed_packages = watch.run(
|
|
38
|
-
'{} info --only-installed'
|
|
40
|
+
f'{tlmgr} info --only-installed', log=False
|
|
39
41
|
)
|
|
40
|
-
all_packages = watch.run('{} info'
|
|
42
|
+
all_packages = watch.run(f'{tlmgr} info', log=False)
|
|
41
43
|
|
|
42
44
|
watch.final_report(
|
|
43
45
|
status=0,
|
|
@@ -47,27 +49,29 @@ and `stderr`) are captured.
|
|
|
47
49
|
},
|
|
48
50
|
)
|
|
49
51
|
|
|
50
|
-
.. code-block::
|
|
51
|
-
|
|
52
|
-
[email]
|
|
53
|
-
subject_prefix = [cwatcher]
|
|
54
|
-
from_addr =
|
|
55
|
-
to_addr = logs@example.com
|
|
56
|
-
to_addr_critical = critical@example.com
|
|
57
|
-
smtp_login = mailer
|
|
58
|
-
smtp_password = 1234
|
|
59
|
-
smtp_server = mail.example.com:587
|
|
52
|
+
.. code-block:: yaml
|
|
60
53
|
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
54
|
+
---
|
|
55
|
+
email:
|
|
56
|
+
from_addr: logs@example.com
|
|
57
|
+
to_addr: logs@example.com
|
|
58
|
+
to_addr_critical: critical@example.com
|
|
59
|
+
smtp_login: mailer@mail.example.com
|
|
60
|
+
smtp_password: abcd
|
|
61
|
+
smtp_server: mail.example.com:587
|
|
66
62
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
63
|
+
icinga:
|
|
64
|
+
api_endpoint_host: localhost
|
|
65
|
+
api_endpoint_port: 5665
|
|
66
|
+
client_private_key: /etc/pretiac/api-client.key.pem
|
|
67
|
+
client_certificate: /etc/pretiac/api-client.cert.pem
|
|
68
|
+
ca_certificate: /etc/pretiac/ca.crt
|
|
69
|
+
new_host_defaults:
|
|
70
|
+
templates: [passive-host]
|
|
71
|
+
new_service_defaults:
|
|
72
|
+
templates: [passive-service]
|
|
73
|
+
attrs:
|
|
74
|
+
check_interval: monthly
|
|
71
75
|
|
|
72
|
-
|
|
73
|
-
|
|
76
|
+
beep:
|
|
77
|
+
activated: true
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
[project]
|
|
2
|
+
name = "command_watcher"
|
|
3
|
+
version = "0.6.0"
|
|
4
|
+
description = "Module to watch the execution of shell scripts. Both streams (`stdout` and `stderr`) are captured."
|
|
5
|
+
authors = [{ name = "Josef Friedrich", email = "josef@friedrich.rocks" }]
|
|
6
|
+
requires-python = ">=3.12,<4"
|
|
7
|
+
readme = "README.rst"
|
|
8
|
+
license = "MIT"
|
|
9
|
+
classifiers = [
|
|
10
|
+
"Development Status :: 5 - Production/Stable",
|
|
11
|
+
"License :: OSI Approved :: MIT License",
|
|
12
|
+
"Programming Language :: Python :: 3 :: Only",
|
|
13
|
+
"Programming Language :: Python :: 3",
|
|
14
|
+
"Programming Language :: Python :: 3.12",
|
|
15
|
+
"Programming Language :: Python :: 3.13",
|
|
16
|
+
"Programming Language :: Python :: 3.14",
|
|
17
|
+
]
|
|
18
|
+
dependencies = [
|
|
19
|
+
"pretiac>=0.6.0",
|
|
20
|
+
"pydantic>=2.12.5",
|
|
21
|
+
"pyyaml>=6.0.3",
|
|
22
|
+
"termcolor>=3.3.0",
|
|
23
|
+
"types-pyyaml>=6.0.12.20250915",
|
|
24
|
+
"types-requests>=2.32.4.20260107",
|
|
25
|
+
"types-termcolor>=1.1.6.2",
|
|
26
|
+
]
|
|
27
|
+
|
|
28
|
+
[project.urls]
|
|
29
|
+
Repository = "https://github.com/Josef-Friedrich/command-watcher"
|
|
30
|
+
|
|
31
|
+
[dependency-groups]
|
|
32
|
+
dev = [
|
|
33
|
+
"pytest>=9.0.2",
|
|
34
|
+
"stdout-stderr-capturing>=0.2.1",
|
|
35
|
+
]
|
|
36
|
+
|
|
37
|
+
[tool.uv]
|
|
38
|
+
|
|
39
|
+
[tool.uv.sources]
|
|
40
|
+
pretiac = { git = "https://github.com/Josef-Friedrich/PREtty-Typed-Icinga2-Api-Client_py.git" }
|
|
41
|
+
|
|
42
|
+
[build-system]
|
|
43
|
+
requires = ["uv_build>=0.11.1,<0.12.0"]
|
|
44
|
+
build-backend = "uv_build"
|
|
45
|
+
|
|
46
|
+
[tool.pytest.ini_options]
|
|
47
|
+
verbosity_assertions = 2
|
|
48
|
+
truncation_limit_lines = 999999
|
|
49
|
+
truncation_limit_chars = 999999
|