mirror of
https://github.com/eworm-de/routeros-scripts.git
synced 2024-05-11 05:55:19 +00:00
check-health: wording: load -> utilization
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%. ---- ✂️ ----
This commit is contained in:
22
check-health
22
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");
|
||||
|
Binary file not shown.
Before Width: | Height: | Size: 5.9 KiB |
BIN
doc/check-health.d/notification-01-cpu-utilization-high.avif
Normal file
BIN
doc/check-health.d/notification-01-cpu-utilization-high.avif
Normal file
Binary file not shown.
After Width: | Height: | Size: 6.3 KiB |
Binary file not shown.
Before Width: | Height: | Size: 6.2 KiB |
BIN
doc/check-health.d/notification-02-cpu-utilization-ok.avif
Normal file
BIN
doc/check-health.d/notification-02-cpu-utilization-ok.avif
Normal file
Binary file not shown.
After Width: | Height: | Size: 6.6 KiB |
@ -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
|
||||
|
||||
|
@ -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.";
|
||||
|
Reference in New Issue
Block a user