Branch: refs/heads/master
Home:
https://github.com/tribe29/checkmk
Commit: 9fe0d9c7efbfb6e0d76f3801283312345d67ff89
https://github.com/tribe29/checkmk/commit/9fe0d9c7efbfb6e0d76f3801283312345…
Author: Max Linke <max.linke(a)tribe29.com>
Date: 2022-04-29 (Fri, 29 Apr 2022)
Changed paths:
M tests/unit/cmk/base/plugins/agent_based/test_systemd_units.py
Log Message:
-----------
simplify systemd tests
Change-Id: Iab9354b8b2b6d192869ac3b47e1a44cbc76e9aae
Commit: 6ebc78e2ef3637661ca7d134b0ee0024963ca4b3
https://github.com/tribe29/checkmk/commit/6ebc78e2ef3637661ca7d134b0ee00249…
Author: Michael Prokop <michael.prokop(a)synpro.solutions>
Date: 2022-04-29 (Fri, 29 Apr 2022)
Changed paths:
M agents/check_mk_agent.linux
Log Message:
-----------
check_mk_agent.linux / systemctl: properly handle units marked with bullet circles
systemd uses the so called bullet circle (SPECIAL_GLYPH_BLACK_CIRCLE)
to mark units in special states (not-found, inactive, dead,... but also
failed).
By default, and when running in a UTF-8 capable environment, systemd
uses the "●" character for the bullet circle, only in ASCII fallback
mode it uses "*" instead.
When C.UTF-8 is available, check_mk_agent uses it as its LC_ALL setting
though, returning something like:
| % LC_ALL="C.utf8" systemctl --all --no-pager | sed '/^$/q' | tr -s
' ' | grep restic-backup
| restic-backup-fileserver01-data-prune.service loaded inactive dead Restic backup prune
of fileserver01-data
| ● restic-backup-mail01-data-prune.service loaded failed failed Restic backup prune of
mail01-data
| restic-backup-fileserver01-data-prune.timer loaded active waiting Weekly restic backup
prune of fileserver01-data
| restic-backup-mail01-data-prune.timer loaded active waiting Weekly restic backup prune
of mail01-data
But such a failed unit isn't detected and handled by checkmk's
systemd_units then (as observed with checkmk v2.0.0p22):
| OK Systemd Service Summary Total: 102, Disabled: 9, Failed: 0
But when using an environment *without* UTF-8 support, systemd's
systemctl would behave as expected by checkmk. Corresponding output:
| % LC_ALL=C systemctl --all --no-pager | sed '/^$/q' | tr -s ' ' | grep
restic-backup
| restic-backup-fileserver01-data-prune.service loaded inactive dead Restic backup prune
of fileserver01-data
| * restic-backup-mail01-data-prune.service loaded failed failed Restic backup prune of
mail01-data
| restic-backup-fileserver01-data-prune.timer loaded active waiting Weekly restic backup
prune of fileserver01-data
| restic-backup-mail01-data-prune.timer loaded active waiting Weekly restic backup prune
of mail01-data
The proper solution though is to use the options `--no-legend --no-pager
--plain` instead, quoting from systemd upstream commit 1cabd2d0c56b7:
| systemctl: hide first column with --plain instead of --no-legend
|
| Hiding the first column, which may contain bullet circles, with --no-legend
| is undocumented and potentially unexpected. On the other hand, not printing
| bullet circles with --plain is documented so hiding the column with that
| switch is sensible.
|
| The combination "--full --no-legend --no-pager --plain" is appropriate for
| automated processing of systemctl output.
And indeed, this behaves as expected then and also checkmk handles it
properly then:
| synpromika@backup ~ % LC_ALL="C.utf8" systemctl --all --no-legend --no-pager
--plain | sed '/^$/q' | tr -s ' ' | grep restic-backup
| restic-backup-fileserver01-data-prune.service loaded inactive dead Restic backup prune
of fileserver01-data
| restic-backup-mail01-data-prune.service loaded failed failed Restic backup prune of
mail01-data
| restic-backup-fileserver01-data-prune.timer loaded active waiting Weekly restic backup
prune of fileserver01-data
| restic-backup-mail01-data-prune.timer loaded active waiting Weekly restic backup prune
of mail01-data
And also checkmk handles it properly then:
| CRIT Systemd Service Summary Total: 125, Disabled: 9, Failed: 1, 1 static service failed
(restic-backup-mail01-data-prune)
Verified systemctl behavior on systemd v232-25 (Debian/stretch), v241-7
(Debian/buster), v247.3 (Debian/bullseye) and v250.4 (Debian/unstable as
of 2022-04-21).
FTR: the --plain option isn't relevant for the new `systemctl status`
handling that got introduced in commit e5d0b1c852. Quoting from
systemctl(1) section about `status` unit command:
| This function is intended to generate human-readable output.
| If you are looking for computer-parsable output, use show instead.
Closes: #457
Signed-off-by: Michael Prokop <tribe29(a)michael-prokop.at>
Change-Id: I265ab6a906659c1fc8731f3b32a4b018436832a2
Commit: 2c1f6adc11b1dd8d525c1256964db4f1b24f374c
https://github.com/tribe29/checkmk/commit/2c1f6adc11b1dd8d525c1256964db4f1b…
Author: Max Linke <max.linke(a)tribe29.com>
Date: 2022-04-29 (Fri, 29 Apr 2022)
Changed paths:
M agents/check_mk_agent.linux
Log Message:
-----------
update linux agent systemd section
Change-Id: Iafb5cbe8b6e8f1a9a9717196d482c224dcab7a6d
Commit: 539640e789851c9ef3652d1b1ed7024a2dea0e7b
https://github.com/tribe29/checkmk/commit/539640e789851c9ef3652d1b1ed7024a2…
Author: Mathias Laurin <mathias.laurin(a)tribe29.com>
Date: 2022-04-29 (Fri, 29 Apr 2022)
Changed paths:
M cmk/gui/fields/definitions.py
M cmk/gui/fields/utils.py
M cmk/gui/plugins/openapi/endpoints/host_tag.py
M cmk/gui/plugins/wato/utils/__init__.py
M cmk/gui/plugins/webapi/utils.py
M cmk/gui/wato/__init__.py
M cmk/gui/wato/pages/bulk_edit.py
M cmk/gui/wato/pages/folders.py
M cmk/gui/wato/pages/hosts.py
M cmk/gui/wato/pages/tags.py
M cmk/gui/watolib/__init__.py
M cmk/gui/watolib/host_attributes.py
M tests/unit/cmk/gui/watolib/test_host_attributes.py
Log Message:
-----------
Remove transient and unused imports #13
- cmk.gui.watolib.host_attributes
Including a trivial cycle where host_attributes module
defines the host_attribute() function but uses it over
an import.
CMK-10313
Change-Id: I51f272a7986127208ee1cc41aff97ffac3434205
Compare:
https://github.com/tribe29/checkmk/compare/3a22b04211f1...539640e78985