Imported Upstream version 2.6.4

This commit is contained in:
Arnaud Quette 2012-06-01 15:55:19 +02:00
parent fad6ced6f6
commit fefe62b2bd
257 changed files with 6020 additions and 1394 deletions

View file

@ -7,6 +7,7 @@ HP-UX/nut-upsd \
HP-UX/nut-upsd.sh \
HP-UX/nut-upsmon \
HP-UX/nut-upsmon.sh \
logrotate/nutlogd \
misc/nut.bash_completion \
misc/osd-notify \
perl/Nut.pm \
@ -19,6 +20,7 @@ RedHat/upsmon \
RedHat/upsmon.in \
Solaris8/S99upsmon \
subdriver/path-to-subdriver.sh \
ufw/README \
upower/95-upower-hid.rules \
Windows/halt.c \
Windows/Makefile

View file

@ -188,6 +188,7 @@ MKDIR_P = @MKDIR_P@
NETLIBS = @NETLIBS@
NM = @NM@
NMEDIT = @NMEDIT@
NUT_NETVERSION = @NUT_NETVERSION@
OBJDUMP = @OBJDUMP@
OBJEXT = @OBJEXT@
OS_NAME = @OS_NAME@
@ -201,6 +202,7 @@ PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
PIDPATH = @PIDPATH@
PKG_CONFIG = @PKG_CONFIG@
PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
@ -208,6 +210,7 @@ PORT = @PORT@
RANLIB = @RANLIB@
RUN_AS_GROUP = @RUN_AS_GROUP@
RUN_AS_USER = @RUN_AS_USER@
SBINDIR = @SBINDIR@
SED = @SED@
SERLIBS = @SERLIBS@
SET_MAKE = @SET_MAKE@
@ -290,6 +293,7 @@ HP-UX/nut-upsd \
HP-UX/nut-upsd.sh \
HP-UX/nut-upsmon \
HP-UX/nut-upsmon.sh \
logrotate/nutlogd \
misc/nut.bash_completion \
misc/osd-notify \
perl/Nut.pm \
@ -302,6 +306,7 @@ RedHat/upsmon \
RedHat/upsmon.in \
Solaris8/S99upsmon \
subdriver/path-to-subdriver.sh \
ufw/README \
upower/95-upower-hid.rules \
Windows/halt.c \
Windows/Makefile

View file

@ -5,7 +5,7 @@ EXTRA_DIST = gen-nutupsconf-aug.py nutupsconf.aug.tpl \
# only call the script to generate Augeas ups.conf lens upon "make dist",
# and if Python is present
dist-hook:
@if python -c pass; then \
@if python -c "import re,glob,codecs"; then \
echo "Regenerating Augeas ups.conf lens."; \
$(distdir)/gen-nutupsconf-aug.py $(distdir)/; \
else \

View file

@ -155,6 +155,7 @@ MKDIR_P = @MKDIR_P@
NETLIBS = @NETLIBS@
NM = @NM@
NMEDIT = @NMEDIT@
NUT_NETVERSION = @NUT_NETVERSION@
OBJDUMP = @OBJDUMP@
OBJEXT = @OBJEXT@
OS_NAME = @OS_NAME@
@ -168,6 +169,7 @@ PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
PIDPATH = @PIDPATH@
PKG_CONFIG = @PKG_CONFIG@
PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
@ -175,6 +177,7 @@ PORT = @PORT@
RANLIB = @RANLIB@
RUN_AS_GROUP = @RUN_AS_GROUP@
RUN_AS_USER = @RUN_AS_USER@
SBINDIR = @SBINDIR@
SED = @SED@
SERLIBS = @SERLIBS@
SET_MAKE = @SET_MAKE@
@ -459,7 +462,7 @@ uninstall-am:
# only call the script to generate Augeas ups.conf lens upon "make dist",
# and if Python is present
dist-hook:
@if python -c pass; then \
@if python -c "import re,glob,codecs"; then \
echo "Regenerating Augeas ups.conf lens."; \
$(distdir)/gen-nutupsconf-aug.py $(distdir)/; \
else \

View file

@ -58,6 +58,7 @@ let ups_fields = "driver"
| "awd"
| "batteryPercentage"
| "battext"
| "battvoltmult"
| "baud_rate"
| "baudrate"
| "bus"

View file

@ -173,6 +173,7 @@ MKDIR_P = @MKDIR_P@
NETLIBS = @NETLIBS@
NM = @NM@
NMEDIT = @NMEDIT@
NUT_NETVERSION = @NUT_NETVERSION@
OBJDUMP = @OBJDUMP@
OBJEXT = @OBJEXT@
OS_NAME = @OS_NAME@
@ -186,6 +187,7 @@ PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
PIDPATH = @PIDPATH@
PKG_CONFIG = @PKG_CONFIG@
PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
@ -193,6 +195,7 @@ PORT = @PORT@
RANLIB = @RANLIB@
RUN_AS_GROUP = @RUN_AS_GROUP@
RUN_AS_USER = @RUN_AS_USER@
SBINDIR = @SBINDIR@
SED = @SED@
SERLIBS = @SERLIBS@
SET_MAKE = @SET_MAKE@

