Giter Site home page Giter Site logo

networkupstools / nut Goto Github PK

View Code? Open in Web Editor NEW
1.6K 60.0 332.0 84.32 MB

The Network UPS Tools repository. UPS management protocol Informational RFC 9271 published by IETF at https://www.rfc-editor.org/info/rfc9271 Please star NUT on GitHub, this helps with sponsorships!

Home Page: https://networkupstools.org/

License: Other

Shell 6.76% C 77.24% C++ 6.33% HTML 0.01% Makefile 1.96% Perl 0.64% Smarty 0.02% Augeas 0.05% M4 5.90% Groovy 1.07% Batchfile 0.02%
management modbus monitoring netxml nut pdu serial snmp ups usb

nut's Introduction

Network UPS Tools Overview

Description

Network UPS Tools is a collection of programs which provide a common interface for monitoring and administering UPS, PDU and SCD hardware. It uses a layered approach to connect all of the parts.

Drivers are provided for a wide assortment of equipment. They understand the specific language of each device and map it back to a compatibility layer. This means both an expensive high end UPS, a simple "power strip" PDU, or any other power device can be handled transparently with a uniform management interface.

This information is cached by the network server upsd, which then answers queries from the clients. upsd contains a number of access control features to limit the abilities of the clients. Only authorized hosts may monitor or control your hardware if you wish. Since the notion of monitoring over the network is built into the software, you can hang many systems off one large UPS, and they will all shut down together. You can also use NUT to power on, off or cycle your data center nodes, individually or globally through PDU outlets.

Clients such as upsmon check on the status of the hardware and do things when necessary. The most important task is shutting down the operating system cleanly before the UPS runs out of power. Other programs are also provided to log information regularly, monitor status through your web browser, and more.

NUT and the ecosystem

NUT comes pre-packaged for many operating systems and embedded in storage, automation or virtualization appliances, and is also often shipped as the software companion by several UPS vendors. Of course, it is quite normal and supported to build your own — whether for an operating system which lacks it yet, or for an older distribution which lacks the current NUT version; whether to take advantage of new features or to troubleshoot a new UPS deployment with a debugger in hand.

Given its core position at the heart of your systems' lifecycle, we make it a point to have current NUT building and running anywhere, especially where older releases did work before (including "abandonware" like the servers and OSes from the turn of millennium): if those boxes are still alive and in need of power protection, they should be able to get it.

Tip

If you like how the NUT project helps protect your systems from power outages, please consider sponsoring or at least "starring" it on GitHub at https://github.com/networkupstools/nut/ - these stars are among metrics which the larger potential sponsors consider when choosing how to help FOSS projects. Keeping the lights shining in such a large non-regression build matrix is a big undertaking!

As a FOSS project, for over a quarter of a century we welcome contributions of both core code (drivers and other features), build recipes and other integration elements to make it work on your favourite system, documentation revisions to make it more accessible to newcomers, as well as hardware vendor cooperation with first-hand driver and protocol submissions, and just about anything else you can think of.

Installing

If you are installing these programs for the first time, go read the installation instructions to find out how to do that. This document contains more information on what all of this stuff does.

Upgrading

When upgrading from an older version, always check the upgrading notes to see what may have changed. Compatibility issues and other changes will be listed there to ease the process.

Configuring and using

Once NUT is installed, refer to the configuration notes for directions.

Documentation

This is just an overview of the software. You should read the man pages, included example configuration files, and auxiliary documentation for the parts that you intend to use.

Network Information

These programs are designed to share information over the network. In the examples below, localhost is used as the hostname. This can also be an IP address or a fully qualified domain name. You can specify a port number if your upsd process runs on another port.

In the case of the program upsc, to view the variables on the UPS called sparky on the upsd server running on the local machine, you’d do this:

/usr/local/ups/bin/upsc sparky@localhost

The default port number is 3493. You can change this with "configure --with-port" at compile-time. To make a client talk to upsd on a specific port, add it after the hostname with a colon, like this:

/usr/local/ups/bin/upsc sparky@localhost:1234

This is handy when you have a mixed environment and some of the systems are on different ports.

The general form for UPS identifiers is this:

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

Keep this in mind when viewing the examples below.

Manifest

This package is broken down into several categories:

  • drivers - These programs talk directly to your UPS hardware.

  • server - upsd serves data from the drivers to the network.

  • clients - They talk to upsd and do things with the status data.

  • cgi-bin - Special class of clients that you can use with your web server.

  • scripts - Contains various scripts, like the Perl and Python binding, integration bits and applications.

Drivers

These programs provide support for specific UPS models. They understand the protocols and port specifications which define status information and convert it to a form that upsd can understand.

To configure drivers, edit ups.conf. For this example, we’ll have a UPS called "sparky" that uses the apcsmart driver and is connected to /dev/ttyS1. That’s the second serial port on most Linux-based systems. The entry in ups.conf looks like this:

[sparky]
	driver = apcsmart
	port = /dev/ttyS1

To start and stop drivers, use upsdrvctl of upsdrvsvcctl (installed on operating systems with a service management framework supported by NUT). By default, it will start or stop every UPS in the config file:

/usr/local/ups/sbin/upsdrvctl start
/usr/local/ups/sbin/upsdrvctl stop

However, you can also just start or stop one by adding its name:

/usr/local/ups/sbin/upsdrvctl start sparky
/usr/local/ups/sbin/upsdrvctl stop sparky

On operating systems with a supported service management framework, you might wrap your NUT drivers into individual services instances with:

/usr/local/ups/sbin/upsdrvsvcctl resync

and then manage those service instances with commands like:

/usr/local/ups/sbin/upsdrvsvcctl start sparky
/usr/local/ups/sbin/upsdrvsvcctl stop sparky

To find the driver name for your device, refer to the section below called "HARDWARE SUPPORT TABLE".

Extra Settings

Some drivers may require additional settings to properly communicate with your hardware. If it doesn’t detect your UPS by default, check the driver’s man page or help (-h) to see which options are available.

For example, the usbhid-ups driver allows you to use USB serial numbers to distinguish between units via the "serial" configuration option. To use this feature, just add another line to your ups.conf section for that UPS:

[sparky]
	driver = usbhid-ups
	port = auto
	serial = 1234567890

Hardware Compatibility List

The Hardware Compatibility List is available in the source directory (nut-X.Y.Z/data/driver.list), and is generally distributed with packages. For example, it is available on Debian systems as:

/usr/share/nut/driver.list

This table is also available online.

If your driver has vanished, see the FAQ and Upgrading notes.

Generic Device Drivers

NUT provides several generic drivers that support a variety of very similar models.

  • The genericups driver supports many serial models that use the same basic principle to communicate with the computer. This is known as "contact closure", and basically involves raising or lowering signals to indicate power status.

    This type of UPS tends to be cheaper, and only provides the very simplest data about power and battery status. Advanced features like battery charge readings and such require a "smart" UPS and a driver which supports it.

    See the genericups(8) man page for more information.

  • The usbhid-ups driver attempts to communicate with USB HID Power Device Class (PDC) UPSes. These units generally implement the same basic protocol, with minor variations in the exact set of supported attributes. This driver also applies several correction factors when the UPS firmware reports values with incorrect scale factors.

    See the usbhid-ups(8) man page for more information.

  • The nutdrv_qx driver supports the Megatec / Q1 protocol that is used in many brands (Blazer, Energy Sistem, Fenton Technologies, Mustek, Voltronic Power and many others).

    See the nutdrv_qx(8) man page for more information.

  • The snmp-ups driver handles various SNMP enabled devices, from many different manufacturers. In SNMP terms, snmp-ups is a manager, that monitors SNMP agents.

    See the snmp-ups(8) man page for more information.

  • The powerman-pdu is a bridge to the PowerMan daemon, thus handling all PowerMan supported devices. The PowerMan project supports several serial and networked PDU, along with Blade and IPMI enabled servers.

    See the powerman-pdu(8) man page for more information.

  • The apcupsd-ups driver is a bridge to the Apcupsd daemon, thus handling all Apcupsd supported devices. The Apcupsd project supports many serial, USB and networked APC UPS.

    See the apcupsd-ups(8) man page for more information.

UPS Shutdowns

upsdrvctl can also shut down (power down) all of your UPS hardware.

Warning
if you play around with this command, expect your filesystems to die. Don’t power off your computers unless they’re ready for it:
/usr/local/ups/sbin/upsdrvctl shutdown
/usr/local/ups/sbin/upsdrvctl shutdown sparky

You should read the Configuring automatic UPS shutdowns chapter to learn more about when to use this feature. If called at the wrong time, you may cause data loss by turning off a system with a filesystem mounted read-write.

Power distribution unit management

NUT also provides an advanced support for power distribution units.

You should read the NUT outlets management and PDU notes chapter to learn more about when to use this feature.

Network Server

upsd is responsible for passing data from the drivers to the client programs via the network. It should be run immediately after upsdrvctl in your system’s startup scripts.

upsd should be kept running whenever possible, as it is the only source of status information for the monitoring clients like upsmon.

Monitoring client

upsmon provides the essential feature that you expect to find in UPS monitoring software: safe shutdowns when the power fails.

In the layered scheme of NUT software, it is a client. It has this separate section in the documentation since it is so important.

You configure it by telling it about UPSes that you want to monitor in upsmon.conf. Each UPS can be defined as one of two possible types: a "primary" or "secondary".

Primary

The monitored UPS possibly supplies power to this system running upsmon, but more importantly — this system can manage the UPS (typically, this instance of upsmon runs on the same system as the upsd and driver(s)): it is capable and responsible for shutting it down when the battery is depleted (or in another approach, lingering to deplete it or to tell the UPS to reboot its load after too much time has elapsed and this system is still alive — meaning wall power returned at a "wrong" moment).

The shutdown of this (primary) system itself, as well as eventually an UPS shutdown, occurs after any secondary systems ordered to shut down first have disconnected, or a critical urgency threshold was passed.

If your UPS is plugged directly into a system’s serial or USB port, the upsmon process on that system should define its relation to that UPS as a primary. It may be more complicated for higher-end UPSes with a shared network management capability (typically via SNMP) or several serial/USB ports that can be used simultaneously, and depends on what vendors and drivers implement. Setups with several competing primaries (for redundancy) are technically possible, if each one runs its own full stack of NUT, but results can be random (currently NUT does not provide a way to coordinate several entities managing the same device).

For a typical home user, there’s one computer connected to one UPS. That means you would run on the same computer the whole NUT stack — a suitable driver, upsd, and upsmon in primary mode.

Secondary

The monitored UPS may supply power to the system running upsmon (or alternatively, it may be a monitoring station with zero PSUs fed by that UPS), but more importantly, this system can’t manage the UPS — e.g. shut it down directly (through a locally running NUT driver).

Use this mode when you run multiple computers on the same UPS. Obviously, only one can be connected to the serial or USB port on a typical UPS, and that system is the primary. Everything else is a secondary.

For a typical home user, there’s one computer connected to one UPS. That means you run a driver, upsd, and upsmon in primary mode.

Additional Information

More information on configuring upsmon can be found in these places:

Clients

Clients talk to upsd over the network and do useful things with the data from the drivers. There are tools for command line access, and a few special clients which can be run through your web server as CGI programs.

For more details on specific programs, refer to their man pages.

upsc

upsc is a simple client that will display the values of variables known to upsd and your UPS drivers. It will list every variable by default, or just one if you specify an additional argument. This can be useful in shell scripts for monitoring something without writing your own network code.

upsc is a quick way to find out if your driver(s) and upsd are working together properly. Just run upsc <ups> to see what’s going on, i.e.:

morbo:~$ upsc sparky@localhost
ambient.humidity: 035.6
ambient.humidity.alarm.maximum: NO,NO
ambient.humidity.alarm.minimum: NO,NO
ambient.temperature: 25.14
...

If you are interested in writing a simple client that monitors upsd, the source code for upsc is a good way to learn about using the upsclient functions.

See the upsc(8) man page and NUT command and variable naming scheme for more information.

upslog

upslog will write status information from upsd to a file at set intervals. You can use this to generate graphs or reports with other programs such as gnuplot.

upsrw

upsrw allows you to display and change the read/write variables in your UPS hardware. Not all devices or drivers implement this, so this may not have any effect on your system.

A driver that supports read/write variables will give results like this:

$ upsrw sparky@localhost
( many skipped )
[ups.test.interval]
Interval between self tests
Type: ENUM
Option: "1209600"
Option: "604800" SELECTED
Option: "0"
( more skipped )

On the other hand, one that doesn’t support them won’t print anything:

$ upsrw fenton@gearbox
( nothing )

upsrw requires administrator powers to change settings in the hardware. Refer to upsd.users(5) for information on defining users in upsd.

upscmd

Some UPS hardware and drivers support the notion of an instant command - a feature such as starting a battery test, or powering off the load. You can use upscmd to list or invoke instant commands if your hardware/drivers support them.

Use the -l command to list them, like this:

$ upscmd -l sparky@localhost
Instant commands supported on UPS [sparky@localhost]:
load.on - Turn on the load immediately
test.panel.start - Start testing the UPS panel
calibrate.start - Start run time calibration
calibrate.stop - Stop run time calibration
...

upscmd requires administrator powers to start instant commands. To define users and passwords in upsd, see upsd.users(5).

CGI Programs

The CGI programs are clients that run through your web server. They allow you to see UPS status and perform certain administrative commands from any web browser. Javascript and cookies are not required.

These programs are not installed or compiled by default. To compile and install them, first run configure --with-cgi, then do make and make install. If you receive errors about "gd" during configure, go get it and install it before continuing.

You can get the source here:

In the event that you need libpng or zlib in order to compile gd, they can be found at these URLs:

Access Restrictions

The CGI programs use hosts.conf to see if they are allowed to talk to a host. This keeps malicious visitors from creating queries from your web server to random hosts on the Internet.

If you get error messages that say "Access to that host is not authorized", you’re probably missing an entry in your hosts.conf.

upsstats

upsstats generates web pages from HTML templates, and plugs in status information in the right places. It looks like a distant relative of APC’s old Powerchute interface. You can use it to monitor several systems or just focus on one.

It also can generate IMG references to upsimage.

upsimage

This is usually called by upsstats via IMG SRC tags to draw either the utility or outgoing voltage, battery charge percent, or load percent.

upsset

upsset provides several useful administration functions through a web interface. You can use upsset to kick off instant commands on your UPS hardware like running a battery test. You can also use it to change variables in your UPS that accept user-specified values.

Essentially, upsset provides the functions of upsrw and upscmd, but with a happy pointy-clicky interface.

upsset will not run until you convince it that you have secured your system. You must secure your CGI path so that random interlopers can’t run this program remotely. See the upsset.conf file. Once you have secured the directory, you can enable this program in that configuration file. It is not active by default.

Version Numbering

The version numbers work like this: if the middle number is odd, it’s a development tree, otherwise it is the stable tree.

The past stable trees were 1.0, 1.2, 1.4, 2.0, 2.2 and 2.4, with the latest such stable tree designated 2.6. The development trees were 1.1, 1.3, 1.5, 2.1 and 2.3. Since the 2.4 release, there is no real separate development branch anymore since the code is available through a revision control system (namely, Git — or actually Subversion back then) and its snapshots become published releases.

