From owner-freebsd-questions Sun Dec 29 4: 6:59 2002 Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 1D9FE37B405 for ; Sun, 29 Dec 2002 04:06:53 -0800 (PST) Received: from mail.tiscali.it (mail-6.tiscali.it [195.130.225.152]) by mx1.FreeBSD.org (Postfix) with ESMTP id DFB0043F1C for ; Sun, 29 Dec 2002 04:06:51 -0800 (PST) (envelope-from fcasadei@inwind.it) Received: from goku.kasby (217.133.209.195) by mail.tiscali.it (6.5.032) id 3E00932900523281 for freebsd-questions@FreeBSD.ORG; Sun, 29 Dec 2002 13:06:29 +0100 Received: (qmail 676 invoked by uid 1000); 29 Dec 2002 11:59:13 -0000 Date: Sun, 29 Dec 2002 12:59:13 +0100 From: Francesco Casadei To: freebsd-questions@FreeBSD.ORG Subject: Re: UPS program for Freebsd Message-ID: <20021229115913.GA642@goku.kasby> Mail-Followup-To: freebsd-questions@FreeBSD.ORG References: <4.2.0.58.20021228183642.00a69ab0@pop.voyager.net> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="VbJkn9YxBvnuCH5J" Content-Disposition: inline In-Reply-To: <4.2.0.58.20021228183642.00a69ab0@pop.voyager.net> User-Agent: Mutt/1.4i X-Operating-System: FreeBSD 4.7-STABLE i386 Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG --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 [+][+] ... # 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