View file

@ -14,6 +14,13 @@
<!-- Hewlett Packard -->
<match key="usb_device.vendor_id" int="0x03f0">
<!-- e.g. ? -->
<match key="usb_device.product_id" int="0x0001">
<append key="info.category" type="string">battery</append>
<merge key="info.capabilities" type="strlist">battery</merge>
<merge key="info.addons" type="strlist">hald-addon-usbhid-ups</merge>
<merge key="battery.type" type="string">ups</merge>
</match>
<!-- T500 -->
<match key="usb_device.product_id" int="0x1f01">
<append key="info.category" type="string">battery</append>
@ -56,7 +63,7 @@
<merge key="info.addons" type="strlist">hald-addon-usbhid-ups</merge>
<merge key="battery.type" type="string">ups</merge>
</match>
<!-- HP R1500 G2 INTL -->
<!-- HP R1500 G2 and G3 INTL -->
<match key="usb_device.product_id" int="0x1fe0">
<append key="info.category" type="string">battery</append>
<merge key="info.capabilities" type="strlist">battery</merge>
@ -70,6 +77,48 @@
<merge key="info.addons" type="strlist">hald-addon-usbhid-ups</merge>
<merge key="battery.type" type="string">ups</merge>
</match>
<!-- e.g. ? -->
<match key="usb_device.product_id" int="0x1fe2">
<append key="info.category" type="string">battery</append>
<merge key="info.capabilities" type="strlist">battery</merge>
<merge key="info.addons" type="strlist">hald-addon-usbhid-ups</merge>
<merge key="battery.type" type="string">ups</merge>
</match>
<!-- HP T1500 G3 -->
<match key="usb_device.product_id" int="0x1fe3">
<append key="info.category" type="string">battery</append>
<merge key="info.capabilities" type="strlist">battery</merge>
<merge key="info.addons" type="strlist">hald-addon-usbhid-ups</merge>
<merge key="battery.type" type="string">ups</merge>
</match>
<!-- R/T3000 -->
<match key="usb_device.product_id" int="0x1fe5">
<append key="info.category" type="string">battery</append>
<merge key="info.capabilities" type="strlist">battery</merge>
<merge key="info.addons" type="strlist">hald-addon-usbhid-ups</merge>
<merge key="battery.type" type="string">ups</merge>
</match>
<!-- R/T3000 -->
<match key="usb_device.product_id" int="0x1fe6">
<append key="info.category" type="string">battery</append>
<merge key="info.capabilities" type="strlist">battery</merge>
<merge key="info.addons" type="strlist">hald-addon-usbhid-ups</merge>
<merge key="battery.type" type="string">ups</merge>
</match>
<!-- various models -->
<match key="usb_device.product_id" int="0x1fe7">
<append key="info.category" type="string">battery</append>
<merge key="info.capabilities" type="strlist">battery</merge>
<merge key="info.addons" type="strlist">hald-addon-usbhid-ups</merge>
<merge key="battery.type" type="string">ups</merge>
</match>
<!-- various models -->
<match key="usb_device.product_id" int="0x1fe8">
<append key="info.category" type="string">battery</append>
<merge key="info.capabilities" type="strlist">battery</merge>
<merge key="info.addons" type="strlist">hald-addon-usbhid-ups</merge>
<merge key="battery.type" type="string">ups</merge>
</match>
</match>
<!-- Eaton -->
@ -222,13 +271,13 @@
</match>
</match>
<!-- Phoenixtec -->
<!-- Phoenixtec Power Co., Ltd -->
<match key="usb_device.vendor_id" int="0x06da">
<!-- various models -->
<!-- Online Yunto YQ450 -->
<match key="usb_device.product_id" int="0x0002">
<append key="info.category" type="string">battery</append>
<merge key="info.capabilities" type="strlist">battery</merge>
<merge key="info.addons" type="strlist">hald-addon-bcmxcp_usb</merge>
<merge key="info.addons" type="strlist">hald-addon-blazer_usb</merge>
<merge key="battery.type" type="string">ups</merge>
</match>
<!-- Mustek Powermust -->
@ -238,6 +287,27 @@
<merge key="info.addons" type="strlist">hald-addon-blazer_usb</merge>
<merge key="battery.type" type="string">ups</merge>
</match>
<!-- Phoenixtec Innova 3/1 T -->
<match key="usb_device.product_id" int="0x0004">
<append key="info.category" type="string">battery</append>
<merge key="info.capabilities" type="strlist">battery</merge>
<merge key="info.addons" type="strlist">hald-addon-blazer_usb</merge>
<merge key="battery.type" type="string">ups</merge>
</match>
<!-- Phoenixtec Innova RT -->
<match key="usb_device.product_id" int="0x0005">
<append key="info.category" type="string">battery</append>
<merge key="info.capabilities" type="strlist">battery</merge>
<merge key="info.addons" type="strlist">hald-addon-blazer_usb</merge>
<merge key="battery.type" type="string">ups</merge>
</match>
<!-- Phoenixtec Innova T -->
<match key="usb_device.product_id" int="0x0201">
<append key="info.category" type="string">battery</append>
<merge key="info.capabilities" type="strlist">battery</merge>
<merge key="info.addons" type="strlist">hald-addon-blazer_usb</merge>
<merge key="battery.type" type="string">ups</merge>
</match>
<!-- various models -->
<match key="usb_device.product_id" int="0xffff">
<append key="info.category" type="string">battery</append>
@ -274,7 +344,7 @@
<merge key="info.addons" type="strlist">hald-addon-usbhid-ups</merge>
<merge key="battery.type" type="string">ups</merge>
</match>
<!-- OR2200LCDRM2U -->
<!-- OR2200LCDRM2U, OR700LCDRM1U, PR6000LCDRTXL5U -->
<match key="usb_device.product_id" int="0x0601">
<append key="info.category" type="string">battery</append>
<merge key="info.capabilities" type="strlist">battery</merge>

