From 23ae78c6fffe32b0fc7d7bcbbb68f7d6ad59544c Mon Sep 17 00:00:00 2001 From: Sheppy Date: Tue, 14 Mar 2023 11:51:32 +0100 Subject: [PATCH] fix: service name not shown pynag --- files/pynagsystemd.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/files/pynagsystemd.py b/files/pynagsystemd.py index c612f21..e0589de 100755 --- a/files/pynagsystemd.py +++ b/files/pynagsystemd.py @@ -32,7 +32,8 @@ class SystemdStatus(nagiosplugin.Resource): if pres: result = "" for line in io.StringIO(pres.decode('utf-8')): - result = "%s %s" % (result, line.split(' ')[0]) + # format is DOT_SPECIA_CHAR name service failed .. + result = "%s %s" % (result, line.split(' ')[1]) return [nagiosplugin.Metric('systemd', (False, result), context='systemd')]