*BSD News Article 83685


Return to BSD News archive

Path: euryale.cc.adfa.oz.au!newshost.carno.net.au!harbinger.cc.monash.edu.au!nntp.coast.net!howland.erols.net!news.mathworks.com!uunet!in3.uu.net!Gamma.RU!srcc!demos!solace!mn6.swip.net!seunet!news2.swip.net!nike.volvo.se!cyklop.volvo.se!peter
From: peter@cyklop.volvo.se (peter hakanson)
Newsgroups: comp.unix.bsd.bsdi.misc
Subject: Re: APC Smart-ups
Date: 27 Nov 1996 08:37:06 GMT
Organization: Volvo Corp.
Lines: 44
Message-ID: <57guji$afj@nike.volvo.se>
References: <57fsb9$4dh@news3.digex.net>
NNTP-Posting-Host: cyklop.volvo.se
X-Newsreader: TIN [version 1.2 PL2]

In principle it's easy to create your own.

Suppose the UPS has a signal that could be made to +12V when
power is failing.

Connect this cable to pin 'CD' (carrier detect) on a spare serial
port. Put the serial port in -clocal mode , and launch a script
that tries to open it (echo "blaha" > /dev/ttyx)

When voltage rises carrier will be asserted and the opening
will succeed, the script will continue execution.

Guess what to put in the file ??  shutdown -h now or simular.

The mail trick is to make it more stable, like not trigging
on dips (maybe retest the opeing with a few seconds of delay),
and to deal with restart (when power is restored). Th emost
tricky is to deal with the case when power comes on and off (and
on and off).

If the UPS has more advanced features, like ascii messages coming
out of and into the cable, one may build a more sofisticated
daemon. Some UPS might even talk snmp!

And, you have to think twice when to start the stuff during boot!

I think there is a few implementations "out there". Any one cares
to contribute ?

peter h
Integrated Network Strategies (ins@access1.digex.net) wrote:
: I am installing a APC smart ups and need a deamon that will shut down the
: server when the power goes out.  APC does not carry such a product for
: BSDI.  Does anyone know of one?

: Thanks,

: Craig N. Hoover
: craig@inetstrat.com

--
--
NO JUNK EMAIL <peter@cyklop.volvo.se>
Peter Hakanson  VolvoData Dep 2580 phone +46 31 66 74 27