nut/docs/man/dummy-ups.txt

154 lines
4.7 KiB
Text
Raw Permalink Normal View History

2011-01-26 09:35:08 +00:00
DUMMY-UPS(8)
============
2010-03-25 23:20:59 +00:00
2011-01-26 09:35:08 +00:00
NAME
----
dummy-ups - Driver for multi-purpose UPS emulation
NOTE
----
2010-03-25 23:20:59 +00:00
This man page only documents the specific features of the
dummy-ups driver. For information about the core driver, see
2011-01-26 09:35:08 +00:00
linkman:nutupsdrv[8].
2010-03-25 23:20:59 +00:00
2011-01-26 09:35:08 +00:00
DESCRIPTION
-----------
This program is a multi-purpose UPS emulation tool.
2010-03-25 23:20:59 +00:00
Its behavior depends on the running mode:
2011-01-26 09:35:08 +00:00
Dummy Mode
~~~~~~~~~~
2010-03-25 23:20:59 +00:00
2011-01-26 09:35:08 +00:00
*dummy-ups* looks like a standard device driver to linkman:upsd[8] and
2012-01-24 10:22:33 +00:00
allows one to change any value for testing purposes. It is both interactive,
2011-01-26 09:35:08 +00:00
controllable through the linkman:upsrw[1] and linkman:upscmd[1] commands (or
2010-03-25 23:20:59 +00:00
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.
2011-01-26 09:35:08 +00:00
Repeater Mode
~~~~~~~~~~~~~
*dummy-ups* 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-to-point communication with the UPS.
2010-03-25 23:20:59 +00:00
2011-01-26 09:35:08 +00:00
IMPLEMENTATION
--------------
2010-03-25 23:20:59 +00:00
2011-01-26 09:35:08 +00:00
The port specification depends on the running mode, and allows the driver to
select the right mode.
2010-03-25 23:20:59 +00:00
2011-01-26 09:35:08 +00:00
Dummy Mode
~~~~~~~~~~
2010-03-25 23:20:59 +00:00
2011-01-26 09:35:08 +00:00
Port is a definition file name for *dummy-ups*. This can either
2010-03-25 23:20:59 +00:00
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.
2011-01-26 09:35:08 +00:00
For instance:
2012-01-24 10:22:33 +00:00
[dummy]
2011-01-26 09:35:08 +00:00
driver = dummy-ups
port = evolution500.dev
desc = "dummy-ups in dummy mode"
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 linkman:upsc[8]
2011-06-01 20:31:49 +00:00
dump (<varname>: <value>). So you can easily create definition
2010-03-25 23:20:59 +00:00
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.
2011-01-26 09:35:08 +00:00
Since *dummy-ups* will loop on reading this file, you can dynamically modify
it to interact with the driver. This will avoid message spam into your
system log files, if you are using NUT default configuration.
2010-03-25 23:20:59 +00:00
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:
ups.status: OL
TIMER 60
ups.status: OB
TIMER 60
ups.status: LB
TIMER 60
It is wise to end the script with a TIMER. Otherwise dummy-ups will directly
go back to the beginning of the file.
2011-01-26 09:35:08 +00:00
Repeater Mode
~~~~~~~~~~~~~
2010-03-25 23:20:59 +00:00
Port is the name of a remote UPS, using the NUT form, ie:
2015-04-30 13:53:36 +00:00
<upsname>@<hostname>[:<port>]
2010-03-25 23:20:59 +00:00
2011-01-26 09:35:08 +00:00
For instance:
2010-03-25 23:20:59 +00:00
2011-01-26 09:35:08 +00:00
[repeater]
driver = dummy-ups
port = ups@hostname
desc = "dummy-ups in repeater mode"
2010-03-25 23:20:59 +00:00
2015-04-30 13:53:36 +00:00
Unlike UPS specifications in the rest of NUT, the `@hostname` portion is not
optional - it is the `@` character which enables Repeater Mode. To refer to an
UPS on the same host as *dummy-ups*, use `port = upsname@localhost`.
2011-01-26 09:35:08 +00:00
INTERACTION
-----------
2010-03-25 23:20:59 +00:00
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
2011-01-26 09:35:08 +00:00
linkman:upsrw[1] and linkman:upscmd[1] commands.
Note that in simulation mode, new variables can be added on the fly, by
adding these to the definition file. Conversely, if you need to remove
variable (such as transient ones, like ups.alarm), simply update these
by setting an empty value. As a result, they will get removed from the data.
2010-03-25 23:20:59 +00:00
In repeater mode, the driver acts according to the capabilities of the UPS, and
so support the same instant commands and settable values.
2011-01-26 09:35:08 +00:00
BACKGROUND
----------
2010-03-25 23:20:59 +00:00
2015-04-30 13:53:36 +00:00
Dummy Mode was originally written in one evening to replace the previous
dummycons testing driver, which was too limited, and required a terminal for
interaction.
2010-03-25 23:20:59 +00:00
2015-04-30 13:53:36 +00:00
*dummy-ups* is useful for NUT client development, and other testing purposes.
2010-03-25 23:20:59 +00:00
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,
2012-01-24 10:22:33 +00:00
which allows one to build a virtual device, composed of several other devices
2010-03-25 23:20:59 +00:00
(either UPS, PDUs).
2011-01-26 09:35:08 +00:00
BUGS
----
Instant commands are not yet supported in Dummy Mode, and data need name/value
checking enforcement, as well as boundaries or enumeration definition.
2010-03-25 23:20:59 +00:00
2011-01-26 09:35:08 +00:00
AUTHOR
------
2010-03-25 23:20:59 +00:00
Arnaud Quette
2011-01-26 09:35:08 +00:00
SEE ALSO
--------
2010-03-25 23:20:59 +00:00
2011-01-26 09:35:08 +00:00
linkman:upscmd[1],
linkman:upsrw[1],
linkman:ups.conf[5],
linkman:nutupsdrv[8]
2010-03-25 23:20:59 +00:00
2011-01-26 09:35:08 +00:00
Internet Resources:
~~~~~~~~~~~~~~~~~~~
2010-03-25 23:20:59 +00:00
The NUT (Network UPS Tools) home page: http://www.networkupstools.org/