Setting Up APC UPS Power Protection And Monitoring For Your Routerboard

REQUIREMENTS
In order to complete this tutorial successfully the following items are required. Please ensure to have these items available before taking implimentation action on this tutorial :
1) 1 x Mikrotik Routerboard with a USB or RS232 port.
2) 1 x USB or RS232 Cable.
3) 1 x APC UPS with a Powerchute USB port.
4) 1 x Laptop / Desktop Computer.
5) 1 x RJ45 Network Cable.
OVERVIEW
1)
2)
3)
4)
5)
1) Hibernate and safe reboot on power and battery failure
2) UPS battery test and run time calibration test
3) Monitoring of all “smart” mode status information supported by UPS
4) Logging of power changes
Step 1 : Configuring RouterOS APC UPS Protection
To sccessfully configure you RouterOS follow the steps as listed below :
1) Connect to your RouterBoard using your RJ45 network cables on ETHER2 and the ethernet port on your laptop / desktop
2) Connect a USB or RS232 cable from your RouterBoard to your APC UPS in this tutorial a USB cable was used.
3) Next go to SYSTEM > PACKAGES to check if the UPS package is installed. If you do not see it as show in the image on the left you have to download the EXTRAS package for your RouterBoard from www.mikrotik.com.





Step 2 : Configuring Power Monitoring
7) Here we are going to configure UPS power minitoring so that when a power fault occurs you will get an email notification informing you that UPS power is online or offline/ on battery. To do this follow these steps :
a) Connect and login to your Routerboard and go to SYSTEM > LOGGING and click on the ACTIONS tab…
b) Next click on the ADD button to add a new action (This will dictate what action should be taken by the log event).
c) Add any name you would like in the NAME input box, set the TYPE to email and add the email address you would like to send to the the EMAIL input box.
d) Click APPLY and OK.

8) Next add a new RULE that will execute the ACTION you created in the prevous step. Select the RULES tab and click the ADD button.
a) In the NEW LOG RULE WINDOW select the TOPICS dropdwn menu and select UPS.
b) leave the PREFIX drop down empty and on the ACTION dropdown select the action that you created in the privious step, press APPLY and OK.
c) If you following these steps correctly you can go forward to test your setup. Results may vary depending on UPS use however if you swift the UPS off and back one again you should see UPS logs in the Log section in Winbox, also check your email account to see if RouterOS is sending logs. The images below illustrate this..
