1NUT-DRIVER-ENUMERA(8) NUT Manual NUT-DRIVER-ENUMERA(8)
2
3
4
6 nut-driver-enumerator - tool to map NUT device entries to service
7 instances
8
10 nut-driver-enumerator.sh -h
11
12 nut-driver-enumerator.sh (no args)
13
14 nut-driver-enumerator.sh [--COMMAND]
15
17 nut-driver-enumerator.sh implements the set-up and querying of the
18 mapping between NUT driver configuration sections for each individual
19 monitored device, and the operating system service management framework
20 service instances into which such drivers are wrapped for independent
21 execution and management (on platforms where NUT currently supports
22 this integration — currently this covers Linux distributions with
23 systemd and systems derived from Solaris 10 codebase, including
24 proprietary Sun/Oracle Solaris and numerous open-source illumos
25 distributions with SMF). It may be not installed in packaging for other
26 operating systems.
27
28 This script provides a uniform interface for further NUT tools such as
29 upsdrvsvcctl(8) to implement their logic as platform-independently as
30 was possible and practical. It is not currently intended for end-user
31 consumption (and so is located in the libexec directory), with
32 upsdrvsvcctl exposing the most useful data and actions with its list
33 and resync arguments.
34
35 One part of the platform complexity that nut-driver-enumerator.sh hides
36 is the difference of rules for valid service instance names in various
37 frameworks, as well as system tools and naming patterns involved.
38
40 nut-driver-enumerator.sh (no args)
41 Update wrapping of devices into services
42
43 nut-driver-enumerator.sh --daemon(=freq)
44 Update wrapping of devices into services in an infinite loop;
45 Default freq is 60 sec.
46
47 nut-driver-enumerator.sh --reconfigure
48 Stop and un-register all service instances and recreate them (e.g.
49 if new dependency template was defined in a new version of the
50 script or package)
51
52 nut-driver-enumerator.sh --get-service-framework
53 Print the detected service management framework in this OS
54
55 nut-driver-enumerator.sh --list-devices
56 Print list of devices in NUT config
57
58 nut-driver-enumerator.sh --list-services
59 Print list of service instances which wrap registered NUT devices
60 (full name of service unit)
61
62 nut-driver-enumerator.sh --list-instances
63 Print list of service instances which wrap registered NUT devices
64 (just instance suffix)
65
66 nut-driver-enumerator.sh --get-service-for-device DEV
67 Print the full name of service unit which wraps a NUT device named
68 DEV
69
70 nut-driver-enumerator.sh --get-device-for-service SVC
71 Print the NUT device name for full or instance-suffix name of a
72 service unit SVC which wraps it
73
74 nut-driver-enumerator.sh --list-services-for-devices
75 Print a TAB-separated list of service units and corresponding NUT
76 device names which each such unit wraps
77
78 nut-driver-enumerator.sh --show-all-configs
79 Show the complete normalized list of device configuration blocks
80 (same as used later by the parser in the script to make decisions)
81
82 nut-driver-enumerator.sh --show-device-config DEV
83 Show configuration block of the specified NUT device
84
85 nut-driver-enumerator.sh --show-device-config-value DEV KEY
86 Show single configuration key of the specified NUT device
87
89 By default nut-driver-enumerator.sh executed without arguments would
90 automatically start any newly registered service instances wrapping the
91 NUT devices, and would also restart the nut-server service if the
92 configuration was changed. Environment variable AUTO_START=no disables
93 this default part of the action.
94
95 Also see below for environment variable REPORT_RESTART_42=no value.
96
98 nut-driver-enumerator.sh will return a zero exit code if it had nothing
99 to do (all currently defined drivers match all of the currently defined
100 service instances, one-to-one) and if it had no errors in its
101 operation.
102
103 Other codes can be returned as a result of re-synchronization of
104 mappings:
105
106 42
107 NUT device sections and system service instances differed before,
108 but now match up — so now the caller should likely restart some
109 services. Note that the drivers' service instances may have been
110 started or stopped as required (by AUTO_START=yes) — but maybe the
111 upsmon or upssched services should restart. If you pass environment
112 variable REPORT_RESTART_42=no then this codepath would return 0 (as
113 a non-error exit code). In default mode, such non-null
114 reconfiguration should cause the nut-driver-enumerator service to
115 restart and this would propagate to other NUT services that depend
116 on it.
117
118 13
119 Sections and services differed, and still do not match up
120
121 1
122 Bad inputs, e.g. unrecognized service management framework
123
124 2
125 Absent or unreadable ups.conf file
126
128 Jim Klimov <jimklimov+nut@gmail.com>
129
131 upsdrvsvcctl(8), ups.conf(5)
132
133 Internet resources:
134 The NUT (Network UPS Tools) home page: http://www.networkupstools.org/
135
136
137
138Network UPS Tools 2.8.0 04/26/2022 NUT-DRIVER-ENUMERA(8)