02.12.2015 Views

Network UPS Tools User Manual

Network UPS Tools User Manual

Network UPS Tools User Manual

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

<strong>Network</strong> <strong>UPS</strong> <strong>Tools</strong> <strong>User</strong> <strong>Manual</strong> 82 / 84<br />

J.4 Leaving 0.x territory<br />

J.4.1 August 2002: first stable tree: NUT 1.0.0<br />

After nearly 5 years of having a 0.x version number, 1.0.0 was released on August 19, 2002. This milestone meant that all of<br />

the base features that you would expect to find were intact: good hardware support, a network server with security controls, and<br />

system shutdowns that worked.<br />

The design was showing signs of wear from the rapid expansion, but this was intentionally ignored for the moment. The focus<br />

was on getting a good version out that would provide a reasonable base while the design issues could be addressed in the future,<br />

and I’m confident that we succeeded.<br />

J.4.2 November 2002: second stable tree: NUT 1.2.0<br />

One day after the release of 1.0.0, 1.1.0 started the new development tree. During that development cycle, the CGI programs were<br />

rewritten to use templates instead of hard-coded HTML, thus bringing back the flexibility of the original unreleased prototype<br />

from 5 years before. multimon was removed from the tree, as the new upsstats could do both jobs by loading different templates.<br />

A new client library called upsclient was created, and it replaced upsfetch. This new library only supported TCP connections,<br />

and used an opaque context struct to keep state for each connection. As a result, client programs could now do things that used<br />

multiple connections without any conflicts. This was done primarily to allow OpenSSL support, but there were other benefits<br />

from the redesign.<br />

upsd and the clients could now use OpenSSL for basic authentication and encryption, but this was not included by default. This<br />

was provided as a bonus feature for those users who cared to read about it and enable the option, as the initial setup was complex.<br />

After the 1.1 tree was frozen and deemed complete, it became the second stable tree with the release of 1.2.0 on November 5,<br />

2002.<br />

J.4.3<br />

April 2003: new naming scheme, better driver glue, and an overhauled protocol<br />

Following an extended period with no development tree, 1.3.0 got things moving again on April 13, 2003. The focus of this tree<br />

was to rewrite the driver-server communication layer and replace the static naming scheme for variables and commands.<br />

Up to this point, all variables had names like STATUS, UTILITY, and OUTVOLT. They had been created as drivers were added<br />

to the tree, and there was little consistency. For example, it probably should have been INVOLT and OUTVOLT, but there was<br />

no OUTVOLT originally, so UTILITY was all we had. This same pattern repeated with ACFREQ - is it incoming or outgoing?<br />

- and many more.<br />

To solve this problem, all variables and commands were renamed to a hierarchical scheme that had obvious grouping. STATUS<br />

became ups.status. UTILITY turned into input.voltage, and OUTVOLT is output.voltage. ACFREQ is input.frequency, and the<br />

new output.frequency is also now supported. Every other variable or command was renamed in this fashion.<br />

These variables had been shared between the drivers and upsd as values. That is, for each name like STATUS, there was a #define<br />

somewhere in the tree with an INFO_ prefix that gave it a number. INFO_STATUS was 0x0006, INFO_UTILITY was 0x0004,<br />

and so on, with each name having a matching number. This number was stored in an int within a structure which was part of the<br />

array that was either written to disk or shared memory.<br />

That structure had several restrictions on expansion and was dropped as the data sharing method between the drivers and the<br />

server. It was replaced by a new system of text-based messages over Unix domain sockets. Drivers now accepted a short list of<br />

commands from upsd, and would push out updates asynchronously. upsd no longer had to poll the state files or shared memory.<br />

It could just select all of the driver and client fds and act on events.<br />

At the same time, the network protocol on port 3493 was overhauled to take advantage of the new naming scheme. The existing<br />

"REQ STATUS@su700", "ANS STATUS@su700 OL" scheme was showing signs of age, and it really only supported the <strong>UPS</strong><br />

name (@su700) as an afterthought. The new protocol would now use commands like GET and LIST, leading to exchanges like<br />

"GET VAR su700 ups.status" and "VAR su700 ups.status OL". The responses contain enough data to stand alone, so clients can<br />

now handle them asynchronously.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!