File: dummy-ups.8

package info (click to toggle)
nut 2.4.3-1.1squeeze2
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 5,816 kB
  • ctags: 5,658
  • sloc: ansic: 45,735; sh: 11,290; makefile: 668; python: 448; perl: 179
file content (133 lines) | stat: -rw-r--r-- 4,185 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
.TH DUMMY-UPS 8 "Tue Oct 6 2009" "" "Network UPS Tools (NUT)"
.SH NAME
dummy-ups \- Driver for multi purpose UPS emulation

.SH NOTE
This man page only documents the specific features of the
dummy-ups driver.  For information about the core driver, see
\fBnutupsdrv\fR(8).

.SH DESCRIPTION
This program is a multi purpose UPS emulation tool.
Its behavior depends on the running mode:

.IP "Dummy mode"

looks like a standard UPS driver to \fBupsd\fR(8) and 
allows to change any value for testing purposes.  It is both interactive,
controllable through the \fBupsrw\fR(1) and \fBupscmd\fR(1) commands (or
equivalent graphical tool), and batchable through script files. It can be
configured, launched and used as any other real driver.  This mode is mostly
useful for development and testing purposes.

.IP "Repeater mode"

acts as a NUT client, simply forwarding data. This can be useful for supervision
purposes. This can also allow some load sharing between several UPS instances,
using a point\(hyto\(hypoint communication with the UPS.

.SH ARGUMENTS
The port specification depends on the running mode, and allows the automatic
guessing of it.

.IP "Dummy mode"

Port is a definition file name for dummy-ups. This can either
be an absolute or a relative path name. In the latter case the NUT
sysconfig directory (ie /etc/nut, /usr/local/ups/etc, ...) is prepended.

This file is generally named something.dev. It contains a list of all
valid data and associated values, and has the same format as an upsc
dump (<varname>: <value>). So you can easilly create definition
files from an existing UPS using "upsc > file.dev".
It can also be empty, in which case only a basic set of data is available:
device.*, driver.*, ups.mfr, ups.model, ups.status

Samples definition files are available in the "data" directory of the nut source
tree, and generally in the sysconfig directory of your system distribution.

Since dummy-ups will loop on reading this file, you can dynamically modify it to
interact with the driver.

You can also use the "TIMER <seconds>" instruction to create scheduled events
sequences. For example, the following sequence will loop on switching ups.status
between "OL", "OB" and "OB LB" every minute:

.nf
	ups.status: OL
	TIMER 60
	ups.status: OB
	TIMER 60
	ups.status: LB
	TIMER 60
.fi

It is wise to end the script with a TIMER. Otherwise dummy-ups will directly
go back to the beginning of the file.

.IP "Repeater mode"

Port is the name of a remote UPS, using the NUT form, ie:

	<upsname>[@<hostname>[:<port>]]

.SH IMPLEMENTATION
You will need add to at least one entry in \fBups.conf\fR(5) like:

.nf
[dummy]
	driver = dummy-ups
	port = evolution500.dev
	desc = "dummy-ups in dummy mode"
.fi

.nf
[repeater]
	driver = dummy-ups
	port = ups@hostname
	desc = "dummy-ups in repeater mode"
.fi

You can declare as many entries, and so run multiple instances, as you need.

.SH INTERACTION

Once the driver is loaded in dummy mode, you can change any variables, except
those of the driver.* and server.* collections.
You can do this by either editing the definition file, or use the
\fBupsrw\fR(1) and \fBupscmd\fR(1) commands.

In repeater mode, the driver acts according to the capabilities of the UPS, and
so support the same instant commands and settable values.

.SH BACKGROUND

This driver was written in one evening to replace the previous dummycons
testing driver. It was too limited and required to work from a terminal to
interact.

dummy-ups is useful for NUT client development, and other testing purpose.

It also helps the NUT Quality Assurance effort, by automating some tests on the
NUT framework.

It now offers a repeater mode. This will help in building the Meta UPS approach,
which allows to build a virtual device, composed of several other devices
(either UPS, PDUs).

.SH BUGS
Instant commands are not yet supported in Dummy Mode, and data need name /
value checking enforcement, as well as boundaries or enumeration definition.

.SH AUTHOR
Arnaud Quette

.SH SEE ALSO

\fBupscmd\fR(1),
\fBupsrw\fR(1),
\fBups.conf\fR(5),
\fBnutupsdrv\fR(8)

.SS Internet resources:
The NUT (Network UPS Tools) home page: http://www.networkupstools.org/