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 /ospf-to-leds | |
parent | b0e52aa2d1baa78fc9d025c0671fea8babba0ec2 (diff) |
global: give script or function name in log messages
Diffstat (limited to 'ospf-to-leds')
-rw-r--r-- | ospf-to-leds | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/ospf-to-leds b/ospf-to-leds index 32027db..727f33b 100644 --- a/ospf-to-leds +++ b/ospf-to-leds @@ -6,10 +6,11 @@ # visualize ospf instance state via leds # https://git.eworm.de/cgit/routeros-scripts/about/doc/ospf-to-leds.md +:local 0 "ospf-to-leds"; :global GlobalFunctionsReady; :while ($GlobalFunctionsReady != true) do={ :delay 500ms; } -:global LogPrintExit; +:global LogPrintExit2; :global ParseKeyValueStore; :foreach Instance in=[ / routing ospf instance find where comment~"^ospf-to-leds," ] do={ @@ -17,7 +18,7 @@ :local LED ([ $ParseKeyValueStore ($InstanceVal->"comment") ]->"leds"); :local LEDType [ / system leds get [ find where leds=$LED ] type ]; - $LogPrintExit debug ("OSPF instance " . $InstanceVal->"name" . " is " . $InstanceVal->"state" . ".") false; + $LogPrintExit2 debug $0 ("OSPF instance " . $InstanceVal->"name" . " is " . $InstanceVal->"state" . ".") false; :if ($InstanceVal->"state" = "running" && $LEDType = "off") do={ / system leds set type=on [ find where leds=$LED ]; } |