Imported Upstream version 2.6.2
This commit is contained in:
parent
a367d9bc54
commit
45043b58d0
246 changed files with 18228 additions and 1415 deletions
|
|
@ -48,6 +48,8 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/ax_compare_version.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_libavahi.m4 \
|
||||
$(top_srcdir)/m4/nut_check_libfreeipmi.m4 \
|
||||
$(top_srcdir)/m4/nut_check_libgd.m4 \
|
||||
$(top_srcdir)/m4/nut_check_libhal.m4 \
|
||||
$(top_srcdir)/m4/nut_check_libneon.m4 \
|
||||
|
|
@ -116,10 +118,14 @@ INSTALL_SCRIPT = @INSTALL_SCRIPT@
|
|||
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
|
||||
LD = @LD@
|
||||
LDFLAGS = @LDFLAGS@
|
||||
LIBAVAHI_CFLAGS = @LIBAVAHI_CFLAGS@
|
||||
LIBAVAHI_LIBS = @LIBAVAHI_LIBS@
|
||||
LIBGD_CFLAGS = @LIBGD_CFLAGS@
|
||||
LIBGD_LDFLAGS = @LIBGD_LDFLAGS@
|
||||
LIBHAL_CFLAGS = @LIBHAL_CFLAGS@
|
||||
LIBHAL_LIBS = @LIBHAL_LIBS@
|
||||
LIBIPMI_CFLAGS = @LIBIPMI_CFLAGS@
|
||||
LIBIPMI_LIBS = @LIBIPMI_LIBS@
|
||||
LIBNEON_CFLAGS = @LIBNEON_CFLAGS@
|
||||
LIBNEON_LIBS = @LIBNEON_LIBS@
|
||||
LIBNETSNMP_CFLAGS = @LIBNETSNMP_CFLAGS@
|
||||
|
|
@ -157,6 +163,10 @@ PACKAGE_TARNAME = @PACKAGE_TARNAME@
|
|||
PACKAGE_URL = @PACKAGE_URL@
|
||||
PACKAGE_VERSION = @PACKAGE_VERSION@
|
||||
PATH_SEPARATOR = @PATH_SEPARATOR@
|
||||
PKG_CONFIG = @PKG_CONFIG@
|
||||
PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
|
||||
PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
|
||||
PORT = @PORT@
|
||||
RANLIB = @RANLIB@
|
||||
RUN_AS_GROUP = @RUN_AS_GROUP@
|
||||
RUN_AS_USER = @RUN_AS_USER@
|
||||
|
|
@ -221,6 +231,8 @@ sbindir = @sbindir@
|
|||
sharedstatedir = @sharedstatedir@
|
||||
srcdir = @srcdir@
|
||||
sysconfdir = @sysconfdir@
|
||||
systemdsystemshutdowndir = @systemdsystemshutdowndir@
|
||||
systemdsystemunitdir = @systemdsystemunitdir@
|
||||
target = @target@
|
||||
target_alias = @target_alias@
|
||||
target_cpu = @target_cpu@
|
||||
|
|
|
|||
|
|
@ -203,3 +203,59 @@ Test the conformity testing module
|
|||
Existing configuration files can be tested for conformity. To do so, use:
|
||||
|
||||
$ augparse -I ./ ./test_nut.aug
|
||||
|
||||
|
||||
Complete configuration wizard example
|
||||
-------------------------------------
|
||||
|
||||
Here is a Python example that generate a complete and usable standalone configuration:
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
import augeas
|
||||
|
||||
device_name="dev1"
|
||||
driver_name="usbhid-ups"
|
||||
port_name="auto"
|
||||
|
||||
a = augeas.augeas()
|
||||
|
||||
# Generate nut.conf
|
||||
a.set("/files/etc/nut/nut.conf/MODE", "standalone")
|
||||
|
||||
# Generate ups.conf
|
||||
# FIXME: chroot, driverpath?
|
||||
a.set(("/files/etc/nut/ups.conf/%s/driver" % device_name), driver_name)
|
||||
a.set(("/files/etc/nut/ups.conf/%s/port" % device_name), port_name)
|
||||
|
||||
# Generate upsd.conf
|
||||
a.set("/files/etc/nut/upsd.conf/#comment[1]", "just to touch the file!")
|
||||
|
||||
# Generate upsd.users
|
||||
user = "admin"
|
||||
a.set(("/files/etc/nut/upsd.users/%s/password" % user), "dummypass")
|
||||
a.set(("/files/etc/nut/upsd.users/%s/actions/SET" % user), "")
|
||||
# FIXME: instcmds lens should be fixed, as per the above rule
|
||||
a.set(("/files/etc/nut/upsd.users/%s/instcmds" % user), "ALL")
|
||||
|
||||
monuser = "monuser"
|
||||
monpasswd = "******"
|
||||
a.set(("/files/etc/nut/upsd.users/%s/password" % monuser), monpasswd)
|
||||
a.set(("/files/etc/nut/upsd.users/%s/upsmon" % monuser), "master")
|
||||
|
||||
# Generate upsmon.conf
|
||||
a.set("/files/etc/nut/upsmon.conf/MONITOR/system/upsname", device_name)
|
||||
# Note: we prefer to omit localhost, not to be bound to a specific
|
||||
# entry in /etc/hosts, and thus be more generic
|
||||
#a.set("/files/etc/nut/upsmon.conf/MONITOR/system/hostname", "localhost")
|
||||
a.set("/files/etc/nut/upsmon.conf/MONITOR/powervalue", "1")
|
||||
a.set("/files/etc/nut/upsmon.conf/MONITOR/username", monuser)
|
||||
a.set("/files/etc/nut/upsmon.conf/MONITOR/password", monpasswd)
|
||||
a.set("/files/etc/nut/upsmon.conf/MONITOR/type", "master")
|
||||
|
||||
# FIXME: glitch on the generated content
|
||||
a.set("/files/etc/nut/upsmon.conf/SHUTDOWNCMD", "/sbin/shutdown -h +0")
|
||||
|
||||
# save config
|
||||
a.save()
|
||||
a.close()
|
||||
--------------------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -54,6 +54,8 @@ let ups_fields = "driver"
|
|||
| "advorder"
|
||||
| "authPassword"
|
||||
| "authProtocol"
|
||||
| "authtype"
|
||||
| "awd"
|
||||
| "batteryPercentage"
|
||||
| "battext"
|
||||
| "baud_rate"
|
||||
|
|
@ -70,6 +72,7 @@ let ups_fields = "driver"
|
|||
| "fake_lowbatt"
|
||||
| "flash"
|
||||
| "frequency"
|
||||
| "fruid"
|
||||
| "full_update"
|
||||
| "houroff"
|
||||
| "houron"
|
||||
|
|
@ -120,6 +123,7 @@ let ups_fields = "driver"
|
|||
| "sdtype"
|
||||
| "secLevel"
|
||||
| "secName"
|
||||
| "sensorid"
|
||||
| "serial"
|
||||
| "serialnumber"
|
||||
| "shutdownArguments"
|
||||
|
|
@ -139,6 +143,7 @@ let ups_fields = "driver"
|
|||
| "usd"
|
||||
| "use_crlf"
|
||||
| "use_pre_lf"
|
||||
| "username"
|
||||
| "validationSequence"
|
||||
| "vendor"
|
||||
| "vendorid"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue