Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 29 Dec 2002 12:59:13 +0100
From:      Francesco Casadei <fcasadei@inwind.it>
To:        freebsd-questions@FreeBSD.ORG
Subject:   Re: UPS program for Freebsd
Message-ID:  <20021229115913.GA642@goku.kasby>
In-Reply-To: <4.2.0.58.20021228183642.00a69ab0@pop.voyager.net>
References:  <4.2.0.58.20021228183642.00a69ab0@pop.voyager.net>

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

--VbJkn9YxBvnuCH5J
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Sat, Dec 28, 2002 at 06:42:29PM -0500, Dragoncrest wrote:
> 	Hi all.  I used to have an email that came from this list detailing=20
> 	which UPS program to use for freebsd, but for some reason I have lost it=
. =20
> I currently have an APC 650 Pro UPS attached to Com1 on one of my machine=
s=20
> and I need to set it up so that it will monitor the machine and shut it=
=20
> down only when there is less than 5 minutes of power left.  I also need i=
t=20
> to announce to all logged in users (remote via SSH or locally via the=20
> console) the moment the UPS goes on battery and when its getting close to=
=20
> shutdown time, etc.
>=20
> 	If anyone can send me this information, I would greatly appreciate=20
> it.  Thank you.
>=20
>=20
> To Unsubscribe: send mail to majordomo@FreeBSD.org
> with "unsubscribe freebsd-questions" in the body of the message
>=20
> end of the original message

I use nut - the Network UPS Tools - with an APC Back-UPS Pro 650 and it wor=
ks
fine.  Here is a sample output from the included upsc program:

host: localhost
MODEL: Back-UPS Pro 650
SERIAL: NB0130252271
STATUS: OL
UTILITY: 230.4
BATTPCT: 100.0
ACFREQ: 50.00
LOADPCT: 032.5
BATTVOLT: 13.77
OUTVOLT: 230.4
UPSIDENT: UPS_IDEN
LOWXFER: 208
HIGHXFER: 253
WAKEDELAY: 000
LINESENS: H
GRACEDELAY: 020
RTHRESH: 00
ALRMDEL: 0
BATTDATE: 07/26/01
MFR: APC

You can define a message for each of the following events:

 ONLINE   : UPS is back online
 ONBATT   : UPS is on battery
 LOWBATT  : UPS is on battery and has a low battery (is critical)
 FSD      : UPS is being shutdown by the master (FSD =3D "Forced Shutdown")
 COMMOK   : Communications established with the UPS
 COMMBAD  : Communications lost to the UPS
 SHUTDOWN : The system is being shutdown
 REPLBATT : The UPS battery is bad and needs to be replaced
 NOCOMM   : A UPS is unavailable (can't be contacted for monitoring)

Then for each event you defined you can tell nut what to do. From one of the
configuration files:

# NOTIFYFLAG - change behavior of upsmon when NOTIFY events occur
#
# By default, upsmon sends walls (global messages to all logged in users)
# and writes to the syslog when things happen.  You can change this.
#
# NOTIFYFLAG <notify type> <flag>[+<flag>][+<flag>] ...
#
NOTIFYFLAG ONLINE SYSLOG+EXEC
NOTIFYFLAG ONBATT SYSLOG+EXEC
NOTIFYFLAG LOWBATT SYSLOG+EXEC
NOTIFYFLAG SHUTDOWN SYSLOG+EXEC
#
# Possible values for the flags:
#
# SYSLOG - Write the message in the syslog
# WALL   - Write the message to all users on the system
# EXEC   - Execute NOTIFYCMD (see above) with the message
# IGNORE - Don't do anything
#
# If you use IGNORE, don't use any other flags on the same line.

You can write your own program to execute custom actions, for example I have
a program that notifies me via SMS when one of the four events ONLINE, ONBA=
TT,
LOWBATT and SHUTDOWN occurs.

You can find nut in the ports collection located at sysutils/nut.

	Francesco Casadei
--=20
You can download my public key from http://digilander.libero.it/fcasadei/
or retrieve it from a keyserver (pgpkeys.mit.edu, wwwkeys.pgp.net, ...)

Key fingerprint is: 1671 9A23 ACB4 520A E7EE  00B0 7EC3 375F 164E B17B


--VbJkn9YxBvnuCH5J
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (FreeBSD)
Comment: For info see http://www.gnupg.org

iD8DBQE+DuOQfsM3XxZOsXsRAulCAJsHw1/4qMSstlEJrlhySWXUutXHSQCdGU4o
cqBYtHRBzcXKfzUd94vqyHo=
=GBhd
-----END PGP SIGNATURE-----

--VbJkn9YxBvnuCH5J--

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?20021229115913.GA642>