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 
>       which UPS program to use for freebsd, but for some reason I have lost it.  
> I currently have an APC 650 Pro UPS attached to Com1 on one of my machines 
> and I need to set it up so that it will monitor the machine and shut it 
> down only when there is less than 5 minutes of power left.  I also need it 
> to announce to all logged in users (remote via SSH or locally via the 
> console) the moment the UPS goes on battery and when its getting close to 
> shutdown time, etc.
> 
>       If anyone can send me this information, I would greatly appreciate 
> it.  Thank you.
> 
> 
> To Unsubscribe: send mail to [EMAIL PROTECTED]
> with "unsubscribe freebsd-questions" in the body of the message
> 
> end of the original message

I use nut - the Network UPS Tools - with an APC Back-UPS Pro 650 and it works
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 = "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, ONBATT,
LOWBATT and SHUTDOWN occurs.

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

        Francesco Casadei
-- 
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

Attachment: msg13561/pgp00000.pgp
Description: PGP signature

Reply via email to