From a7a44c908b50ca30f084353aa212abd4c396d8a9 Mon Sep 17 00:00:00 2001 From: mc-fucker Date: Tue, 15 Feb 2022 16:51:07 +0100 Subject: [PATCH] internal systemd function instead of regex for systemd.exitstatus --- modules/zabbix-agent.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/zabbix-agent.nix b/modules/zabbix-agent.nix index 6ac13f9..0627e0d 100644 --- a/modules/zabbix-agent.nix +++ b/modules/zabbix-agent.nix @@ -6,7 +6,7 @@ package = pkgs.zabbix.agent2; settings = { UserParameter = '' - systemd.exitstatus[*],systemctl status "$1" | grep "Main PID: " | grep -Po "(?<=status=)[0-9]{1,3}(?=(/|))" + systemd.exitstatus[*],systemctl show --value -p ExecMainStatus "$1" ''; }; };