ups_monitor
ups_monitor delay {battery_level temperature_limit}
DESCRIPTIONups_monitor is used to determine the state of power supplied to the system when an Uninterruptable Power Supply (UPS) is attached to the system. The program polls the UPS attached to the system continuously via a serial interface. When a power failure occurs, the UPS switches to battery operation. ups_monitor monitors the battery condition during the power failure. When the battery reaches battery_level percent of its capacity, ups_monitor executes the script "$TSCANROOT/bin/power_mon". This script contains the following commands:
# $TSCANROOT/bin/power_mon Example # echo "Power Failure Shutdown" init 0Note that the actual shutdown of the UPS may be delayed by using the p command. Also, the UPS may not actually re-supply power to the computer until the following criteria are met:
The messages issued by ups_monitor are stored in the logging file $PASSDIR/schedlog. They are:
Begin UPS monitoring. Battery cutoff level = 20 % Now on Battery. Shutdown begins when battery reaches 20%. Low Battery. Battery level 20%. XX System is shutting down. Now on normal power. - Issued when mains power is restored.
No reply from UPS to shutdown UPS.The following entries in system.config must be defined in order to run ups_monitor:
The file $PASSDIR/ups_lock_dev_term_X (as defined in system.config as [system]ups.device) must be defined so that two copies of this function (or the function ups) can run. Any "/" in the device name will be replaced by "_" for the lock file name. It is a zero length file with read/write permissions.
Specifies the time delay (in seconds) before reading the current status from the UPS. The default is 3 seconds.battery_level
Specifies the percent of battery capacity that causes the ups_monitor to initiate the system shutdown. The delay parameter must precede this parameter. The default is 20 percent. Some systems may need a larger value than 20 percent battery capacity to safely shut down the system.temperature_limitThis is an optional parameter, entered as an integer.
Specifies the internal temperature alarm limit of the UPS. When this temperature is reached, an alarm message is issued. When the temperature drops below this limit, a message is issued is issued stating a return to normal. The delay and battery_level parameters must precede this parameter. The default temperature is 45 degrees C.This is an optional parameter, entered as an integer.
[1]%ups_monitor &Run the test forever, testing every 5 seconds.
[2]%ups_monitor 5 &Run the test forever, testing every 5 seconds, shutdown at 30% battery capacity.
[3]%ups_monitor 5 30 &Run the test forever, testing every 5 seconds, shutdown at 30% battery capacity, alarm at 35 degrees C.
[3]%ups_monitor 5 30 35&
Last Update: $Date: 1999/09/09 20:48:46 $