Since 2.7 line of releases, sources are tracked in Git revision control system, with the project ecosystem being hosted on GitHub, and any code improvements or other contributions merged through common pull request approach and custom NUT CI testing on multiple platforms.

Major release jumps are mostly due to large changes to the features list. There have also been a number of architectural changes which may not be noticeable to most users, but which can impact developers.

Backwards and Forwards Compatibility

The network protocol for the current version of NUT should be backwards-compatible all the way back to version 1.4. A newer client should fail gracefully when querying an older server.

If you need more details about cross-compatibility of older NUT releases (1.x vs. 2.x), please see the Project history chapter.

Support / Help / etc.

If you are in need of help, refer to the Support instructions in the user manual.

Hacking / Development Info

Additional documentation can be found in:

Acknowledgements / Contributions

The many people who have participated in creating and improving NUT are listed in the user manual acknowledgements appendix.

We would like to highlight some organizations which provide continuous support to the NUT project (and many other FOSS projects) on technological and organizational sides, such as helping keep the donations transparent, NUT CI farm afloat, and public resources visible. Thanks for keeping the clocks ticking, day and night:

GitHub logo

The "NetworkUPSTools" organization on GitHub arranges a lot of things, including source code hosting for NUT itself and several related projects, team management, projects, issue and pull request discussions, sponsorship, nut-website rendering and hosting, some automated actions, and more…​

Jenkins and NUT logo

The Jenkins CI project and its huge plugin ecosystem provides the technological foundation for the largest island of the self-hosted NUT CI farm. There is a fair amount of cross-pollination between the upstream project and community, and the development done originally for the NUT CI farm.

See more at Jenkins is the way to build multi-platform NUT article.

Fosshost logo

Fosshost provided virtual machines where the multi-platform NUT CI farm with a jenkins-dynamatrix setup runs to arrange builds in numerous operating environments and a lot of toolkit versions and implementations. Some workers running on NUT community members' machines can also dial in to provide an example of their favourite platforms. Literally hundreds of NUT builds run for each iteration, to make sure NUT can always build and work everywhere.

This allows us to ensure that NUT remains portable across two decades' worth of operating systems, compilers, script interpreters, tools and third-party dependencies.

CircleCI logo

The CircleCI NUT pipeline allows us to test NUT CI builds on MacOS.

AppVeyor logo

The AppVeyor NUT pipeline allows us to test NUT CI builds on Windows (and publish preview tarballs with binaries).

DigitalOcean logo

The DigitalOcean droplets allow us to host NUT CI farm Jenkins controller and the build agents for multiple operating systems.

Gandi.Net logo

Gandi.Net took up the costs of NUT DNS hosting.

Open Collective logo

https://opencollective.com/networkupstools allows us to arrange monetary donations and spending, with public transparency of everything that happens.

nut's People

Contributors

alfh avatar aquette avatar arjendekorte avatar arnaudquette-eaton avatar askazancev avatar biergaizi avatar bigon avatar bohe-eaton avatar carlosefr avatar clepple avatar desertwitch avatar dtsecon avatar echterago avatar efuss avatar emilienkia avatar emilienkia-eaton avatar ericclappier-eaton avatar gdt avatar jimklimov avatar mhlavink avatar modrisb avatar msoltyspl avatar mtenberge avatar nbriggs avatar nielsb avatar overhacked avatar selinger avatar tdy91 avatar zeezooz avatar zykh avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

nut's Issues

apcupsd-ups driver toggles between stale and not stale when apcupsd is unreachable

While the target apcupsd host is down, there are spurious stale/not-stale messages in syslog:

09:10:21 hostname apcupsd-ups[94147]: can't communicate with apcupsd!
09:10:21 hostname upsd[94149]: UPS [apcupsd] data is no longer stale
09:10:37 hostname upsd[94149]: Data for UPS [apcupsd] is stale - check driver

Verbose is good, but in this case, we should probably make sure the staleness is being handled properly in other cases, and when the host comes back up.

[HCL] MicroDowell B.Box LP 500 supported by genericups

Manufacturer: MicroDowell
Model: B.Box LP 500

ups.conf

[microdowell]
        driver = genericups
        port = /dev/ttyS0
        upstype = 7

upsc

$ upsc microdowell
device.mfr: CyberPower
device.model: Power99
device.type: ups
driver.name: genericups
driver.parameter.pollinterval: 2
driver.parameter.port: /dev/ttyS0
driver.parameter.upstype: 7
driver.version: 2.6.3
driver.version.internal: 1.36
ups.mfr: CyberPower
ups.model: Power99
ups.status: OL

OL, OB and LB is working with upstype 7 [CP=RTS] [OL=CTS] [LB=-DCD].

UPS shutdown with upstype 7 [SD=DTR]

$ sudo upsdrvctl shutdown microdowell
Network UPS Tools - UPS driver controller 2.6.3
Network UPS Tools - Generic contact-closure UPS driver 1.36 (2.6.3)
UPS type: CyberPower Power99

Initiating UPS shutdown

UPS shutdown only works when on-battery and has a delay of about 1min until execution (something between 50sec to 1min 30sec on mine).

References:
http://www.ezdirect.it/pdf/lp500.pdf
https://forums.gentoo.org/viewtopic-t-730172-start-0.html

Edit:
I forgot to mention that I also tried the windows software UPSEye from MicroDowell, it also can't do more than displaying the UPS state without detail information. Therefore it seems that genericups is the best protocol the UPS supports. Moreover the datasheet mentions "RS232 Simple Contacts interfaces".

Consolidate bool_t definitions into a common header file

Several drivers have some boilerplate code that implements a boolean type through an enum or an int. Some, such as the one in mge-utalk.h, are slightly different from the rest. This should be moved to a common header file.

USB integration on FreeBSD

(Theoretically, this applies to NetBSD and OpenBSD as well, but FreeBSD's USB stack seems more complete at the moment.)

Some code: https://github.com/clepple/nut/tree/devd-usb

Things to do:

  • Generate devd.conf files for known USB devices
  • Install devd.conf files in the right place (includes detection of *BSD)
  • Document the installation process (restarting devd, other permissions issues like scanning the bus, etc.)
  • Coordinate with ports maintainer

al175

Hello up there, NUT people.

Here is AL175 driver patch, updated again, based on feedback from 2009:

http://lists.alioth.debian.org/pipermail/nut-upsdev/2008-December/003641.html
http://lists.alioth.debian.org/pipermail/nut-upsdev/2008-December/003644.html
http://lists.alioth.debian.org/pipermail/nut-upsdev/2009-January/003710.html
http://lists.alioth.debian.org/pipermail/nut-upsdev/2009-January/003778.html
http://lists.alioth.debian.org/pipermail/nut-upsdev/2009-January/003779.html
http://lists.alioth.debian.org/pipermail/nut-upsdev/2009-February/003791.html
http://lists.alioth.debian.org/pipermail/nut-upsdev/2009-February/003790.html

(lists.a.d.o is currently down, but the links should be ok)

I've tried to clean it up, but unfortunately no longer have hardware
to test and will not have any in foreseeable future, so the driver was reworked
to meet the project code quality criteria, without testing on real hardware.
Some bugs may have crept in.

The patches are here:

http://repo.or.cz/w/networkupstools/kirr.git/commitdiff/dd43abcf0292a99b93346522c364f417616b58df
http://repo.or.cz/w/networkupstools/kirr.git/commitdiff/f2ab786359179970d484b447738b1cecc8461e05

available for pull from repo.or.cz repository as

git pull git://repo.or.cz/networkupstools/kirr.git y/al175-2013

If you would ask me, there is no reason not to merge it - yes, the code could be seen as somewhat unusual, but was (when testing with hardware) functional and is structured and logic and flow could be traced. Several people already asked me about al175 driver on email, so I think rejecting the driver benefits noone.

Thanks beforehand,
Kirill

2.7.1 checklist

Checklist for the 2.7.1 interim release:

  • @clepple: update dowload info for git
  • update client info with walNUT
  • address issue #30 (NSS support broke upsc output)
  • address issue #15 (Avoid "2.6.x-Unversioned Directory" version numbers)
  • check branch bcmxcp and merge if ok
  • check branch voltronic-driver and merge if ok (but see #57)
  • #57: check branch blzr and merge if ok; possibly removing voltronic
  • add Tripp Lite information to drivers.list
  • check branch powercom-instant-commands and merge if ok
  • update news/upgrading files

Store NUT installation path in a Windows registry key

There is no registry key to point NUT installation path, as selected during installation.
The right and suitable key name is to be confirmed by a Windows guru, but something like the following should probably do it:
HKEY_LOCAL_MACHINE\SOFTWARE\Network UPS Tools\InstallationPath

NUT Dummy driver Gen3

dummycons (1rst generation) and dummy-ups (2nd generation) have well served various purposes, such as:

  • debug of the NUT framework,
  • client development
  • simulation for QA regression testing purpose (with static definitions and power sequences)

The work on dummy-ups also permitted the creation of the NUT Devices Dumps Library (http://www.networkupstools.org/devdumps/).

However, time has come for a 3rd generation to address the following, either in definition files (.dev / . seq) and / or the driver:

  • 1. Add versioning to current definition files (.dev / . seq)
  • 2. Specify v2 of definition files (.nut?), including the below
  • 2.1. Handle read/write flags for variables
  • 2.2. Handle instant commands
  • 2.3. Handle complementary information and user comments (need specific comment annotation)
  • 3. Create a new nutdrv-repeater driver from the "repetition" mode code
  • 4. Create a new driver nutdrv-simulation from the "dummy" mode code
  • 5. Create a tool to assist users in dumping all needed data in a smart and easy way
  1. and 2.* will also permit to improve the NUT Devices Dumps Library, by providing more information.

NSS support broke upsc output

Versions prior to NSS merge provided the following output:

nut-2.6.4$ ./clients/upsc -L
test: Description unavailable

Since the merge of NSS, we now have (here using the latest git master):

$ ./clients/upsc -L
upscli not initialized, force initialisation without SSL configuration
Init SSL without certificate database
Can not connect to localhost in SSL, continue uncrypted
test: Description unavailable

This should be fixed prior to the next release, since it breaks compatibility with, for example, scripts and tools using upsc output.

The issue lies in clients/upsclient.c, when tryssl (default) is set and SSL can't be enabled...

HCL: show legend even when JavaScript is disabled

While the selectors for the jQuery filters on the HCL do not need to be displayed if JavaScript is disabled, the key which shows the meaning of the colors should be enabled.

Similarly, we should check to see that this makes sense in something other than Mozilla-based or Webkit-based browsers.

Powerchain support

The idea behind the PowerChain is simple:
There are many links in a powerchain, that supplies power to a device (server, appliance, ...):

  • power supply unit,
  • UPS,
  • PDU.
  • STS (static transfer switch),
  • bypass module,
  • genset,
  • ...

Monitoring only UPS is not sufficient to guaranty a smart power protection.
Having a consolidated view on the whole also allows real HA, Green Grid and SmartGrid features.

ServerOneiricInfraPower-exampleRack png

An example PowerChain for the CLC would be:

PSU1 ==> PDU1:outlet1 ==> UPS1 ==> Main Power
PSU2 ==> PDU2:outlet1 ==> UPS2 ==> Main Power

Other details:

Tasks list:

  • Create a new power supply unit (PSU) driver,

  • Create a new NUT data, 'device.parent', defined in ups.conf and exposed by all NUT drivers.
    This will store the parent reference in NUT canonical form:

    device[:outlet][@hostname[:port]]

    Example:
    ups.conf
    [psu1]
    driver = nut-psu
    port = psu1
    parent = pdu1:outlet1@localhost
    [pdu1]
    driver = snmp-ups
    port =
    parent = ups1@localhost
    [ups1]
    driver = usbhid-ups
    port = auto
    parent = main

    $ upsc psu1 device.parent
    pdu1:outlet1@localhost

  • Implement power-chain support in upsc ('-P' option to get a tree list, when using '-l' and '-L')
    Note: only the first version, with coma separators.

    $ upsc -P localhost
    psu1 -> pdu1:outlet1 -> ups1

    $ upsc -Pl localhost
    ups1
    |-> pdu1:outlet1
    |-> pdu1

  • Implement a *tree store for upsd, to fix the lack of the current one (powerchain_t, in server/powerchain.ch

  • Implement power-chain support in upsmon

POWERDOWNFLAG path changed to @CONFPATH@/killpower

Hi,

With the new 2.7.1 version, the POWERDOWNFLAG path has changed from /etc/killpower to @CONFPATH@/killpower

This means that the new default path is /etc/nut/killpower on most of the distributions.

I'm wondering if this shouldn't be reverted to /etc/killpower

usbhid-ups: trailing spaces in nut-scanner output not ignored when trying to find ups

Hi,
I discovered an issue when trying to configure an APC Back-UPS ES 700G.

As I assume from the documentation nut-scanner -qNU should create a usable configuration entry which can be directly copied into ups.conf.

When running the above command I get:

[nutdev1]
        driver = "usbhid-ups"
        port = "auto"
        vendorid = "051D"
        productid = "0002"
        product = "Back-UPS ES 700G FW:871.O2 .I USB FW:O2 "
        serial = "5B1243T01934  "
        vendor = "APC"
        bus = "002"

For a first quick test I used:
usbhid-ups -DD -u root -a nutdev1
------------%<----------------------------------------------------------------------------------------

Network UPS Tools - Generic HID driver 0.37 (2.6.5)
USB communication driver 0.32
   0.000000     debug level is '2'
   0.001513     upsdrv_initups...
   0.083102     Checking device (8087/0024) (001/002)
   0.083195     - VendorID: 8087
   0.083211     - ProductID: 0024
   0.083225     - Manufacturer: unknown
   0.083239     - Product: unknown
   0.083253     - Serial Number: unknown
   0.083267     - Bus: 001
   0.083281     Trying to match device
   0.083306     Device does not match - skipping
   0.083347     Checking device (1D6B/0002) (001/001)
   0.084525     - VendorID: 1d6b
   0.084542     - ProductID: 0002
   0.084556     - Manufacturer: Linux 3.4.41-dist ehci_hcd
   0.084570     - Product: EHCI Host Controller
   0.084584     - Serial Number: 0000:00:1a.0
   0.084598     - Bus: 001
   0.084612     Trying to match device
   0.084627     Device does not match - skipping
   0.084666     Checking device (8087/0024) (002/002)
   0.084740     - VendorID: 8087
   0.084755     - ProductID: 0024
   0.084769     - Manufacturer: unknown
   0.084783     - Product: unknown
   0.084797     - Serial Number: unknown
   0.084811     - Bus: 002
   0.084824     Trying to match device
   0.084839     Device does not match - skipping
   0.084877     Checking device (1D6B/0002) (002/001)
   0.086036     - VendorID: 1d6b
   0.086052     - ProductID: 0002
   0.086066     - Manufacturer: Linux 3.4.41-dist ehci_hcd
   0.086080     - Product: EHCI Host Controller
   0.086094     - Serial Number: 0000:00:1d.0
   0.086108     - Bus: 002
   0.086122     Trying to match device
   0.086137     Device does not match - skipping
   0.086175     Checking device (051D/0002) (002/004)
   0.117261     - VendorID: 051d
   0.117312     - ProductID: 0002
   0.117365     - Manufacturer: APC
   0.117411     - Product: Back-UPS ES 700G FW:871.O2 .I USB FW:O2 
   0.117452     - Serial Number: 5B1243T01934  
   0.117482     - Bus: 002
   0.117529     Trying to match device
   0.117660     Device does not match - skipping
   0.117743     No appropriate HID device found
   0.117799     No matching HID UPS found

------------%<----------------------------------------------------------------------------------------

So strangely nut-scanner is detecting the UPS but the driver is not detecting it.

First I tried to cherry-pick some fixes from the git master, applying them when building from the latest release source tarball (2.6.5).

  • 3a89af5 - [nut-scanner] Fix a crash when no start IP is provided.

  • 9758dcf - Set USB timeout to 5 seconds

but both patches didn't changed the behavior.

After that I simply tried to uncomment entries from the generated configuration and found out that when uncommenting the product and serial entry, the driver is able to detect the UPS. Same applies when only removing the trailing spaces from product and serial entry.

usbhid-ups -DD -u root -a nutdev1
------------%<----------------------------------------------------------------------------------------

Network UPS Tools - Generic HID driver 0.37 (2.6.5)
USB communication driver 0.32
   0.000000     debug level is '2'
   0.001530     upsdrv_initups...
   0.083640     Checking device (8087/0024) (001/002)
   0.083731     - VendorID: 8087
   0.083746     - ProductID: 0024
   0.083761     - Manufacturer: unknown
   0.083775     - Product: unknown
   0.083789     - Serial Number: unknown
   0.083803     - Bus: 001
   0.083817     Trying to match device
   0.083842     Device does not match - skipping
   0.083884     Checking device (1D6B/0002) (001/001)
   0.085067     - VendorID: 1d6b
   0.085083     - ProductID: 0002
   0.085098     - Manufacturer: Linux 3.4.41-dist ehci_hcd
   0.085112     - Product: EHCI Host Controller
   0.085126     - Serial Number: 0000:00:1a.0
   0.085140     - Bus: 001
   0.085154     Trying to match device
   0.085168     Device does not match - skipping
   0.085207     Checking device (8087/0024) (002/002)
   0.085282     - VendorID: 8087
   0.085297     - ProductID: 0024
   0.085312     - Manufacturer: unknown
   0.085326     - Product: unknown
   0.085339     - Serial Number: unknown
   0.085353     - Bus: 002
   0.085368     Trying to match device
   0.085382     Device does not match - skipping
   0.085420     Checking device (1D6B/0002) (002/001)
   0.086586     - VendorID: 1d6b
   0.086602     - ProductID: 0002
   0.086616     - Manufacturer: Linux 3.4.41-dist ehci_hcd
   0.086630     - Product: EHCI Host Controller
   0.086644     - Serial Number: 0000:00:1d.0
   0.086658     - Bus: 002
   0.086672     Trying to match device
   0.086687     Device does not match - skipping
   0.086725     Checking device (051D/0002) (002/004)
   0.118688     - VendorID: 051d
   0.118711     - ProductID: 0002
   0.118726     - Manufacturer: APC
   0.118740     - Product: Back-UPS ES 700G FW:871.O2 .I USB FW:O2 
   0.118754     - Serial Number: 5B1243T01934  
   0.118768     - Bus: 002
   0.118782     Trying to match device
   0.118887     Device matches
   0.125217     HID descriptor length 929
   0.272566     Report Descriptor size = 929
   0.272777     Using subdriver: APC HID 0.95

------------%<----------------------------------------------------------------------------------------

As we can see the UPS is detected when removing the trailing spaces from the affected config entries.

Refresh FAQ

FAQ needs an overall refresh.
Some important topics may still be missing (see commit eb1f01e) or not enough visible, others may not be applicable anymore, ...

SNMP driver Gen3

  • in usbhid-ups spirit (2nd generation of meta driver, with sub-drivers)
  • support external MIB2NUT files (externalize all mib2nut?)
    Already available through the DMF
  • support SNMP traps ("events notification")
    • how to handle traps for multiple drivers?
    • ==> nutdrv-trap{d,handler,dispatcher,whatever_name} is a driver that receives traps and dispatches it over the nutdrv-snmp driver(s) instance(s), using ups.conf->port field as a key. The main issue here is that this driver needs to be started (not forcibly declared) somewhere. nutdrv-controller could do the job, with a specific hook
    • ==> nutd could do the job of starting. but that would not be clean!

Add apcupsd support to nut-scanner

With the apcupsd-ups driver merged into master, it would be handy to be able to scan for existing apcupsd NIS servers.

Basic detection would be an open TCP port 3551.

jNUT split

Split jNUT source code and distribution from the mainline.
Create a new repository on github, dedicated to jNUT.

IPMI support completion

A few things are still missing, to complete IPMI support:

Lower priority:

  • better NUT IPMI back-ends interface (create a NUT IPMI API)
  • Allow runtime selection (beside compile time) of the IPMI backend used
  • 2nd IPMI back-end implementation, beside of FreeIPMI (ipmiutil or ipmitool)
  • Rename to nutdrv-ipmipsu (or simply nutdrv-ipmi?)

Note on ipmiutil:
It provides transparent IPMI command-level access for in-band and out-of-band.
Using the ipmi_sample.c in the devel package does support FRU, SDR, etc., so that shows how this is used, and could be compiled as a library as well. And there is an ipmi_sample_evt.c for handling events.
Andy Cress also proposed some help and is interested in feedback.

Note on ipmitool:
Used at least on Opengear systems.

Eaton Evolution UPS communication problem

I've upgraded from 2.6.4 to 2.7.1 and in the upgrade on some servers I lost connectivity to the Evolution UPS serial port. I tracked this down to the patch 65db105, reverting it made things work again.

nut-scanner Gen2

2nd generation of lbnutscanner and nut-scanner:

  • plugin design:
    • each "bus" is provided through a specific library (aka "plugin"),
    • each plugin provides everything: help, init, scan, cleanup/close,
    • plugins using weak dependencies through dl_* functions (no hard link)
    • ip address iterator is also perfectible
  • libnutscanner provides .so listing and loading (to wrap available and usable plugins)
  • nut-scanner is almost empty shell

This will solve the #ifdef issue, and make nut scan library and tool more maintainable and usable!

NUT Controller (nutctld)

A daemon to control NUT features locally or remotely:

  • scan,
  • configuration,
  • daemons start / stop / restart / reload.

Use cases:

  • mass configuration (including initial configuration) of a network of NUT systems,
  • automated initial configuration of system with USB devices.

@balooloo: to be completed

Non-standard USB_TIMEOUT in libusb.c is causing problems with Eaton 5PX UPS, usbhid-ups won't start

Hello,

I reported a problem with the USB driver and an Eaton 5PX UPS. usbhid-ups failed to start, because it timeouts while receiving the descriptor. The USB_TIMEOUT constant in libusb.c is set to 4 seconds, instead of the standard 5 seconds.

Here is the original thread: http://www.mail-archive.com/[email protected]/msg07676.html

Here is the constant I'm talking about: https://github.com/networkupstools/nut/blob/master/drivers/libusb.c#L38

libupsclient should link against libcommon

When building nut 2.7.1 on debian, I get the following warnings:

dpkg-shlibdeps: warning: symbol upsdebugx used by debian/libupsclient3/lib/x86_64-linux-gnu/libupsclient.so.3.0.1 found in none of the libraries
dpkg-shlibdeps: warning: symbol upslogx used by debian/libupsclient3/lib/x86_64-linux-gnu/libupsclient.so.3.0.1 found in none of the libraries
dpkg-shlibdeps: warning: symbol xmalloc used by debian/libupsclient3/lib/x86_64-linux-gnu/libupsclient.so.3.0.1 found in none of the libraries
dpkg-shlibdeps: warning: symbol xstrdup used by debian/libupsclient3/lib/x86_64-linux-gnu/libupsclient.so.3.0.1 found in none of the libraries

I guess that libupsclient should link against libcommon

Devices Dumps Library improvements

NUT Devices Dumps Library (http://networkupstools.org/ddl/) needs some more actions before being complete:

Postponed items

  • Complete task #94 (NUT Dummy driver Gen3)
  • Call to users for massive report (who?) => or make it easier to submit DDL report.
    Part of this was started to be addressed with ca9f601

blazer / Megatec/Q1 / Qx driver Gen4

Create the 4th generation driver to address all older Q1 and newer Q5 / QFS protocol variations.

The general idea is to have something between the current blazer* and usbhid-ups like claiming and data mapping structure.

A special care must be taken to old dumb things:
current parameters have to be kept, and a "force q1" should probably be added.

informal code review of the libconf branch

Some of the warnings on the clang builders prompted me to take a closer look at the libconf branch.

NutStream::status_t NutFile::putData(const std::string & data) has a comment that there is not a FILE* interface for writing arbitrary data. What about fwrite()?

tempnam() should probably be replaced with mkstemp(). Then you won't need the hard-coded /var/tmp variable. (Some systems implement per-user $TMPDIR variables, which eliminate some corner cases and race conditions.)

This expression won't do bit operations: ss << (packed && 0x000000ff) << ".";

Also, you should consider using the standard inet_?to? functions here, especially for the IPv6 address printer.

QA regression test (QRT) suite integration

Integrate the QRT work done for Ubuntu in NUT mainline.
Quoting docs/nut-qa.txt:

a runtime testing suite, which automates the inter layer communication testing
(driver - upsd - upsmon / clients), that is part of Ubuntu.
The NUT testing script is available in the Ubuntu QA Regression Testing suite:

It installs nut, configure with for the dummy-ups driver, changes a few data and
check that these are well propagated with upsc.

This probably involves testlib.py, but should be limited if it goes beyond!

NOTE: it's a good time to reconsider QRT as a whole!
Other framework may now be more suitable to test our broader scope (OS at least)

Also hook it to the "check" target, for buildbot use.

USB integration on Solaris

USB support on Solaris exists for years.
But it has never been fully completed.

Some information:

Things to do:

  • Generate a script that executes add_drv/update_drv/rem_drv (step 4-c of the above gist) for known USB devices (used for Solaris package postint/prerm)
  • Integrate the script (and other actions) in Solaris package
  • Integrate the remaining documentation info, if any

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.