mirror of
https://github.com/eworm-de/routeros-scripts.git
synced 2025-12-06 01:49:28 +00:00
check-health.d/temperature: use script name for origin in notification
This commit is contained in:
parent
907358cb85
commit
62ca30b5d3
1 changed files with 4 additions and 3 deletions
|
|
@ -11,7 +11,8 @@
|
||||||
:global CheckHealthPlugins;
|
:global CheckHealthPlugins;
|
||||||
|
|
||||||
:set ($CheckHealthPlugins->[ :jobname ]) do={
|
:set ($CheckHealthPlugins->[ :jobname ]) do={
|
||||||
:local FuncName [ :tostr $0 ];
|
:local FuncName [ :tostr $0 ];
|
||||||
|
:local ScriptName [ :tostr $1 ];
|
||||||
|
|
||||||
:global CheckHealthLast;
|
:global CheckHealthLast;
|
||||||
:global CheckHealthTemperature;
|
:global CheckHealthTemperature;
|
||||||
|
|
@ -54,7 +55,7 @@
|
||||||
}
|
}
|
||||||
:if ($Value > $CheckHealthTemperature->$Name && \
|
:if ($Value > $CheckHealthTemperature->$Name && \
|
||||||
$CheckHealthTemperatureNotified->$Name != true) do={
|
$CheckHealthTemperatureNotified->$Name != true) do={
|
||||||
$SendNotification2 ({ origin=$FuncName; \
|
$SendNotification2 ({ origin=$ScriptName; \
|
||||||
subject=([ $SymbolForNotification "fire" ] . "Health warning: " . $Name); \
|
subject=([ $SymbolForNotification "fire" ] . "Health warning: " . $Name); \
|
||||||
message=("The " . $Name . " on " . $Identity . " is above threshold: " . \
|
message=("The " . $Name . " on " . $Identity . " is above threshold: " . \
|
||||||
$Value . "\C2\B0" . "C") });
|
$Value . "\C2\B0" . "C") });
|
||||||
|
|
@ -62,7 +63,7 @@
|
||||||
}
|
}
|
||||||
:if ($Value <= ($CheckHealthTemperature->$Name - $CheckHealthTemperatureDeviation) && \
|
:if ($Value <= ($CheckHealthTemperature->$Name - $CheckHealthTemperatureDeviation) && \
|
||||||
$CheckHealthTemperatureNotified->$Name = true) do={
|
$CheckHealthTemperatureNotified->$Name = true) do={
|
||||||
$SendNotification2 ({ origin=$FuncName; \
|
$SendNotification2 ({ origin=$ScriptName; \
|
||||||
subject=([ $SymbolForNotification "white-heavy-check-mark" ] . "Health recovery: " . $Name); \
|
subject=([ $SymbolForNotification "white-heavy-check-mark" ] . "Health recovery: " . $Name); \
|
||||||
message=("The " . $Name . " on " . $Identity . " dropped below threshold: " . \
|
message=("The " . $Name . " on " . $Identity . " dropped below threshold: " . \
|
||||||
$Value . "\C2\B0" . "C") });
|
$Value . "\C2\B0" . "C") });
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue