UPS Monitor Daemon for OS/2 or eComStation

Please read this entire document to understand
the function of UPS Daemon. This is a test version
and will expire the end of 2004.

This version of UPS Monitor is for contact closure
type interfaces and supports UPS like APC simple
signaling, Belkin, Tripplite, IBM, CyberPower etc.

NOTE: You must determine the proper command line
switches before running UPSDAEM.EXE. Improper
switches may start a system shutdown within 20
seconds. If that happens, terminate UPSDAEM.EXE
by pressing CTRL Q.

By default, the UPSDAEM.EXE selects positive AC Fail
and positive Low Battery polarity. This prevents
the UPSDAEM.EXE from activating shutdown when
started into an unconnected serial port.

UPSDAEM.EXE is a VIO program handling all interfacing
to the UPS. That program can be run minimized once the
command line switches have been determined.

UPSSTAT.CMD is a simple REXX script to displays the UPS
status and lets you know when AC fail or low battery
alarms are active.

UPS Monitor needs to know your UPS signal polarity. This is
a manual process and can't be done automatically because
of lack of standard of this interface. Connect your UPS
to a free serial port. Then simply run UPSDAEM.EXE -comx
where -comx is the serial port you have the UPS connected
to (i.e. UPSDAEM -COM2). If UPS Monitor displays
"Power failure detected" terminate it by pressing CTRL Q.
Add -ACfn to the UPSDAEM.EXE command line ( i.e. upsdaem -com2 -ACfn)
Run UPSDAEM.EXE again and no power failure should be detected.
If you get a "Low battery alarm" at this point, add -LBn to the
command line of UPSDAEM.EXE.

Once you get no power failure or low battery alarm, it is
time to test the UPS for real. Pull the plug on the UPS and
check if UPSDAEM.EXE reports a power failure. This will take up
to 5 seconds to detect. If a power failure is detected, plug the
UPS in again and you are done. If no power failure is detected, your
UPS may not be supported.

Test the simulated shutdown by unplugging the UPS for 20 seconds.
(Disconnect the computer from the UPS outlets to prevent potential
file corruption when the UPS turns off).
UPS Monitor will display "System Shutdown" and then terminate.
Inspect the UPSMON.LOG with a text editor for entries.

UPS Shutdown polarity selects the proper signal polarity to shutdown
the UPS to prevent further draining of the batteries. This feature
is not supported by many UPS and if supported, may pose more
problems than it prevents. This signal must be activated when
the OS is still running and if the UPS does not have a time delayed
turn off, the power is removed during the OS shutdown which is obviously
not good. If you know your UPS has a time delay after the UPS shutdown
signal is activated, then you can enable UPS OFF (-OFF options). If
you are unsure, don't provide this option. The UPS will eventually
turn off and your operating system will be properly shut down.

Email the log, the brand and model number of your UPS to
LPAInfo@att.net if you would like to contribute to testing.


Installation

Copy the files to any new folder on your system.
Run UPSDAEM.EXE and UPSSTAT.CMD from the open folder.
UPSDAEM.EXE is best placed into the start-up folder
once command line parameters have been determined.
An installation program will be added later on.




UPS Monitor Command Line Switches

UPSDAEM.EXE [-comx] [-ACfn] [-LBn] [-SDn] [-NoLog] [-OFF] [-Zxxx] [-ES] [-X] [-H]
or
UPSDAEM.EXE [/comx] [/ACfn] [/LBn] [/SDn] [/NoLog] [/OFF] [/Zxxx] [/ES] [/X]

-comx  x = 2-5 (COM2 through COM5; default if omitted is COM1)
-ACfn  AC Fail polarity is negative (omit for positive)
-LBn   Low Battery polarity is negative (omit for positive)
-SDn   UPS Shutdown polarity is negative (omit for positive)
-NoLog Turn UPS event log off (default = on)
-OFF   Turns UPS off after shutdown (default is no UPS turn off)
       Some UPS may immediately turn off after UPS Shutdown signal
       is activated. This will interfere with OS shutdown. Use this
       option to prevent UPS turn off.
-Zxxx  Timed shutdown after AC Fail detect. Starts count down for shutdown.
       If a low battery signal is detected, shut down will be activated within
       6 seconds provided the count down hasn't reached less than 10 seconds.
       If xxx is omitted or zero, then the shutdown delay is 20 seconds.
       If xxx is between 1 and 600 then the shutdown delay is the
       given value in seconds.
-ES    Use this option for APC Back-UPS ES models only.
-X     Don't shutdown operating system. To be used for testing only
       AND when computer power is NOT connected to UPS outlets.

-H     shows help (/H is not implemented).


Command line switches are case insensitive.
You may also use the forward slash / instead of the minus -

Pressing CTRL Q will quit UPS Monitor.


Timing Details:

UPSDAEM.EXE UPS status polling rate: every 5 seconds.
Timed shutdown (no -Zxxx option): 20 seconds after AC Fail has been detected.
AC Fail then Low Battery alarm to shutdown: 10 seconds.

UPSCONFIG polling rate of UPSDAEM status: every 4 seconds


UPS Monitor Log File:

UPSMON.LOG located where upsdaem.exe is running at. It's a plain
text file. This log is not checked for size and continues growing
until manually deleted.


UPSCONFIG.EXE

This GUI program lets you select various command line
options and then start UPSDAEM to test them. If
UPSDAEM is already running, UPSCONFIG will stop
and restart it with the new settings. UPSDAEM status
is displayed as well. The selected command line
parameters are displayed in the text box and can be
highlighted and copied to the clipboard.
(Use CTRL-INS to copy, SHIFT-INS to paste)

UPSCONFIG.EXE also comes with preconfigured and
tested settings for certain UPS models. Use File -
Open UPS Configuration to select from different models.
When UPSCONFIG is closed, the settings will automatically
be saved to the file default.dat and be reloaded the next
time UPSCONFIG is used.



APC UPS Settings:

Back-UPS (older models with 940-0020B cable): all polarities are positive.

Back-UPS ES models: Low battery positive, AC fail positive, 
                    UPS Shutdown negative, use -ES option.


Other UPS brand settings:

IBM/Tripplite: all polarities are negative.

Belkin: Low battery negative, AC fail negative, UPS shutdown positive.

Magnum BI-UPS: Low battery negative, AC fail negative,
               UPS shutdown positive.

CyberPower: Low battery negative, AC fail negative,
            UPS shutdown positive.

Redline Technologies: all polarities are negative.

PK Electronics: all polarities are negative.

AAP UPS2: Low battery negative, AC fail negative,
          UPS shutdown positive.

Beam Tech SI: Low battery negative, AC fail negative,
              UPS shutdown positive.


Contact

Email: LPAInfo@att.net
Website: http://home.att.net/~LPAInfo
