-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
UPS support #488
Comments
Development test bed:
|
Well, no, PyNUT isn't available via pip. It only appears to be shipped with each release of NUT. That said, it's available as a separately installable package via at least Debian-derived distros ("python-nut"). I have several non-APC units, so apcupsd wouldn't get me glances support; I'm not sure if the first link is meant to imply adding support via apcupsd. |
Could be implemented through an AMP ==> http://glances.readthedocs.io/en/stable/aoa/amps.html |
@nicolargo , there's nothing in the documentation to indicate that an AMP can be used to evaluate command output. I'm also not seeing a way to discard stderr.
—becomes this—
—in the current best case, with the label malformed, useless stderr output included, and no obvious processing of the value (9%). I don't see a way to trigger a warning or error in Glances if the value is, for example, 75% or 90%. There's no intelligent formatting of the output, and no way to define it, either. What I was really looking for was something like the output from lm_sensors that Glances already formats, displays attractively, and handles error reporting for. Since it's impossible to write some custom script to be executed by Glances that can take into account the display width and height and perform formatting and line-wrapping, it's also impossible to avoid wasting a huge amount of vertical and horizontal space. This information—
—could be displayed on as little as one line with some abbreviation and grouping. The only way to do that, however, would be if Glances actually parsed the output as variables, which it doesn't. (I tried sending some tabs and ANSI escape codes for color highlighting through AMP. The escapes were printed as literal characters and the tabs ended up uneven somehow. So it looks like Glances is in complete control of the display, and I can't customize it even the least bit by writing a wrapper to attempt to handle some of the parsing and formatting myself.) One item that occurred to me, involving saved space? Glances could use some global options to optionally hide or "collapse" output as long as it doesn't indicate a warning / error / critical state. Intelligent retrieval of NUT variables—again, completely possible through the Python bindings the NUT project provides—could transform a list of "healthy" UPS variables into a space-saving "UPS: GOOD", or even just a "UPS" section header in green, with no contents. Likewise, it would be great to be able to hide filesystems that aren't over a certain percentage used, sensors or a laptop battery that are within normal parameters, and so forth. The same could be done with the process listing, by providing the ability to hide processes that aren't performing storage I/O or network I/O, aren't utilizing more than a configurable range (1-5%?) of CPU time, and so forth. If this is something you'd consider, I'd be happy to split it into a separate issue. Thanks! |
Has there been any progress on this? |
In case anyone is interested in contributing, newer version of PyNUT: https://github.com/rshipp/python-nut2 |
Would it be possible to add support for basic UPS status--say batt level, temp, and offline / online status?
PyNUT appears to ship as part of the Network UPS Tools.
Thanks!
The text was updated successfully, but these errors were encountered: