Imported Upstream version 2.6.0
This commit is contained in:
parent
26fb71b504
commit
459aaf9392
510 changed files with 40508 additions and 18859 deletions
16
scripts/augeas/Makefile.am
Normal file
16
scripts/augeas/Makefile.am
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
|
||||
EXTRA_DIST = gen-nutupsconf-aug.py nutupsconf.aug.tpl \
|
||||
README tests/test_nut.aug
|
||||
|
||||
# only call the script to generate Augeas ups.conf lens upon "make dist",
|
||||
# and if Python is present
|
||||
dist-hook:
|
||||
@if python -c pass; then \
|
||||
echo "Regenerating Augeas ups.conf lens."; \
|
||||
$(distdir)/gen-nutupsconf-aug.py $(distdir)/; \
|
||||
else \
|
||||
echo "----------------------------------------------------------------------"; \
|
||||
echo "Warning: Python is not available."; \
|
||||
echo "Skipping Augeas ups.conf lens regeneration."; \
|
||||
echo "----------------------------------------------------------------------"; \
|
||||
fi
|
||||
457
scripts/augeas/Makefile.in
Normal file
457
scripts/augeas/Makefile.in
Normal file
|
|
@ -0,0 +1,457 @@
|
|||
# Makefile.in generated by automake 1.11.1 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/augeas
|
||||
DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
|
||||
$(srcdir)/nuthostsconf.aug.in $(srcdir)/nutnutconf.aug.in \
|
||||
$(srcdir)/nutupsconf.aug.in $(srcdir)/nutupsdconf.aug.in \
|
||||
$(srcdir)/nutupsdusers.aug.in $(srcdir)/nutupsmonconf.aug.in \
|
||||
$(srcdir)/nutupsschedconf.aug.in \
|
||||
$(srcdir)/nutupssetconf.aug.in
|
||||
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
||||
am__aclocal_m4_deps = $(top_srcdir)/m4/ax_compare_version.m4 \
|
||||
$(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_asciidoc.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_config_libhal.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 = nutnutconf.aug nutupsconf.aug nutupsdconf.aug \
|
||||
nutupsdusers.aug nutupsmonconf.aug nutupsschedconf.aug \
|
||||
nuthostsconf.aug nutupssetconf.aug
|
||||
CONFIG_CLEAN_VPATH_FILES =
|
||||
SOURCES =
|
||||
DIST_SOURCES =
|
||||
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
|
||||
A2X = @A2X@
|
||||
ACLOCAL = @ACLOCAL@
|
||||
AMTAR = @AMTAR@
|
||||
AR = @AR@
|
||||
ASCIIDOC = @ASCIIDOC@
|
||||
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@
|
||||
DBLATEX = @DBLATEX@
|
||||
DEFS = @DEFS@
|
||||
DEPDIR = @DEPDIR@
|
||||
DOC_BUILD_LIST = @DOC_BUILD_LIST@
|
||||
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@
|
||||
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_LIBS = @LIBHAL_LIBS@
|
||||
LIBNEON_CFLAGS = @LIBNEON_CFLAGS@
|
||||
LIBNEON_LIBS = @LIBNEON_LIBS@
|
||||
LIBNETSNMP_CFLAGS = @LIBNETSNMP_CFLAGS@
|
||||
LIBNETSNMP_LIBS = @LIBNETSNMP_LIBS@
|
||||
LIBOBJS = @LIBOBJS@
|
||||
LIBPOWERMAN_CFLAGS = @LIBPOWERMAN_CFLAGS@
|
||||
LIBPOWERMAN_LIBS = @LIBPOWERMAN_LIBS@
|
||||
LIBS = @LIBS@
|
||||
LIBSSL_CFLAGS = @LIBSSL_CFLAGS@
|
||||
LIBSSL_LIBS = @LIBSSL_LIBS@
|
||||
LIBTOOL = @LIBTOOL@
|
||||
LIBUSB_CFLAGS = @LIBUSB_CFLAGS@
|
||||
LIBUSB_LIBS = @LIBUSB_LIBS@
|
||||
LIBWRAP_CFLAGS = @LIBWRAP_CFLAGS@
|
||||
LIBWRAP_LIBS = @LIBWRAP_LIBS@
|
||||
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 = gen-nutupsconf-aug.py nutupsconf.aug.tpl \
|
||||
README tests/test_nut.aug
|
||||
|
||||
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/augeas/Makefile'; \
|
||||
$(am__cd) $(top_srcdir) && \
|
||||
$(AUTOMAKE) --gnu scripts/augeas/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):
|
||||
nutnutconf.aug: $(top_builddir)/config.status $(srcdir)/nutnutconf.aug.in
|
||||
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
|
||||
nutupsconf.aug: $(top_builddir)/config.status $(srcdir)/nutupsconf.aug.in
|
||||
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
|
||||
nutupsdconf.aug: $(top_builddir)/config.status $(srcdir)/nutupsdconf.aug.in
|
||||
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
|
||||
nutupsdusers.aug: $(top_builddir)/config.status $(srcdir)/nutupsdusers.aug.in
|
||||
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
|
||||
nutupsmonconf.aug: $(top_builddir)/config.status $(srcdir)/nutupsmonconf.aug.in
|
||||
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
|
||||
nutupsschedconf.aug: $(top_builddir)/config.status $(srcdir)/nutupsschedconf.aug.in
|
||||
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
|
||||
nuthostsconf.aug: $(top_builddir)/config.status $(srcdir)/nuthostsconf.aug.in
|
||||
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
|
||||
nutupssetconf.aug: $(top_builddir)/config.status $(srcdir)/nutupssetconf.aug.in
|
||||
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
|
||||
|
||||
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
|
||||
$(MAKE) $(AM_MAKEFLAGS) \
|
||||
top_distdir="$(top_distdir)" distdir="$(distdir)" \
|
||||
dist-hook
|
||||
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 \
|
||||
dist-hook 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
|
||||
|
||||
|
||||
# only call the script to generate Augeas ups.conf lens upon "make dist",
|
||||
# and if Python is present
|
||||
dist-hook:
|
||||
@if python -c pass; then \
|
||||
echo "Regenerating Augeas ups.conf lens."; \
|
||||
$(distdir)/gen-nutupsconf-aug.py $(distdir)/; \
|
||||
else \
|
||||
echo "----------------------------------------------------------------------"; \
|
||||
echo "Warning: Python is not available."; \
|
||||
echo "Skipping Augeas ups.conf lens regeneration."; \
|
||||
echo "----------------------------------------------------------------------"; \
|
||||
fi
|
||||
|
||||
# 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:
|
||||
205
scripts/augeas/README
Normal file
205
scripts/augeas/README
Normal file
|
|
@ -0,0 +1,205 @@
|
|||
NUT configuration management with Augeas
|
||||
========================================
|
||||
|
||||
Introduction
|
||||
------------
|
||||
|
||||
Configuration has long been one of the two main NUT weaknesses. This is
|
||||
mostly due to the framework nature of NUT, and its many components and
|
||||
features, which make NUT configuration a very complex task.
|
||||
|
||||
In order to address this point, NUT now provides configuration tools and
|
||||
manipulation abstraction, to anybody who want to manipulate NUT configuration,
|
||||
through Augeas lenses and modules.
|
||||
|
||||
From link:http://augeas.net[Augeas homepage]:
|
||||
|
||||
"Augeas is a configuration editing tool. It parses configuration files in their
|
||||
native formats and transforms them into a tree. Configuration changes are made
|
||||
by manipulating this tree and saving it back into native config files."
|
||||
|
||||
In other words, Augeas is the dreamed Registry, with all the advantages
|
||||
(such as a uniform interface and tools), and the added bonus of being
|
||||
free/libre open source software and letting liberty on configuration file
|
||||
format.
|
||||
|
||||
Requirements
|
||||
------------
|
||||
|
||||
To be able to use Augeas with NUT, you will need to install Augeas,
|
||||
and also the NUT provided lenses, which describe NUT configuration
|
||||
files format.
|
||||
|
||||
Augeas
|
||||
~~~~~~
|
||||
|
||||
Having link:http://augeas.net[Augeas] installed.
|
||||
You will need at least version 0.5.1 (prior versions may work too, reports
|
||||
are welcome).
|
||||
|
||||
As an example, on Debian and derivatives, do the following:
|
||||
|
||||
$ apt-get install augeas-lenses augeas-tools
|
||||
|
||||
And optionaly:
|
||||
|
||||
$ apt-get install libaugeas0 libaugeas-dev python-augeas
|
||||
|
||||
On RedHat and derivatives, you have to install the packages 'augeas' and
|
||||
'augeas-libs'.
|
||||
|
||||
[[augeas_user]]
|
||||
|
||||
NUT lenses and modules for Augeas
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
These are the *.aug files in the present directory.
|
||||
|
||||
You can either install the files to the right location on your system,
|
||||
generally in '/usr/share/augeas/lenses/', or use these from NUT
|
||||
source directory ('nut/scripts/augeas'). The latter is to be prefered for
|
||||
the time being.
|
||||
|
||||
|
||||
Create a test sandbox
|
||||
---------------------
|
||||
|
||||
NOTE: for now, it's easier to include an existing /etc/nut/ directory.
|
||||
|
||||
$ export AUGEAS_ROOT=./augeas-sandbox
|
||||
$ mkdir $AUGEAS_ROOT
|
||||
$ sudo cp -pr /etc/nut $AUGEAS_ROOT
|
||||
$ sudo chown -R $(id -nu):$(id -ng) $AUGEAS_ROOT
|
||||
|
||||
|
||||
Start testing and using
|
||||
-----------------------
|
||||
|
||||
Augeas provides many tools and
|
||||
link:http://augeas.net/download.html[languages bindings] (Python, Perl,
|
||||
Java, PHP, Ruby, ...), still with the same simple logic.
|
||||
|
||||
This chapter will only illustrate some of these. Refer to the language
|
||||
binding's help and link:http://augeas.net/docs/index.html[Augeas documentation]
|
||||
for more information.
|
||||
|
||||
|
||||
Shell
|
||||
~~~~~
|
||||
|
||||
Start an augeas shell using:
|
||||
|
||||
$ augtool -b
|
||||
|
||||
NOTE: if you have not installed NUT lenses, add '-I/path/to/nut/scripts/augeas'.
|
||||
|
||||
From there, you can perform different actions like:
|
||||
|
||||
- list existing nut related files:
|
||||
|
||||
augtool> ls /files/etc/nut/
|
||||
nut.conf/ = (none)
|
||||
upsd.users/ = (none)
|
||||
upsmon.conf = (none)
|
||||
ups.conf/ = (none)
|
||||
upsd.conf/ = (none
|
||||
+
|
||||
or using:
|
||||
+
|
||||
augtool> match /files/etc/nut/*
|
||||
/files/etc/nut/nut.conf = (none)
|
||||
/files/etc/nut/upsd.users = (none)
|
||||
/files/etc/nut/upsmon.conf = (none)
|
||||
/files/etc/nut/ups.conf = (none)
|
||||
/files/etc/nut/upsd.conf = (none)
|
||||
|
||||
NOTE: if you don't see anything, you may search for error messages by using:
|
||||
+
|
||||
augtool> ls /augeas/files/etc/nut/*/errors
|
||||
and
|
||||
augtool> get /augeas/files/etc/nut/ups.conf/error/message
|
||||
/augeas/files/etc/nut/ups.conf/error/message = Permission denied
|
||||
|
||||
- create a new device entry (in ups.conf), called 'augtest':
|
||||
|
||||
augtool> set /files/etc/nut/ups.conf/augtest/driver dummy-ups
|
||||
augtool> set /files/etc/nut/ups.conf/augtest/port auto
|
||||
augtool> save
|
||||
|
||||
- list the devices using the 'usbhid-ups' driver:
|
||||
|
||||
augtool> match /files/etc/nut/ups.conf/*/driver dummy-ups
|
||||
|
||||
|
||||
C
|
||||
~
|
||||
|
||||
A library is available for C programs, along with pkg-config support.
|
||||
|
||||
You can get the compilation and link flags using the following code
|
||||
in your configure script or Makefile:
|
||||
|
||||
CFLAGS="`pkg-config --silence-errors --cflags augeas`"
|
||||
LDFLAGS="`pkg-config --silence-errors --libs augeas`"
|
||||
|
||||
Here is an code sample using this library for NUT configuration:
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
augeas *a = aug_init(NULL, NULL, AUG_NONE);
|
||||
ret = aug_match(a, "/files/etc/nut/*", &matches_p);
|
||||
ret = aug_set(a, "/files/etc/nut/ups.conf/augtest/driver", "dummy-ups");
|
||||
ret = aug_set(a, "/files/etc/nut/ups.conf/augtest/port", "auto");
|
||||
ret = aug_save(a);
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
Python
|
||||
~~~~~~
|
||||
|
||||
The `augeas` class abstracts access to the configuration files.
|
||||
|
||||
$ python
|
||||
Python 2.5.1 (r251:54863, Apr 8 2008, 01:19:33)
|
||||
[GCC 4.3.0 20080404 (Red Hat 4.3.0-6)] on linux2
|
||||
Type "help", "copyright", "credits" or "license" for more information.
|
||||
>>> import augeas
|
||||
>>> a = augeas.augeas()
|
||||
>>> a.match("/files/etc/nut/*")
|
||||
['/files/etc/nut/upsd.users', '/files/etc/nut/upsmon.conf', '/files/etc/nut/ups.conf', '/files/etc/nut/upsd.conf']
|
||||
>>> a.set("/files/etc/nut/ups.conf/augtest/driver", "dummy-ups")
|
||||
True
|
||||
>>> a.set("/files/etc/nut/ups.conf/augtest/port", "auto")
|
||||
True
|
||||
>>> a.save()
|
||||
True
|
||||
>>>
|
||||
|
||||
$ grep -A 2 augtest /etc/nut/ups.conf
|
||||
[augtest]
|
||||
driver=dummy-ups
|
||||
port=auto
|
||||
|
||||
|
||||
Perl
|
||||
~~~~
|
||||
|
||||
The Perl binding is available through CPAN and packages.
|
||||
|
||||
use Config::Augeas;
|
||||
|
||||
my $aug = Config::Augeas->new( root => $aug_root ) ;
|
||||
|
||||
my @a = $aug->match("/files/etc/nut/*") ;
|
||||
my $nb = $aug->count_match("/files/etc/nut/*") ;
|
||||
|
||||
$aug->set("/files/etc/nut/ups.conf/augtest/driver", "dummy-ups") ;
|
||||
$aug->set("/files/etc/nut/ups.conf/augtest/port", "auto") ;
|
||||
|
||||
$aug->save ;
|
||||
|
||||
|
||||
Test the conformity testing module
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
Existing configuration files can be tested for conformity. To do so, use:
|
||||
|
||||
$ augparse -I ./ ./test_nut.aug
|
||||
119
scripts/augeas/gen-nutupsconf-aug.py
Executable file
119
scripts/augeas/gen-nutupsconf-aug.py
Executable file
|
|
@ -0,0 +1,119 @@
|
|||
#!/usr/bin/env python
|
||||
# Copyright (C) 2010 - Arnaud Quette <arnaud.quette@gmail.com>
|
||||
#
|
||||
# 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
|
||||
|
||||
# This program extracts all drivers specific variables, declared
|
||||
# using 'addvar()' and output a complete ups.conf lens for Augeas
|
||||
|
||||
import sys
|
||||
import re
|
||||
import glob
|
||||
import codecs
|
||||
|
||||
# Return a sorted list of unique entries, based on the input 'list'
|
||||
def sortUnique(list):
|
||||
newVarList = []
|
||||
prevVar = ''
|
||||
|
||||
# sort the list
|
||||
list.sort()
|
||||
|
||||
for curVariable in list:
|
||||
if curVariable != prevVar:
|
||||
newVarList.append(curVariable)
|
||||
prevVar = curVariable
|
||||
|
||||
return newVarList
|
||||
|
||||
# Grep for 'string' pattern in the text 'list',
|
||||
# excluding C/C++ styles comments
|
||||
# Return the list of matching lines
|
||||
def grep(string,list):
|
||||
matchList = []
|
||||
expr = re.compile(string)
|
||||
for text in list:
|
||||
match = expr.search(text)
|
||||
if match != None:
|
||||
# Exclude comments
|
||||
exprComment = re.compile('(/\*([^*]|(\*+[^*/]))*\*+/)|(//.*)')
|
||||
if (exprComment.search(match.string) == None):
|
||||
matchList.append(match.string)
|
||||
|
||||
return matchList
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
||||
rawCount = 0
|
||||
global finalCount
|
||||
variableNames = []
|
||||
specificVars = ""
|
||||
global inLensContent
|
||||
global finalLensContent
|
||||
Exceptionlist = ['../../drivers/main.c', '../../drivers/skel.c']
|
||||
outputFilename = 'nutupsconf.aug.in'
|
||||
templateFilename = 'nutupsconf.aug.tpl'
|
||||
dirPrefix = ''
|
||||
|
||||
if (len(sys.argv) == 2):
|
||||
dirPrefix = sys.argv[1]
|
||||
print dirPrefix
|
||||
|
||||
# 1/ Extract all specific drivers parameters, in a sorted list with unique entries
|
||||
# 1.1/ List all drivers implementation files
|
||||
for filename in glob.glob('../../drivers/*.c'):
|
||||
# 1.2/ Exclude main.c, which defines addvar() and skel.c (example driver)
|
||||
if filename not in Exceptionlist:
|
||||
fd = codecs.open(filename, encoding='utf-8')
|
||||
# 1.3/ Grep for the "addvar(..." pattern
|
||||
matchResults = grep ('.*addvar[\ ]*\(.*(VAR_FLAG|VAR_VALUE)*,.*', fd)
|
||||
|
||||
# 1.4/ Extract variable names
|
||||
for line in matchResults:
|
||||
row = line.split(',')
|
||||
if len(row) >= 2:
|
||||
# Absence of quotes indicate that we have a #define
|
||||
# Let's grep in .ch related files
|
||||
if (row[1].find('"') == -1):
|
||||
for defFilename in glob.glob(filename.replace('.c', '.[ch]')):
|
||||
defFd = codecs.open(defFilename, encoding='utf-8')
|
||||
matchString = '^#define.*' + row[1].replace('"', '').lstrip() + '.*'
|
||||
matchResult = grep (matchString, defFd)
|
||||
for varDefine in matchResult:
|
||||
# Now search for a string
|
||||
defRow = re.findall(r'"([^"]*)",?', varDefine)
|
||||
if (len(defRow) == 1):
|
||||
variableNames.append(defRow[0])
|
||||
else:
|
||||
# Remove quotes
|
||||
variableNames.append(row[1].replace('"', '').lstrip())
|
||||
|
||||
# Filter multiply defined variables
|
||||
variableNames = sortUnique(variableNames)
|
||||
|
||||
# Create the formated list of specific variables
|
||||
for name in variableNames:
|
||||
specificVars += " | \"%s\"\n" %(name)
|
||||
|
||||
# 2/ Load the template lens
|
||||
tplFd = codecs.open(dirPrefix + templateFilename, encoding='utf-8')
|
||||
|
||||
# 2.1/ Search for the pattern to replace
|
||||
outputText = tplFd.read()
|
||||
outputText = outputText.replace('@SPECIFIC_DRV_VARS@', specificVars)
|
||||
|
||||
# 3/ Output final lens
|
||||
outFd = codecs.open(outputFilename, mode='w', encoding='utf-8')
|
||||
outFd.write(outputText)
|
||||
45
scripts/augeas/nuthostsconf.aug.in
Normal file
45
scripts/augeas/nuthostsconf.aug.in
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
(*
|
||||
Module: NutHostsConf
|
||||
Parses @CONFPATH@/hosts.conf
|
||||
|
||||
Author: Frederic Bohe <fredericbohe@eaton.com>
|
||||
|
||||
About: License
|
||||
This file is licensed under the GPL.
|
||||
|
||||
About: Lens Usage
|
||||
Sample usage of this lens in augtool
|
||||
|
||||
* Print all monitored upsd
|
||||
> print /files@CONFPATH@/hosts.conf/MONITOR
|
||||
|
||||
About: Configuration files
|
||||
This lens applies to @CONFPATH@/hosts.conf. See <filter>.
|
||||
*)
|
||||
|
||||
module NutHostsConf =
|
||||
autoload hosts_xfm
|
||||
|
||||
(************************************************************************
|
||||
* Group: HOSTS.CONF
|
||||
*************************************************************************)
|
||||
|
||||
(* general *)
|
||||
let del_spc = Util.del_opt_ws ""
|
||||
let sep_spc = Util.del_ws_spc
|
||||
let eol = Util.eol
|
||||
let word = /[^"#; \t\n]+/
|
||||
let empty = Util.empty
|
||||
let comment = Util.comment
|
||||
let quoted_string = del "\"" "\"" . store /[^"\n]+/ . del "\"" "\""
|
||||
|
||||
let hosts_notify = [ del_spc . key "MONITOR" . sep_spc
|
||||
. [ label "system" . store word . sep_spc ]
|
||||
. [ label "description" . quoted_string ] . eol ]
|
||||
|
||||
let hosts_lns = (hosts_notify|comment|empty)*
|
||||
|
||||
let hosts_filter = ( incl "@CONFPATH@/hosts.conf" )
|
||||
. Util.stdexcl
|
||||
|
||||
let hosts_xfm = transform hosts_lns hosts_filter
|
||||
48
scripts/augeas/nutnutconf.aug.in
Normal file
48
scripts/augeas/nutnutconf.aug.in
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
(*
|
||||
Module: NutNutConf
|
||||
Parses @CONFPATH@/nut.conf
|
||||
|
||||
Author: Frederic Bohe <fredericbohe@eaton.com>
|
||||
|
||||
About: License
|
||||
This file is licensed under the GPL.
|
||||
|
||||
About: Lens Usage
|
||||
Sample usage of this lens in augtool
|
||||
|
||||
* Print NUT MODE start-up configuration:
|
||||
> print /files@CONFPATH@/nut.conf/MODE
|
||||
|
||||
About: Configuration files
|
||||
This lens applies to @CONFPATH@/nut.conf. See <filter>.
|
||||
*)
|
||||
|
||||
module NutNutConf =
|
||||
autoload nut_xfm
|
||||
|
||||
|
||||
(************************************************************************
|
||||
* Group: NUT.CONF
|
||||
*************************************************************************)
|
||||
|
||||
(* general *)
|
||||
let def_sep = IniFile.sep IniFile.sep_re IniFile.sep_default
|
||||
let sep_spc = Util.del_opt_ws ""
|
||||
let eol = Util.eol
|
||||
let comment = Util.comment
|
||||
let empty = Util.empty
|
||||
|
||||
|
||||
let nut_possible_mode = "none"
|
||||
| "standalone"
|
||||
| "netserver"
|
||||
| "netclient"
|
||||
|
||||
let nut_mode = [ sep_spc . key "MODE" . def_sep . sep_spc . store nut_possible_mode . eol ]
|
||||
|
||||
let nut_lns = (nut_mode|comment|empty)*
|
||||
|
||||
let nut_filter = ( incl "@CONFPATH@/nut.conf" )
|
||||
. Util.stdexcl
|
||||
|
||||
let nut_xfm = transform nut_lns nut_filter
|
||||
159
scripts/augeas/nutupsconf.aug.in
Normal file
159
scripts/augeas/nutupsconf.aug.in
Normal file
|
|
@ -0,0 +1,159 @@
|
|||
(*
|
||||
Module: NutUpsConf
|
||||
Parses @CONFPATH@/ups.conf
|
||||
|
||||
Author: Raphael Pinson <raphink@gmail.com>
|
||||
Frederic Bohe <fredericbohe@eaton.com>
|
||||
Arnaud Quette <arnaud.quette@gmail.com>
|
||||
|
||||
About: License
|
||||
This file is licensed under the GPL.
|
||||
|
||||
About: Lens Usage
|
||||
Sample usage of this lens in augtool
|
||||
|
||||
* Print all drivers used
|
||||
> print /files/@CONFPATH@/ups.conf/*/driver
|
||||
|
||||
About: Configuration files
|
||||
This lens applies to @CONFPATH@/ups.conf. See <filter>.
|
||||
*)
|
||||
|
||||
module NutUpsConf =
|
||||
autoload ups_xfm
|
||||
|
||||
(************************************************************************
|
||||
* Group: UPS.CONF
|
||||
*************************************************************************)
|
||||
|
||||
let ups_comment = IniFile.comment IniFile.comment_re IniFile.comment_default
|
||||
|
||||
let ups_sep = IniFile.sep IniFile.sep_re IniFile.sep_default
|
||||
|
||||
let ups_global = "chroot"
|
||||
| "driverpath"
|
||||
| "maxstartdelay"
|
||||
| "pollinterval"
|
||||
| "user"
|
||||
|
||||
let ups_fields = "driver"
|
||||
| "port"
|
||||
| "sdorder"
|
||||
| "desc"
|
||||
| "nolock"
|
||||
| "maxstartdelay"
|
||||
| "CP"
|
||||
| "CS"
|
||||
| "ID"
|
||||
| "LB"
|
||||
| "LowBatt"
|
||||
| "OL"
|
||||
| "OffDelay"
|
||||
| "OnDelay"
|
||||
| "SD"
|
||||
| "authPassword"
|
||||
| "authProtocol"
|
||||
| "batteryPercentage"
|
||||
| "battext"
|
||||
| "baud_rate"
|
||||
| "baudrate"
|
||||
| "bus"
|
||||
| "cable"
|
||||
| "cablepower"
|
||||
| "chargetime"
|
||||
| "community"
|
||||
| "daysoff"
|
||||
| "daysweek"
|
||||
| "dumbterm"
|
||||
| "explore"
|
||||
| "fake_lowbatt"
|
||||
| "flash"
|
||||
| "frequency"
|
||||
| "full_update"
|
||||
| "houroff"
|
||||
| "houron"
|
||||
| "idleload"
|
||||
| "input_timeout"
|
||||
| "linevoltage"
|
||||
| "load.off"
|
||||
| "load.on"
|
||||
| "load.status"
|
||||
| "loadPercentage"
|
||||
| "login"
|
||||
| "lowbatt"
|
||||
| "manufacturer"
|
||||
| "max_load"
|
||||
| "methodOfFlowControl"
|
||||
| "mfr"
|
||||
| "mibs"
|
||||
| "mincharge"
|
||||
| "minruntime"
|
||||
| "model"
|
||||
| "modelname"
|
||||
| "nohang"
|
||||
| "nombattvolt"
|
||||
| "norating"
|
||||
| "notification"
|
||||
| "notransferoids"
|
||||
| "novendor"
|
||||
| "nowarn_noimp"
|
||||
| "numOfBytesFromUPS"
|
||||
| "offdelay"
|
||||
| "oldmac"
|
||||
| "ondelay"
|
||||
| "output_pace"
|
||||
| "password"
|
||||
| "pollfreq"
|
||||
| "pollonly"
|
||||
| "powerup"
|
||||
| "prefix"
|
||||
| "prgshut"
|
||||
| "privPassword"
|
||||
| "privProtocol"
|
||||
| "product"
|
||||
| "productid"
|
||||
| "protocol"
|
||||
| "rebootdelay"
|
||||
| "runtimecal"
|
||||
| "sdtime"
|
||||
| "sdtype"
|
||||
| "secLevel"
|
||||
| "secName"
|
||||
| "serial"
|
||||
| "serialnumber"
|
||||
| "shutdownArguments"
|
||||
| "shutdown_delay"
|
||||
| "silent"
|
||||
| "snmp_version"
|
||||
| "startdelay"
|
||||
| "status_only"
|
||||
| "subdriver"
|
||||
| "subscribe"
|
||||
| "testtime"
|
||||
| "timeout"
|
||||
| "type"
|
||||
| "ups.delay.shutdown"
|
||||
| "ups.delay.start"
|
||||
| "upstype"
|
||||
| "usd"
|
||||
| "use_crlf"
|
||||
| "use_pre_lf"
|
||||
| "validationSequence"
|
||||
| "vendor"
|
||||
| "vendorid"
|
||||
| "voltage"
|
||||
| "wait"
|
||||
|
||||
|
||||
let ups_entry = IniFile.indented_entry (ups_global|ups_fields) ups_sep ups_comment
|
||||
|
||||
let ups_title = IniFile.indented_title IniFile.record_re
|
||||
|
||||
let ups_record = IniFile.record ups_title ups_entry
|
||||
|
||||
let ups_lns = IniFile.lns ups_record ups_comment
|
||||
|
||||
let ups_filter = (incl "@CONFPATH@/ups.conf")
|
||||
. Util.stdexcl
|
||||
|
||||
let ups_xfm = transform ups_lns ups_filter
|
||||
58
scripts/augeas/nutupsconf.aug.tpl
Normal file
58
scripts/augeas/nutupsconf.aug.tpl
Normal file
|
|
@ -0,0 +1,58 @@
|
|||
(*
|
||||
Module: NutUpsConf
|
||||
Parses @CONFPATH@/ups.conf
|
||||
|
||||
Author: Raphael Pinson <raphink@gmail.com>
|
||||
Frederic Bohe <fredericbohe@eaton.com>
|
||||
Arnaud Quette <arnaud.quette@gmail.com>
|
||||
|
||||
About: License
|
||||
This file is licensed under the GPL.
|
||||
|
||||
About: Lens Usage
|
||||
Sample usage of this lens in augtool
|
||||
|
||||
* Print all drivers used
|
||||
> print /files/@CONFPATH@/ups.conf/*/driver
|
||||
|
||||
About: Configuration files
|
||||
This lens applies to @CONFPATH@/ups.conf. See <filter>.
|
||||
*)
|
||||
|
||||
module NutUpsConf =
|
||||
autoload ups_xfm
|
||||
|
||||
(************************************************************************
|
||||
* Group: UPS.CONF
|
||||
*************************************************************************)
|
||||
|
||||
let ups_comment = IniFile.comment IniFile.comment_re IniFile.comment_default
|
||||
|
||||
let ups_sep = IniFile.sep IniFile.sep_re IniFile.sep_default
|
||||
|
||||
let ups_global = "chroot"
|
||||
| "driverpath"
|
||||
| "maxstartdelay"
|
||||
| "pollinterval"
|
||||
| "user"
|
||||
|
||||
let ups_fields = "driver"
|
||||
| "port"
|
||||
| "sdorder"
|
||||
| "desc"
|
||||
| "nolock"
|
||||
| "maxstartdelay"
|
||||
@SPECIFIC_DRV_VARS@
|
||||
|
||||
let ups_entry = IniFile.indented_entry (ups_global|ups_fields) ups_sep ups_comment
|
||||
|
||||
let ups_title = IniFile.indented_title IniFile.record_re
|
||||
|
||||
let ups_record = IniFile.record ups_title ups_entry
|
||||
|
||||
let ups_lns = IniFile.lns ups_record ups_comment
|
||||
|
||||
let ups_filter = (incl "@CONFPATH@/ups.conf")
|
||||
. Util.stdexcl
|
||||
|
||||
let ups_xfm = transform ups_lns ups_filter
|
||||
65
scripts/augeas/nutupsdconf.aug.in
Normal file
65
scripts/augeas/nutupsdconf.aug.in
Normal file
|
|
@ -0,0 +1,65 @@
|
|||
(*
|
||||
Module: NutUpsdConf
|
||||
Parses @CONFPATH@/upsd.conf
|
||||
|
||||
Author: Raphael Pinson <raphink@gmail.com>
|
||||
Frederic Bohe <fredericbohe@eaton.com>
|
||||
Arnaud Quette <arnaud.quette@gmail.com>
|
||||
|
||||
About: License
|
||||
This file is licensed under the GPL.
|
||||
|
||||
About: Lens Usage
|
||||
Sample usage of this lens in augtool
|
||||
|
||||
* Print all network interface upsd will listen to
|
||||
> print /files@CONFPATH@/upsd.conf/LISTEN
|
||||
|
||||
About: Configuration files
|
||||
This lens applies to @CONFPATH@/upsd.conf. See <filter>.
|
||||
|
||||
*)
|
||||
|
||||
module NutUpsdConf =
|
||||
autoload upsd_xfm
|
||||
|
||||
(************************************************************************
|
||||
* Group: UPSD.CONF
|
||||
*************************************************************************)
|
||||
|
||||
(* general *)
|
||||
let sep_spc = Util.del_ws_spc
|
||||
let opt_spc = Util.del_opt_ws ""
|
||||
let eol = Util.eol
|
||||
let ip = /[0-9A-Za-z\.:]+/
|
||||
let num = /[0-9]+/
|
||||
let word = /[^"#; \t\n]+/
|
||||
let empty = Util.empty
|
||||
let comment = Util.comment
|
||||
let path = word
|
||||
|
||||
let upsd_maxage = [ opt_spc . key "MAXAGE" . sep_spc . store num . eol ]
|
||||
let upsd_statepath = [ opt_spc . key "STATEPATH" . sep_spc . store path . eol ]
|
||||
let upsd_listen = [ opt_spc . key "LISTEN" . sep_spc
|
||||
. [ label "interface" . store ip ]
|
||||
. [ sep_spc . label "port" . store num]? ]
|
||||
let upsd_listen_list = upsd_listen . eol
|
||||
let upsd_maxconn = [ opt_spc . key "MAXCONN" . sep_spc . store num . eol ]
|
||||
let upsd_certfile = [ opt_spc . key "CERTFILE" . sep_spc . store path . eol ]
|
||||
|
||||
(************************************************************************
|
||||
* MAXAGE seconds
|
||||
* STATEPATH path
|
||||
* LISTEN interface port
|
||||
* Multiple LISTEN addresses may be specified. The default is to bind to 0.0.0.0 if no LISTEN addresses are specified.
|
||||
* LISTEN 127.0.0.1 LISTEN 192.168.50.1 LISTEN ::1 LISTEN 2001:0db8:1234:08d3:1319:8a2e:0370:7344
|
||||
*
|
||||
*************************************************************************)
|
||||
let upsd_other = upsd_maxage | upsd_statepath | upsd_listen_list | upsd_maxconn | upsd_certfile
|
||||
|
||||
let upsd_lns = (upsd_other|comment|empty)*
|
||||
|
||||
let upsd_filter = (incl "@CONFPATH@/upsd.conf")
|
||||
. Util.stdexcl
|
||||
|
||||
let upsd_xfm = transform upsd_lns upsd_filter
|
||||
83
scripts/augeas/nutupsdusers.aug.in
Normal file
83
scripts/augeas/nutupsdusers.aug.in
Normal file
|
|
@ -0,0 +1,83 @@
|
|||
(*
|
||||
Module: NutUpsdUsers
|
||||
Parses @CONFPATH@/upsd.users
|
||||
|
||||
Author: Raphael Pinson <raphink@gmail.com>
|
||||
Frederic Bohe <fredericbohe@eaton.com>
|
||||
|
||||
About: License
|
||||
This file is licensed under the GPL.
|
||||
|
||||
About: Lens Usage
|
||||
Sample usage of this lens in augtool
|
||||
|
||||
* Print all users granted to send commands to UPS
|
||||
> /files@CONFPATH@/upsd.users/fred/actions/SET
|
||||
|
||||
About: Configuration files
|
||||
This lens applies to @CONFPATH@/upsd.users. See <filter>.
|
||||
*)
|
||||
|
||||
module NutUpsdUsers =
|
||||
autoload upsd_users_xfm
|
||||
|
||||
(************************************************************************
|
||||
* Group: UPSD.USERS
|
||||
*************************************************************************)
|
||||
|
||||
(* general *)
|
||||
let del_spc = Util.del_opt_ws ""
|
||||
let sep_spc = Util.del_ws_spc
|
||||
let eol = Util.eol
|
||||
let ip = /[0-9A-Za-z\.:]+/
|
||||
let num = /[0-9]+/
|
||||
let word = /[^"#; \t\n]+/
|
||||
let empty = Util.empty
|
||||
(* let netblock = /[0-9A-Za-z\.:\/]+/ *)
|
||||
let netblock = word
|
||||
let path = word
|
||||
|
||||
let upsd_users_comment = IniFile.comment IniFile.comment_re IniFile.comment_default
|
||||
|
||||
let upsd_users_sep = IniFile.sep IniFile.sep_re IniFile.sep_default
|
||||
|
||||
let upsd_users_fields = "password"
|
||||
| "instcmds"
|
||||
|
||||
let upsd_users_entry = IniFile.indented_entry upsd_users_fields upsd_users_sep upsd_users_comment
|
||||
|
||||
let upsd_users_actions_entry = [ key /SET|FSD/ ]
|
||||
|
||||
let upsd_users_actions = [ del_spc
|
||||
. key "actions" . upsd_users_sep
|
||||
. del_spc
|
||||
. upsd_users_actions_entry
|
||||
. ( sep_spc . upsd_users_actions_entry )*
|
||||
. ( upsd_users_comment|eol ) ]
|
||||
|
||||
(* FIXME: NEEDED? can be all, or a list of instant commands *)
|
||||
let upsd_users_instcmds_entry = [ key /ALL|FSD/ ]
|
||||
|
||||
let upsd_users_instcmds = [ del_spc
|
||||
. key "instcmds" . upsd_users_sep
|
||||
. del_spc
|
||||
. upsd_users_instcmds_entry
|
||||
. ( sep_spc . upsd_users_instcmds_entry )*
|
||||
. ( upsd_users_comment|eol ) ]
|
||||
|
||||
let upsd_users_upsmon = [ del_spc
|
||||
. key "upsmon" . sep_spc
|
||||
. store /master|slave/ . eol ]
|
||||
|
||||
let upsd_users_title = IniFile.indented_title IniFile.record_re
|
||||
|
||||
let upsd_users_record = IniFile.record upsd_users_title (upsd_users_entry|upsd_users_actions|upsd_users_upsmon)
|
||||
|
||||
let upsd_users_lns = IniFile.lns upsd_users_record upsd_users_comment
|
||||
|
||||
let upsd_users_filter = ( incl "@CONFPATH@/upsd.users" )
|
||||
. Util.stdexcl
|
||||
|
||||
let upsd_users_xfm = transform upsd_users_lns upsd_users_filter
|
||||
|
||||
|
||||
122
scripts/augeas/nutupsmonconf.aug.in
Normal file
122
scripts/augeas/nutupsmonconf.aug.in
Normal file
|
|
@ -0,0 +1,122 @@
|
|||
(*
|
||||
Module: NutUpsmonConf
|
||||
Parses @CONFPATH@/upsmon.conf
|
||||
|
||||
Author: Raphael Pinson <raphink@gmail.com>
|
||||
Frederic Bohe <fredericbohe@eaton.com>
|
||||
|
||||
About: License
|
||||
This file is licensed under the GPL.
|
||||
|
||||
About: Lens Usage
|
||||
Sample usage of this lens in augtool
|
||||
|
||||
* Print all notification messages
|
||||
> print /files@CONFPATH@/upsmon.conf/NOTIFYMSG
|
||||
|
||||
About: Configuration files
|
||||
This lens applies to @CONFPATH@/upsmon.conf. See <filter>.
|
||||
*)
|
||||
|
||||
module NutUpsmonConf =
|
||||
autoload upsmon_xfm
|
||||
|
||||
|
||||
(************************************************************************
|
||||
* Group: UPSMON.CONF
|
||||
*************************************************************************)
|
||||
|
||||
(* general *)
|
||||
let del_spc = Util.del_opt_ws ""
|
||||
let sep_spc = Util.del_ws_spc
|
||||
let eol = Util.eol
|
||||
let num = /[0-9]+/
|
||||
let word = /[^"#; \t\n]+/
|
||||
let empty = Util.empty
|
||||
let comment = Util.comment
|
||||
let quoted_string = del "\"" "\"" . store /[^"\n]+/ . del "\"" "\""
|
||||
|
||||
(* UPS identifier
|
||||
* <upsname>[@<hostname>[:<port>]]
|
||||
*
|
||||
* There might be a cleaner way to write this
|
||||
* but I'm stuck with (hostname | hostname . port)?
|
||||
*)
|
||||
let hostname = [ label "hostname" . store /[^ \t\n:]+/ ]
|
||||
let port = [ label "port" . store num ]
|
||||
let identifier = [ label "upsname" . store /[^ \t\n@]+/ ]
|
||||
. ( ( Util.del_str "@" . hostname )
|
||||
| ( Util.del_str "@" . hostname
|
||||
. Util.del_str ":" . port ) )?
|
||||
|
||||
|
||||
let upsmon_num_re = "DEADTIME"
|
||||
| "FINALDELAY"
|
||||
| "HOSTSYNC"
|
||||
| "MINSUPPLIES"
|
||||
| "NOCOMMWARNTIME"
|
||||
| "POLLFREQ"
|
||||
| "POLLFREQALERT"
|
||||
| "RBWARNTIME"
|
||||
|
||||
let upsmon_num = [ del_spc . key upsmon_num_re . sep_spc . store num . eol ]
|
||||
|
||||
let upsmon_word = [ del_spc . key "RUN_AS_USER" . sep_spc . store word . eol ]
|
||||
|
||||
let upsmon_file_re = "NOTIFYCMD"
|
||||
| "POWERDOWNFLAG"
|
||||
| "SHUTDOWNCMD"
|
||||
|
||||
let sto_to_eol = IniFile.sto_to_eol
|
||||
(* here we should support both quoted and not quotted
|
||||
* string but I can't manage to find the right way of doing this
|
||||
*)
|
||||
let upsmon_file = [ del_spc . key upsmon_file_re . sto_to_eol . eol ]
|
||||
|
||||
(* MONITOR system powervalue username password type *)
|
||||
let upsmon_monitor = [ del_spc . key "MONITOR" . sep_spc
|
||||
. [ label "system" . identifier ] . sep_spc
|
||||
. [ label "powervalue" . store num ] . sep_spc
|
||||
. [ label "username" . store word ] . sep_spc
|
||||
. [ label "password" . store word ] . sep_spc
|
||||
. [ label "type" . store word ] . eol ]
|
||||
|
||||
let upsmon_notify_type = "ONLINE"
|
||||
| "ONBATT"
|
||||
| "LOWBATT"
|
||||
| "FSD"
|
||||
| "COMMOK"
|
||||
| "COMMBAD"
|
||||
| "SHUTDOWN"
|
||||
| "REPLBATT"
|
||||
| "NOCOMM"
|
||||
| "NOPARENT"
|
||||
|
||||
let upsmon_notify = [ del_spc . key "NOTIFYMSG" . sep_spc
|
||||
. [ label "type" . store upsmon_notify_type . sep_spc ]
|
||||
. [ label "message" . quoted_string ] . eol ]
|
||||
|
||||
let flags = "IGNORE"
|
||||
| "SYSLOG"
|
||||
| "WALL"
|
||||
| "EXEC"
|
||||
|
||||
let plus = [ del /\+*/ "" ]
|
||||
|
||||
(*let entries = /IGNORE|SYSLOG|WALL|EXEC+/*)
|
||||
|
||||
let record = [ seq "record" . plus . store flags ]
|
||||
|
||||
let upsmon_notify_flag = [ counter "record"
|
||||
. del_spc . key "NOTIFYFLAG" . sep_spc
|
||||
. [ label "type" . store upsmon_notify_type . sep_spc ]
|
||||
. record+ . eol ]
|
||||
|
||||
let upsmon_record = upsmon_num|upsmon_word|upsmon_file|upsmon_monitor|upsmon_notify|upsmon_notify_flag
|
||||
|
||||
let upsmon_lns = (upsmon_record|comment|empty)*
|
||||
|
||||
let upsmon_filter = ( incl "@CONFPATH@/upsmon.conf" )
|
||||
. Util.stdexcl
|
||||
|
||||
let upsmon_xfm = transform upsmon_lns upsmon_filter
|
||||
75
scripts/augeas/nutupsschedconf.aug.in
Normal file
75
scripts/augeas/nutupsschedconf.aug.in
Normal file
|
|
@ -0,0 +1,75 @@
|
|||
(*
|
||||
Module: NutUpsSchedConf
|
||||
Parses @CONFPATH@/upssched.conf
|
||||
|
||||
Author: Raphael Pinson <raphink@gmail.com>
|
||||
Frederic Bohe <fredericbohe@eaton.com>
|
||||
|
||||
About: License
|
||||
This file is licensed under the GPL.
|
||||
|
||||
About: Lens Usage
|
||||
Sample usage of this lens in augtool
|
||||
|
||||
* Print the command script:
|
||||
> print /files@CONFPATH@/upssched.conf/CMDSCRIPT
|
||||
|
||||
About: Configuration files
|
||||
This lens applies to @CONFPATH@/upssched.conf. See <filter>.
|
||||
*)
|
||||
|
||||
module NutUpsschedConf =
|
||||
autoload upssched_xfm
|
||||
|
||||
|
||||
(************************************************************************
|
||||
* Group: UPSSCHED.CONF
|
||||
*************************************************************************)
|
||||
|
||||
(* general *)
|
||||
let sep_spc = Util.del_ws_spc
|
||||
let eol = Util.eol
|
||||
let num = /[0-9]+/
|
||||
let word = /[^"#; \t\n]+/
|
||||
let empty = Util.empty
|
||||
let comment = Util.comment
|
||||
|
||||
(* Variable: quoted_word *)
|
||||
let word_space = /"[^"\n]+"/
|
||||
let quoted_word = /"[^" \t\n]+"/
|
||||
|
||||
(* Variable: word_all *)
|
||||
let word_all = word_space | word | quoted_word
|
||||
|
||||
let upssched_re = "CMDSCRIPT"
|
||||
| "PIPEFN"
|
||||
| "LOCKFN"
|
||||
|
||||
let upssched_opt = [ key upssched_re . sep_spc . store word_all . eol ]
|
||||
|
||||
let upssched_start_timer = [ key "START-TIMER" . sep_spc
|
||||
. [ label "timername" . store word ] . sep_spc
|
||||
. [ label "interval" . store num ] ]
|
||||
|
||||
|
||||
let upssched_cancel_timer = [ key "CANCEL-TIMER" . sep_spc
|
||||
. [ label "timername" . store word ]
|
||||
. ( sep_spc . [ label "cmd" . store word_all ])* ]
|
||||
|
||||
let upssched_execute_timer = [ key "EXECUTE" . sep_spc
|
||||
. [ label "command" . store word_all ] ]
|
||||
|
||||
|
||||
let upssched_command = (upssched_start_timer|upssched_cancel_timer|upssched_execute_timer)
|
||||
|
||||
let upssched_at = [ key "AT" . sep_spc
|
||||
. [ label "notifytype" . store word ] . sep_spc
|
||||
. [ label "upsname" . store word ] . sep_spc
|
||||
. upssched_command . eol ]
|
||||
|
||||
let upssched_lns = (upssched_at|upssched_opt|comment|empty)*
|
||||
|
||||
let upssched_filter = ( incl "@CONFPATH@/upssched.conf" )
|
||||
. Util.stdexcl
|
||||
|
||||
let upssched_xfm = transform upssched_lns upssched_filter
|
||||
46
scripts/augeas/nutupssetconf.aug.in
Normal file
46
scripts/augeas/nutupssetconf.aug.in
Normal file
|
|
@ -0,0 +1,46 @@
|
|||
(*
|
||||
Module: NutUpssetConf
|
||||
Parses @CONFPATH@/upsset.conf
|
||||
|
||||
Author: Raphael Pinson <raphink@gmail.com>
|
||||
Frederic Bohe <fredericbohe@eaton.com>
|
||||
|
||||
About: License
|
||||
This file is licensed under the GPL.
|
||||
|
||||
About: Lens Usage
|
||||
Sample usage of this lens in augtool
|
||||
|
||||
* Print the string declaring secured cgi directory:
|
||||
> print /files@CONFPATH@/upsset.conf/auth
|
||||
|
||||
About: Configuration files
|
||||
This lens applies to @CONFPATH@/upsset.conf. See <filter>.
|
||||
*)
|
||||
|
||||
module NutUpssetConf =
|
||||
autoload upsset_xfm
|
||||
|
||||
|
||||
(************************************************************************
|
||||
* Group: UPSSET.CONF
|
||||
*************************************************************************)
|
||||
|
||||
(* general *)
|
||||
let sep_spc = Util.del_opt_ws ""
|
||||
let eol = Util.eol
|
||||
let comment = Util.comment
|
||||
let empty = Util.empty
|
||||
|
||||
|
||||
let upsset_key_word = "I_HAVE_SECURED_MY_CGI_DIRECTORY"
|
||||
|
||||
let upsset_key = [ label "auth" . sep_spc . store upsset_key_word . eol ]
|
||||
|
||||
let upsset_lns = (upsset_key|comment|empty)*
|
||||
|
||||
let upsset_filter = ( incl "@CONFPATH@/upsset.conf" )
|
||||
. Util.stdexcl
|
||||
|
||||
let upsset_xfm = transform upsset_lns upsset_filter
|
||||
|
||||
187
scripts/augeas/tests/test_nut.aug
Normal file
187
scripts/augeas/tests/test_nut.aug
Normal file
|
|
@ -0,0 +1,187 @@
|
|||
(* Tests for the Nut module *)
|
||||
|
||||
module Test_nut =
|
||||
|
||||
let nut_conf = "
|
||||
MODE=standalone
|
||||
"
|
||||
|
||||
test NutNutConf.nut_lns get nut_conf =
|
||||
{ }
|
||||
{ "MODE" = "standalone" }
|
||||
|
||||
let ups_conf = "
|
||||
[testups]
|
||||
driver = dummy-ups
|
||||
port = auto
|
||||
desc = \"Dummy UPS\"
|
||||
"
|
||||
|
||||
test NutUpsConf.ups_lns get ups_conf =
|
||||
{ }
|
||||
{ "testups"
|
||||
{ "driver" = "dummy-ups" }
|
||||
{ "port" = "auto" }
|
||||
{ "desc" = "\"Dummy UPS\"" } }
|
||||
|
||||
|
||||
let upsd_conf = "
|
||||
MAXAGE 30
|
||||
LISTEN 0.0.0.0 3493
|
||||
MAXCONN 1024
|
||||
"
|
||||
|
||||
test NutUpsdConf.upsd_lns get upsd_conf =
|
||||
{ }
|
||||
{ "MAXAGE" = "30" }
|
||||
{ "LISTEN"
|
||||
{ "interface" = "0.0.0.0" }
|
||||
{ "port" = "3493" } }
|
||||
{ "MAXCONN" = "1024" }
|
||||
|
||||
let upsd_users = "
|
||||
[admin]
|
||||
password = upsman
|
||||
actions = SET FSD
|
||||
instcmds = ALL
|
||||
|
||||
[pfy]
|
||||
password = duh
|
||||
instcmds = test.panel.start
|
||||
instcmds = test.panel.stop
|
||||
|
||||
[monmaster]
|
||||
password = blah
|
||||
upsmon master
|
||||
|
||||
[monslave]
|
||||
password = abcd
|
||||
upsmon slave
|
||||
"
|
||||
|
||||
test NutUpsdUsers.upsd_users_lns get upsd_users =
|
||||
{ }
|
||||
{ "admin"
|
||||
{ "password" = "upsman" }
|
||||
{ "actions"
|
||||
{ "SET" }
|
||||
{ "FSD" } }
|
||||
{ "instcmds" = "ALL" }
|
||||
{ } }
|
||||
{ "pfy"
|
||||
{ "password" = "duh" }
|
||||
{ "instcmds" = "test.panel.start" }
|
||||
{ "instcmds" = "test.panel.stop" }
|
||||
{ } }
|
||||
{ "monmaster"
|
||||
{ "password" = "blah" }
|
||||
{ "upsmon" = "master" }
|
||||
{ } }
|
||||
{ "monslave"
|
||||
{ "password" = "abcd" }
|
||||
{ "upsmon" = "slave" } }
|
||||
|
||||
let upsmon_conf = "
|
||||
MONITOR testups@localhost 1 monmaster blah master
|
||||
|
||||
MINSUPPLIES 1
|
||||
SHUTDOWNCMD /sbin/shutdown -h +0
|
||||
POLLFREQ 5
|
||||
POLLFREQALERT 5
|
||||
HOSTSYNC 30
|
||||
DEADTIME 15
|
||||
POWERDOWNFLAG /etc/killpower
|
||||
RBWARNTIME 43200
|
||||
NOCOMMWARNTIME 300
|
||||
FINALDELAY 5
|
||||
"
|
||||
|
||||
test NutUpsmonConf.upsmon_lns get upsmon_conf =
|
||||
{ }
|
||||
{ "MONITOR"
|
||||
{ "system"
|
||||
{ "upsname" = "testups" }
|
||||
{ "hostname" = "localhost" } }
|
||||
{ "powervalue" = "1" }
|
||||
{ "username" = "monmaster" }
|
||||
{ "password" = "blah" }
|
||||
{ "type" = "master" } }
|
||||
{ }
|
||||
{ "MINSUPPLIES" = "1" }
|
||||
{ "SHUTDOWNCMD" = "/sbin/shutdown -h +0" }
|
||||
{ "POLLFREQ" = "5" }
|
||||
{ "POLLFREQALERT" = "5" }
|
||||
{ "HOSTSYNC" = "30" }
|
||||
{ "DEADTIME" = "15" }
|
||||
{ "POWERDOWNFLAG" = "/etc/killpower" }
|
||||
{ "RBWARNTIME" = "43200" }
|
||||
{ "NOCOMMWARNTIME" = "300" }
|
||||
{ "FINALDELAY" = "5" }
|
||||
|
||||
let upsset_conf = "
|
||||
I_HAVE_SECURED_MY_CGI_DIRECTORY
|
||||
"
|
||||
|
||||
test NutUpssetConf.upsset_lns get upsset_conf =
|
||||
{ }
|
||||
{ "auth" = "I_HAVE_SECURED_MY_CGI_DIRECTORY" }
|
||||
|
||||
|
||||
let upssched_conf = "
|
||||
CMDSCRIPT /upssched-cmd
|
||||
PIPEFN /var/state/ups/upssched/upssched.pipe
|
||||
LOCKFN /var/state/ups/upssched/upssched.lock
|
||||
AT COMMBAD * START-TIMER upsgone 10
|
||||
AT COMMOK myups@localhost CANCEL-TIMER upsgone
|
||||
AT ONLINE * EXECUTE ups-back-on-line
|
||||
"
|
||||
|
||||
test NutUpsschedConf.upssched_lns get upssched_conf =
|
||||
{ }
|
||||
{ "CMDSCRIPT" = "/upssched-cmd" }
|
||||
{ "PIPEFN" = "/var/state/ups/upssched/upssched.pipe" }
|
||||
{ "LOCKFN" = "/var/state/ups/upssched/upssched.lock" }
|
||||
{ "AT"
|
||||
{ "notifytype" = "COMMBAD" }
|
||||
{ "upsname" = "*" }
|
||||
{ "START-TIMER"
|
||||
{ "timername" = "upsgone" }
|
||||
{ "interval" = "10" }
|
||||
}
|
||||
}
|
||||
{ "AT"
|
||||
{ "notifytype" = "COMMOK" }
|
||||
{ "upsname" = "myups@localhost" }
|
||||
{ "CANCEL-TIMER"
|
||||
{ "timername" = "upsgone" }
|
||||
}
|
||||
}
|
||||
{ "AT"
|
||||
{ "notifytype" = "ONLINE" }
|
||||
{ "upsname" = "*" }
|
||||
{ "EXECUTE"
|
||||
{ "command" = "ups-back-on-line" }
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
let hosts_conf = "
|
||||
MONITOR myups@localhost \"Local UPS\"
|
||||
MONITOR su2200@10.64.1.1 \"Finance department\"
|
||||
MONITOR matrix@shs-server.example.edu \"Sierra High School data room #1\"
|
||||
"
|
||||
|
||||
test NutHostsConf.hosts_lns get hosts_conf =
|
||||
{ }
|
||||
{ "MONITOR"
|
||||
{ "system" = "myups@localhost" }
|
||||
{ "description" = "Local UPS" }
|
||||
}
|
||||
{ "MONITOR"
|
||||
{ "system" = "su2200@10.64.1.1" }
|
||||
{ "description" = "Finance department" }
|
||||
}
|
||||
{ "MONITOR"
|
||||
{ "system" = "matrix@shs-server.example.edu" }
|
||||
{ "description" = "Sierra High School data room #1" }
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue