aboutsummaryrefslogtreecommitdiffstats
path: root/ospf-to-leds
diff options
context:
space:
mode:
authorGravatar Christian Hesse <mail@eworm.de>2021-07-06 21:41:02 +0200
committerGravatar Christian Hesse <mail@eworm.de>2021-07-06 21:41:33 +0200
commit92a97b12ca45c9653b02aa0edb9b167f895c490d (patch)
tree105ae3be42e1ed3cb599260be8bb752ce8f9451a /ospf-to-leds
parentfcc0d1551a0da553fc2a64cd67bd867a23b00659 (diff)
ospf-to-leds: do not flood but log properly
Diffstat (limited to 'ospf-to-leds')
-rw-r--r--ospf-to-leds3
1 files changed, 2 insertions, 1 deletions
diff --git a/ospf-to-leds b/ospf-to-leds
index 727f33b..40fbbb3 100644
--- a/ospf-to-leds
+++ b/ospf-to-leds
@@ -18,11 +18,12 @@
:local LED ([ $ParseKeyValueStore ($InstanceVal->"comment") ]->"leds");
: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={
+ $LogPrintExit2 info $0 ("OSPF instance " . $InstanceVal->"name" . " is running, led on!") false;
/ system leds set type=on [ find where leds=$LED ];
}
: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 ];
}
}