home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / unix / sys5 / r4 / 1178 < prev    next >
Encoding:
Text File  |  1993-01-08  |  5.6 KB  |  164 lines

  1. Newsgroups: comp.unix.sys5.r4
  2. Path: sparky!uunet!cs.utexas.edu!zaphod.mps.ohio-state.edu!pacific.mps.ohio-state.edu!linac!att!mcdchg!chinet!randy
  3. From: randy@chinet.chi.il.us (Randy Suess)
  4. Subject: Re: UPS Shutdown Software??
  5. Message-ID: <C0Jn04.1v@chinet.chi.il.us>
  6. Keywords: UPS 
  7. Organization: Chinet - Public Access UNIX
  8. References: <C0IMzA.I1I@world.std.com>
  9. Date: Fri, 8 Jan 1993 16:26:28 GMT
  10. Lines: 152
  11.  
  12. In article <C0IMzA.I1I@world.std.com> sandyb@world.std.com (Sandy Bendremer) writes:
  13. >I have a Topaz/Square D CUB Powermaker UPS, on a 486 based system running
  14. >SVR4.  
  15. >Is there any simple software kicking around that allows one to use an RS232
  16. >port to monitor the UPS like this.  It seems that some of the standard RS232
  17. >control lines could be used for this purpose.
  18. >
  19.  
  20.     (email bounced)
  21.  
  22.     Yes, here is the README from a usenet posted source that I am
  23.     using on my UPS..
  24.  
  25.  
  26.     upsd release 03/30/91 version 1.0 patchlevel 3            Pg. 1
  27.  
  28.  
  29.     INTRODUCTION
  30.  
  31.     The UPS monitor daemon or "upsd"  watches the serial port
  32.     connected to an UPS and will perform an unattended shutdown
  33.     of the system if the UPS is on battery longer than a specified
  34.     number of minutes.  Upsd needs to watch a tty with modem control
  35.     properties, and expects the UPS to raise DCD when it switches
  36.     to battery backup and drop DCD when it goes back to online.
  37.     Upsd was developed and tested under ISC with the FAS 2.08 driver
  38.     and an American Power Conversion SmartUPS 600, your milage may
  39.     vary on other OSes and UPSes.
  40.  
  41.     The C source was written for system V and hence will require 
  42.     some work to get it working under BSD or other UNIXes, the
  43.     program is built via the Makefile.  A number of configurable
  44.     defaults are in common.h, you may want to hack that file before
  45.     making upsd.  Although the program can be run manually from the
  46.     command line, users will most likely want the program to start
  47.     automatically from their /etc/rc script (SYS5R2) or a script
  48.     in /etc/rc2.d (SYS5R3).  The Makefile by default installs upsd
  49.     in the /etc directory when the install target is made.  
  50.  
  51.  
  52.     upsd release 03/30/91 version 1.0 patchlevel 3            Pg. 2
  53.  
  54.  
  55.     COMMAND LINE OPTIONS
  56.  
  57.     Upsd runtime behavior can be configured either on the command
  58.     line or via environment variables.  The command line options
  59.     take precedence to the environment variable settings, and are
  60.     as follows:
  61.  
  62.     usage: upsd [-d tty][-c cmd][-l file][-t min][-f file][-r file]
  63.         -d tty        pathname of UPS device
  64.         -c cmd        pathname of shutdown command
  65.         -l file        pathname of UPS log file
  66.         -f file        pathname of UPS fail message file
  67.         -r file        pathname of UPS restore message file
  68.         -t min        delay time in minutes
  69.  
  70.     The -d tty option must specify the full pathname (including the
  71.     /dev/ prefix) to the tty device the UPS is on.
  72.  
  73.     Example:
  74.  
  75.     upsd -d /dev/ttyFM00
  76.  
  77.     The -c cmd option specifies the full pathname of the command
  78.     to be executed to shut down the system.  This command must
  79.     be enclosed in quotes if it consists of 2 or more words.
  80.  
  81.     Example:
  82.  
  83.     upsd -c "/etc/shutdown -y -i0"
  84.  
  85.     The -l option specifies the logfile upsd will write it's event
  86.     messages to, these messages give the date and time that the UPS
  87.     daemon started, switched to battery, switched back to online,
  88.     executed the shutdown command, or was terminated via SIGTERM.
  89.  
  90.     Example:
  91.  
  92.     upsd -l /etc/upslog
  93.  
  94.     The -f option specifies the path name of the failure message file
  95.     to broadcast to all users in the event of a power failure.  The
  96.     failure message file is simply an ASCII text file which you can
  97.     create with an editor such as vi(1). If the file is not found by
  98.     upsd, no message will be broadcast upon power failure.
  99.  
  100.     Example:
  101.  
  102.     upsd -f /etc/upsfail
  103.  
  104.     The -r option specifies the path name of the restore message file
  105.     to broadcast to all users in the event of power restore.  The
  106.     restore message file is simply an ASCII text file which you can
  107.     create with an editor such as vi(1). If the file is not found by
  108.     upsd, no message will be broadcast upon power restore.
  109.  
  110.     Example:
  111.  
  112.     upsd -f /etc/upsrest
  113.  
  114.     Finally, the -t option specifies the number of minutes to allow
  115.     the UPS to be on battery backup before executing the shutdown
  116.     sequence.  This number must be between 1 and 30.  Be careful not
  117.     to choose a value greater than the number of minutes of battery
  118.     time your UPS supports with your current load.  A value in the
  119.     5 to 10 minute range is probably sufficient.
  120.  
  121.     Example:
  122.  
  123.     upsd -t 10
  124.     
  125.     upsd release 03/30/91 version 1.0 patchlevel 3            Pg. 3
  126.  
  127.  
  128.     ENVIRONMENT VARIABLES
  129.  
  130.     The following environment variables can be set if that interface
  131.     is preferred to the command line options.  Note again that command
  132.     line options override the environment variable settings.
  133.  
  134.  
  135.     Environment    Equivalent        Default
  136.     Variable    Command line option    Value
  137.     UPSPORT            -p        /dev/ttyFM00
  138.     UPSSHUT            -c        "/etc/shutdown -y -i0"
  139.     UPSLOG            -l        /etc/upslog
  140.     UPSFAIL            -f        /etc/upsfail
  141.     UPSREST            -r        /etc/upsrest
  142.     UPSTIME            -t        10
  143.  
  144.     Note that the compiled in default values can be altered in common.h
  145.     and the program can be recompiled.  If no command line options or
  146.     environment variables exist, the defaults will be used.  The table
  147.     above gives the environment variables looked for by the program and
  148.     their command line option counterparts.  All the rules applying to
  149.     the command line options apply to the environment variables as well.
  150.  
  151.     If you have any comments or suggestions regarding my program,
  152.     send email to the following address:
  153.  
  154.     Arthur W. Neilson III
  155.     INET: art@pilikia.pegasus.com
  156.     UUCP: uunet!ucsd!nosc!pilikia!art
  157.  
  158.  
  159. -- 
  160.     I am created Shiva the Destroyer; Death, the shatterer of worlds!
  161.     Who is this dog meat who stands before me now?
  162.     That's the biz, sweetheart.
  163. Randy Suess                     randy@chinet.chi.il.us
  164.