<?xmlversion='1.0' encoding='UTF-8' ?> <!-- The SGML source file draft-rprice-ups-management-protocol-15.sgml2rfc makes extensive use of markup minimisation. The required XML is generated from the SGML by osgmlnorm:I: "OpenSP" version "1.5.2" using a HyTime architectural form, and is verified to conform by xml2rfc 3.12.2 Editor: Roger Price, NUT Project, ietf@rogerprice.org 2022-05-18 08:24:45 UTC -->version="1.0" encoding="UTF-8"?> <!DOCTYPE rfcSYSTEM "rfc2629-xhtml.ent">[ <!ENTITY nbsp " "> <!ENTITY zwsp "​"> <!ENTITY nbhy "‑"> <!ENTITY wj "⁠"> ]> <rfc xml:lang="en" xmlns:xi="http://www.w3.org/2001/XInclude" obsoletes="" updates=""category="info"ipr="trust200902"submissionType="IETF"submissionType="independent" category="info" docName="draft-rprice-ups-management-protocol-15" number="9271" sortRefs="true" symRefs="true" tocInclude="true" tocDepth="4" version="3"> <front> <title abbrev="UPSmanagement protocol">UninterruptibleManagement Protocol">Uninterruptible Power Supply (UPS) Management Protocol -- Commands and Responses</title> <seriesInfoname="Internet-Draft" value="draft-rprice-ups-management-protocol-15"/>name="RFC" value="9271"/> <author initials="R." surname="Price" fullname="Roger Price" role="editor"> <organization>Network UPS ToolsProject </organization>Project</organization> <address> <postal><street> </street> <city> </city> <region> </region> <code> </code> <country>France </country><country>France</country> </postal><phone> </phone> <email>ietf@rogerprice.org </email><email>ietf@rogerprice.org</email> </address> </author> <dateyear="2022"> </date> <area>General </area> <workgroup>IETF </workgroup> <keyword>Uninterruptible Power Supply UPS NUT </keyword>year="2022" month="August"/> <keyword>Uninterruptible</keyword> <keyword>Power</keyword> <keyword>Supply</keyword> <keyword>UPS</keyword> <keyword>NUT</keyword> <abstract> <t>This document describes the command/response protocol currently used in the management of Uninterruptible Power Supply (UPS) units and other power devices often deployed in smalloffices,offices and in IT installations subject to an erratic public power supply. The UPS units typically interface to an Attachment Daemon in the system they protect. This daemon is in turn polled by a Management Daemonwhichthat notifies users and system administrators of power supplyincidents,incidents and automates system shutdown decisions. The commands and responses described by this document are exchanged between the UPS Attachment Daemon and the Management Daemon. The practice current when this protocol was first developed risks weaksecuritysecurity, and this is addressed in the Security Considerations sections of this document. </t> </abstract> </front> <middle> <section> <name>Introduction</name> <section anchor="intro"> <name>Current Practice</name> <t>This document describes UPS management techniques and current UPS management practice published by theNUT (NetworkNetwork UPSTools)Tools (NUT) Project. The document is based on version 2.8.0 of the NUT Projectsoftwaresoftware, which supports version 1.3 of the NUT protocol. </t> <t>Since May 2002, the protocol described by this document has been operating on IANA port 3493/TCP (nut). </t> <section anchor="proj"> <name>NUTSoftwareProject</name> <t>The primary goal of theNUT (NetworkNetwork UPSTools) SoftwareTools (NUT) Project software <xref target="NUT"></xref> is to provide support forPower Devices,power devices, such asUninterruptible Power Supplies.UPSs. TheProjectproject has been in operation since19981998, with a major rework in 2003. It operates through a user <xref target="nut-upsuser">mailing list</xref>, a developer <xref target="nut-upsdev">mailing list</xref>, a <xreftarget="NUT">web site</xref>target="NUT">website</xref>, and a <xref target="nut-repository">GitHub repository</xref>. See <xref target="githist"></xref> and Appendix J of <xref target="History"></xref> for a history of the project. </t> </section> <section anchor="TSS"> <name>The"Shutdown Story"</name> <t>"TheShutdownStory", seeStory</name> <t>The Shutdown Story section (see <xreftarget="shutdownstory"></xref>,target="shutdownstory"></xref>) describes the current UPS management practice for performing a managed shutdown of unattended infrastructure after an unscheduled failure of the public power supply in order tominimiseminimize the risk of corruption to data processed by this infrastructure. </t> </section> <section anchor="HowtoRead"> <name>How to Read this Document</name> <t>As a simplification to ease reading, the term "UPS" is used when "Managed Power Device" would be more complete. The reader should understand the simple "UPS" to include other managed power devices. </t> <t>The statuses and events appearing in this document are named with short text-form names, some of which are abbreviations. A full list of the statuses can be found in <xreftarget="symbols"></xref>target="symbols"></xref>, while the events are listed in <xref target="events"></xref>. </t> <t>This document refers to the "public power supply". Other texts frequently refer to "utility power", "input sourcepower"power", or even "wall power". </t> </section> </section> <section anchor="AddInf"> <name>Additional Information</name> <t>Additional information about the NUT Project is available in the <xref target="Documentation">project documentation</xref>. Requests for further information about this protocol and related technical matters may be addressed to the <xref target="nut-upsuser">mailing list</xref> of the NUT Project. </t> </section> <section> <name>Requirements Language</name><t>The<t> The key words "<bcp14>MUST</bcp14>", "<bcp14>MUST NOT</bcp14>", "<bcp14>REQUIRED</bcp14>", "<bcp14>SHALL</bcp14>", "<bcp14>SHALL NOT</bcp14>", "<bcp14>SHOULD</bcp14>", "<bcp14>SHOULD NOT</bcp14>", "<bcp14>RECOMMENDED</bcp14>", "<bcp14>NOT RECOMMENDED</bcp14>", "<bcp14>MAY</bcp14>", and "<bcp14>OPTIONAL</bcp14>" in this document are to be interpreted as described inBCP 14BCP 14 <xreftarget="RFC2119"></xref>target="RFC2119"/> <xreftarget="RFC8174"></xref>target="RFC8174"/> when, and only when, they appear in all capitals, as shown here. </t> </section> </section> <section anchor="Terminology"> <name>Terminology</name> <t>The following technical terms appear in this document. They are listed in alphabetical order. </t> <section anchor="au"> <name>Administrative User</name> <t>In current practice, the commands and other functions offered by the Attachment Daemon are made available to a set of users known as Management Daemons. These Management Daemons authenticate to the Attachment Daemon with basic credentials (username and password). Although called "users", the administrative users are not systemusers,users; they are specific to an Attachment Daemon and are listed in a text file (currently <tt>upsd.users</tt>)whichthat is read by the Attachment Daemon andwhichthat assigns to each of them the password, InstantCommandsCommands, and actionswhichthat are allowed, together with the Primary or Secondary status of the Management Daemon. For details, see <xref target="adminuser"></xref>. For details ofPrimarythe Primary, see <xreftarget="prim"></xref>, andtarget="prim"></xref>; for details ofSecondarythe Secondary, see <xref target="sec"></xref>.TypicallyTypically, a high-level user will be able to send command<tt>FSD</tt><tt>FSD</tt>, but a low-level user might only be allowed to access the test panel. The security provisions for administrative users are discussed in <xref target="adsec"></xref>. </t> </section> <section anchor="AD"> <name>Attachment Daemon</name> <t>The Attachment Daemon retrieves the status from the UPS and sends commands to it often through a Driver specific to the hardware model and the connection medium, e.g., USB, serial. See <xref target="Driver"></xref>. It maintains an abstracted view of the hardware through the use of hardware statuses. See <xref target="st"></xref>. A Management Daemon may consult the abstracted view using the commands described in this document. </t> <t>See <xref target="MinSup"></xref> for details of the recommended minimum support ofvariablesvariables, which calls for Attachment Daemon support of statuses <tt>OB</tt>, <tt>OL</tt>,<tt>LB</tt><tt>LB</tt>, and <tt>FSD</tt>. </t> <t>The NUT Project has implemented an Attachment Daemon as program <tt>upsd</tt> and a set ofhardware specific drivers,hardware-specific Drivers, all written in K&RC.C <xref target="C2ndEd"/>. The Attachment Daemon is launched as system user"root","root" but for bettersecurity, thensecurity; then, it drops the privilege to run as a detached software service. </t> </section> <section anchor="Driver"> <name>Driver</name> <t>A Driver is that part of an Attachment Daemonwhichthat is specific to the UPS hardware, the connectionmediummedium, and the connection protocol, e.g., USB, serial. In currentpracticepractice, the Attachment Daemon has adriverDriver for each hardware interface type it supports. Although this document considers thedriverDriver to be part of the Attachment Daemon, current practice is to see it as a separate software unit running as a daemon "in front of" the Attachment Daemon. The protocol for data exchange between the Driver and the Attachment Daemon is outside the scope of this document. </t> </section> <section> <name>Event</name> <t>A UPSEventevent occurs in the Management Daemon when a change in the UPS status is received from the Attachment Daemon. This event is internal to the Management Daemon. See <xref target="events"></xref>. </t> </section> <section anchor="IC"> <name>Instant Command</name><t>A<t>An Instant Command is a commandwhichthat, when sent to the AttachmentDaemonDaemon, is passed to thedriverDriver and sent to the hardware without any configured delay to perform a function. Forexampleexample, <tt>INSTCMD su700test.panel.start</tt> .test.panel.start</tt>. See <xref target="instcmd"></xref>. </t> </section> <section anchor="MD"> <name>Management Daemon</name> <t>The Management Daemon is primarily responsible for managing the hardware and orchestrating system-wide actions after a power event. Using commands sent to the AttachmentDaemonDaemon, it follows the status of the UPS and determines when UPS events occur. It takes decisions based on the events, such as calling for a system shutdown. See <xref target="shutdownstory"></xref>. Although the term includes the word"Daemon""Daemon", nothing requires that it be implemented as a detached software service. The Management Daemon may also provide administrativefunctionsfunctions, such as a graphic interface to view the hardware activity. </t> <t>There are several examples of a Management Daemon: the NUT Project provides<tt>upsmon</tt><tt>upsmon</tt>, which takes the system shutdown decision when the public power supply fails. Further configurationoptionsoptions, such astimerstimers, are provided by the helper program <tt>upssched</tt>. </t> <t anchor="util">Other programs represent the Management Daemon: </t> <ul spacing="compact"> <li><tt>upsc</tt> reports the values of the variables defined for a givenUPS,UPS; see <xref target="typvar"></xref>. </li> <li><tt>upsrw</tt> reports on and changes the values of the readable and writable configuration variables defined for a givenUPS,UPS; see <xref target="rw"></xref>. </li> <li><tt>upscmd</tt> reports on and executes the instant action commands defined for a givenUPS,UPS; see <xref target="instcmd"></xref>. </li> <li><tt>UPSmon.py</tt> is an experimental Python3 rewrite of <tt>upsmon</tt> and <tt>upssched</tt>whichthat includes support for <xref target="RFC8446">TLS 1.3</xref>. </li> </ul> </section> <section anchor="prim"> <name>Primary</name> <t>When a powerdevicedevice, such as a UPSunitunit, supplies power to more than one system, the computer running thedriverDriver is known as the Primary. The others are Secondaries. Seefigure<xreftarget="fig.oview4" format="counter"></xref>.target="fig.oview4"/>. Common current practice for system administrators is to consider the Management Daemon in the Primary to be the Primary Management Daemonwhichthat is in charge of the shutdown of all the systems powered by the UPS. The Primary Management Daemon sets status symbol <tt>FSD</tt> to order thesecondariesSecondaries to shut down. </t> <aside> <t>Note: Historically, the Primary was known as the"Master". </t>"Master".</t> </aside> </section> <section anchor="sec"> <name>Secondary</name> <t>When a hardwaredevicedevice, such as a UPSunitunit, supplies power to more than one system, the systemwhichthat communicates directly with the UPSunit e.g.unit, e.g., using a USB,RS232,RS-232, or a network connection, is known as thePrimariy.Primary. Theotherothers are Secondaries. There is no Attachment Daemon in a Secondary. Seefigure<xreftarget="fig.oview4" format="counter"></xref>.target="fig.oview4"/>. Common current practice for system administrators is to consider the Management Daemon in a Secondary to be a Secondary Management Daemonwhichthat understands status symbol <tt>FSD</tt> as an order to shut down. </t> <aside> <t>Note: Historically, the Secondary was known as the"Slave". </t>"Slave".</t> </aside> </section> <section anchor="sess"> <name>Session</name> <t>The Management Daemon may initiate a TCP session with a specifieddevicedevice, such as a UPS known to the Attachment Daemon. The session structure provides for audit andsecuritysecurity, as well as access tomission criticalmission-critical UPS functions. Forexampleexample, good practice requiresapassword protection for an Instant Commandwhichthat turns off a UPS outlet. Other than the commands and responses used, the details of session management are outside the scope of this document. </t> </section> <section anchor="st"> <name>UPS Status</name> <t>The status of a hardwaredevicedevice, such as a UPSunitunit, is a symbolic description of the state of the unit. It consists of aspace separatedspace-separated list of symbols from the set {<tt>ALARM</tt> <tt>BOOST</tt> <tt>BYPASS</tt> <tt>CAL</tt> <tt>CHRG</tt> <tt>COMM</tt> <tt>DISCHRG</tt> <tt>FSD</tt> <tt>LB</tt> <tt>NOCOMM</tt> <tt>OB</tt> <tt>OFF</tt> <tt>OL</tt> <tt>OVER</tt> <tt>RB</tt> <tt>TEST</tt> <tt>TRIM</tt>}. The symbols <tt>TICK</tt> and <tt>TOCK</tt> are experimental additions to the statuses and are not in common current practice. See <xreftarget="symbols"></xref>target="symbols"></xref>, which specifies each of these symbols. </t> <t>See <xref target="MinSup"></xref> for details of the recommended minimum support of status symbols <tt>OB</tt>, <tt>OL</tt>,<tt>LB</tt><tt>LB</tt>, and <tt>FSD</tt>. </t> </section> <section anchor="var"> <name>UPS Variable</name> <t>The metrics and identifiers provided by each UPS are represented by variables giving the value representing that metric oridentifier,identifier. The UPS variable is an abstraction of the UPS hardware configuration and activity maintained by the Attachment Daemon. See <xreftarget="Annex1"></xref>target="Annex1"></xref>, which provides examples of variables. Forexampleexample, the variable <tt>battery.charge</tt> contains the current charge of the UPS battery as a percentage value. </t> <t>Note: Some variables are constants,e.g.e.g., batterytype,type and manufacturer. </t> <t>See <xref target="MinSup"></xref> for details of the recommended minimum support of variables. A full list of possible variables is available in <xref target="gitvars">source code filedocs/nut-names.txt</xref>docs/nut-names.txt</xref>, which serves as the Recording Document. </t> </section> </section> <section anchor="overview"> <name>Protocol Overview</name><t>Figure <xref target="fig.oview" format="counter"></xref><t><xref target="fig.oview"/> shows a reference configuration in which the command/response protocol applies. The UPS shown is representative of all managed powerdevices,devices. </t> <figure anchor="fig.oview"> <name>ReferenceConfiguration </name>Configuration</name> <artworkalign="center">align="center" type="ascii-art"><![CDATA[ "The client" ,--------------, ,--------------, ,-----, | UPS |<-Commands<-Commands | UPS | | UPS |---| Attachment |---------------| Management | | |===| Daemon |Responses->Responses-> | Daemon | /-----\ '--------------' '--------------' UPS Attachment UPS Management System NetworkSystem</artwork>System ]]></artwork> </figure> <t>The reference configuration infigure<xreftarget="fig.oview" format="counter"></xref>target="fig.oview"/> shows a single UPS unitwhichthat has a power supply link (<tt>===</tt>) and a data link (<tt>---</tt>) attached to a system running an Attachment Daemon. The UPS provides power supply protection to the system running the Attachment Daemon. </t> <t>Inpracticepractice, there may be more than one UPS unit, and a unit may provide power protection to more than one system. The figure also shows a single Management Daemon. Inpracticepractice, there may be more than one Management Daemon, and any one Management Daemon may manage more than one UPS Attachment Daemon. </t> <t>The protocol applies to connections between the Attachment Daemon and the ManagementDaemonDaemon, which act as the <strong>server</strong> and<strong>client</strong><strong>client</strong>, respectively. The Management Daemon sends commands over TCP to the Attachment Daemon and receives responses over TCP from that daemon. </t> <t>The two daemons may run in the samesystem,system or may be connected through a local or wide area network. In simple cases, as shown infigure<xreftarget="fig.oview2" format="counter"></xref>,target="fig.oview2"/>, the Attachment Daemon and the Management Daemon are in the same system, the one protected by the UPS. The commands and responses are exchanged through an internal loopback interface. </t> <figure anchor="fig.oview2"> <name>Simplifiedsingle-system configurationSingle-System Configuration </name> <artworkalign="center">align="center" type="ascii-art"><![CDATA[ "The client" ,--------------------,---------------------, ,-----, | UPS<-Commands<-Commands UPS | | UPS |---| Attachment | Management | | |===| DaemonResponses->Responses-> Daemon | /-----\ '--------------------'---------------------' InternalloopbackLoopback UPS Attachment and ManagementSystem</artwork>System ]]></artwork> </figure> <t>The reference configuration does not require any specific design. Forexample figureexample, <xreftarget="fig.oview3" format="counter"></xref>target="fig.oview3"/> shows an arrangement in which the Attachment Daemon is closely associated with, or even includedinin, the UPS system setup. This is becoming more prevalent with the availability oflow costlow-cost processors able to run the AttachmentDaemonDaemon, thereby effectively creating anetwork attachednetwork-attached UPS running a published protocol. </t> <figure anchor="fig.oview3"> <name>UPS and Attachment DaemonintegrationIntegration </name> <artworkalign="center">align="center" type="ascii-art"><![CDATA[ "The client" ,-----,------------, ,--------------, | | UPS |<-Commands<-Commands | UPS | | UPS - Attachment |---------------| Management | | | Daemon |Responses->Responses-> | Daemon | /-----'------------\ '--------------' UPS Attachment UPS Management System NetworkSystem</artwork>System ]]></artwork> </figure> <t>As the power requirements for processors decrease, it is becoming increasingly common to use a single UPS to protect multiplesystemssystems, as shown infigure<xreftarget="fig.oview4" format="counter"></xref>. Howevertarget="fig.oview4"/>. However, there is only one data line (<tt>---</tt>) from the UPS to the Primary system. The others have only power connections (<tt>===</tt>) to theUPS,UPS and are known as Secondaries. A Secondary does not run an AttachmentDaemon,Daemon; it connects over a network to the Attachment Daemon in the Primary.Figure<xreftarget="fig.oview4" format="counter"></xref>target="fig.oview4"/> shows the Attachment Daemon and the Primary Management Daemon in the same system. This is commonpracticepractice, but it is not a technical requirement. </t> <figure anchor="fig.oview4"> <name>UPSprotects multiple systemsProtects Multiple Systems </name> <artworkalign="center">align="center" type="ascii-art"><![CDATA[ "The client" ,--------------------,---------------------, ,-----, | UPS<-Commands<-Commands Primary | | |---| Attachment | Management | Primary | |===| DaemonResponses->Responses-> Daemon | | | '--------------------'---------------------' | UPS | ^ | |'<-Commands---Responses->,'<-Commands---Responses->, | | v | | ,--------------,-----------------, | |============| | Secondary | /-----\ | | Management | Secondary | | Daemon |'--------------'-----------------'</artwork>'--------------'-----------------' ]]></artwork> </figure> <aside> <t>Note: Should the Primary fail or gooff-line,offline, the fate of the Secondaries depends on the UPS status when the Primary failed. If the UPS had status<tt>OL</tt><tt>OL</tt>, the Secondary continues operation, but if the UPS had status<tt>OB</tt><tt>OB</tt>, the Secondary may choose to shut down as a precaution. </t> </aside> </section> <section anchor="protspec"> <name>Protocol Specification</name> <t>This specification includes only the commands and their responses. An implementation of the Attachment Daemon has an internal state machine, and some complex implementations of the Management Daemon include an internal statemachine;machine, forexampleexample, to assist the system shutdown of a complex installation. The Management Daemon is required to remember the previous <tt>ups.status</tt> value it received from the Attachment Daemon and compare it with the next. Other thanthatthat, the management protocol used between them is effectively stateless. </t><t>See for example<t>For example, see <xreftarget="events"></xref>target="events"></xref>, which shows a map of the new <tt>ups.status</tt> response and the previous <tt>ups.status</tt> response to anEventevent, which is taken as the basis for Management Daemon action. </t> <section anchor="Notation"> <name>Notation Used in this Specification</name> <t>The character set used for commands and responses isUS-ASCII,US-ASCII; see <xref target="RFC0020"></xref>. </t> <t>Multi-word elements are contained betweenQUOTATION MARKquotation mark characters for easierparsing. E.g.,parsing, e.g., "UPS on fire". Embedded quotation marks are escaped withREVERSE SLANT \reverse slant (\), often known as backslashes. Embedded backslashes are also escaped by representing them as \\. </t> <t anchor="onenewline">Commands and responses have no leading or trailingwhitespace,blank space and are terminated with a single new line characterLINE FEEDline feed (LF). </t><t>White<t>Blank space within commands and responses is reduced to oneSPACEspace (SP). </t> </section> <section anchor="commands"> <name>Commands</name> <t>The commands address the UPS to which they apply by<tt><upsname></tt><tt><upsname></tt>, where</t> <ul spacing="compact"> <li><tt><upsname></tt> ::= <tt><ups>[@<hostname>[:<port>]]</tt> </li> <li><tt><ups></tt> is defined by the Attachment Daemon configuration files. </li> <li>The default <tt><hostname></tt> is<tt>localhost</tt><tt>localhost</tt>. </li> <li>The <tt><port></tt> is the number of the TCP port on which the Attachment Daemon is listening. The default is 3493. This is supported by all current Management Daemons. </li> </ul> <t>Examples: <tt>myups</tt>,<tt>UPS-97B@bigserver.example.com</tt> </t><tt>UPS-97B@bigserver.example.com</tt></t> <t>ABNF:seeSee variable <tt>upsname</tt> in <xreftarget="fig.ABNF"></xref>. </t>target="fig.ABNF"></xref>.</t> <t>Note: Experimental Management Daemons use an extended form of <tt><upsname></tt> in configuration files and in program parameters,wherewhere: </t> <ul spacing="compact"> <li><tt><upsname></tt> ::=<tt>[<group>:]<ups>[@<hostname>[:<port>]]</tt> </li><tt>[<group>:]<ups>[@<hostname>[:<port>]]</tt></li> <li><tt><group></tt> is an experimental extension to provide for groups of UPSs. It is not in common currentpractice. </li>practice.</li> <li><tt><ups></tt> is defined by the Attachment Daemon configurationfiles. </li>files.</li> <li>The default <tt><hostname></tt> is<tt>localhost</tt> </li><tt>localhost</tt>.</li> </ul> <t>Examples: <tt>ups-1@example.com:3493</tt>, <tt>HB:heartbeat1@example.com:3493</tt> </t> <aside> <t><em>Implementation note:</em> In the current implementation, the names of commands and subcommands are not case sensitive. Forexampleexample, <tt>GET VAR</tt> may be written as <tt>Get var</tt>, but in thisspecificationspecification, they are always written inupper case.uppercase. Similarly, <tt><upsname></tt> and <tt><varname></tt> are not case sensitive. Forexampleexample, <tt>UPS341 ups.id</tt> may be written as <tt>ups341 Ups.Id</tt>, but in thisspecificationspecification, <tt><varname></tt> is always written in lower case. </t> </aside> <section anchor="attach"> <name><tt>ATTACH</tt></name> <t>In a configurationsuch as thatlike the one shown in <xreftarget="fig.oview4"></xref>target="fig.oview4"></xref>, in which a UPS protects more than one system, the Primary Management Daemon needs to know how many Secondaries are currently"<em>active</em>",<em>active</em>, i.e., powered by the UPS, either from the public power supply or from battery power. The Attachment Daemon supports this by keeping a count of all the"<em>active</em>"<em>active</em> systems powered by a UPS. The count isinitialised,initialized, one Secondary at a time by the <tt>ATTACH</tt> command, which should be understood as"<em>count<em>count this Secondary asactive</em>".active</em>. <tt>ATTACH</tt> is one of three commands for Secondarycounting:counting. Additionally, command <tt>DETACH</tt> decrements thecountcount, and a Management Daemon may read the count at any time using the command <tt>NUMATTACH</tt>. </t> <t>The <tt>ATTACH</tt> command is also sent to the Attachment Daemon for thePrimaryPrimary, so during normal, fully protected operation, the count is 1 for the Primary + the number ofsecondaries.Secondaries. During a full system shutdown, the count drops as each Secondary Management Daemon executes command <tt>DETACH</tt> during its own shutdown. When the count drops to 1, only the Primary is"<em>active</em>"<em>active</em>, and it knows that all thesecondariesSecondaries have shut down. </t> <t>Command: <tt>ATTACH <upsname></tt> </t> <t>If the command succeeds, the response is<tt>OK</tt>, otherwise<tt>OK</tt>; otherwise, see the error responses in <xref target="errorresponses"></xref>. </t> <t>ABNF: See variable <tt>attach</tt> in <xreftarget="fig.ABNF"></xref>,target="fig.ABNF"></xref>. </t> <aside> <t>Note: Historically, this command was known as <tt>LOGIN</tt>.Since thatHowever, because <tt>LOGIN</tt> was not the conventional user access to a shell orprogramprogram, the name was changed to avoidconfusion. </t>confusion.</t> </aside> </section> <section anchor="detach"> <name><tt>DETACH</tt></name> <t>This companion command to <tt>ATTACH</tt> reduces the count of "active" Secondaries. It should be understood as"<em>this<em>this Secondary is no longeractive</em>",active</em> and is usually used during system shutdown to decrement a count of how many Secondaries are still"active".<em>active</em>. </t> <t>Command: <tt>DETACH</tt> </t> <t>If the command succeeds, the response is <tt>OKGoodbye</tt>, otherwiseGoodbye</tt>; otherwise, see the error responses in <xref target="errorresponses"></xref>. </t> <t>ABNF: See variable <tt>detach</tt> in <xreftarget="fig.ABNF"></xref>,target="fig.ABNF"></xref>. </t> <aside> <t>Note: Historically, this command was known as<tt>LOGOUT</tt>. </t><tt>LOGOUT</tt>.</t> </aside> </section> <section anchor="FSD"> <name><tt>FSD</tt></name> <t>A Management Daemonwhichthat is Primary and has the requiredauthority,authority uses this command to set status symbol<tt>FSD</tt><tt>FSD</tt>, meaning "ForcedShutdown"Shutdown", in the Attachment Daemon. In currentpracticepractice, the Primary Management Daemon uses the symbol to tell the Secondaries to shut down. </t> <t>Command: <tt>FSD <upsname></tt> </t> <t>If the command succeeds, the response is <tt>OKFSD-SET</tt>, otherwiseFSD-SET</tt>; otherwise, see the error responses in <xref target="errorresponses"></xref>. </t> <t>ABNF: See variable <tt>fsd</tt> in <xref target="fig.ABNF"></xref>. </t> <t>In current practice, commands such as <tt>FSD</tt> are made available only to a privileged administrative user authorized to send such amission criticalmission-critical command. The security provisions for administrative users are discussed in <xref target="adsec"></xref>. </t> <t>Note: The symbol"<tt>FSD</tt>"<tt>FSD</tt> is also used for anEvent.event. See <xref target="EventFSD"></xref>. </t> </section> <section anchor="get"> <name><tt>GET</tt></name> <t>Retrieve a single response from the Attachment Daemon. </t> <t>ABNF: See variable <tt>get</tt> in <xref target="fig.ABNF"></xref>. </t> <t>The possiblesub-commands are:subcommands are listed in the sections below. </t> <section anchor="cmddesc"> <name><tt>GET CMDDESC</tt></name> <t>Retrieve a text description of a command. </t> <t>Command: <tt>GET CMDDESC <upsname> <cmdname></tt> </t> <t>Response: <tt>CMDDESC <upsname> <cmdname> "<description>"</tt> </t> <t>For example: command <tt>GET CMDDESC su700 load.on</tt> and response <tt>CMDDESC su700 load.on "Turn on the load immediately"</tt> </t> <t>This is like <tt>GET DESC</tt>, but it applies to an InstantCommand;.Command. See <xref target="desc"></xref>. </t> </section> <section anchor="desc"> <name><tt>GET DESC</tt></name> <t>Retrieve a text description of a UPS variable. See <xref target="var"></xref>. </t> <t>Command: <tt>GET DESC <upsname> <varname></tt> </t> <t>Response: <tt>DESC <upsname> <varname> "<description>"</tt> </t><t>where <tt><description></tt><t><tt><description></tt> is a string that gives a brief explanation of the named variable. The Attachment Daemon <bcp14>MAY</bcp14> return "Unavailable" if the filewhichthat provides this description is not installed. </t> <t>Forexampleexample: command <tt>GET DESC su700 ups.status</tt> and response <tt>DESC su700 ups.status "UPS status"</tt> </t> </section> <section anchor="numattach"> <name><tt>GET NUMATTACH</tt></name> <t>Retrieve the count kept by the Attachment Daemon of all the"<em>active</em>"<em>active</em> systems protected by this UPS. </t> <t>Command: <tt>GET NUMATTACH <upsname></tt> </t> <t>Response: <tt>NUMATTACH <upsname> <value></tt> </t><t>where <tt><value></tt><t><tt><value></tt> is a count of the Primary and the number of Secondaries currently powered by this UPS. </t> <t>Forexampleexample: command <tt>GET ATTACH su700</tt> and response <tt>NUMATTACH su700 1</tt> </t> <t>This information is needed by the Management Daemon to determine how many Secondaries are still connected during the system shutdown process. </t> <aside> <t>Note: Historically, thissub-commandsubcommand was known as <tt>NUMLOGINS</tt>. Since <tt>LOGIN</tt> was not the conventional user access to a shell orprogramprogram, the name was changed to avoidconfusion. </t>confusion.</t> </aside> </section> <section anchor="type"> <name><tt>GET TYPE</tt></name> <t>Retrieve the type of a UPS variable. See <xref target="var"></xref>. </t> <t>Command: <tt>GET TYPE <upsname> <varname></tt> </t> <t>Response: <tt>TYPE <upsname> <varname> <type>...</tt> </t><t>where <tt><type>...</tt><t><tt><type>...</tt> can be one or more of the following tokens. Multiple types may be returned. </t> <t>Forexampleexample: command <tt>GET TYPE su700 input.transfer.low</tt> and response <tt>TYPE su700 input.transfer.low ENUM</tt> </t> <table> <name>VariableTypes </name>Types</name> <thead> <tr> <thalign="center"> Type </th>align="center"> Type </th> <thalign="center">Meaning </th>align="center">Meaning</th> </tr> </thead> <tbody> <tr> <td>RW </td> <td>This is a read/write variable. It may be read with command <tt>GETVAR</tt>, seeVAR</tt> (see <xreftarget="getvar"></xref>,target="getvar"></xref>) and set to a different value with command<tt>SET</tt>, see<tt>SET</tt> (see <xreftarget="set"></xref>.target="set"></xref>). </td> </tr> <tr> <td>ENUM </td><td>An<td>This is an enumerated type, which supports specific predetermined values. </td> </tr> <tr> <td>STRING:n </td> <td>This is a string of maximum length <tt>n</tt>. </td> </tr> <tr> <td>RANGE </td> <td><t>This is a number, either integer or float, comprised in the rangewhichthat may be seen with the command <tt>LISTRANGE</tt>, seeRANGE</tt> (see <xreftarget="range"></xref>.target="range"></xref>). </t></td> </tr> <tr> <td>NUMBER </td> <td>This is a single numeric value, either integer or float. </td> </tr> </tbody> </table> <t>Notes: </t><ul><ul spacing="normal"> <li>ENUM,STRING:nSTRING:n, and RANGE are usually associated withRW,RW but not always. The default <type>, when omitted, is numeric, so either integer or float. Each Driver is then responsible for handling values as either integer or float. </li> <li>Current practice is to represent floating point values using a decimal (base 10)USEnglish-based representation.Hexadecimal,Hexadecimals, exponents, andcommacommas used as separators for thousandsseparatorare not allowed. Forexample:example, "1200.20" is valid, while "1,200.20" and "1200,20" are not valid. </li> </ul> </section> <section anchor="upsdesc"> <name><tt>GET UPSDESC</tt></name> <t>Retrieve a text description of a UPS. </t> <t>Command: <tt>GET UPSDESC <upsname></tt> </t> <t>Response: <tt>UPSDESC <upsname> "<description>"</tt> </t><t>where <description><t><description> is defined by the Attachment Daemon configuration. If it is not set, current practice is for the Attachment Daemon to return "Unavailable". </t> <t>Forexampleexample: command <tt>GET UPSDESC su700</tt> and response <tt>UPSDESC su700 "Development box"</tt> </t> <t>This can be used to provide human-readabledescriptionsdescriptions, instead of a cryptic <tt>ups@hostname</tt> string. </t> </section> <section anchor="getvar"> <name><tt>GET VAR</tt></name> <t>Retrieve the value of a UPS variable. See <xref target="var"></xref>. </t> <t>Command: <tt>GET VAR <upsname> <varname></tt> </t> <t>Response: <tt>VAR <upsname> <varname> "<value>"</tt> </t> <t>Forexampleexample: command <tt>GET VAR su700 ups.status</tt> and response <tt>VAR su700 ups.status "OB LB"</tt> </t> </section> </section> <section anchor="help"> <name><tt>HELP</tt></name> <t>Return a list of the commands supported by the Attachment Daemon. This command is intended forhumanhuman, as well asprogramprogram, use. </t><t>Command<t>Command: <tt>HELP</tt> </t> <t>Forexample,example: the following command line sequence executed on an AttachmentDaemon:</t> <sourcecode>netcatDaemon</t> <sourcecode name="" type="shell"> netcat localhost 3493 HELP Commands: HELP VER GET LIST SET INSTCMD ATTACH DETACH USERNAME PASSWORDSTARTTLS</sourcecode>STARTTLS </sourcecode> <t>ABNF: See variable <tt>help</tt> in <xref target="fig.ABNF"></xref>. </t> <aside> <t>Note: Historically, this command also returned <tt>LOGIN</tt> and <tt>LOGOUT</tt>.SinceBecause <tt>LOGIN</tt> was not the conventional user access to a shell or program, the command names were changed to <tt>ATTACH</tt> and <tt>DETACH</tt> to avoidconfusion. </t>confusion.</t> </aside> </section> <section anchor="instcmd"> <name><tt>INSTCMD</tt></name> <t>Send an Instant Command to the UPS. </t> <t>Command: <tt>INSTCMD <upsname> <cmdname></tt> </t><t>where <tt><upsname></tt><t><tt><upsname></tt> is the name of theUPSUPS, and <tt><cmdname></tt> is the Instant Command to be issued to that UPS. See <xref target="instcmdexamples"></xref> for examples ofinstant commands.Instant Commands. </t> <t>If the command succeeds, the response is<tt>OK</tt>, otherwise<tt>OK</tt>; otherwise, see the errorresponses,responses in <xref target="errorresponses"></xref>. </t> <t>Forexample the command:example: command <tt>INSTCMD su700 test.panel.start</tt> andtheresponse <tt>OK</tt> </t> <t>ABNF: See variable <tt>instcmd</tt> in <xref target="fig.ABNF"></xref>. </t> </section> <section anchor="list"> <name><tt>LIST</tt></name> <t>All the <tt>LIST</tt> commands produce a response with a common format. The responsewill beginbegins with <tt>BEGIN LIST</tt> and thenrepeatrepeats the initial query. A list then follows, with as many lines as are necessary. The response ends with <tt>ENDLIST</tt>LIST</tt>, followed by the initial query. </t> <t>The formatting may seem a bit redundant, but it makes a different form of client possible. A client can send a <tt>LIST</tt> command and then wait for the response. When it arrives, the Management Daemon doesn't need a complicated state machine to remember which list is which. </t> <t>Note: The current NUT Project implementation of the Attachment Daemon, <tt>upsd</tt>, sends back the response to the <tt>LIST</tt> command as a sequence of messages. The Management Daemon should continue reading these messages until it receives the line beginning <tt>END LIST</tt>. </t> <t>ABNF: See the variable <tt>list</tt> in <xref target="fig.ABNF"></xref>. </t> <t>The possible subcommandsare:are listed in the sections below. </t> <section anchor="client"> <name><tt>LIST CLIENT</tt></name> <t>The command calls for the Attachment Daemon to report all the current Management Daemon clients of a given UPS. </t> <t>Command: <tt>LIST CLIENT <upsname></tt> </t><t>The response is<t>Response: </t><artwork>BEGIN<sourcecode name="" type="shell"> BEGIN LIST CLIENT <upsname> CLIENT <upsname> <client_IP_address> ... END LIST CLIENT <upsname></artwork></sourcecode> <t>Forexample, theexample: command <tt>LIST CLIENT ups1</tt> andthe response:response </t><artwork>BEGIN<sourcecode name="" type="shell"> BEGIN LIST CLIENT ups1 CLIENT ups1 ::1 CLIENT ups1 203.0.113.1 END LIST CLIENT ups1</artwork></sourcecode> </section> <section anchor="cmd"> <name><tt>LIST CMD</tt></name> <t>The command calls for the Attachment Daemon to report a list of the Instant Commandswhichthat the Management Daemon may send to the Attachment Daemon. This Instant Command list is the abstracted view of the UPS hardware capabilities. An economical UPS will support few or no InstantCommandsCommands, but a professional model should support more. </t> <t>Command: <tt>LIST CMD <upsname></tt> </t><t>The response is:</t> <sourcecode>BEGIN<t>Response:</t> <sourcecode name="" type="shell"> BEGIN LIST CMD <upsname> CMD <upsname> <cmdname> ... END LIST CMD <upsname> </sourcecode><t>where <tt><upsname></tt><t><tt><upsname></tt> is the name of the UPS, and <tt><cmdname></tt> is the name of the Instant Commandwhichthat may be issued to the UPS. </t> <t>Forexample the command:example: command <tt>LIST CMD su700</tt> andthe response:response </t><sourcecode>BEGIN<sourcecode name="" type="shell"> BEGIN LIST CMD su700 CMD su700 load.on CMD su700 test.panel.start ... END LIST CMD su700 </sourcecode> </section> <section anchor="enum"> <name><tt>LIST ENUM</tt></name> <t>The command calls for the Attachment Daemon to report the set of possible values of a UPS variablewhichthat has predetermined values. </t> <t>Command: <tt>LIST ENUM <upsname> <varname></tt> </t><t>The response is:</t> <sourcecode>BEGIN<t>Response:</t> <sourcecode name="" type="shell"> BEGIN LIST ENUM <upsname> <varname> ENUM <upsname> <varname> "<value>" ... END LIST ENUM <upsname> <varname> </sourcecode><t>where <tt><upsname></tt><t><tt><upsname></tt> is the name of the UPS, <tt><varname></tt> is the UPSvariablevariable, and <tt><value></tt> is one of the possible values of that UPS variable. Notethatthat, in currentpracticepractice, the output is an unordered list.Note alsoAlso note that theQUOTATION MARKSquotation marks are part of the response. </t> <t>Forexample the command:example: command <tt>LIST ENUM su700 input.transfer.low</tt> andthe response:</t> <sourcecode>BEGINresponse</t> <sourcecode name="" type="shell"> BEGIN LIST ENUM su700 input.transfer.low ENUM su700 input.transfer.low "103" ENUM su700 input.transfer.low "100" ... END LIST ENUM su700 input.transfer.low </sourcecode> </section> <section anchor="range"> <name><tt>LIST RANGE</tt></name> <t>The command calls for the Attachment Daemon to report the interval in which valid values of UPS variable lie. </t> <t>Command: <tt>LIST RANGE <upsname> <varname></tt> </t><t>The response is: </t> <sourcecode>BEGIN<t>Response:</t> <sourcecode name="" type="shell"> BEGIN LIST RANGE <upsname> <varname> RANGE <upsname> <varname> "<min>" "<max>" ... END LIST RANGE <upsname> <varname> </sourcecode><t>where <tt><upsname></tt><t><tt><upsname></tt> is the name of the UPS, <tt><varname></tt> is the UPSvariablevariable, and {<tt><min></tt>,<tt><max></tt>} is the interval of valid values of that UPS variable. Note that theQUOTATION MARKSquotation marks are part of the response. </t> <t>Forexample, theexample: command <tt>LIST RANGE su700 input.transfer.low</tt> andthe response:response </t><sourcecode>BEGIN<sourcecode name="" type="shell"> BEGIN LIST RANGE su700 input.transfer.low RANGE su700 input.transfer.low "90" "105" END LIST RANGE su700 input.transfer.low </sourcecode> </section> <section anchor="listrw"> <name><tt>LIST RW</tt></name> <t>The command calls for the Attachment Daemon to report a list of the UPS variables associated with a given UPSwhichthat may be read and written by the Management Daemon. These variables are the abstracted view of the UPS hardware capabilities. An economical UPS may support fewvariablesvariables, but a professional model should support at least the variableswhichthat are needed for an automatic shutdown andrestart,restart; see <xref target="shutdownstory"></xref>.See alsoAlso, see <xref target="MinSup"></xref> for details of the recommended minimum support of variables. A full list of variables is available in <xref target="gitvars">source code filedocs/nut-names.txt</xref>docs/nut-names.txt</xref>, which serves as the Recording Document. </t> <t>Command: <tt>LIST RW <upsname></tt> </t><t>The response is:</t> <sourcecode>BEGIN<t>Response:</t> <sourcecode name="" type="shell"> BEGIN LIST RW <upsname> RW <upsname> <varname> "<value>" ... END LIST RW <upsname> </sourcecode><t>where <tt><upsname></tt><t><tt><upsname></tt> is the name of the UPS, <tt><varname></tt> is the UPSvariablevariable, and <tt><value></tt> is the value of that UPS variable. Note that theQUOTATION MARKSquotation marks are part of the response. </t> <t>Forexample the command:example: command <tt>LIST RW su700</tt> andthe response:response </t><sourcecode>BEGIN<sourcecode name="" type="shell"> BEGIN LIST RW su700 RW su700 output.voltage.nominal "115" RW su700 ups.delay.shutdown "020" ... END LIST RW su700 </sourcecode> </section> <section anchor="ups"> <name><tt>LIST UPS</tt></name> <t>The command calls for the Attachment Daemon to report a list of the UPS units to which it is attached. </t> <t>Command: <tt>LIST UPS</tt> </t><t>The response is:</t> <sourcecode>BEGIN<t>Response:</t> <sourcecode name="" type="shell"> BEGIN LIST UPS UPS <upsname> "<description>" ... END LIST UPS </sourcecode><t>where <tt><upsname></tt><t><tt><upsname></tt> is the name of a UPS, and <tt><description></tt> is the description maintained by the AttachmentDaemonDaemon, if available. It is set to "Unavailable" otherwise. Note that theQUOTATION MARKSquotation marks are part of the response. </t> <t>This command can also be used to determine what values of <tt><upsname></tt> are valid before calling other functions on the server. This is also a good way to handle situations where a single Attachment Daemon supports multipleUPS's.UPSs. It is also useful for clientswhichthat perform a UPS discovery process. </t> <t>Forexample, the response:example: response </t><sourcecode>BEGIN<sourcecode name="" type="shell"> BEGIN LIST UPS UPS su700 "Development box" END LIST UPS </sourcecode> </section> <section anchor="listvar"> <name><tt>LIST VAR</tt></name> <t>The command calls for the Attachment Daemon to report a list of all the UPS variableswhichthat it maintains for a givenUPS,UPS and the values of those UPS variables. </t> <t>Command: <tt>LIST VAR <upsname></tt> </t><t>The response is:</t> <sourcecode>BEGIN<t>Response:</t> <sourcecode name="" type="shell"> BEGIN LIST VAR <upsname> VAR <upsname> <varname> "<value>" ... END LIST VAR <upsname> </sourcecode><t>where <tt><upsname></tt><t><tt><upsname></tt> is the name of the UPS, <tt><varname></tt> is the UPSvariablevariable, and <tt><value></tt> is the value of that variable. Note that theQUOTATION MARKSquotation marks are part of the response. </t> <t>The response to this command lists the UPS variables available for this UPS and their currentvalues. For example thevalues.</t> <t>For example: command <tt>LIST VAR su700</tt> andthe response:response </t><sourcecode>BEGIN<sourcecode name="" type="shell"> BEGIN LIST VAR su700 VAR su700 ups.mfr "Example Mfg" VAR su700 ups.mfr.date "10/17/96" ... END LIST VARsu700</sourcecode>su700 </sourcecode> <t>See <xref target="MinSup"></xref> for details of the recommended minimum support of variables. A full list of variables is available in <xref target="gitvars">source code filedocs/nut-names.txt</xref>docs/nut-names.txt</xref>, which serves as the Recording Document. </t> </section> </section> <section anchor="password"> <name><tt>PASSWORD</tt></name> <t>This command is a companion to<tt>USERNAME</tt>,<tt>USERNAME</tt> and is used by a Management Daemon to specify the password required to enter aSessionsession with the AttachmentDaemon,Daemon; see <xref target="sess"></xref>. </t> <t>Command: <tt>PASSWORD <password></tt> </t> <t>If the command succeeds, the response is<tt>OK</tt>, otherwise<tt>OK</tt>; otherwise, see the errorresponses,responses in <xref target="errorresponses"></xref>. </t> <t>For examples of the use of commands <tt>USERNAME</tt> and <tt>PASSWORD</tt> by administrative users, see <xref target="adsecclient"></xref>. </t> <t>ABNF: See variable<tt>password</tt><tt>session-password</tt> in <xref target="fig.ABNF"></xref>. </t> </section> <section anchor="primary"> <name><tt>PRIMARY</tt></name> <t>In current practice, the Attachment Daemon records in local file <tt>upsd.users</tt> that an administrative user is a Primary. See <xref target="adminuser"></xref> for an example. When a Management Daemon starts up and opens aSessionsession with the Attachment Daemon, it lays claim to being a Primary by sending command <tt>PRIMARY</tt> to the Attachment Daemon, thus claiming that it has the required authority to performsuchcriticalactionsactions, such as setting status symbol <tt>FSD</tt>. </t> <t>Command: <tt>PRIMARY <upsname></tt> </t><t>where <tt><upsname></tt><t><tt><upsname></tt> is the name of the UPS. </t> <t>If the Attachment Daemon has the authority, the response is<tt>OK</tt>, otherwise<tt>OK</tt>; otherwise, see the error responses in <xref target="errorresponses"></xref>. </t> <aside> <t>Note: Historically, this command was known as<tt>MASTER</tt>. </t><tt>MASTER</tt>.</t> </aside> </section> <section anchor="protver"> <name><tt>PROTVER</tt></name> <t>Return the version of the command/response protocol used by the Attachment Daemon. This command is intended forhumanhuman, as well asprogramprogram, use. </t><t>Command<t>Command: <tt>PROTVER</tt> </t> <t>Forexample,example: the following command line sequence in the AttachmentDaemon:Daemon </t><sourcecode>netcat<sourcecode name="" type="shell"> netcat localhost 3493 PROTVER1.3</sourcecode>1.3 </sourcecode> <t>Notes: </t> <ol spacing="compact" indent="adaptive"> <li>There are noQUOTATION MARKSquotation marks in the response. </li> <li>The version of the protocol returned by <tt>PROTVER</tt> is differenttothan the implementation version of the Attachment Daemon returned by <tt>VER</tt>. </li> <li>To ease migration, NUT version 2.8.0 also supports the equivalent <tt>NETVER</tt> command used in previous releases. See <xref target="Version.2.7.4"></xref>. </li> </ol> <t>ABNF: See variable <tt>protver</tt> in <xref target="fig.ABNF"></xref>. </t> </section> <section anchor="set"> <name><tt>SET</tt></name> <t>The command calls for the Attachment Daemon to set a UPS variable to a given value. Whether this has an effect on the UPS hardware is specific to the Driver and the UPS model. Some variables are read-only due to the design of the UPS or itsdriver.Driver. </t> <t>Command: <tt>SET VAR <upsname> <varname> "<value>"</tt> </t><t>where <tt><upsname></tt><t><tt><upsname></tt> is the name of the UPS, <tt><varname></tt> is the UPSvariablevariable, and <tt><value></tt> is the value to be assigned to that variable. Note that theQUOTATION MARKSquotation marks are part of the command. </t> <t>If the command succeeds, the response is<tt>OK</tt>, otherwise<tt>OK</tt>; otherwise, see the error responses in <xref target="errorresponses"></xref>. </t> <t>Forexample the command:example: command <tt>SET VAR su700 ups.id "My UPS"</tt> andtheresponse <tt>OK</tt> </t> <t>ABNF: See the variable <tt>set</tt> in <xref target="fig.ABNF"></xref>. </t> </section> <section anchor="starttls"> <name><tt>STARTTLS</tt></name> <t>The client tells the Attachment Daemon to switch to communication encrypted by TLS <xreftarget="RFC8446"></xref> encrypted communication.target="RFC8446"></xref>. When the client receives<tt>OK</tt><tt>OK</tt>, it also switches to TLS encryption. </t> <t>Command: <tt>STARTTLS</tt> </t> <t>If the command succeeds, the response is <tt>OKSTARTTLS</tt>, otherwiseSTARTTLS</tt>; otherwise, see the error responses in <xref target="errorresponses"></xref>. </t> <t>If the client does not send command STARTTLS to the AttachmentDaemonDaemon, communication continuesunencrypted, howeverunencrypted; however, an Attachment Daemon <bcp14>MAY</bcp14> refuse unencrypted communication. </t> <t>NUT 2.8.0 supports the encryption of communications between the Attachment Daemon and the Management Daemon using TLS 1.3 <xref target="RFC8446"></xref> with X.509 v3certificatescertificates, as defined by <xref target="RFC5280"></xref> and updates. See <xref target="AppendixEavesdropping"></xref> for details of the encryption of communications in previousrelaserelease 2.7.4. </t> <t>ABNF: See variable <tt>starttls</tt> in <xref target="fig.ABNF"></xref>. </t> <section anchor="selfsigned"> <name>Key Infrastructure andSelf-signedSelf-Signed Certificates</name> <t><em>The very restricted nature of UPS management makes it of interest to consider self-signed certificates.</em> </t> <t>In the World Wide Web, there are millions of servers and hundreds of millions of potential clients for each one. The servers do not know who their clients will be, so they entrust the management of a Public Key Infrastructure (PKI) to Certificate Authorities that theytrust, for some value oftrust. The encryption of communications between the client and server requires that the browsers carry a list of Certificate Authoritieswhichthat the clients have to trust. <em>This is a many-to-many relationship.</em> </t> <t>The management of UPS units is not a many-to-manyrelationship,relationship; it is frequentlyone-to-one.one to one. In the closely restrained world of UPS management, there are a very limited number of clients for each server, rarely more than three, and unlike the World WideWebWeb, the server administrators know exactly who they are. These clients visit very few servers, typically one only. This situation is totally differenttofrom the World Wide Web. The use of external Certificate Authorities is a potential security weakness that must be accepted for the World WideWeb,Web but which can be avoided for UPS management by either generatinglocallythe private and publickeys, orkeys locally or, for largerorganisations,organizations, using aPrivate Key Infrastructure..PKI. </t> <t>The security policies for UPS management may be subordinate to anorganisation'sorganization's own internal IT security plans and procedures, possibly based on <xref target="RFC7030"></xref> and <xref target="RFC8894"></xref>, but in simplecasescases, it is possible to obtain better security using self-signed certificates. </t> </section> </section> <section anchor="username"> <name><tt>USERNAME</tt></name> <t>The Attachment Daemon limits access to clients whose credentials match those in the file <tt>upsd.users</tt>. There is no anonymous access. A Management Daemon program or script uses command <tt>USERNAME</tt> and its companion command <tt>PASSWORD</tt> to open aSessionsession with the Attachment Daemon for an administrative user. Note that this command is for program or script use and is not the familiar login command typed on a command line to gain access to a shell. </t> <t>Command: <tt>USERNAME <username></tt> </t> <t>If the command succeeds, the response is<tt>OK</tt>, otherwise<tt>OK</tt>; otherwise, see the error responses in <xref target="errorresponses"></xref>. </t> <t>For examples of the use of commands <tt>USERNAME</tt> and <tt>PASSWORD</tt> by administrative users, see <xref target="adsecclient"></xref>. </t> <t>ABNF: See variable<tt>username</tt><tt>session-username</tt> in <xref target="fig.ABNF"></xref>. </t> </section> <section anchor="ver"> <name><tt>VER</tt></name> <t>Return the implementation version of the Attachment Daemon. This command is intended forhumanhuman, as well asprogramprogram, use. </t><t>Command<t>Command: <tt>VER</tt> </t> <t>Forexample,example: the following command linesequence:sequence </t><sourcecode>netcat<sourcecode name="" type="shell"> netcat localhost 3493 VER Network UPS Tools upsd 2.8.0 - http://www.networkupstools.org/ </sourcecode> <t>Notes: </t> <ol spacing="compact" indent="adaptive"> <li>There are noQUOTATION MARKSquotation marks in the response. </li> <li>The implementation version of the Attachment Daemon returned by VER is differenttothan the protocol version returned by <tt>PROTVER</tt>. </li> </ol> <t>ABNF: See variable <tt>ver</tt> in <xref target="fig.ABNF"></xref>. </t> </section> </section> <section anchor="responses"> <name>Summary of Responses</name> <section anchor="success"> <name>ResponsewhenWhen Command Succeeds</name> <t>If the command succeeds, the response has the following command-dependent form: </t> <table> <name>Responseif command succeeds </name>If Command Succeeds</name> <thead> <tr><th>Command </th> <th>Response </th> <th>Reference </th> <th>Note </th><th>Command</th> <th>Response</th> <th>Reference</th> <th>Note</th> </tr> </thead> <tbody> <tr><td><tt>ATTACH</tt> </td> <td><tt>OK</tt> </td><td><tt>ATTACH</tt></td> <td><tt>OK</tt></td> <td><xreftarget="attach"></xref> </td>target="attach"></xref></td> <td>Was LOGIN </td> </tr> <tr><td><tt>DETACH</tt> </td><td><tt>DETACH</tt></td> <td><tt>OKGoodbye</tt> </td>Goodbye</tt></td> <td><xreftarget="detach"></xref> </td>target="detach"></xref></td> <td>Was LOGOUT </td> </tr> <tr><td><tt>FSD</tt> </td><td><tt>FSD</tt></td> <td><tt>OKFSD-SET</tt> </td>FSD-SET</tt></td> <td><xreftarget="FSD"></xref> </td> <td> </td>target="FSD"></xref></td> <td></td> </tr> <tr><td><tt>GET</tt> </td> <td>Sub command specific </td><td><tt>GET</tt></td> <td>Subcommand specific</td> <td><xreftarget="get"></xref> </td> <td> </td>target="get"></xref></td> <td></td> </tr> <tr><td><tt>HELP</tt> </td><td><tt>HELP</tt></td> <td>List ofcommands </td>commands</td> <td><xreftarget="help"></xref> </td> <td> </td>target="help"></xref></td> <td></td> </tr> <tr><td><tt>INSTCMD</tt> </td> <td><tt>OK </tt> </td><td><tt>INSTCMD</tt></td> <td><tt>OK</tt></td> <td><xreftarget="instcmd"></xref> </td> <td> </td>target="instcmd"></xref></td> <td></td> </tr> <tr><td><tt>LIST</tt> </td> <td>Sub command specific </td><td><tt>LIST</tt></td> <td>Subcommand specific</td> <td><xreftarget="list"></xref> </td> <td> </td>target="list"></xref></td> <td></td> </tr> <tr><td><tt>PASSWORD</tt> </td> <td><tt>OK</tt> </td><td><tt>PASSWORD</tt></td> <td><tt>OK</tt></td> <td><xreftarget="password"></xref> </td> <td> </td>target="password"></xref></td> <td></td> </tr> <tr> <td><tt>PRIMARY</tt> </td><td><tt>OK</tt> </td><td><tt>OK</tt></td> <td><xreftarget="primary"></xref> </td> <td> </td>target="primary"></xref></td> <td></td> </tr> <tr><td><tt>PROTVER</tt> </td><td><tt>PROTVER</tt></td> <td>Protocolversion </td>version</td> <td><xreftarget="protver"></xref> </td>target="protver"></xref></td> <td>WasNETVER </td>NETVER</td> </tr> <tr><td><tt>SET</tt> </td> <td><tt>OK</tt> </td><td><tt>SET</tt></td> <td><tt>OK</tt></td> <td><xreftarget="set"></xref> </td> <td> </td>target="set"></xref></td> <td></td> </tr> <tr><td><tt>STARTTLS</tt> </td><td><tt>STARTTLS</tt></td> <td><tt>OKSTARTTLS</tt> </td>STARTTLS</tt></td> <td><xreftarget="starttls"></xref> </td> <td> </td>target="starttls"></xref></td> <td></td> </tr> <tr><td><tt>USERNAME</tt> </td> <td><tt>OK</tt> </td><td><tt>USERNAME</tt></td> <td><tt>OK</tt></td> <td><xreftarget="username"></xref> </td> <td> </td>target="username"></xref></td> <td></td> </tr> <tr><td><tt>VER</tt> </td><td><tt>VER</tt></td> <td>Programversion </td>version</td> <td><xreftarget="ver"></xref> </td> <td> </td>target="ver"></xref></td> <td></td> </tr> </tbody> </table> </section> <section anchor="errorresponses"> <name>Error Responses</name> <t>Error responses have the following format: </t><sourcecode>ERR<sourcecode name="" type="shell"> ERR <error-name> [<extra>] </sourcecode><t>where <tt><error-name></tt><t><tt><error-name></tt> is a single word token taken from the 27 characters A-Z andHYPHEN (MINUS).hyphen (-). Implementations<bcp14>MAY</bcp14><bcp14>MAY</bcp14>, ifneededneeded, add anadditionaladditional, optional <tt><extra></tt>. Current practice does not make use of this possibility. </t> <t>The <tt><error-name></tt> may have one of the following values: </t> <table anchor="errors"> <name>Errorresponses </name>Responses</name> <thead> <tr> <thalign="center"> The error name token <br/><tt><error-name></tt> </th>align="center"> The Error Name Token <br/><tt><error-name></tt></th> <thalign="center">Meaning </th>align="center">Meaning</th> </tr> </thead> <tbody> <tr> <td><tt>ACCESS-DENIED</tt></td> <td>The client's host and/or authentication details supplied by <tt>USERNAME</tt> and <tt>PASSWORD</tt> are not sufficient to execute the requestedcommand. </td>command.</td> </tr> <tr> <td><tt>ALREADY-ATTACHED</tt></td> <td><t>The client has already sent a successful <tt>ATTACH</tt> command for a given UPS and can't do itagain. </t><t>Note: Historically, this error response was <tt>ALREADY-LOGGED-IN</tt>. </t></td>again.</t> </td> </tr> <tr> <td><tt>ALREADY-SET-PASSWORD</tt></td> <td>The client has already supplied a <tt>PASSWORD</tt> and is attempting to repeat the command in the sameSession. </td>session.</td> </tr> <tr> <td><tt>ALREADY-SET-USERNAME</tt></td> <td>The client has already supplied a<tt>USERNAME</tt>,<tt>USERNAME</tt> and is attempting to repeat the command within the sameSession. </td>session.</td> </tr> <tr> <td><tt>CMD-NOT-SUPPORTED</tt></td> <td>The specified UPS doesn't support the InstantCommand. </td>Command.</td> </tr> <tr> <td><tt>DATA-STALE</tt></td> <td><t>The Attachment Daemon is connected to the Driver for the UPS, but thatdriverDriver isn't providing regular updates or has specifically marked the data as stale. Current practice is for the Attachment Daemon to refuse to provide the Management Daemon with variables on stale units to avoid falsereadings. </t><t>Thisreadings.</t> <t>This generally means that the Driver is running, but it has lost communication with the hardware. Check the physical connection to the equipment. </t></td> </tr> <tr> <td><tt>DRIVER-NOT-CONNECTED</tt></td> <td>The Attachment Daemon can't perform the requested command, since the Driver for that UPS is not connected. This usually means that thedriverDriver is notrunning, orrunning or, if it is, ismisconfigured. </td>misconfigured.</td> </tr> <tr> <td><tt>FEATURE-NOT-CONFIGURED</tt></td> <td>This instance of the Attachment Daemon hasn't been configured properly to allow the requested feature to operate. In currentpracticepractice, this error response is possible only for command<tt>STARTTLS</tt>. </td><tt>STARTTLS</tt>.</td> </tr> <tr> <td><tt>FEATURE-NOT-SUPPORTED</tt></td> <td>This instance of Attachment Daemon does not support the requested feature. In currentpracticepractice, this error response is possible only for command<tt>STARTTLS</tt>. </td><tt>STARTTLS</tt>.</td> </tr> <tr> <td><tt>INSTCMD-FAILED</tt></td> <td>The Attachment Daemon failed to deliver the Instant Command request to the Driver. No further information is available to the client. This typically indicates a dead or brokendriver. </td>Driver.</td> </tr> <tr> <td><tt>INVALID-ARGUMENT</tt></td> <td>The client sent an argument to a commandwhichthat is not recognized or is otherwise not valid in this context. This is typically caused by sending a validcommandcommand, such as<tt>GET</tt><tt>GET</tt>, with a subcommandwhichthat is notvalid. </td>valid.</td> </tr> <tr> <td><tt>INVALID-PASSWORD</tt></td> <td>The client sent anon valid <tt>PASSWORD</tt>. </td>nonvalid <tt>PASSWORD</tt>.</td> </tr> <tr> <td><tt>INVALID-USERNAME</tt></td> <td>The client sentan non valid <tt>USERNAME</tt>. </td>a nonvalid <tt>USERNAME</tt>.</td> </tr> <tr> <td><tt>INVALID-VALUE</tt></td> <td>The value specified in the request is not valid. This usually applies to a <tt>SET</tt> of an <tt>ENUM</tt> typewhichthat is using a value not in the list of allowed values. See <xreftarget="enum"></xref>. </td>target="enum"></xref>.</td> </tr> <tr><td><tt>PASSWORD-REQUIRED</tt></td><td><tt>PASSWORD-<bcp14>REQUIRED</bcp14></tt></td> <td>The command requires a <tt>PASSWORD</tt> for authentication, but the client hasn't providedone. </td>one.</td> </tr> <tr> <td><tt>READONLY</tt></td> <td>The requested variable in a <tt>SET</tt> command is notwritable. </td>writable.</td> </tr> <tr> <td><tt>SET-FAILED</tt></td> <td>The Attachment Daemon failed to deliver the <tt>SET</tt> request to the Driver. This is similar to<tt>INSTCMD-FAILED</tt>. </td><tt>INSTCMD-FAILED</tt>.</td> </tr> <tr> <td><tt>TLS-ALREADY-ENABLED</tt></td> <td><t>TLS mode is already enabled on this connection, so the Attachment Daemon can't start it again. </t><t>Note: Historically, this message was <tt>ALREADY-SSL-MODE.</tt> </t></td> </tr> <tr> <td><tt>TLS-NOT-ENABLED</tt></td> <td><t>TLS mode is required but has not yet been enabled on this connection, so the Attachment Daemon can't sendcommands. </t><t>Note:commands.</t> <t>Note: This message is experimental and not in current commonuse. </t></td>use.</t></td> </tr> <tr> <td><tt>TOO-LONG</tt></td> <td>The requested value in a <tt>SET</tt> command is toolong. </td>long.</td> </tr> <tr> <td><tt>UNKNOWN-COMMAND</tt></td> <td>The Attachment Daemon doesn't recognize thecommand. </td>command.</td> </tr> <tr> <td><tt>UNKNOWN-UPS</tt></td> <td>The UPS specified in the request is not known to the Attachment Daemon. This usually means that it didn't match anything in the Attachment Daemonconfiguration. </td>configuration.</td> </tr> <tr><td><tt>USERNAME-REQUIRED</tt></td><td><tt>USERNAME-<bcp14>REQUIRED</bcp14></tt></td> <td>The command requires a <tt>USERNAME</tt> for authentication, but the client hasn't providedone. </td>one.</td> </tr> <tr> <td><tt>VAR-NOT-SUPPORTED</tt></td> <td>The specified UPS doesn't support the UPS variable in thecommand. </td>command.</td> </tr> </tbody> </table> <aside> <t>Note: Historically, this error response was <tt>ALREADY-LOGGED-IN</tt>.</t> </aside> </section> </section> <section anchor="ABNF"> <name>An ABNF of the Commands</name> <t>This section repeats the syntax of <xreftarget="commands"></xref>,target="commands"></xref> but in AugmentedBachus-NaurBackus-Naur Form (ABNF). It does not define any additionalfeature.features. For further details of each command and the response, see <xref target="commands"></xref>. </t> <t>The commands may be presented in ABNF <xreftarget="RFC5234"></xref><xref target="RFC7405"></xref>,target="RFC5234"></xref> <xref target="RFC7405"></xref> and represented usingASCIIUS-ASCII <xref target="RFC0020"></xref>. </t> <t>Current practice toleratesmixed casemixed-case command names, but it is <bcp14>RECOMMENDED</bcp14> to useupper caseuppercase only for commands. See <xref target="fig.ABNF"></xref>. </t> <figure anchor="fig.ABNF" align="center"> <name>ABNF for the Commands </name> <sourcecode type="abnf"> ;------------------------------------------------------------------- ; This grammar is case sensitive. Terminal keywords SHOULD be ; written inupper caseuppercase, as shown. ; The following basic rules written withupper caseuppercase names are ; taken fromRFC5234RFC 5234, Appendix B.1. SP = 1*%x20 ; At least one SPACE LF = %x0A ; Linefeed DIGIT = %x30-39 ; Digit 0 through 9 ALPHA = %x41-5A / %x61-7A ; A-Z / a-z DQUOTE = %x22 ; Double quote " VCHAR = %x21-7E ; Visible (printing) characters ; Additional basic rules needed by this grammar LC = %x61-7A ; Letter a through z DOT = 1%x2E ; Exactly one . COLON = 1%x3A ; Exactly one : AT = 1%x40 ; Exactly one @ SEP = 1"-" / 1"_" / 1"." ; A single - or _ or . JOIN = COLON / AT ; A single : or @ ; Frequently used in this grammar cmdname = 1*LC *62(DOT 1*LC) ;E.g.E.g., load.off.delay upschar = DIGIT / ALPHA / SEP ups = 1*ALPHA *62upschar ;E.g.E.g., Example-Mfg-999 group = ups ;E.g.E.g., HB (Not in common use) hostname = ups ;E.g.E.g., example.com port = 1*5DIGIT ;E.g.E.g., 3493 upsname = [group COLON] ups [AT hostname [COLON port]] ; Fully Qualified UPS name ;E.g.E.g., ; HB:heartbeat1@example.com:3493 username = ups ;E.g.E.g., Power-Dept.6 varname = 1*LC *62( DOT 1*(DIGIT / LC) ) ;E.g.E.g., outlet.1.status ;------------------------------------------------------------------- commandLine = command LF ; LF is a single %x0A command = attach / detach / fsd / get / help / instcmd / list / password / primary / protver / set / starttls / username / ver ; attach = "ATTACH" SP upsname ; detach = "DETACH" ; fsd = "FSD" SP upsname ; get = "GET" SP getsubcommnd getsubcommand = getcmddesc / getdesc / getnumattach / gettype / getupsdesc / getvar ; getcmddesc = "CMDDESC" SP upsname SP cmdname getdesc = "DESC" SP upsname SP varname getnumattach = "NUMATTACH" SP upsname gettype = "TYPE" SP upsname SP varname getupsdesc = "UPSDESC" SP upsname getvar = "VAR" SP upsname SP varname ; help = "HELP" ; instcmd = "INSTCMD" SP upsname SP cmdname ; list = "LIST" listsubcommand listsubcommand = listclient / listcmd / listenum / listrange / listrw / listups / listvar ; listclient = "CLIENT" SP upsname listcmd = "CMD" SP upsname listenum = "ENUM" SP upsname SP varname listrange = "RANGE" SP upsname SP varname listrw = "RW" SP upsname listups = "UPS" listvar = "VAR" SP upsname ;passwordsession-password = "PASSWORD" SP *63VCHAR ; A sequence of printable characters defined ; in a server configuration file. Local ; security practices may mandate a minimum ; and maximum number of characters. ; primary = "PRIMARY" SP upsname ; protver = "PROTVER" ; value = *63VCHAR ; Local practices may limit the choice of ;characters,characters and requirenon US-ASCII.non-US-ASCII. set = "SET" SP %s"VAR" SP upsname SP varname SP DQUOTE value DQUOTE ; starttls = "STARTTLS" ;usernamesession-username = "USERNAME" SP username ; ver = "VER" ;------------------------------------------------------------------- </sourcecode> </figure><t>Notes: </t><t>Notes:</t> <ol spacing="normal" indent="adaptive"> <li><em>Implementation note:</em> The ABNF is written using the provisions of <xref target="RFC5234"></xref> and <xreftarget="RFC7405"></xref>target="RFC7405"></xref>, which are <xref target="RFC0020">US-ASCIIbased</xref>. </li>based</xref>.</li> <li>The grammar is case sensitive. The terminal key words <bcp14>SHOULD</bcp14> be written inupper caseuppercase, asspecified. </li>specified.</li> <li>The repetition factor in front of an expression has the form<min>*<max><min>*<max>, where <min> is the minimum number ofrepetitionsrepetitions, and <max> is the maximumnumber. </li>number.</li> <li>If <min> isomittedomitted, its value is 0. If <max> is omitted, its value isinfinity. </li>infinity.</li> <li>The notation<tt>n*n</tt><tt>n*n</tt>, meaning "exactly ncopies"copies", may be written as<tt>n</tt>. </li><tt>n</tt>.</li> <li>Square brackets around an expression mean that the expression is optional. This could be written as<tt>0*1</tt>. </li><tt>0*1</tt>.</li> </ol> <section anchor="ABNF-resp"> <name>Responses to Commands</name> <t>The responses to the commands are encoded in <xref target="RFC0020">US-ASCII</xref> and fall into two groups: </t> <ol spacing="normal" indent="adaptive"> <li>Short replies to actioncommands,commands; see <xreftarget="responses"></xref>. </li>target="responses"></xref>.</li> <li>Long replies to requests for information. In thiscasecase, the reply is sent in a sequence of messages. The last message will contain a line beginning <tt>END LIST</tt> .See for exampleFor example, see <xreftarget="client"></xref>. </li>target="client"></xref>.</li> </ol> </section> </section> </section> <section> <name>Statuses and Events</name> <section anchor="symbols"> <name>Status Symbols</name> <t>These symbols resume the abstracted view of the UPS hardware maintained by the Attachment Daemon. The variable <tt>ups.status</tt> contains one or more space-separated statussymbolssymbols, which together describe the UPS state at that instant. In currentpracticepractice, the Management Daemon will poll variable <tt>ups.status</tt> every 5 seconds with acommandcommand, such as <tt>GET VAR su700ups.status</tt>ups.status</tt>, andresponsea response, such as <tt>VAR su700 ups.status "OBLB"</tt>LB"</tt>, to discover changes in the UPS status. These changes will indicate UPS events. </t> <table> <name>UPS StatusSymbols </name>Symbols</name> <thead> <tr> <th align="center">Status Symbol </th> <thalign="center">Meaning </th>align="center">Meaning</th> </tr> </thead> <tbody> <tr><td><tt>ALARM</tt> </td><td><tt>ALARM</tt></td> <td>The UPS reports that it requiresintervention. </td>intervention.</td> </tr> <tr><td><tt>BOOST</tt> </td><td><tt>BOOST</tt></td> <td>The UPS has determined that the voltage level of the public power supply is toolow,low and is boosting it to the required level. The UPS continues to supply the protected system from the public powersupply. </td>supply.</td> </tr> <tr><td><tt>BYPASS</tt> </td><td><tt>BYPASS</tt></td> <td>The UPS is feeding current directly from the public power supply to the protected system. The backup facilities are disconnected. This state allows maintenance personnel to change the batteries without interrupting the protectedsystem. </td>system.</td> </tr> <tr><td><tt>CAL</tt> </td><td><tt>CAL</tt></td> <td>The UPS is calibrating itself, forexampleexample, to determine at what charge the <tt>LB</tt> status is raised orlowered. </td>lowered.</td> </tr> <tr><td><tt>CHRG</tt> </td><td><tt>CHRG</tt></td> <td><t>The UPS battery is charging. This usually implies that the UPS also has status<tt>OL</tt>,<tt>OL</tt> but may not be the case if the UPS also has status <tt>OFF</tt>. </t></td> </tr> <tr><td><tt>COMM</tt> </td><td><tt>COMM</tt></td> <td>The Attachment Daemon has effective contact with theUPS. </td>UPS.</td> </tr> <tr><td><tt>DISCHRG</tt> </td><td><tt>DISCHRG</tt></td> <td><t>The UPS battery is discharging. This usually implies that the UPS also has status<tt>OB</tt>,<tt>OB</tt> but may not be the case if the UPS also has status <tt>OFF</tt>. </t></td> </tr> <tr><td><tt>FSD</tt> </td><td><tt>FSD</tt></td> <td>This "Forced Shutdown" status signals that the final shutdown sequence hasbegun. </td>begun.</td> </tr> <tr><td><tt>LB</tt> </td><td><tt>LB</tt></td> <td>Low Battery. The battery level of the UPS is below a chosen limit. The UPS may be in status <tt>OL</tt> or<tt>OB</tt>. </td><tt>OB</tt>.</td> </tr> <tr><td><tt>NOCOMM</tt> </td><td><tt>NOCOMM</tt></td> <td>The Attachment Daemon has no effective contact with theUPS. </td>UPS.</td> </tr> <tr><td><tt>OB</tt> </td><td><tt>OB</tt></td> <td>On Battery. The UPS is taking energy fromit'sits battery. The battery is discharging. A UPS must have status <tt>OB</tt> or<tt>OL</tt>, otherwise<tt>OL</tt>; otherwise, it is deemeddead. </td>dead.</td> </tr> <tr><td><tt>OFF</tt> </td><td><tt>OFF</tt></td> <td>The UPS is in state "Off". It does not react to failure in the public power supply. The exact meaning depends on themodel. </td>model.</td> </tr> <tr><td><tt>OL</tt> </td><td><tt>OL</tt></td> <td>Online. The UPS is online, receiving energy from the public power supply. The battery is charging. A UPS must have status <tt>OB</tt> or<tt>OL</tt>, otherwise<tt>OL</tt>; otherwise, it is deemeddead. </td>dead.</td> </tr> <tr><td><tt>OVER</tt> </td><td><tt>OVER</tt></td> <td>Overloaded. The UPS reports that the load on it is beyondit'sits normal operatingmaximum. </td>maximum.</td> </tr> <tr><td><tt>RB</tt> </td><td><tt>RB</tt></td> <td>Replace battery. The UPS reports thatit's battery/batteriesits battery or batteries should bereplaced. </td>replaced.</td> </tr> <tr><td><tt>TEST</tt> </td><td><tt>TEST</tt></td> <td>Under test. The UPS is currently undergoing atest, whichtest that may have beencalled forrequested manually orinternally. </td>internally.</td> </tr> <tr><td><tt>TICK</tt> </td><td><tt>TICK</tt></td> <td>Heartbeat. A software UPS in the Attachment Daemon provides a regular signal monitored by the Management Daemon as a way of verifying effective end-to-end management. <tt>TICK</tt> and <tt>TOCK</tt> arecompanions,companions; they are consideredexperimental. </td>experimental.</td> </tr> <tr><td><tt>TOCK</tt> </td><td><tt>TOCK</tt></td> <td>Heartbeat. See<tt>TICK</tt> </td><tt>TICK</tt></td> </tr> <tr><td><tt>TRIM</tt> </td><td><tt>TRIM</tt></td> <td>The UPS has determined that the voltage level of the public power supply is toohigh,high and is reducing it to the required level. The UPS continues to supply the protected system from the public powersupply. </td>supply.</td> </tr> </tbody> </table> </section> <section anchor="events"> <name>Events</name> <t>A Management Daemon detects the occurrence of a UPSEventevent from a change in the UPS status received from the Attachment Daemon. The following table summarizes the process. A status of "none" means that the status symbol is not present in the variable <tt>ups.status</tt>. </t> <t>The Management Daemon should retrieve the variable <tt>ups.status</tt> from the Attachment Daemon at regular intervals. If the interval is too short, compute and network resources will be wasted, but if the interval is too large, the Management Daemon risks missing short-lived changes in the UPS status. </t> <t>A default value of 5 seconds is <bcp14>RECOMMENDED</bcp14>, but an implementation <bcp14>MAY</bcp14> make this value configurable. Bydefaultdefault, the "old" status is therefore the previous value retrieved 5 seconds ago. </t> <t>Current practice is for the Management Daemon to assign names to certain events. Theseisare shown in the table in parentheses. </t> <table> <name>EventdeductionDeduction fromstatus changes </name>Status Changes</name> <thead> <tr> <th>Oldstatus </th>Status</th> <th>Newstatus </th> <th>Event </th> <th> </th>Status</th> <th>Event</th> <th> </th> <th>Oldstatus </th>Status</th> <th>Newstatus </th> <th>Event </th>Status</th> <th>Event</th> </tr> </thead> <tbody> <tr><td>none </td> <td><tt>ALARM</tt> </td><td>none</td> <td><tt>ALARM</tt></td> <td>Alarmon </td> <td> </td> <td><tt>ALARM</tt> </td> <td>none </td>on</td> <td> </td> <td><tt>ALARM</tt></td> <td>none</td> <td>Alarmoff </td>off</td> </tr> <tr><td>none </td> <td><tt>BOOST</tt> </td><td>none</td> <td><tt>BOOST</tt></td> <td>Boostingvoltage </td> <td> </td> <td><tt>BOOST</tt> </td> <td>none </td>voltage</td> <td> </td> <td><tt>BOOST</tt></td> <td>none</td> <td>Notboosting </td>boosting</td> </tr> <tr><td>none </td> <td><tt>BYPASS</tt> </td><td>none</td> <td><tt>BYPASS</tt></td> <td>Bypasson </td> <td> </td> <td><tt>BYPASS</tt> </td> <td>none </td>on</td> <td> </td> <td><tt>BYPASS</tt></td> <td>none</td> <td>Bypassoff </td>off</td> </tr> <tr><td>none </td> <td><tt>CAL</tt> </td> <td>Calibrating </td> <td> </td> <td><tt>CAL</tt> </td> <td>none </td><td>none</td> <td><tt>CAL</tt></td> <td>Calibrating</td> <td> </td> <td><tt>CAL</tt></td> <td>none</td> <td>Notcalibrating </td>calibrating</td> </tr> <tr><td>none </td> <td><tt>CHRG</tt> </td> <td>Charging </td> <td> </td> <td><tt>CHRG</tt> </td> <td>none </td><td>none</td> <td><tt>CHRG</tt></td> <td>Charging</td> <td> </td> <td><tt>CHRG</tt></td> <td>none</td> <td>Notcharging </td>charging</td> </tr> <tr><td>none </td> <td><tt>COMM</tt> </td><td>none</td> <td><tt>COMM</tt></td> <td>UPScommunicating<br/>(Event <tt>COMMOK</tt>) </td> <td> </td> <td><tt>COMM</tt> </td> <td>none </td>communicating<br/>(event <tt>COMMOK</tt>)</td> <td> </td> <td><tt>COMM</tt></td> <td>none</td> <td>See note <xref target="DDD"format="counter"></xref> </td>format="counter"></xref></td> </tr> <tr><td>none </td> <td><tt>DISCHRG</tt> </td> <td>Discharging </td> <td> </td> <td><tt>DISCHRG</tt> </td> <td>none </td><td>none</td> <td><tt>DISCHRG</tt></td> <td>Discharging</td> <td> </td> <td><tt>DISCHRG</tt></td> <td>none</td> <td>Notdischarging </td>discharging</td> </tr> <tr anchor="EventFSD"><td>none </td> <td><tt>FSD</tt> </td><td>none</td> <td><tt>FSD</tt></td> <td>Systemshutdown<br/>(Eventsshutdown<br/>(events <tt>FSD</tt>,<tt>SHUTDOWN</tt>) </td> <td> </td> <td><tt>FSD</tt> </td> <td>none </td><tt>SHUTDOWN</tt>)</td> <td> </td> <td><tt>FSD</tt></td> <td>none</td> <td>Shutdown abandoned. See note <xref target="AAA"format="counter"></xref> </td>format="counter"></xref></td> </tr> <tr><td>none </td> <td><tt>LB</tt> </td><td>none</td> <td><tt>LB</tt></td> <td>Low battery. See note <xref target="BBB" format="counter"></xref>(Event <tt>LOWBATT</tt>) </td> <td> </td> <td><tt>LB</tt> </td> <td>none </td>(event <tt>LOWBATT</tt>)</td> <td> </td> <td><tt>LB</tt></td> <td>none</td> <td>Battery notlow </td>low</td> </tr> <tr><td>none </td> <td><tt>NOCOMM</tt> </td><td>none</td> <td><tt>NOCOMM</tt></td> <td>UPS dead? See note <xref target="DDD"format="counter"></xref><br/>(Eventsformat="counter"></xref><br/>(events <tt>COMMBAD</tt>,<tt>NOCOMM</tt>) </td> <td> </td> <td><tt>NOCOMM</tt> </td> <td>none </td><tt>NOCOMM</tt>)</td> <td> </td> <td><tt>NOCOMM</tt></td> <td>none</td> <td>See note <xref target="DDD"format="counter"></xref> </td>format="counter"></xref></td> </tr> <tr><td>none </td> <td><tt>OFF</tt> </td><td>none</td> <td><tt>OFF</tt></td> <td>UPS turnedoff </td> <td> </td> <td><tt>OFF</tt> </td> <td>none </td>off</td> <td> </td> <td><tt>OFF</tt></td> <td>none</td> <td>UPS not turnedoff </td>off</td> </tr> <tr><td><tt>OB</tt> </td> <td><tt>OL</tt> </td><td><tt>OB</tt></td> <td><tt>OL</tt></td> <td>Receivingpower<br/>(Event <tt>ONLINE</tt>) </td> <td> </td> <td><tt>OL</tt> </td> <td><tt>OB</tt> </td>power<br/>(event <tt>ONLINE</tt>)</td> <td> </td> <td><tt>OL</tt></td> <td><tt>OB</tt></td> <td>Powerlost<br/>(Event <tt>ONBATT</tt>) </td>lost<br/>(event <tt>ONBATT</tt>)</td> </tr> <tr><td>none </td> <td><tt>OVER</tt> </td><td>none</td> <td><tt>OVER</tt></td> <td>UPSoverloaded </td> <td> </td> <td><tt>OVER</tt> </td> <td>none </td>overloaded</td> <td> </td> <td><tt>OVER</tt></td> <td>none</td> <td>Overloadgone </td>gone</td> </tr> <tr><td>none </td> <td><tt>RB</tt> </td><td>none</td> <td><tt>RB</tt></td> <td>Replacebattery<br/>(Event <tt>REPLBATT</tt>) </td> <td> </td> <td><tt>RB</tt> </td> <td>none </td>battery<br/>(event <tt>REPLBATT</tt>)</td> <td> </td> <td><tt>RB</tt></td> <td>none</td> <td>Replacementcanceled </td>canceled</td> </tr> <tr><td>none </td> <td><tt>TEST</tt> </td><td>none</td> <td><tt>TEST</tt></td> <td>Teststarts </td> <td> </td> <td><tt>TEST</tt> </td> <td>none </td>starts</td> <td> </td> <td><tt>TEST</tt></td> <td>none</td> <td>Testfinished </td>finished</td> </tr> <tr><td>none </td> <td><tt>TICK</tt> </td><td>none</td> <td><tt>TICK</tt></td> <td>Heartbeat event. See note <xref target="CCC" format="counter"></xref> </td><td> </td> <td><tt>TICK</tt> </td> <td>none </td><td> </td> <td><tt>TICK</tt></td> <td>none</td> <td>No heartbeat. See note <xref target="CCC"format="counter"></xref> </td>format="counter"></xref></td> </tr> <tr><td>none </td> <td><tt>TOCK</tt> </td><td>none</td> <td><tt>TOCK</tt></td> <td>Heartbeat event. See note <xref target="CCC" format="counter"></xref> </td><td> </td> <td><tt>TOCK</tt> </td> <td>none </td><td> </td> <td><tt>TOCK</tt></td> <td>none</td> <td>No heartbeat. See note <xref target="CCC"format="counter"></xref> </td>format="counter"></xref></td> </tr> <tr><td>none </td> <td><tt>TRIM</tt> </td><td>none</td> <td><tt>TRIM</tt></td> <td>Trimmingvoltage </td> <td> </td> <td><tt>TRIM</tt> </td> <td>none </td>voltage</td> <td> </td> <td><tt>TRIM</tt></td> <td>none</td> <td>Nottrimming </td>trimming</td> </tr> </tbody> </table><t>Notes </t><dl newline="true" spacing="normal"> <dt>Notes:</dt> <dd> <ol spacing="compact" indent="adaptive"> <li anchor="AAA">Current practice does not include thisevent. </li>event.</li> <li anchor="BBB">If the status <tt>OB</tt> is present, current practice takes Management Daemon reception of <tt>LB</tt> as an order to perform an emergency systemshutdown. </li>shutdown.</li> <li anchor="CCC">The use of asoftware definedsoftware-defined UPS to provide a heartbeat is experimental and is not part of common currentpractice. </li>practice.</li> <li anchor="DDD">Current practiceis:is the following: if the UPS has not responded for 15 seconds, the Management Daemon assumes that the UPS is"<em>dead</em>" (Event<em>dead</em> (event <tt>NOCOMM</tt>), and if the last known <tt>OL</tt>/<tt>OB</tt> status was<tt>OB</tt><tt>OB</tt>, a systemshutdown, command <tt>FSD</tt>,shutdown (command <tt>FSD</tt>) iscalled for. </li>requested.</li> </ol> </dd> </dl> </section> </section> <section anchor="Sec"> <name>Security Considerations</name> <section anchor="weak"> <name>Current General Security Practice</name> <t>Experience over the last 20 years shows that new UPS management software releases are notfrequent, andfrequent and, when installed, stay unmodified for some years. This is probably because UPS management is a mature activity, part of sitemangement.management. A limited number of system administrators have access to the UPS hardware and software and tend to assume a certain "security by obscurity" since many installations have a configurationaslike the one shown infigure<xreftarget="fig.weak" format="counter"></xref>target="fig.weak"/>, which uses port 3493/TCP (nut) between the two daemons running in the same system. The traffic is often not encrypted, and whenencryptedit is encrypted, it uses deprecated early versions of SSL/TLS. </t> <figure anchor="fig.weak"> <name>Commonsingle-system configuration </name>Single-System Configuration</name> <artworkalign="center">align="center" type="ascii-art"> ,-----, ,--------------------,---------------------, | UPS |---| Attachment <-Commands Management | | |===| Daemon Responses-> Daemon | /-----\ '--------------------'---------------------' Listens on port 3493/TCP forlocalhost</artwork>localhost </artwork> </figure> <t>This situation is now changing aslow costlow-cost processors become available, costing significantly less than a UPS unit. This evolution makes it interesting to shift to a configurationaslike the one shown infigure<xreftarget="fig.weaker" format="counter"></xref>,target="fig.weaker"/>, but it also exacerbates the security weakness offigure<xreftarget="fig.weak" format="counter"></xref>target="fig.weak"/>, since the traffic between the daemons is now over an exposed network. </t> <figure anchor="fig.weaker"> <name>Integration of UPS and Attachment Daemon </name> <artworkalign="center">align="center" type="ascii-art"> ,-----,------------, ,--------------, | UPS - Attachment | <-Commands | Management | | | Daemon | Responses-> | Daemon | /-----'------------\ '--------------' Listens on port3493/TCP</artwork>3493/TCP </artwork> </figure> <t>These security issues raised by UPS management are those of the power industry ingeneral:general; they are addressed in detail in <xref target="IEC62351-1">IEC Technical Specification 62351</xref>. In addition to equipment security, cyber security is now an essential consideration. </t> <t>Quoting from IEC 62351-1<xref target="IEC62351-1"></xref>, Introduction to the standard, clause 5.2.3.5: </t> <blockquote> With the computer systems for power operations presumably kept isolated from the Internet, many utility personnel do not see any reason for adding security measures to these systems. However, as clearly seen from these Subclauses, this may not be true anymore as networking becomes more prevalent and additional information access requirements grow.</blockquote> <t>In IEC 62351-1<xreftarget="IEC62351-1"></xref>target="IEC62351-1"></xref>, clause 5.3.5 lists typical security attacks: Eavesdropping, Masquerade, Man-in-the-Middle, Replay, and Resource Exhaustion.RFC3552<xref target="RFC3552"></xref> adds messageinsersion / deletion / modification,insertion/deletion/modification and denial of service. </t> <t>Let's look more closely at these requirements: </t><ul> <li>Eavesdropping,<ul spacing="normal"> <li>Eavesdropping; see <xreftarget="Eavesdropping"></xref> </li> <li>Man-in-the-Middle,target="Eavesdropping"></xref></li> <li>Man-in-the-Middle; see <xreftarget="Man-in-the-Middle"></xref> </li> <li>Masquerade,target="Man-in-the-Middle"></xref></li> <li>Masquerade; see <xreftarget="Masquerade"></xref> </li>target="Masquerade"></xref></li> <li>Messageinsersion,insertion, deletion,modification,and modification; see <xreftarget="Messageidm"></xref> </li> <li>Replay,target="Messageidm"></xref></li> <li>Replay; see <xreftarget="Replay"></xref> </li>target="Replay"></xref></li> <li>ResourceExhaustion,Exhaustion and Denial ofService,Service; see <xreftarget="Exhaustion"></xref> </li>target="Exhaustion"></xref></li> </ul> </section> <section anchor="SecRec"> <name>Communication Security Requirements</name> <t>Enforcing secure communication requires tightening up the Attachment Daemon to require the use of command <tt>STARTTLS</tt> for commands sent over the global Internet. In such asituationsituation, an Attachment Daemon listening for traffic other than fromthe<tt>localhost</tt>: </t> <ol spacing="normal" indent="adaptive"> <li anchor="should"><bcp14>SHOULD</bcp14> require and accept command<tt>STARTTLS</tt>, </li><tt>STARTTLS</tt>,</li> <li anchor="must"><bcp14>MUST</bcp14> encrypt all communication with a Management Daemon,</li>and</li> <li anchor="shall"><bcp14>SHALL</bcp14> refuse all non-encryptedcommandscommands, except an initial<tt>STARTTLS</tt>. </li><tt>STARTTLS</tt>.</li> </ol> <t>Notes: </t><ul><ul spacing="normal"> <li anchor="note-should">The<bcp14>SHOULD</bcp14><bcp14>SHOULD</bcp14>, rather than<bcp14>MUST</bcp14><bcp14>MUST</bcp14>, in <xref target="should"></xref> above allows system administrators to enforce secure communication using other techniqueswhichthat do not involve the <tt>STARTTLS</tt>command. </li>command.</li> <li>If an Attachment Daemon requires that all commands be encrypted as required by the <bcp14>MUST</bcp14> in <xref target="must"></xref> above,then automaticallythen, automatically, each Management Daemon <bcp14>MUST</bcp14> encrypt as well, since it has to do so in order to gainaccess. </li>access.</li> <li>The <bcp14>SHALL</bcp14> in <xref target="shall"></xref> above applies to traffic from the global Internet. An Attachment Daemon <bcp14>MAY</bcp14> accept unencrypted commands from <tt>localhost</tt> if the local installation's security practices allow it, forexampleexample, in a dedicatedappliance. </li>appliance.</li> </ul> <t>Firewalls <bcp14>SHOULD</bcp14> be used to restrict the communication between the Attachment Daemon and the accepted Management Daemons, prohibiting and discarding traffic from any systems that are not part of the envisioned power management setup. Note: See <xref target="note-should"></xref> above on the use of <bcp14>SHOULD</bcp14>. </t> <section anchor="certsec"> <name>Certificatesecurity</name>Security</name> <t>In long-livedinstallationsinstallations, such as those found in UPS management, careful certificate management is essential, whether the certificate is provided by a CertificateAuthority,Authority or is a self-signed certificate. Forexampleexample, thespecification ofexpiration times of both the certificate containing the public key and the signingcertificate.certificate should be specified. </t> </section> </section> <section anchor="Attacks"> <name>Attacks andDefences</name>Defenses</name> <section anchor="Eavesdropping"> <name>Eavesdropping</name> <t>Thedefencedefense against eavesdropping is encryption of the commands and responses passed between the client Management Daemon and server Attachment Daemon. The protocol provides command <tt>STARTTLS</tt>, see <xref target="starttls"></xref>, which calls on the Attachment Daemon to support TLS encryption of the communication. If this command is accepted, the Management Daemon also encrypts. </t> <t>In current NUT Project practice, the use of TLS isoptional, howeveroptional; however, a Management Daemon may refuse to accept unencrypted communication. This is done by setting declarations <tt>FORCESSL</tt> to 1 and <tt>CERTVERIFY</tt> to 1 in the Management Daemon configuration file. </t> <section> <name>Misplaceddeclarations requiringDeclarations Requiring TLS</name> <t>A further weakness is that the <tt>FORCESSL</tt> and <tt>CERTVERIFY</tt>declarationsdeclarations, which enforce use ofencryptionencryption, are in the client Management Daemon configuration file and not in the Attachment Daemon. Secure practice requires enforcement by the server AttachmentDaemonDaemon, rather than a possibly rogue client Management Daemon out on the Internet. </t> <t>This weakness may be mitigated with strict firewall ruleswhichthat would prevent the rogue client Management Daemon from accessing the Attachment Daemon. </t> </section> <section> <name>WeakprotectionProtection inprevious versionPrevious Version 2.7.4</name> <t>Although version 2.8.0 of NUT supports TLS 1.3 <xref target="RFC8446"></xref> with X.509 v3 certificates as defined byRFC5280<xref target="RFC5280"></xref>, previous version 2.7.4 only supported earlier SSL/TLS versions. To overcome this weakness, The following techniques have been used: </t><ul> <li>Shims,<ul spacing="normal"> <li>Shims; see <xreftarget="Shims"></xref> </li>target="Shims"></xref></li> <li>TLStunnel,tunnel; see <xreftarget="TLStunnel"></xref> </li>target="TLStunnel"></xref></li> <li>Virtual PrivateNetwork, VPN,Network (VPN); see <xreftarget="VPN"></xref> </li>target="VPN"></xref></li> <li>Virtual Local Areanetwork, VLAN,Network (VLAN); see <xreftarget="VLAN"></xref> </li>target="VLAN"></xref></li> </ul> </section> </section> <section anchor="Man-in-the-Middle"><name>Man in the Middle</name><name>Man-in-the-Middle</name> <t>The protocol relies on TLS encryption to prevent man-in-the-middle attacks. See <xref target="AppendixEavesdropping"></xref> for defense methods used for previous NUT version 2.7.4. </t> </section> <section anchor="Masquerade"> <name>Masquerade Attack: Agent Verification</name> <t anchor="AgentVerif">The protocol allows a malicious client acting asana Management Daemon to send command <tt>FSD</tt> to an Attachment Daemon to shut down a working system andit'sits powersupplysupply, as described in The ShutdownStory, seeStory section (see <xreftarget="shutdownstory"></xref>.target="shutdownstory"></xref>). Similarly, a malicious client could turn off the UPS poweroutletsoutlets, causing the system to fail. </t> <t>The protocol provides commands<tt>USERNAME</tt>, see<tt>USERNAME</tt> (see <xreftarget="username"></xref>,target="username"></xref>) and<tt>PASSWORD</tt>, see<tt>PASSWORD</tt> (see <xreftarget="password"></xref>,target="password"></xref>), which allow an administrative user in a Management Daemon to authenticate itself to the Attachment Daemon, as adefencedefense against masquerade attacks. The administrativeuser nameusername and password need protection against local malicious users. This is done by restricting access to the configuration files. </t> </section> <section anchor="Messageidm"> <name>Messageinsertion, deletion, modification</name>Insertion, Deletion, and Modification</name> <t>The protocol relies on TLS encryption to prevent message insertion,deletiondeletion, and modification attacks. See <xref target="AppendixEavesdropping"></xref> for defense methods used for previous NUT version 2.7.4. </t> </section> <section anchor="Replay"> <name>Replay</name> <t>There are two cases: </t> <ol spacing="normal" indent="adaptive"> <li>The replay is from a system other than an approved ManagementDaemon:Daemon, i.e., the protocol relies on a firewall to block the traffic. </li> <li>The replay is from an approved ManagementDaemon:Daemon. i.e., the protocol relies on the Management Daemon's own security to preventunauthorised access. </li>unauthorized access.</li> </ol> </section> <section anchor="Exhaustion"> <name>Denial of Service</name> <t>The protocol relies on a very tightly specified firewall to preventdenial of servicedenial-of-service attacks. Only designated client Management Daemons should be able to reach the server Attachment Daemon. </t> </section> </section> </section> <section> <name>IANA Considerations</name> <t>The protocol specified by this text runs over port 3493/TCP(nut)(nut), which is registered by theNUT (NetworkNetwork UPSTools) project.Tools (NUT) Project. </t> <t>This documentwill behas been added to the registration'sreference field.Reference field in the "Service Name and Transport Protocol Port Number Registry" <xref target="Registry" format="default"/>. </t> </section> <section anchor="implementation"> <name>Implementation Status</name> <t>This section presents a very short summary of the status of the Network UPS Tools project. </t> <ul anchor="vsh" spacing="compact"> <li>May 1996: The first hack as a cronjob. </li>job.</li> <li>September 1997: The first server-clientcode. </li>code.</li> <li>March 1998: First publicrelease. </li>release.</li> <li>June 1999: Code rewrite with a UPSdriverDriver <tt>smartups</tt>, an Attachment Daemon<tt>upsd</tt><tt>upsd</tt>, and a simple ManagementDaemon. </li>Daemon.</li> <li>September 1999: The project became "Network UPS Tools". The Management Daemon <tt>upsmon</tt> supportedprimary/secondary configurations. </li>Primary/Secondary configurations.</li> <li>June 2001: Common core for multipledrivers. </li>Drivers.</li> <li>May 2002: IANA granted port 3493/TCP (nut). August: release 1.0.0. November: OpenSSLsupport. </li>support.</li> <li>April 2003: The initial set of command and variable names wasdesigned. </li>designed.</li> <li anchor="arno">February 2005: Arnaud Quette took over the project lead from RussellKroll. </li>Kroll.</li> <li>March 2016: Version 2.7.4 released, supported over 100 device manufacturers and hundreds of UPSmodels. </li>models.</li> <li>November 2020: Evgeny "Jim" Klimov took over project lead from ArnaudQuette. </li>Quette.</li> <li>May 2022: Version 2.8.0 released, supporting protocol version1.3. </li>1.3.</li> </ul> <t>See <xref target="githist"></xref> and Appendix J <xref target="History"></xref> for a detailed history of the NUT Project. </t> <section> <name>Inclusion in Software Distributions</name> <t>The programs <tt>upsd</tt>, <tt>upsmon</tt>, <tt>upssched</tt>, <tt>upsc</tt>,<tt>upscmd</tt><tt>upscmd</tt>, and <tt>upsrw</tt> have been included in the package known as "nut" in the package systems of manydistributions:distributions, i.e., all the major Linuxdistributions,distributions and Unixdistributionsdistributions, such as OpenBSD and OpenSolaris. A Microsoft Windows version has been developed but was not maintained. </t> </section> <section anchor="MinSup"> <name>Recommended Minimum Support</name> <t>The features provided by current UPS units vary widely.HoweverHowever, experience shows that a minimum feature set is needed for satisfactory use of the NUT Project software. A full list of variables is available in <xref target="gitvars">source code filedocs/nut-names.txt</xref>docs/nut-names.txt</xref>, which serves as the Recording Document. </t> <section anchor="MinSupPC"> <name>Desktop PC Variables</name> <t>The following variables form a minimum set suitable forDesktopa desktop PC. It is expectedthatthat, on public power supply failure, the PC will be halted. It will not restart automatically when power returns. </t><ul> <li><tt>battery.charge</tt> </li> <li><tt>battery.charge.low</tt> </li> <li><tt>device.mfr</tt> </li> <li><tt>device.model</tt> </li><ul spacing="normal"> <li><tt>battery.charge</tt></li> <li><tt>battery.charge.low</tt></li> <li><tt>device.mfr</tt></li> <li><tt>device.model</tt></li> <li><tt>ups.status</tt> with the minimum status symbol set <tt>OL</tt> <tt>OB</tt> <tt>LB</tt><tt>FSD</tt>,<tt>FSD</tt>; see <xreftarget="symbols"></xref>. </li>target="symbols"></xref></li> </ul> </section> <section anchor="MinSupServer"> <name>UnattendedServers,Servers and Additional Variables</name> <t>The following additional variables are needed in a minimum set suitable for an unattended server. It is expectedthatthat, on public power supply failure, the server will be halted. It will restart automatically when power returns. </t><ul> <li><tt>battery.date</tt> </li> <li><tt>device.serial</tt> </li> <li><tt>ups.delay.shutdown</tt> </li> <li><tt>ups.delay.start</tt> </li><ul spacing="normal"> <li><tt>battery.date</tt></li> <li><tt>device.serial</tt></li> <li><tt>ups.delay.shutdown</tt></li> <li><tt>ups.delay.start</tt></li> </ul> </section> <section anchor="MinSupCommands"> <name>Commands andotherOther Technical Terms</name> <t>Satisfactory use of the NUT Project software requires support for all the commands specified in protocol version 1.3, software version 2.8.0. </t> </section> <section anchor="Version.2.7.4"> <name>Support for Earlier Versions</name> <t>In order to ease migration from software version2.7.42.7.4, which supported protocol version 1.2, software version 2.8.0 also supports the technical terms used in protocol version 1.2. See <xref target="differences"></xref> for the differences. </t> </section> </section> </section><section anchor="Ack"> <name>Acknowledgments</name> <t>This document is based on the NUT Project <xref target="devguide">documentation</xref>. The editor acknowledges the work of Charles Lepple, Arjen de Korte, Arnaud Quette, Jim Klimov, Russell Kroll, Manuel Wolfshant, Greg Troxel, Mark Hansen and many others who contribute to the <xref target="nut-upsuser">nut-upsuser</xref>. and <xref target="nut-upsdev">nut-upsdev</xref> mailing lists. </t> <t>The source for this document is marked up using an <xref target="SGML">SGML DTD</xref> and an XML meta-DTD as defined by <xref target="HyTimeA">HyTime Annex A</xref>. Unlike XML, SGML offers markup minimisation, and the source document takes advantage of this. The <xref target="sgmlnorm"><tt>osgmlnorm</tt></xref> program generates XML which program <xref target="RFC7991"><tt>xml2rfc</tt></xref> uses to prepare the HTML and text renderings. The editor acknowledges the help received from Carsten Bormann and Julian Reschke in the xml2rfc mailing list. </t> <t>Many helpful comments were received from Eliot Lear, Bart Smit, David Zomaya, Joyce Norris, and Ted Mittelstaedt. </t> </section></middle> <back> <references> <name>References</name> <references> <name>NormativeReferences </name> <reference anchor="RFC0020" target="https://www.rfc-editor.org/info/rfc20"> <front> <title>ASCII format for network interchange</title> <author initials="V.G." surname="Cerf" fullname="V.G. Cerf"> </author> <date month="October" year="1969"> </date> </front> <seriesInfo name="STD" value="80"/> <seriesInfo name="RFC" value="20"/> <seriesInfo name="DOI" value="10.17487/RFC0020"/> </reference> <reference xml:base="https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.2119.xml" anchor="RFC2119" target="https://www.rfc-editor.org/info/rfc2119"> <front> <title>Key words for use in RFCs to Indicate Requirement Levels</title> <seriesInfo name="DOI" value="10.17487/RFC2119"/> <seriesInfo name="RFC" value="2119"/> <seriesInfo name="BCP" value="14"/> <author initials="S." surname="Bradner" fullname="S. Bradner"> </author> <date month="March" year="1997"> </date> <abstract> <t>In many standards track documents several words are used to signify the requirements in the specification. These words are often capitalized. This document defines these words as they should be interpreted in IETF documents. This document specifies an Internet Best Current Practices for the Internet Community, and requests discussion and suggestions for improvements. </t> </abstract> </front> </reference> <reference anchor="RFC5234" target="https://www.rfc-editor.org/info/rfc5234"> <front> <title>Augmented BNF for Syntax Specifications: ABNF</title> <author initials="D." surname="Crocker" fullname="D. Crocker" role="editor"> </author> <author initials="P." surname="Overell" fullname="P. Overell"> </author> <date month="January" year="2008"> </date> <abstract> <t>Internet technical specifications often need to define a formal syntax. Over the years, a modified version of Backus-Naur Form (BNF), called Augmented BNF (ABNF), has been popular among many Internet specifications. The current specification documents ABNF. It balances compactness and simplicity with reasonable representational power. The differences between standard BNF and ABNF involve naming rules, repetition, alternatives, order-independence, and value ranges. This specification also supplies additional rule definitions and encoding for a core lexical analyzer of the type common to several Internet specifications. [STANDARDS-TRACK] </t> </abstract> </front> <seriesInfo name="STD" value="68"/> <seriesInfo name="RFC" value="5234"/> <seriesInfo name="DOI" value="10.17487/RFC5234"/> </reference> <reference anchor="RFC7405" target="https://www.rfc-editor.org/info/rfc7405"> <front> <title>Case-Sensitive String Support in ABNF</title> <author initials="P." surname="Kyzivat" fullname="P. Kyzivat"> </author> <date month="December" year="2014"> </date> <abstract> <t>This document extends the base definition of ABNF (Augmented Backus-Naur Form) to include a way to specify US-ASCII string literals that are matched in a case-sensitive manner. </t> </abstract> </front> <seriesInfo name="RFC" value="7405"/> <seriesInfo name="DOI" value="10.17487/RFC7405"/> </reference> <reference anchor="RFC8174" target="https://www.rfc-editor.org/info/rfc8174"> <front> <title>Ambiguity of Uppercase vs Lowercase in RFC 2119 Key Words</title> <author initials="B." surname="Leiba" fullname="B. Leiba"> </author> <date month="May" year="2017"> </date> <abstract> <t>RFC 2119 specifies common key words that may be used in protocol specifications. This document aims to reduce the ambiguity by clarifying that only UPPERCASE usage of the key words have the defined special meanings. </t> </abstract> </front> <seriesInfo name="BCP" value="14"/> <seriesInfo name="RFC" value="8174"/> <seriesInfo name="DOI" value="10.17487/RFC8174"/> </reference>References</name> <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.0020.xml"/> <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.2119.xml"/> <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.5234.xml"/> <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.7405.xml"/> <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.8174.xml"/> </references> <references> <name>Informative References </name><reference anchor="RFC3552" target="https://www.rfc-editor.org/info/rfc3552"> <front> <title>Guidelines for Writing RFC Text on Security Considerations</title> <author initials="E." surname="Rescorla" fullname="E. Rescorla"> </author> <author initials="B." surname="Korver" fullname="B. Korver"> </author> <date month="July" year="2003"> </date> <abstract> <t>All RFCs are required to have a Security Considerations section. Historically, such sections have been relatively weak. This document provides guidelines to RFC authors on how to write a good Security Considerations section. This document specifies an Internet Best Current Practices for the Internet Community, and requests discussion and suggestions for improvements. </t> </abstract> </front> <seriesInfo name="BCP" value="72"/> <seriesInfo name="RFC" value="3552"/> <seriesInfo name="DOI" value="10.17487/RFC3552"/> </reference> <reference xml:base="https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.7991.xml" anchor="RFC7991" target="https://www.rfc-editor.org/info/rfc7991"> <front> <title>The "xml2rfc" Version 3 Vocabulary</title> <seriesInfo name="RFC" value="7991"/> <author initials="P." surname="Hoffman" fullname="P. Hoffman"> </author> <date month="December" year="2016"> </date> </front> </reference> <reference anchor="RFC5280" target="https://www.rfc-editor.org/info/rfc5280"> <front> <title> Internet X.509 Public Key Infrastructure Certificate and Certificate Revocation List (CRL) Profile </title> <author initials="D." surname="Cooper" fullname="D. Cooper"> </author> <author initials="S." surname="Santesson" fullname="S. Santesson"> </author> <author initials="S." surname="Farrell" fullname="S. Farrell"> </author> <author initials="S." surname="Boeyen" fullname="S. Boeyen"> </author> <author initials="R." surname="Housley" fullname="R. Housley"> </author> <author initials="W." surname="Polk" fullname="W. Polk"> </author> <date month="May" year="2008"> </date> <abstract> <t>This memo profiles the X.509 v3 certificate and X.509 v2 certificate revocation list (CRL) for use in the Internet. An overview of this approach and model is provided as an introduction. The X.509 v3 certificate format is described in detail, with additional information regarding the format and semantics of Internet name forms. Standard certificate extensions are described and two Internet-specific extensions are defined. A set of required certificate extensions is specified. The X.509 v2 CRL format is described in detail along with standard and Internet-specific extensions. An algorithm for X.509 certification path validation is described. An ASN.1 module and examples are provided in the appendices. [STANDARDS-TRACK] </t> </abstract> </front> <seriesInfo name="RFC" value="5280"/> <seriesInfo name="DOI" value="10.17487/RFC5280"/> </reference> <reference anchor="RFC7030" target="https://www.rfc-editor.org/info/rfc7030"> <front> <title>Enrollment over Secure Transport</title> <author initials="M." surname="Pritikin" fullname="M. Pritikin" role="editor"> </author> <author initials="P." surname="Yee" fullname="P. Yee" role="editor"> </author> <author initials="D." surname="Harkins" fullname="D. Harkins" role="editor"> </author> <date month="October" year="2013"> </date> <abstract> <t>This document profiles certificate enrollment for clients using Certificate Management over CMS (CMC) messages over a secure transport. This profile, called Enrollment over Secure Transport (EST), describes a simple, yet functional, certificate management protocol targeting Public Key Infrastructure (PKI) clients that need to acquire client certificates and associated Certification Authority (CA) certificates. It also supports client-generated public/private key pairs as well as key pairs generated by the CA. </t> </abstract> </front> <seriesInfo name="RFC" value="7030"/> <seriesInfo name="DOI" value="10.17487/RFC7030"/> </reference> <reference anchor="RFC8446" target="https://www.rfc-editor.org/info/rfc8446"> <front> <title>The Transport Layer Security (TLS) Protocol Version 1.3</title> <author initials="E." surname="Rescorla" fullname="E. Rescorla"> </author> <date month="August" year="2018"> </date> <abstract> <t>This document specifies version 1.3 of the Transport Layer Security (TLS) protocol. TLS allows client/server applications to communicate over the Internet in a way that is designed to prevent eavesdropping, tampering, and message forgery.</t> <t>This document updates RFCs 5705 and 6066, and obsoletes RFCs 5077, 5246, and 6961. This document also specifies new requirements for TLS 1.2 implementations.</t> </abstract> </front> <seriesInfo name="RFC" value="8446"/> <seriesInfo name="DOI" value="10.17487/RFC8446"/> </reference> <reference anchor="RFC8894" target="https://www.rfc-editor.org/info/rfc8894"> <front> <title>Simple Certificate Enrolment Protocol</title> <author initials="P." surname="Gutmann" fullname="P. Gutmann"> </author> <date month="September" year="2020"> </date> <abstract> <t>This document specifies the Simple Certificate Enrolment Protocol (SCEP), a PKI protocol that leverages existing technology by using Cryptographic Message Syntax (CMS, formerly known as PKCS #7) and PKCS #10 over HTTP. SCEP is the evolution of the enrolment protocol sponsored by Cisco Systems, which enjoys wide support in both client and server implementations, as well as being relied upon by numerous other industry standards that work with certificates. </t> </abstract> </front> <seriesInfo name="RFC" value="8894"/> <seriesInfo name="DOI" value="10.17487/RFC8894"/> </reference><xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.3552.xml"/> <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.7991.xml"/> <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.5280.xml"/> <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.7030.xml"/> <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.8446.xml"/> <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.8894.xml"/> <reference anchor="IEC62351-1" target="https://nanopdf.com/download/technical-iec-specification-ts-62351-1_pdf"> <front><title>IEC TS 62351-1 Power<title>Power systems management and associated information exchange -- Data and communications security. Part 1: Communication network and system security -- Introduction to security issues</title> <author> <organization>IEC</organization> </author> <dateday="15"month="May"year="2007"> </date> <abstract> <t>Provides an introduction to the remaining parts of the IEC 62351 series, primarily to introduce the reader to various aspects of information security as applied to power system operations.</t> </abstract>year="2007"></date> </front> <seriesInfo name="IEC"value="Technical Specification Reference number IEC/TS 62351-1:2007(E), 35 pages"/> <seriesInfo name="CHF" value="205"/> <seriesInfo name="Technical Committee" value="TCvalue="TS 62351-1:2007"/> <refcontent>35 pages, TC 57 - Power systems management and associated informationexchange"/>exchange</refcontent> </reference> <reference anchor="NUT" target="https://www.networkupstools.org"> <front> <title>Network UPSTools (NUT) Project</title>Tools, Devices Dumps Library</title> <author><organization> </organization><organization/> </author> </front> </reference> <reference anchor="nut-upsuser" target="https://alioth-lists.debian.net/cgi-bin/mailman/listinfo/nut-upsuser"> <front> <title>Network UPS Tools (NUT) Project Mailing List forusers</title>Users</title> <author><organization> </organization><organization>NUT</organization> </author> </front> </reference> <reference anchor="nut-upsdev" target="https://alioth-lists.debian.net/cgi-bin/mailman/listinfo/nut-upsdev"> <front> <title>Network UPS Tools (NUT) Project Mailing List fordevelopers</title>Developers</title> <author><organization> </organization><organization>NUT</organization> </author> </front> </reference> <reference anchor="nut-repository" target="https://github.com/networkupstools/nut/"> <front><title>GitHub Repository for the<title>The Network UPS Tools(NUT) Project</title>repository </title> <author><organization> </organization><organization/> </author> </front> </reference> <reference anchor="devguide" target="https://networkupstools.org/docs/developer-guide.chunked/ar01s09.html"> <front> <title>Network UPS Tools(NUT)Project Developer Guide</title><author> <organization> </organization><author initials="R" surname="Kroll" fullname="Russell Kroll"> <organization/> </author> <author initials="A" surname="Quette" fullname="Arnaud Quette"> <organization/> </author> <author initials="C" surname="Lepple" fullname="Charles Lepple"> <organization/> </author> <author initials="P" surname="Selinger" fullname="Peter Selinger"> <organization/> </author> </front> </reference> <reference anchor="SGML"> <front> <title>The SGML Handbook</title><seriesInfo name="ISBN" value="0-19-853737-9"/><authorinitials="Charles F."initials="C." surname="Goldfarb" fullname="Charles F. Goldfarb"><organization>Oxford University Press </organization></author> <dateyear="1990"> </date>year="1990"></date> </front> <seriesInfo name="ISBN-10" value="0-19-853737-9"/> <refcontent>Oxford University Press</refcontent> </reference> <reference anchor="HyTimeA"> <front><title>International Standard ISO/IEC 10744<title>Information technology -- Hypermedia/Time-based StructuringLanguage, Annex A, SGML Extended Facilities</title> <seriesInfo name="ISO/IEC" value="JTC 1/SC 34 Document description and processing languages"/>Language (HyTime)</title> <author><organization> </organization><organization>ISO/IEC</organization> </author> <dateyear="1997"> </date>month="August" year="1997"></date> </front> <seriesInfo name="ISO/IEC" value="10744:1997"/> </reference> <reference anchor="sgmlnorm"target="http://www.jclark.com/sp/sgmlnorm.htm">target="http://openjade.sourceforge.net/"> <front><title>SGMLNORM An SGML System Conforming to International Standard ISO 8879 -- Standard Generalized Markup Language</title> <author initials="James" surname="Clark" fullname="James Clark"> <organization> </organization><title>OpenJade Distribution Page</title> <author> <organization>OpenJade Project</organization> </author> </front> </reference> <reference anchor="Registry" target="https://www.iana.org/assignments/service-names-port-numbers/service-names-port-numbers.xhtml"> <front> <title>Service Name and Transport Protocol Port Number Registry</title><seriesInfo name="Publisher:" value="IANA"/> <author> </author><author><organization>IANA</organization></author> </front> </reference> <reference anchor="Library" target="https://networkupstools.org/ddl/"> <front><title>GitHub Network UPS Tools, Devices<title>Devices Dumps Library</title><author> </author><author></author> </front> </reference> <reference anchor="History" target="https://networkupstools.org/docs/user-manual.pdf"> <front> <title>Network UPS Tools UserManual, Appendix J Project history</title> <author> </author>Manual</title> <author initials="R" surname="Kroll" fullname="Russell Kroll"/> <author initials="A" surname="Quette" fullname="Arnaud Quette"/> <author initials="A" surname="de Korte" fullname="Arjen de Korte"/> <date month="May" year="2022"/> </front> </reference> <reference anchor="Documentation" target="https://networkupstools.org/documentation.html"> <front> <title>Network UPS Tools Documentation</title><author> </author><author></author> </front> </reference> <reference anchor="gitvars" target="https://github.com/networkupstools/nut/blob/master/docs/nut-names.txt"> <front><title>GitHub<title>The Network UPS Toolscoderepository, variable names</title><author> </author> </front> </reference> <reference anchor="gitstats" target="https://github.com/networkupstools/nut/blob/master/clients/status.h"> <front> <title>GitHub Network UPS Tools code repository, status names</title> <author> </author><author></author> <date month="April" year="2022"/> </front> </reference> <reference anchor="githist" target="https://github.com/networkupstools/nut/blob/master/docs/history.txt"> <front><title>GitHub<title>The Network UPS Toolscoderepository, project history</title><author> </author><author></author> <date month="July" year="2022"/> </front> </reference> <reference anchor="stunnel" target="https://www.stunnel.org/"> <front><title>Stunnel proxy adds TLS encryption functionality to existing clients and servers</title><title>Stunnel</title> <author></author> </front> </reference> <reference anchor="C2ndEd" target=""> <front> <title>The C Programming Language</title> <authorinitials="Michal" surname="Trojnara" fullname="Michal Trojnara"> </author>initials="B" surname="Kernighan" fullname="Brian W. Kernighan"/> <author initials="D" surname="Ritchie" fullname="Dennis M. Ritchie"/> <date year="1988"/> </front> <seriesInfo name="ISBN" value="0-13-110362-8"/> <refcontent>2nd edition, Prentice Hall Software Series</refcontent> </reference> </references> </references> <section anchor="Annex1"> <name>Variables</name> <t>The UPS variables represent the abstracted state of the UPS unit. Certain variables represent not only the state of some hardwarefeature,feature but also provide tunable values andinstant commands,Instant Commands; see <xref target="IC"></xref>. The full set of variables is recorded in the <xref target="gitvars">reference document for variable names</xref>. </t> <t>The number of variables used in a given deployment depends on the sophistication of the UPSproduct:product; this annex shows a typical example of the subset of variables used for a reasonably complete "consumer grade" UPS. The NUT Project maintains a <xref target="Library">large library of the variable subsets</xref> used by different UPS models. </t> <t>Note that successive versions of a given product may add or deletefeaturesfeatures, causing a change in the subset of variables used. An example is the removal of <tt>ups.delay.start</tt> from a "consumer grade" UPS. The manufacturer reserves the feature for the "professional" product. </t> <t>An implementation of a Management Daemon acting as a utility program may provide a listing of the variables available for a given product, forexampleexample, utility program<tt>upsc</tt><tt>upsc</tt>, as included in the NUTpackage,package; see <xref target="util"></xref>. </t> <t>The following sections illustrate the use of variables by taking the values associated with a typical product. The example is a1600Va 1000W1600 Va 1000 W UPS. </t> <section> <name>Typical UPS Variables</name> <table anchor="typvar"> <name>Typical UPSVariables </name>Variables</name> <thead> <tr> <thalign="center">Variable </th>align="center">Variable</th> <th align="center">Typicalvalue </th>Value</th> <th align="center">Defaultdescription </th>Description</th> </tr> </thead> <tbody> <tr><td><tt>battery.charge</tt> </td> <td><tt>100</tt> </td><td><tt>battery.charge</tt></td> <td><tt>100</tt></td> <td>"Battery charge (percent offull)" </td>full)"</td> </tr> <tr><td><tt>battery.charge.low</tt> </td> <td><tt>20</tt> </td><td><tt>battery.charge.low</tt></td> <td><tt>20</tt></td> <td>"Remaining battery level when UPS switches to LB(percent)" </td>(percent)"</td> </tr> <tr><td><tt>battery.runtime</tt> </td> <td><tt>1481</tt> </td><td><tt>battery.runtime</tt></td> <td><tt>1481</tt></td> <td>"Battery runtime(seconds)" </td>(seconds)"</td> </tr> <tr><td><tt>battery.type</tt> </td> <td><tt>PbAc</tt> </td><td><tt>battery.type</tt></td> <td><tt>PbAc</tt></td> <td>"Batterychemistry" </td>chemistry"</td> </tr> <tr><td><tt>device.mfr</tt> </td><td><tt>device.mfr</tt></td> <td><tt>ExampleMfg</tt> </td> <td>"" </td>Mfg</tt></td> <td>""</td> </tr> <tr><td><tt>device.model</tt> </td><td><tt>device.model</tt></td> <td><tt>Economy1600</tt> </td> <td>"" </td>1600</tt></td> <td>""</td> </tr> <tr><td><tt>device.serial</tt> </td> <td><tt>1234567890</tt> </td> <td>"" </td><td><tt>device.serial</tt></td> <td><tt>1234567890</tt></td> <td>""</td> </tr> <tr><td><tt>device.type</tt> </td> <td><tt>ups</tt> </td> <td>"" </td><td><tt>device.type</tt></td> <td><tt>ups</tt></td> <td>""</td> </tr> <tr><td><tt>driver.name</tt> </td> <td><tt>usbhid-ups</tt> </td><td><tt>driver.name</tt></td> <td><tt>usbhid-ups</tt></td> <td>"Drivername" </td>name"</td> </tr> <tr><td><tt>driver.parameter.lowbatt</tt> </td> <td><tt>37</tt> </td><td><tt>driver.parameter.lowbatt</tt></td> <td><tt>37</tt></td> <td>"Driver parameter:<name>" </td><name>"</td> </tr> <tr><td><tt>driver.parameter.offdelay</tt> </td> <td><tt>30</tt> </td><td><tt>driver.parameter.offdelay</tt></td> <td><tt>30</tt></td> <td>"Driver parameter:<name>" </td><name>"</td> </tr> <tr><td><tt>driver.parameter.ondelay</tt> </td> <td><tt>40</tt> </td><td><tt>driver.parameter.ondelay</tt></td> <td><tt>40</tt></td> <td>"Driver parameter:<name>" </td><name>"</td> </tr> <tr><td><tt>driver.parameter.pollfreq</tt> </td> <td><tt>30</tt> </td><td><tt>driver.parameter.pollfreq</tt></td> <td><tt>30</tt></td> <td>"Driver parameter:<name>" </td><name>"</td> </tr> <tr><td><tt>driver.parameter.pollinterval</tt> </td> <td><tt>2</tt> </td><td><tt>driver.parameter.pollinterval</tt></td> <td><tt>2</tt></td> <td>"Driver parameter:<name>" </td><name>"</td> </tr> <tr><td><tt>driver.parameter.port</tt> </td> <td><tt>auto</tt> </td><td><tt>driver.parameter.port</tt></td> <td><tt>auto</tt></td> <td>"Driver parameter:<name>" </td><name>"</td> </tr> <tr><td><tt>driver.parameter.synchronous</tt> </td> <td><tt>no</tt> </td><td><tt>driver.parameter.synchronous</tt></td> <td><tt>no</tt></td> <td>"Driver parameter:<name>" </td><name>"</td> </tr> <tr><td><tt>driver.parameter.vendorid</tt> </td> <td><tt>0999</tt> </td><td><tt>driver.parameter.vendorid</tt></td> <td><tt>0999</tt></td> <td>"Driver parameter:<name>" </td><name>"</td> </tr> <tr><td><tt>driver.version</tt> </td> <td><tt>2.8.0</tt> </td><td><tt>driver.version</tt></td> <td><tt>2.8.0</tt></td> <td>"Driver version - NUTrelease" </td>release"</td> </tr> <tr><td><tt>driver.version.data</tt> </td><td><tt>driver.version.data</tt></td> <td><tt>HID1.39</tt> </td> <td>"" </td>1.39</tt></td> <td>""</td> </tr> <tr><td><tt>driver.version.internal</tt> </td> <td><tt>0.41</tt> </td><td><tt>driver.version.internal</tt></td> <td><tt>0.41</tt></td> <td>"Internal driverversion" </td>version"</td> </tr> <tr><td><tt>input.transfer.high</tt> </td> <td><tt>264</tt> </td><td><tt>input.transfer.high</tt></td> <td><tt>264</tt></td> <td>"High voltage transfer point(V)" </td>(V)"</td> </tr> <tr><td><tt>input.transfer.low</tt> </td> <td><tt>184</tt> </td><td><tt>input.transfer.low</tt></td> <td><tt>184</tt></td> <td>"Low voltage transfer point(V)" </td>(V)"</td> </tr> <tr><td><tt>outlet.1.desc</tt> </td><td><tt>outlet.1.desc</tt></td> <td><tt>PowerShare Outlet1</tt> </td>1</tt></td> <td>"Outletdescription" </td>description"</td> </tr> <tr><td><tt>outlet.1.id</tt> </td> <td><tt>2</tt> </td><td><tt>outlet.1.id</tt></td> <td><tt>2</tt></td> <td>"Outlet systemidentifier" </td>identifier"</td> </tr> <tr><td><tt>outlet.1.status</tt> </td> <td><tt>on</tt> </td><td><tt>outlet.1.status</tt></td> <td><tt>on</tt></td> <td>"Outlet switchstatus" </td>status"</td> </tr> <tr><td><tt>outlet.1.switchable</tt> </td> <td><tt>no</tt> </td><td><tt>outlet.1.switchable</tt></td> <td><tt>no</tt></td> <td>"Outlet switchability" </td>ability"</td> </tr> <tr><td><tt>outlet.2.desc</tt> </td><td><tt>outlet.2.desc</tt></td> <td><tt>PowerShare Outlet2</tt> </td>2</tt></td> <td>"Outletdescription" </td>description"</td> </tr> <tr><td><tt>outlet.2.id</tt> </td> <td><tt>3</tt> </td><td><tt>outlet.2.id</tt></td> <td><tt>3</tt></td> <td>"Outlet systemidentifier" </td>identifier"</td> </tr> <tr><td><tt>outlet.2.status</tt> </td> <td><tt>on</tt> </td><td><tt>outlet.2.status</tt></td> <td><tt>on</tt></td> <td>"Outlet switchstatus" </td>status"</td> </tr> <tr><td><tt>outlet.2.switchable</tt> </td> <td><tt>no</tt> </td><td><tt>outlet.2.switchable</tt></td> <td><tt>no</tt></td> <td>"Outlet switchability" </td>ability"</td> </tr> <tr><td><tt>outlet.desc</tt> </td><td><tt>outlet.desc</tt></td> <td><tt>MainOutlet</tt> </td>Outlet</tt></td> <td>"Outletdescription" </td>description"</td> </tr> <tr><td><tt>outlet.id</tt> </td> <td><tt>1</tt> </td><td><tt>outlet.id</tt></td> <td><tt>1</tt></td> <td>"Outlet systemidentifier" </td>identifier"</td> </tr> <tr><td><tt>outlet.power</tt> </td> <td><tt>25</tt> </td> <td>"" </td><td><tt>outlet.power</tt></td> <td><tt>25</tt></td> <td>""</td> </tr> <tr><td><tt>outlet.switchable</tt> </td> <td><tt>no</tt> </td><td><tt>outlet.switchable</tt></td> <td><tt>no</tt></td> <td>"Outlet switchability" </td>ability"</td> </tr> <tr><td><tt>output.frequency.nominal</tt> </td> <td><tt>50</tt> </td><td><tt>output.frequency.nominal</tt></td> <td><tt>50</tt></td> <td>"Nominal output frequency(Hz)" </td>(Hz)"</td> </tr> <tr><td><tt>output.voltage</tt> </td> <td><tt>230.0</tt> </td><td><tt>output.voltage</tt></td> <td><tt>230.0</tt></td> <td>"Output voltage(V)" </td>(V)"</td> </tr> <tr><td><tt>output.voltage.nominal</tt> </td> <td><tt>230</tt> </td><td><tt>output.voltage.nominal</tt></td> <td><tt>230</tt></td> <td>"Nominal output voltage(V)" </td>(V)"</td> </tr> <tr><td><tt>ups.beeper.status</tt> </td> <td><tt>enabled</tt> </td><td><tt>ups.beeper.status</tt></td> <td><tt>enabled</tt></td> <td>"UPS beeperstatus" </td>status"</td> </tr> <tr><td><tt>ups.delay.shutdown</tt> </td> <td><tt>20</tt> </td><td><tt>ups.delay.shutdown</tt></td> <td><tt>20</tt></td> <td>"Interval to wait after shutdown with delay command(seconds)" </td>(seconds)"</td> </tr> <tr><td><tt>ups.delay.start</tt> </td> <td><tt>30</tt> </td><td><tt>ups.delay.start</tt></td> <td><tt>30</tt></td> <td>"Interval to wait before (re)starting the load(seconds)" </td>(seconds)"</td> </tr> <tr><td><tt>ups.firmware</tt> </td> <td><tt>02</tt> </td><td><tt>ups.firmware</tt></td> <td><tt>02</tt></td> <td>"UPSfirmware" </td>firmware"</td> </tr> <tr><td><tt>ups.load</tt> </td> <td><tt>20</tt> </td><td><tt>ups.load</tt></td> <td><tt>20</tt></td> <td>"Load on UPS (percent offull)" </td>full)"</td> </tr> <tr><td><tt>ups.mfr</tt> </td><td><tt>ups.mfr</tt></td> <td><tt>ExampleMfg</tt> </td>Mfg</tt></td> <td>"UPSmanufacturer" </td>manufacturer"</td> </tr> <tr><td><tt>ups.model</tt> </td><td><tt>ups.model</tt></td> <td><tt>Economy1600</tt> </td>1600</tt></td> <td>"UPSmodel" </td>model"</td> </tr> <tr><td><tt>ups.power.nominal</tt> </td> <td><tt>1600</tt> </td><td><tt>ups.power.nominal</tt></td> <td><tt>1600</tt></td> <td>"UPS power rating(VA)" </td>(VA)"</td> </tr> <tr><td><tt>ups.productid</tt> </td> <td><tt>ffff</tt> </td><td><tt>ups.productid</tt></td> <td><tt>ffff</tt></td> <td>"Product ID for USBdevices" </td>devices"</td> </tr> <tr> <td><tt>ups.serial</tt> </td> <td><tt>000000000</tt> </td> <td>"UPS serialnumber" </td>number"</td> </tr> <tr><td><tt>ups.status</tt> </td> <td><tt>OL</tt> </td><td><tt>ups.status</tt></td> <td><tt>OL</tt></td> <td>"UPSstatus" </td>status"</td> </tr> <tr><td><tt>ups.temperature</tt> </td> <td><tt>27</tt> </td><td><tt>ups.temperature</tt></td> <td><tt>27</tt></td> <td>"UPS temperature(C)" </td>(C)"</td> </tr> <tr><td><tt>ups.timer.shutdown</tt> </td> <td><tt>0</tt> </td><td><tt>ups.timer.shutdown</tt></td> <td><tt>0</tt></td> <td>"Time before the load will be shutdown(seconds)" </td>(seconds)"</td> </tr> <tr><td><tt>ups.timer.start</tt> </td> <td><tt>0</tt> </td><td><tt>ups.timer.start</tt></td> <td><tt>0</tt></td> <td>"Time before the load will be started(seconds)" </td>(seconds)"</td> </tr> <tr><td><tt>ups.vendorid</tt> </td> <td><tt>0999</tt> </td><td><tt>ups.vendorid</tt></td> <td><tt>0999</tt></td> <td>"Vendor ID for USBdevices" </td>devices"</td> </tr> </tbody> </table> </section> <section anchor="rw"> <name>Typical UPS Readable and Writable Variables</name> <t>Some of the features of a UPS are represented by variableswhichthat may be tuned by the user. The following variables are typical of such tunable features. The precise list depends on the model of UPS. An implementation of a Management Daemon acting as a utility program may provide a listing of the variables available, as well as acting on them, forexampleexample, utility program<tt>upsrw</tt><tt>upsrw</tt>, as included in the NUTpackage,package; see <xref target="util"></xref>. </t> <table> <name>TypicalreadableReadable andwritableWritable UPSVariables </name>Variables</name> <thead> <tr> <thalign="center">Variable </th>align="center">Variable</th> <th align="center">Typicalvalue </th>Value</th> <th align="center">Defaultdescription providedDescription Provided asresponseResponse to thecommandCommand <tt>GETDESC</tt> </th>DESC</tt></th> </tr> </thead> <tbody> <tr><td><tt>battery.charge.low</tt> </td> <td><tt>20</tt> </td><td><tt>battery.charge.low</tt></td> <td><tt>20</tt></td> <td><tt>"Remaining battery level when UPS switches to LB(percent)"</tt> </td>(percent)"</tt></td> </tr> <tr><td><tt>input.transfer.high</tt> </td> <td><tt>264</tt> </td><td><tt>input.transfer.high</tt></td> <td><tt>264</tt></td> <td><tt>"High voltage transfer point(V)"</tt> </td>(V)"</tt></td> </tr> <tr><td><tt>input.transfer.low</tt> </td> <td><tt>184</tt> </td><td><tt>input.transfer.low</tt></td> <td><tt>184</tt></td> <td><tt>"Low voltage transfer point(V)"</tt> </td>(V)"</tt></td> </tr> <tr><td><tt>outlet.1.desc</tt> </td><td><tt>outlet.1.desc</tt></td> <td><tt>PowerShare Outlet1</tt> </td>1</tt></td> <td><tt>"Outletdescription"</tt> </td>description"</tt></td> </tr> <tr><td><tt>outlet.2.desc</tt> </td><td><tt>outlet.2.desc</tt></td> <td><tt>PowerShare Outlet2</tt> </td>2</tt></td> <td><tt>"Outletdescription"</tt> </td>description"</tt></td> </tr> <tr><td><tt>outlet.2.switchable</tt> </td> <td><tt>no</tt> </td><td><tt>outlet.2.switchable</tt></td> <td><tt>no</tt></td> <td><tt>"Outlet switchability"</tt> </td>ability"</tt></td> </tr> <tr><td><tt>outlet.desc</tt> </td><td><tt>outlet.desc</tt></td> <td><tt>MainOutlet</tt> </td>Outlet</tt></td> <td><tt>"Outletdescription"</tt> </td>description"</tt></td> </tr> <tr><td><tt>outlet.power</tt> </td> <td><tt>25</tt> </td><td><tt>outlet.power</tt></td> <td><tt>25</tt></td> <td><tt>"Descriptionunavailable"</tt> </td>unavailable"</tt></td> </tr> <tr><td><tt>output.voltage.nominal</tt> </td> <td><tt>230</tt> </td><td><tt>output.voltage.nominal</tt></td> <td><tt>230</tt></td> <td><tt>"Nominal output voltage(V)"</tt> </td>(V)"</tt></td> </tr> <tr><td><tt>ups.delay.shutdown</tt> </td> <td><tt>20</tt> </td><td><tt>ups.delay.shutdown</tt></td> <td><tt>20</tt></td> <td><tt>"Interval to wait after shutdown with delay command(seconds)"</tt> </td>(seconds)"</tt></td> </tr> <tr><td><tt>ups.delay.start</tt> </td> <td><tt>30</tt> </td><td><tt>ups.delay.start</tt></td> <td><tt>30</tt></td> <td><tt>"Interval to wait before (re)starting the load(seconds)"</tt> </td>(seconds)"</tt></td> </tr> </tbody> </table> </section> <section anchor="instcmdexamples"> <name>Typical UPS Instant Commands</name> <t>Some of the features of a UPS are actions known asinstant commands, seeInstant Commands (see <xreftarget="IC"></xref>,target="IC"></xref>), which may be ordered by the user. The following variables represent suchinstant commands.Instant Commands. The precise list depends on the model of UPS. An implementation of a Management Daemon acting as a utility program may provide a listing of the variables available, as well as acting on them, forexampleexample, utility program<tt>upscmd</tt><tt>upscmd</tt>, as included in the NUTpackage,package; see <xref target="util"></xref>. </t> <table> <name>Typical InstantCommands </name>Commands</name> <thead> <tr> <thalign="center">Command </th>align="center">Command</th> <thalign="center">Meaning </th>align="center">Meaning</th> </tr> </thead> <tbody> <tr><td><tt>beeper.disable</tt> </td><td><tt>beeper.disable</tt></td> <td>Disable the UPSbeeper </td>beeper</td> </tr> <tr><td><tt>beeper.enable</tt> </td><td><tt>beeper.enable</tt></td> <td>Enable the UPSbeeper </td>beeper</td> </tr> <tr><td><tt>beeper.mute</tt> </td><td><tt>beeper.mute</tt></td> <td>Temporarily mute the UPSbeeper </td>beeper</td> </tr> <tr><td><tt>load.off</tt> </td><td><tt>load.off</tt></td> <td>Turn off the loadimmediately </td>immediately</td> </tr> <tr><td><tt>load.off.delay</tt> </td><td><tt>load.off.delay</tt></td> <td>Turn off the load with a delay(seconds) </td>(seconds)</td> </tr> <tr><td><tt>load.on</tt> </td><td><tt>load.on</tt></td> <td>Turn on the loadimmediately </td>immediately</td> </tr> <tr><td><tt>load.on.delay</tt> </td><td><tt>load.on.delay</tt></td> <td>Turn on the load with a delay(seconds) </td>(seconds)</td> </tr> <tr><td><tt>shutdown.return</tt> </td><td><tt>shutdown.return</tt></td> <td>Turn off the load and return when power isback </td>back</td> </tr> <tr><td><tt>shutdown.stayoff</tt> </td><td><tt>shutdown.stayoff</tt></td> <td>Turn off the load and remainoff </td>off</td> </tr> <tr><td><tt>shutdown.stop</tt> </td><td><tt>shutdown.stop</tt></td> <td>Stop a shutdown inprogress </td>progress</td> </tr> </tbody> </table> </section> </section> <section anchor="shutdownstory"> <name>The Shutdown Story for System and UPS</name> <t>This appendix provides background material helpful for a general understanding of the relation between system and UPS. It does not define any feature of the command-response protocol. </t> <t>We consider the steps involved in the shutdown and restart of a long-running unattended server protected by a single UPS. The Management Daemon runs in the server as shown in <xref target="fig.story"></xref>. </t> <figure anchor="fig.story"><name>Long-running unattended server </name><name>Long-Running Unattended Server</name> <artworkalign="center">align="center" type="ascii-art"> ,------------------SERVER------------------, | | | ,-----, | UPS <-Commands UPS | | UPS |---| Attachment | Management | | |===| Daemon Responses-> Daemon | /-----\ '--------------------'---------------------' Internalloopback</artwork>loopback </artwork> </figure> <ol spacing="normal" indent="adaptive"> <li anchor="start"><em>The public power supply ison</em> --on.</em> The system runs normally. Every 5 seconds, variable <tt>ups.status</tt> reports <tt>OL</tt>.--<em>Days, weeks, months goby...</em> </li>by...</em></li> <li><em>Winter storm. Tree falls on power lines. The public power supplyfails</em> --fails.</em> The server remainsoperationaloperational, running on the UPS battery. The Management Daemon polls the AttachmentDaemon,Daemon and detects status change<tt>OL</tt>-><tt>OB</tt>. </li><tt>OL</tt>-><tt>OB</tt>.</li> <li>The Management Daemon logs warning messages. The server is stilloperationaloperational, running on the UPS battery.--<em>Minutes goby...</em> </li>by...</em></li> <li>The battery discharges below the level specified by variable <tt>battery.charge.low</tt>. The server remains operational, but the UPS battery will not last much longer. The Management Daemon polls the AttachmentDaemon,Daemon and detects status change<tt>OB</tt>-><tt>OB</tt>+<tt>LB</tt>. </li><tt>OB</tt>-><tt>OB</tt>+<tt>LB</tt>.</li> <li>The Management Daemon logs the low batteryevent. </li>event.</li> <li anchor="setFSD">The Management Daemon decides to call for a system shutdown. It sets status <tt>FSD</tt> in the Attachment Daemon to call on anysecondariesSecondaries to shut down and waits for command <tt>GET NUMATTACH</tt> to report one single attachment,i.e.i.e., the Primary itself. The Management Daemon then issues the system shutdown command foritself. </li>itself.</li> <li anchor="upsdrvctl">The operating system's shutdown process takes over. During the system shutdown, aNUT Projectspecific script to the NUT Project or an equivalentsystemdsystem service unit runs the command <tt>upsdrvctl shutdown</tt>. This tells the UPS that it is to shut down N seconds later where the default is N=20. Note that the "shutdown" of a UPS removes power from the outletsockets,sockets but may not turn the UPS off completely. A delayed shutdown is sometimes audible, and the characteristic beeping of the UPSstops. </li>stops.</li> <li>The system shuts down and powers down, hopefully before the N=20 seconds havepassed. </li>passed.</li> <li anchor="UPSshutdown"><t><em>N seconds after item <xref target="upsdrvctl" format="counter"></xref></em>--The UPS shuts down, i.e., it turns off its outlet sockets when N=20 seconds have passed. With some UPS units, there is an audible "clunk". </t><t>What if the public power supply returns before the UPS shuts down? The UPS unit should be able to wait a configurable time with default 30 seconds. These two timers start from the moment the UPS receives the <tt>upsdrvctl shutdown</tt> command.--<em>Minutes, hours, days goby...</em> </t></li>by...</em></t></li> <li><em>Some time later, maybe much later, the public power supplyreturns</em> --returns.</em> The UPS reconnectsit'sits outlets to send power to the protectedsystem. </li>system.</li> <li anchor="UPSrestart">The system BIOS option "Restore power on AC return" or "Restore to previous state" has hopefully been selected and the system powers up. The bootstrap process of the operating systembegins. </li>begins.</li> <li>The operating system starts the Attachment Daemon and the Management Daemon. The Attachment Daemon starts the Driver and scans the UPS. The UPS status becomes<tt>OL</tt>+<tt>LB</tt>. </li><tt>OL</tt>+<tt>LB</tt>.</li> <li>After some time, the battery charges above the <tt>battery.charge.low</tt>thresholdthreshold, and the Attachment Daemon declares the status change <tt>OL</tt>+<tt>LB</tt>-><tt>OL</tt>. We are now back in the same situation as item <xref target="start" format="counter"></xref>above. </li>above.</li> </ol> </section> <section anchor="differences"> <name>Technical Terms: Historical Differences</name> <t>This appendix lists the major differences between the technical terms used in NUT software release 2.8.0 and documented in this text,andas well as those used in previous version 2.7.4 of the NUT Project. </t> <table> <name>Technical Terms: Historical Differences</name> <thead> <tr> <th>Term inprevious<br/>releasePrevious<br/>Release NUT2.7.4 </th>2.7.4</th> <th>Term in thisdocument,<br/>releaseDocument,<br/>Release NUT2.8.0 </th>2.8.0</th> <th>Reference </th> </tr> </thead> <tbody> <tr><td>ALREADY-LOGGED-IN </td> <td>ALREADY-ATTACHED </td><td>ALREADY-LOGGED-IN</td> <td>ALREADY-ATTACHED</td> <td><xreftarget="errors"></xref> </td>target="errors"></xref></td> </tr> <tr><td>ALREADY-SSL-MODE </td> <td>TLS-ALREADY-ENABLED </td><td>ALREADY-SSL-MODE</td> <td>TLS-ALREADY-ENABLED</td> <td><xreftarget="errors"></xref> </td>target="errors"></xref></td> </tr> <tr><td><tt>LOGIN</tt> </td> <td><tt>ATTACH</tt> </td><td><tt>LOGIN</tt></td> <td><tt>ATTACH</tt></td> <td><xreftarget="attach"></xref> </td>target="attach"></xref></td> </tr> <tr><td><tt>LOGOUT</tt> </td> <td><tt>DETACH</tt> </td><td><tt>LOGOUT</tt></td> <td><tt>DETACH</tt></td> <td><xreftarget="detach"></xref> </td>target="detach"></xref></td> </tr> <tr><td>Master </td> <td>Primary </td><td>Master</td> <td>Primary</td> <td><xreftarget="prim"></xref> </td>target="prim"></xref></td> </tr> <tr><td><tt>NETVER</tt> </td> <td><tt>PROTVER</tt> </td><td><tt>NETVER</tt></td> <td><tt>PROTVER</tt></td> <td><xreftarget="protver"></xref> </td>target="protver"></xref></td> </tr> <tr><td><tt>NUMLOGINS</tt> </td> <td><tt>NUMATTACH</tt> </td><td><tt>NUMLOGINS</tt></td> <td><tt>NUMATTACH</tt></td> <td><xreftarget="numattach"></xref> </td>target="numattach"></xref></td> </tr> <tr><td>Slave </td> <td>Secondary </td><td>Slave</td> <td>Secondary</td> <td><xreftarget="sec"></xref> </td>target="sec"></xref></td> </tr> </tbody> </table> </section> <section anchor="AppendixEavesdropping"> <name>SecurityDefencesDefenses in Release 2.7.4</name> <t>Previous NUT version 2.7.4 did not provide support for TLS 1.3 <xref target="RFC8446"></xref>. The following subsections describe mitigating techniques. </t> <section anchor="Shims"> <name>Shims</name> <t>Previous version 2.7.4 of NUT did not support TLS 1.3 <xref target="RFC8446"></xref>. Where such protection is needed for version 2.7.4, a possible technique introduces shims between the Attachment Daemon and thenetwork,network and between the network and the ManagementDaemonDaemon, as shown infigure<xreftarget="fig.shim" format="counter"></xref>.target="fig.shim"/>. These shims provide TLS 1.3 support, thus allowing the Attachment Daemon and Management Daemon to continue temporarily withoutnative TLS.having TLS implementations themselves. The technique has been successfully tested. </t> <figure anchor="fig.shim"> <name>ShimsprovideProvide TLSsupport during migrationSupport During Migration </name> <artworkalign="center">align="center" type="ascii-art"> TLS shim listens TLS shim listens on port TBD1/TCP on port 3493/TCP ,-----,------------,----, ,----,--------------, | UPS - Attachment |TLS | <-STARTTLS | TLS| Management | | | Daemon |shim| OK--> |shim| Daemon | /-----'------------'----\ '----'--------------' Listens on port3493/TCP</artwork>3493/TCP </artwork> </figure> <section> <name>Attachment Daemon Shim</name> <t>The shim in front of the Attachment Daemon listens to incoming traffic on port TBD1/TCP. When it receives the command<tt>STARTTLS</tt> it<tt>STARTTLS</tt>, it: </t> <ol spacing="compact" indent="adaptive"><li>Returns<li>returns <tt>OK</tt> to the client and sets up TLSencapsulation. </li> <li>Doesencapsulation.</li> <li>does not send <tt>STARTTLS</tt> to the Attachment Daemon port3493/TCP. </li>3493/TCP.</li> </ol> <t>All other commands and responses are passed through. </t> <t>Note: Port TBD1/TCP is not specified by this text. </t> </section> <section> <name>Management Daemon Shim</name> <t>The shim in front of the Management Daemon listens for incoming traffic on port 3493/TCP. When it receives the command<tt>STARTTLS</tt> it<tt>STARTTLS</tt>, it: </t> <ol spacing="compact" indent="adaptive"><li>Returns<li>returns <tt>FEATURE-NOT-CONFIGURED</tt> to theclient. </li> <li>Sendsclient.</li> <li>sends <tt>STARTTLS</tt> to the Attachment Daemon on portTBD1/TCP. </li>TBD1/TCP.</li> </ol> <t>All other commands and responses are passed through. </t> </section> </section> <section anchor="TLStunnel"> <name>TLS Tunnels</name> <t>Another technique is the use of <xref target="RFC8446">TLS tunnels</xref>, using asoftwaresoftware, such as stunnel <xreftarget="stunnel"></xref>target="stunnel"></xref>, which adds OpenSSL-based TLS support without modifying the Attachment Daemon or Management Daemon. The NUT Project has no procedure to enforce this on sites. </t> </section> <section anchor="VPN"> <name>VPN</name> <t>A further option to secure communications is very similar to <xref target="RFC8446">TLStunnelling</xref>tunneling</xref> and consists of routing the NUT traffic through a Virtual PrivateNetwork, VPN.Network (VPN). </t> </section> <section anchor="VLAN"> <name>VLAN</name> <t>A fourth option is to isolate the UPS management traffic at the network switching level using a VirtualLAN, VLANLAN (VLAN) technique. </t> <figure anchor="fig.VLAN"> <name>UPS Management ProtocolrunsRuns overits ownIts Own VLAN </name> <artworkalign="center">align="center" type="ascii-art"> ,-------------, ,-------------, ,-----, | Attachment | | Management | | UPS |---| Daemon | | Daemon | | | |-------------| UPS |-------------| | |===| | Management | UPS | /-----\ | Protected |~~~~~~~~~~~~~~~| Management | | Server | VLAN | Client | | | '-------------' '-------------' Production | VLAN ,---|-------, ,-----------,| ,-----------,|' | Clients |''-----------'</artwork>'-----------' </artwork> </figure> <t>In <xreftarget="fig.VLAN"></xref>target="fig.VLAN"></xref>, there are two VLANS:Thethe main traffic between the protected server and its clientsusesusing the production VLAN. The UPS management traffic between the Attachment and Management Daemons uses the UPS management VLAN marked as ~~~~~~~~~~~~~. </t> </section> </section> <section anchor="adsec"> <name>Administrative Security</name> <t>Administrativecommandscommands, such as <tt>FSD</tt>,<tt>INSTCMD</tt><tt>INSTCMD</tt>, and<tt>SET</tt><tt>SET</tt>, are powerful and can have a deep effect on systemintegrity,integrity. For example, the command <tt>FSD</tt> is involved inmission criticalmission-critical system shutdown decisions. Access to them needs to be managed and restricted. Thisclausesection presents the current practice. </t> <section anchor="adminuser"> <name>Management of Administrative Users</name> <t>The Attachment Daemon maintains a file (currently <tt>upsd.users</tt>)definingthat defines each administrative user. Note that these users are independent of those recorded in file <tt>/etc/passwd</tt>. Each administrative user gets its own section in file <tt>upsd.users</tt>. The declarations in that section set the parameterswhichthat define that user's privileges. The section begins with the name of the user enclosed in square brackets,OPENING BRACKET [ and CLOSING BRACKET ],opening bracket ([) and closing bracket (]), and continues until the nextuser nameusername in brackets or EOF. </t> <t>Forexampleexample, the following file declares two administrativeusersusers, <tt>admin</tt> and <tt>pfy</tt>:</t><sourcecode><sourcecode name="" type="shell"> [admin] password = sekret upsmon master actions = SET instcmds = ALL [pfy] password = sekret instcmds = test.panel.start instcmds = test.panel.stop </sourcecode> <t>Within eachsectionsection, the administrative user declarations are: </t> <table> <name>Administrativeuser declarations </name>User Declarations</name> <thead> <tr> <th align="center">Declaration </th> <thalign="center">Meaning </th>align="center">Meaning</th> </tr> </thead> <tbody> <tr><td><tt>actions</tt> </td><td><tt>actions</tt></td> <td><t>Allow the user to do certain things in the Attachment Daemon. To specify multiple actions, use multiple instances of the declaration. Valid actionsare: </t><ul>are:</t> <ul spacing="normal"> <li><tt>FSD</tt> Set the "Forced Shutdown" flag for this UPS. See <xreftarget="FSD"></xref>. </li>target="FSD"></xref>.</li> <li><tt>SET</tt> Change the value of a UPS variable. See <xreftarget="set"></xref>. </li> </ul></td> </tr>target="set"></xref>.</li> </ul></td></tr> <tr><td><tt>instcmds</tt> </td><td><tt>instcmds</tt></td> <td>Let a user initiate specificinstant commands.Instant Commands. See <xref target="instcmd"></xref>. Use value <tt>ALL</tt> to grant all commands automatically. To specify multiple commands, use multiple instances of the instcmds field. For the full list of what a given UPS supports, use client <tt>upscmd -l</tt> supplied by the NUT Project. The <tt>LIST CMD</tt> command is issued within the client<tt>upscmd</tt>. </td><tt>upscmd</tt>.</td> </tr> <tr><td><tt>password</tt> </td><td><tt>password</tt></td> <td>Set the password for this user. <em>Your password should be more secure than the examplesshown.</em> </td>shown.</em></td> </tr> <tr><td><tt>upsmon</tt> </td><td><tt>upsmon</tt></td> <td>Add the necessary actions for a Management Daemon to process a system shutdown. In currentpracticepractice, the value is still <tt>master</tt> or <tt>slave</tt>. Note that there is no EQUALS=. </td>=.</td> </tr> </tbody> </table> </section> <section anchor="adsecclient"> <name>An Administrative User of a Client Management Daemon</name> <t>The following examples show the current security practices for administrative users of a client ManagementDaemonDaemon. They also illustrate the command pair <tt>USERNAME</tt> and <tt>PASSWORD</tt>. See Sections <xreftarget="username"></xref>target="username" format="counter"></xref> and <xreftarget="password"></xref>.target="password" format="counter"></xref>. </t> <section> <name>An Administrative User Logs into a Short Session</name> <t>In this simple example of current practice, the system administrator sets the battery level at which an Attachment Daemon will raise the status <tt>LB</tt>, represented by variable <tt>battery.charge.low</tt>, to 35% of full charge. A system administrator types the following command to call the client <tt>upsrw</tt> supplied by the NUT Project.</t><sourcecode>upsrw<sourcecode name="" type="shell"> upsrw -s battery.charge.low=35 -u admin -p sekret UPS-1@example.com </sourcecode> <t>Option <tt>-s</tt> specifies the variable and the value, option <tt>-u</tt> specifies the <tt>USERNAME</tt>, option <tt>-p</tt> specifies the <tt>PASSWORD</tt>, and <tt>UPS-1@example.com</tt> is the UPS. The <tt>USERNAME</tt> and <tt>PASSWORD</tt> commands are issued within the client<tt>upsrw</tt><tt>upsrw</tt>, and theSessionsession is of short duration. </t> <t>Note: Your password should be stronger than the example shown. </t> </section> <section anchor="longsess"> <name>An Administrative User Logs into a Long Session</name> <t>In this second example of current practice, the long-running Management Daemon<tt>upsmon</tt><tt>upsmon</tt>, which is responsible for initiating system shutdowns and which is provided by the NUTProjectProject, issues commands <tt>USERNAME</tt> and <tt>PASSWORD</tt> when it starts up. The data values needed for the <tt>USERNAME</tt> and <tt>PASSWORD</tt> commands are provided by a configuration file<tt>upsmon.conf</tt><tt>upsmon.conf</tt>, which contains theline</t> <sourcecode>MONITORline:</t> <sourcecode name="" type="shell"> MONITOR UPS-1@example.com 1 admin sekret master </sourcecode> <t> This says that the UPS to be monitored is<tt>UPS-1@example.com</tt>, it<tt>UPS-1@example.com</tt>. It provides 1 single powersupply, thesupply. The administrative user is <tt>admin</tt> with password <tt>sekret</tt>. The Management Daemon acts as a Primary, although current practice still uses the former term <tt>master</tt>. </t> <t>The <tt>USERNAME</tt> and <tt>PASSWORD</tt> commands are contained within the client<tt>upsmon</tt><tt>upsmon</tt>, and theSessionsession is of long duration. </t> </section> </section> </section> <section anchor="Ack" numbered="false"> <name>Acknowledgments</name> <t>This document is based on the NUT Project <xref target="devguide">documentation</xref>. The editor acknowledges the work of <contact fullname="Charles Lepple"/>, <contact fullname="Arjen de Korte"/>, <contact fullname="Arnaud Quette"/>, <contact fullname="Jim Klimov"/>, <contact fullname="Russell Kroll"/>, <contact fullname="Manuel Wolfshant"/>, <contact fullname="Greg Troxel"/>, <contact fullname="Mark Hansen"/>, and many others who contribute to the <xref target="nut-upsuser">nut-upsuser</xref> and <xref target="nut-upsdev">nut-upsdev</xref> mailing lists. </t> <t>Earlier draft versions of this document were prepared using an SGML DTD <xref target="SGML"/> and an XML meta-DTD defined by HyTime Annex A <xref target="HyTimeA"/>. Unlike XML, SGML offers markup minimization, and the earlier drafts took advantage of this. The osgmlnorm <xref target="sgmlnorm"/> program generated the XML that was used as input to xml2rfc <xref target="RFC7991"/>, which then created the document's current source. The editor acknowledges the help received from <contact fullname="Carsten Bormann"/> and <contact fullname="Julian Reschke"/> in the xml2rfc mailing list.</t> <t>Many helpful comments were received from <contact fullname="Eliot Lear"/>, <contact fullname="Bart Smit"/>, <contact fullname="David Zomaya"/>, <contact fullname="Joyce Norris"/>, and <contact fullname="Ted Mittelstaedt"/>. </t> </section> </back> </rfc>