UPS_CONTROL.PY

Description

Ups_control.py is a Python script witch monitors your ups, using upsd from NUT project. Ups_control.py is made during free time and is under GNU General Public License.

Ups_control2 is a rewrite of ups_control in C. Planed for December 2004.

Features

Ups_control.py can only monitors a generic ups for the moment. It scans your ups status every 15 sec and more when power is down, sends an e-mail with some information when state changes and executes the command you want to shut down the machine.

ToDo

Download

Changes

In 1.7.1 : just a

'make install'
is needed to install ups_control, logfile fixes

In 1.7 : bugfix ups name problems, better (smaller) log file, catch signals and the new --stop option : now you can make a script in your /etc/init.d or /etc/rc*.d to start, stop ups_control as a true daemon !

In 1.6 : Ups_control scans upsd every 15 secondes and every 5 seconds when power is down. The new -h option allows to scan a distant ups. Few bugfixes.

Example of init script for ups_control

If you want to start ups_control at boot, you should see this script : ups_control.

If you have installed chkconfig you can do :

>  download ups_control.py and ups_control, edit ups_control and change ups_control.py path and command
># cp ups_control /etc/init.d
># cd /etc/init.d ; chmod 700 ups_control
># chkconfig --add ups_control
># ./ups_control start

NOTA : since 1.7.1, just type 'make install' for installing ups_control !

Contact

Elrik