From c48509683c556aacde6b4fcbbdd53f2c77d38077 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Tue, 14 Feb 2023 20:09:41 +0100 Subject: check-health: wording: load -> utilization MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The load is defined as something different... https://en.wikipedia.org/wiki/Load_(computing) So let's update the wording and use 'utilization' instead. ---- ✂️ ---- 🧮️📈️ Health warning: CPU utilization The average CPU utilization on MikroTik is at 76%! ---- ✂️ ---- 🧮️📉️ Health recovery: CPU utilization The average CPU utilization on MikroTik decreased to 64%. ---- ✂️ ---- --- check-health | 22 ++++++++++----------- .../notification-01-cpu-load-high.avif | Bin 6066 -> 0 bytes .../notification-01-cpu-utilization-high.avif | Bin 0 -> 6453 bytes .../notification-02-cpu-load-ok.avif | Bin 6378 -> 0 bytes .../notification-02-cpu-utilization-ok.avif | Bin 0 -> 6717 bytes doc/check-health.md | 14 ++++++------- global-config.changes | 2 +- 7 files changed, 19 insertions(+), 19 deletions(-) delete mode 100644 doc/check-health.d/notification-01-cpu-load-high.avif create mode 100644 doc/check-health.d/notification-01-cpu-utilization-high.avif delete mode 100644 doc/check-health.d/notification-02-cpu-load-ok.avif create mode 100644 doc/check-health.d/notification-02-cpu-utilization-ok.avif diff --git a/check-health b/check-health index a9a9dbf..e208bac 100644 --- a/check-health +++ b/check-health @@ -10,8 +10,8 @@ :global GlobalFunctionsReady; :while ($GlobalFunctionsReady != true) do={ :delay 500ms; } -:global CheckHealthCPULoad; -:global CheckHealthCPULoadNotified; +:global CheckHealthCPUUtilization; +:global CheckHealthCPUUtilizationNotified; :global CheckHealthFreeRAMNotified; :global CheckHealthLast; :global CheckHealthTemperature; @@ -37,18 +37,18 @@ $ScriptLock $0; :local Resource [ /system/resource/get ]; -:set CheckHealthCPULoad (($CheckHealthCPULoad * 4 + ($Resource->"cpu-load") * 10) / 5); -:if ($CheckHealthCPULoad > 750 && $CheckHealthCPULoadNotified != true) do={ +:set CheckHealthCPUUtilization (($CheckHealthCPUUtilization * 4 + ($Resource->"cpu-load") * 10) / 5); +:if ($CheckHealthCPUUtilization > 750 && $CheckHealthCPUUtilizationNotified != true) do={ $SendNotification2 ({ origin=$0; \ - subject=([ $SymbolForNotification "abacus,chart-increasing" ] . "Health warning: CPU load"); \ - message=("The average CPU load on " . $Identity . " is at " . ($CheckHealthCPULoad / 10) . "%!") }); - :set CheckHealthCPULoadNotified true; + subject=([ $SymbolForNotification "abacus,chart-increasing" ] . "Health warning: CPU utilization"); \ + message=("The average CPU utilization on " . $Identity . " is at " . ($CheckHealthCPUUtilization / 10) . "%!") }); + :set CheckHealthCPUUtilizationNotified true; } -:if ($CheckHealthCPULoad < 650 && $CheckHealthCPULoadNotified = true) do={ +:if ($CheckHealthCPUUtilization < 650 && $CheckHealthCPUUtilizationNotified = true) do={ $SendNotification2 ({ origin=$0; \ - subject=([ $SymbolForNotification "abacus,chart-decreasing" ] . "Health recovery: CPU load"); \ - message=("The average CPU load on " . $Identity . " decreased to " . ($CheckHealthCPULoad / 10) . "%.") }); - :set CheckHealthCPULoadNotified false; + subject=([ $SymbolForNotification "abacus,chart-decreasing" ] . "Health recovery: CPU utilization"); \ + message=("The average CPU utilization on " . $Identity . " decreased to " . ($CheckHealthCPUUtilization / 10) . "%.") }); + :set CheckHealthCPUUtilizationNotified false; } :local CheckHealthFreeRAM ($Resource->"free-memory" * 100 / $Resource->"total-memory"); diff --git a/doc/check-health.d/notification-01-cpu-load-high.avif b/doc/check-health.d/notification-01-cpu-load-high.avif deleted file mode 100644 index 3c1a468..0000000 Binary files a/doc/check-health.d/notification-01-cpu-load-high.avif and /dev/null differ diff --git a/doc/check-health.d/notification-01-cpu-utilization-high.avif b/doc/check-health.d/notification-01-cpu-utilization-high.avif new file mode 100644 index 0000000..8aad878 Binary files /dev/null and b/doc/check-health.d/notification-01-cpu-utilization-high.avif differ diff --git a/doc/check-health.d/notification-02-cpu-load-ok.avif b/doc/check-health.d/notification-02-cpu-load-ok.avif deleted file mode 100644 index 4f12b70..0000000 Binary files a/doc/check-health.d/notification-02-cpu-load-ok.avif and /dev/null differ diff --git a/doc/check-health.d/notification-02-cpu-utilization-ok.avif b/doc/check-health.d/notification-02-cpu-utilization-ok.avif new file mode 100644 index 0000000..ee5d7d0 Binary files /dev/null and b/doc/check-health.d/notification-02-cpu-utilization-ok.avif differ diff --git a/doc/check-health.md b/doc/check-health.md index 850d61c..58c1fba 100644 --- a/doc/check-health.md +++ b/doc/check-health.md @@ -12,7 +12,7 @@ Description This script is run from scheduler periodically, sending notification on health related events: -* high CPU load +* high CPU utilization * low available free RAM * voltage jumps up or down more than configured threshold * voltage drops below hard lower limit @@ -21,18 +21,18 @@ health related events: Note that bad initial state will not trigger an event. -Monitoring CPU load and available free RAM works on all devices. Other -than that only sensors available in hardware can be checked. See what your -hardware supports: +Monitoring CPU utilization and available free RAM works on all devices. +Other than that only sensors available in hardware can be checked. See what +your hardware supports: /system/health/print; ### Sample notifications -#### CPU load +#### CPU utilization -![check-health notification cpu load high](check-health.d/notification-01-cpu-load-high.avif) -![check-health notification cpu load ok](check-health.d/notification-02-cpu-load-ok.avif) +![check-health notification cpu utilization high](check-health.d/notification-01-cpu-utilization-high.avif) +![check-health notification cpu utilization ok](check-health.d/notification-02-cpu-utilization-ok.avif) #### Available free RAM diff --git a/global-config.changes b/global-config.changes index ad8e7a9..3e0372a 100644 --- a/global-config.changes +++ b/global-config.changes @@ -96,7 +96,7 @@ 85="Dropped 'netwatch-syslog', filtering in firewall is advised."; 86="Added support for hooks in 'sms-forward'. This now provides similar functionality to 'sms-action', but is more flexible."; 87="Added support for extra text (or emojis \F0\9F\9A\80) in notification tags."; - 88="Added support for monitoring CPU load and available free RAM in 'check-health'."; + 88="Added support for monitoring CPU utilization and available free RAM in 'check-health'."; 89="Made the warning time for 'check-certificates' configurable."; 90="Chat with your router! Introduced 'telegram-chat' to chat via Telegram bot and send commands to your router."; 91="Dropped check for CAP in 'check-routeros-update' to solve issues with wifiwave2 package."; -- cgit v1.2.3-54-g00ecf