Simple Program UPS for Unix
upsdaemon is a simple program to monitor os (UPS)
series APC-Pro. When the power fail, the UpsDaemon it effects shutdown the
To use the upsdaemon you must posses the qualified serial, device
in kernel (sio).
The device is assumed to be /dev/cuad0 by default.
UpsDaemon: The program monitors the serial
port, keeys DTR (Data Terminal Ready) raised and
RTS (Request To Send) lowered. When the upsdaemon sees
the RNG high, runs the upsdaemon-alerts (powerfail
warning) and reports failure to syslog. If the power failure continued for 5
minutes (defined), the upsdaemon runs the upsdaemon-alerts (down), reports
to syslog and makes the UPS to sleep by RTS. The power
recovered within 5 minutes, the upsdaemon runs the upsdaemon-alerts
(recovery) and continues to monitor the serial port for another powerfilure.
In case the batter low is observed, the upsdaemon runs the upsdaemon-alerts
(emergency shutdown now) immediately, reports to syslog and makes the UPS to
The UpsDaemon is connected to the serial port1 and default value /dev/cuad0 is
- Power failure warning Shell: A shell-script to inform users the power goes
out and the system will be down soon. It generates log in:
- Shutdown Shell: A shell-script to shutdown the system cleanly. Its
generates log in:
- Emergency shutdown Shellt: A shell-script to execute emergency halt for
battery power failing. Its generates log in:
- Power recovery Shell: A shell-script to inform users the power has been
restored and system shutdown was canceled. Its generates log in:
$ upsdaemon /dev/cuad0
The upsdaemon port is specified to be the serial port2 /dev/cuad1
using command argument.
Webpage for UpsDaemon is at http://www.ederbs.org/projects/upsdaemon/
Ederson de Moura <email@example.com>
$ upsdaemon /dev/cuad1