Hello everyone,
I’m a newbie to these forums, but I’ve been working with router os off and on for many years now, I’ve lost count how many, since 2.7.20
Anyways, of to the reason for my post. Recently on of our solar sites was struck by lightning and I’ve had to rebuild it basically from scratch. The site has redundant APs and sectors and by default we leave them powered on to load balance, shorten any fail over time and automate fail over. However, if the battery voltage starts to get low we currently manually log in and turn the redundant APs off. I’m looking to automate this process and I’ve created a script to do it. My problem is, I cannot get the script to work. I’m stumped, but then again it’s only 2am here.
The script is intended to turn ether3 of when the voltage reaches less than 10.6 and turn it back on once the voltages raises above 13.9. Please note these values are adjusted to compensate for the rb750up voltage inaccuracies.
:global "min-voltage" "106"
:global "cut-in-voltage" "139"
:global "current-voltage" [/system health get voltage]
:global "turn-off-int3" "ether3"
:if ($current-voltage < $min-voltage) do={
:log info "******* Voltage below threshold, turning $turn-off-int3 off *******"
/interface ether set $"turn-off-int3" poe-out=off
/tool e-mail send subject="Voltage low turned $"turn-off-int3" off" " body="Voltage low turned $"turn-off-int3" off" to="admin@blah.com" cc="cellphone@vtext.com" from="dude@blah.com"}
:if ($current-voltage > $cut-in-voltage) do={
:log info "******* Voltage above cut in threshold, turning $turn-off-int3 back on *******"
/interface ether set $"turn-off-int3" poe-out=forced-on
/tool e-mail send subject="Voltage above cut in threshold, turning $"turn-off-int3" back on" " body="Voltage above cut in threshold, turning $"turn-off-int3" back on" to="admin@blah.com" from="dude@blah.com"}
Any help on solving the failure point would be greatly appreciated.