Greg A. Woods
2012-Mar-08 23:21 UTC
[Nut-upsdev] some fixes, improvements, and new features (EPO and DYING) for NUT
Here are a series of my recent changes to NUT. The first few in the set are primarily little fixes and improvements. In among those are a few for .gitignore files which of course you can ignore for SVN, and there's one for a commit to a generated file which of course should not be tracked in any VCS. Then there are a couple or three to do with generating the header files used by nut-scanner. These probably could have been collapsed into one, but I left them separate to show more clearly what some of the problems are with the crazy attempts to use scripts to parse C code instead of using the compiler. The final one in that group is a half-assed attempt to generate one of the headers using a helper function directly from the compiled data structures it is derived from, and thus totally eliminating the need for the broken python script in the first place. Even this though is wrong -- the code needing the data structures from the driver should be linking directly with shared .o files to access it instead of re-inventing new data structures and trying to populate them from the existing data structures. The same thing should be done to eliminate the horrid perl script in there too. I then made some improvements to the SNMP driver to make it actually work properly with my AP9605 SNMP card, and which should make it work properly now with any SNMP agent implementing APC's POWERNET MIB. I also discovered the blazer driver does work pretty well with my GE Digital Energy GT Series UPS, at least with the 1000-3000 VA models. I added some more info about APC cables that I'd been keeping track of independently. I had independently made a similar change to the apcsmart driver to keep it from failing when tcgetattr() reported some irrelevant differences in the port settings. What's actually in the patch now is my merge of the change from upstream which is basically just an "improved" log message. I've also added some suggested coding improvements which I think will make things easier to maintain down the line, notably using clear syntax that's easy to modify safely for defining bit flag value macros, as well as a strong suggestion to NEVER EVER use comment syntax to comment out code blocks -- always use the pre-processor -- it's much safer! Finally I introduce the first of my new features: The "EPO" command. This is very similar to "FSD", but fundamentally different in that it goes a bit deeper into the infrastructure and it has a different purpose and ultimate affect on the systems being managed. The basic idea is to provide the moral equivalent, though not in quite such draconian and dangerous hard-core way, of an Emergency Power Off (big red) switch. The critical difference with FSD is that EPO is intended to require manual human intervention to recover from, and that it is also intended to completely and entirely remove power from everything if at all possible, even if mains power is still fully and smoothly functioning. I'm really not sure if "FSD" has a true purpose other than as a test command to see if everything will restart after mains power returns, since of course FSD tries to simulate the effect of mains power returning after a full shutdown has been committed to and is in progress. EPO on the other hand is a key requirement of my next feature: The ability of a UPS driver to declare that the UPS is dying of some critical condition and that it must be shut down in such a way that manual human intervention is required to restart it. EPO is also intended to be triggered automatically, whereas FSD (I think) is always intended to be manually introduced by a human systems manager. I.e. in an ideal configuration everything should restart and reboot and return to operational status after "upsmon -c fsd" once mains power returns or if power was never actually off; whereas with "upsmon -c epo" then everything should power down and stay off even if mains power remains on and steady. For example I would have used "FSD" to shut down in power blackouts where I knew the power could not return before the batteries ran low, and thus I would have conserved battery charge for the inevitable short hiccups that occur after a long blackout, but still been able to enjoy automatic restart after the blackout in case power returns while I'm sleeping, etc. Finally I add some features to the three drivers I was able to test which make use of this new "DYING" state to power things down safely but quickly when they detect operating temperatures above a configurable maximum value. The one driver that already supported use of the ALARM state also sets an alarm when the temperature rises above a configurable warning value. The idea here is that if the HVAC fails in your computer room then you can have everything automatically shut down _AND_ stop pouring BTUs out into the room, and of course hopefully first raise an alarm so that a human can try to intervene before an emergency power off is actually necessary to prevent equipment damage. Indeed the motivation behind these new features is because HVAC fails far more frequently in my client's server room, and with far more dire consequences, than the power fails. Indeed they have only one tiny UPS that can run only the most critical core equipment, but everything has come near to suffering serious physical damage when ambient temperatures have shot up above 45C in an extremely short time after HVAC failure, which of course is usually on a Saturday night. These changes are a work in progress to some extent -- I still have not fully tested the EPO of a running network, but I hope to do that very soon. The drivers do report alarms (where implemented) and they report the "DYING" status when their temperature sensors report above-maximum values.
Greg A. Woods
2012-Mar-08 23:21 UTC
[Nut-upsdev] [PATCH 01/36] fix a configure error message: asciidoc might actually be installed but documentation might still not be build-able (earlier messages should hint at exactly what was missing).
From: "Greg A. Woods" <woods at planix.com> --- configure.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.in b/configure.in index f906a30..aebfc55 100644 --- a/configure.in +++ b/configure.in @@ -594,7 +594,7 @@ no) if test -z "${DOC_NOBUILD_LIST}"; then nut_with_doc="yes" else - AC_MSG_ERROR(["Asciidoc is required for documentation support and missing"]) + AC_MSG_ERROR(["Unable to build ${DOC_NOBUILD_LIST} documentation"]) fi ;; esac -- 1.7.9.2
Greg A. Woods
2012-Mar-08 23:21 UTC
[Nut-upsdev] [PATCH 06/36] This file should not be tracked!
From: "Greg A. Woods" <woods at planix.com> It seems to be regenerated automatically (and unconditionally) by ../tools/nut-usbinfo.pl. --- scripts/upower/95-upower-hid.rules | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/upower/95-upower-hid.rules b/scripts/upower/95-upower-hid.rules index dd9d899..c2af72c 100644 --- a/scripts/upower/95-upower-hid.rules +++ b/scripts/upower/95-upower-hid.rules @@ -18,7 +18,7 @@ ATTRS{idVendor}=="047c", ENV{UPOWER_VENDOR}="Dell" ATTRS{idVendor}=="050d", ENV{UPOWER_VENDOR}="Belkin" ATTRS{idVendor}=="051d", ENV{UPOWER_VENDOR}="APC" ATTRS{idVendor}=="0592", ENV{UPOWER_VENDOR}="Powerware" -ATTRS{idVendor}=="06da", ENV{UPOWER_VENDOR}="Phoenixtec" +ATTRS{idVendor}=="06da", ENV{UPOWER_VENDOR}="Phoenixtec Power Co., Ltd" ATTRS{idVendor}=="075d", ENV{UPOWER_VENDOR}="iDowell" ATTRS{idVendor}=="0764", ENV{UPOWER_VENDOR}="Cyber Power Systems" ATTRS{idVendor}=="09ae", ENV{UPOWER_VENDOR}="TrippLite" @@ -58,7 +58,7 @@ ATTRS{idVendor}=="051d", ATTRS{idProduct}=="0003", ENV{UPOWER_BATTERY_TYPE}="ups # Powerware ATTRS{idVendor}=="0592", ATTRS{idProduct}=="0004", ENV{UPOWER_BATTERY_TYPE}="ups" -# Phoenixtec +# Phoenixtec Power Co., Ltd ATTRS{idVendor}=="06da", ATTRS{idProduct}=="ffff", ENV{UPOWER_BATTERY_TYPE}="ups" # iDowell -- 1.7.9.2
Greg A. Woods
2012-Mar-08 23:21 UTC
[Nut-upsdev] [PATCH 07/36] Ignore a file generated by re-configuration.
From: "Greg A. Woods" <woods at planix.com> --- include/.gitignore | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/include/.gitignore b/include/.gitignore index da28148..0747a53 100644 --- a/include/.gitignore +++ b/include/.gitignore @@ -1,7 +1,8 @@ -/config.h -/config.h.in /Makefile /Makefile.in +/config.h +/config.h.in +/config.h.in~ /nut_version.h -/stamp-h1 /stamp-h.in +/stamp-h1 -- 1.7.9.2
Greg A. Woods
2012-Mar-08 23:21 UTC
[Nut-upsdev] [PATCH 13/36] use an example driver name matching the unified NUT drivers generic manual page name.
From: "Greg A. Woods" <woods at planix.com> --- docs/design.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/design.txt b/docs/design.txt index dfaeae8..4e39eca 100644 --- a/docs/design.txt +++ b/docs/design.txt @@ -128,7 +128,7 @@ This scenario requires some configuration, obviously: 2. upsd has a valid UPS entry in ups.conf for this UPS. [myups] - driver = upsdriver + driver = nutupsdrv port = /dev/ttySx 3. upsd has a valid user for upsmon in upsd.users. -- 1.7.9.2
Greg A. Woods
2012-Mar-08 23:21 UTC
[Nut-upsdev] [PATCH 16/36] Update info about APC cable model numbering and revisions.
From: "Greg A. Woods" <woods at planix.com> --- docs/cables/apc.txt | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/docs/cables/apc.txt b/docs/cables/apc.txt index ef927e0..ef87ccd 100644 --- a/docs/cables/apc.txt +++ b/docs/cables/apc.txt @@ -5,6 +5,33 @@ Auth: Arjen de Korte <adkorte-guest at alioth.debian.org http://lists.alioth.debian.org/pipermail/nut-upsuser/2005-August/000118.html +Note that APC UPS serial cable part numbers follow a numbering scheme +where the "940-" prefix identifies them as cables. + + 940-1000 straight through cable + 940-0103 null modem cable + 940-0020 Basic Signaling Cable (OB and kill power) + 940-0023 Simple Signaling Cable (OB only) + 940-LL24 Smart Signaling Cable + 940-0095 PnP Cable (see Apcupsd manual for diagram) + 940-0119 Simple Signaling Cable (OB and kill power) + 940-0127 RJ45-10P10C to USB Cable + 940-0128 Simple Signaling Cable for Back-UPS CS + +"LL" represents the length: + + 00 six feet + NN NN feet + +The suffix letter represents a minor revision in physical design, or a +change of OEM, _not_ a change of wiring or pin-out, and all cables +differing only in this suffix letter are electrically interchangeable. +Note though the following quote from the APC Discussion Forums: "At one +point there were a small number of revision D cables [940-0024D] that +had some shielding issues from the manufacturer that could maybe cause +[...] [spontaneous] self-tests)." + + +-----------------------------------------------------------------+ | | | Black APC 940-0024C Smart Signalling UPS Cable Wiring Diagram | @@ -183,6 +210,7 @@ http://lists.alioth.debian.org/pipermail/nut-upsuser/2005-August/000118.html +-----------------------------------------------------------------+ | | +| APC 940-1000 Straight Through cable | | Universal APC serial extension cable for use in conjunction | | with an APC UPS cable. This cable is verified to work. | | | -- 1.7.9.2
Greg A. Woods
2012-Mar-08 23:21 UTC
[Nut-upsdev] [PATCH 22/36] remove dead #defines and use "#if 0" to comment out code!
From: "Greg A. Woods" <woods at planix.com> --- clients/upsmon.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/clients/upsmon.c b/clients/upsmon.c index fe3f5fb..33d0a64 100644 --- a/clients/upsmon.c +++ b/clients/upsmon.c @@ -79,12 +79,6 @@ static int opt_af = AF_UNSPEC; static struct sigaction sa; static sigset_t nut_upsmon_sigmask; -#ifdef SHUT_RDWR -#define shutdown_how SHUT_RDWR -#else -#define shutdown_how 2 -#endif - static void setflag(int *val, int flag) { *val |= flag; @@ -709,8 +703,10 @@ static void recalc(void) ups = ups->next; } - /* upsdebugx(3, "Current power value: %d", val_ol); - upsdebugx(3, "Minimum power value: %d", minsupplies); */ +#if 0 + upsdebugx(3, "Current power value: %d", val_ol); + upsdebugx(3, "Minimum power value: %d", minsupplies); +#endif if (val_ol < minsupplies) forceshutdown(); -- 1.7.9.2
Greg A. Woods
2012-Mar-08 23:21 UTC
[Nut-upsdev] [PATCH 28/36] Turn on EXTRADATA by default, and fix the code to work with it on!
From: "Greg A. Woods" <woods at planix.com> --- drivers/metasys.c | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/drivers/metasys.c b/drivers/metasys.c index e80217f..aec15e9 100644 --- a/drivers/metasys.c +++ b/drivers/metasys.c @@ -17,10 +17,8 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -/* Uncomment if you want to read additional Meta System UPS data */ -/* -#define EXTRADATA -*/ +/* Defined to read additional interesting and useful Meta System UPS data */ +#define EXTRADATA /* defined */ #include "main.h" #include "serial.h" @@ -269,7 +267,7 @@ void upsdrv_initinfo(void) dstate_setinfo("output.current", "%d", -1); dstate_setflags("output.current", ST_FLAG_RW); #ifdef EXTRADATA - dstate_setinfo("output.current.peak", "%2.2f", -1); + dstate_setinfo("output.current.peak", "%2.2f", -1.0); dstate_setflags("output.current.peak", ST_FLAG_RW); dstate_setinfo("input.power", "%d", -1); dstate_setflags("input.power", ST_FLAG_RW); @@ -277,17 +275,17 @@ void upsdrv_initinfo(void) dstate_setinfo("input.voltage", "%d", -1); dstate_setflags("input.voltage", ST_FLAG_RW); #ifdef EXTRADATA - dstate_setinfo("input.current", "%2.2f", -1); + dstate_setinfo("input.current", "%2.2f", -1.0); dstate_setflags("input.current", ST_FLAG_RW); - dstate_setinfo("input.current.peak", "%2.2f", -1); + dstate_setinfo("input.current.peak", "%2.2f", -1.0); dstate_setflags("input.current.peak", ST_FLAG_RW); #endif dstate_setinfo("battery.voltage", "%d", -1); dstate_setflags("battery.voltage", ST_FLAG_RW); #ifdef EXTRADATA - dstate_setinfo("battery.voltage.low", "%2.2f", -1); + dstate_setinfo("battery.voltage.low", "%2.2f", -1.0); dstate_setflags("battery.voltage.low", ST_FLAG_RW); - dstate_setinfo("battery.voltage.exhaust", "%2.2f", -1); + dstate_setinfo("battery.voltage.exhaust", "%2.2f", -1.0); dstate_setflags("battery.voltage.exhaust", ST_FLAG_RW); dstate_setinfo("ups.total.runtime", "retrieving..."); dstate_setflags("ups.total.runtime", ST_FLAG_STRING | ST_FLAG_RW); -- 1.7.9.2
Charles Lepple
2012-Mar-09 04:01 UTC
[Nut-upsdev] some fixes, improvements, and new features (EPO and DYING) for NUT
On Mar 8, 2012, at 6:21 PM, Greg A. Woods wrote:> Here are a series of my recent changes to NUT. > > The first few in the set are primarily little fixes and improvements. > > In among those are a few for .gitignore files which of course you can > ignore for SVN, and there's one for a commit to a generated file which > of course should not be tracked in any VCS.We are actually in the process of trying to move the NUT source code over to Git, but both conversions by git-svn and Eric S. Raymond's reposurgeon are not quite there yet. (We are leaning towards reposurgeon, which involves a little more tweaking of commits, but produces better results for a one-way SVN-to-Git conversion, including .gitignore files generated from svn:ignore properties.) That said, while we could easily apply these first few patches, I would like to preserve what is left of my sanity (we are still working through a horrible Git/SVN hybrid merge of the NSS SSL code), and defer applying them until we have a native Git tree. This will also prevent some from falling through the cracks.> Then there are a couple or three to do with generating the header files > used by nut-scanner. These probably could have been collapsed into one, > but I left them separate to show more clearly what some of the problems > are with the crazy attempts to use scripts to parse C code instead of > using the compiler. The final one in that group is a half-assed attempt > to generate one of the headers using a helper function directly from the > compiled data structures it is derived from, and thus totally > eliminating the need for the broken python script in the first place. > Even this though is wrong -- the code needing the data structures from > the driver should be linking directly with shared .o files to access it > instead of re-inventing new data structures and trying to populate them > from the existing data structures. The same thing should be done to > eliminate the horrid perl script in there too.I have vented about other issues related to nut-scanner in the past, but with the CI and source control stuff, I haven't had time to fix it personally. My vote would be for applying these, but I'll give the Eaton folks a chance to look at it first.> I then made some improvements to the SNMP driver to make it actually > work properly with my AP9605 SNMP card, and which should make it work > properly now with any SNMP agent implementing APC's POWERNET MIB.SNMP isn't my area, but sounds good.> I also discovered the blazer driver does work pretty well with my GE > Digital Energy GT Series UPS, at least with the 1000-3000 VA models.Trivial to apply.> I added some more info about APC cables that I'd been keeping track of > independently.Very useful, thanks.> I had independently made a similar change to the apcsmart driver to keep > it from failing when tcgetattr() reported some irrelevant differences in > the port settings. What's actually in the patch now is my merge of the > change from upstream which is basically just an "improved" log message.Agreed.> I've also added some suggested coding improvements which I think will > make things easier to maintain down the line, notably using clear syntax > that's easy to modify safely for defining bit flag value macros, as well > as a strong suggestion to NEVER EVER use comment syntax to comment out > code blocks -- always use the pre-processor -- it's much safer!Agreed in principle, although I haven't looked to see if collapsing any of the unused bits will lead to binary incompatibility. Given how distributions tend to lag behind the latest code, we often suggest that people just drop in a replacement driver to test certain changes without disrupting the rest of the install. This could be completely unwarranted fears on my part, though.> Finally I introduce the first of my new features: The "EPO" command. > This is very similar to "FSD", but fundamentally different in that it > goes a bit deeper into the infrastructure and it has a different purpose > and ultimate affect on the systems being managed. The basic idea is to > provide the moral equivalent, though not in quite such draconian and > dangerous hard-core way, of an Emergency Power Off (big red) switch. > The critical difference with FSD is that EPO is intended to require > manual human intervention to recover from, and that it is also intended > to completely and entirely remove power from everything if at all > possible, even if mains power is still fully and smoothly functioning. > > I'm really not sure if "FSD" has a true purpose other than as a test > command to see if everything will restart after mains power returns, > since of course FSD tries to simulate the effect of mains power > returning after a full shutdown has been committed to and is in > progress.Recently, we discussed adding the option for drivers to set FSD if an external shutdown signal has been applied (e.g. if NUT is not the master): http://article.gmane.org/gmane.comp.monitoring.nut.devel/5925> EPO on the other hand is a key requirement of my next feature: The > ability of a UPS driver to declare that the UPS is dying of some > critical condition and that it must be shut down in such a way that > manual human intervention is required to restart it. EPO is also > intended to be triggered automatically, whereas FSD (I think) is always > intended to be manually introduced by a human systems manager. > > I.e. in an ideal configuration everything should restart and reboot and > return to operational status after "upsmon -c fsd" once mains power > returns or if power was never actually off; whereas with "upsmon -c epo" > then everything should power down and stay off even if mains power > remains on and steady.This is an interesting distinction (one that a few drivers make in their different shutdown commands, but that is not currently tied to FSD). The reason why I advocated usurping the "FSD" status was because it is the only other status besides "OB LB" that is currently guaranteed to trigger a shutdown. I wonder if we could just use FSD with some other status option to indicate whether the driver should request a restart when the power returns. I've CC'd Bill Elliot to get his thoughts on the use cases that led to suggesting the external shutdown trigger - it might dovetail with this.> For example I would have used "FSD" to shut down in power blackouts > where I knew the power could not return before the batteries ran low, > and thus I would have conserved battery charge for the inevitable short > hiccups that occur after a long blackout, but still been able to enjoy > automatic restart after the blackout in case power returns while I'm > sleeping, etc. > > Finally I add some features to the three drivers I was able to test > which make use of this new "DYING" state to power things down safely but > quickly when they detect operating temperatures above a configurable > maximum value. The one driver that already supported use of the ALARM > state also sets an alarm when the temperature rises above a configurable > warning value. The idea here is that if the HVAC fails in your computer > room then you can have everything automatically shut down _AND_ stop > pouring BTUs out into the room, and of course hopefully first raise an > alarm so that a human can try to intervene before an emergency power off > is actually necessary to prevent equipment damage. > > Indeed the motivation behind these new features is because HVAC fails > far more frequently in my client's server room, and with far more dire > consequences, than the power fails. Indeed they have only one tiny UPS > that can run only the most critical core equipment, but everything has > come near to suffering serious physical damage when ambient temperatures > have shot up above 45C in an extremely short time after HVAC failure, > which of course is usually on a Saturday night. > > These changes are a work in progress to some extent -- I still have not > fully tested the EPO of a running network, but I hope to do that very > soon. The drivers do report alarms (where implemented) and they report > the "DYING" status when their temperature sensors report above-maximum > values.It's definitely a feature I would like to see merged at some point. Now that you mention this, I think there are several UPS protocols which support a bitmask for alarm conditions which will trigger a shutdown (including overtemp). We will want to make sure that the procedure for setting that event mask is not terribly different depending on whether the shutdown is triggered by the UPS hardware, or by NUT monitoring other UPS status (as I believe you are proposing with the DYING status). I admit I haven't had time to read all of the patches that implement this, though, so please correct me if I am making any incorrect assumptions. -- Charles Lepple clepple at gmail
Michal Soltys
2012-Mar-12 20:26 UTC
[Nut-upsdev] some fixes, improvements, and new features (EPO and DYING) for NUT
On 12-03-09 00:21, Greg A. Woods wrote:> > I had independently made a similar change to the apcsmart driver to keep > it from failing when tcgetattr() reported some irrelevant differences in > the port settings. What's actually in the patch now is my merge of the > change from upstream which is basically just an "improved" log message.The error from the past was a reason of too hasty zeroing, but after the earlier commit, noone really commented on the issue. The flags /should/ match now. Would be good to test if they still don't.> > I've also added some suggested coding improvements which I think will > make things easier to maintain down the line, notably using clear syntax > that's easy to modify safely for defining bit flag value macros, as wellPersonally I prefer 0x approach, though I don't really care that much =) Some ornamental changes (short help summary, etc.) I think go beyond 80th column now. I'll have to check this. I'll check the actual changes carefully later. Thanks !
Greg A. Woods
2012-Mar-12 21:53 UTC
[Nut-upsdev] [PATCH] oops, forgot that I changed where nut-usbinfo.pl is to be run from!
From: "Greg A. Woods" <woods at planix.com> --- autogen.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/autogen.sh b/autogen.sh index 323b167..328a88c 100755 --- a/autogen.sh +++ b/autogen.sh @@ -21,7 +21,7 @@ if [ ! -f scripts/hal/ups-nut-device.fdi.in ] || [ ! -f scripts/udev/nut-usbups. then if perl -e 1; then echo "Regenerating the USB helper files..." - cd tools && ./nut-usbinfo.pl && cd .. + cd tools/nut-scanner && ../nut-usbinfo.pl && cd ../.. else echo "----------------------------------------------------------------------" echo "Error: Perl is not available." -- 1.7.9.2
Arnaud Quette
2012-May-11 11:28 UTC
[Nut-upsdev] [PATCH 07/36] Ignore a file generated by re-configuration.
2012/3/9 Greg A. Woods <woods at planix.com>:> From: "Greg A. Woods" <woods at planix.com> > > --- > ?include/.gitignore | ? ?7 ++++--- > ?1 file changed, 4 insertions(+), 3 deletions(-) > > diff --git a/include/.gitignore b/include/.gitignore > index da28148..0747a53 100644 > --- a/include/.gitignore > +++ b/include/.gitignore > @@ -1,7 +1,8 @@ > -/config.h > -/config.h.in > ?/Makefile > ?/Makefile.in > +/config.h > +/config.h.in > +/config.h.in~ > ?/nut_version.h > -/stamp-h1 > ?/stamp-h.in > +/stamp-h1.gitignore are left out for the time being. so this patch is discarded. Git migration is subject to many threads on the ML. ESR and Charles have worked a lot on automating migration from SVN to Git, without spilling a drop. this is a post 2.6.4 work area... thanks, Arnaud -- Linux / Unix Expert R&D - Eaton - http://powerquality.eaton.com Network UPS Tools (NUT) Project Leader - http://www.networkupstools.org/ Debian Developer - http://www.debian.org Free Software Developer - http://arnaud.quette.free.fr/
Arnaud Quette
2012-May-14 08:57 UTC
[Nut-upsdev] [PATCH 13/36] use an example driver name matching the unified NUT drivers generic manual page name.
2012/3/9 Greg A. Woods <woods at planix.com>:> From: "Greg A. Woods" <woods at planix.com> > > --- > ?docs/design.txt | ? ?2 +- > ?1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/docs/design.txt b/docs/design.txt > index dfaeae8..4e39eca 100644 > --- a/docs/design.txt > +++ b/docs/design.txt > @@ -128,7 +128,7 @@ This scenario requires some configuration, obviously: > ?2. upsd has a valid UPS entry in ups.conf for this UPS. > > ? ? ? ?[myups] > - ? ? ? ? ? ? ? driver = upsdriver > + ? ? ? ? ? ? ? driver = nutupsdrv > ? ? ? ? ? ? ? ?port = /dev/ttySx > > ?3. upsd has a valid user for upsmon in upsd.users.applied to trunk, r3577. thanks. Arnaud -- Linux / Unix Expert R&D - Eaton - http://powerquality.eaton.com Network UPS Tools (NUT) Project Leader - http://www.networkupstools.org/ Debian Developer - http://www.debian.org Free Software Developer - http://arnaud.quette.free.fr/
2012/3/9 Greg A. Woods <woods at planix.com>:> From: "Greg A. Woods" <woods at planix.com> > > GE is actually GE Digital Energy in this context. > GT Series 1000-3000 VA work fine with the blazer_ser driver. > --- > ?data/driver.list.in | ? ?3 ++- > ?1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/data/driver.list.in b/data/driver.list.in > index 3162cf3..7dab537 100644 > --- a/data/driver.list.in > +++ b/data/driver.list.in > @@ -294,7 +294,8 @@ > ?"Gamatronic" ? "ups" ? "5" ? ? "MS" ? ?"" ? ? ?"gamatronic" > ?"Gamatronic" ? "ups" ? "5" ? ? "?PS3/1" ? ? ? ?"" ? ? ?"gamatronic" > > -"GE" ? "ups" ? "2" ? ? "EP series" ? ? "" ? ? ?"blazer_usb" > +"GE Digtal Energy" ? ? "ups" ? "2" ? ? "EP Series" ? ? "" ? ? ?"blazer_usb" > +"GE Digtal Energy" ? ? "ups" ? "2" ? ? "GT Series 1000/1500/2000/3000 VA Rack/Tower" ? "UL-version" ? ?"blazer_ser" > > ?"Geek Squad" ? "ups" ? "2" ? ? "GS1285U" ? ? ? "USB" ? "usbhid-ups"applied to trunk, r3581, fixing the typos (Dig*i*tal ;-) and spacing (this file uses tabs!). thanks. Arnaud -- Linux / Unix Expert R&D - Eaton - http://powerquality.eaton.com Network UPS Tools (NUT) Project Leader - http://www.networkupstools.org/ Debian Developer - http://www.debian.org Free Software Developer - http://arnaud.quette.free.fr/
Arnaud Quette
2012-May-14 09:14 UTC
[Nut-upsdev] [PATCH 16/36] Update info about APC cable model numbering and revisions.
2012/3/9 Greg A. Woods <woods at planix.com>:> From: "Greg A. Woods" <woods at planix.com> > > --- > ?docs/cables/apc.txt | ? 28 ++++++++++++++++++++++++++++ > ?1 file changed, 28 insertions(+) > > diff --git a/docs/cables/apc.txt b/docs/cables/apc.txt > index ef927e0..ef87ccd 100644 > --- a/docs/cables/apc.txt > +++ b/docs/cables/apc.txt > @@ -5,6 +5,33 @@ Auth: Arjen de Korte <adkorte-guest at alioth.debian.org > > ?http://lists.alioth.debian.org/pipermail/nut-upsuser/2005-August/000118.html > > +Note that APC UPS serial cable part numbers follow a numbering scheme > +where the "940-" prefix identifies them as cables. > + > + ? ? ? 940-1000 ? ? ? ?straight through cable > + ? ? ? 940-0103 ? ? ? ?null modem cable > + ? ? ? 940-0020 ? ? ? ?Basic Signaling Cable (OB and kill power) > + ? ? ? 940-0023 ? ? ? ?Simple Signaling Cable (OB only) > + ? ? ? 940-LL24 ? ? ? ?Smart Signaling Cable > + ? ? ? 940-0095 ? ? ? ?PnP Cable (see Apcupsd manual for diagram) > + ? ? ? 940-0119 ? ? ? ?Simple Signaling Cable (OB and kill power) > + ? ? ? 940-0127 ? ? ? ?RJ45-10P10C to USB Cable > + ? ? ? 940-0128 ? ? ? ?Simple Signaling Cable for Back-UPS CS > + > +"LL" represents the length: > + > + ? ? ? 00 ? ? ?six feet > + ? ? ? NN ? ? ?NN feet > + > +The suffix letter represents a minor revision in physical design, or a > +change of OEM, _not_ a change of wiring or pin-out, and all cables > +differing only in this suffix letter are electrically interchangeable. > +Note though the following quote from the APC Discussion Forums: ?"At one > +point there were a small number of revision D cables [940-0024D] that > +had some shielding issues from the manufacturer that could maybe cause > +[...] [spontaneous] self-tests)." > + > + > ?+-----------------------------------------------------------------+ > ?| ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? | > ?| ?Black APC 940-0024C Smart Signalling UPS Cable Wiring Diagram ?| > @@ -183,6 +210,7 @@ http://lists.alioth.debian.org/pipermail/nut-upsuser/2005-August/000118.html > > ?+-----------------------------------------------------------------+ > ?| ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? | > +| ?APC 940-1000 Straight Through cable ? ? ? ? ? ? ? ? ? ? ? ? ? ?| > ?| ?Universal APC serial extension cable for use in conjunction ? ?| > ?| ?with an APC UPS cable. This cable is verified to work. ? ? ? ? | > ?| ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? |applied to trunk, r3582. thanks. Arnaud -- Linux / Unix Expert R&D - Eaton - http://powerquality.eaton.com Network UPS Tools (NUT) Project Leader - http://www.networkupstools.org/ Debian Developer - http://www.debian.org Free Software Developer - http://arnaud.quette.free.fr/
Arnaud Quette
2012-May-14 14:52 UTC
[Nut-upsdev] [PATCH 21/36] Use (1 << N) to define a bit flag at bit N.
2012/3/9 Greg A. Woods <woods at planix.com>:> From: "Greg A. Woods" <woods at planix.com> > > --- > ?drivers/apcsmart.h | ? 16 ++++++++-------- > ?1 file changed, 8 insertions(+), 8 deletions(-) > > diff --git a/drivers/apcsmart.h b/drivers/apcsmart.h > index e10c5fe..d85c3b9 100644 > --- a/drivers/apcsmart.h > +++ b/drivers/apcsmart.h > @@ -115,14 +115,14 @@ > > ?/* status bits */ > > -#define APC_STAT_CAL ? 0x01 ? ?/* calibration */ > -#define APC_STAT_TRIM ?0x02 ? ?/* SmartTrim */ > -#define APC_STAT_BOOST 0x04 ? ?/* SmartBoost */ > -#define APC_STAT_OL ? ?0x08 ? ?/* on line */ > -#define APC_STAT_OB ? ?0x10 ? ?/* on battery */ > -#define APC_STAT_OVER ?0x20 ? ?/* overload */ > -#define APC_STAT_LB ? ?0x40 ? ?/* low battery */ > -#define APC_STAT_RB ? ?0x80 ? ?/* replace battery */ > +#define APC_STAT_CAL ? (1 << 0) ? ? ? ?/* calibration */ > +#define APC_STAT_TRIM ?(1 << 1) ? ? ? ?/* SmartTrim */ > +#define APC_STAT_BOOST (1 << 2) ? ? ? ?/* SmartBoost */ > +#define APC_STAT_OL ? ?(1 << 3) ? ? ? ?/* on line */ > +#define APC_STAT_OB ? ?(1 << 4) ? ? ? ?/* on battery */ > +#define APC_STAT_OVER ?(1 << 5) ? ? ? ?/* overload */ > +#define APC_STAT_LB ? ?(1 << 6) ? ? ? ?/* low battery */ > +#define APC_STAT_RB ? ?(1 << 7) ? ? ? ?/* replace battery */ > > ?/* > ?* serial protocol: special commands - initialization and suchapplied to trunk, r3586, with another driver version bump. thanks. Arnaud -- Linux / Unix Expert R&D - Eaton - http://powerquality.eaton.com Network UPS Tools (NUT) Project Leader - http://www.networkupstools.org/ Debian Developer - http://www.debian.org Free Software Developer - http://arnaud.quette.free.fr/
Arnaud Quette
2012-May-15 09:03 UTC
[Nut-upsdev] [PATCH 25/36] mention more varieties of APC SNMP cards, and mention the POWERNET MIB
2012/3/9 Greg A. Woods <woods at planix.com>:> From: "Greg A. Woods" <woods at planix.com> > > --- > ?docs/man/snmp-ups.txt | ? ?2 +- > ?1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/docs/man/snmp-ups.txt b/docs/man/snmp-ups.txt > index 58ee71e..e61f858 100644 > --- a/docs/man/snmp-ups.txt > +++ b/docs/man/snmp-ups.txt > @@ -23,7 +23,7 @@ UPS that is RFC 1628 (UPS MIB) compliant, e.g. MGE UPS SYSTEMS, Liebert, perhaps > ?MGE UPS SYSTEMS and MGE Office Protection Systems devices with SNMP cards (ref 66062, 66045, 66074 and 66244) > > ?*apcc*:: > -APC AP9606 APC Web/SNMP management card, perhaps others > +APC AP9605, AP9606, AP9617, and AP9618 APC network management cards, as well as any others supporting the APC POWERNET MIB. > > ?*netvision*:: > ?Socomec Sicon UPS with Netvision Web/SNMP management card/external boxapplied to trunk, r3593. thanks. Arnaud -- Linux / Unix Expert R&D - Eaton - http://powerquality.eaton.com Network UPS Tools (NUT) Project Leader - http://www.networkupstools.org/ Debian Developer - http://www.debian.org Free Software Developer - http://arnaud.quette.free.fr/
Arnaud Quette
2012-May-15 09:35 UTC
[Nut-upsdev] [PATCH 27/36] Use "(1 << N)" to define bit N in flag macros!
2012/3/9 Greg A. Woods <woods at planix.com>:> From: "Greg A. Woods" <woods at planix.com> > > Convert some comments about variables to actual values. > > Also a bit of a cleanup. > --- > ?drivers/dummy-ups.h | ? 68 ++++++++++++++++++++++++++++++--------------------- > ?1 file changed, 40 insertions(+), 28 deletions(-) > > diff --git a/drivers/dummy-ups.h b/drivers/dummy-ups.h > index b086a52..ba49094 100644 > --- a/drivers/dummy-ups.h > +++ b/drivers/dummy-ups.h > @@ -18,11 +18,16 @@ > ? ?Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA > ?*/ > > -/* This file list all valid data with their type and info. > - * this are then enable through a definition file, specified > +/* > + * This file lists all valid data with their type and info. > + * > + * These are then enabled through a definition file, specified > ?* as the "port" parameter (only the file name, not the path). > + * > ?* The format of this file is the same as an upsc dump: > + * > ?* <varname>: <value> > + * > ?* FIXME: use cmdvartab for conformance checking > ?* ... > ?* Once the driver is loaded: > @@ -36,24 +41,31 @@ > ?/* Struct & data for ups.status processing ? ? ? ? ? ? ? ? ? ? ? ? */ > ?/* --------------------------------------------------------------- */ > > +#if 0 ?/* XXX status lookup table not currently used???? */ > +/* > + * Status lookup table type definition > + */ > ?typedef struct { > ? ? ? ?const char ? ? ?*status_str; ? ?/* ups.status string */ > - ? ? ? int ? ? status_value; ? /* ups.status value */ > + ? ? ? int ? ? status_value; ? ? ? ? ? /* ups.status flag bit */ > ?} status_lkp_t; > > -#define STATUS_CAL ? ? ? ? ? ? 1 ? ? ? /* calibration */ > -#define STATUS_TRIM ? ? ? ? ? ?2 ? ? ? /* SmartTrim */ > -#define STATUS_BOOST ? 4 ? ? ? /* SmartBoost */ > -#define STATUS_OL ? ? ? ? ? ? ?8 ? ? ? /* on line */ > -#define STATUS_OB ? ? ? ? ? ? ?16 ? ? ?/* on battery */ > -#define STATUS_OVER ? ? ? ? ? ?32 ? ? ?/* overload */ > -#define STATUS_LB ? ? ? ? ? ? ?64 ? ? ?/* low battery */ > -#define STATUS_RB ? ? ? ? ? ? ?128 ? ? /* replace battery */ > -#define STATUS_BYPASS ?256 ? ? ? ? ? ? /* on bypass */ > -#define STATUS_OFF ? ? ? ? ? ? 512 ? ? ? ? ? ? /* ups is off */ > -#define STATUS_CHRG ? ? ? ? ? ?1024 ? ?/* charging */ > -#define STATUS_DISCHRG 2048 ? ?/* discharging */ > - > +#define STATUS_CAL ? ? ? ? ? ? (1 << 0) ? ? ? ?/* calibration */ > +#define STATUS_TRIM ? ? ? ? ? ?(1 << 1) ? ? ? ?/* SmartTrim */ > +#define STATUS_BOOST ? ? ? ? ? (1 << 2) ? ? ? ?/* SmartBoost */ > +#define STATUS_OL ? ? ? ? ? ? ?(1 << 3) ? ? ? ?/* on line */ > +#define STATUS_OB ? ? ? ? ? ? ?(1 << 4) ? ? ? ?/* on battery */ > +#define STATUS_OVER ? ? ? ? ? ?(1 << 5) ? ? ? ?/* overload */ > +#define STATUS_LB ? ? ? ? ? ? ?(1 << 6) ? ? ? ?/* low battery */ > +#define STATUS_RB ? ? ? ? ? ? ?(1 << 7) ? ? ? ?/* replace battery */ > +#define STATUS_BYPASS ? ? ? ? ?(1 << 8) ? ? ? ?/* on bypass */ > +#define STATUS_OFF ? ? ? ? ? ? (1 << 9) ? ? ? ?/* ups is off */ > +#define STATUS_CHRG ? ? ? ? ? ?(1 << 10) ? ? ? /* charging */ > +#define STATUS_DISCHRG ? ? ? ? (1 << 11) ? ? ? /* discharging */ > + > +/* > + * Status lookup table > + */ > ?status_lkp_t status_info[] = { > ? { "CAL", STATUS_CAL }, > ? { "TRIM", STATUS_TRIM }, > @@ -69,8 +81,9 @@ status_lkp_t status_info[] = { > ? { "DISCHRG", STATUS_DISCHRG }, > ? { "NULL", 0 }, > ?}; > -/* from usbhid-ups.h */ > +#endif /* 0 -- not currently used??? */ > > +/* from usbhid-ups.h */ > ?typedef struct { > ? ? ? ?char ? ?hid_value; ? ? ?/* HID value */ > ? ? ? ?char ? ?*nut_value; ? ? /* NUT value */ > @@ -96,7 +109,6 @@ typedef struct { > ?/* data flags */ > ?#define DU_FLAG_NONE ? ? ? ? ? ? ? ? ? 0 > ?#define DU_FLAG_INIT ? ? ? ? ? ? ? ? ? 1 ? ? ? ? ? ? ? /* intialy show element to upsd */ > -#define DU_TYPE_CMD ? ? ? ? ? ? ? ? ? ?2 > > ?/* --------------------------------------------------------------- */ > ?/* ?Data table (all possible info from NUT, then enable upon cong ?*/ > @@ -166,16 +178,16 @@ battery.alarm.threshold > ?battery.date > ?battery.packs > ?battery.packs.bad > - > -ambient.temperature > -ambient.temperature.alarm > -ambient.temperature.high > -ambient.temperature.low > -ambient.humidity > -ambient.humidity.alarm > -ambient.humidity.high > -ambient.humidity.low > - > + */ > + ? ? ? { "ambient.temperature", ST_FLAG_RW, 1, NULL, DU_FLAG_NONE, NULL }, > + ? ? ? { "ambient.temperature.alarm", ST_FLAG_RW, 1, NULL, DU_FLAG_NONE, NULL }, > + ? ? ? { "ambient.temperature.high", ST_FLAG_RW, 1, NULL, DU_FLAG_NONE, NULL }, > + ? ? ? { "ambient.temperature.low", ST_FLAG_RW, 1, NULL, DU_FLAG_NONE, NULL }, > + ? ? ? { "ambient.humidity", ST_FLAG_RW, 1, NULL, DU_FLAG_NONE, NULL }, > + ? ? ? { "ambient.humidity.alarm", ST_FLAG_RW, 1, NULL, DU_FLAG_NONE, NULL }, > + ? ? ? { "ambient.humidity.high", ST_FLAG_RW, 1, NULL, DU_FLAG_NONE, NULL }, > + ? ? ? { "ambient.humidity.low", ST_FLAG_RW, 1, NULL, DU_FLAG_NONE, NULL }, > +/* > ?FIXME: how to manage these? > ?outlet.n.id > ?outlet.n.descapplied to trunk, r3596. thanks. Arnaud -- Linux / Unix Expert R&D - Eaton - http://powerquality.eaton.com Network UPS Tools (NUT) Project Leader - http://www.networkupstools.org/ Debian Developer - http://www.debian.org Free Software Developer - http://arnaud.quette.free.fr/
Arnaud Quette
2012-May-15 15:16 UTC
[Nut-upsdev] [PATCH 35/36] Initial exploratory hacks and fixes to prepare for temperature monitoring.
2012/3/9 Greg A. Woods <woods at planix.com>:> From: "Greg A. Woods" <woods at planix.com> > > (...)postponing for the same reasons as patch 31 to 34. cheers, Arnaud -- Linux / Unix Expert R&D - Eaton - http://powerquality.eaton.com Network UPS Tools (NUT) Project Leader - http://www.networkupstools.org/ Debian Developer - http://www.debian.org Free Software Developer - http://arnaud.quette.free.fr/