View file

@ -178,6 +178,7 @@ MKDIR_P = @MKDIR_P@
NETLIBS = @NETLIBS@
NM = @NM@
NMEDIT = @NMEDIT@
NUT_NETVERSION = @NUT_NETVERSION@
OBJDUMP = @OBJDUMP@
OBJEXT = @OBJEXT@
OS_NAME = @OS_NAME@
@ -191,6 +192,7 @@ PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
PIDPATH = @PIDPATH@
PKG_CONFIG = @PKG_CONFIG@
PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
@ -198,6 +200,7 @@ PORT = @PORT@
RANLIB = @RANLIB@
RUN_AS_GROUP = @RUN_AS_GROUP@
RUN_AS_USER = @RUN_AS_USER@
SBINDIR = @SBINDIR@
SED = @SED@
SERLIBS = @SERLIBS@
SET_MAKE = @SET_MAKE@

View file

@ -8,6 +8,8 @@
libhidups 0x0003 0x0001 0x0000 0x0000 0x0000 0x00 0x00 0x00 0x00 0x00 0x00 0x00000000
# Hewlett Packard
# e.g. ?
libhidups 0x0003 0x03f0 0x0001 0x0000 0x0000 0x00 0x00 0x00 0x00 0x00 0x00 0x00000000
# T500
libhidups 0x0003 0x03f0 0x1f01 0x0000 0x0000 0x00 0x00 0x00 0x00 0x00 0x00 0x00000000
# T750
@ -20,10 +22,22 @@ libhidups 0x0003 0x03f0 0x1f08 0x0000 0x0000 0x00
libhidups 0x0003 0x03f0 0x1f09 0x0000 0x0000 0x00 0x00 0x00 0x00 0x00 0x00 0x00000000
# HP R/T 2200 INTL (like SMART2200RMXL2U)
libhidups 0x0003 0x03f0 0x1f0a 0x0000 0x0000 0x00 0x00 0x00 0x00 0x00 0x00 0x00000000
# HP R1500 G2 INTL
# HP R1500 G2 and G3 INTL
libhidups 0x0003 0x03f0 0x1fe0 0x0000 0x0000 0x00 0x00 0x00 0x00 0x00 0x00 0x00000000
# HP T750 G2
libhidups 0x0003 0x03f0 0x1fe1 0x0000 0x0000 0x00 0x00 0x00 0x00 0x00 0x00 0x00000000
# e.g. ?
libhidups 0x0003 0x03f0 0x1fe2 0x0000 0x0000 0x00 0x00 0x00 0x00 0x00 0x00 0x00000000
# HP T1500 G3
libhidups 0x0003 0x03f0 0x1fe3 0x0000 0x0000 0x00 0x00 0x00 0x00 0x00 0x00 0x00000000
# R/T3000
libhidups 0x0003 0x03f0 0x1fe5 0x0000 0x0000 0x00 0x00 0x00 0x00 0x00 0x00 0x00000000
# R/T3000
libhidups 0x0003 0x03f0 0x1fe6 0x0000 0x0000 0x00 0x00 0x00 0x00 0x00 0x00 0x00000000
# various models
libhidups 0x0003 0x03f0 0x1fe7 0x0000 0x0000 0x00 0x00 0x00 0x00 0x00 0x00 0x00000000
# various models
libhidups 0x0003 0x03f0 0x1fe8 0x0000 0x0000 0x00 0x00 0x00 0x00 0x00 0x00 0x00000000
# Eaton
# various models
@ -71,11 +85,17 @@ libhidups 0x0003 0x05b8 0x0000 0x0000 0x0000 0x00
# Belkin F6C1200-UNV
libhidups 0x0003 0x0665 0x5161 0x0000 0x0000 0x00 0x00 0x00 0x00 0x00 0x00 0x00000000
# Phoenixtec
# various models
# Phoenixtec Power Co., Ltd
# Online Yunto YQ450
libhidups 0x0003 0x06da 0x0002 0x0000 0x0000 0x00 0x00 0x00 0x00 0x00 0x00 0x00000000
# Mustek Powermust
libhidups 0x0003 0x06da 0x0003 0x0000 0x0000 0x00 0x00 0x00 0x00 0x00 0x00 0x00000000
# Phoenixtec Innova 3/1 T
libhidups 0x0003 0x06da 0x0004 0x0000 0x0000 0x00 0x00 0x00 0x00 0x00 0x00 0x00000000
# Phoenixtec Innova RT
libhidups 0x0003 0x06da 0x0005 0x0000 0x0000 0x00 0x00 0x00 0x00 0x00 0x00 0x00000000
# Phoenixtec Innova T
libhidups 0x0003 0x06da 0x0201 0x0000 0x0000 0x00 0x00 0x00 0x00 0x00 0x00 0x00000000
# various models
libhidups 0x0003 0x06da 0xffff 0x0000 0x0000 0x00 0x00 0x00 0x00 0x00 0x00 0x00000000
@ -88,7 +108,7 @@ libhidups 0x0003 0x075d 0x0300 0x0000 0x0000 0x00
libhidups 0x0003 0x0764 0x0005 0x0000 0x0000 0x00 0x00 0x00 0x00 0x00 0x00 0x00000000
# Dynex DX-800U?
libhidups 0x0003 0x0764 0x0501 0x0000 0x0000 0x00 0x00 0x00 0x00 0x00 0x00 0x00000000
# OR2200LCDRM2U
# OR2200LCDRM2U, OR700LCDRM1U, PR6000LCDRTXL5U
libhidups 0x0003 0x0764 0x0601 0x0000 0x0000 0x00 0x00 0x00 0x00 0x00 0x00 0x00000000
# Sweex 1000VA
libhidups 0x0003 0x0925 0x1234 0x0000 0x0000 0x00 0x00 0x00 0x00 0x00 0x00 0x00000000

View file

@ -150,6 +150,7 @@ MKDIR_P = @MKDIR_P@
NETLIBS = @NETLIBS@
NM = @NM@
NMEDIT = @NMEDIT@
NUT_NETVERSION = @NUT_NETVERSION@
OBJDUMP = @OBJDUMP@
OBJEXT = @OBJEXT@
OS_NAME = @OS_NAME@
@ -163,6 +164,7 @@ PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
PIDPATH = @PIDPATH@
PKG_CONFIG = @PKG_CONFIG@
PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
@ -170,6 +172,7 @@ PORT = @PORT@
RANLIB = @RANLIB@
RUN_AS_GROUP = @RUN_AS_GROUP@
RUN_AS_USER = @RUN_AS_USER@
SBINDIR = @SBINDIR@
SED = @SED@
SERLIBS = @SERLIBS@
SET_MAKE = @SET_MAKE@

View file

@ -116,5 +116,5 @@ public class Variable {
}
}
// TODO Add query for type and enum values
// TODO Add query for type, enum and range values
}

24
scripts/logrotate/nutlogd Normal file
View file

@ -0,0 +1,24 @@
# Log rotation configuration for NUT:
# Rotate NUT log file(s) either monthly or when exceeding 5 Mb
#
# For more information, refer to logrotate(8) manual page:
# http://linuxcommand.org/man_pages/logrotate8.html
#
# To install this file, use:
# $ cp nutlogd /etc/logrotate.d/
# $ chmod 644 /etc/logrotate.d/nutlogd
# $ chown root.root /etc/logrotate.d/nutlogd
#
# Log files must have "nut-" prefix and ".log" suffix
/var/log/nut-*.log {
missingok
notifempty
size=5M
rotate 12
monthly
postrotate
/usr/bin/killall -HUP upslog
endscript
}

View file

@ -150,6 +150,7 @@ MKDIR_P = @MKDIR_P@
NETLIBS = @NETLIBS@
NM = @NM@
NMEDIT = @NMEDIT@
NUT_NETVERSION = @NUT_NETVERSION@
OBJDUMP = @OBJDUMP@
OBJEXT = @OBJEXT@
OS_NAME = @OS_NAME@
@ -163,6 +164,7 @@ PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
PIDPATH = @PIDPATH@
PKG_CONFIG = @PKG_CONFIG@
PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
@ -170,6 +172,7 @@ PORT = @PORT@
RANLIB = @RANLIB@
RUN_AS_GROUP = @RUN_AS_GROUP@
RUN_AS_USER = @RUN_AS_USER@
SBINDIR = @SBINDIR@
SED = @SED@
SERLIBS = @SERLIBS@
SET_MAKE = @SET_MAKE@

View file

@ -28,6 +28,13 @@
# 2010-07-23 David Goncalves - Version 1.2
# Changed GetRWVars function that fails is the UPS is not
# providing such vars.
#
# 2011-07-05 René Martín Rodríguez <rmrodri@ull.es> - Version 1.2.1
# Added support for FSD, HELP and VER commands
#
# 2012-02-07 René Martín Rodríguez <rmrodri@ull.es> - Version 1.2.2
# Added support for LIST CLIENTS command
#
import telnetlib
@ -42,8 +49,8 @@ class PyNUTClient :
__timeout = None
__srv_handler = None
__version = "1.2"
__release = "2010-07-23"
__version = "1.2.2"
__release = "2012-02-07"
def __init__( self, host="127.0.0.1", port=3493, login=None, password=None, debug=False, timeout=5 ) :
@ -247,3 +254,78 @@ Returns OK on success or raises an error
return( "OK" )
else :
raise Exception, result.replace( "\n", "" )
def FSD( self, ups="") :
""" Send FSD command
Returns OK on success or raises an error
"""
if self.__debug :
print( "[DEBUG] MASTER called..." )
self.__srv_handler.write( "MASTER %s\n" % ups )
result = self.__srv_handler.read_until( "\n" )
if ( result != "OK MASTER-GRANTED\n" ) :
raise Exception, ( "Master level function are not available", "" )
if self.__debug :
print( "[DEBUG] FSD called..." )
self.__srv_handler.write( "FSD %s\n" % ups )
result = self.__srv_handler.read_until( "\n" )
if ( result == "OK FSD-SET\n" ) :
return( "OK" )
else :
raise Exception, result.replace( "\n", "" )
def help(self) :
""" Send HELP command
"""
if self.__debug :
print( "[DEBUG] HELP called..." )
self.__srv_handler.write( "HELP\n")
return self.__srv_handler.read_until( "\n" )
def ver(self) :
""" Send VER command
"""
if self.__debug :
print( "[DEBUG] VER called..." )
self.__srv_handler.write( "VER\n")
return self.__srv_handler.read_until( "\n" )
def ListClients( self, ups = None ) :
""" Returns the list of connected clients from the NUT server
The result is a dictionary containing 'key->val' pairs of 'UPSName' and a list of clients
"""
if self.__debug :
print( "[DEBUG] ListClients from server" )
if ups and (ups not in self.GetUPSList()):
raise Exception, "%s is not a valid UPS" % ups
if ups:
self.__srv_handler.write( "LIST CLIENTS %s\n" % ups)
else:
self.__srv_handler.write( "LIST CLIENTS\n" )
result = self.__srv_handler.read_until( "\n" )
if result != "BEGIN LIST CLIENTS\n" :
raise Exception, result.replace( "\n", "" )
result = self.__srv_handler.read_until( "END LIST CLIENTS\n" )
ups_list = {}
for line in result.split( "\n" ):
if line[:6] == "CLIENT" :
host, ups = line[7:].split(' ')
ups.replace(' ', '')
if not ups in ups_list:
ups_list[ups] = []
ups_list[ups].append(host)
return( ups_list )

View file

@ -1,11 +1,6 @@
EXTRA_DIST = README
if HAVE_SYSTEMD
%.service: %.service.in
sed -e 's,@sbindir\@,$(sbindir),g' $< > $@
nutshutdown: nutshutdown.in
sed -e 's,@sbindir\@,$(sbindir),g' $< > $@
systemdsystemunit_DATA = \
nut-driver.service \

View file

@ -40,7 +40,10 @@ target_triplet = @target@
@HAVE_SYSTEMD_FALSE@ nut-server.service.in nutshutdown.in
subdir = scripts/systemd
DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in
DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
$(srcdir)/nut-driver.service.in \
$(srcdir)/nut-monitor.service.in \
$(srcdir)/nut-server.service.in $(srcdir)/nutshutdown.in
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/ax_compare_version.m4 \
$(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \
@ -68,7 +71,8 @@ am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/include/config.h
CONFIG_CLEAN_FILES =
CONFIG_CLEAN_FILES = nut-driver.service nut-monitor.service \
nut-server.service nutshutdown
CONFIG_CLEAN_VPATH_FILES =
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
am__vpath_adj = case $$p in \
@ -178,6 +182,7 @@ MKDIR_P = @MKDIR_P@
NETLIBS = @NETLIBS@
NM = @NM@
NMEDIT = @NMEDIT@
NUT_NETVERSION = @NUT_NETVERSION@
OBJDUMP = @OBJDUMP@
OBJEXT = @OBJEXT@
OS_NAME = @OS_NAME@
@ -191,6 +196,7 @@ PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
PIDPATH = @PIDPATH@
PKG_CONFIG = @PKG_CONFIG@
PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
@ -198,6 +204,7 @@ PORT = @PORT@
RANLIB = @RANLIB@
RUN_AS_GROUP = @RUN_AS_GROUP@
RUN_AS_USER = @RUN_AS_USER@
SBINDIR = @SBINDIR@
SED = @SED@
SERLIBS = @SERLIBS@
SET_MAKE = @SET_MAKE@
@ -311,6 +318,14 @@ $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(am__aclocal_m4_deps):
nut-driver.service: $(top_builddir)/config.status $(srcdir)/nut-driver.service.in
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
nut-monitor.service: $(top_builddir)/config.status $(srcdir)/nut-monitor.service.in
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
nut-server.service: $(top_builddir)/config.status $(srcdir)/nut-server.service.in
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
nutshutdown: $(top_builddir)/config.status $(srcdir)/nutshutdown.in
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
install-systemdsystemshutdownSCRIPTS: $(systemdsystemshutdown_SCRIPTS)
@$(NORMAL_INSTALL)
test -z "$(systemdsystemshutdowndir)" || $(MKDIR_P) "$(DESTDIR)$(systemdsystemshutdowndir)"
@ -526,12 +541,6 @@ uninstall-am: uninstall-systemdsystemshutdownSCRIPTS \
uninstall-systemdsystemunitDATA
@HAVE_SYSTEMD_TRUE@%.service: %.service.in
@HAVE_SYSTEMD_TRUE@ sed -e 's,@sbindir\@,$(sbindir),g' $< > $@
@HAVE_SYSTEMD_TRUE@nutshutdown: nutshutdown.in
@HAVE_SYSTEMD_TRUE@ sed -e 's,@sbindir\@,$(sbindir),g' $< > $@
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:

View file

@ -4,7 +4,7 @@ After=local-fs.target network.target
StopWhenUnneeded=yes
[Service]
ExecStart=/sbin/upsdrvctl start
ExecStop=/sbin/upsdrvctl stop
ExecStart=@SBINDIR@/upsdrvctl start
ExecStop=@SBINDIR@/upsdrvctl stop
Type=forking

View file

@ -3,8 +3,8 @@ Description=Network UPS Tools - power device monitor and shutdown controller
After=local-fs.target network.target nut-server.service
[Service]
ExecStart=/usr/sbin/upsmon
PIDFile=/var/run/nut/upsmon.pid
ExecStart=@SBINDIR@/upsmon
PIDFile=@PIDPATH@/upsmon.pid
Type=forking
[Install]

View file

@ -5,7 +5,7 @@ Requires=nut-driver.service
Before=nut-monitor.service
[Service]
ExecStart=/usr/sbin/upsd
ExecStart=@SBINDIR@/upsd
Type=forking
[Install]

View file

@ -1,2 +1,2 @@
#!/bin/sh
upsmon -K >/dev/null 2>&1 && upsdrvctl shutdown
@SBINDIR@/upsmon -K >/dev/null 2>&1 && @SBINDIR@/upsdrvctl shutdown

View file

@ -175,6 +175,7 @@ MKDIR_P = @MKDIR_P@
NETLIBS = @NETLIBS@
NM = @NM@
NMEDIT = @NMEDIT@
NUT_NETVERSION = @NUT_NETVERSION@
OBJDUMP = @OBJDUMP@
OBJEXT = @OBJEXT@
OS_NAME = @OS_NAME@
@ -188,6 +189,7 @@ PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
PIDPATH = @PIDPATH@
PKG_CONFIG = @PKG_CONFIG@
PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
@ -195,6 +197,7 @@ PORT = @PORT@
RANLIB = @RANLIB@
RUN_AS_GROUP = @RUN_AS_GROUP@
RUN_AS_USER = @RUN_AS_USER@
SBINDIR = @SBINDIR@
SED = @SED@
SERLIBS = @SERLIBS@
SET_MAKE = @SET_MAKE@

View file

@ -10,6 +10,8 @@ LABEL="nut-usbups_rules_real"
ATTR{idVendor}=="0001", ATTR{idProduct}=="0000", MODE="664", GROUP="@RUN_AS_GROUP@"
# Hewlett Packard
# e.g. ? - usbhid-ups
ATTR{idVendor}=="03f0", ATTR{idProduct}=="0001", MODE="664", GROUP="@RUN_AS_GROUP@"
# T500 - bcmxcp_usb
ATTR{idVendor}=="03f0", ATTR{idProduct}=="1f01", MODE="664", GROUP="@RUN_AS_GROUP@"
# T750 - bcmxcp_usb
@ -22,10 +24,22 @@ ATTR{idVendor}=="03f0", ATTR{idProduct}=="1f08", MODE="664", GROUP="@RUN_AS_GROU
ATTR{idVendor}=="03f0", ATTR{idProduct}=="1f09", MODE="664", GROUP="@RUN_AS_GROUP@"
# HP R/T 2200 INTL (like SMART2200RMXL2U) - usbhid-ups
ATTR{idVendor}=="03f0", ATTR{idProduct}=="1f0a", MODE="664", GROUP="@RUN_AS_GROUP@"
# HP R1500 G2 INTL - usbhid-ups
# HP R1500 G2 and G3 INTL - usbhid-ups
ATTR{idVendor}=="03f0", ATTR{idProduct}=="1fe0", MODE="664", GROUP="@RUN_AS_GROUP@"
# HP T750 G2 - usbhid-ups
ATTR{idVendor}=="03f0", ATTR{idProduct}=="1fe1", MODE="664", GROUP="@RUN_AS_GROUP@"
# e.g. ? - usbhid-ups
ATTR{idVendor}=="03f0", ATTR{idProduct}=="1fe2", MODE="664", GROUP="@RUN_AS_GROUP@"
# HP T1500 G3 - usbhid-ups
ATTR{idVendor}=="03f0", ATTR{idProduct}=="1fe3", MODE="664", GROUP="@RUN_AS_GROUP@"
# R/T3000 - usbhid-ups
ATTR{idVendor}=="03f0", ATTR{idProduct}=="1fe5", MODE="664", GROUP="@RUN_AS_GROUP@"
# R/T3000 - usbhid-ups
ATTR{idVendor}=="03f0", ATTR{idProduct}=="1fe6", MODE="664", GROUP="@RUN_AS_GROUP@"
# various models - usbhid-ups
ATTR{idVendor}=="03f0", ATTR{idProduct}=="1fe7", MODE="664", GROUP="@RUN_AS_GROUP@"
# various models - usbhid-ups
ATTR{idVendor}=="03f0", ATTR{idProduct}=="1fe8", MODE="664", GROUP="@RUN_AS_GROUP@"
# Eaton
# various models - usbhid-ups
@ -73,11 +87,17 @@ ATTR{idVendor}=="05b8", ATTR{idProduct}=="0000", MODE="664", GROUP="@RUN_AS_GROU
# Belkin F6C1200-UNV - blazer_usb
ATTR{idVendor}=="0665", ATTR{idProduct}=="5161", MODE="664", GROUP="@RUN_AS_GROUP@"
# Phoenixtec
# various models - bcmxcp_usb
# Phoenixtec Power Co., Ltd
# Online Yunto YQ450 - blazer_usb
ATTR{idVendor}=="06da", ATTR{idProduct}=="0002", MODE="664", GROUP="@RUN_AS_GROUP@"
# Mustek Powermust - blazer_usb
ATTR{idVendor}=="06da", ATTR{idProduct}=="0003", MODE="664", GROUP="@RUN_AS_GROUP@"
# Phoenixtec Innova 3/1 T - blazer_usb
ATTR{idVendor}=="06da", ATTR{idProduct}=="0004", MODE="664", GROUP="@RUN_AS_GROUP@"
# Phoenixtec Innova RT - blazer_usb
ATTR{idVendor}=="06da", ATTR{idProduct}=="0005", MODE="664", GROUP="@RUN_AS_GROUP@"
# Phoenixtec Innova T - blazer_usb
ATTR{idVendor}=="06da", ATTR{idProduct}=="0201", MODE="664", GROUP="@RUN_AS_GROUP@"
# various models - usbhid-ups
ATTR{idVendor}=="06da", ATTR{idProduct}=="ffff", MODE="664", GROUP="@RUN_AS_GROUP@"
@ -90,7 +110,7 @@ ATTR{idVendor}=="075d", ATTR{idProduct}=="0300", MODE="664", GROUP="@RUN_AS_GROU
ATTR{idVendor}=="0764", ATTR{idProduct}=="0005", MODE="664", GROUP="@RUN_AS_GROUP@"
# Dynex DX-800U? - usbhid-ups
ATTR{idVendor}=="0764", ATTR{idProduct}=="0501", MODE="664", GROUP="@RUN_AS_GROUP@"
# OR2200LCDRM2U - usbhid-ups
# OR2200LCDRM2U, OR700LCDRM1U, PR6000LCDRTXL5U - usbhid-ups
ATTR{idVendor}=="0764", ATTR{idProduct}=="0601", MODE="664", GROUP="@RUN_AS_GROUP@"
# Sweex 1000VA - richcomm_usb
ATTR{idVendor}=="0925", ATTR{idProduct}=="1234", MODE="664", GROUP="@RUN_AS_GROUP@"

30
scripts/ufw/README Normal file
View file

@ -0,0 +1,30 @@
Uncomplicated Firewall (UFW) support
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
NUT can tightly integrate with
link:http://en.wikipedia.org/wiki/Uncomplicated_Firewall[Uncomplicated Firewall]
using the provided profile (nut.ufw.profile).
You must first install the profile on your system:
$ cp nut.ufw.profile /etc/ufw/applications.d/
To enable outside access to your local upsd, use:
$ ufw allow NUT
To restrict access to the network '192.168.X.Y', use:
$ ufw allow from 192.168.0.0/16 to any app NUT
You can also use graphical frontends, such as gui-ufw (gufw), ufw-kde
or ufw-frontends.
For more information, refer to:
- link:http://gufw.tuxfamily.org/[UFW homepage],
- link:https://launchpad.net/ufw[UFW project page],
- link:https://wiki.ubuntu.com/UncomplicatedFirewall[UFW wiki],
- UFW manual page, section APPLICATION INTEGRATION

View file

@ -0,0 +1,4 @@
[NUT]
title=NUT - Network UPS Tools server
description=NUT is a client - server system with support for UPS, PDU and PSU.
ports=@PORT@/tcp

View file

@ -18,7 +18,7 @@ ATTRS{idVendor}=="047c", ENV{UPOWER_VENDOR}="Dell"
ATTRS{idVendor}=="050d", ENV{UPOWER_VENDOR}="Belkin"
ATTRS{idVendor}=="051d", ENV{UPOWER_VENDOR}="APC"
ATTRS{idVendor}=="0592", ENV{UPOWER_VENDOR}="Powerware"
ATTRS{idVendor}=="06da", ENV{UPOWER_VENDOR}="Phoenixtec"
ATTRS{idVendor}=="06da", ENV{UPOWER_VENDOR}="Phoenixtec Power Co., Ltd"
ATTRS{idVendor}=="075d", ENV{UPOWER_VENDOR}="iDowell"
ATTRS{idVendor}=="0764", ENV{UPOWER_VENDOR}="Cyber Power Systems"
ATTRS{idVendor}=="09ae", ENV{UPOWER_VENDOR}="TrippLite"
@ -26,12 +26,19 @@ ATTRS{idVendor}=="0d9f", ENV{UPOWER_VENDOR}="PowerCOM"
ATTRS{idVendor}=="10af", ENV{UPOWER_VENDOR}="Liebert"
# Hewlett Packard
ATTRS{idVendor}=="03f0", ATTRS{idProduct}=="0001", ENV{UPOWER_BATTERY_TYPE}="ups"
ATTRS{idVendor}=="03f0", ATTRS{idProduct}=="1f06", ENV{UPOWER_BATTERY_TYPE}="ups"
ATTRS{idVendor}=="03f0", ATTRS{idProduct}=="1f08", ENV{UPOWER_BATTERY_TYPE}="ups"
ATTRS{idVendor}=="03f0", ATTRS{idProduct}=="1f09", ENV{UPOWER_BATTERY_TYPE}="ups"
ATTRS{idVendor}=="03f0", ATTRS{idProduct}=="1f0a", ENV{UPOWER_BATTERY_TYPE}="ups"
ATTRS{idVendor}=="03f0", ATTRS{idProduct}=="1fe0", ENV{UPOWER_BATTERY_TYPE}="ups"
ATTRS{idVendor}=="03f0", ATTRS{idProduct}=="1fe1", ENV{UPOWER_BATTERY_TYPE}="ups"
ATTRS{idVendor}=="03f0", ATTRS{idProduct}=="1fe2", ENV{UPOWER_BATTERY_TYPE}="ups"
ATTRS{idVendor}=="03f0", ATTRS{idProduct}=="1fe3", ENV{UPOWER_BATTERY_TYPE}="ups"
ATTRS{idVendor}=="03f0", ATTRS{idProduct}=="1fe5", ENV{UPOWER_BATTERY_TYPE}="ups"
ATTRS{idVendor}=="03f0", ATTRS{idProduct}=="1fe6", ENV{UPOWER_BATTERY_TYPE}="ups"
ATTRS{idVendor}=="03f0", ATTRS{idProduct}=="1fe7", ENV{UPOWER_BATTERY_TYPE}="ups"
ATTRS{idVendor}=="03f0", ATTRS{idProduct}=="1fe8", ENV{UPOWER_BATTERY_TYPE}="ups"
# Eaton
ATTRS{idVendor}=="0463", ATTRS{idProduct}=="0001", ENV{UPOWER_BATTERY_TYPE}="ups"
@ -58,7 +65,7 @@ ATTRS{idVendor}=="051d", ATTRS{idProduct}=="0003", ENV{UPOWER_BATTERY_TYPE}="ups
# Powerware
ATTRS{idVendor}=="0592", ATTRS{idProduct}=="0004", ENV{UPOWER_BATTERY_TYPE}="ups"
# Phoenixtec
# Phoenixtec Power Co., Ltd
ATTRS{idVendor}=="06da", ATTRS{idProduct}=="ffff", ENV{UPOWER_BATTERY_TYPE}="ups"
# iDowell