aboutsummaryrefslogtreecommitdiffstats
path: root/check-health.rsc
diff options
context:
space:
mode:
authorGravatar Christian Hesse <mail@eworm.de>2023-11-15 15:02:39 +0100
committerGravatar Christian Hesse <mail@eworm.de>2023-11-15 15:03:16 +0100
commit23c5c461a6a3a6eb26df0e34b67bf537287c096a (patch)
tree55edc196690901536bd69713cf3e6e119c842272 /check-health.rsc
parent5f457e5c37ee58f592ca677766515725212a5fad (diff)
check-health: use $HumanReadableNum for RAM utilization
Diffstat (limited to 'check-health.rsc')
-rw-r--r--check-health.rsc7
1 files changed, 4 insertions, 3 deletions
diff --git a/check-health.rsc b/check-health.rsc
index 3ada4c8..e7977f7 100644
--- a/check-health.rsc
+++ b/check-health.rsc
@@ -22,6 +22,7 @@
:global Identity;
:global FormatLine;
+:global HumanReadableNum;
:global IfThenElse;
:global LogPrintExit2;
:global ScriptLock;
@@ -57,9 +58,9 @@ $ScriptLock $0;
$SendNotification2 ({ origin=$0; \
subject=([ $SymbolForNotification "card-file-box,chart-increasing" ] . "Health warning: RAM utilization"); \
message=("The RAM utilization on " . $Identity . " is at " . $CheckHealthRAMUtilization . "%!\n\n" . \
- [ $FormatLine "total" (($Resource->"total-memory" / 1024 / 1024) . " MiB") ] . "\n" . \
- [ $FormatLine "used" ((($Resource->"total-memory" - $Resource->"free-memory") / 1024 / 1024) . " MiB") ] . "\n" . \
- [ $FormatLine "free" (($Resource->"free-memory" / 1024 / 1024) . " MiB") ]) });
+ [ $FormatLine "total" ([ $HumanReadableNum ($Resource->"total-memory") 1024 ] . "iB") ] . "\n" . \
+ [ $FormatLine "used" ([ $HumanReadableNum ($Resource->"total-memory" - $Resource->"free-memory") 1024 ] . "iB") ] . "\n" . \
+ [ $FormatLine "free" ([ $HumanReadableNum ($Resource->"free-memory") 1024 ] . "iB") ]) });
:set CheckHealthRAMUtilizationNotified true;
}
:if ($CheckHealthRAMUtilization < 70 && $CheckHealthRAMUtilizationNotified = true) do={