UPS Monitor
Document revision 1.0 (20-Jan-2003)
This document applies to the MikroTik RouterOS v2.6
The UPS monitor feature works with APC UPS units that support “smart” signaling.
This feature enables the network administrator to monitor the UPS and set the router
to ‘gracefully’ handle any power outage with no corruption or damage to the router.
The basic purpose of this feature is to ensure that the router will come back online
after an extended power failure. To do this, the router will monitor the UPS and set
itself to hibernate mode when the ‘utility’ power is down and the UPS battery is has
less than 10% of its battery power left. The router will then continue to monitor the UPS
(while in hibernate mode) and then restart itself after when the ‘utility’ power returns.
If the UPS battery is drained and the router loses all power, the router will power back
to full operation when the ‘utility’ power returns.
The UPS monitor feature on the MikroTik RouterOS supports:
- hibernate and safe reboot on power and battery failure
- UPS battery test and run time calibration test
- monitoring of all “smart” mode status information supported by UPS
- logging of power changes
Packages required : ups
License required : Any
Home menu level : /system ups
Protocols utilized : APC's smart protocol
Hardware usage: not significant
The APC UPS (BackUPS Pro or SmartUPS) requires a special serial cable.
If no cable came with the UPS, a cable may be ordered from APC or one can be made "in-house".
Use the following diagram:
Router Side (DB9f) |
Signal |
Direction |
UPS Side (DB9m) |
| 2 |
Receive |
IN |
2 |
| 3 |
Send |
OUT |
1 |
| 5 |
Ground |
|
4 |
| 7 |
CTS |
IN |
6 |
Submenu level : /system ups
[admin@MikroTik] system> ups
[admin@MikroTik] system ups> print
enabled: no
port: (unknown)
off-line-time: 5m
min-run-time: 5m
alarm-setting: immediate
rtc-alarm-setting: none
[admin@MikroTik] system ups>
enabled (yes | no, default: no) - status of the monitoring is disabled by default
port (name)- s communication port of the router
off-line-time (time, default: 5m) - how long to work on batteries. The router waits
that amount of time and then goes into hibernate mode until the UPS reports that the ‘utility’
power is back
0 - the router will go into hibernate mode according the min-run-time
setting and 10% of battery power event. In this case, the router will wait until the UPS reports
that the battery power is below 10%
min-run-time (time, default: 5m) - minimal run time remaining
After a ‘utility’ failure, the router will monitor the run-time-left value.
When the value reaches the min-run-time value, the router will go to hibernate mode
0 - the router will go to hibernate mode when the “battery low” signal is
sent indicating that the battery power is below 10%
alarm-setting (delayed | immediate | low-battery | none, default: immediate) -
UPS sound alarm setting:
delayed - alarm is delayed to the on-battery event
immediate - alarm immediately after the on-battery event
low-battery - alarm only when the battery is low
none - do not alarm
rtc-alarm-setting (delayed | immediate | low-battery | none, default: none) -
UPS sound alarm setting during run time calibration:
delayed - alarm is delayed to the on-battery event
immediate - alarm immediately after the on-battery event
low-battery - alarm only when the battery is low
none - do not alarm
When enabled, additional properties appear (that cannot be changed):
model (string) - less than 32 ASCII character string consisting of the UPS model name
(the words on the front of the UPS itself).
version (string) - UPS version, consists of three fields: SKU number, firmware revision,
country code. The county code may be one of the following:
I - 220/230/240 Vac
D - 115/120 Vac
A - 100 Vac
M - 208 Vac
J - 200 Vac
serial (string) - a string of at least 8 characters directly representing the UPS's
serial number as set at the factory. Newer SmartUPS models have 12-character serial numbers
manufacture-date (string) - the UPS's date of manufacture in the format "mm/dd/yy" (month, day, year)
nominal-battery-voltage (integer) - the UPS's nominal battery voltage rating
(this is not the UPS's actual battery voltage)
In order to enable UPS monitor, the serial port should be available:
[admin@MikroTik] port> print
# NAME USED-BY BAUD-RATE
0 serial0 Serial Console 9600
1 serial1 9600
[admin@MikroTik] port>
Port serial1 if free in this example.
To enable the UPS monitor for port serial1:
[admin@MikroTik] system ups> set port=serial1 enabled=yes
[admin@MikroTik] system ups> print
enabled: yes
port: serial1
off-line-time: 5m
min-run-time: 5m
alarm-setting: immediate
rtc-alarm-setting: immediate
model: "Back-UPS Pro 420"
version: "11.4.I"
serial-number: "NB9941252992"
manufacture-date: "10/08/99"
nominal-battery-voltage: 12
[admin@MikroTik] system ups>
Command name : /system ups run-time-calibration
The run-time-calibration command causes the UPS to start a run time calibration
until less than 25% of full battery capacity is reached. This command calibrates the
returned run time value.
The test begins only if battery capacity is 100%.
[MikroTik] system ups> run-time-calibration
Command name : /system ups monitor
on-line (yes | no) - whether power is being provided by the external utility (power company)
on-battery (yes | no ) - whether UPS battery is supplying power
transfer cause (only shown when the unit is on-battery) -
the reason for the most recent transfer to on-battery operation:
unacceptable utility voltage rate of change
detection of high utility voltage
detection of low utility voltage
detection of a line voltage notch or spike
transfer in response to battery-test or run-time-calibration
low-battery - Only shown when the UPS report this status
replace-battery - Only shown when the UPS report this status
overloaded-output - Only shown when the UPS report this status
smart-boost-mode - Only shown when the UPS report this status
smart-ssdd-mode - Only shown when the UPS report this status
run-time-calibration-running - Only shown when the UPS report this status
run-time-left - the UPS's estimated remaining run time in minutes.
You can query the UPS when it is operating in the on-line, bypass,
or on-battery modes of operation. The UPS's remaining run time reply
is based on available battery capacity and output load
battery-charge - the UPS's remaining battery capacity as a percent
of the fully charged condition
battery-voltage - the UPS's present battery voltage.
The typical accuracy of this measurement is ±5% of the maximum value (depending on the
UPS's nominal battery voltage)
line-voltage - the the in-line utility power voltage
output-voltage - the UPS's output voltage
load - the UPS's output load as a percentage of full rated load in Watts.
The typical accuracy of this measurement is ±3% of the maximum of 105%
frequency - When operating on-line, the UPS's internal operating frequency
is synchronized to the line within variations within 3 Hz of the nominal 50 or 60 Hz.
The typical accuracy of this measurement is ±1% of the full scale value of 63 Hz
When running on utility power:
[admin@MikroTik] system ups> monitor
on-line: yes
on-battery: no
run-time-left: 11m
battery-charge: 100
battery-voltage: 13
line-voltage: 221
output-voltage: 221
load: 57
fequency: 50
[admin@MikroTik] system ups>
When running on battery:
[admin@MikroTik] system ups> monitor
on-line: no
on-battery: yes
transfer-cause: "utility voltage notch or spike detected"
run-time-left: 9m
battery-charge: 95
battery-voltage: 11
line-voltage: 0
output-voltage: 233
load: 66
fequency: 50
[admin@MikroTik] system ups>
http://www.linuxdoc.org/HOWTO/UPS-HOWTO.html
http://www.sibbald.com/apcupsd/manual/upsbible.html
© Copyright 1999-2003, MikroTik