Web Power Switch control

Simple example of RouterOS controlling a DLI Web Power Switch (www.digital-loggers.com)
I have my RB3011 turning on and off a cooling fan for my rack at home.

:local DLIuser "username";
:local DLIpass "password";
:local DLIaddress "192.168.88.2";
:local DLIoutlet "8";
:local onTemp 32;
:local offTemp 30;
:local currentTemp [/system health get temperature];

:global fanStatus;

:if ($currentTemp >= $onTemp && $fanStatus != 1) do={
    /tool fetch url="http://$DLIuser:$DLIpass@$DLIaddress/outlet?$DLIoutlet=ON" mode=http keep-result=no
    :log error "Router temp is $currentTemp. Turning on cooling fan.";
    :global fanStatus 1;
}

:if ($currentTemp <= $offTemp && $fanStatus != 0) do={
    /tool fetch url="http://$DLIuser:$DLIpass@$DLIaddress/outlet?$DLIoutlet=OFF" mode=http keep-result=no
    :log warning "Router temp is $currentTemp. Turning off cooling fan.";
    :global fanStatus 0;
}

Tagging… That’s awesome. I’ll have to play around with this.


Sent from my iPad using Tapatalk

I use these “Web Power Switches”, both 10 and 18 port, at every one of my client offices. They save me hundreds of hours of driving every year. It has basic scripting built in, but the MicroTik adds so much more.