mirror of
https://github.com/eworm-de/routeros-scripts.git
synced 2025-08-04 18:24:35 +02:00
check-health: support hard lower limit for voltage
... to detect slow decrease of voltage, for example with UPS.
This commit is contained in:
parent
d87c50cf68
commit
2625cc09a5
6 changed files with 19 additions and 4 deletions
12
check-health
12
check-health
|
@ -14,6 +14,7 @@
|
|||
:global CheckHealthTemperature;
|
||||
:global CheckHealthTemperatureDeviation;
|
||||
:global CheckHealthTemperatureNotified;
|
||||
:global CheckHealthVoltageLow;
|
||||
:global CheckHealthVoltagePercent;
|
||||
:global Identity;
|
||||
|
||||
|
@ -52,6 +53,17 @@ $ScriptLock $0;
|
|||
message=("The " . $Name . " on " . $Identity . " jumped more than " . $CheckHealthVoltagePercent . "%.\n\n" . \
|
||||
"old value: " . [ $FormatVoltage ($CheckHealthLast->$Name) ] . "\n" . \
|
||||
"new value: " . [ $FormatVoltage $Voltage ]) });
|
||||
} else={
|
||||
:if ($Voltage <= $CheckHealthVoltageLow && $CheckHealthLast->$Name > $CheckHealthVoltageLow) do={
|
||||
$SendNotification2 ({ origin=$0; \
|
||||
subject=([ $SymbolForNotification "high-voltage-sign,chart-decreasing" ] . "Health warning: Low " . $Name); \
|
||||
message=("The " . $Name . " on " . $Identity . " dropped to " . [ $FormatVoltage $Voltage ] . " below hard limit.") });
|
||||
}
|
||||
:if ($Voltage > $CheckHealthVoltageLow && $CheckHealthLast->$Name <= $CheckHealthVoltageLow) do={
|
||||
$SendNotification2 ({ origin=$0; \
|
||||
subject=([ $SymbolForNotification "high-voltage-sign,chart-increasing" ] . "Health recovery: Low " . $Name); \
|
||||
message=("The " . $Name . " on " . $Identity . " recovered to " . [ $FormatVoltage $Voltage ] . " above hard limit.") });
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue