diff options
author | Steve Price <steve@FreeBSD.org> | 1998-02-25 16:46:25 +0000 |
---|---|---|
committer | Steve Price <steve@FreeBSD.org> | 1998-02-25 16:46:25 +0000 |
commit | 415268cc40ebcd7e34c9937dba60a8f44e97b5c9 (patch) | |
tree | c876e71b8a25f9366bef480ee7047394172b456d | |
parent | 6cbfa7badcb884b20942f52e60bce73c90ba340e (diff) | |
download | ports-415268cc40ebcd7e34c9937dba60a8f44e97b5c9.tar.gz ports-415268cc40ebcd7e34c9937dba60a8f44e97b5c9.zip |
APC smart UPS monitoring daemon.
PR: 4662
Submitted by: Daniel Baker <dbaker@neosoft.com> and myself
Notes
Notes:
svn path=/head/; revision=9929
-rw-r--r-- | sysutils/upsd/Makefile | 30 | ||||
-rw-r--r-- | sysutils/upsd/distinfo | 1 | ||||
-rw-r--r-- | sysutils/upsd/files/patch-aa | 12 | ||||
-rw-r--r-- | sysutils/upsd/files/patch-ab | 11 | ||||
-rw-r--r-- | sysutils/upsd/files/upsd.conf | 100 | ||||
-rw-r--r-- | sysutils/upsd/pkg-comment | 1 | ||||
-rw-r--r-- | sysutils/upsd/pkg-descr | 3 | ||||
-rw-r--r-- | sysutils/upsd/pkg-plist | 2 |
8 files changed, 160 insertions, 0 deletions
diff --git a/sysutils/upsd/Makefile b/sysutils/upsd/Makefile new file mode 100644 index 000000000000..706ce89242a9 --- /dev/null +++ b/sysutils/upsd/Makefile @@ -0,0 +1,30 @@ +# New ports collection makefile for: upsd +# Version required: 2.0.1.6 +# Date created: 11 Jul 1996 +# Whom: alexis +# +# $Id$ +# + +DISTNAME= upsd-2.0.1.6 +PKGNAME= upsd-2.0 +CATEGORIES= sysutils +MASTER_SITES= ftp://www.ww.net/pub/wildwind/upsd/ \ + http://www.cre8tivegroup.com/ \ + ftp://ftp.sw.ru/pub/unix/upsd/ + +MAINTAINER= alexis@ww.net + +WRKSRC= ${WRKDIR}/upsd-2.0 + +pre-build: + @${MV} ${WRKSRC}/config.h ${WRKSRC}/config.h.orig + @sed -e "s!@prefix@!${PREFIX}!g" ${WRKSRC}/config.h.orig > ${WRKSRC}/config.h + +post-install: + if [ ! -f ${PREFIX}/etc/upsd.conf ] ; then \ + ${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m 644 \ + ${FILESDIR}/upsd.conf ${PREFIX}/etc/upsd.conf; \ + fi + +.include <bsd.port.mk> diff --git a/sysutils/upsd/distinfo b/sysutils/upsd/distinfo new file mode 100644 index 000000000000..298849ddffcf --- /dev/null +++ b/sysutils/upsd/distinfo @@ -0,0 +1 @@ +MD5 (upsd-2.0.1.6.tar.gz) = 98e46c6f86a87cb441931e1e4bf355c5 diff --git a/sysutils/upsd/files/patch-aa b/sysutils/upsd/files/patch-aa new file mode 100644 index 000000000000..cefc70eb501e --- /dev/null +++ b/sysutils/upsd/files/patch-aa @@ -0,0 +1,12 @@ +--- Makefile.orig Mon Feb 23 17:32:56 1998 ++++ Makefile Mon Feb 23 17:33:50 1998 +@@ -8,8 +8,7 @@ + + PROG= upsd + +-BINDIR= /usr/local/sbin +-MANDIR= /usr/local/share/man ++BINDIR= ${PREFIX}/sbin + NOMAN= noway + + #DEBUG= -g -DDEBUG diff --git a/sysutils/upsd/files/patch-ab b/sysutils/upsd/files/patch-ab new file mode 100644 index 000000000000..4a42c0055377 --- /dev/null +++ b/sysutils/upsd/files/patch-ab @@ -0,0 +1,11 @@ +--- config.h.orig Mon Feb 23 17:50:34 1998 ++++ config.h Mon Feb 23 17:50:49 1998 +@@ -8,7 +8,7 @@ + */ + + #ifndef DEBUG +-#define _PATH_UPSD_CONF "/etc/upsd.conf" ++#define _PATH_UPSD_CONF "@prefix@/upsd.conf" + #define _PATH_UPSD_PID "/var/run/upsd.pid" + #else + #define _PATH_UPSD_CONF "sample/upsd.conf" diff --git a/sysutils/upsd/files/upsd.conf b/sysutils/upsd/files/upsd.conf new file mode 100644 index 000000000000..ed2c55f54442 --- /dev/null +++ b/sysutils/upsd/files/upsd.conf @@ -0,0 +1,100 @@ +# $Id: upsd.conf,v 2.0 1996/01/28 11:50:37 alexis Exp $ +# +# UPS Daemon +# The Wild Wind Communications, 1995, 1996 +# +# See file LICENSE for the distribution terms of this software. +# + +ups "smart-ups" (230) proto "apc-smart" { + device "/dev/cuaa0" + speed 2400 + read-timeout 2 + write-block-size 1 + write-block-delay 50 + queue-size 64 +} + +every 5 { # check events every 5 seconds + nop +} + +on "initialize" != "SM" { + poll "initialize" + after 60 every 60 { + log emerg "Cannot put the UPS into smart mode!" + } +} + +every 600 { + tune "high-transfer-point" 264 + tune "low-transfer-point" 196 + tune "line-alarm" "0" + tune "line-sensitivity" "L" + tune "low-batteries-duration" 2 + tune "nominal-voltage" 220 + tune "shutdown-delay" 20 + tune "wakeup-batteries-capacity" 25 + tune "wakeup-delay" 0 +# tune "batteries-replaced" "01/01/77" +# tune "label" "WildWind" +} + +every 300 { # poll the UPS + poll "last-test" +# poll "light-test" + poll "line-frequency" + poll "line-maxvac" + poll "line-minvac" + poll "line-voltage" + poll "load" + poll "recharge" + poll "temperature" + poll "vdc" + poll "voltage" + + log notice "last test: %last-test%, light test: %light-test%" + log notice "frequency: %line-frequency%, maxvac: %line-maxvac%, minvac: %line-minvac%, voltage: %line-voltage%" + log notice "load: %load%, recharge: %recharge%, temp: %temperature%, vdc: %vdc%, output voltage: %voltage%" + + on "load" > 95 { + log alert "UPS load is too high: %load%" + } +} + +on "line-fail" { + log emerg "*** ALERT! Source power line failed, save your work! ***" +} + +on "line-fail" after 30 { + log emerg "*** ALERT! System shutdown in 30 seconds, LOGOUT NOW! ***" +} + +on "line-restore" { + log emerg "Source power line restored, you may continue your work." +} + +on "line-fail" after 60 { + log emerg "*** ALERT! THE SYSTEM IS SHUTTING DOWN! ***" + + poll "shutdown" + poll "shutdown" + poll "power-test" + poll "power-test" + poll "shutdown" + poll "shutdown" + + sleep 2 + + exec "/sbin/halt &" + + poll "power-test" + poll "shutdown" + poll "power-test" + poll "shutdown" + poll "power-test" + poll "shutdown" + poll "power-test" + + sleep 1000 # let us wait peacefully +} diff --git a/sysutils/upsd/pkg-comment b/sysutils/upsd/pkg-comment new file mode 100644 index 000000000000..441e71ef2cce --- /dev/null +++ b/sysutils/upsd/pkg-comment @@ -0,0 +1 @@ +APC Smart UPS Monitoring Daemon diff --git a/sysutils/upsd/pkg-descr b/sysutils/upsd/pkg-descr new file mode 100644 index 000000000000..bbbc0361575e --- /dev/null +++ b/sysutils/upsd/pkg-descr @@ -0,0 +1,3 @@ +upsd is a daemon with flexible configuration which lets you to +shutdown your system properly when source power line fails and +measure its frequency, voltage etc diff --git a/sysutils/upsd/pkg-plist b/sysutils/upsd/pkg-plist new file mode 100644 index 000000000000..61a9fdb79e47 --- /dev/null +++ b/sysutils/upsd/pkg-plist @@ -0,0 +1,2 @@ +etc/upsd.conf +sbin/upsd |