Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Sébastien Luttringer
infrastructure
Commits
12e05ae1
Verified
Commit
12e05ae1
authored
Apr 09, 2018
by
Florian Pritz
Browse files
zabbix: Ignore failed syncrepo services
Signed-off-by:
Florian Pritz
<
bluewind@xinu.at
>
parent
caa7b0c4
Changes
1
Hide whitespace changes
Inline
Side-by-side
roles/zabbix-agent/files/systemd-units-failed.py
View file @
12e05ae1
...
...
@@ -2,10 +2,13 @@
import
dbus
ignore
=
set
([
'syncrepo.service'
,
'syncrepo_arch32.service'
])
bus
=
dbus
.
SystemBus
()
systemd1
=
bus
.
get_object
(
'org.freedesktop.systemd1'
,
'/org/freedesktop/systemd1'
)
systemd1_manager
=
dbus
.
Interface
(
systemd1
,
dbus_interface
=
'org.freedesktop.systemd1.Manager'
)
units
=
systemd1_manager
.
ListUnits
()
for
unit
in
filter
(
lambda
u
:
u
[
3
]
==
'failed'
,
units
):
for
unit
in
filter
(
lambda
u
:
u
[
3
]
==
'failed'
and
u
[
0
]
not
in
ignore
,
units
):
print
(
unit
[
0
])
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment