Imported Upstream version 2.4.3

This commit is contained in:
arnaud.quette@free.fr 2010-03-26 00:20:59 +01:00
commit 26fb71b504
446 changed files with 148951 additions and 0 deletions

51
scripts/HP-UX/Makefile Normal file
View file

@ -0,0 +1,51 @@
# directory definitions
INSTALLSH = ../../install-sh
CONFIGPATH = /etc/rc.config.d
SCRIPTPATH = /sbin/init.d
LINKPATH = /sbin/rc3.d
LINKPREFIX = 991
OWNER = root
GROUP = root
SCRIPTS = nut-upsd.sh nut-drvctl.sh nut-upsmon.sh
CONFIGS = nut-drvctl nut-upsd nut-upsmon
INSTALLPERMS = 0755
INSTALLCMD = $(INSTALLSH) -c
all: install
install:
@if (test ! -d $(CONFIGPATH)) then \
echo "NO $(CONFIGPATH)"; exit 1; \
fi
@if (test ! -d $(SCRIPTPATH)) then \
echo "NO $(SCRIPTPATH)"; exit 1; \
fi
@if (test ! -d $(LINKPATH)) then \
echo "NO $(LINKPATH)"; exit 1; \
fi
@for script in $(SCRIPTS); do\
name=`basename $$script .sh` ; \
$(INSTALLSH) -c -o $(OWNER) -g $(GROUP) $$script $(SCRIPTPATH)/$$name || exit 1; \
ln -s $(SCRIPTPATH)/$$name $(LINKPATH)/K$(LINKPREFIX)$$name \
|| echo "Unable to link $(SCRIPTPATH)/$$name to $(LINKPATH)/K$(LINKPREFIX)$$name"; \
ln -s $(SCRIPTPATH)/$$name $(LINKPATH)/S$(LINKPREFIX)$$name \
|| echo "Unable to link $(SCRIPTPATH)/$$name to $(LINKPATH)/S$(LINKPREFIX)$$name"; \
done
@for config in $(CONFIGS); do\
$(INSTALLSH) -c -o $(OWNER) -g $(GROUP) $$config $(CONFIGPATH) || exit 1 ; \
done
remove:
@for config in $(CONFIGS); do\
rm -f $(CONFIGPATH)/$$config;\
done
@for script in $(SCRIPTS); do\
name=`basename $$script .sh` ; \
rm -f $(SCRIPTPATH)/$$name || exit 1; \
rm -f $(LINKPATH)/K$(LINKPREFIX)$$name \
|| echo "Unable to remove $(LINKPATH)/K$(LINKPREFIX)$$name"; \
rm -f $(LINKPATH)/S$(LINKPREFIX)$$name \
|| echo "Unable to remove $(LINKPATH)/S$(LINKPREFIX)$$name"; \
done

8
scripts/HP-UX/nut-drvctl Normal file
View file

@ -0,0 +1,8 @@
# NUT_START: Set to 1 to start NUT
# NUT_ARGS: Command line arguments to pass to NUT
#
# To configure the NUT environment:
NUT_START=1
UPSNAME= # Blank == all configured UPSs
RUNAS= # Blank == run as root

114
scripts/HP-UX/nut-drvctl.sh Executable file
View file

@ -0,0 +1,114 @@
#!/sbin/sh
#
# nut-drvctl: NUT ups model-specific drivers start-up and shutdown script
#
# Allowed exit values:
# 0 = success; causes "OK" to show up in checklist.
# 1 = failure; causes "FAIL" to show up in checklist.
# 2 = skip; causes "N/A" to show up in the checklist.
# Use this value if execution of this script is overridden
# by the use of a control variable, or if this script is not
# appropriate to execute for some other reason.
# 3 = reboot; causes the system to be rebooted after execution.
# Input and output:
# stdin is redirected from /dev/null
#
# stdout and stderr are redirected to the /etc/rc.log file
# during checklist mode, or to the console in raw mode.
umask 022
PATH=/usr/sbin:/usr/bin:/sbin
export PATH
WHAT='NUT UPS driver (Network UPS Tools -- http://www.exploits.org/nut)'
WHAT_PATH=/opt/nut/bin/upsdrvctl
WHAT_CONFIG=/etc/rc.config.d/nut-drvctl
# NOTE: If your script executes in run state 0 or state 1, then /usr might
# not be available. Do not attempt to access commands or files in
# /usr unless your script executes in run state 2 or greater. Other
# file systems typically not mounted until run state 2 include /var
# and /opt.
rval=0
# Check the exit value of a command run by this script. If non-zero, the
# exit code is echoed to the log file and the return value of this script
# is set to indicate failure.
set_return() {
x=$?
if [ $x -ne 0 ]; then
echo "EXIT CODE: $x"
rval=1 # script FAILed
fi
}
case $1 in
'start_msg')
echo "Starting $WHAT"
;;
'stop_msg')
echo "Stopping $WHAT"
;;
'start')
if [ -f $WHAT_CONFIG ] ; then
. $WHAT_CONFIG
else
echo "ERROR: $WHAT_CONFIG defaults file MISSING"
fi
if [ "X$RUNAS" = "X" ] ; then
# no user set
if [ "$NUT_START" -eq 1 -a -x $WHAT_PATH ]; then
$WHAT_PATH start $UPSNAME && echo $WHAT started $UPSNAME
set_return
else
rval=2
fi
else
# start upsd as a specified user
if [ "$NUT_START" -eq 1 -a -x $WHAT_PATH ]; then
su $RUNAS -c $WHAT_PATH start $UPSNAME && echo $WHAT started $UPSNAME as user $RUNAS
set_return
else
rval=2
fi
fi
;;
'stop')
if [ "X$RUNAS" = "X" ] ; then
$WHAT_PATH stop $UPSNAME
if [ $? -eq 0 ]; then
echo "$WHAT stopped $UPSNAME"
else
rval=1
echo "Unable to stop $WHAT $UPSNAME"
fi
else
su $RUNAS -c $WHAT_PATH stop $UPSNAME
if [ $? -eq 0 ]; then
echo "$WHAT stopped $UPSNAME by user $RUNAS"
else
rval=1
echo "User $RUNAS unable to stop $WHAT $UPSNAME"
fi
fi
;;
*)
echo "usage: $0 {start|stop|start_msg|stop_msg}"
rval=1
;;
esac
exit $rval

8
scripts/HP-UX/nut-upsd Normal file
View file

@ -0,0 +1,8 @@
# NUT_START: Set to 1 to start NUT
# NUT_ARGS: Command line arguments to pass to NUT
#
# To configure the NUT environment:
NUT_START=1
UPSNAME= # Blank == all configured UPSs
RUNAS= # Blank == run as root

113
scripts/HP-UX/nut-upsd.sh Executable file
View file

@ -0,0 +1,113 @@
#!/sbin/sh
#
# nut-upsd: NUT upsd start-up and shutdown script
#
# Allowed exit values:
# 0 = success; causes "OK" to show up in checklist.
# 1 = failure; causes "FAIL" to show up in checklist.
# 2 = skip; causes "N/A" to show up in the checklist.
# Use this value if execution of this script is overridden
# by the use of a control variable, or if this script is not
# appropriate to execute for some other reason.
# 3 = reboot; causes the system to be rebooted after execution.
# Input and output:
# stdin is redirected from /dev/null
#
# stdout and stderr are redirected to the /etc/rc.log file
# during checklist mode, or to the console in raw mode.
umask 022
PATH=/usr/sbin:/usr/bin:/sbin
export PATH
WHAT='NUT UPS daemon (Network UPS Tools -- http://www.exploits.org/nut)'
WHAT_PATH=/opt/nut/sbin/upsd
WHAT_CONFIG=/etc/rc.config.d/nut-upsd
# NOTE: If your script executes in run state 0 or state 1, then /usr might
# not be available. Do not attempt to access commands or files in
# /usr unless your script executes in run state 2 or greater. Other
# file systems typically not mounted until run state 2 include /var
# and /opt.
rval=0
# Check the exit value of a command run by this script. If non-zero, the
# exit code is echoed to the log file and the return value of this script
# is set to indicate failure.
set_return() {
x=$?
if [ $x -ne 0 ]; then
echo "EXIT CODE: $x"
rval=1 # script FAILed
fi
}
case $1 in
'start_msg')
echo "Starting $WHAT"
;;
'stop_msg')
echo "Stopping $WHAT"
;;
'start')
if [ -f $WHAT_CONFIG ] ; then
. $WHAT_CONFIG
else
echo "ERROR: $WHAT_CONFIG defaults file MISSING"
fi
if [ "X$RUNAS" = "X" ] ; then
# no user set
if [ "$NUT_START" -eq 1 -a -x $WHAT_PATH ]; then
$WHAT_PATH && echo $WHAT started
set_return
else
rval=2
fi
else
# start upsd as a specified user
if [ "$NUT_START" -eq 1 -a -x $WHAT_PATH ]; then
su $RUNAS -c $WHAT_PATH && echo $WHAT started as user $RUNAS
set_return
else
rval=2
fi
fi
;;
'stop')
if [ "X$RUNAS" = "X" ] ; then
$WHAT_PATH -c stop
if [ $? -eq 0 ]; then
echo "$WHAT stopped"
else
rval=1
echo "Unable to stop $WHAT"
fi
else
su $RUNAS -c "$WHAT_PATH -c stop"
if [ $? -eq 0 ]; then
echo "$WHAT stopped by user $RUNAS"
else
rval=1
echo "User $RUNAS unable to stop $WHAT"
fi
fi
;;
*)
echo "usage: $0 {start|stop|start_msg|stop_msg}"
rval=1
;;
esac
exit $rval

7
scripts/HP-UX/nut-upsmon Normal file
View file

@ -0,0 +1,7 @@
# NUT_START: Set to 1 to start NUT
# NUT_ARGS: Command line arguments to pass to NUT
#
# To configure the NUT environment:
NUT_START=1
UPSMON_ARGS=

92
scripts/HP-UX/nut-upsmon.sh Executable file
View file

@ -0,0 +1,92 @@
#!/sbin/sh
#
# nut-upsmon: NUT ups monitor start-up and shutdown script
#
# Allowed exit values:
# 0 = success; causes "OK" to show up in checklist.
# 1 = failure; causes "FAIL" to show up in checklist.
# 2 = skip; causes "N/A" to show up in the checklist.
# Use this value if execution of this script is overridden
# by the use of a control variable, or if this script is not
# appropriate to execute for some other reason.
# 3 = reboot; causes the system to be rebooted after execution.
# Input and output:
# stdin is redirected from /dev/null
#
# stdout and stderr are redirected to the /etc/rc.log file
# during checklist mode, or to the console in raw mode.
umask 022
PATH=/usr/sbin:/usr/bin:/sbin
export PATH
WHAT='NUT UPS monitor (Network UPS Tools -- http://www.exploits.org/nut)'
WHAT_PATH=/opt/nut/sbin/upsmon
WHAT_CONFIG=/etc/rc.config.d/nut-upsmon
# NOTE: If your script executes in run state 0 or state 1, then /usr might
# not be available. Do not attempt to access commands or files in
# /usr unless your script executes in run state 2 or greater. Other
# file systems typically not mounted until run state 2 include /var
# and /opt.
rval=0
# Check the exit value of a command run by this script. If non-zero, the
# exit code is echoed to the log file and the return value of this script
# is set to indicate failure.
set_return() {
x=$?
if [ $x -ne 0 ]; then
echo "EXIT CODE: $x"
rval=1 # script FAILed
fi
}
case $1 in
'start_msg')
echo "Starting $WHAT"
;;
'stop_msg')
echo "Stopping $WHAT"
;;
'start')
if [ -f $WHAT_CONFIG ] ; then
. $WHAT_CONFIG
else
echo "ERROR: $WHAT_CONFIG defaults file MISSING"
fi
if [ "$NUT_START" -eq 1 -a -x $WHAT_PATH ]; then
$WHAT_PATH $UPSMON_ARGS && echo $WHAT $UPSMON_ARGS started
set_return
else
rval=2
fi
;;
'stop')
$WHAT_PATH -c stop
if [ $? -eq 0 ]; then
echo "$WHAT stopped"
else
rval=1
echo "Unable to stop $WHAT"
fi
;;
*)
echo "usage: $0 {start|stop|start_msg|stop_msg}"
rval=1
;;
esac
exit $rval

23
scripts/Makefile.am Normal file
View file

@ -0,0 +1,23 @@
EXTRA_DIST = README \
HP-UX/Makefile \
HP-UX/nut-drvctl \
HP-UX/nut-drvctl.sh \
HP-UX/nut-upsd \
HP-UX/nut-upsd.sh \
HP-UX/nut-upsmon \
HP-UX/nut-upsmon.sh \
misc/nut.bash_completion \
misc/osd-notify \
RedHat/halt.patch \
RedHat/README \
RedHat/ups \
RedHat/upsd \
RedHat/upsd.in \
RedHat/upsmon \
RedHat/upsmon.in \
Solaris8/S99upsmon \
subdriver/path-to-subdriver.sh \
Windows/halt.c \
Windows/Makefile
SUBDIRS = hal hotplug python udev

634
scripts/Makefile.in Normal file
View file

@ -0,0 +1,634 @@
# Makefile.in generated by automake 1.11 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation,
# Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
@SET_MAKE@
VPATH = @srcdir@
pkgdatadir = $(datadir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkglibexecdir = $(libexecdir)/@PACKAGE@
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_HEADER = $(INSTALL_DATA)
transform = $(program_transform_name)
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
target_triplet = @target@
subdir = scripts
DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/ax_create_stdint_h.m4 \
$(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \
$(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \
$(top_srcdir)/m4/lt~obsolete.m4 \
$(top_srcdir)/m4/nut_arg_with.m4 \
$(top_srcdir)/m4/nut_check_ipv6.m4 \
$(top_srcdir)/m4/nut_check_libgd.m4 \
$(top_srcdir)/m4/nut_check_libhal.m4 \
$(top_srcdir)/m4/nut_check_libneon.m4 \
$(top_srcdir)/m4/nut_check_libnetsnmp.m4 \
$(top_srcdir)/m4/nut_check_libpowerman.m4 \
$(top_srcdir)/m4/nut_check_libssl.m4 \
$(top_srcdir)/m4/nut_check_libusb.m4 \
$(top_srcdir)/m4/nut_check_libwrap.m4 \
$(top_srcdir)/m4/nut_check_os.m4 \
$(top_srcdir)/m4/nut_report_feature.m4 \
$(top_srcdir)/m4/nut_type_socklen_t.m4 \
$(top_srcdir)/configure.in
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_VPATH_FILES =
SOURCES =
DIST_SOURCES =
RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
html-recursive info-recursive install-data-recursive \
install-dvi-recursive install-exec-recursive \
install-html-recursive install-info-recursive \
install-pdf-recursive install-ps-recursive install-recursive \
installcheck-recursive installdirs-recursive pdf-recursive \
ps-recursive uninstall-recursive
RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \
distclean-recursive maintainer-clean-recursive
AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \
$(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \
distdir
ETAGS = etags
CTAGS = ctags
DIST_SUBDIRS = $(SUBDIRS)
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
am__relativize = \
dir0=`pwd`; \
sed_first='s,^\([^/]*\)/.*$$,\1,'; \
sed_rest='s,^[^/]*/*,,'; \
sed_last='s,^.*/\([^/]*\)$$,\1,'; \
sed_butlast='s,/*[^/]*$$,,'; \
while test -n "$$dir1"; do \
first=`echo "$$dir1" | sed -e "$$sed_first"`; \
if test "$$first" != "."; then \
if test "$$first" = ".."; then \
dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \
dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \
else \
first2=`echo "$$dir2" | sed -e "$$sed_first"`; \
if test "$$first2" = "$$first"; then \
dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \
else \
dir2="../$$dir2"; \
fi; \
dir0="$$dir0"/"$$first"; \
fi; \
fi; \
dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
done; \
reldir="$$dir2"
ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
AR = @AR@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
BINDIR = @BINDIR@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CONFPATH = @CONFPATH@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CYGPATH_W = @CYGPATH_W@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
DRIVER_BUILD_LIST = @DRIVER_BUILD_LIST@
DRIVER_INSTALL_TARGET = @DRIVER_INSTALL_TARGET@
DRIVER_MAN_LIST = @DRIVER_MAN_LIST@
DSYMUTIL = @DSYMUTIL@
DUMPBIN = @DUMPBIN@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
FGREP = @FGREP@
GREP = @GREP@
HAL_CALLOUTS_PATH = @HAL_CALLOUTS_PATH@
HAL_DEVICE_MATCH_KEY = @HAL_DEVICE_MATCH_KEY@
HAL_FDI_PATH = @HAL_FDI_PATH@
HAL_USER = @HAL_USER@
HAVE_GLIB_2_14 = @HAVE_GLIB_2_14@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
LD = @LD@
LDFLAGS = @LDFLAGS@
LIBGD_CFLAGS = @LIBGD_CFLAGS@
LIBGD_LDFLAGS = @LIBGD_LDFLAGS@
LIBHAL_CFLAGS = @LIBHAL_CFLAGS@
LIBHAL_LDFLAGS = @LIBHAL_LDFLAGS@
LIBNEON_CFLAGS = @LIBNEON_CFLAGS@
LIBNEON_LDFLAGS = @LIBNEON_LDFLAGS@
LIBNETSNMP_CFLAGS = @LIBNETSNMP_CFLAGS@
LIBNETSNMP_LDFLAGS = @LIBNETSNMP_LDFLAGS@
LIBOBJS = @LIBOBJS@
LIBPOWERMAN_CFLAGS = @LIBPOWERMAN_CFLAGS@
LIBPOWERMAN_LDFLAGS = @LIBPOWERMAN_LDFLAGS@
LIBS = @LIBS@
LIBSSL_CFLAGS = @LIBSSL_CFLAGS@
LIBSSL_LDFLAGS = @LIBSSL_LDFLAGS@
LIBTOOL = @LIBTOOL@
LIBUSB_CFLAGS = @LIBUSB_CFLAGS@
LIBUSB_LDFLAGS = @LIBUSB_LDFLAGS@
LIBWRAP_CFLAGS = @LIBWRAP_CFLAGS@
LIBWRAP_LDFLAGS = @LIBWRAP_LDFLAGS@
LIPO = @LIPO@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
MKDIR_P = @MKDIR_P@
NETLIBS = @NETLIBS@
NM = @NM@
NMEDIT = @NMEDIT@
OBJDUMP = @OBJDUMP@
OBJEXT = @OBJEXT@
OS_NAME = @OS_NAME@
OTOOL = @OTOOL@
OTOOL64 = @OTOOL64@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
RANLIB = @RANLIB@
RUN_AS_GROUP = @RUN_AS_GROUP@
RUN_AS_USER = @RUN_AS_USER@
SED = @SED@
SERLIBS = @SERLIBS@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STATEPATH = @STATEPATH@
STRIP = @STRIP@
SUN_LIBUSB = @SUN_LIBUSB@
VERSION = @VERSION@
WORDS_BIGENDIAN = @WORDS_BIGENDIAN@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
abs_top_srcdir = @abs_top_srcdir@
ac_ct_CC = @ac_ct_CC@
ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
am__tar = @am__tar@
am__untar = @am__untar@
bindir = @bindir@
build = @build@
build_alias = @build_alias@
build_cpu = @build_cpu@
build_os = @build_os@
build_vendor = @build_vendor@
builddir = @builddir@
cgiexecdir = @cgiexecdir@
datadir = @datadir@
datarootdir = @datarootdir@
docdir = @docdir@
driverexecdir = @driverexecdir@
dvidir = @dvidir@
exec_prefix = @exec_prefix@
host = @host@
host_alias = @host_alias@
host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
hotplugdir = @hotplugdir@
htmldir = @htmldir@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
localedir = @localedir@
localstatedir = @localstatedir@
lt_ECHO = @lt_ECHO@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
pdfdir = @pdfdir@
pkgconfigdir = @pkgconfigdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
sysconfdir = @sysconfdir@
target = @target@
target_alias = @target_alias@
target_cpu = @target_cpu@
target_os = @target_os@
target_vendor = @target_vendor@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
udevdir = @udevdir@
EXTRA_DIST = README \
HP-UX/Makefile \
HP-UX/nut-drvctl \
HP-UX/nut-drvctl.sh \
HP-UX/nut-upsd \
HP-UX/nut-upsd.sh \
HP-UX/nut-upsmon \
HP-UX/nut-upsmon.sh \
misc/nut.bash_completion \
misc/osd-notify \
RedHat/halt.patch \
RedHat/README \
RedHat/ups \
RedHat/upsd \
RedHat/upsd.in \
RedHat/upsmon \
RedHat/upsmon.in \
Solaris8/S99upsmon \
subdriver/path-to-subdriver.sh \
Windows/halt.c \
Windows/Makefile
SUBDIRS = hal hotplug python udev
all: all-recursive
.SUFFIXES:
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
&& { if test -f $@; then exit 0; else break; fi; }; \
exit 1;; \
esac; \
done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu scripts/Makefile'; \
$(am__cd) $(top_srcdir) && \
$(AUTOMAKE) --gnu scripts/Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
*) \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(am__aclocal_m4_deps):
mostlyclean-libtool:
-rm -f *.lo
clean-libtool:
-rm -rf .libs _libs
# This directory's subdirectories are mostly independent; you can cd
# into them and run `make' without going through this Makefile.
# To change the values of `make' variables: instead of editing Makefiles,
# (1) if the variable is set in `config.status', edit `config.status'
# (which will cause the Makefiles to be regenerated when you run `make');
# (2) otherwise, pass the desired values on the `make' command line.
$(RECURSIVE_TARGETS):
@failcom='exit 1'; \
for f in x $$MAKEFLAGS; do \
case $$f in \
*=* | --[!k]*);; \
*k*) failcom='fail=yes';; \
esac; \
done; \
dot_seen=no; \
target=`echo $@ | sed s/-recursive//`; \
list='$(SUBDIRS)'; for subdir in $$list; do \
echo "Making $$target in $$subdir"; \
if test "$$subdir" = "."; then \
dot_seen=yes; \
local_target="$$target-am"; \
else \
local_target="$$target"; \
fi; \
($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|| eval $$failcom; \
done; \
if test "$$dot_seen" = "no"; then \
$(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
fi; test -z "$$fail"
$(RECURSIVE_CLEAN_TARGETS):
@failcom='exit 1'; \
for f in x $$MAKEFLAGS; do \
case $$f in \
*=* | --[!k]*);; \
*k*) failcom='fail=yes';; \
esac; \
done; \
dot_seen=no; \
case "$@" in \
distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
*) list='$(SUBDIRS)' ;; \
esac; \
rev=''; for subdir in $$list; do \
if test "$$subdir" = "."; then :; else \
rev="$$subdir $$rev"; \
fi; \
done; \
rev="$$rev ."; \
target=`echo $@ | sed s/-recursive//`; \
for subdir in $$rev; do \
echo "Making $$target in $$subdir"; \
if test "$$subdir" = "."; then \
local_target="$$target-am"; \
else \
local_target="$$target"; \
fi; \
($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|| eval $$failcom; \
done && test -z "$$fail"
tags-recursive:
list='$(SUBDIRS)'; for subdir in $$list; do \
test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
done
ctags-recursive:
list='$(SUBDIRS)'; for subdir in $$list; do \
test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
done
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
mkid -fID $$unique
tags: TAGS
TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
set x; \
here=`pwd`; \
if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
include_option=--etags-include; \
empty_fix=.; \
else \
include_option=--include; \
empty_fix=; \
fi; \
list='$(SUBDIRS)'; for subdir in $$list; do \
if test "$$subdir" = .; then :; else \
test ! -f $$subdir/TAGS || \
set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
fi; \
done; \
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
shift; \
if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
test -n "$$unique" || unique=$$empty_fix; \
if test $$# -gt 0; then \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
"$$@" $$unique; \
else \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
$$unique; \
fi; \
fi
ctags: CTAGS
CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
test -z "$(CTAGS_ARGS)$$unique" \
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
$$unique
GTAGS:
here=`$(am__cd) $(top_builddir) && pwd` \
&& $(am__cd) $(top_srcdir) \
&& gtags -i $(GTAGS_ARGS) "$$here"
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
distdir: $(DISTFILES)
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
list='$(DISTFILES)'; \
dist_files=`for file in $$list; do echo $$file; done | \
sed -e "s|^$$srcdirstrip/||;t" \
-e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
case $$dist_files in \
*/*) $(MKDIR_P) `echo "$$dist_files" | \
sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
sort -u` ;; \
esac; \
for file in $$dist_files; do \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
if test -d $$d/$$file; then \
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
if test -d "$(distdir)/$$file"; then \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
else \
test -f "$(distdir)/$$file" \
|| cp -p $$d/$$file "$(distdir)/$$file" \
|| exit 1; \
fi; \
done
@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
if test "$$subdir" = .; then :; else \
test -d "$(distdir)/$$subdir" \
|| $(MKDIR_P) "$(distdir)/$$subdir" \
|| exit 1; \
fi; \
done
@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
if test "$$subdir" = .; then :; else \
dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
$(am__relativize); \
new_distdir=$$reldir; \
dir1=$$subdir; dir2="$(top_distdir)"; \
$(am__relativize); \
new_top_distdir=$$reldir; \
echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \
echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \
($(am__cd) $$subdir && \
$(MAKE) $(AM_MAKEFLAGS) \
top_distdir="$$new_top_distdir" \
distdir="$$new_distdir" \
am__remove_distdir=: \
am__skip_length_check=: \
am__skip_mode_fix=: \
distdir) \
|| exit 1; \
fi; \
done
check-am: all-am
check: check-recursive
all-am: Makefile
installdirs: installdirs-recursive
installdirs-am:
install: install-recursive
install-exec: install-exec-recursive
install-data: install-data-recursive
uninstall: uninstall-recursive
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
installcheck: installcheck-recursive
install-strip:
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
`test -z '$(STRIP)' || \
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
mostlyclean-generic:
clean-generic:
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
clean: clean-recursive
clean-am: clean-generic clean-libtool mostlyclean-am
distclean: distclean-recursive
-rm -f Makefile
distclean-am: clean-am distclean-generic distclean-tags
dvi: dvi-recursive
dvi-am:
html: html-recursive
html-am:
info: info-recursive
info-am:
install-data-am:
install-dvi: install-dvi-recursive
install-dvi-am:
install-exec-am:
install-html: install-html-recursive
install-html-am:
install-info: install-info-recursive
install-info-am:
install-man:
install-pdf: install-pdf-recursive
install-pdf-am:
install-ps: install-ps-recursive
install-ps-am:
installcheck-am:
maintainer-clean: maintainer-clean-recursive
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-recursive
mostlyclean-am: mostlyclean-generic mostlyclean-libtool
pdf: pdf-recursive
pdf-am:
ps: ps-recursive
ps-am:
uninstall-am:
.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \
install-am install-strip tags-recursive
.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
all all-am check check-am clean clean-generic clean-libtool \
ctags ctags-recursive distclean distclean-generic \
distclean-libtool distclean-tags distdir dvi dvi-am html \
html-am info info-am install install-am install-data \
install-data-am install-dvi install-dvi-am install-exec \
install-exec-am install-html install-html-am install-info \
install-info-am install-man install-pdf install-pdf-am \
install-ps install-ps-am install-strip installcheck \
installcheck-am installdirs installdirs-am maintainer-clean \
maintainer-clean-generic mostlyclean mostlyclean-generic \
mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \
uninstall uninstall-am
# 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:

11
scripts/README Normal file
View file

@ -0,0 +1,11 @@
These directories hold various scripts:
- example startup and shutdown scripts for various operating systems and
distributions,
- hotplug and udev integration for on the fly privileges settings (Linux only),
- Hardware Abstraction Layer script, for declaring and binding NUT addons to
specific USB devices,
- Python Client module and application,
- Perl client module.
They have either been contributed by users of the software, or by the NUT Team
itself.

4
scripts/RedHat/README Normal file
View file

@ -0,0 +1,4 @@
Install ups in /etc/rc.d/init.d
/etc/sysconfig/ups is used only to store the POWERDOWNFLAG variable

40
scripts/RedHat/halt.patch Normal file
View file

@ -0,0 +1,40 @@
--- /etc/rc.d/init.d/halt Thu Mar 28 00:21:19 2002
+++ halt.new Fri Jan 31 15:29:49 2003
@@ -8,8 +8,17 @@
# Modified for RHS Linux by Damien Neil
#
+# 2003-01-31 Antonino Albanese <al.an@monkeysweb.net>
+# Modified ups shutdown for new NUT method
+#
# Set the path.
PATH=/sbin:/bin:/usr/bin:/usr/sbin
+# load /etc/sysconfig/ups if present I've put the POWERDOWNFLAG
+# in there so noboby have to manually modify the shutdown script
+if [ -f /etc/sysconfig/ups ]; then
+ . /etc/sysconfig/ups
+fi
+UPSCMD=`which upsdrvctl`
export NOLOCALE=1
. /etc/init.d/functions
@@ -198,10 +208,15 @@
fi
if [ "$command" = halt ] ; then
- if [ -r /etc/ups/upsmon.conf -a -f /etc/killpower -a -f /etc/sysconfig/ups ] ; then
- . /etc/sysconfig/ups
- [ "$SERVER" = "yes" -a "$MODEL" != "NONE" -a -n "$MODEL" -a -n "$DEVICE" ] && $MODEL -k $DEVICE
- fi
+# if [ -r /etc/ups/upsmon.conf -a -f /etc/killpower -a -f /etc/sysconfig/ups ] ; then
+# . /etc/sysconfig/ups
+# [ "$SERVER" = "yes" -a "$MODEL" != "NONE" -a -n "$MODEL" -a -n "$DEVICE" ] && $MODEL -k $DEVICE
+# fi
+ if [ -n "$POWERDOWNFLAG" -a -n "$UPSCMD" ]; then
+ if [ -f $POWERDOWNFLAG ]; then
+ $UPSCMD shutdown
+ fi
+ fi
fi
if [ -x "/sbin/halt.local" ]; then

3
scripts/RedHat/ups Normal file
View file

@ -0,0 +1,3 @@
# POWERDOWNFLAG *must* match that in upsmon.conf
POWERDOWNFLAG=/etc/killpower
NUTUSER=nutmon

110
scripts/RedHat/upsd Normal file
View file

@ -0,0 +1,110 @@
#!/bin/sh
#
# chkconfig: 2345 30 90
#
# 2003-01-31 Antonino Albanese <al.an@monkeysweb.net>
# Removed all old statements
# start programs as user nut
# new style starting and stopping upsd
# added reload option
# use of /etc/sysconfig/ups for POWERDOWNFLAG variable retrieving
#
# 2002-02-07 Nigel Metheringham <Nigel.Metheringham@InTechnology.co.uk>
# made ups.conf pre-eminant, added new upsdrvctl functions, targeted for RH7.2, should
# work OK on RH 6.x, 7.x
# 2001-10-24 Peter Bieringer <pb@bieringer.de>
# enhancements for new style drivers and controls, tested on a RHL 7.1.93 system
#
# description: NUT upsd and its drivers directly monitor a ups and \
# make information from it available to other programs
# processname: upsd
# config: /etc/ups/upsd.conf
# config: /etc/ups/ups.conf
PATH=/sbin:/bin:/usr/sbin:/usr/bin
export PATH
# Source function library.
. /etc/rc.d/init.d/functions
# POWERDOWNFLAG *must* match that in upsmon.conf
# Loading POWERDOWNFLAG from /etc/sysconfig/ups
DRIVERPATH=/sbin
if [ -f /etc/sysconfig/ups ]; then
. /etc/sysconfig/ups
else
POWERDOWNFLAG=/etc/killpower
NUTUSER=nutmon
fi
UPSDCONF=/etc/ups/upsd.conf
UPSCONF=/etc/ups/ups.conf
# if there are no config file, bail out
[ -f $UPSDCONF ] && [ -f $UPSCONF ] || exit 0
runcmd() {
echo -n "$1 "
shift
if [ "$BOOTUP" = "color" ]; then
$* && echo_success || echo_failure
else
$*
fi
echo
}
# See how we are called.
case "$1" in
start)
# new style drivers uses 'upsdrvctl'
echo -n "NUT Starting UPS model drivers: "
# starting ase nut user
daemon --user $NUTUSER `which upsdrvctl` start
echo
if [ $? -eq 0 ]; then
echo -n "NUT Starting UPS daemon: "
# starting ase nut user
daemon upsd -u $NUTUSER
echo
touch /var/lock/subsys/upsd
fi
;;
stop)
# new style upsd stop
action "NUT Stopping UPS daemon" \
upsd -c stop
# new style drivers uses 'upsdrvctl'
action "NUT Stopping UPS model drivers" \
upsdrvctl stop
rm -f /var/lock/subsys/upsd
;;
powerdown)
# new style drivers
runcmd "NUT powerdown of attached UPS(es)" upsdrvctl shutdown
;;
restart)
$0 stop
$0 start
;;
reload)
# reloading upsd config files
action "NUT Reloading config files" \
upsd -c reload
;;
status)
# new style drivers
action "NUT: checking UPS model drivers" upsdrvctl status
status upsd
;;
*)
echo "Usage: upsd {start|stop|powerdown|restart|reload|status}"
exit 1
esac

110
scripts/RedHat/upsd.in Normal file
View file

@ -0,0 +1,110 @@
#!/bin/sh
#
# chkconfig: 2345 30 90
#
# 2003-01-31 Antonino Albanese <al.an@monkeysweb.net>
# Removed all old statements
# start programs as user nut
# new style starting and stopping upsd
# added reload option
# use of /etc/sysconfig/ups for POWERDOWNFLAG variable retrieving
#
# 2002-02-07 Nigel Metheringham <Nigel.Metheringham@InTechnology.co.uk>
# made ups.conf pre-eminant, added new upsdrvctl functions, targeted for RH7.2, should
# work OK on RH 6.x, 7.x
# 2001-10-24 Peter Bieringer <pb@bieringer.de>
# enhancements for new style drivers and controls, tested on a RHL 7.1.93 system
#
# description: NUT upsd and its drivers directly monitor a ups and \
# make information from it available to other programs
# processname: upsd
# config: @sysconfdir@/upsd.conf
# config: @sysconfdir@/ups.conf
PATH=/sbin:/bin:/usr/sbin:/usr/bin
export PATH
# Source function library.
. /etc/rc.d/init.d/functions
# POWERDOWNFLAG *must* match that in upsmon.conf
# Loading POWERDOWNFLAG from /etc/sysconfig/ups
DRIVERPATH=@DRVPATH@
if [ -f /etc/sysconfig/ups ]; then
. /etc/sysconfig/ups
else
POWERDOWNFLAG=/etc/killpower
NUTUSER=nutmon
fi
UPSDCONF=@sysconfdir@/upsd.conf
UPSCONF=@sysconfdir@/ups.conf
# if there are no config file, bail out
[ -f $UPSDCONF ] && [ -f $UPSCONF ] || exit 0
runcmd() {
echo -n "$1 "
shift
if [ "$BOOTUP" = "color" ]; then
$* && echo_success || echo_failure
else
$*
fi
echo
}
# See how we are called.
case "$1" in
start)
# new style drivers uses 'upsdrvctl'
echo -n "NUT Starting UPS model drivers: "
# starting ase nut user
daemon --user $NUTUSER `which upsdrvctl` start
echo
if [ $? -eq 0 ]; then
echo -n "NUT Starting UPS daemon: "
# starting ase nut user
daemon upsd -u $NUTUSER
echo
touch /var/lock/subsys/upsd
fi
;;
stop)
# new style upsd stop
action "NUT Stopping UPS daemon" \
upsd -c stop
# new style drivers uses 'upsdrvctl'
action "NUT Stopping UPS model drivers" \
upsdrvctl stop
rm -f /var/lock/subsys/upsd
;;
powerdown)
# new style drivers
runcmd "NUT powerdown of attached UPS(es)" upsdrvctl shutdown
;;
restart)
$0 stop
$0 start
;;
reload)
# reloading upsd config files
action "NUT Reloading config files" \
upsd -c reload
;;
status)
# new style drivers
action "NUT: checking UPS model drivers" upsdrvctl status
status upsd
;;
*)
echo "Usage: upsd {start|stop|powerdown|restart|reload|status}"
exit 1
esac

56
scripts/RedHat/upsmon Normal file
View file

@ -0,0 +1,56 @@
#!/bin/sh
#
# chkconfig: 2345 31 89
#
# 2003-01-31 Antonino Albanese <al.an@monkeysweb.net>
# start program as user nut
# new style stopping upsmon
# added reload option
#
# description: upsmon talks to upsd and notifies of ups status changes \
# also shutting systems down if required.
# processname: upsmon
# config: /etc/ups/upsmon.conf
PATH=/sbin:/bin:/usr/sbin:/usr/bin
export PATH
# Source function library.
. /etc/rc.d/init.d/functions
if [ -f /etc/sysconfig/ups ]; then
. /etc/sysconfig/ups
else
POWERDOWNFLAG=/etc/killpower
NUTUSER=nutmon
fi
# See how we are called.
case "$1" in
start)
action "NUT Starting UPS monitor" upsmon -u $NUTUSER
touch /var/lock/subsys/upsmon
;;
stop)
action "NUT Stopping UPS monitor: " \
upsmon -c stop
rm -f /var/lock/subsys/upsmon
;;
restart)
$0 stop
$0 start
;;
reload)
action "NUT Reloading UPS monitor: " \
upsmon -c reload
;;
status)
status upsmon
;;
*)
echo "Usage: upsmon {start|stop|restart|reload|status}"
exit 1
esac

56
scripts/RedHat/upsmon.in Normal file
View file

@ -0,0 +1,56 @@
#!/bin/sh
#
# chkconfig: 2345 31 89
#
# 2003-01-31 Antonino Albanese <al.an@monkeysweb.net>
# start program as user nut
# new style stopping upsmon
# added reload option
#
# description: upsmon talks to upsd and notifies of ups status changes \
# also shutting systems down if required.
# processname: upsmon
# config: @sysconfdir@/upsmon.conf
PATH=/sbin:/bin:/usr/sbin:/usr/bin
export PATH
# Source function library.
. /etc/rc.d/init.d/functions
if [ -f /etc/sysconfig/ups ]; then
. /etc/sysconfig/ups
else
POWERDOWNFLAG=/etc/killpower
NUTUSER=nutmon
fi
# See how we are called.
case "$1" in
start)
action "NUT Starting UPS monitor" upsmon -u $NUTUSER
touch /var/lock/subsys/upsmon
;;
stop)
action "NUT Stopping UPS monitor: " \
upsmon -c stop
rm -f /var/lock/subsys/upsmon
;;
restart)
$0 stop
$0 start
;;
reload)
action "NUT Reloading UPS monitor: " \
upsmon -c reload
;;
status)
status upsmon
;;
*)
echo "Usage: upsmon {start|stop|restart|reload|status}"
exit 1
esac

37
scripts/Solaris8/S99upsmon Executable file
View file

@ -0,0 +1,37 @@
#! /bin/sh
# Copyright (c) 1995-2000 ???
#
# Author: Sandro Wefel <wefel@informatik.uni-halle.de>
#
# Put it in /etc/rc2.d/ or /etc/rc3.d depending on runlevel
#
PATH=/sbin:/bin:/usr/sbin:/usr/bin
export PATH
UPSDPATH=/usr/local/ups/sbin
# See how we are called.
case "$1" in
'start')
if [ -x $UPSDPATH/upsmon ]; then
echo "NUT Starting UPS monitor "
$UPSDPATH/upsmon >/dev/console 2>&1
touch /var/lock/subsys/upsmon
fi
;;
'stop')
echo "NUT Stopping UPS monitor "
/usr/bin/pkill -x upsmon
rm -f /var/lock/subsys/upsmon
;;
'restart')
$0 stop
$0 start
;;
*)
echo "Usage: upsmon {start|stop|restart}"
exit 1
;;
esac
exit 0

2
scripts/Windows/Makefile Normal file
View file

@ -0,0 +1,2 @@
halt: halt.c
gcc -mwindows -mno-cygwin -s -o halt.exe halt.c

84
scripts/Windows/halt.c Normal file
View file

@ -0,0 +1,84 @@
/* gcc -mwindows -mno-cygwin -o halt.exe halt.c
NAME
halt - stopping the system
SYNOPSIS
halt [-pq]
DESCRIPTION
The halt utility logs off the current user, flushes the file system
buffers to disk, stops all processes (non-responsive processes are
only forced to stop in Windows 2000), and shuts the system down.
The options are as follows
-p Attempt to powerdown the system. If the powerdown fails, or
the system does not support software powerdown, the system
will halt.
-q Do not give processes a chance to shut down before halting or
restarting. This option should not normally be used.
AUTHOR
Ben Collver <collver@softhome.net>
*/
#include <windows.h>
#ifndef EWX_FORCEIFHUNG
#define EWX_FORCEIFHUNG 0x00000010
#endif
int WINAPI WinMain(
HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPSTR lpCmdLine,
int nCmdShow)
{
TOKEN_PRIVILEGES privileges = {1, {{{0, 0}, SE_PRIVILEGE_ENABLED}}};
HANDLE my_token;
UINT my_flags;
my_flags = EWX_SHUTDOWN | EWX_FORCEIFHUNG;
if (strstr(lpCmdLine, "q") != NULL) {
my_flags |= EWX_FORCE;
}
if (strstr(lpCmdLine, "p") != NULL) {
my_flags |= EWX_POWEROFF;
}
if (!LookupPrivilegeValue(
NULL,
SE_SHUTDOWN_NAME,
&privileges.Privileges[0].Luid))
{
exit(1);
}
if (!OpenProcessToken(
GetCurrentProcess(),
TOKEN_ADJUST_PRIVILEGES,
&my_token))
{
exit(2);
}
if (!AdjustTokenPrivileges(
my_token,
FALSE,
&privileges,
sizeof(TOKEN_PRIVILEGES),
NULL,
NULL))
{
exit(3);
}
CloseHandle(my_token);
if (!ExitWindowsEx(my_flags, 0)) {
exit(4);
}
exit(0);
}

16
scripts/hal/Makefile.am Normal file
View file

@ -0,0 +1,16 @@
if WITH_HAL
halfdidir = $(HAL_FDI_PATH)
halfdi_DATA = 20-ups-nut-device.fdi
endif
# FIXME: should be able to use $< here.
20-ups-nut-device.fdi: ups-nut-device.fdi
cp ups-nut-device.fdi $@
EXTRA_DIST = ups-nut-device.fdi.in
DISTCLEANFILES = ups-nut-device.fdi
# we should never remove this one, apart from a distclean-check
#MAINTAINERCLEANFILES = ups-nut-device.fdi.in
CLEANFILES = 20-ups-nut-device.fdi

473
scripts/hal/Makefile.in Normal file
View file

@ -0,0 +1,473 @@
# Makefile.in generated by automake 1.11 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation,
# Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
@SET_MAKE@
VPATH = @srcdir@
pkgdatadir = $(datadir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkglibexecdir = $(libexecdir)/@PACKAGE@
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_HEADER = $(INSTALL_DATA)
transform = $(program_transform_name)
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
target_triplet = @target@
subdir = scripts/hal
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
$(srcdir)/ups-nut-device.fdi.in
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/ax_create_stdint_h.m4 \
$(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \
$(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \
$(top_srcdir)/m4/lt~obsolete.m4 \
$(top_srcdir)/m4/nut_arg_with.m4 \
$(top_srcdir)/m4/nut_check_ipv6.m4 \
$(top_srcdir)/m4/nut_check_libgd.m4 \
$(top_srcdir)/m4/nut_check_libhal.m4 \
$(top_srcdir)/m4/nut_check_libneon.m4 \
$(top_srcdir)/m4/nut_check_libnetsnmp.m4 \
$(top_srcdir)/m4/nut_check_libpowerman.m4 \
$(top_srcdir)/m4/nut_check_libssl.m4 \
$(top_srcdir)/m4/nut_check_libusb.m4 \
$(top_srcdir)/m4/nut_check_libwrap.m4 \
$(top_srcdir)/m4/nut_check_os.m4 \
$(top_srcdir)/m4/nut_report_feature.m4 \
$(top_srcdir)/m4/nut_type_socklen_t.m4 \
$(top_srcdir)/configure.in
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 = ups-nut-device.fdi
CONFIG_CLEAN_VPATH_FILES =
SOURCES =
DIST_SOURCES =
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
am__vpath_adj = case $$p in \
$(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
*) f=$$p;; \
esac;
am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
am__install_max = 40
am__nobase_strip_setup = \
srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
am__nobase_strip = \
for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
am__nobase_list = $(am__nobase_strip_setup); \
for p in $$list; do echo "$$p $$p"; done | \
sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
$(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
if (++n[$$2] == $(am__install_max)) \
{ print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
END { for (dir in files) print dir, files[dir] }'
am__base_list = \
sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
am__installdirs = "$(DESTDIR)$(halfdidir)"
DATA = $(halfdi_DATA)
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
AR = @AR@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
BINDIR = @BINDIR@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CONFPATH = @CONFPATH@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CYGPATH_W = @CYGPATH_W@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
DRIVER_BUILD_LIST = @DRIVER_BUILD_LIST@
DRIVER_INSTALL_TARGET = @DRIVER_INSTALL_TARGET@
DRIVER_MAN_LIST = @DRIVER_MAN_LIST@
DSYMUTIL = @DSYMUTIL@
DUMPBIN = @DUMPBIN@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
FGREP = @FGREP@
GREP = @GREP@
HAL_CALLOUTS_PATH = @HAL_CALLOUTS_PATH@
HAL_DEVICE_MATCH_KEY = @HAL_DEVICE_MATCH_KEY@
HAL_FDI_PATH = @HAL_FDI_PATH@
HAL_USER = @HAL_USER@
HAVE_GLIB_2_14 = @HAVE_GLIB_2_14@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
LD = @LD@
LDFLAGS = @LDFLAGS@
LIBGD_CFLAGS = @LIBGD_CFLAGS@
LIBGD_LDFLAGS = @LIBGD_LDFLAGS@
LIBHAL_CFLAGS = @LIBHAL_CFLAGS@
LIBHAL_LDFLAGS = @LIBHAL_LDFLAGS@
LIBNEON_CFLAGS = @LIBNEON_CFLAGS@
LIBNEON_LDFLAGS = @LIBNEON_LDFLAGS@
LIBNETSNMP_CFLAGS = @LIBNETSNMP_CFLAGS@
LIBNETSNMP_LDFLAGS = @LIBNETSNMP_LDFLAGS@
LIBOBJS = @LIBOBJS@
LIBPOWERMAN_CFLAGS = @LIBPOWERMAN_CFLAGS@
LIBPOWERMAN_LDFLAGS = @LIBPOWERMAN_LDFLAGS@
LIBS = @LIBS@
LIBSSL_CFLAGS = @LIBSSL_CFLAGS@
LIBSSL_LDFLAGS = @LIBSSL_LDFLAGS@
LIBTOOL = @LIBTOOL@
LIBUSB_CFLAGS = @LIBUSB_CFLAGS@
LIBUSB_LDFLAGS = @LIBUSB_LDFLAGS@
LIBWRAP_CFLAGS = @LIBWRAP_CFLAGS@
LIBWRAP_LDFLAGS = @LIBWRAP_LDFLAGS@
LIPO = @LIPO@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
MKDIR_P = @MKDIR_P@
NETLIBS = @NETLIBS@
NM = @NM@
NMEDIT = @NMEDIT@
OBJDUMP = @OBJDUMP@
OBJEXT = @OBJEXT@
OS_NAME = @OS_NAME@
OTOOL = @OTOOL@
OTOOL64 = @OTOOL64@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
RANLIB = @RANLIB@
RUN_AS_GROUP = @RUN_AS_GROUP@
RUN_AS_USER = @RUN_AS_USER@
SED = @SED@
SERLIBS = @SERLIBS@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STATEPATH = @STATEPATH@
STRIP = @STRIP@
SUN_LIBUSB = @SUN_LIBUSB@
VERSION = @VERSION@
WORDS_BIGENDIAN = @WORDS_BIGENDIAN@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
abs_top_srcdir = @abs_top_srcdir@
ac_ct_CC = @ac_ct_CC@
ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
am__tar = @am__tar@
am__untar = @am__untar@
bindir = @bindir@
build = @build@
build_alias = @build_alias@
build_cpu = @build_cpu@
build_os = @build_os@
build_vendor = @build_vendor@
builddir = @builddir@
cgiexecdir = @cgiexecdir@
datadir = @datadir@
datarootdir = @datarootdir@
docdir = @docdir@
driverexecdir = @driverexecdir@
dvidir = @dvidir@
exec_prefix = @exec_prefix@
host = @host@
host_alias = @host_alias@
host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
hotplugdir = @hotplugdir@
htmldir = @htmldir@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
localedir = @localedir@
localstatedir = @localstatedir@
lt_ECHO = @lt_ECHO@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
pdfdir = @pdfdir@
pkgconfigdir = @pkgconfigdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
sysconfdir = @sysconfdir@
target = @target@
target_alias = @target_alias@
target_cpu = @target_cpu@
target_os = @target_os@
target_vendor = @target_vendor@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
udevdir = @udevdir@
@WITH_HAL_TRUE@halfdidir = $(HAL_FDI_PATH)
@WITH_HAL_TRUE@halfdi_DATA = 20-ups-nut-device.fdi
EXTRA_DIST = ups-nut-device.fdi.in
DISTCLEANFILES = ups-nut-device.fdi
# we should never remove this one, apart from a distclean-check
#MAINTAINERCLEANFILES = ups-nut-device.fdi.in
CLEANFILES = 20-ups-nut-device.fdi
all: all-am
.SUFFIXES:
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
&& { if test -f $@; then exit 0; else break; fi; }; \
exit 1;; \
esac; \
done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu scripts/hal/Makefile'; \
$(am__cd) $(top_srcdir) && \
$(AUTOMAKE) --gnu scripts/hal/Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
*) \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(am__aclocal_m4_deps):
ups-nut-device.fdi: $(top_builddir)/config.status $(srcdir)/ups-nut-device.fdi.in
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
mostlyclean-libtool:
-rm -f *.lo
clean-libtool:
-rm -rf .libs _libs
install-halfdiDATA: $(halfdi_DATA)
@$(NORMAL_INSTALL)
test -z "$(halfdidir)" || $(MKDIR_P) "$(DESTDIR)$(halfdidir)"
@list='$(halfdi_DATA)'; test -n "$(halfdidir)" || list=; \
for p in $$list; do \
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
echo "$$d$$p"; \
done | $(am__base_list) | \
while read files; do \
echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(halfdidir)'"; \
$(INSTALL_DATA) $$files "$(DESTDIR)$(halfdidir)" || exit $$?; \
done
uninstall-halfdiDATA:
@$(NORMAL_UNINSTALL)
@list='$(halfdi_DATA)'; test -n "$(halfdidir)" || list=; \
files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
test -n "$$files" || exit 0; \
echo " ( cd '$(DESTDIR)$(halfdidir)' && rm -f" $$files ")"; \
cd "$(DESTDIR)$(halfdidir)" && rm -f $$files
tags: TAGS
TAGS:
ctags: CTAGS
CTAGS:
distdir: $(DISTFILES)
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
list='$(DISTFILES)'; \
dist_files=`for file in $$list; do echo $$file; done | \
sed -e "s|^$$srcdirstrip/||;t" \
-e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
case $$dist_files in \
*/*) $(MKDIR_P) `echo "$$dist_files" | \
sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
sort -u` ;; \
esac; \
for file in $$dist_files; do \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
if test -d $$d/$$file; then \
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
if test -d "$(distdir)/$$file"; then \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
else \
test -f "$(distdir)/$$file" \
|| cp -p $$d/$$file "$(distdir)/$$file" \
|| exit 1; \
fi; \
done
check-am: all-am
check: check-am
all-am: Makefile $(DATA)
installdirs:
for dir in "$(DESTDIR)$(halfdidir)"; do \
test -z "$$dir" || $(MKDIR_P) "$$dir"; \
done
install: install-am
install-exec: install-exec-am
install-data: install-data-am
uninstall: uninstall-am
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
installcheck: installcheck-am
install-strip:
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
`test -z '$(STRIP)' || \
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
mostlyclean-generic:
clean-generic:
-test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
-test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
clean: clean-am
clean-am: clean-generic clean-libtool mostlyclean-am
distclean: distclean-am
-rm -f Makefile
distclean-am: clean-am distclean-generic
dvi: dvi-am
dvi-am:
html: html-am
html-am:
info: info-am
info-am:
install-data-am: install-halfdiDATA
install-dvi: install-dvi-am
install-dvi-am:
install-exec-am:
install-html: install-html-am
install-html-am:
install-info: install-info-am
install-info-am:
install-man:
install-pdf: install-pdf-am
install-pdf-am:
install-ps: install-ps-am
install-ps-am:
installcheck-am:
maintainer-clean: maintainer-clean-am
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-am
mostlyclean-am: mostlyclean-generic mostlyclean-libtool
pdf: pdf-am
pdf-am:
ps: ps-am
ps-am:
uninstall-am: uninstall-halfdiDATA
.MAKE: install-am install-strip
.PHONY: all all-am check check-am clean clean-generic clean-libtool \
distclean distclean-generic distclean-libtool distdir dvi \
dvi-am html html-am info info-am install install-am \
install-data install-data-am install-dvi install-dvi-am \
install-exec install-exec-am install-halfdiDATA install-html \
install-html-am install-info install-info-am install-man \
install-pdf install-pdf-am install-ps install-ps-am \
install-strip installcheck installcheck-am installdirs \
maintainer-clean maintainer-clean-generic mostlyclean \
mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
uninstall uninstall-am uninstall-halfdiDATA
# FIXME: should be able to use $< here.
20-ups-nut-device.fdi: ups-nut-device.fdi
cp ups-nut-device.fdi $@
# 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

@ -0,0 +1,392 @@
<?xml version="1.0" encoding="ISO-8859-1"?> <!-- -*- SGML -*- -->
<deviceinfo version="0.2">
<device>
<match key="@HAL_DEVICE_MATCH_KEY@" string="usb_device">
<match key="usb_device.vendor_id" int="0x0001">
<!-- Krauler UP-M500VA -->
<match key="usb_device.product_id" int="0x0000">
<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>
</match>
<!-- Hewlett Packard -->
<match key="usb_device.vendor_id" int="0x03f0">
<!-- T500 -->
<match key="usb_device.product_id" int="0x1f01">
<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="battery.type" type="string">ups</merge>
</match>
<!-- T750 -->
<match key="usb_device.product_id" int="0x1f02">
<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="battery.type" type="string">ups</merge>
</match>
<!-- HP T750 INTL -->
<match key="usb_device.product_id" int="0x1f06">
<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 R/T 2200 INTL (like SMART2200RMXL2U) -->
<match key="usb_device.product_id" int="0x1f0a">
<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 -->
<match key="usb_device.vendor_id" int="0x0463">
<!-- various models -->
<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>
<!-- various models -->
<match key="usb_device.product_id" int="0xffff">
<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>
<!-- Dell -->
<match key="usb_device.vendor_id" int="0x047c">
<!-- various models -->
<match key="usb_device.product_id" int="0xffff">
<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>
<!-- Belkin -->
<match key="usb_device.vendor_id" int="0x050d">
<!-- F6H375-USB -->
<match key="usb_device.product_id" int="0x0375">
<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>
<!-- F6C550-AVR -->
<match key="usb_device.product_id" int="0x0551">
<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>
<!-- F6C1250-TW-RK -->
<match key="usb_device.product_id" int="0x0750">
<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>
<!-- F6C1500-TW-RK -->
<match key="usb_device.product_id" int="0x0751">
<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>
<!-- F6C900-UNV -->
<match key="usb_device.product_id" int="0x0900">
<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>
<!-- F6C100-UNV -->
<match key="usb_device.product_id" int="0x0910">
<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>
<!-- F6C120-UNV -->
<match key="usb_device.product_id" int="0x0912">
<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>
<!-- F6C800-UNV -->
<match key="usb_device.product_id" int="0x0980">
<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>
<!-- F6C1100-UNV, F6C1200-UNV -->
<match key="usb_device.product_id" int="0x1100">
<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>
<!-- APC -->
<match key="usb_device.vendor_id" int="0x051d">
<!-- various models -->
<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-usbhid-ups</merge>
<merge key="battery.type" type="string">ups</merge>
</match>
</match>
<!-- Powerware -->
<match key="usb_device.vendor_id" int="0x0592">
<!-- various models -->
<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="battery.type" type="string">ups</merge>
</match>
</match>
<match key="usb_device.vendor_id" int="0x05b8">
<!-- Agiler UPS -->
<match key="usb_device.product_id" int="0x0000">
<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>
</match>
<match key="usb_device.vendor_id" int="0x0665">
<!-- Belkin F6C1200-UNV -->
<match key="usb_device.product_id" int="0x5161">
<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>
</match>
<!-- Liebert -->
<match key="usb_device.vendor_id" int="0x06da">
<!-- various models -->
<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="battery.type" type="string">ups</merge>
</match>
<!-- Mustek Powermust -->
<match key="usb_device.product_id" int="0x0003">
<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>
<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>
<!-- Cyber Power Systems -->
<match key="usb_device.vendor_id" int="0x0764">
<!-- 900AVR/BC900D, CP1200AVR/BC1200D -->
<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-usbhid-ups</merge>
<merge key="battery.type" type="string">ups</merge>
</match>
<!-- Dynex DX-800U? -->
<match key="usb_device.product_id" int="0x0501">
<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>
<!-- OR2200LCDRM2U -->
<match key="usb_device.product_id" int="0x0601">
<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>
<match key="usb_device.vendor_id" int="0x0925">
<!-- Sweex 1000VA -->
<match key="usb_device.product_id" int="0x1234">
<append key="info.category" type="string">battery</append>
<merge key="info.capabilities" type="strlist">battery</merge>
<merge key="info.addons" type="strlist">hald-addon-richcomm_usb</merge>
<merge key="battery.type" type="string">ups</merge>
</match>
</match>
<!-- TrippLite -->
<match key="usb_device.vendor_id" int="0x09ae">
<!-- e.g. OMNIVS1000, SMART550USB, ... -->
<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-tripplite_usb</merge>
<merge key="battery.type" type="string">ups</merge>
</match>
<!-- e.g. TrippLite AVR550U -->
<match key="usb_device.product_id" int="0x1003">
<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>
<!-- e.g. TrippLite AVR750U -->
<match key="usb_device.product_id" int="0x1007">
<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>
<!-- e.g. TrippLite ECO550UPS -->
<match key="usb_device.product_id" int="0x1008">
<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>
<!-- e.g. TrippLite OMNI1000LCD -->
<match key="usb_device.product_id" int="0x2005">
<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>
<!-- e.g. TrippLite OMNI900LCD -->
<match key="usb_device.product_id" int="0x2007">
<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>
<!-- e.g. TrippLite smart2200RMXL2U -->
<match key="usb_device.product_id" int="0x3012">
<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>
<!-- e.g. ? -->
<match key="usb_device.product_id" int="0x3014">
<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>
<!-- e.g. TrippLite SmartOnline SU1500RTXL2UA (older unit?) -->
<match key="usb_device.product_id" int="0x4001">
<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>
<!-- e.g. TrippLite SmartOnline SU6000RT4U? -->
<match key="usb_device.product_id" int="0x4002">
<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>
<!-- e.g. TrippLite SmartOnline SU1500RTXL2ua -->
<match key="usb_device.product_id" int="0x4003">
<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>
<!-- PowerCOM -->
<match key="usb_device.vendor_id" int="0x0d9f">
<!-- PowerCOM IMP - IMPERIAL Series -->
<match key="usb_device.product_id" int="0x00a2">
<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>
<!-- PowerCOM SKP - Smart KING Pro (all Smart series) -->
<match key="usb_device.product_id" int="0x00a3">
<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>
<!-- PowerCOM WOW -->
<match key="usb_device.product_id" int="0x00a4">
<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>
<!-- PowerCOM VGD - Vanguard -->
<match key="usb_device.product_id" int="0x00a5">
<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>
<!-- PowerCOM BNT - Black Knight Pro -->
<match key="usb_device.product_id" int="0x00a6">
<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>
<match key="usb_device.vendor_id" int="0x0f03">
<!-- Unitek Alpha 1200Sx -->
<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-blazer_usb</merge>
<merge key="battery.type" type="string">ups</merge>
</match>
</match>
<!-- Liebert -->
<match key="usb_device.vendor_id" int="0x10af">
<!-- Liebert PowerSure PSA UPS -->
<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>
</match>
<match key="usb_device.vendor_id" int="0xffff">
<!-- Ablerex 625L USB -->
<match key="usb_device.product_id" int="0x0000">
<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>
</match>
</match>
</device>
</deviceinfo>

View file

@ -0,0 +1,11 @@
if WITH_HOTPLUG
hotplugusbdir = $(hotplugdir)/usb
dist_hotplugusb_DATA = libhid.usermap
hotplugusb_SCRIPTS = libhidups
endif
EXTRA_DIST = README
DISTCLEANFILES = libhidups
# we should never remove this one, apart from a distclean-check
#MAINTAINERCLEANFILES = libhid.usermap

509
scripts/hotplug/Makefile.in Normal file
View file

@ -0,0 +1,509 @@
# Makefile.in generated by automake 1.11 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation,
# Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
@SET_MAKE@
VPATH = @srcdir@
pkgdatadir = $(datadir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkglibexecdir = $(libexecdir)/@PACKAGE@
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_HEADER = $(INSTALL_DATA)
transform = $(program_transform_name)
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
target_triplet = @target@
subdir = scripts/hotplug
DIST_COMMON = README $(am__dist_hotplugusb_DATA_DIST) \
$(srcdir)/Makefile.am $(srcdir)/Makefile.in \
$(srcdir)/libhidups.in
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/ax_create_stdint_h.m4 \
$(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \
$(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \
$(top_srcdir)/m4/lt~obsolete.m4 \
$(top_srcdir)/m4/nut_arg_with.m4 \
$(top_srcdir)/m4/nut_check_ipv6.m4 \
$(top_srcdir)/m4/nut_check_libgd.m4 \
$(top_srcdir)/m4/nut_check_libhal.m4 \
$(top_srcdir)/m4/nut_check_libneon.m4 \
$(top_srcdir)/m4/nut_check_libnetsnmp.m4 \
$(top_srcdir)/m4/nut_check_libpowerman.m4 \
$(top_srcdir)/m4/nut_check_libssl.m4 \
$(top_srcdir)/m4/nut_check_libusb.m4 \
$(top_srcdir)/m4/nut_check_libwrap.m4 \
$(top_srcdir)/m4/nut_check_os.m4 \
$(top_srcdir)/m4/nut_report_feature.m4 \
$(top_srcdir)/m4/nut_type_socklen_t.m4 \
$(top_srcdir)/configure.in
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 = libhidups
CONFIG_CLEAN_VPATH_FILES =
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
am__vpath_adj = case $$p in \
$(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
*) f=$$p;; \
esac;
am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
am__install_max = 40
am__nobase_strip_setup = \
srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
am__nobase_strip = \
for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
am__nobase_list = $(am__nobase_strip_setup); \
for p in $$list; do echo "$$p $$p"; done | \
sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
$(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
if (++n[$$2] == $(am__install_max)) \
{ print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
END { for (dir in files) print dir, files[dir] }'
am__base_list = \
sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
am__installdirs = "$(DESTDIR)$(hotplugusbdir)" \
"$(DESTDIR)$(hotplugusbdir)"
SCRIPTS = $(hotplugusb_SCRIPTS)
SOURCES =
DIST_SOURCES =
am__dist_hotplugusb_DATA_DIST = libhid.usermap
DATA = $(dist_hotplugusb_DATA)
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
AR = @AR@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
BINDIR = @BINDIR@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CONFPATH = @CONFPATH@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CYGPATH_W = @CYGPATH_W@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
DRIVER_BUILD_LIST = @DRIVER_BUILD_LIST@
DRIVER_INSTALL_TARGET = @DRIVER_INSTALL_TARGET@
DRIVER_MAN_LIST = @DRIVER_MAN_LIST@
DSYMUTIL = @DSYMUTIL@
DUMPBIN = @DUMPBIN@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
FGREP = @FGREP@
GREP = @GREP@
HAL_CALLOUTS_PATH = @HAL_CALLOUTS_PATH@
HAL_DEVICE_MATCH_KEY = @HAL_DEVICE_MATCH_KEY@
HAL_FDI_PATH = @HAL_FDI_PATH@
HAL_USER = @HAL_USER@
HAVE_GLIB_2_14 = @HAVE_GLIB_2_14@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
LD = @LD@
LDFLAGS = @LDFLAGS@
LIBGD_CFLAGS = @LIBGD_CFLAGS@
LIBGD_LDFLAGS = @LIBGD_LDFLAGS@
LIBHAL_CFLAGS = @LIBHAL_CFLAGS@
LIBHAL_LDFLAGS = @LIBHAL_LDFLAGS@
LIBNEON_CFLAGS = @LIBNEON_CFLAGS@
LIBNEON_LDFLAGS = @LIBNEON_LDFLAGS@
LIBNETSNMP_CFLAGS = @LIBNETSNMP_CFLAGS@
LIBNETSNMP_LDFLAGS = @LIBNETSNMP_LDFLAGS@
LIBOBJS = @LIBOBJS@
LIBPOWERMAN_CFLAGS = @LIBPOWERMAN_CFLAGS@
LIBPOWERMAN_LDFLAGS = @LIBPOWERMAN_LDFLAGS@
LIBS = @LIBS@
LIBSSL_CFLAGS = @LIBSSL_CFLAGS@
LIBSSL_LDFLAGS = @LIBSSL_LDFLAGS@
LIBTOOL = @LIBTOOL@
LIBUSB_CFLAGS = @LIBUSB_CFLAGS@
LIBUSB_LDFLAGS = @LIBUSB_LDFLAGS@
LIBWRAP_CFLAGS = @LIBWRAP_CFLAGS@
LIBWRAP_LDFLAGS = @LIBWRAP_LDFLAGS@
LIPO = @LIPO@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
MKDIR_P = @MKDIR_P@
NETLIBS = @NETLIBS@
NM = @NM@
NMEDIT = @NMEDIT@
OBJDUMP = @OBJDUMP@
OBJEXT = @OBJEXT@
OS_NAME = @OS_NAME@
OTOOL = @OTOOL@
OTOOL64 = @OTOOL64@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
RANLIB = @RANLIB@
RUN_AS_GROUP = @RUN_AS_GROUP@
RUN_AS_USER = @RUN_AS_USER@
SED = @SED@
SERLIBS = @SERLIBS@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STATEPATH = @STATEPATH@
STRIP = @STRIP@
SUN_LIBUSB = @SUN_LIBUSB@
VERSION = @VERSION@
WORDS_BIGENDIAN = @WORDS_BIGENDIAN@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
abs_top_srcdir = @abs_top_srcdir@
ac_ct_CC = @ac_ct_CC@
ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
am__tar = @am__tar@
am__untar = @am__untar@
bindir = @bindir@
build = @build@
build_alias = @build_alias@
build_cpu = @build_cpu@
build_os = @build_os@
build_vendor = @build_vendor@
builddir = @builddir@
cgiexecdir = @cgiexecdir@
datadir = @datadir@
datarootdir = @datarootdir@
docdir = @docdir@
driverexecdir = @driverexecdir@
dvidir = @dvidir@
exec_prefix = @exec_prefix@
host = @host@
host_alias = @host_alias@
host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
hotplugdir = @hotplugdir@
htmldir = @htmldir@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
localedir = @localedir@
localstatedir = @localstatedir@
lt_ECHO = @lt_ECHO@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
pdfdir = @pdfdir@
pkgconfigdir = @pkgconfigdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
sysconfdir = @sysconfdir@
target = @target@
target_alias = @target_alias@
target_cpu = @target_cpu@
target_os = @target_os@
target_vendor = @target_vendor@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
udevdir = @udevdir@
@WITH_HOTPLUG_TRUE@hotplugusbdir = $(hotplugdir)/usb
@WITH_HOTPLUG_TRUE@dist_hotplugusb_DATA = libhid.usermap
@WITH_HOTPLUG_TRUE@hotplugusb_SCRIPTS = libhidups
EXTRA_DIST = README
DISTCLEANFILES = libhidups
all: all-am
.SUFFIXES:
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
&& { if test -f $@; then exit 0; else break; fi; }; \
exit 1;; \
esac; \
done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu scripts/hotplug/Makefile'; \
$(am__cd) $(top_srcdir) && \
$(AUTOMAKE) --gnu scripts/hotplug/Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
*) \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(am__aclocal_m4_deps):
libhidups: $(top_builddir)/config.status $(srcdir)/libhidups.in
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
install-hotplugusbSCRIPTS: $(hotplugusb_SCRIPTS)
@$(NORMAL_INSTALL)
test -z "$(hotplugusbdir)" || $(MKDIR_P) "$(DESTDIR)$(hotplugusbdir)"
@list='$(hotplugusb_SCRIPTS)'; test -n "$(hotplugusbdir)" || list=; \
for p in $$list; do \
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \
done | \
sed -e 'p;s,.*/,,;n' \
-e 'h;s|.*|.|' \
-e 'p;x;s,.*/,,;$(transform)' | sed 'N;N;N;s,\n, ,g' | \
$(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1; } \
{ d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
if ($$2 == $$4) { files[d] = files[d] " " $$1; \
if (++n[d] == $(am__install_max)) { \
print "f", d, files[d]; n[d] = 0; files[d] = "" } } \
else { print "f", d "/" $$4, $$1 } } \
END { for (d in files) print "f", d, files[d] }' | \
while read type dir files; do \
if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
test -z "$$files" || { \
echo " $(INSTALL_SCRIPT) $$files '$(DESTDIR)$(hotplugusbdir)$$dir'"; \
$(INSTALL_SCRIPT) $$files "$(DESTDIR)$(hotplugusbdir)$$dir" || exit $$?; \
} \
; done
uninstall-hotplugusbSCRIPTS:
@$(NORMAL_UNINSTALL)
@list='$(hotplugusb_SCRIPTS)'; test -n "$(hotplugusbdir)" || exit 0; \
files=`for p in $$list; do echo "$$p"; done | \
sed -e 's,.*/,,;$(transform)'`; \
test -n "$$list" || exit 0; \
echo " ( cd '$(DESTDIR)$(hotplugusbdir)' && rm -f" $$files ")"; \
cd "$(DESTDIR)$(hotplugusbdir)" && rm -f $$files
mostlyclean-libtool:
-rm -f *.lo
clean-libtool:
-rm -rf .libs _libs
install-dist_hotplugusbDATA: $(dist_hotplugusb_DATA)
@$(NORMAL_INSTALL)
test -z "$(hotplugusbdir)" || $(MKDIR_P) "$(DESTDIR)$(hotplugusbdir)"
@list='$(dist_hotplugusb_DATA)'; test -n "$(hotplugusbdir)" || list=; \
for p in $$list; do \
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
echo "$$d$$p"; \
done | $(am__base_list) | \
while read files; do \
echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(hotplugusbdir)'"; \
$(INSTALL_DATA) $$files "$(DESTDIR)$(hotplugusbdir)" || exit $$?; \
done
uninstall-dist_hotplugusbDATA:
@$(NORMAL_UNINSTALL)
@list='$(dist_hotplugusb_DATA)'; test -n "$(hotplugusbdir)" || list=; \
files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
test -n "$$files" || exit 0; \
echo " ( cd '$(DESTDIR)$(hotplugusbdir)' && rm -f" $$files ")"; \
cd "$(DESTDIR)$(hotplugusbdir)" && rm -f $$files
tags: TAGS
TAGS:
ctags: CTAGS
CTAGS:
distdir: $(DISTFILES)
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
list='$(DISTFILES)'; \
dist_files=`for file in $$list; do echo $$file; done | \
sed -e "s|^$$srcdirstrip/||;t" \
-e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
case $$dist_files in \
*/*) $(MKDIR_P) `echo "$$dist_files" | \
sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
sort -u` ;; \
esac; \
for file in $$dist_files; do \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
if test -d $$d/$$file; then \
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
if test -d "$(distdir)/$$file"; then \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
else \
test -f "$(distdir)/$$file" \
|| cp -p $$d/$$file "$(distdir)/$$file" \
|| exit 1; \
fi; \
done
check-am: all-am
check: check-am
all-am: Makefile $(SCRIPTS) $(DATA)
installdirs:
for dir in "$(DESTDIR)$(hotplugusbdir)" "$(DESTDIR)$(hotplugusbdir)"; do \
test -z "$$dir" || $(MKDIR_P) "$$dir"; \
done
install: install-am
install-exec: install-exec-am
install-data: install-data-am
uninstall: uninstall-am
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
installcheck: installcheck-am
install-strip:
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
`test -z '$(STRIP)' || \
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
mostlyclean-generic:
clean-generic:
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
-test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
clean: clean-am
clean-am: clean-generic clean-libtool mostlyclean-am
distclean: distclean-am
-rm -f Makefile
distclean-am: clean-am distclean-generic
dvi: dvi-am
dvi-am:
html: html-am
html-am:
info: info-am
info-am:
install-data-am: install-dist_hotplugusbDATA install-hotplugusbSCRIPTS
install-dvi: install-dvi-am
install-dvi-am:
install-exec-am:
install-html: install-html-am
install-html-am:
install-info: install-info-am
install-info-am:
install-man:
install-pdf: install-pdf-am
install-pdf-am:
install-ps: install-ps-am
install-ps-am:
installcheck-am:
maintainer-clean: maintainer-clean-am
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-am
mostlyclean-am: mostlyclean-generic mostlyclean-libtool
pdf: pdf-am
pdf-am:
ps: ps-am
ps-am:
uninstall-am: uninstall-dist_hotplugusbDATA \
uninstall-hotplugusbSCRIPTS
.MAKE: install-am install-strip
.PHONY: all all-am check check-am clean clean-generic clean-libtool \
distclean distclean-generic distclean-libtool distdir dvi \
dvi-am html html-am info info-am install install-am \
install-data install-data-am install-dist_hotplugusbDATA \
install-dvi install-dvi-am install-exec install-exec-am \
install-hotplugusbSCRIPTS install-html install-html-am \
install-info install-info-am install-man install-pdf \
install-pdf-am install-ps install-ps-am install-strip \
installcheck installcheck-am installdirs maintainer-clean \
maintainer-clean-generic mostlyclean mostlyclean-generic \
mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am \
uninstall-dist_hotplugusbDATA uninstall-hotplugusbSCRIPTS
# we should never remove this one, apart from a distclean-check
#MAINTAINERCLEANFILES = libhid.usermap
# 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:

37
scripts/hotplug/README Normal file
View file

@ -0,0 +1,37 @@
Desc: Hotplug script for NUT USB drivers
File: scripts/hotplug/README
Date: 8 January 2007
Auth: Arnaud Quette <arnaud.quette@mgeups.com>
This document introduces Linux Hotplug script for NUT USB
drivers (usbhid-ups, bcmxcp_usb and tripplite_usb).
These are needed, on older Linux systems, to ensure the right
privileges are set on the usb files (ie allowing nut user to read AND
write to the UPS device).
Alternative
-----------
For newer 2.6 kernels with the udev mechanism, you should use the
scripts in scripts/udev instead of this one.
Installation
------------
For most users, these files will be automatically installed in
/etc/hotplug upon "make install", if that directory exists. You can
specify an alternate directory by ./configure --with-hotplug-dir=DIR.
Manual installation
-------------------
These scripts can be used with Linux 2.4 to 2.6.13.
- possibly change libhidups to match NUT user
- copy libhidups and libhid.usermap to /etc/hotplug/usb/
- make libhidups executable with:
chmod a+x /etc/hotplug/usb/libhidups
- call update-usb.usermap or equivalent if needed
You can then plug your UPS, and start NUT.

View file

@ -0,0 +1,122 @@
# This file is generated and installed by the Network UPS Tools package.
#
# Sample entry (replace 0xVVVV and 0xPPPP with vendor ID and product ID respectively) :
# libhidups 0x0003 0xVVVV 0xPPPP 0x0000 0x0000 0x00 0x00 0x00 0x00 0x00 0x00 0x00000000
#
# usb module match_flags idVendor idProduct bcdDevice_lo bcdDevice_hi bDeviceClass bDeviceSubClass bDeviceProtocol bInterfaceClass bInterfaceSubClass bInterfaceProtocol driver_info
# Krauler UP-M500VA
libhidups 0x0003 0x0001 0x0000 0x0000 0x0000 0x00 0x00 0x00 0x00 0x00 0x00 0x00000000
# Hewlett Packard
# T500
libhidups 0x0003 0x03f0 0x1f01 0x0000 0x0000 0x00 0x00 0x00 0x00 0x00 0x00 0x00000000
# T750
libhidups 0x0003 0x03f0 0x1f02 0x0000 0x0000 0x00 0x00 0x00 0x00 0x00 0x00 0x00000000
# HP T750 INTL
libhidups 0x0003 0x03f0 0x1f06 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
# Eaton
# various models
libhidups 0x0003 0x0463 0x0001 0x0000 0x0000 0x00 0x00 0x00 0x00 0x00 0x00 0x00000000
# various models
libhidups 0x0003 0x0463 0xffff 0x0000 0x0000 0x00 0x00 0x00 0x00 0x00 0x00 0x00000000
# Dell
# various models
libhidups 0x0003 0x047c 0xffff 0x0000 0x0000 0x00 0x00 0x00 0x00 0x00 0x00 0x00000000
# Belkin
# F6H375-USB
libhidups 0x0003 0x050d 0x0375 0x0000 0x0000 0x00 0x00 0x00 0x00 0x00 0x00 0x00000000
# F6C550-AVR
libhidups 0x0003 0x050d 0x0551 0x0000 0x0000 0x00 0x00 0x00 0x00 0x00 0x00 0x00000000
# F6C1250-TW-RK
libhidups 0x0003 0x050d 0x0750 0x0000 0x0000 0x00 0x00 0x00 0x00 0x00 0x00 0x00000000
# F6C1500-TW-RK
libhidups 0x0003 0x050d 0x0751 0x0000 0x0000 0x00 0x00 0x00 0x00 0x00 0x00 0x00000000
# F6C900-UNV
libhidups 0x0003 0x050d 0x0900 0x0000 0x0000 0x00 0x00 0x00 0x00 0x00 0x00 0x00000000
# F6C100-UNV
libhidups 0x0003 0x050d 0x0910 0x0000 0x0000 0x00 0x00 0x00 0x00 0x00 0x00 0x00000000
# F6C120-UNV
libhidups 0x0003 0x050d 0x0912 0x0000 0x0000 0x00 0x00 0x00 0x00 0x00 0x00 0x00000000
# F6C800-UNV
libhidups 0x0003 0x050d 0x0980 0x0000 0x0000 0x00 0x00 0x00 0x00 0x00 0x00 0x00000000
# F6C1100-UNV, F6C1200-UNV
libhidups 0x0003 0x050d 0x1100 0x0000 0x0000 0x00 0x00 0x00 0x00 0x00 0x00 0x00000000
# APC
# various models
libhidups 0x0003 0x051d 0x0002 0x0000 0x0000 0x00 0x00 0x00 0x00 0x00 0x00 0x00000000
# Powerware
# various models
libhidups 0x0003 0x0592 0x0002 0x0000 0x0000 0x00 0x00 0x00 0x00 0x00 0x00 0x00000000
# Agiler UPS
libhidups 0x0003 0x05b8 0x0000 0x0000 0x0000 0x00 0x00 0x00 0x00 0x00 0x00 0x00000000
# Belkin F6C1200-UNV
libhidups 0x0003 0x0665 0x5161 0x0000 0x0000 0x00 0x00 0x00 0x00 0x00 0x00 0x00000000
# Liebert
# various models
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
# various models
libhidups 0x0003 0x06da 0xffff 0x0000 0x0000 0x00 0x00 0x00 0x00 0x00 0x00 0x00000000
# Cyber Power Systems
# 900AVR/BC900D, CP1200AVR/BC1200D
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
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
# TrippLite
# e.g. OMNIVS1000, SMART550USB, ...
libhidups 0x0003 0x09ae 0x0001 0x0000 0x0000 0x00 0x00 0x00 0x00 0x00 0x00 0x00000000
# e.g. TrippLite AVR550U
libhidups 0x0003 0x09ae 0x1003 0x0000 0x0000 0x00 0x00 0x00 0x00 0x00 0x00 0x00000000
# e.g. TrippLite AVR750U
libhidups 0x0003 0x09ae 0x1007 0x0000 0x0000 0x00 0x00 0x00 0x00 0x00 0x00 0x00000000
# e.g. TrippLite ECO550UPS
libhidups 0x0003 0x09ae 0x1008 0x0000 0x0000 0x00 0x00 0x00 0x00 0x00 0x00 0x00000000
# e.g. TrippLite OMNI1000LCD
libhidups 0x0003 0x09ae 0x2005 0x0000 0x0000 0x00 0x00 0x00 0x00 0x00 0x00 0x00000000
# e.g. TrippLite OMNI900LCD
libhidups 0x0003 0x09ae 0x2007 0x0000 0x0000 0x00 0x00 0x00 0x00 0x00 0x00 0x00000000
# e.g. TrippLite smart2200RMXL2U
libhidups 0x0003 0x09ae 0x3012 0x0000 0x0000 0x00 0x00 0x00 0x00 0x00 0x00 0x00000000
# e.g. ?
libhidups 0x0003 0x09ae 0x3014 0x0000 0x0000 0x00 0x00 0x00 0x00 0x00 0x00 0x00000000
# e.g. TrippLite SmartOnline SU1500RTXL2UA (older unit?)
libhidups 0x0003 0x09ae 0x4001 0x0000 0x0000 0x00 0x00 0x00 0x00 0x00 0x00 0x00000000
# e.g. TrippLite SmartOnline SU6000RT4U?
libhidups 0x0003 0x09ae 0x4002 0x0000 0x0000 0x00 0x00 0x00 0x00 0x00 0x00 0x00000000
# e.g. TrippLite SmartOnline SU1500RTXL2ua
libhidups 0x0003 0x09ae 0x4003 0x0000 0x0000 0x00 0x00 0x00 0x00 0x00 0x00 0x00000000
# PowerCOM
# PowerCOM IMP - IMPERIAL Series
libhidups 0x0003 0x0d9f 0x00a2 0x0000 0x0000 0x00 0x00 0x00 0x00 0x00 0x00 0x00000000
# PowerCOM SKP - Smart KING Pro (all Smart series)
libhidups 0x0003 0x0d9f 0x00a3 0x0000 0x0000 0x00 0x00 0x00 0x00 0x00 0x00 0x00000000
# PowerCOM WOW
libhidups 0x0003 0x0d9f 0x00a4 0x0000 0x0000 0x00 0x00 0x00 0x00 0x00 0x00 0x00000000
# PowerCOM VGD - Vanguard
libhidups 0x0003 0x0d9f 0x00a5 0x0000 0x0000 0x00 0x00 0x00 0x00 0x00 0x00 0x00000000
# PowerCOM BNT - Black Knight Pro
libhidups 0x0003 0x0d9f 0x00a6 0x0000 0x0000 0x00 0x00 0x00 0x00 0x00 0x00 0x00000000
# Unitek Alpha 1200Sx
libhidups 0x0003 0x0f03 0x0001 0x0000 0x0000 0x00 0x00 0x00 0x00 0x00 0x00 0x00000000
# Liebert
# Liebert PowerSure PSA UPS
libhidups 0x0003 0x10af 0x0001 0x0000 0x0000 0x00 0x00 0x00 0x00 0x00 0x00 0x00000000
# Ablerex 625L USB
libhidups 0x0003 0xffff 0x0000 0x0000 0x0000 0x00 0x00 0x00 0x00 0x00 0x00 0x00000000

View file

@ -0,0 +1,17 @@
#!/bin/sh
# This script changes the permissions and ownership of a USB device under
# /proc/bus/usb to grant access to this device to users in the nut group.
#
# Ownership is set to root.@RUN_AS_GROUP@, permissions are set to 0664.
#
# Arguments :
# -----------
# ACTION=[add|remove]
# DEVICE=/proc/bus/usb/BBB/DDD
# TYPE=usb
if [ "$ACTION" = "add" -a "$TYPE" = "usb" ]; then
chown root:@RUN_AS_GROUP@ "$DEVICE"
chmod 0664 "$DEVICE"
fi

View file

@ -0,0 +1,208 @@
# Bash completion function for Network UPS Tools 'upsc' command.
#
# Install in /etc/bash_completion.d (and run '. /etc/bash_completion if this
# has not been done in your startup files already).
#
# Charles Lepple <clepple@gmail>
_nut_local_upses()
{
upsc -l 2>/dev/null
}
_nut_upses()
{
upsc -l 2>/dev/null
# Example syntax:
echo UPS@host:port
# ... could add others from upsmon.conf, etc.
}
###
_nut_upsc_completion()
{
local upses cur
COMPREPLY=()
cur=${COMP_WORDS[COMP_CWORD]}
prev=${COMP_WORDS[COMP_CWORD-1]}
# The 'list' options can take a hostname and a port, but we don't complete
# the port number:
case "$prev" in
-l|-L)
COMPREPLY=( $(compgen -A hostname ${cur}) ) ; return 0 ;;
esac
# If the user starts to type an option, then only offer options for that word:
if [[ "$cur" == -* ]]; then
COMPREPLY=( $(compgen -W "-l -L" -- ${cur}) ) ; return 0
fi
upses="$(_nut_upses)"
COMPREPLY=( $(compgen -W "-l -L $upses" -- ${cur}) )
return 0
}
complete -F _nut_upsc_completion upsc
###
_nut_upscmd_completion()
{
local cur options prev pprev upses
COMPREPLY=()
cur=${COMP_WORDS[COMP_CWORD]}
prev=${COMP_WORDS[COMP_CWORD-1]}
(( COMP_CWORD >= 3 )) && pprev=${COMP_WORDS[COMP_CWORD-3]}
options="-h -l -u -p"
case "$prev" in
-u|-p) # TODO: match against upsd.users, if readable.
COMPREPLY=( ) ; return 0 ;;
-l)
upses="$(_nut_upses)"
COMPREPLY=( $(compgen -W "$upses" -- ${cur}) ) ; return 0 ;;
upscmd)
upses="$(_nut_upses)"
COMPREPLY=( $(compgen -W "$options $upses" -- ${cur}) ) ; return 0 ;;
esac
# If the user starts to type an option, then only offer options for that word:
if [[ "$cur" == -* ]]; then
COMPREPLY=( $(compgen -W "$options" -- ${cur}) ) ; return 0
fi
# If we have hit the end of the command line, then don't try and match the command as a host:
[[ "$pprev" == -* || "$pprev" == "upscmd" ]] && return 0
# Get the list of commands from the UPS named in the previous word:
local cmds
cmds=$(upscmd -l $prev 2>/dev/null | tail -n +3 | sed 's/ - .*//' )
COMPREPLY=( $(compgen -W "$cmds" -- ${cur}) )
return 0
}
complete -F _nut_upscmd_completion upscmd
###
_nut_upsd_completion()
{
local cur options prev
COMPREPLY=()
cur=${COMP_WORDS[COMP_CWORD]}
prev=${COMP_WORDS[COMP_CWORD-1]}
options="-c -D -f -h -r -u -V -4 -6"
case "$prev" in
-c) # commands:
COMPREPLY=( $(compgen -W "reload stop" -- ${cur}) ) ; return 0 ;;
-r) # chroot:
COMPREPLY=( $(compgen -A directory -- ${cur}) ) ; return 0 ;;
-u) # system user, not in upsd.users
COMPREPLY=( $(compgen -u -- ${cur}) ) ; return 0 ;;
esac
# Only options, no other words:
COMPREPLY=( $(compgen -W "$options" -- ${cur}) ) ; return 0
return 0
}
complete -F _nut_upsd_completion upsd
###
_nut_upsdrvctl_completion()
{
local cur options prev upses
COMPREPLY=()
cur=${COMP_WORDS[COMP_CWORD]}
prev=${COMP_WORDS[COMP_CWORD-1]}
options="-h -r -t -u -D"
case "$prev" in
-r) # chroot:
COMPREPLY=( $(compgen -A directory -- ${cur}) ) ; return 0 ;;
-u) # system user, not in upsd.users
COMPREPLY=( $(compgen -u -- ${cur}) ) ; return 0 ;;
start|stop|shutdown)
upses="$(_nut_local_upses)"
COMPREPLY=( $(compgen -W "$upses" -- ${cur}) ) ; return 0 ;;
esac
# If the user starts to type an option, then only offer options for that word:
if [[ "$cur" == -* ]]; then
COMPREPLY=( $(compgen -W "$options" -- ${cur}) ) ; return 0
fi
# Don't auto-complete shutdown because it doesn't usually do what you want (upsmon -c fsd):
COMPREPLY=( $(compgen -W "$options start stop" -- ${cur}) )
return 0
}
complete -F _nut_upsdrvctl_completion upsdrvctl
###
_nut_upsmon_completion()
{
local cur options prev
COMPREPLY=()
cur=${COMP_WORDS[COMP_CWORD]}
prev=${COMP_WORDS[COMP_CWORD-1]}
options="-c -D -h -K -u -4 -6"
case "$prev" in
-c) # commands:
COMPREPLY=( $(compgen -W "fsd reload stop" -- ${cur}) ) ; return 0 ;;
-u) # system user, not in upsd.users
COMPREPLY=( $(compgen -u -- ${cur}) ) ; return 0 ;;
esac
# Only options, no other words:
COMPREPLY=( $(compgen -W "$options" -- ${cur}) ) ; return 0
return 0
}
complete -F _nut_upsmon_completion upsmon
###
_nut_upsrw_completion()
{
local cur options prev upses
COMPREPLY=()
cur=${COMP_WORDS[COMP_CWORD]}
prev=${COMP_WORDS[COMP_CWORD-1]}
options="-s -u -p -h"
upses="$(_nut_upses)"
case "$prev" in
-u|-p) # TODO: match against upsd.users, if readable.
COMPREPLY=( ) ; return 0 ;;
-l)
COMPREPLY=( $(compgen -W "$upses" -- ${cur}) ) ; return 0 ;;
esac
# If the user starts to type an option, then only offer options for that word:
if [[ "$cur" == -* ]]; then
COMPREPLY=( $(compgen -W "$options" -- ${cur}) ) ; return 0
fi
COMPREPLY=( $(compgen -W "$options $upses" -- ${cur}) )
return 0
}
complete -F _nut_upsrw_completion upsrw

35
scripts/misc/osd-notify Normal file
View file

@ -0,0 +1,35 @@
#!/bin/sh
# **********************************************************#
# osd-notify: script to make On Screen Display notification #
# **********************************************************#
# Copyright 2003 - Arnaud Quette #
# Distributed under the GNU GPL v2 #
# See attached file (osd-notify.txt) for usage information #
# **********************************************************#
# select your font with xfontsel
# ******************************
FONT="-adobe-courier-bold-*-*-*-34-*-100-*-*-*-*-*"
# Position
# ********
POSITION="-p middle -A center"
# Delay in seconds
# ****************
DELAY="10"
# Color
# *****
COLOR="red"
# You can use a combination of valid message values:
# $* => for full text
# $UPSNAME => for ups name
# $NOTIFYTYPE => depending on event (ONLINE, ONBATT, ...)
# *********************************************************************
MESSAGE="$*"
# Processing part
# ***************
echo $MESSAGE | osd_cat - -c $COLOR -f $FONT -d $DELAY $POSITION

View file

@ -0,0 +1,11 @@
# Network UPS Tools: data/html
EXTRA_DIST = README \
app/gui.glade \
app/NUT-Monitor \
app/nut-monitor.desktop \
app/nut-monitor.png \
app/README \
module/PyNUT.py \
module/test_nutclient.py

420
scripts/python/Makefile.in Normal file
View file

@ -0,0 +1,420 @@
# Makefile.in generated by automake 1.11 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation,
# Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
@SET_MAKE@
# Network UPS Tools: data/html
VPATH = @srcdir@
pkgdatadir = $(datadir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkglibexecdir = $(libexecdir)/@PACKAGE@
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_HEADER = $(INSTALL_DATA)
transform = $(program_transform_name)
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
target_triplet = @target@
subdir = scripts/python
DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/ax_create_stdint_h.m4 \
$(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \
$(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \
$(top_srcdir)/m4/lt~obsolete.m4 \
$(top_srcdir)/m4/nut_arg_with.m4 \
$(top_srcdir)/m4/nut_check_ipv6.m4 \
$(top_srcdir)/m4/nut_check_libgd.m4 \
$(top_srcdir)/m4/nut_check_libhal.m4 \
$(top_srcdir)/m4/nut_check_libneon.m4 \
$(top_srcdir)/m4/nut_check_libnetsnmp.m4 \
$(top_srcdir)/m4/nut_check_libpowerman.m4 \
$(top_srcdir)/m4/nut_check_libssl.m4 \
$(top_srcdir)/m4/nut_check_libusb.m4 \
$(top_srcdir)/m4/nut_check_libwrap.m4 \
$(top_srcdir)/m4/nut_check_os.m4 \
$(top_srcdir)/m4/nut_report_feature.m4 \
$(top_srcdir)/m4/nut_type_socklen_t.m4 \
$(top_srcdir)/configure.in
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_VPATH_FILES =
SOURCES =
DIST_SOURCES =
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
AR = @AR@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
BINDIR = @BINDIR@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CONFPATH = @CONFPATH@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CYGPATH_W = @CYGPATH_W@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
DRIVER_BUILD_LIST = @DRIVER_BUILD_LIST@
DRIVER_INSTALL_TARGET = @DRIVER_INSTALL_TARGET@
DRIVER_MAN_LIST = @DRIVER_MAN_LIST@
DSYMUTIL = @DSYMUTIL@
DUMPBIN = @DUMPBIN@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
FGREP = @FGREP@
GREP = @GREP@
HAL_CALLOUTS_PATH = @HAL_CALLOUTS_PATH@
HAL_DEVICE_MATCH_KEY = @HAL_DEVICE_MATCH_KEY@
HAL_FDI_PATH = @HAL_FDI_PATH@
HAL_USER = @HAL_USER@
HAVE_GLIB_2_14 = @HAVE_GLIB_2_14@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
LD = @LD@
LDFLAGS = @LDFLAGS@
LIBGD_CFLAGS = @LIBGD_CFLAGS@
LIBGD_LDFLAGS = @LIBGD_LDFLAGS@
LIBHAL_CFLAGS = @LIBHAL_CFLAGS@
LIBHAL_LDFLAGS = @LIBHAL_LDFLAGS@
LIBNEON_CFLAGS = @LIBNEON_CFLAGS@
LIBNEON_LDFLAGS = @LIBNEON_LDFLAGS@
LIBNETSNMP_CFLAGS = @LIBNETSNMP_CFLAGS@
LIBNETSNMP_LDFLAGS = @LIBNETSNMP_LDFLAGS@
LIBOBJS = @LIBOBJS@
LIBPOWERMAN_CFLAGS = @LIBPOWERMAN_CFLAGS@
LIBPOWERMAN_LDFLAGS = @LIBPOWERMAN_LDFLAGS@
LIBS = @LIBS@
LIBSSL_CFLAGS = @LIBSSL_CFLAGS@
LIBSSL_LDFLAGS = @LIBSSL_LDFLAGS@
LIBTOOL = @LIBTOOL@
LIBUSB_CFLAGS = @LIBUSB_CFLAGS@
LIBUSB_LDFLAGS = @LIBUSB_LDFLAGS@
LIBWRAP_CFLAGS = @LIBWRAP_CFLAGS@
LIBWRAP_LDFLAGS = @LIBWRAP_LDFLAGS@
LIPO = @LIPO@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
MKDIR_P = @MKDIR_P@
NETLIBS = @NETLIBS@
NM = @NM@
NMEDIT = @NMEDIT@
OBJDUMP = @OBJDUMP@
OBJEXT = @OBJEXT@
OS_NAME = @OS_NAME@
OTOOL = @OTOOL@
OTOOL64 = @OTOOL64@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
RANLIB = @RANLIB@
RUN_AS_GROUP = @RUN_AS_GROUP@
RUN_AS_USER = @RUN_AS_USER@
SED = @SED@
SERLIBS = @SERLIBS@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STATEPATH = @STATEPATH@
STRIP = @STRIP@
SUN_LIBUSB = @SUN_LIBUSB@
VERSION = @VERSION@
WORDS_BIGENDIAN = @WORDS_BIGENDIAN@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
abs_top_srcdir = @abs_top_srcdir@
ac_ct_CC = @ac_ct_CC@
ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
am__tar = @am__tar@
am__untar = @am__untar@
bindir = @bindir@
build = @build@
build_alias = @build_alias@
build_cpu = @build_cpu@
build_os = @build_os@
build_vendor = @build_vendor@
builddir = @builddir@
cgiexecdir = @cgiexecdir@
datadir = @datadir@
datarootdir = @datarootdir@
docdir = @docdir@
driverexecdir = @driverexecdir@
dvidir = @dvidir@
exec_prefix = @exec_prefix@
host = @host@
host_alias = @host_alias@
host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
hotplugdir = @hotplugdir@
htmldir = @htmldir@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
localedir = @localedir@
localstatedir = @localstatedir@
lt_ECHO = @lt_ECHO@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
pdfdir = @pdfdir@
pkgconfigdir = @pkgconfigdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
sysconfdir = @sysconfdir@
target = @target@
target_alias = @target_alias@
target_cpu = @target_cpu@
target_os = @target_os@
target_vendor = @target_vendor@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
udevdir = @udevdir@
EXTRA_DIST = README \
app/gui.glade \
app/NUT-Monitor \
app/nut-monitor.desktop \
app/nut-monitor.png \
app/README \
module/PyNUT.py \
module/test_nutclient.py
all: all-am
.SUFFIXES:
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
&& { if test -f $@; then exit 0; else break; fi; }; \
exit 1;; \
esac; \
done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu scripts/python/Makefile'; \
$(am__cd) $(top_srcdir) && \
$(AUTOMAKE) --gnu scripts/python/Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
*) \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(am__aclocal_m4_deps):
mostlyclean-libtool:
-rm -f *.lo
clean-libtool:
-rm -rf .libs _libs
tags: TAGS
TAGS:
ctags: CTAGS
CTAGS:
distdir: $(DISTFILES)
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
list='$(DISTFILES)'; \
dist_files=`for file in $$list; do echo $$file; done | \
sed -e "s|^$$srcdirstrip/||;t" \
-e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
case $$dist_files in \
*/*) $(MKDIR_P) `echo "$$dist_files" | \
sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
sort -u` ;; \
esac; \
for file in $$dist_files; do \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
if test -d $$d/$$file; then \
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
if test -d "$(distdir)/$$file"; then \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
else \
test -f "$(distdir)/$$file" \
|| cp -p $$d/$$file "$(distdir)/$$file" \
|| exit 1; \
fi; \
done
check-am: all-am
check: check-am
all-am: Makefile
installdirs:
install: install-am
install-exec: install-exec-am
install-data: install-data-am
uninstall: uninstall-am
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
installcheck: installcheck-am
install-strip:
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
`test -z '$(STRIP)' || \
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
mostlyclean-generic:
clean-generic:
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
clean: clean-am
clean-am: clean-generic clean-libtool mostlyclean-am
distclean: distclean-am
-rm -f Makefile
distclean-am: clean-am distclean-generic
dvi: dvi-am
dvi-am:
html: html-am
html-am:
info: info-am
info-am:
install-data-am:
install-dvi: install-dvi-am
install-dvi-am:
install-exec-am:
install-html: install-html-am
install-html-am:
install-info: install-info-am
install-info-am:
install-man:
install-pdf: install-pdf-am
install-pdf-am:
install-ps: install-ps-am
install-ps-am:
installcheck-am:
maintainer-clean: maintainer-clean-am
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-am
mostlyclean-am: mostlyclean-generic mostlyclean-libtool
pdf: pdf-am
pdf-am:
ps: ps-am
ps-am:
uninstall-am:
.MAKE: install-am install-strip
.PHONY: all all-am check check-am clean clean-generic clean-libtool \
distclean distclean-generic distclean-libtool distdir dvi \
dvi-am html html-am info info-am install install-am \
install-data install-data-am install-dvi install-dvi-am \
install-exec install-exec-am install-html install-html-am \
install-info install-info-am install-man install-pdf \
install-pdf-am install-ps install-ps-am install-strip \
installcheck installcheck-am installdirs maintainer-clean \
maintainer-clean-generic mostlyclean mostlyclean-generic \
mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am
# 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:

32
scripts/python/README Normal file
View file

@ -0,0 +1,32 @@
Python NUT Client files
-----------------------
This directory contains various NUT Client related Python scripts, written by
David Goncalves, and released under GPL v3.
* "module": this directory contains PyNUT.py, which is a Python abstraction
class to access NUT server(s). You can use it in Python programs to access NUT's
upsd data server in a simple way, without having to know the NUT protocol.
To import it on Python programs you have to use the following (case sensitive) :
'import PyNUT'
This module provides a 'PyNUTClient' class that can be used to connect and get
data from an upsd data server.
To install the PyNUT module on Debian/Ubuntu, copy it to:
/usr/share/python-support/python-pynut/
This directory also contains test_nutclient.py, which is a PyNUT test program.
For this to be fully functional, you will need to adapt the login, password and
upsname to fit your configuration.
* "app": this directory contains the NUT-Monitor application, that uses the
PyNUT class, along with its resources.
To install it, you will either need to keep the files together, or to install:
- NUT-Monitor to /usr/bin, /usr/X11R6/bin/ or something like that,
- gui.glade to /usr/share/nut-monitor/,
- nut-monitor.png to something like /usr/share/pixmaps/
- and nut-monitor.desktop to /usr/share/applications

423
scripts/python/app/NUT-Monitor Executable file
View file

@ -0,0 +1,423 @@
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright (C) 2008 David Goncalves <david@lestat.st>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# 2008-02-01 David Goncalves
# A gui to monitor UPSes via NUT using PyNUT class.
# 2009-02-12 David Goncalves
# Modified the status report method to allow 'composite' UPS status
# ( OL + TRIM, OL + OFF, etc... )
import gtk, gtk.glade, gobject, pango
import sys, os, time
import threading
import PyNUT
# Activate use of threadings
gobject.threads_init()
class gui :
__widgets = {}
__callbacks = {}
__ups_handler = None
__ups_thread = None
__ups_name = ""
__ups_commands = list()
__ups_connected = False
__version = "1.1"
__release = "2009-02-12"
def __init__( self ) :
if os.path.exists( "gui.glade" ) :
glade_file = "gui.glade"
else :
glade_file = "/usr/share/nut-monitor/gui.glade"
self.__widgets["interface"] = gtk.glade.XML( glade_file )
self.__widgets["main_window"] = self.__widgets["interface"].get_widget("window1")
self.__widgets["button_ups_refresh"] = self.__widgets["interface"].get_widget("button1")
self.__widgets["button_ups_connect"] = self.__widgets["interface"].get_widget("button2")
self.__widgets["button_ups_disconnect"] = self.__widgets["interface"].get_widget("button4")
self.__widgets["button_ups_list"] = self.__widgets["interface"].get_widget("combobox1")
self.__widgets["button_ups_command_list"] = self.__widgets["interface"].get_widget("combobox3")
self.__widgets["button_ups_command_apply"] = self.__widgets["interface"].get_widget("button3")
self.__widgets["button_authentication"] = self.__widgets["interface"].get_widget("checkbutton1")
self.__widgets["entry_login"] = self.__widgets["interface"].get_widget("entry2")
self.__widgets["entry_password"] = self.__widgets["interface"].get_widget("entry3")
self.__widgets["login_password_frame"] = self.__widgets["interface"].get_widget("hbox2")
self.__widgets["entry_host"] = self.__widgets["interface"].get_widget("entry1")
self.__widgets["entry_port"] = self.__widgets["interface"].get_widget("spinbutton1")
self.__widgets["progress_battery_charge"] = self.__widgets["interface"].get_widget("progressbar1")
self.__widgets["progress_ups_load"] = self.__widgets["interface"].get_widget("progressbar2")
self.__widgets["label_battery_runtime"] = self.__widgets["interface"].get_widget("label2")
self.__widgets["label_ups_infos_left"] = self.__widgets["interface"].get_widget("label15")
self.__widgets["label_ups_infos_right"] = self.__widgets["interface"].get_widget("label16")
self.__widgets["status_bar"] = self.__widgets["interface"].get_widget("statusbar1")
self.__widgets["ups_status_frame"] = self.__widgets["interface"].get_widget("frame1")
self.__widgets["ups_hostport_table"] = self.__widgets["interface"].get_widget("table1")
self.__widgets["main_window"].show()
# Define the callbacks
self.__callbacks = { "on_window1_destroy" : self.quit,
"on_imagemenuitem5_activate" : self.quit,
"on_imagemenuitem2_activate" : self.about,
"on_entry1_changed" : self.__host_changed,
"on_entry2_changed" : self.__login_pass_changed,
"on_entry3_changed" : self.__login_pass_changed,
"on_button1_clicked" : self.__gui_refresh_ups_list,
"on_button2_clicked" : self.__connect_to_ups,
"on_button3_clicked" : self.__apply_ups_command,
"on_button4_clicked" : self.__disconnect_from_ups,
"on_checkbutton1_toggled" : self.__use_authentication_changed
}
# Removes the dummy entry in the combobox
self.__widgets["button_ups_list"].remove_text( 0 )
self.__widgets["button_ups_command_list"].remove_text( 0 )
# Connect the callbacks
self.__widgets["interface"].signal_autoconnect( self.__callbacks )
def run( self ) :
gtk.main()
def about( self, widget=None ) :
dial = self.__widgets["interface"].get_widget( "aboutdialog1" )
dial.run()
dial.destroy()
def quit( self, widget=None ) :
try :
if self.__ups_thread.isAlive() :
self.__ups_thread.stop_thread()
self.__ups_thread.join()
except :
pass
gtk.main_quit()
def refresh_gui( self ) :
while gtk.events_pending() :
gtk.main_iteration( False )
return( True )
# If host string is modified, check if there is a value to activate the "Refresh" button.
def __host_changed( self, widget=None ) :
value = widget.get_text()
if value != "" :
self.__widgets["button_ups_refresh"].set_sensitive( True )
self.__widgets["button_authentication"].set_sensitive( True )
if self.__widgets["button_authentication"].toggled() :
self.__widgets["login_password_frame"].set_sensitive( True )
if self.__widgets["button_ups_list"].get_active() != -1 :
self.__widgets["button_ups_connect"].set_sensitive( True )
else :
self.__widgets["button_ups_refresh"].set_sensitive( False )
self.__widgets["button_ups_connect"].set_sensitive( False )
self.__widgets["button_authentication"].set_sensitive( False )
self.__widgets["login_password_frame"].set_sensitive( False )
def __use_authentication_changed( self, widget=None ) :
if widget.get_active() :
self.__widgets["login_password_frame"].set_sensitive( True )
# Clear UPS List
while self.__widgets["button_ups_list"].get_active() != -1 :
self.__widgets["button_ups_list"].remove_text( 0 )
self.__widgets["button_ups_list"].set_active( 0 )
self.__widgets["button_ups_connect"].set_sensitive( False )
if ( self.__widgets["entry_login"].get_text() == "" ) or ( self.__widgets["entry_password"].get_text() == "" ) :
self.__widgets["button_ups_refresh"].set_sensitive( False )
else :
self.__widgets["button_ups_refresh"].set_sensitive( True )
else :
self.__widgets["login_password_frame"].set_sensitive( False )
self.__widgets["button_ups_refresh"].set_sensitive( True )
def __login_pass_changed( self, widget=None ) :
# Get the values for login/pass fields in order to check that there is something typed
self.__host_changed( self.__widgets["entry_host"] )
def __gui_refresh_ups_list( self, widget=None ) :
host = self.__widgets["entry_host"].get_text()
port = int( self.__widgets["entry_port"].get_value() )
try :
# If the authentication is active, try to log into the UPS using login/password
if self.__widgets["button_authentication"].get_active() :
login = self.__widgets["entry_login"].get_text()
password = self.__widgets["entry_password"].get_text()
else :
login = None
password = None
self.__ups_handler = PyNUT.PyNUTClient( host=host, port=port, login=login, password=password )
result = self.__ups_handler.GetUPSList()
# Clear UPS List
while self.__widgets["button_ups_list"].get_active() != -1 :
self.__widgets["button_ups_list"].remove_text( 0 )
self.__widgets["button_ups_list"].set_active( 0 )
if len( result.keys() ) > 0 :
for current_ups in result.keys() :
self.__widgets["button_ups_list"].append_text( current_ups )
self.__widgets["button_ups_list"].set_active( 0 )
self.__widgets["button_ups_refresh"].set_sensitive( False )
self.__widgets["button_ups_connect"].set_sensitive( True )
self.__widgets["button_authentication"].set_sensitive( False )
self.__widgets["login_password_frame"].set_sensitive( False )
except :
self.status_message( "%s : %s" % ( sys.exc_info()[0], sys.exc_info()[1] ) )
def __gui_refresh_ups_commands( self, widget=None ) :
# Clear the command list
while self.__widgets["button_ups_command_list"].get_active() != -1 :
self.__widgets["button_ups_command_list"].remove_text( 0 )
self.__widgets["button_ups_command_list"].set_active( 0 )
self.__ups_commands = list()
try :
commands = self.__ups_handler.GetUPSCommands( self.__ups_name )
self.__ups_commands = commands.keys()
self.__ups_commands.sort()
for desc in self.__ups_commands :
self.__widgets["button_ups_command_list"].append_text( commands[desc] )
self.__widgets["button_ups_command_list"].set_active( 0 )
self.__widgets["button_ups_command_apply"].set_sensitive( True )
except :
self.__widgets["button_ups_command_apply"].set_sensitive( False )
def __disconnect_from_ups( self, widget=None ) :
if self.__ups_thread.isAlive() :
self.__ups_thread.stop_thread()
self.__ups_thread.join()
def __apply_ups_command( self, widget=None ) :
id = self.__widgets["button_ups_command_list"].get_active()
# Display a confirmation dialog
dial = gtk.MessageDialog( parent=self.__widgets["main_window"],
flags=gtk.DIALOG_MODAL,
type=gtk.MESSAGE_INFO,
buttons=gtk.BUTTONS_YES_NO,
message_format=None )
dial.set_markup( "<span size=\"x-large\"><b>Action confirmation</b></span>" )
msg = "Are you sur that you want to perform a <span foreground=\"#900000\"><b>%s</b></span> on <span foreground=\"#009000\"><b>%s</b></span> ?\n" % ( self.__ups_commands[id], self.__ups_name )
dial.format_secondary_markup( msg )
resp = dial.run()
dial.destroy()
if resp == gtk.RESPONSE_YES :
try :
self.__ups_handler.RunUPSCommand( self.__ups_name, self.__ups_commands[id] )
except :
self.error_message( "<span size=\"x-large\"><b>Send command failed</b></span>", "Something went wrong while sending command to server.\n\n<span foreground=\"#900000\">%s</span>" % sys.exc_info()[1] )
# When the 'connect' button is clicked...
def __connect_to_ups( self, widget=None ) :
# Get the selected UPS name
self.__ups_name = self.__widgets["button_ups_list"].get_active_text()
self.__ups_thread = ups_updater( self )
self.__ups_thread.start()
def error_message( self, message1 = "", message2 = "" ) :
dial = gtk.MessageDialog( parent=self.__widgets["main_window"], flags=gtk.DIALOG_MODAL, type=gtk.MESSAGE_WARNING,
buttons=gtk.BUTTONS_CLOSE, message_format=None )
dial.set_markup( message1 )
dial.format_secondary_markup( message2 )
dial.run()
dial.destroy()
def status_message( self, message = "" ) :
context_id = self.__widgets["status_bar"].get_context_id("Infos")
message_id = self.__widgets["status_bar"].push( context_id, message )
self.refresh_gui()
class ups_updater( threading.Thread ) :
__parent_class = None
__stop_thread = False
__ups_status_mapper = { "LB" : "<span color=\"#BB0000\"><b>Low batteries</b></span>",
"RB" : "<span color=\"#FF0000\"><b>Replace batteries !</b></span>",
"BYPASS" : "<span color=\"#BB0000\">Running bypass</span> <i>(no battery protection)</i>",
"CAL" : "Performing runtime calibration",
"OFF" : "<span color=\"#000090\">output offline</span> <i>(not providing power to the load)</i>",
"OVER" : "<span color=\"#BB0000\">Overloaded !</span> <i>(there is too much load for UPS)</i>",
"TRIM" : "Triming <i>(UPS is triming incoming voltage)</i>",
"BOOST" : "Boost <i>(UPS is boosting incoming voltage)</i>"
}
def __init__( self, parent_class ) :
threading.Thread.__init__( self )
self.__parent_class = parent_class
def run( self ) :
self.__parent_class.status_message( "Connecting to %s" % self.__parent_class._gui__ups_name )
self.__parent_class._gui__gui_refresh_ups_commands()
while not self.__stop_thread :
vars = {}
try :
vars = self.__parent_class._gui__ups_handler.GetUPSVars( self.__parent_class._gui__ups_name )
self.__parent_class.status_message( "Connected to %s" % self.__parent_class._gui__ups_name )
self.__parent_class._gui__widgets["ups_status_frame"].set_sensitive( True )
self.__parent_class._gui__widgets["ups_hostport_table"].set_sensitive( False )
self.__parent_class._gui__widgets["button_ups_connect"].hide()
self.__parent_class._gui__widgets["button_ups_disconnect"].show()
self.__parent_class._gui__widgets["button_authentication"].set_sensitive( False )
self.__parent_class._gui__widgets["login_password_frame"].set_sensitive( False )
# Update the battery charge progress bar
if not vars.has_key( "battery.charge" ) :
self.__parent_class._gui__widgets["progress_battery_charge"].set_fraction( 0.0 )
self.__parent_class._gui__widgets["progress_battery_charge"].set_text( "Not available" )
else :
charge = vars.get( "battery.charge", "0" )
self.__parent_class._gui__widgets["progress_battery_charge"].set_fraction( float( charge ) / 100.0 )
self.__parent_class._gui__widgets["progress_battery_charge"].set_text( "%s %%" % int( float( charge ) ) )
# Update the UPS load progress bar
if not vars.has_key( "ups.load" ) :
self.__parent_class._gui__widgets["progress_ups_load"].set_fraction( 0.0 )
self.__parent_class._gui__widgets["progress_ups_load"].set_text( "Not available" )
else :
load = vars.get( "ups.load", "0" )
self.__parent_class._gui__widgets["progress_ups_load"].set_fraction( float( load ) / 100.0 )
self.__parent_class._gui__widgets["progress_ups_load"].set_text( "%s %%" % int( float( load ) ) )
# Update the UPS remaining battery time
if not vars.has_key( "battery.runtime" ) :
self.__parent_class._gui__widgets["label_battery_runtime"].set_text( "Not available" )
else :
runtime = int( float( vars.get( "battery.runtime", "0" ) ) )
H = runtime / 3600
M = ( runtime - ( H * 3600 ) ) / 60
S = runtime - ( H * 3600 ) - ( M * 60 )
if H > 0 :
string = "%s hour(s) %s minutes %s seconds" % ( H, M, S )
elif ( H == 0 ) and ( M > 0 ) :
string = "%s minutes %s seconds" % ( M, S )
else :
string = "%s seconds" % S
self.__parent_class._gui__widgets["label_battery_runtime"].set_text( string )
text_left = ""
text_right = ""
# Update UPS informations fields
if vars.has_key("ups.status") :
text_left += "<b>UPS Status :</b>\n\n"
if vars["ups.status"].find( "OL" ) != -1 :
# UPS is online
text_right += "<span color=\"#009000\">Online</span>"
if vars["ups.status"].find( "OB" ) != -1 :
# UPS is on batteries
text_right += "<span color=\"#900000\">On batteries</span>"
# Check for additionnal informations
for k,v in self.__ups_status_mapper.iteritems() :
if vars["ups.status"].find(k) != -1 :
text_right += " - %s" % v
text_right += "\n\n"
text_left += "<b>UPS Model :</b>\n"
if vars.has_key("ups.mfr") :
text_right += "%s " % vars.get( "ups.mfr", "" )
if vars.has_key("ups.model") :
text_right += "%s\n" % vars.get( "ups.model", "" )
if vars.has_key("ups.serial") :
text_left += "<b>S/N :</b>\n"
text_right += "%s\n" % vars.get( "ups.serial", "" )
if vars.has_key("ups.id") :
text_left += "<b>Identifier :</b>\n"
text_right += "%s\n" % vars.get( "ups.id", "" )
if vars.has_key("ups.temperature") :
text_left += "<b>Temperature :</b>\n"
text_right += "%s\n" % int( float( vars.get( "ups.temperature", 0 ) ) )
if vars.has_key("battery.voltage") :
text_left += "<b>Battery voltage :</b>\n"
text_right += "%sv\n" % vars.get( "battery.voltage", "0" )
self.__parent_class._gui__widgets["label_ups_infos_left"].set_markup( text_left[:-1] )
self.__parent_class._gui__widgets["label_ups_infos_right"].set_markup( text_right[:-1] )
except :
self.__parent_class.status_message( repr(sys.exc_info()[1]) )
self.__parent_class._gui__widgets["ups_status_frame"].set_sensitive( False )
time.sleep( 1 )
# The thread stops...
self.__parent_class._gui__widgets["ups_status_frame"].set_sensitive( False )
self.__parent_class._gui__widgets["ups_hostport_table"].set_sensitive( True )
self.__parent_class._gui__widgets["button_ups_disconnect"].hide()
self.__parent_class._gui__widgets["button_ups_connect"].show()
self.__parent_class.status_message( "Disconnected from %s" % self.__parent_class._gui__ups_name )
# Clear all data fields
self.__parent_class._gui__widgets["label_ups_infos_right"].set_markup( "" )
self.__parent_class._gui__widgets["label_battery_runtime"].set_text( "" )
self.__parent_class._gui__widgets["progress_battery_charge"].set_fraction( 0.0 )
self.__parent_class._gui__widgets["progress_ups_load"].set_fraction( 0.0 )
self.__parent_class._gui__widgets["progress_battery_charge"].set_text( "0 %" )
self.__parent_class._gui__widgets["progress_ups_load"].set_text( "0 %" )
def stop_thread( self ) :
self.__stop_thread = True
if __name__ == "__main__" :
app = gui()
app.run()

View file

@ -0,0 +1,7 @@
NUT-Monitor is a graphical application to access and manager UPSes connected to
a NUT (Network UPS Tools) server.
This application (written in Python + GTK) uses the python-pynut class
(available at http://www.lestat.st)
David Goncalves <david@lestat.st>

View file

@ -0,0 +1,658 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE glade-interface SYSTEM "glade-2.0.dtd">
<!--Generated with glade3 3.4.5 on Tue Jun 24 14:36:50 2008 -->
<glade-interface>
<widget class="GtkWindow" id="window1">
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<signal name="destroy" handler="on_window1_destroy"/>
<child>
<widget class="GtkVBox" id="vbox1">
<property name="visible">True</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<child>
<widget class="GtkMenuBar" id="menubar1">
<property name="visible">True</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<child>
<widget class="GtkMenuItem" id="menuitem1">
<property name="visible">True</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<property name="label" translatable="yes">_File</property>
<property name="use_underline">True</property>
<child>
<widget class="GtkMenu" id="menu1">
<property name="visible">True</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<child>
<widget class="GtkImageMenuItem" id="imagemenuitem2">
<property name="visible">True</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<property name="label" translatable="yes">gtk-about</property>
<property name="use_underline">True</property>
<property name="use_stock">True</property>
<signal name="activate" handler="on_imagemenuitem2_activate"/>
</widget>
</child>
<child>
<widget class="GtkImageMenuItem" id="imagemenuitem5">
<property name="visible">True</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<property name="label" translatable="yes">gtk-quit</property>
<property name="use_underline">True</property>
<property name="use_stock">True</property>
<signal name="activate" handler="on_imagemenuitem5_activate"/>
</widget>
</child>
</widget>
</child>
</widget>
</child>
</widget>
<packing>
<property name="expand">False</property>
</packing>
</child>
<child>
<widget class="GtkVBox" id="vbox2">
<property name="visible">True</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<child>
<widget class="GtkFrame" id="frame3">
<property name="visible">True</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<property name="label_xalign">0.5</property>
<child>
<widget class="GtkAlignment" id="alignment3">
<property name="visible">True</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<property name="top_padding">2</property>
<property name="bottom_padding">2</property>
<property name="left_padding">2</property>
<property name="right_padding">2</property>
<child>
<widget class="GtkVBox" id="vbox3">
<property name="visible">True</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<child>
<widget class="GtkTable" id="table1">
<property name="visible">True</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<property name="n_rows">2</property>
<property name="n_columns">3</property>
<child>
<widget class="GtkLabel" id="label4">
<property name="visible">True</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<property name="xalign">1</property>
<property name="label" translatable="yes">Host / Port : </property>
</widget>
<packing>
<property name="x_options">GTK_FILL</property>
<property name="y_options">GTK_FILL</property>
</packing>
</child>
<child>
<widget class="GtkLabel" id="label6">
<property name="visible">True</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<property name="xalign">1</property>
<property name="label" translatable="yes">UPS : </property>
</widget>
<packing>
<property name="top_attach">1</property>
<property name="bottom_attach">2</property>
<property name="x_options">GTK_FILL</property>
<property name="y_options">GTK_FILL</property>
</packing>
</child>
<child>
<widget class="GtkSpinButton" id="spinbutton1">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<property name="adjustment">3493 0 65535 1 10 10</property>
<property name="numeric">True</property>
</widget>
<packing>
<property name="left_attach">2</property>
<property name="right_attach">3</property>
<property name="x_options">GTK_FILL</property>
<property name="y_options">GTK_FILL</property>
</packing>
</child>
<child>
<widget class="GtkButton" id="button1">
<property name="visible">True</property>
<property name="sensitive">False</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<property name="tooltip_text">Get list of UPSs from server</property>
<property name="label" translatable="yes">gtk-refresh</property>
<property name="use_stock">True</property>
<property name="response_id">0</property>
<signal name="clicked" handler="on_button1_clicked"/>
</widget>
<packing>
<property name="left_attach">2</property>
<property name="right_attach">3</property>
<property name="top_attach">1</property>
<property name="bottom_attach">2</property>
<property name="x_options">GTK_FILL</property>
<property name="y_options">GTK_FILL</property>
</packing>
</child>
<child>
<widget class="GtkEntry" id="entry1">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<signal name="changed" handler="on_entry1_changed"/>
</widget>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
<property name="y_options">GTK_FILL</property>
</packing>
</child>
<child>
<widget class="GtkComboBox" id="combobox1">
<property name="visible">True</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<property name="items" translatable="yes">&lt;None&gt;
</property>
</widget>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
<property name="top_attach">1</property>
<property name="bottom_attach">2</property>
<property name="y_options">GTK_FILL</property>
</packing>
</child>
</widget>
<packing>
<property name="expand">False</property>
</packing>
</child>
<child>
<widget class="GtkCheckButton" id="checkbutton1">
<property name="visible">True</property>
<property name="sensitive">False</property>
<property name="can_focus">True</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<property name="label" translatable="yes">Use authentication</property>
<property name="response_id">0</property>
<property name="draw_indicator">True</property>
<signal name="toggled" handler="on_checkbutton1_toggled"/>
</widget>
<packing>
<property name="expand">False</property>
<property name="position">1</property>
</packing>
</child>
<child>
<widget class="GtkHBox" id="hbox2">
<property name="visible">True</property>
<property name="sensitive">False</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<child>
<widget class="GtkLabel" id="label10">
<property name="visible">True</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<property name="xalign">1</property>
<property name="label" translatable="yes">Login / Password : </property>
</widget>
</child>
<child>
<widget class="GtkEntry" id="entry2">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<signal name="changed" handler="on_entry2_changed"/>
</widget>
<packing>
<property name="expand">False</property>
<property name="position">1</property>
</packing>
</child>
<child>
<widget class="GtkEntry" id="entry3">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<property name="visibility">False</property>
<signal name="changed" handler="on_entry3_changed"/>
</widget>
<packing>
<property name="expand">False</property>
<property name="position">2</property>
</packing>
</child>
</widget>
<packing>
<property name="position">2</property>
</packing>
</child>
<child>
<widget class="GtkHSeparator" id="hseparator1">
<property name="visible">True</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
</widget>
<packing>
<property name="expand">False</property>
<property name="padding">4</property>
<property name="position">3</property>
</packing>
</child>
<child>
<widget class="GtkHBox" id="hbox1">
<property name="visible">True</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<child>
<widget class="GtkButton" id="button2">
<property name="visible">True</property>
<property name="sensitive">False</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<property name="tooltip" translatable="yes">Connect to the selected UPS</property>
<property name="label" translatable="yes">gtk-connect</property>
<property name="use_stock">True</property>
<property name="response_id">0</property>
<signal name="clicked" handler="on_button2_clicked"/>
</widget>
<packing>
<property name="expand">False</property>
</packing>
</child>
<child>
<widget class="GtkButton" id="button4">
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<property name="label" translatable="yes">gtk-disconnect</property>
<property name="use_stock">True</property>
<property name="response_id">0</property>
<signal name="clicked" handler="on_button4_clicked"/>
</widget>
<packing>
<property name="expand">False</property>
<property name="position">1</property>
</packing>
</child>
<child>
<widget class="GtkLabel" id="label7">
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<property name="xalign">1</property>
<property name="label" translatable="yes">Delay between refresh : </property>
</widget>
<packing>
<property name="position">2</property>
</packing>
</child>
<child>
<widget class="GtkSpinButton" id="spinbutton2">
<property name="can_focus">True</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<property name="tooltip_text">Delay in seconds between refreshs</property>
<property name="adjustment">0.5 0.5 10 0.10000000000000001 10 10</property>
<property name="digits">1</property>
</widget>
<packing>
<property name="expand">False</property>
<property name="position">3</property>
</packing>
</child>
</widget>
<packing>
<property name="expand">False</property>
<property name="position">4</property>
</packing>
</child>
</widget>
</child>
</widget>
</child>
<child>
<widget class="GtkLabel" id="label3">
<property name="visible">True</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<property name="label" translatable="yes"> NUT Server </property>
<property name="use_markup">True</property>
</widget>
<packing>
<property name="type">label_item</property>
</packing>
</child>
</widget>
<packing>
<property name="expand">False</property>
</packing>
</child>
<child>
<widget class="GtkFrame" id="frame1">
<property name="visible">True</property>
<property name="sensitive">False</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<property name="label_xalign">0.5</property>
<child>
<widget class="GtkAlignment" id="alignment1">
<property name="visible">True</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<property name="top_padding">2</property>
<property name="bottom_padding">2</property>
<property name="left_padding">2</property>
<property name="right_padding">2</property>
<child>
<widget class="GtkTable" id="table2">
<property name="visible">True</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<property name="n_rows">5</property>
<property name="n_columns">2</property>
<child>
<widget class="GtkHBox" id="hbox4">
<property name="visible">True</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<child>
<widget class="GtkComboBox" id="combobox3">
<property name="visible">True</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<property name="items" translatable="yes">&lt;None&gt;
</property>
</widget>
</child>
<child>
<widget class="GtkButton" id="button3">
<property name="visible">True</property>
<property name="sensitive">False</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<property name="label" translatable="yes">gtk-apply</property>
<property name="use_stock">True</property>
<property name="response_id">0</property>
<signal name="clicked" handler="on_button3_clicked"/>
</widget>
<packing>
<property name="expand">False</property>
<property name="position">1</property>
</packing>
</child>
</widget>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
<property name="top_attach">4</property>
<property name="bottom_attach">5</property>
</packing>
</child>
<child>
<widget class="GtkLabel" id="label13">
<property name="visible">True</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<property name="xalign">1</property>
<property name="label" translatable="yes">UPS Commands : </property>
</widget>
<packing>
<property name="top_attach">4</property>
<property name="bottom_attach">5</property>
<property name="x_options">GTK_FILL</property>
</packing>
</child>
<child>
<widget class="GtkFrame" id="frame5">
<property name="visible">True</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<property name="label_xalign">0</property>
<property name="label_yalign">0</property>
<property name="shadow_type">GTK_SHADOW_IN</property>
<child>
<widget class="GtkHBox" id="hbox3">
<property name="visible">True</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<property name="spacing">4</property>
<child>
<widget class="GtkLabel" id="label15">
<property name="visible">True</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<property name="xalign">1</property>
<property name="use_markup">True</property>
<property name="justify">GTK_JUSTIFY_RIGHT</property>
</widget>
<packing>
<property name="expand">False</property>
</packing>
</child>
<child>
<widget class="GtkLabel" id="label16">
<property name="visible">True</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<property name="xalign">0</property>
<property name="use_markup">True</property>
</widget>
<packing>
<property name="position">1</property>
</packing>
</child>
</widget>
</child>
<child>
<placeholder/>
<packing>
<property name="type">label_item</property>
</packing>
</child>
</widget>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
<property name="x_padding">2</property>
<property name="y_padding">2</property>
</packing>
</child>
<child>
<widget class="GtkLabel" id="label12">
<property name="visible">True</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<property name="xalign">1</property>
<property name="label" translatable="yes">UPS informations : </property>
</widget>
<packing>
<property name="x_options">GTK_FILL</property>
</packing>
</child>
<child>
<widget class="GtkProgressBar" id="progressbar1">
<property name="visible">True</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<property name="show_text">True</property>
<property name="text" translatable="yes">0 %</property>
</widget>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
<property name="top_attach">1</property>
<property name="bottom_attach">2</property>
</packing>
</child>
<child>
<widget class="GtkLabel" id="label5">
<property name="visible">True</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<property name="xalign">1</property>
<property name="label" translatable="yes">Battery charge : </property>
</widget>
<packing>
<property name="top_attach">1</property>
<property name="bottom_attach">2</property>
<property name="x_options">GTK_FILL</property>
</packing>
</child>
<child>
<widget class="GtkLabel" id="label8">
<property name="visible">True</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<property name="xalign">1</property>
<property name="label" translatable="yes">UPS Load : </property>
</widget>
<packing>
<property name="top_attach">2</property>
<property name="bottom_attach">3</property>
<property name="x_options">GTK_FILL</property>
</packing>
</child>
<child>
<widget class="GtkProgressBar" id="progressbar2">
<property name="visible">True</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<property name="show_text">True</property>
<property name="text" translatable="yes">0 %</property>
</widget>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
<property name="top_attach">2</property>
<property name="bottom_attach">3</property>
</packing>
</child>
<child>
<widget class="GtkFrame" id="frame2">
<property name="visible">True</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<property name="label_xalign">0</property>
<property name="label_yalign">0</property>
<property name="shadow_type">GTK_SHADOW_IN</property>
<child>
<widget class="GtkLabel" id="label2">
<property name="visible">True</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<property name="label" translatable="yes">0:00</property>
<property name="use_markup">True</property>
<property name="justify">GTK_JUSTIFY_CENTER</property>
</widget>
</child>
<child>
<placeholder/>
<packing>
<property name="type">label_item</property>
</packing>
</child>
</widget>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
<property name="top_attach">3</property>
<property name="bottom_attach">4</property>
<property name="x_padding">2</property>
<property name="y_padding">2</property>
</packing>
</child>
<child>
<widget class="GtkLabel" id="label9">
<property name="visible">True</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<property name="xalign">1</property>
<property name="label" translatable="yes">Time remaining : </property>
</widget>
<packing>
<property name="top_attach">3</property>
<property name="bottom_attach">4</property>
<property name="x_options">GTK_FILL</property>
</packing>
</child>
</widget>
</child>
</widget>
</child>
<child>
<widget class="GtkLabel" id="label1">
<property name="visible">True</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<property name="label" translatable="yes"> UPS Status </property>
<property name="use_markup">True</property>
</widget>
<packing>
<property name="type">label_item</property>
</packing>
</child>
</widget>
<packing>
<property name="position">1</property>
</packing>
</child>
</widget>
<packing>
<property name="expand">False</property>
<property name="padding">2</property>
<property name="position">1</property>
</packing>
</child>
<child>
<widget class="GtkStatusbar" id="statusbar1">
<property name="visible">True</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<property name="spacing">2</property>
</widget>
<packing>
<property name="expand">False</property>
<property name="pack_type">GTK_PACK_END</property>
<property name="position">2</property>
</packing>
</child>
</widget>
</child>
</widget>
<widget class="GtkAboutDialog" id="aboutdialog1">
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<property name="border_width">5</property>
<property name="title" translatable="yes">About UPS Monitor</property>
<property name="resizable">False</property>
<property name="modal">True</property>
<property name="window_position">GTK_WIN_POS_CENTER_ON_PARENT</property>
<property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property>
<property name="has_separator">False</property>
<property name="program_name">NUT Monitor</property>
<property name="version">0.1beta</property>
<property name="copyright" translatable="yes">Copyright (c) David Goncalves</property>
<property name="comments" translatable="yes">GUI to manage UPS trough a NUT server</property>
<property name="website">http://www.lestat.st</property>
<property name="website_label" translatable="yes">www.lestat.st</property>
<property name="license" translatable="yes">Copyright (C) 2008 David Goncalves &lt;david@lestat.st&gt;
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see &lt;http://www.gnu.org/licenses/&gt;.</property>
<property name="authors">David Goncalves - &lt;david@lestat.st&gt;</property>
<child internal-child="vbox">
<widget class="GtkVBox" id="dialog-vbox1">
<property name="visible">True</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<property name="spacing">2</property>
<child>
<placeholder/>
</child>
<child internal-child="action_area">
<widget class="GtkHButtonBox" id="dialog-action_area1">
<property name="visible">True</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<property name="layout_style">GTK_BUTTONBOX_SPREAD</property>
</widget>
<packing>
<property name="expand">False</property>
<property name="pack_type">GTK_PACK_END</property>
</packing>
</child>
</widget>
</child>
</widget>
</glade-interface>

View file

@ -0,0 +1,11 @@
[Desktop Entry]
Name=NUT Monitor
Name[fr]=Moniteur NUT
Comment=Network UPS Tools GUI client
Comment[fr]=Client graphique pour NUT (Network UPS Tools)
Categories=Application;Network;
Encoding=UTF-8
Exec=NUT-Monitor
Icon=nut-monitor.png
Terminal=false
Type=Application

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

View file

@ -0,0 +1,238 @@
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright (C) 2008 David Goncalves <david@lestat.st>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# 2008-01-14 David Goncalves
# PyNUT is an abstraction class to access NUT (Network UPS Tools) server.
#
# 2008-06-09 David Goncalves
# Added 'GetRWVars' and 'SetRWVar' commands.
import telnetlib
class PyNUTClient :
""" Abstraction class to access NUT (Network UPS Tools) server """
__debug = None # Set class to debug mode (prints everything useful for debuging...)
__host = None
__port = None
__login = None
__password = None
__timeout = None
__srv_handler = None
__version = "1.0"
__release = "2008-06-09"
def __init__( self, host="127.0.0.1", port=3493, login=None, password=None, debug=False, timeout=5 ) :
""" Class initialization method
host : Host to connect (default to localhost)
port : Port where NUT listens for connections (default to 3493)
login : Login used to connect to NUT server (default to None for no authentication)
password : Password used when using authentication (default to None)
debug : Boolean, put class in debug mode (prints everything on console, default to False)
timeout : Timeout used to wait for network response
"""
self.__debug = debug
if self.__debug :
print( "[DEBUG] Class initialization..." )
print( "[DEBUG] -> Host = %s (port %s)" % ( host, port ) )
print( "[DEBUG] -> Login = '%s' / '%s'" % ( login, password ) )
self.__host = host
self.__port = port
self.__login = login
self.__password = password
self.__timeout = 5
self.__connect()
# Try to disconnect cleanly when class is deleted ;)
def __del__( self ) :
""" Class destructor method """
try :
self.__srv_handler.write( "LOGOUT\n" )
except :
pass
def __connect( self ) :
""" Connects to the defined server
If login/pass was specified, the class tries to authenticate. An error is raised
if something goes wrong.
"""
if self.__debug :
print( "[DEBUG] Connecting to host" )
self.__srv_handler = telnetlib.Telnet( self.__host, self.__port )
if self.__login != None :
self.__srv_handler.write( "USERNAME %s\n" % self.__login )
result = self.__srv_handler.read_until( "\n", self.__timeout )
if result[:2] != "OK" :
raise Exception, result.replace( "\n", "" )
if self.__password != None :
self.__srv_handler.write( "PASSWORD %s\n" % self.__password )
result = self.__srv_handler.read_until( "\n", self.__timeout )
if result[:2] != "OK" :
raise Exception, result.replace( "\n", "" )
def GetUPSList( self ) :
""" Returns the list of available UPS from the NUT server
The result is a dictionnary containing 'key->val' pairs of 'UPSName' and 'UPS Description'
"""
if self.__debug :
print( "[DEBUG] GetUPSList from server" )
self.__srv_handler.write( "LIST UPS\n" )
result = self.__srv_handler.read_until( "\n" )
if result != "BEGIN LIST UPS\n" :
raise Exception, result.replace( "\n", "" )
result = self.__srv_handler.read_until( "END LIST UPS\n" )
ups_list = {}
for line in result.split( "\n" ) :
if line[:3] == "UPS" :
ups, desc = line[4:-1].split( '"' )
ups_list[ ups.replace( " ", "" ) ] = desc
return( ups_list )
def GetUPSVars( self, ups="" ) :
""" Get all available vars from the specified UPS
The result is a dictionnary containing 'key->val' pairs of all
available vars.
"""
if self.__debug :
print( "[DEBUG] GetUPSVars called..." )
self.__srv_handler.write( "LIST VAR %s\n" % ups )
result = self.__srv_handler.read_until( "\n" )
if result != "BEGIN LIST VAR %s\n" % ups :
raise Exception, result.replace( "\n", "" )
ups_vars = {}
result = self.__srv_handler.read_until( "END LIST VAR %s\n" % ups )
offset = len( "VAR %s " % ups )
end_offset = 0 - ( len( "END LIST VAR %s\n" % ups ) + 1 )
for current in result[:end_offset].split( "\n" ) :
var = current[ offset: ].split( '"' )[0].replace( " ", "" )
data = current[ offset: ].split( '"' )[1]
ups_vars[ var ] = data
return( ups_vars )
def GetUPSCommands( self, ups="" ) :
""" Get all available commands for the specified UPS
The result is a dict object with command name as key and a description
of the command as value
"""
if self.__debug :
print( "[DEBUG] GetUPSCommands called..." )
self.__srv_handler.write( "LIST CMD %s\n" % ups )
result = self.__srv_handler.read_until( "\n" )
if result != "BEGIN LIST CMD %s\n" % ups :
raise Exception, result.replace( "\n", "" )
ups_cmds = {}
result = self.__srv_handler.read_until( "END LIST CMD %s\n" % ups )
offset = len( "CMD %s " % ups )
end_offset = 0 - ( len( "END LIST CMD %s\n" % ups ) + 1 )
for current in result[:end_offset].split( "\n" ) :
var = current[ offset: ].split( '"' )[0].replace( " ", "" )
# For each var we try to get the available description
try :
self.__srv_handler.write( "GET CMDDESC %s %s\n" % ( ups, var ) )
temp = self.__srv_handler.read_until( "\n" )
if temp[:7] != "CMDDESC" :
raise
else :
off = len( "CMDDESC %s %s " % ( ups, var ) )
desc = temp[off:-1].split('"')[1]
except :
desc = var
ups_cmds[ var ] = desc
return( ups_cmds )
def GetRWVars( self, ups="" ) :
""" Get a list of all writable vars from the selected UPS
The result is presented as a dictionnary containing 'key->val' pairs
"""
if self.__debug :
print( "[DEBUG] GetUPSVars from '%s'..." % ups )
self.__srv_handler.write( "LIST RW %s\n" % ups )
result = self.__srv_handler.read_until( "\n" )
if ( result != "BEGIN LIST RW %s\n" % ups ) :
raise Exception, result.replace( "\n", "" )
result = self.__srv_handler.read_until( "END LIST RW %s\n" % ups )
offset = len( "VAR %s" % ups )
end_offset = 0 - ( len( "END LIST RW %s\n" % ups ) + 1 )
rw_vars = {}
for current in result[:end_offset].split( "\n" ) :
var = current[ offset: ].split( '"' )[0].replace( " ", "" )
data = current[ offset: ].split( '"' )[1]
rw_vars[ var ] = data
return( rw_vars )
def SetRWVar( self, ups="", var="", value="" ):
""" Set a variable to the specified value on selected UPS
The variable must be a writable value (cf GetRWVars) and you must have the proper
rights to set it (maybe login/password).
"""
self.__srv_handler.write( "SET VAR %s %s %s\n" % ( ups, var, value ) )
result = self.__srv_handler.read_until( "\n" )
if ( result == "OK\n" ) :
return( "OK" )
else :
raise Exception, result
def RunUPSCommand( self, ups="", command="" ) :
""" Send a command to the specified UPS
Returns OK on success or raises an error
"""
if self.__debug :
print( "[DEBUG] RunUPSCommand called..." )
self.__srv_handler.write( "INSTCMD %s %s\n" % ( ups, command ) )
result = self.__srv_handler.read_until( "\n" )
if ( result == "OK\n" ) :
return( "OK" )
else :
raise Exception, result.replace( "\n", "" )

View file

@ -0,0 +1,43 @@
#!/usr/bin/python
# -*- coding: utf-8 -*-
# This source code is provided for testing/debuging purpose ;)
import PyNUT
import sys
if __name__ == "__main__" :
print( "PyNUTClient test..." )
nut = PyNUT.PyNUTClient( debug=True )
#nut = PyNUT.PyNUTClient( login="upsadmin", password="upsadmin", debug=True )
print( 80*"-" + "\nTesting 'GetUPSList' :")
result = nut.GetUPSList( )
print( "\033[01;33m%s\033[0m\n" % result )
print( 80*"-" + "\nTesting 'GetUPSVars' :")
result = nut.GetUPSVars( "dummy" )
print( "\033[01;33m%s\033[0m\n" % result )
print( 80*"-" + "\nTesting 'GetUPSCommands' :")
result = nut.GetUPSCommands( "dummy" )
print( "\033[01;33m%s\033[0m\n" % result )
print( 80*"-" + "\nTesting 'GetRWVars' :")
result = nut.GetRWVars( "dummy" )
print( "\033[01;33m%s\033[0m\n" % result )
print( 80*"-" + "\nTesting 'RunUPSCommand' (Test front panel) :")
try :
result = nut.RunUPSCommand( "UPS1", "test.panel.start" )
except :
result = sys.exc_info()[1]
print( "\033[01;33m%s\033[0m\n" % result )
print( 80*"-" + "\nTesting 'SetUPSVar' (set ups.id to test):")
try :
result = nut.SetRWVar( "UPS1", "ups.id", "test" )
except :
result = sys.exc_info()[1]
print( "\033[01;33m%s\033[0m\n" % result )

View file

@ -0,0 +1,307 @@
#!/bin/bash
# an auxiliary script to produce a "stub" usbhid-ups subdriver from
# the output of
#
# drivers/usbhid-ups -DD -u root -x generic -x vendorid=XXXX auto
#
# Usage: cat debuginfo | path-to-subdriver.sh
#
# See also: docs/hid-subdrivers.txt
usage() {
echo "Usage: $0 [options] [file]"
echo "Options:"
echo " -h, --help -- show this message and quit"
echo " -n name -- driver name (use natural capitalization)"
echo " -v XXXX -- vendor id"
echo " -p XXXX -- product id"
echo " -k -- keep temporary files (for debugging)"
echo " file -- read from file instead of stdin"
}
DRIVER=""
VENDORID=""
PRODUCTID=""
KEEP=""
while [ $# -gt 0 ]; do
if [ $# -gt 1 -a "$1" = "-n" ]; then
DRIVER="$2"
shift 2
elif [ $# -gt 1 -a "$1" = "-v" ]; then
VENDORID="$2"
shift 2
elif [ $# -gt 1 -a "$1" = "-p" ]; then
PRODUCTID="$2"
shift 2
elif [ "$1" = "-k" ]; then
KEEP=yes
shift
elif echo "$1" | grep -qv '^-'; then
FILE="$1"
shift
elif [ "$1" = "--help" -o "$1" = "-h" ]; then
usage
exit 0
else
echo "Illegal option $1. Try --help for more info." >&2
exit 1
fi
done
# delete temporary files: this is called just before exiting.
cleanup () {
rm -f "$DEBUG" "$UTABLE" "$USAGES" "$SUBST" "$SEDFILE" "$NEWUTABLE"
}
if [ -z "$KEEP" ]; then
trap cleanup EXIT
fi
NAME=path-to-subdriver
TMPDIR="${TEMPDIR:-/tmp}"
DEBUG=`mktemp "$TMPDIR/$NAME-DEBUG.XXXXXX"`
UTABLE=`mktemp "$TMPDIR/$NAME-UTABLE.XXXXXX"`
USAGES=`mktemp "$TMPDIR/$NAME-USAGES.XXXXXX"`
SUBST=`mktemp "$TMPDIR/$NAME-SUBST.XXXXXX"`
SEDFILE=`mktemp "$TMPDIR/$NAME-SEDFILE.XXXXXX"`
NEWUTABLE=`mktemp "$TMPDIR/$NAME-NEWUTABLE.XXXXXX"`
# save standard input to a file
if [ -z "$FILE" ]; then
FILE="$DEBUG"
cat > "$DEBUG"
fi
# prompt use for name of driver
while [ -z "$DRIVER" ]; do
echo "
Please enter a name for this driver. Use only letters and numbers. Use
natural (upper- and lowercase) capitalization, e.g., 'Belkin', 'APC'."
read -p "Name of subdriver: " DRIVER < /dev/tty
if echo $DRIVER | egrep -q '[^a-zA-Z0-9]'; then
echo "Please use only letters and digits"
DRIVER=""
fi
done
# try to determine product and vendor id
VENDORID=`cat "$FILE" | sed -n 's/[> ]*- VendorID: \([0-9a-fA-F]*\).*/\1/p' | tail -1`
PRODUCTID=`cat "$FILE" | sed -n 's/[> ]*- ProductID: \([0-9a-fA-F]*\).*/\1/p' | tail -1`
# prompt for productid, vendorid if necessary
if [ -z "$VENDORID" ]; then
read -p "Vendor ID: " VENDORID < /dev/tty
fi
if [ -z "$PRODUCTID" ]; then
read -p "Product ID: " PRODUCTID < /dev/tty
fi
LDRIVER=`echo $DRIVER | tr A-Z a-z`
UDRIVER=`echo $DRIVER | tr a-z A-Z`
CFILE="$LDRIVER-hid.c"
HFILE="$LDRIVER-hid.h"
# extract Usage Table
cat "$FILE" | sed -n 's/[> ]*Path: \([^,][^,]*\), Type:.*/\1/p' > "$UTABLE"
# extract Usage codes
cat "$UTABLE" | tr '.' $'\n' | sort -u > "$USAGES"
# make up dummy names for unknown usages
count=0
cat "$USAGES" | egrep '[0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F]' |\
while read U; do
count=`expr $count + 1`
echo "$U $UDRIVER$count"
done > "$SUBST"
# create an sed script for substitutions
cat "$SUBST" | sed 's/\(.*\) \(.*\)/s!\1!\2!g;/' > "$SEDFILE"
# create modified usage table
sed -f "$SEDFILE" < "$UTABLE" > "$NEWUTABLE"
# generate header file
echo "Creating $HFILE"
cat > "$HFILE" <<EOF
/* ${HFILE} - subdriver to monitor ${DRIVER} USB/HID devices with NUT
*
* Copyright (C)
* 2003 - 2009 Arnaud Quette <ArnaudQuette@Eaton.com>
* 2005 - 2006 Peter Selinger <selinger@users.sourceforge.net>
* 2008 - 2009 Arjen de Korte <adkorte-guest@alioth.debian.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef ${UDRIVER}_HID_H
#define ${UDRIVER}_HID_H
#include "usbhid-ups.h"
extern subdriver_t ${LDRIVER}_subdriver;
#endif /* ${UDRIVER}_HID_H */
EOF
# generate source file
echo "Creating $CFILE"
cat > "$CFILE" <<EOF
/* ${CFILE} - subdriver to monitor ${DRIVER} USB/HID devices with NUT
*
* Copyright (C)
* 2003 - 2009 Arnaud Quette <ArnaudQuette@Eaton.com>
* 2005 - 2006 Peter Selinger <selinger@users.sourceforge.net>
* 2008 - 2009 Arjen de Korte <adkorte-guest@alioth.debian.org>
*
* Note: this subdriver was initially generated as a "stub" by the
* path-to-subdriver script. It must be customized.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "usbhid-ups.h"
#include "${HFILE}"
#include "main.h" /* for getval() */
#include "usb-common.h"
#define ${UDRIVER}_HID_VERSION "${DRIVER} HID 0.1"
/* FIXME: experimental flag to be put in upsdrv_info */
/* ${DRIVER} */
#define ${UDRIVER}_VENDORID 0x${VENDORID}
/* USB IDs device table */
static usb_device_id_t ${LDRIVER}_usb_device_table[] = {
/* ${DRIVER} */
{ USB_DEVICE(${UDRIVER}_VENDORID, 0x${PRODUCTID}), NULL },
/* Terminating entry */
{ -1, -1, NULL }
};
/* --------------------------------------------------------------- */
/* Vendor-specific usage table */
/* --------------------------------------------------------------- */
/* ${UDRIVER} usage table */
static usage_lkp_t ${LDRIVER}_usage_lkp[] = {
EOF
cat "$SUBST" | sed 's/\(.*\) \(.*\)/\t{ "\2",\t0x\1 },/' >> "$CFILE"
cat >> "$CFILE" <<EOF
{ NULL, 0 }
};
static usage_tables_t ${LDRIVER}_utab[] = {
${LDRIVER}_usage_lkp,
hid_usage_lkp,
NULL,
};
/* --------------------------------------------------------------- */
/* HID2NUT lookup table */
/* --------------------------------------------------------------- */
static hid_info_t ${LDRIVER}_hid2nut[] = {
EOF
cat "$NEWUTABLE" | sort -u | while read U; do
UL=`echo $U | tr A-Z a-z`
cat >> "$CFILE" <<EOF
{ "unmapped.${UL}", 0, 0, "${U}", NULL, "%.0f", 0, NULL },
EOF
done
cat >> "$CFILE" <<EOF
/* end of structure. */
{ NULL, 0, 0, NULL, NULL, NULL, 0, NULL }
};
static char *${LDRIVER}_format_model(HIDDevice_t *hd) {
return hd->Product;
}
static char *${LDRIVER}_format_mfr(HIDDevice_t *hd) {
return hd->Vendor ? hd->Vendor : "${DRIVER}";
}
static char *${LDRIVER}_format_serial(HIDDevice_t *hd) {
return hd->Serial;
}
/* this function allows the subdriver to "claim" a device: return 1 if
* the device is supported by this subdriver, else 0. */
static int ${LDRIVER}_claim(HIDDevice_t *hd)
{
int status = is_usb_device_supported(${LDRIVER}_usb_device_table, hd->VendorID, hd->ProductID);
switch (status)
{
case POSSIBLY_SUPPORTED:
/* by default, reject, unless the productid option is given */
if (getval("productid")) {
return 1;
}
possibly_supported("${DRIVER}", hd);
return 0;
case SUPPORTED:
return 1;
case NOT_SUPPORTED:
default:
return 0;
}
}
subdriver_t ${LDRIVER}_subdriver = {
${UDRIVER}_HID_VERSION,
${LDRIVER}_claim,
${LDRIVER}_utab,
${LDRIVER}_hid2nut,
${LDRIVER}_format_model,
${LDRIVER}_format_mfr,
${LDRIVER}_format_serial,
};
EOF
cat <<EOF
Done.
Do not forget to:
* add #include "${HFILE}" to usbhid-ups.c,
* add &${LDRIVER}_subdriver to usbhid-ups.c:subdriver_list,
* add ${LDRIVER}-hid.c to USBHID_UPS_SUBDRIVERS in drivers/Makefile.am
* add ${LDRIVER}-hid.h to dist_noinst_HEADERS in drivers/Makefile.am
* "autoreconf" from the top level directory
EOF

15
scripts/udev/Makefile.am Normal file
View file

@ -0,0 +1,15 @@
if WITH_UDEV
udevrulesdir = $(udevdir)/rules.d
udevrules_DATA = 52-nut-usbups.rules
endif
EXTRA_DIST = README
52-nut-usbups.rules: nut-usbups.rules
cp nut-usbups.rules 52-nut-usbups.rules
DISTCLEANFILES = nut-usbups.rules
CLEANFILES = 52-nut-usbups.rules
# we should never remove this one, apart from a distclean-check
#MAINTAINERCLEANFILES = nut-usbups.rules.in

472
scripts/udev/Makefile.in Normal file
View file

@ -0,0 +1,472 @@
# Makefile.in generated by automake 1.11 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation,
# Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
@SET_MAKE@
VPATH = @srcdir@
pkgdatadir = $(datadir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkglibexecdir = $(libexecdir)/@PACKAGE@
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_HEADER = $(INSTALL_DATA)
transform = $(program_transform_name)
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
target_triplet = @target@
subdir = scripts/udev
DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
$(srcdir)/nut-usbups.rules.in
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/ax_create_stdint_h.m4 \
$(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \
$(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \
$(top_srcdir)/m4/lt~obsolete.m4 \
$(top_srcdir)/m4/nut_arg_with.m4 \
$(top_srcdir)/m4/nut_check_ipv6.m4 \
$(top_srcdir)/m4/nut_check_libgd.m4 \
$(top_srcdir)/m4/nut_check_libhal.m4 \
$(top_srcdir)/m4/nut_check_libneon.m4 \
$(top_srcdir)/m4/nut_check_libnetsnmp.m4 \
$(top_srcdir)/m4/nut_check_libpowerman.m4 \
$(top_srcdir)/m4/nut_check_libssl.m4 \
$(top_srcdir)/m4/nut_check_libusb.m4 \
$(top_srcdir)/m4/nut_check_libwrap.m4 \
$(top_srcdir)/m4/nut_check_os.m4 \
$(top_srcdir)/m4/nut_report_feature.m4 \
$(top_srcdir)/m4/nut_type_socklen_t.m4 \
$(top_srcdir)/configure.in
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 = nut-usbups.rules
CONFIG_CLEAN_VPATH_FILES =
SOURCES =
DIST_SOURCES =
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
am__vpath_adj = case $$p in \
$(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
*) f=$$p;; \
esac;
am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
am__install_max = 40
am__nobase_strip_setup = \
srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
am__nobase_strip = \
for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
am__nobase_list = $(am__nobase_strip_setup); \
for p in $$list; do echo "$$p $$p"; done | \
sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
$(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
if (++n[$$2] == $(am__install_max)) \
{ print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
END { for (dir in files) print dir, files[dir] }'
am__base_list = \
sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
am__installdirs = "$(DESTDIR)$(udevrulesdir)"
DATA = $(udevrules_DATA)
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
AR = @AR@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
BINDIR = @BINDIR@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CONFPATH = @CONFPATH@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CYGPATH_W = @CYGPATH_W@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
DRIVER_BUILD_LIST = @DRIVER_BUILD_LIST@
DRIVER_INSTALL_TARGET = @DRIVER_INSTALL_TARGET@
DRIVER_MAN_LIST = @DRIVER_MAN_LIST@
DSYMUTIL = @DSYMUTIL@
DUMPBIN = @DUMPBIN@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
FGREP = @FGREP@
GREP = @GREP@
HAL_CALLOUTS_PATH = @HAL_CALLOUTS_PATH@
HAL_DEVICE_MATCH_KEY = @HAL_DEVICE_MATCH_KEY@
HAL_FDI_PATH = @HAL_FDI_PATH@
HAL_USER = @HAL_USER@
HAVE_GLIB_2_14 = @HAVE_GLIB_2_14@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
LD = @LD@
LDFLAGS = @LDFLAGS@
LIBGD_CFLAGS = @LIBGD_CFLAGS@
LIBGD_LDFLAGS = @LIBGD_LDFLAGS@
LIBHAL_CFLAGS = @LIBHAL_CFLAGS@
LIBHAL_LDFLAGS = @LIBHAL_LDFLAGS@
LIBNEON_CFLAGS = @LIBNEON_CFLAGS@
LIBNEON_LDFLAGS = @LIBNEON_LDFLAGS@
LIBNETSNMP_CFLAGS = @LIBNETSNMP_CFLAGS@
LIBNETSNMP_LDFLAGS = @LIBNETSNMP_LDFLAGS@
LIBOBJS = @LIBOBJS@
LIBPOWERMAN_CFLAGS = @LIBPOWERMAN_CFLAGS@
LIBPOWERMAN_LDFLAGS = @LIBPOWERMAN_LDFLAGS@
LIBS = @LIBS@
LIBSSL_CFLAGS = @LIBSSL_CFLAGS@
LIBSSL_LDFLAGS = @LIBSSL_LDFLAGS@
LIBTOOL = @LIBTOOL@
LIBUSB_CFLAGS = @LIBUSB_CFLAGS@
LIBUSB_LDFLAGS = @LIBUSB_LDFLAGS@
LIBWRAP_CFLAGS = @LIBWRAP_CFLAGS@
LIBWRAP_LDFLAGS = @LIBWRAP_LDFLAGS@
LIPO = @LIPO@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
MKDIR_P = @MKDIR_P@
NETLIBS = @NETLIBS@
NM = @NM@
NMEDIT = @NMEDIT@
OBJDUMP = @OBJDUMP@
OBJEXT = @OBJEXT@
OS_NAME = @OS_NAME@
OTOOL = @OTOOL@
OTOOL64 = @OTOOL64@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
RANLIB = @RANLIB@
RUN_AS_GROUP = @RUN_AS_GROUP@
RUN_AS_USER = @RUN_AS_USER@
SED = @SED@
SERLIBS = @SERLIBS@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STATEPATH = @STATEPATH@
STRIP = @STRIP@
SUN_LIBUSB = @SUN_LIBUSB@
VERSION = @VERSION@
WORDS_BIGENDIAN = @WORDS_BIGENDIAN@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
abs_top_srcdir = @abs_top_srcdir@
ac_ct_CC = @ac_ct_CC@
ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
am__tar = @am__tar@
am__untar = @am__untar@
bindir = @bindir@
build = @build@
build_alias = @build_alias@
build_cpu = @build_cpu@
build_os = @build_os@
build_vendor = @build_vendor@
builddir = @builddir@
cgiexecdir = @cgiexecdir@
datadir = @datadir@
datarootdir = @datarootdir@
docdir = @docdir@
driverexecdir = @driverexecdir@
dvidir = @dvidir@
exec_prefix = @exec_prefix@
host = @host@
host_alias = @host_alias@
host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
hotplugdir = @hotplugdir@
htmldir = @htmldir@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
localedir = @localedir@
localstatedir = @localstatedir@
lt_ECHO = @lt_ECHO@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
pdfdir = @pdfdir@
pkgconfigdir = @pkgconfigdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
sysconfdir = @sysconfdir@
target = @target@
target_alias = @target_alias@
target_cpu = @target_cpu@
target_os = @target_os@
target_vendor = @target_vendor@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
udevdir = @udevdir@
@WITH_UDEV_TRUE@udevrulesdir = $(udevdir)/rules.d
@WITH_UDEV_TRUE@udevrules_DATA = 52-nut-usbups.rules
EXTRA_DIST = README
DISTCLEANFILES = nut-usbups.rules
CLEANFILES = 52-nut-usbups.rules
all: all-am
.SUFFIXES:
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
&& { if test -f $@; then exit 0; else break; fi; }; \
exit 1;; \
esac; \
done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu scripts/udev/Makefile'; \
$(am__cd) $(top_srcdir) && \
$(AUTOMAKE) --gnu scripts/udev/Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
*) \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(am__aclocal_m4_deps):
nut-usbups.rules: $(top_builddir)/config.status $(srcdir)/nut-usbups.rules.in
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
mostlyclean-libtool:
-rm -f *.lo
clean-libtool:
-rm -rf .libs _libs
install-udevrulesDATA: $(udevrules_DATA)
@$(NORMAL_INSTALL)
test -z "$(udevrulesdir)" || $(MKDIR_P) "$(DESTDIR)$(udevrulesdir)"
@list='$(udevrules_DATA)'; test -n "$(udevrulesdir)" || list=; \
for p in $$list; do \
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
echo "$$d$$p"; \
done | $(am__base_list) | \
while read files; do \
echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(udevrulesdir)'"; \
$(INSTALL_DATA) $$files "$(DESTDIR)$(udevrulesdir)" || exit $$?; \
done
uninstall-udevrulesDATA:
@$(NORMAL_UNINSTALL)
@list='$(udevrules_DATA)'; test -n "$(udevrulesdir)" || list=; \
files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
test -n "$$files" || exit 0; \
echo " ( cd '$(DESTDIR)$(udevrulesdir)' && rm -f" $$files ")"; \
cd "$(DESTDIR)$(udevrulesdir)" && rm -f $$files
tags: TAGS
TAGS:
ctags: CTAGS
CTAGS:
distdir: $(DISTFILES)
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
list='$(DISTFILES)'; \
dist_files=`for file in $$list; do echo $$file; done | \
sed -e "s|^$$srcdirstrip/||;t" \
-e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
case $$dist_files in \
*/*) $(MKDIR_P) `echo "$$dist_files" | \
sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
sort -u` ;; \
esac; \
for file in $$dist_files; do \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
if test -d $$d/$$file; then \
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
if test -d "$(distdir)/$$file"; then \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
else \
test -f "$(distdir)/$$file" \
|| cp -p $$d/$$file "$(distdir)/$$file" \
|| exit 1; \
fi; \
done
check-am: all-am
check: check-am
all-am: Makefile $(DATA)
installdirs:
for dir in "$(DESTDIR)$(udevrulesdir)"; do \
test -z "$$dir" || $(MKDIR_P) "$$dir"; \
done
install: install-am
install-exec: install-exec-am
install-data: install-data-am
uninstall: uninstall-am
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
installcheck: installcheck-am
install-strip:
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
`test -z '$(STRIP)' || \
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
mostlyclean-generic:
clean-generic:
-test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
-test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
clean: clean-am
clean-am: clean-generic clean-libtool mostlyclean-am
distclean: distclean-am
-rm -f Makefile
distclean-am: clean-am distclean-generic
dvi: dvi-am
dvi-am:
html: html-am
html-am:
info: info-am
info-am:
install-data-am: install-udevrulesDATA
install-dvi: install-dvi-am
install-dvi-am:
install-exec-am:
install-html: install-html-am
install-html-am:
install-info: install-info-am
install-info-am:
install-man:
install-pdf: install-pdf-am
install-pdf-am:
install-ps: install-ps-am
install-ps-am:
installcheck-am:
maintainer-clean: maintainer-clean-am
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-am
mostlyclean-am: mostlyclean-generic mostlyclean-libtool
pdf: pdf-am
pdf-am:
ps: ps-am
ps-am:
uninstall-am: uninstall-udevrulesDATA
.MAKE: install-am install-strip
.PHONY: all all-am check check-am clean clean-generic clean-libtool \
distclean distclean-generic distclean-libtool distdir dvi \
dvi-am html html-am info info-am install install-am \
install-data install-data-am install-dvi install-dvi-am \
install-exec install-exec-am install-html install-html-am \
install-info install-info-am install-man install-pdf \
install-pdf-am install-ps install-ps-am install-strip \
install-udevrulesDATA installcheck installcheck-am installdirs \
maintainer-clean maintainer-clean-generic mostlyclean \
mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
uninstall uninstall-am uninstall-udevrulesDATA
52-nut-usbups.rules: nut-usbups.rules
cp nut-usbups.rules 52-nut-usbups.rules
# we should never remove this one, apart from a distclean-check
#MAINTAINERCLEANFILES = nut-usbups.rules.in
# 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:

41
scripts/udev/README Normal file
View file

@ -0,0 +1,41 @@
Desc: Udev script for NUT USB drivers
File: scripts/udev/README
Date: 27 January 2008
Auth: Arnaud Quette <aquette.dev@gmail.com>
This document introduces the Linux udev script for NUT USB
drivers (usbhid-ups, bcmxcp_usb, tripplite_usb, ...).
These are needed on Linux systems running udev (recommended
as of kernel 2.6.3, and mandatory as of 2.6.14 and higher).
This script ensure that the right privileges are set on the
usb devices files to allow the NUT driver to operate (ie
allowing the nut user to read AND write to the UPS device).
Note that the old style hotplug files, available in the
scripts/hotplug directory, are not needed if your kernel supports
udev.
Installation
------------
For most users, these files will be automatically installed in
/etc/udev (or /lib/udev) upon "make install", if that directory exists. You can
specify an alternate directory with ./configure --with-udev-dir=DIR.
Manual installation
-------------------
To install them manually, copy nut-usbups.rules to /etc/udev/rules.d
(or /lib/udev/rules.d on newer systems) using the command
$ cp -f nut-usbups.rules /etc/udev/rules.d/52-nut-usbups.rules
You will need to refresh the bus to avoid a reboot for these rules to be
active. You can do so using:
$ udevadm trigger --subsystem-match=usb_device
You can then plug your UPS USB cord, or unplug / replug it to
refresh the device permission, and start NUT.

View file

@ -0,0 +1,126 @@
# This file is generated and installed by the Network UPS Tools package.
ACTION!="add", GOTO="nut-usbups_rules_end"
SUBSYSTEM=="usb_device", GOTO="nut-usbups_rules_real"
SUBSYSTEM=="usb", GOTO="nut-usbups_rules_real"
BUS!="usb", GOTO="nut-usbups_rules_end"
LABEL="nut-usbups_rules_real"
# Krauler UP-M500VA - blazer_usb
ATTR{idVendor}=="0001", ATTR{idProduct}=="0000", MODE="664", GROUP="@RUN_AS_GROUP@"
# Hewlett Packard
# T500 - bcmxcp_usb
ATTR{idVendor}=="03f0", ATTR{idProduct}=="1f01", MODE="664", GROUP="@RUN_AS_GROUP@"
# T750 - bcmxcp_usb
ATTR{idVendor}=="03f0", ATTR{idProduct}=="1f02", MODE="664", GROUP="@RUN_AS_GROUP@"
# HP T750 INTL - usbhid-ups
ATTR{idVendor}=="03f0", ATTR{idProduct}=="1f06", 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@"
# Eaton
# various models - usbhid-ups
ATTR{idVendor}=="0463", ATTR{idProduct}=="0001", MODE="664", GROUP="@RUN_AS_GROUP@"
# various models - usbhid-ups
ATTR{idVendor}=="0463", ATTR{idProduct}=="ffff", MODE="664", GROUP="@RUN_AS_GROUP@"
# Dell
# various models - usbhid-ups
ATTR{idVendor}=="047c", ATTR{idProduct}=="ffff", MODE="664", GROUP="@RUN_AS_GROUP@"
# Belkin
# F6H375-USB - usbhid-ups
ATTR{idVendor}=="050d", ATTR{idProduct}=="0375", MODE="664", GROUP="@RUN_AS_GROUP@"
# F6C550-AVR - usbhid-ups
ATTR{idVendor}=="050d", ATTR{idProduct}=="0551", MODE="664", GROUP="@RUN_AS_GROUP@"
# F6C1250-TW-RK - usbhid-ups
ATTR{idVendor}=="050d", ATTR{idProduct}=="0750", MODE="664", GROUP="@RUN_AS_GROUP@"
# F6C1500-TW-RK - usbhid-ups
ATTR{idVendor}=="050d", ATTR{idProduct}=="0751", MODE="664", GROUP="@RUN_AS_GROUP@"
# F6C900-UNV - usbhid-ups
ATTR{idVendor}=="050d", ATTR{idProduct}=="0900", MODE="664", GROUP="@RUN_AS_GROUP@"
# F6C100-UNV - usbhid-ups
ATTR{idVendor}=="050d", ATTR{idProduct}=="0910", MODE="664", GROUP="@RUN_AS_GROUP@"
# F6C120-UNV - usbhid-ups
ATTR{idVendor}=="050d", ATTR{idProduct}=="0912", MODE="664", GROUP="@RUN_AS_GROUP@"
# F6C800-UNV - usbhid-ups
ATTR{idVendor}=="050d", ATTR{idProduct}=="0980", MODE="664", GROUP="@RUN_AS_GROUP@"
# F6C1100-UNV, F6C1200-UNV - usbhid-ups
ATTR{idVendor}=="050d", ATTR{idProduct}=="1100", MODE="664", GROUP="@RUN_AS_GROUP@"
# APC
# various models - usbhid-ups
ATTR{idVendor}=="051d", ATTR{idProduct}=="0002", MODE="664", GROUP="@RUN_AS_GROUP@"
# Powerware
# various models - bcmxcp_usb
ATTR{idVendor}=="0592", ATTR{idProduct}=="0002", MODE="664", GROUP="@RUN_AS_GROUP@"
# Agiler UPS - blazer_usb
ATTR{idVendor}=="05b8", ATTR{idProduct}=="0000", MODE="664", GROUP="@RUN_AS_GROUP@"
# Belkin F6C1200-UNV - blazer_usb
ATTR{idVendor}=="0665", ATTR{idProduct}=="5161", MODE="664", GROUP="@RUN_AS_GROUP@"
# Liebert
# various models - bcmxcp_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@"
# various models - usbhid-ups
ATTR{idVendor}=="06da", ATTR{idProduct}=="ffff", MODE="664", GROUP="@RUN_AS_GROUP@"
# Cyber Power Systems
# 900AVR/BC900D, CP1200AVR/BC1200D - usbhid-ups
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
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@"
# TrippLite
# e.g. OMNIVS1000, SMART550USB, ... - tripplite_usb
ATTR{idVendor}=="09ae", ATTR{idProduct}=="0001", MODE="664", GROUP="@RUN_AS_GROUP@"
# e.g. TrippLite AVR550U - usbhid-ups
ATTR{idVendor}=="09ae", ATTR{idProduct}=="1003", MODE="664", GROUP="@RUN_AS_GROUP@"
# e.g. TrippLite AVR750U - usbhid-ups
ATTR{idVendor}=="09ae", ATTR{idProduct}=="1007", MODE="664", GROUP="@RUN_AS_GROUP@"
# e.g. TrippLite ECO550UPS - usbhid-ups
ATTR{idVendor}=="09ae", ATTR{idProduct}=="1008", MODE="664", GROUP="@RUN_AS_GROUP@"
# e.g. TrippLite OMNI1000LCD - usbhid-ups
ATTR{idVendor}=="09ae", ATTR{idProduct}=="2005", MODE="664", GROUP="@RUN_AS_GROUP@"
# e.g. TrippLite OMNI900LCD - usbhid-ups
ATTR{idVendor}=="09ae", ATTR{idProduct}=="2007", MODE="664", GROUP="@RUN_AS_GROUP@"
# e.g. TrippLite smart2200RMXL2U - usbhid-ups
ATTR{idVendor}=="09ae", ATTR{idProduct}=="3012", MODE="664", GROUP="@RUN_AS_GROUP@"
# e.g. ? - usbhid-ups
ATTR{idVendor}=="09ae", ATTR{idProduct}=="3014", MODE="664", GROUP="@RUN_AS_GROUP@"
# e.g. TrippLite SmartOnline SU1500RTXL2UA (older unit?) - usbhid-ups
ATTR{idVendor}=="09ae", ATTR{idProduct}=="4001", MODE="664", GROUP="@RUN_AS_GROUP@"
# e.g. TrippLite SmartOnline SU6000RT4U? - usbhid-ups
ATTR{idVendor}=="09ae", ATTR{idProduct}=="4002", MODE="664", GROUP="@RUN_AS_GROUP@"
# e.g. TrippLite SmartOnline SU1500RTXL2ua - usbhid-ups
ATTR{idVendor}=="09ae", ATTR{idProduct}=="4003", MODE="664", GROUP="@RUN_AS_GROUP@"
# PowerCOM
# PowerCOM IMP - IMPERIAL Series - usbhid-ups
ATTR{idVendor}=="0d9f", ATTR{idProduct}=="00a2", MODE="664", GROUP="@RUN_AS_GROUP@"
# PowerCOM SKP - Smart KING Pro (all Smart series) - usbhid-ups
ATTR{idVendor}=="0d9f", ATTR{idProduct}=="00a3", MODE="664", GROUP="@RUN_AS_GROUP@"
# PowerCOM WOW - usbhid-ups
ATTR{idVendor}=="0d9f", ATTR{idProduct}=="00a4", MODE="664", GROUP="@RUN_AS_GROUP@"
# PowerCOM VGD - Vanguard - usbhid-ups
ATTR{idVendor}=="0d9f", ATTR{idProduct}=="00a5", MODE="664", GROUP="@RUN_AS_GROUP@"
# PowerCOM BNT - Black Knight Pro - usbhid-ups
ATTR{idVendor}=="0d9f", ATTR{idProduct}=="00a6", MODE="664", GROUP="@RUN_AS_GROUP@"
# Unitek Alpha 1200Sx - blazer_usb
ATTR{idVendor}=="0f03", ATTR{idProduct}=="0001", MODE="664", GROUP="@RUN_AS_GROUP@"
# Liebert
# Liebert PowerSure PSA UPS - usbhid-ups
ATTR{idVendor}=="10af", ATTR{idProduct}=="0001", MODE="664", GROUP="@RUN_AS_GROUP@"
# Ablerex 625L USB - blazer_usb
ATTR{idVendor}=="ffff", ATTR{idProduct}=="0000", MODE="664", GROUP="@RUN_AS_GROUP@"
LABEL="nut-usbups_rules_end"