Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 04 Aug 2000 08:20:09 +0200 (CEST)
From:      Micke Josefsson <mj@isy.liu.se>
To:        Joe.Warner@smed.com
Cc:        freebsd-questions@FreeBSD.ORG
Subject:   RE: UPS Question
Message-ID:  <XFMail.000804082009.mj@isy.liu.se>
In-Reply-To: <85256930.00565317.00@Deimos.smed.com>

next in thread | previous in thread | raw e-mail | index | archive | help

On 03-Aug-00 Joe.Warner@smed.com wrote:
> 
> 
> Last night, the inevitable happened...there was a brief power outage
> where
> I work and my FreeBSD (3.4) box went down.  As a preventative measure, I
> hooked the machine up to an APC Smart-UPS.  I went to APC's web site but
> couldn't find any software that would allow me to do a
> graceful/unattended
> shutdown of the system in the event of another power outage.  All the
> downloads they had were for Linux, AIX, HP/UX, Solaris, SCO UNIX, WIN 3.x
> -
> 2000, Novell and MacOS.  Would any of these (UNIX) work on my system and
> if
> not, does anybody know of any other software that would?
> 
> Thanks
> 
> Joe
> 
I just wrote this just a couple of minutes ago:

My APC Smart UPS runs fine with upsmon-2.1.3/ from the ports. 

upsmon.sh in /usr/local/etc/rc.d/ looks like this:

#!/bin/sh

# see /usr/local/share/doc/upsmon/INSTALL for command line option details

if [ -x /usr/local/sbin/upsmond ]; then
        /usr/local/sbin/upsmond -p /dev/cuaa1 -r 20 && echo -n ' upsmond'
fi

I have used cuaa1 (COM2 in dos-parlance) so as to have a mouse on cuaa0
(-p). I also have a small load so I let the system power me for 20 minutes
before shutting down completely (-r).

#ll /dev/cuaa*
crw-rw----  1 uucp  dialer   28, 128 27 Jun 14:00 /dev/cuaa0
crw-rw----  1 uucp  dialer   28, 129 27 Jun 13:10 /dev/cuaa1

and  /etc/ttys:

ttyd0   "/usr/libexec/getty std.9600"   dialup  off secure
ttyd1   "/usr/libexec/getty std.9600"   dialup  off secure

The program upsstat (in the same port) gives this:

        UPSMON Status Reporting Facility
        ---  upsmond version 2.1.3  ---

             APC UPS 700 Status Info
--------------------------------------------------------
                     Model: SMART-UPS 700
                 CopyRight: (C) APCC
          Manufacture date: 12/18/99
                  Serial #: NS9951331687
          Firmware version: 50.11.I
                  Local ID: UPS_IDEN
 Last battery replace date: 12/18/99
      Nominal line voltage: 230 V
   Nominal battery voltage: 24 V
                 Available: YES
                   Standby: NO
                Line Power: OK
                   Battery: OK
              Line Voltage: 230.10
                      Load:  20.20 %
           Battery Voltage:  27.33
             Battery Level: 100.00 %
--------------------------------------------------------


Installation was easy the problem was to get syslogd to log it. Finally
this cured it:

Insert into /etc/syslog.conf:

!UPS
*.*                                             /var/log/upsmon.log

The trick was to find the magic word UPS. I hade to read the sources to
find that one:(

And now the log says something when power is going down:



Jul 30 08:18:25 <daemon.crit> vanheden UPS: Input line power failure
Jul 30 08:18:57 <daemon.crit> vanheden UPS: Input line power failure
Jul 30 08:19:38 <daemon.crit> vanheden UPS: Input line power failure
Jul 30 08:19:38 <daemon.emerg> vanheden UPS: Power Failure - 1127 seconds
to shutdown!
Jul 30 08:20:19 <daemon.crit> vanheden UPS: Input line power failure

[snip snip]
Jul 30 08:38:04 <daemon.emerg> vanheden UPS: Power Failure - 21 seconds to
shutdown!
Jul 30 08:38:45 <daemon.crit> vanheden UPS: Input line power failure
Jul 30 08:38:45 <daemon.emerg> vanheden UPS: Power Failure - System
shutdown now!

[ A clean shutdown at this point ]

Jul 30 10:28:09 <daemon.info> vanheden UPS: upsmond daemon started -
version 2.1.3
Jul 30 10:28:09 <daemon.alert> vanheden UPS: Input line power back
Aug  1 13:10:32 <daemon.info> vanheden UPS: upsmond daemon started -
version 2.1.3
Aug  3 03:26:29 <daemon.crit> vanheden UPS: Input line power failure
Aug  3 03:26:30 <daemon.alert> vanheden UPS: Input line power back


Hope this helps a bit.
/Micke


----------------------------------
Michael Josefsson, MSEE
mj@isy.liu.se

This message was sent by XFMail
running on FreeBSD 3.5-STABLE
----------------------------------


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?XFMail.000804082009.mj>