diff options
author | Christian Hesse <mail@eworm.de> | 2021-02-22 15:14:10 +0100 |
---|---|---|
committer | Christian Hesse <mail@eworm.de> | 2021-02-24 21:51:54 +0100 |
commit | f46db918453dcb8878b9a0de6e122fb0ea2224d9 (patch) | |
tree | 31544a450651d0705ecdea0c3d35e650ef784d67 /check-health | |
parent | b0e52aa2d1baa78fc9d025c0671fea8babba0ec2 (diff) |
global: give script or function name in log messages
Diffstat (limited to 'check-health')
-rw-r--r-- | check-health | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/check-health b/check-health index 8cb2cf3..761a72f 100644 --- a/check-health +++ b/check-health @@ -6,6 +6,7 @@ # check for RouterOS health state # https://git.eworm.de/cgit/routeros-scripts/about/doc/check-health.md +:local 0 "check-health"; :global GlobalFunctionsReady; :while ($GlobalFunctionsReady != true) do={ :delay 500ms; } @@ -16,7 +17,7 @@ :global CheckHealthVoltagePercent; :global Identity; -:global LogPrintExit; +:global LogPrintExit2; :global SendNotification; :global SymbolForNotification; @@ -28,7 +29,7 @@ :local CheckHealthCurrent [ / system health get ]; :if ([ :len $CheckHealthCurrent ] = 0) do={ - $LogPrintExit error ("Your device does not provide any health values.") true; + $LogPrintExit2 error $0 ("Your device does not provide any health values.") true; } :if ([ :typeof $CheckHealthTemperatureNotified ] != "array") do={ @@ -70,7 +71,7 @@ :if ($Name ~ "temperature" && \ [ :typeof $Temperature ] = "num") do={ :if ([ :typeof ($CheckHealthTemperature->$Name) ] != "num" ) do={ - $LogPrintExit info ("No threshold given for " . $Name . ", assuming 50C.") false; + $LogPrintExit2 info $0 ("No threshold given for " . $Name . ", assuming 50C.") false; :set ($CheckHealthTemperature->$Name) 50; } :local Validate [ / system health get $Name ]; |