check_systemd 2.0.3__tar.gz → 2.0.6__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.
- {check_systemd-2.0.3 → check_systemd-2.0.6}/PKG-INFO +14 -2
- {check_systemd-2.0.3 → check_systemd-2.0.6}/README.md +13 -1
- {check_systemd-2.0.3 → check_systemd-2.0.6}/check_systemd.egg-info/PKG-INFO +14 -2
- {check_systemd-2.0.3 → check_systemd-2.0.6}/check_systemd.py +31 -8
- {check_systemd-2.0.3 → check_systemd-2.0.6}/LICENSE +0 -0
- {check_systemd-2.0.3 → check_systemd-2.0.6}/MANIFEST.in +0 -0
- {check_systemd-2.0.3 → check_systemd-2.0.6}/check_systemd.egg-info/SOURCES.txt +0 -0
- {check_systemd-2.0.3 → check_systemd-2.0.6}/check_systemd.egg-info/dependency_links.txt +0 -0
- {check_systemd-2.0.3 → check_systemd-2.0.6}/check_systemd.egg-info/entry_points.txt +0 -0
- {check_systemd-2.0.3 → check_systemd-2.0.6}/check_systemd.egg-info/requires.txt +0 -0
- {check_systemd-2.0.3 → check_systemd-2.0.6}/check_systemd.egg-info/top_level.txt +0 -0
- {check_systemd-2.0.3 → check_systemd-2.0.6}/setup.cfg +0 -0
- {check_systemd-2.0.3 → check_systemd-2.0.6}/setup.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: check_systemd
|
|
3
|
-
Version: 2.0.
|
|
3
|
+
Version: 2.0.6
|
|
4
4
|
Summary: Nagios / Icinga monitoring plugin to check systemd for failed units.
|
|
5
5
|
Home-page: https://github.com/Josef-Friedrich/check_systemd
|
|
6
6
|
Author: Josef Friedrich
|
|
@@ -13,7 +13,7 @@ Description: [](https
|
|
|
13
13
|
|
|
14
14
|
Nagios / Icinga monitoring plugin to check systemd for failed units.
|
|
15
15
|
|
|
16
|
-
This Python script will report a degraded system to Nagios /
|
|
16
|
+
This Python script will report a degraded system to Nagios / Icinga.
|
|
17
17
|
It requires only the nagiosplugin library.
|
|
18
18
|
|
|
19
19
|
You can also test a single service with -s parameter.
|
|
@@ -31,6 +31,9 @@ Description: [](https
|
|
|
31
31
|
```
|
|
32
32
|
usage: nosetests [-h] [-c SECONDS] [-e UNIT | -u UNIT] [-v] [-V] [-w SECONDS]
|
|
33
33
|
|
|
34
|
+
Copyright (c) 2014-18 Andrea Briganti a.k.a 'Kbyte' <kbytesys@gmail.com>
|
|
35
|
+
Copyright (c) 2019 Josef Friedrich <josef@friedrich.rocks>
|
|
36
|
+
|
|
34
37
|
Nagios / Icinga monitoring plugin to check systemd for failed units.
|
|
35
38
|
|
|
36
39
|
optional arguments:
|
|
@@ -47,12 +50,21 @@ Description: [](https
|
|
|
47
50
|
-w SECONDS, --warning SECONDS
|
|
48
51
|
Startup time in seconds to result in warning status.
|
|
49
52
|
|
|
53
|
+
Performance data:
|
|
54
|
+
- count_units
|
|
55
|
+
- startup_time
|
|
56
|
+
- units_activating
|
|
57
|
+
- units_active
|
|
58
|
+
- units_failed
|
|
59
|
+
- units_inactive
|
|
60
|
+
|
|
50
61
|
```
|
|
51
62
|
|
|
52
63
|
## Project pages
|
|
53
64
|
|
|
54
65
|
* https://github.com/Josef-Friedrich/check_systemd
|
|
55
66
|
* https://exchange.icinga.com/joseffriedrich/check_systemd
|
|
67
|
+
* https://exchange.nagios.org/directory/Plugins/System-Metrics/Processes/check_systemd
|
|
56
68
|
|
|
57
69
|
## Testing
|
|
58
70
|
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
|
|
6
6
|
Nagios / Icinga monitoring plugin to check systemd for failed units.
|
|
7
7
|
|
|
8
|
-
This Python script will report a degraded system to Nagios /
|
|
8
|
+
This Python script will report a degraded system to Nagios / Icinga.
|
|
9
9
|
It requires only the nagiosplugin library.
|
|
10
10
|
|
|
11
11
|
You can also test a single service with -s parameter.
|
|
@@ -23,6 +23,9 @@ pip3 install check_systemd
|
|
|
23
23
|
```
|
|
24
24
|
usage: nosetests [-h] [-c SECONDS] [-e UNIT | -u UNIT] [-v] [-V] [-w SECONDS]
|
|
25
25
|
|
|
26
|
+
Copyright (c) 2014-18 Andrea Briganti a.k.a 'Kbyte' <kbytesys@gmail.com>
|
|
27
|
+
Copyright (c) 2019 Josef Friedrich <josef@friedrich.rocks>
|
|
28
|
+
|
|
26
29
|
Nagios / Icinga monitoring plugin to check systemd for failed units.
|
|
27
30
|
|
|
28
31
|
optional arguments:
|
|
@@ -39,12 +42,21 @@ optional arguments:
|
|
|
39
42
|
-w SECONDS, --warning SECONDS
|
|
40
43
|
Startup time in seconds to result in warning status.
|
|
41
44
|
|
|
45
|
+
Performance data:
|
|
46
|
+
- count_units
|
|
47
|
+
- startup_time
|
|
48
|
+
- units_activating
|
|
49
|
+
- units_active
|
|
50
|
+
- units_failed
|
|
51
|
+
- units_inactive
|
|
52
|
+
|
|
42
53
|
```
|
|
43
54
|
|
|
44
55
|
## Project pages
|
|
45
56
|
|
|
46
57
|
* https://github.com/Josef-Friedrich/check_systemd
|
|
47
58
|
* https://exchange.icinga.com/joseffriedrich/check_systemd
|
|
59
|
+
* https://exchange.nagios.org/directory/Plugins/System-Metrics/Processes/check_systemd
|
|
48
60
|
|
|
49
61
|
## Testing
|
|
50
62
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: check-systemd
|
|
3
|
-
Version: 2.0.
|
|
3
|
+
Version: 2.0.6
|
|
4
4
|
Summary: Nagios / Icinga monitoring plugin to check systemd for failed units.
|
|
5
5
|
Home-page: https://github.com/Josef-Friedrich/check_systemd
|
|
6
6
|
Author: Josef Friedrich
|
|
@@ -13,7 +13,7 @@ Description: [](https
|
|
|
13
13
|
|
|
14
14
|
Nagios / Icinga monitoring plugin to check systemd for failed units.
|
|
15
15
|
|
|
16
|
-
This Python script will report a degraded system to Nagios /
|
|
16
|
+
This Python script will report a degraded system to Nagios / Icinga.
|
|
17
17
|
It requires only the nagiosplugin library.
|
|
18
18
|
|
|
19
19
|
You can also test a single service with -s parameter.
|
|
@@ -31,6 +31,9 @@ Description: [](https
|
|
|
31
31
|
```
|
|
32
32
|
usage: nosetests [-h] [-c SECONDS] [-e UNIT | -u UNIT] [-v] [-V] [-w SECONDS]
|
|
33
33
|
|
|
34
|
+
Copyright (c) 2014-18 Andrea Briganti a.k.a 'Kbyte' <kbytesys@gmail.com>
|
|
35
|
+
Copyright (c) 2019 Josef Friedrich <josef@friedrich.rocks>
|
|
36
|
+
|
|
34
37
|
Nagios / Icinga monitoring plugin to check systemd for failed units.
|
|
35
38
|
|
|
36
39
|
optional arguments:
|
|
@@ -47,12 +50,21 @@ Description: [](https
|
|
|
47
50
|
-w SECONDS, --warning SECONDS
|
|
48
51
|
Startup time in seconds to result in warning status.
|
|
49
52
|
|
|
53
|
+
Performance data:
|
|
54
|
+
- count_units
|
|
55
|
+
- startup_time
|
|
56
|
+
- units_activating
|
|
57
|
+
- units_active
|
|
58
|
+
- units_failed
|
|
59
|
+
- units_inactive
|
|
60
|
+
|
|
50
61
|
```
|
|
51
62
|
|
|
52
63
|
## Project pages
|
|
53
64
|
|
|
54
65
|
* https://github.com/Josef-Friedrich/check_systemd
|
|
55
66
|
* https://exchange.icinga.com/joseffriedrich/check_systemd
|
|
67
|
+
* https://exchange.nagios.org/directory/Plugins/System-Metrics/Processes/check_systemd
|
|
56
68
|
|
|
57
69
|
## Testing
|
|
58
70
|
|
|
@@ -15,7 +15,7 @@ import re
|
|
|
15
15
|
import nagiosplugin
|
|
16
16
|
from nagiosplugin import Metric
|
|
17
17
|
|
|
18
|
-
__version__ = '2.0.
|
|
18
|
+
__version__ = '2.0.6'
|
|
19
19
|
|
|
20
20
|
|
|
21
21
|
class SystemdctlListUnitsResource(nagiosplugin.Resource):
|
|
@@ -136,14 +136,25 @@ class SystemdAnalyseResource(nagiosplugin.Resource):
|
|
|
136
136
|
raise nagiosplugin.CheckError(stderr)
|
|
137
137
|
|
|
138
138
|
if stdout:
|
|
139
|
+
stdout = stdout.decode('utf-8')
|
|
140
|
+
# First line:
|
|
141
|
+
# Startup finished in 1.672s (kernel) + 21.378s (userspace) =
|
|
142
|
+
# 23.050s
|
|
143
|
+
|
|
144
|
+
# On raspian no second line
|
|
139
145
|
# Second line:
|
|
140
146
|
# graphical.target reached after 1min 2.154s in userspace
|
|
141
|
-
match = re.search(r'reached after (.+) in userspace',
|
|
142
|
-
|
|
147
|
+
match = re.search(r'reached after (.+) in userspace', stdout)
|
|
148
|
+
|
|
149
|
+
if not match:
|
|
150
|
+
match = re.search(r' = (.+)\n', stdout)
|
|
143
151
|
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
152
|
+
# Output when boot process is not finished:
|
|
153
|
+
# Bootup is not yet finished. Please try again later.
|
|
154
|
+
if match:
|
|
155
|
+
yield Metric(name='startup_time',
|
|
156
|
+
value=format_timespan_to_seconds(match.group(1)),
|
|
157
|
+
context='startup_time')
|
|
147
158
|
|
|
148
159
|
|
|
149
160
|
class SystemctlIsActiveResource(nagiosplugin.Resource):
|
|
@@ -261,8 +272,20 @@ class SystemdSummary(nagiosplugin.Summary):
|
|
|
261
272
|
|
|
262
273
|
def get_argparser():
|
|
263
274
|
parser = argparse.ArgumentParser(
|
|
264
|
-
|
|
265
|
-
|
|
275
|
+
formatter_class=argparse.RawDescriptionHelpFormatter,
|
|
276
|
+
description= # noqa: E251
|
|
277
|
+
'Copyright (c) 2014-18 Andrea Briganti a.k.a \'Kbyte\' <kbytesys@gmail.com>\n' # noqa: E501
|
|
278
|
+
'Copyright (c) 2019 Josef Friedrich <josef@friedrich.rocks>\n'
|
|
279
|
+
'\n'
|
|
280
|
+
'Nagios / Icinga monitoring plugin to check systemd for failed units.\n', # noqa: E501
|
|
281
|
+
epilog= # noqa: E251
|
|
282
|
+
'Performance data:\n'
|
|
283
|
+
' - count_units\n'
|
|
284
|
+
' - startup_time\n'
|
|
285
|
+
' - units_activating\n'
|
|
286
|
+
' - units_active\n'
|
|
287
|
+
' - units_failed\n'
|
|
288
|
+
' - units_inactive\n',
|
|
266
289
|
)
|
|
267
290
|
|
|
268
291
|
exclusive_group = parser.add_mutually_exclusive_group()
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|