From 907358cb857b9cc32171191e851e1de7894e225d Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Sat, 23 Aug 2025 23:24:13 +0200 Subject: [PATCH] check-health.d/state: use script name for origin in notification --- check-health.d/state.rsc | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/check-health.d/state.rsc b/check-health.d/state.rsc index 2991935..5e4cbb8 100644 --- a/check-health.d/state.rsc +++ b/check-health.d/state.rsc @@ -11,7 +11,8 @@ :global CheckHealthPlugins; :set ($CheckHealthPlugins->[ :jobname ]) do={ - :local FuncName [ :tostr $0 ]; + :local FuncName [ :tostr $0 ]; + :local ScriptName [ :tostr $1 ]; :global CheckHealthLast; :global Identity; @@ -32,13 +33,13 @@ :if ([ :typeof ($CheckHealthLast->$Name) ] != "nothing") do={ :if ($CheckHealthLast->$Name = "ok" && \ $Value != "ok") do={ - $SendNotification2 ({ origin=$FuncName; \ + $SendNotification2 ({ origin=$ScriptName; \ subject=([ $SymbolForNotification "cross-mark" ] . "Health warning: " . $Name); \ message=("The device '" . $Name . "' on " . $Identity . " failed!") }); } :if ($CheckHealthLast->$Name != "ok" && \ $Value = "ok") do={ - $SendNotification2 ({ origin=$FuncName; \ + $SendNotification2 ({ origin=$ScriptName; \ subject=([ $SymbolForNotification "white-heavy-check-mark" ] . "Health recovery: " . $Name); \ message=("The device '" . $Name . "' on " . $Identity . " recovered!") }); }