From owner-freebsd-questions Wed Mar 1 12:37:43 2000 Delivered-To: freebsd-questions@freebsd.org Received: from stargate.clickcom.com (stargate.clickcom.com [209.198.22.4]) by hub.freebsd.org (Postfix) with ESMTP id DC9C137BA53 for ; Wed, 1 Mar 2000 12:37:40 -0800 (PST) (envelope-from ne@clickcom.com) Received: from fishbowl (dhcp1.clickcom.com [209.198.22.31]) by stargate.clickcom.com with SMTP (Microsoft Exchange Internet Mail Service Version 5.5.2650.21) id GC578RTQ; Wed, 1 Mar 2000 15:37:36 -0500 Message-ID: <038201bf83bd$f7f41790$1f16c6d1@clickcom.com> From: "John Straiton" To: "Dan B. " Cc: References: Subject: Re: SmartUPS 1400 Date: Wed, 1 Mar 2000 15:37:31 -0500 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.00.2314.1300 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300 Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG > This is OK, but suppose you have a server hooked-up to a 1400VA UPS (which > will keep going for approx 1hr 30min after an outage) do you realy want to > shutdown in 60 secs? 20 min? why not shutdown when there is only enough > battery power left in the UPS for say 5minutes? We're bordering on "why don't you open the upsd.conf and look at how it works" here... Don't be scared to look at what's there and try to reverse engineer it. The upsd.conf just matches conditions. You should be able to rewrite it to check for %recharge% being below a certain number while "line-fail" was still a condition. Just combine the lines you see there. Try a combination and then see what happens. Without trying this or even really knowing how it works it would probably look like: on "line-fail" every 60 { log emerg "** Power down. Will halt when battery falls below 10% charge! **" on "recharge" < 10 { poll "shutdown" sleep 2 exec "/sbin/halt &" }} Theoretically, I'm looking at code that would check every 60 seconds after the AC has been lost for the battery being below a 10% charge, if so it would start the shutdown. Personally, I just happen to have a rather static load on that gear so I know the approximate number of minutes the gear will work whilst on battery. Lets assume that number is 30 minutes (pretty close to the exact tests we've run), then I'd set the 60 to a number like 1500 so that at 25 minutes, the shutdown begins. I'm just trying to help, perhaps someone with more knowledge of the actual code could do a better job here but it looks like few are answering you. John To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message