mirror of
https://git.eworm.de/cgit/routeros-scripts
synced 2025-07-31 16:24:25 +02:00
ospf-to-leds: do not flood but log properly
This commit is contained in:
parent
fcc0d1551a
commit
92a97b12ca
1 changed files with 2 additions and 1 deletions
|
@ -18,11 +18,12 @@
|
||||||
:local LED ([ $ParseKeyValueStore ($InstanceVal->"comment") ]->"leds");
|
:local LED ([ $ParseKeyValueStore ($InstanceVal->"comment") ]->"leds");
|
||||||
:local LEDType [ / system leds get [ find where leds=$LED ] type ];
|
:local LEDType [ / system leds get [ find where leds=$LED ] type ];
|
||||||
|
|
||||||
$LogPrintExit2 debug $0 ("OSPF instance " . $InstanceVal->"name" . " is " . $InstanceVal->"state" . ".") false;
|
|
||||||
:if ($InstanceVal->"state" = "running" && $LEDType = "off") do={
|
:if ($InstanceVal->"state" = "running" && $LEDType = "off") do={
|
||||||
|
$LogPrintExit2 info $0 ("OSPF instance " . $InstanceVal->"name" . " is running, led on!") false;
|
||||||
/ system leds set type=on [ find where leds=$LED ];
|
/ system leds set type=on [ find where leds=$LED ];
|
||||||
}
|
}
|
||||||
:if ($InstanceVal->"state" = "down" && $LEDType = "on") do={
|
:if ($InstanceVal->"state" = "down" && $LEDType = "on") do={
|
||||||
|
$LogPrintExit2 info $0 ("OSPF instance " . $InstanceVal->"name" . " is down, led off!") false;
|
||||||
/ system leds set type=off [ find where leds=$LED ];
|
/ system leds set type=off [ find where leds=$LED ];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue