diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index 288472971e..639fa20c8e 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -4,6 +4,11 @@ as for which text documents to update. See also docs/developer-guide.txt for general points on NUT architecture and design. +* Please note that we require "Signed-Off-By" tags in each Git Commit + message, to conform to the common DCO (Developer Certificate of Origin) + as posted in LICENSE-DCO at root of NUT codebase as well as published + at https://developercertificate.org/ + * The checklist below is more of a reminder of steps to take and "dangers" to look out for. PRs to update this template are also welcome :) diff --git a/AUTHORS b/AUTHORS index 5a96fa7db3..4c9619133a 100644 --- a/AUTHORS +++ b/AUTHORS @@ -54,7 +54,7 @@ D: Provided a Best Fortress for development of a Best driver (bestups) N: Russell Kroll E: rkroll@exploits.org -W: http://www.networkupstools.org/ +W: https://www.networkupstools.org/ D: Original NUT author and coordinator P: 1024D/9DC0E77E 6A5C 7D2D 7945 C022 6104 D421 D61D C97F 9DC0 E77E diff --git a/COPYING b/COPYING index 22de43ea47..94adc8c31f 100644 --- a/COPYING +++ b/COPYING @@ -28,3 +28,9 @@ To the best of our knowledge, conditions of the 2/3-clause BSD, MIT, curl and CC BY-SA licenses allow redistribution and reuse of the codebase in projects made available under GPL license terms, as long as attribution is provided. + + NUT contributors are encouraged to "sign off" their git commits as a conscious + act done under Developer's Certificate of Origin. See the copy of "LICENSE-DCO" + in the root of this distribution, but please note that it is not a "license" on + its own - rather a proclamation that work was done and submitted according to + applicable open-source licenses. diff --git a/Jenkinsfile-dynamatrix b/Jenkinsfile-dynamatrix index 967c12081e..c44e565c52 100644 --- a/Jenkinsfile-dynamatrix +++ b/Jenkinsfile-dynamatrix @@ -240,12 +240,13 @@ import org.nut.dynamatrix.*; //dynacfgPipeline.buildSystem = 'ci_build.sh' //dynacfgPipeline.slowBuildDefaultBody = { echo "Running default custom build" } - dynacfgPipeline.slowBuildDefaultBody_autotools = { delegate -> setDelegate(delegate) + dynacfgPipeline.slowBuildDefaultBody_autotools = { def delegate -> setDelegate(delegate) + // Be sure to have a fixed resolved String here ASAP: + String stageNameClone = "${stageName}" def dsbcClone = dsbc.clone() - def stageNameClone = "${stageName}" stage('Investigate envvars (Autotools DEBUG)') { - echo "Running default custom build for '${stageName}' ==> ${dsbc.toString()}" + echo "Running default custom build for '${stageNameClone}' ==> ${dsbcClone.toString()}" // Trick about endianness via ELF binary header picked up from https://serverfault.com/a/749469/490516 sh label: 'Inspect initial envvars', script: """ hostname; date -u; uname -a echo "LONG_BIT:`getconf LONG_BIT` WORD_BIT:`getconf WORD_BIT`" || true @@ -261,19 +262,20 @@ set | sort -n """ } } - infra.withEnvOptional(dynacfgPipeline.defaultTools) { + withEnvOptional(dynacfgPipeline.defaultTools) { unstashCleanSrc(dynacfgPipeline.stashnameSrc) buildMatrixCellCI(dynacfgPipeline, dsbcClone, stageNameClone) //buildMatrixCellCI(dynacfgPipeline, dsbc, stageName) } } - dynacfgPipeline.slowBuildDefaultBody_ci_build = { delegate -> setDelegate(delegate) + dynacfgPipeline.slowBuildDefaultBody_ci_build = { def delegate -> setDelegate(delegate) + // Be sure to have a fixed resolved String here ASAP: + String stageNameClone = "${stageName}" def dsbcClone = dsbc.clone() - def stageNameClone = "${stageName}" stage('Investigate envvars (CI_Build DEBUG)') { - echo "Running default custom build for '${stageName}' ==> ${dsbc.toString()}" + echo "Running default custom build for '${stageNameClone}' ==> ${dsbcClone.toString()}" // Trick about endianness via ELF binary header picked up from https://serverfault.com/a/749469/490516 sh label: 'Inspect initial envvars', script: """ hostname; date -u; uname -a echo "LONG_BIT:`getconf LONG_BIT` WORD_BIT:`getconf WORD_BIT`" || true @@ -289,7 +291,7 @@ set | sort -n """ } } - infra.withEnvOptional(dynacfgPipeline.defaultTools) { + withEnvOptional(dynacfgPipeline.defaultTools) { unstashCleanSrc(dynacfgPipeline.stashnameSrc) def dynacfgPipeline_ciBuild = dynacfgPipeline.clone() dynacfgPipeline_ciBuild.buildSystem = 'ci_build.sh' @@ -321,7 +323,7 @@ set | sort -n """ //branchRegexTarget: dynacfgPipeline.branchStableRegex, branchRegexTarget: ~/fightwarn/, appliesToChangedFilesRegex: dynacfgPipeline.appliesToChangedFilesRegex_C, - 'getParStages': { dynamatrix, Closure body -> + 'getParStages': { def dynamatrix, Closure body -> return dynamatrix.generateBuild([ //commonLabelExpr: dynacfgBase.commonLabelExpr, //defaultDynamatrixConfig: dynacfgBase.defaultDynamatrixConfig, @@ -359,7 +361,7 @@ set | sort -n """ branchRegexTarget: ~/fightwarn/, // NOTE: For fightwarn, we want some schenarios that would always build to test //appliesToChangedFilesRegex: dynacfgPipeline.appliesToChangedFilesRegex_C, - 'getParStages': { dynamatrix, Closure body -> + 'getParStages': { def dynamatrix, Closure body -> return dynamatrix.generateBuild([ //commonLabelExpr: dynacfgBase.commonLabelExpr, //defaultDynamatrixConfig: dynacfgBase.defaultDynamatrixConfig, @@ -401,7 +403,7 @@ set | sort -n """ //branchRegexSource: ~/^(PR-.+|fightwarn.*)$/, //branchRegexTarget: dynacfgPipeline.branchStableRegex, appliesToChangedFilesRegex: dynacfgPipeline.appliesToChangedFilesRegex_C, - 'getParStages': { dynamatrix, Closure body -> + 'getParStages': { def dynamatrix, Closure body -> return dynamatrix.generateBuild([ requiredNodelabels: [], excludedNodelabels: [], @@ -438,7 +440,7 @@ set | sort -n """ //branchRegexSource: ~/^(PR-.+|fightwarn.*)$/, //branchRegexTarget: dynacfgPipeline.branchStableRegex, appliesToChangedFilesRegex: dynacfgPipeline.appliesToChangedFilesRegex_C, - 'getParStages': { dynamatrix, Closure body -> + 'getParStages': { def dynamatrix, Closure body -> return dynamatrix.generateBuild([ requiredNodelabels: ["(NUT_BUILD_CAPS=valgrind=yes||NUT_BUILD_CAPS=valgrind)"], excludedNodelabels: ["NUT_BUILD_CAPS=valgrind=no"], @@ -483,7 +485,7 @@ set | sort -n """ //branchRegexTarget: dynacfgPipeline.branchStableRegex, branchRegexTarget: ~/fightwarn/, appliesToChangedFilesRegex: dynacfgPipeline.appliesToChangedFilesRegex_C, - 'getParStages': { dynamatrix, Closure body -> + 'getParStages': { def dynamatrix, Closure body -> return dynamatrix.generateBuild([ dynamatrixAxesLabels: ['OS_FAMILY'], // + [ 'OS_DISTRO', 'MAKE'], requiredNodelabels: ["(NUT_BUILD_CAPS=cppcheck||NUT_BUILD_CAPS=cppcheck=yes)"], @@ -527,7 +529,7 @@ set | sort -n """ //branchRegexSource: ~/^(PR-.+|fightwarn.*)$/, //branchRegexTarget: dynacfgPipeline.branchStableRegex, appliesToChangedFilesRegex: dynacfgPipeline.appliesToChangedFilesRegex_C, - 'getParStages': { dynamatrix, Closure body -> + 'getParStages': { def dynamatrix, Closure body -> return dynamatrix.generateBuild([ //commonLabelExpr: "nut-builder:alldrv", requiredNodelabels: ["(NUT_BUILD_CAPS=drivers:all||nut-builder:alldrv)"], @@ -568,7 +570,7 @@ set | sort -n """ //branchRegexSource: ~/^(PR-.+|fightwarn.*)$/, //branchRegexTarget: dynacfgPipeline.branchStableRegex, appliesToChangedFilesRegex: dynacfgPipeline.appliesToChangedFilesRegex_C, - 'getParStages': { dynamatrix, Closure body -> + 'getParStages': { def dynamatrix, Closure body -> return dynamatrix.generateBuild([ //commonLabelExpr: "nut-builder:alldrv", requiredNodelabels: ["(NUT_BUILD_CAPS=drivers:all||nut-builder:alldrv)"], @@ -604,7 +606,7 @@ set | sort -n """ branchRegexSource: ~/^(PR-.+|.*fightwarn.*)$/, branchRegexTarget: ~/fightwarn/, appliesToChangedFilesRegex: dynacfgPipeline.appliesToChangedFilesRegex_C, - 'getParStages': { dynamatrix, Closure body -> + 'getParStages': { def dynamatrix, Closure body -> return dynamatrix.generateBuild([ //commonLabelExpr: "nut-builder:alldrv", requiredNodelabels: ["(NUT_BUILD_CAPS=drivers:all||nut-builder:alldrv)"], @@ -644,7 +646,7 @@ set | sort -n """ //branchRegexSource: ~/^(PR-.+|fightwarn.*)$/, //branchRegexTarget: dynacfgPipeline.branchStableRegex, appliesToChangedFilesRegex: dynacfgPipeline.appliesToChangedFilesRegex_PY, - 'getParStages': { dynamatrix, Closure body -> + 'getParStages': { def dynamatrix, Closure body -> return dynamatrix.generateBuild([ //commonLabelExpr: "nut-builder:alldrv", // TOTHINK: Should we also vary compilers here? @@ -684,7 +686,7 @@ set | sort -n """ //branchRegexSource: ~/^(PR-.+|fightwarn.*)$/, //branchRegexTarget: dynacfgPipeline.branchStableRegex, appliesToChangedFilesRegex: dynacfgPipeline.appliesToChangedFilesRegex_DOC, - 'getParStages': { dynamatrix, Closure body -> + 'getParStages': { def dynamatrix, Closure body -> return dynamatrix.generateBuild([ //commonLabelExpr: dynacfgBase.commonLabelExpr + " && doc-builder", //commonLabelExpr: infra.labelDocumentationWorker(), @@ -726,7 +728,7 @@ set | sort -n """ //branchRegexSource: ~/^(PR-.+|fightwarn.*)$/, //branchRegexTarget: dynacfgPipeline.branchStableRegex, appliesToChangedFilesRegex: dynacfgPipeline.appliesToChangedFilesRegex_TXT, - 'getParStages': { dynamatrix, Closure body -> + 'getParStages': { def dynamatrix, Closure body -> return dynamatrix.generateBuild([ //commonLabelExpr: dynacfgBase.commonLabelExpr + " && doc-builder", //commonLabelExpr: infra.labelDocumentationWorker(), @@ -764,7 +766,7 @@ set | sort -n """ //branchRegexSource: ~/^(PR-.+|fightwarn.*)$/, //branchRegexTarget: dynacfgPipeline.branchStableRegex, appliesToChangedFilesRegex: dynacfgPipeline.appliesToChangedFilesRegex_C, - 'getParStages': { dynamatrix, Closure body -> + 'getParStages': { def dynamatrix, Closure body -> return dynamatrix.generateBuild([ requiredNodelabels: [], excludedNodelabels: [], @@ -804,7 +806,7 @@ set | sort -n """ //branchRegexSource: ~/^(PR-.+|.*fightwarn.*)$/, //branchRegexTarget: ~/fightwarn.*/, appliesToChangedFilesRegex: dynacfgPipeline.appliesToChangedFilesRegex_C, - 'getParStages': { dynamatrix, Closure body -> + 'getParStages': { def dynamatrix, Closure body -> return dynamatrix.generateBuild([ requiredNodelabels: [], excludedNodelabels: [], @@ -838,7 +840,7 @@ set | sort -n """ branchRegexSource: ~/^(PR-.+|.*fightwarn.*89.*)$/, branchRegexTarget: ~/fightwarn.*89.*/, appliesToChangedFilesRegex: dynacfgPipeline.appliesToChangedFilesRegex_C, - 'getParStages': { dynamatrix, Closure body -> + 'getParStages': { def dynamatrix, Closure body -> return dynamatrix.generateBuild([ requiredNodelabels: [], excludedNodelabels: [], @@ -872,7 +874,7 @@ set | sort -n """ //branchRegexSource: ~/^(PR-.+|fightwarn.*|.*qemu.*)$/, //branchRegexTarget: ~/^(master|main|stable|.*qemu.*)$/, appliesToChangedFilesRegex: dynacfgPipeline.appliesToChangedFilesRegex_C, - 'getParStages': { dynamatrix, Closure body -> + 'getParStages': { def dynamatrix, Closure body -> return dynamatrix.generateBuild([ //commonLabelExpr: "qemu-" + dynacfgBase.commonLabelExpr, commonLabelExpr: "qemu-nut-builder || ssh-qemu-nut-builder", @@ -914,7 +916,7 @@ set | sort -n """ branchRegexSource: ~/^(PR-.+|.*fightwarn.*)$/, branchRegexTarget: ~/fightwarn/, appliesToChangedFilesRegex: dynacfgPipeline.appliesToChangedFilesRegex_C, - 'getParStages': { dynamatrix, Closure body -> + 'getParStages': { def dynamatrix, Closure body -> return dynamatrix.generateBuild([ requiredNodelabels: [], excludedNodelabels: [], @@ -958,7 +960,7 @@ set | sort -n """ branchRegexSource: ~/^(PR-.+|.*fightwarn.*89.*)$/, branchRegexTarget: ~/fightwarn.*89.*/, appliesToChangedFilesRegex: dynacfgPipeline.appliesToChangedFilesRegex_C, - 'getParStages': { dynamatrix, Closure body -> + 'getParStages': { def dynamatrix, Closure body -> return dynamatrix.generateBuild([ requiredNodelabels: [], excludedNodelabels: [], @@ -995,7 +997,7 @@ set | sort -n """ //branchRegexSource: ~/^(PR-.+|fightwarn.*)$/, //branchRegexTarget: dynacfgPipeline.branchStableRegex, appliesToChangedFilesRegex: dynacfgPipeline.appliesToChangedFilesRegex_C, - 'getParStages': { dynamatrix, Closure body -> + 'getParStages': { def dynamatrix, Closure body -> return dynamatrix.generateBuild([ requiredNodelabels: [], excludedNodelabels: [], @@ -1038,7 +1040,7 @@ set | sort -n """ branchRegexSource: ~/^(PR-.+|.*fightwarn.*)$/, branchRegexTarget: ~/fightwarn/, appliesToChangedFilesRegex: dynacfgPipeline.appliesToChangedFilesRegex_C, - 'getParStages': { dynamatrix, Closure body -> + 'getParStages': { def dynamatrix, Closure body -> return dynamatrix.generateBuild([ requiredNodelabels: [], excludedNodelabels: [], @@ -1078,7 +1080,7 @@ set | sort -n """ branchRegexSource: ~/^(PR-.+|.*fightwarn.*)$/, branchRegexTarget: ~/fightwarn.*/, appliesToChangedFilesRegex: dynacfgPipeline.appliesToChangedFilesRegex_C, - 'getParStages': { dynamatrix, Closure body -> + 'getParStages': { def dynamatrix, Closure body -> return dynamatrix.generateBuild([ requiredNodelabels: [], excludedNodelabels: [], @@ -1115,7 +1117,7 @@ set | sort -n """ branchRegexSource: ~/^(PR-.+|.*fightwarn.*89.*)$/, branchRegexTarget: ~/fightwarn.*89.*/, appliesToChangedFilesRegex: dynacfgPipeline.appliesToChangedFilesRegex_C, - 'getParStages': { dynamatrix, Closure body -> + 'getParStages': { def dynamatrix, Closure body -> return dynamatrix.generateBuild([ requiredNodelabels: [], excludedNodelabels: [], @@ -1152,7 +1154,7 @@ set | sort -n """ branchRegexSource: ~/^(PR-.+|.*fightwarn.*|.*Windows.*)$/, branchRegexTarget: ~/fightwarn|Windows-.*/, appliesToChangedFilesRegex: dynacfgPipeline.appliesToChangedFilesRegex_C, - 'getParStages': { dynamatrix, Closure body -> + 'getParStages': { def dynamatrix, Closure body -> return dynamatrix.generateBuild([ requiredNodelabels: [], excludedNodelabels: [], @@ -1193,7 +1195,7 @@ set | sort -n """ //branchRegexSource: ~/^(PR-.+|.*fightwarn.*|.*Windows.*)$/, //branchRegexTarget: ~/fightwarn|Windows-.*/, appliesToChangedFilesRegex: dynacfgPipeline.appliesToChangedFilesRegex_C, - 'getParStages': { dynamatrix, Closure body -> + 'getParStages': { def dynamatrix, Closure body -> return dynamatrix.generateBuild([ commonLabelExpr: "cross-windows-nut-builder", dynamatrixAxesLabels: ['OS_FAMILY', 'OS_DISTRO', 'ARCH${ARCH_BITS}', 'COMPILER'], diff --git a/LICENSE-DCO b/LICENSE-DCO new file mode 100644 index 0000000000..49b8cb0549 --- /dev/null +++ b/LICENSE-DCO @@ -0,0 +1,34 @@ +Developer Certificate of Origin +Version 1.1 + +Copyright (C) 2004, 2006 The Linux Foundation and its contributors. + +Everyone is permitted to copy and distribute verbatim copies of this +license document, but changing it is not allowed. + + +Developer's Certificate of Origin 1.1 + +By making a contribution to this project, I certify that: + +(a) The contribution was created in whole or in part by me and I + have the right to submit it under the open source license + indicated in the file; or + +(b) The contribution is based upon previous work that, to the best + of my knowledge, is covered under an appropriate open source + license and I have the right under that license to submit that + work with modifications, whether created in whole or in part + by me, under the same open source license (unless I am + permitted to submit under a different license), as indicated + in the file; or + +(c) The contribution was provided directly to me by some other + person who certified (a), (b) or (c) and I have not modified + it. + +(d) I understand and agree that this project and the contribution + are public and that a record of the contribution (including all + personal information I submit with it, including my sign-off) is + maintained indefinitely and may be redistributed consistent with + this project or the open source license(s) involved. diff --git a/Makefile.am b/Makefile.am index 429befdfa1..1b632c97f8 100644 --- a/Makefile.am +++ b/Makefile.am @@ -212,6 +212,9 @@ cppcheck: @echo "CPPCHECK analysis not available since 'cppcheck' was not found." endif !HAVE_CPPCHECK +sockdebug: + cd $(builddir)/server && $(MAKE) $(AM_MAKEFLAGS) sockdebug$(EXEEXT) + # ---------------------------------------------------------------------- # Automatically generate the ChangeLog from Git logs: MAINTAINERCLEANFILES += ChangeLog diff --git a/NEWS b/NEWS index 308f6e5b9a..0b9828dd1d 100644 --- a/NEWS +++ b/NEWS @@ -40,6 +40,20 @@ https://github.com/networkupstools/nut/milestone/8 https://www.iana.org/assignments/service-names-port-numbers/service-names-port-numbers.xhtml?search=3493 (even though this RFC is not formally an Internet Standard) + - Published a new maintainer GPG key to sign tags and release artifacts, + and possibly git commits as well, as part of solution for issue #1410. + You can pull it from common OpenPGP servers with the following command: ++ +---- +:; gpg --recv-key DE0184DA7043DCF7 +gpg: key DE0184DA7043DCF7: public key "Jim Klimov (Doing FOSS + since last millennium) " imported +gpg: Total number processed: 1 +gpg: imported: 1 +---- ++ +as part of https://github.com/networkupstools/nut/issues/1410 solution. + - Bug fixes for fallout possible due to "fightwarn" effort and other evolution in NUT v2.8.0 release: * The `upsdebugx()` and similar methods were converted to macros in #685 @@ -75,6 +89,11 @@ https://github.com/networkupstools/nut/milestone/8 of recent codebase solves their practical issues. For "quick tests", a shortcut operation `./ci_build.sh inplace` was added [#1714] + - State tree structure and methods (including "dstate" wrapper for common + driver internals) was enhanced with time-stamping of last modification + (setting, changing, deleting the value or some fields in an entry): + this allows to detect stale information in a centralized fashion [#2010] + - We lacked log information about changes of chroot jail (uncommon) and of UID/GID (everywhere), which makes troubleshooting harder (e.g. lack of access to config files or USB device nodes). Now we have it [#1694] @@ -108,6 +127,11 @@ https://github.com/networkupstools/nut/milestone/8 - powercom driver should now try harder to refresh data from device [#356] + - apcupsd-ups: + * improvement for `POLL_INTERVAL_MIN` from PR #797 was buggy [#2007] + * fix to clean obsoleted readings (if any) AFTER getting new info from an + `apcupsd` daemon, to avoid the gap when NUT driver knows nothing [#2007] + - NUT for Windows: * Ability to build NUT for Windows, last tackled with a branch based on NUT v2.6.5 a decade ago, has been revived with the 2.8.x era codebase [#5]. @@ -145,6 +169,8 @@ https://github.com/networkupstools/nut/milestone/8 driver [#1716] * `baytech-mib.c` subdriver: fixed `baytech_outlet_status_info[]` set of valid outlet status values [#1871] + * `cyberpower-mib.c` subdriver: support devices which report the shorter + Vendor OID as their sysOID, e.g. "CyberPower PowerPanel Personal" [#1997] - The `bestfortress` driver shutdown handling was fixed to use a non-trivial default timeout [#1820] @@ -283,11 +309,21 @@ https://github.com/networkupstools/nut/milestone/8 to toggle whether they want to receive `send_to_all()` updates from a driver, or only answers to requests they send [#1914] + - Added support for `make sockdebug` for easier developer access to the tool; + also if `configure --with-dev` is in effect, it would now be installed to + the configured `libexec` location. A man page was also added. [#1936] + - Numerous daemons (`upsd`, `upsmon`, drivers, `upsdrvctl`, `upssched`) which accepted `-D` option for debug setting previously, now can also honour a `NUT_DEBUG_LEVEL=NUM` environment variable if no `-D` arguments were provided. Unlike those arguments, the environment variable does not enforce that daemons run in foreground mode by default [#1915] + * Note that unlike some other NUT daemons, `upssched` with enabled + debug does not stop reporting on `stderr`! [#1965] + + - A bug in `upssched` was discovered and fixed, where it ran a tight loop + stressing the CPU; it was presumably introduced between NUT v2.7.4 and + v2.8.0 releases [#1964, #1965] - Implemented generic support for INSTCMD and SETVAR use-cases shared by all drivers, and in particular to see and change active debug verbosity @@ -340,6 +376,15 @@ and a `driver.killpower` instant command (for safety, must be unlocked by - The `COPYING` file was updated with licenses and attribution for certain source code files and blocks coming from the Internet originally [#1758] + - The `tools/gitlog2changelog.py.in` script was revised, in particular to + generate the `ChangeLog` file more consistently with different versions + of Python interpreter, and without breaking the long file paths in the + resulting mark-up text [#1945, #1955] + + - The "NUT client for VMware ESXi" project (by René Garcia) got its build + recipes published on GitHub at https://github.com/rgc2000/NutClient-ESXi + [#1961] + --------------------------------------------------------------------------- Release notes for NUT 2.8.0 - what's new since 2.7.4: @@ -759,22 +804,22 @@ Release notes for NUT 2.7.4 - what's new since 2.7.3: input, output, outlet and outlet.group) - support for new devices: - AEG PROTECT B / NAS - APC ATS AP7724 (should be supported) - Asium P700 - Eaton ATS - Eaton 5E 1100iUSB - Eaton E Series DX UPS 1-20 kVA - Eaton Powerware 9125-5000g - Electrys UPS 2500 - Fideltronic INIGO Viper 1200 - Legrand Keor Multiplug - LYONN CTB-800V - Micropower LCD 1000 - NHS Laser Senoidal 5000VA - Sweex model P220 - TS Shara - Various APCUPSD-controlled APC devices + * AEG PROTECT B / NAS + * APC ATS AP7724 (should be supported) + * Asium P700 + * Eaton ATS + * Eaton 5E 1100iUSB + * Eaton E Series DX UPS 1-20 kVA + * Eaton Powerware 9125-5000g + * Electrys UPS 2500 + * Fideltronic INIGO Viper 1200 + * Legrand Keor Multiplug + * LYONN CTB-800V + * Micropower LCD 1000 + * NHS Laser Senoidal 5000VA + * Sweex model P220 + * TS Shara + * Various APCUPSD-controlled APC devices - snmp-ups: * Improve automatic detection algorithm @@ -1064,7 +1109,7 @@ Release notes for NUT 2.6.5 - what's new since 2.6.4: not executed (report and patch from Oliver Schonefeld) - Website hosting: free NUT from Eaton website hosting - NUT website (http://www.networkupstools.org) is no longer hosted by Eaton. + NUT website (https://www.networkupstools.org) is no longer hosted by Eaton. Arnaud Quette (NUT project leader) has taken over NUT hosting on his own, to give NUT back some independence. This effort is also part of a logic to stop crediting Eaton for @@ -1209,7 +1254,7 @@ Release notes for NUT 2.6.4 - what's new since 2.6.3: - Provide an Uncomplicated Firewall (UFW) profile (nut.ufw.profile) - Riello protocols have been officially published in NUT protocols library: - http://www.networkupstools.org/ups-protocols.html#_riello + https://www.networkupstools.org/ups-protocols.html#_riello - Duplicate instances of upsd / upsmon are now detected upon startup diff --git a/README b/README index 608c52c1b2..85ef108867 100644 --- a/README +++ b/README @@ -171,7 +171,7 @@ For example, it is available on Debian systems as: /usr/share/nut/driver.list -This table is also available link:http://www.networkupstools.org/stable-hcl.html[online]. +This table is also available link:https://www.networkupstools.org/stable-hcl.html[online]. If your driver has vanished, see the link:FAQ.html[FAQ] and diff --git a/UPGRADING b/UPGRADING index a6a09315af..10b87c0968 100644 --- a/UPGRADING +++ b/UPGRADING @@ -65,6 +65,10 @@ Changes from 2.8.0 to 2.8.1 the packaging recipes may use NUT source-code facilities and package just symlinks as relevant for each distro separately [#1462, #1504] +- Added support for `make sockdebug` for easier developer access to the tool; + also if `configure --with-dev` is in effect, it would now be installed to + the configured `libexec` location. A man page was also added. [#1936] + - NUT software-only drivers (dummy-ups, clone, clone-outlet) separated from serial drivers in respective Makefile and configure script options - this may impact packaging decisions on some distributions going forward [#1446] @@ -108,6 +112,14 @@ Changes from 2.8.0 to 2.8.1 were renamed: `pw` is now `eaton_pw_nm2`, and `pxgx_ups` is `eaton_pxg_ups` [#1715] +- The `tools/gitlog2changelog.py.in` script was revised, in particular to + generate the `ChangeLog` file more consistently with different versions + of Python interpreter, and without breaking the long file paths in the + resulting mark-up text. Due to this, a copy of this file distributed with + NUT release archives is expected to considerably differ on first glance + from its earlier released versions (not just adding lines for the new + release, but changing lines in the older releases too) [#1945, #1955] + Changes from 2.7.4 to 2.8.0 --------------------------- diff --git a/clients/upssched.c b/clients/upssched.c index aa1593240a..4b8e9c4ba9 100644 --- a/clients/upssched.c +++ b/clients/upssched.c @@ -49,6 +49,7 @@ #include #include #include +#include #else #include "wincompat.h" #include @@ -170,6 +171,7 @@ static void checktimers(void) sleep(15); #endif + upsdebugx(1, "Timer queue empty, closing pipe and exiting upssched daemon"); unlink(pipefn); exit(EXIT_SUCCESS); } @@ -620,7 +622,7 @@ static TYPE_FD conn_add(TYPE_FD sockfd) else connhead = conn; - upsdebugx(3, "new connection on fd %p", acc); + upsdebugx(3, "new connection on handle %p", acc); pconf_init(&conn->ctx, NULL); #endif @@ -675,24 +677,64 @@ static int sock_read(conn_t *conn) ssize_t ret; char ch; + upsdebugx(6, "Starting sock_read()"); for (i = 0; i < US_MAX_READ; i++) { - + /* NOTE: This does not imply that each command line must + * fit in the US_MAX_READ length limit - at worst we would + * "return 0", and continue with pconf_char() next round. + */ #ifndef WIN32 + errno = 0; ret = read(conn->fd, &ch, 1); + if (ret > 0) + upsdebugx(6, "read() from fd %d returned %" PRIiSIZE " (bytes): '%c'; errno=%d: %s", + conn->fd, ret, ch, errno, strerror(errno)); + if (ret < 1) { /* short read = no parsing, come back later */ - if ((ret == -1) && (errno == EAGAIN)) + if ((ret == -1) && (errno == EAGAIN)) { + upsdebugx(6, "Ending sock_read(): short read"); return 0; + } /* O_NDELAY with zero bytes means nothing to read but - * since read() follows a succesful select() with - * ready file descriptor, ret shouldn't be 0. */ - if (ret == 0) + * since read() follows a successful select() with + * ready file descriptor, ret shouldn't be 0. + * This may also mean that the counterpart has exited + * and the file descriptor should be reaped. + */ + if (ret == 0) { + struct pollfd pfd; + pfd.fd = conn->fd; + pfd.events = 0; + pfd.revents = 0; + /* Note: we check errno twice, since it could + * have been set by read() above or by one + * of the probing routines below + */ + if (errno + || (fcntl(conn->fd, F_GETFD) < 0) + || (poll(&pfd, 1, 0) <= 0) + || errno + ) { + upsdebugx(4, "read() from fd %d returned 0; errno=%d: %s", + conn->fd, errno, strerror(errno)); + return -1; /* connection closed, probably */ + } + if (i == (US_MAX_READ - 1)) { + upsdebugx(4, "read() from fd %d returned 0 " + "too many times in a row, aborting " + "sock_read(); errno=%d: %s", + conn->fd, errno, strerror(errno)); + return -1; /* connection closed, probably */ + } continue; + } /* some other problem */ + upsdebugx(6, "Ending sock_read(): some other problem"); return -1; /* error */ } #else @@ -720,10 +762,14 @@ static int sock_read(conn_t *conn) upslogx(LOG_NOTICE, "Parse error on sock: %s", conn->ctx.errmsg); + upsdebugx(6, "Ending sock_read(): parse error"); return 0; /* nothing parsed */ } /* try to use it, and complain about unknown commands */ + upsdebugx(3, "Ending sock_read() on a good note: try to use command:"); + for (size_t numarg = 0; numarg < conn->ctx.numargs; numarg++) + upsdebugx(3, "\targ %" PRIuSIZE ": %s", numarg, conn->ctx.arglist[numarg]); if (!sock_arg(conn)) { log_unknown(conn->ctx.numargs, conn->ctx.arglist); send_to_one(conn, "ERR UNKNOWN\n"); @@ -732,6 +778,11 @@ static int sock_read(conn_t *conn) return 1; /* we did some work */ } + upsdebugx(6, "sock_read() from fd %d returned nothing " + "(maybe still collecting the command line); " + "errno=%d: %s", + conn->fd, errno, strerror(errno)); + return 0; /* fell out without parsing anything */ } @@ -762,19 +813,64 @@ static void start_daemon(TYPE_FD lockfd) /* child */ - close(0); - close(1); - close(2); + /* make fds 0-2 (typically) point somewhere defined */ +#ifdef HAVE_DUP2 + /* system can close (if needed) and (re-)open a specific FD number */ + if (1) { /* scoping */ + TYPE_FD devnull = open("/dev/null", O_RDWR); + if (devnull < 0) + fatal_with_errno(EXIT_FAILURE, "open /dev/null"); + + if (dup2(devnull, STDIN_FILENO) != STDIN_FILENO) + fatal_with_errno(EXIT_FAILURE, "re-open /dev/null as STDIN"); + if (dup2(devnull, STDOUT_FILENO) != STDOUT_FILENO) + fatal_with_errno(EXIT_FAILURE, "re-open /dev/null as STDOUT"); + + if (nut_debug_level) { + upsdebugx(1, "Keeping stderr open due to debug verbosity %d", nut_debug_level); + } else { + if (dup2(devnull, STDERR_FILENO) != STDERR_FILENO) + fatal_with_errno(EXIT_FAILURE, "re-open /dev/null as STDERR"); + } - /* make fds 0-2 point somewhere defined */ - if (open("/dev/null", O_RDWR) != 0) - fatal_with_errno(EXIT_FAILURE, "open /dev/null"); + close(devnull); + } +#else +# ifdef HAVE_DUP + /* opportunistically duplicate to the "lowest-available" FD number */ + close(STDIN_FILENO); + if (open("/dev/null", O_RDWR) != STDIN_FILENO) + fatal_with_errno(EXIT_FAILURE, "re-open /dev/null as STDIN"); + + close(STDOUT_FILENO); + if (dup(STDIN_FILENO) != STDOUT_FILENO) + fatal_with_errno(EXIT_FAILURE, "dup /dev/null as STDOUT"); + + if (nut_debug_level) { + upsdebugx(1, "Keeping stderr open due to debug verbosity %d", nut_debug_level); + } else { + close(STDERR_FILENO); + if (dup(STDIN_FILENO) != STDERR_FILENO) + fatal_with_errno(EXIT_FAILURE, "dup /dev/null as STDERR"); + } +# else + close(STDIN_FILENO); + if (open("/dev/null", O_RDWR) != STDIN_FILENO) + fatal_with_errno(EXIT_FAILURE, "re-open /dev/null as STDIN"); - if (dup(0) == -1) - fatal_with_errno(EXIT_FAILURE, "dup"); + close(STDOUT_FILENO); + if (open("/dev/null", O_RDWR) != STDOUT_FILENO) + fatal_with_errno(EXIT_FAILURE, "re-open /dev/null as STDOUT"); - if (dup(0) == -1) - fatal_with_errno(EXIT_FAILURE, "dup"); + if (nut_debug_level) { + upsdebugx(1, "Keeping stderr open due to debug verbosity %d", nut_debug_level); + } else { + close(STDERR_FILENO); + if (open("/dev/null", O_RDWR) != STDERR_FILENO) + fatal_with_errno(EXIT_FAILURE, "re-open /dev/null as STDERR"); + } +# endif +#endif pipefd = open_sock(); @@ -789,8 +885,15 @@ static void start_daemon(TYPE_FD lockfd) close(lockfd); /* now watch for activity */ + upsdebugx(2, "Timer daemon waiting for connections on pipefd %d", + pipefd); for (;;) { + int zero_reads = 0, total_reads = 0; + struct timeval start, now; + + gettimeofday(&start, NULL); + /* wait at most 1s so we can check our timers regularly */ tv.tv_sec = 1; tv.tv_usec = 0; @@ -810,7 +913,6 @@ static void start_daemon(TYPE_FD lockfd) ret = select(maxfd + 1, &rfds, NULL, NULL, &tv); if (ret > 0) { - if (FD_ISSET(pipefd, &rfds)) conn_add(pipefd); @@ -820,10 +922,15 @@ static void start_daemon(TYPE_FD lockfd) tmpnext = tmp->next; if (FD_ISSET(tmp->fd, &rfds)) { - if (sock_read(tmp) < 0) { + total_reads++; + ret = sock_read(tmp); + if (ret < 0) { + upsdebugx(3, "closing connection on fd %d", tmp->fd); close(tmp->fd); conn_del(tmp); } + if (ret == 0) + zero_reads++; } tmp = tmpnext; @@ -831,6 +938,30 @@ static void start_daemon(TYPE_FD lockfd) } checktimers(); + + /* upsdebugx(6, "zero_reads=%d total_reads=%d", zero_reads, total_reads); */ + if (zero_reads && zero_reads == total_reads) { + /* Catch run-away loops - that is, consider + * throttling the cycle as to not hog CPU: + * did select() spend its second to reply, + * or had something to say immediately? + * Note that while select() may have changed + * "tv" to deduct the time waited, our further + * processing loops could eat some more time. + * So we just check the difference of "start" + * and "now". If we did spend a substantial + * part of the second, do not delay further. + */ + double d; + gettimeofday(&now, NULL); + d = difftimeval(now, start); + upsdebugx(6, "difftimeval() => %f sec", d); + if (d > 0 && d < 0.2) { + d = (1.0 - d) * 1000000.0; + upsdebugx(5, "Enforcing a throttling sleep: %f usec", d); + usleep(d); + } + } } #else /* WIN32 */ @@ -905,6 +1036,7 @@ static void start_daemon(TYPE_FD lockfd) else { if( tmp != NULL) { if (sock_read(tmp) < 0) { + upsdebugx(3, "closing connection on handle %p", tmp->fd); CloseHandle(tmp->fd); conn_del(tmp); } @@ -1355,7 +1487,7 @@ static void help(const char *arg_progname) printf("Practical behavior is managed by UPSNAME and NOTIFYTYPE envvars\n"); printf("\nUsage: %s [OPTIONS]\n\n", arg_progname); - printf(" -D raise debugging level\n"); + printf(" -D raise debugging level (NOTE: keeps reporting when daemonized)\n"); printf(" -V display the version of this software\n"); printf(" -h display this help\n"); @@ -1409,7 +1541,7 @@ int main(int argc, char **argv) notify_type = getenv("NOTIFYTYPE"); if ((!upsname) || (!notify_type)) { - printf("Error: UPSNAME and NOTIFYTYPE must be set.\n"); + printf("Error: environment variables UPSNAME and NOTIFYTYPE must be set.\n"); printf("This program should only be run from upsmon.\n"); exit(EXIT_FAILURE); } @@ -1417,8 +1549,10 @@ int main(int argc, char **argv) /* see if this matches anything in the config file */ /* This is actually the processing loop: * checkconf -> conf_arg -> parse_at -> sendcmd -> daemon if needed + * -> start_daemon -> conn_add(pipefd) or sock_read(conn) */ checkconf(); + upsdebugx(1, "Exiting upssched (CLI process)"); exit(EXIT_SUCCESS); } diff --git a/common/common.c b/common/common.c index 38383e401b..0864f28b23 100644 --- a/common/common.c +++ b/common/common.c @@ -659,6 +659,38 @@ const char *xbasename(const char *file) return p + 1; } +/* Based on https://www.gnu.org/software/libc/manual/html_node/Calculating-Elapsed-Time.html + * modified for a syntax similar to difftime() + */ +double difftimeval(struct timeval x, struct timeval y) +{ + struct timeval result; + double d; + + /* Code below assumes that tv_sec is signed (time_t), + * but tv_usec is not necessarily */ + /* Perform the carry for the later subtraction by updating y. */ + if (x.tv_usec < y.tv_usec) { + intmax_t numsec = (y.tv_usec - x.tv_usec) / 1000000 + 1; + y.tv_usec -= 1000000 * numsec; + y.tv_sec += numsec; + } + + if (x.tv_usec - y.tv_usec > 1000000) { + intmax_t numsec = (x.tv_usec - y.tv_usec) / 1000000; + y.tv_usec += 1000000 * numsec; + y.tv_sec -= numsec; + } + + /* Compute the time remaining to wait. + * tv_usec is certainly positive. */ + result.tv_sec = x.tv_sec - y.tv_sec; + result.tv_usec = x.tv_usec - y.tv_usec; + + d = 0.000001 * result.tv_usec + result.tv_sec; + return d; +} + #if defined(HAVE_CLOCK_GETTIME) && defined(HAVE_CLOCK_MONOTONIC) && HAVE_CLOCK_GETTIME && HAVE_CLOCK_MONOTONIC /* From https://github.com/systemd/systemd/blob/main/src/basic/time-util.c * and https://github.com/systemd/systemd/blob/main/src/basic/time-util.h @@ -678,6 +710,8 @@ typedef uint64_t nsec_t; #define NSEC_PER_MSEC ((nsec_t) 1000000ULL) #define NSEC_PER_USEC ((nsec_t) 1000ULL) +# if defined(WITH_LIBSYSTEMD) && (WITH_LIBSYSTEMD) && !(defined(WITHOUT_LIBSYSTEMD) && (WITHOUT_LIBSYSTEMD)) && defined(HAVE_SD_NOTIFY) && (HAVE_SD_NOTIFY) +/* Limited to upsnotify() use-cases below, currently */ static usec_t timespec_load(const struct timespec *ts) { assert(ts); @@ -692,6 +726,8 @@ static usec_t timespec_load(const struct timespec *ts) { (usec_t) ts->tv_nsec / NSEC_PER_USEC; } +/* Not used, currently -- maybe later */ +/* static nsec_t timespec_load_nsec(const struct timespec *ts) { assert(ts); @@ -703,6 +739,37 @@ static nsec_t timespec_load_nsec(const struct timespec *ts) { return (nsec_t) ts->tv_sec * NSEC_PER_SEC + (nsec_t) ts->tv_nsec; } +*/ +# endif /* WITH_LIBSYSTEMD && HAVE_SD_NOTIFY && !WITHOUT_LIBSYSTEMD */ + +double difftimespec(struct timespec x, struct timespec y) +{ + struct timespec result; + double d; + + /* Code below assumes that tv_sec is signed (time_t), + * but tv_nsec is not necessarily */ + /* Perform the carry for the later subtraction by updating y. */ + if (x.tv_nsec < y.tv_nsec) { + intmax_t numsec = (y.tv_nsec - x.tv_nsec) / 1000000000L + 1; + y.tv_nsec -= 1000000000L * numsec; + y.tv_sec += numsec; + } + + if (x.tv_nsec - y.tv_nsec > 1000000) { + intmax_t numsec = (x.tv_nsec - y.tv_nsec) / 1000000000L; + y.tv_nsec += 1000000000L * numsec; + y.tv_sec -= numsec; + } + + /* Compute the time remaining to wait. + * tv_nsec is certainly positive. */ + result.tv_sec = x.tv_sec - y.tv_sec; + result.tv_nsec = x.tv_nsec - y.tv_nsec; + + d = 0.000000001 * result.tv_nsec + result.tv_sec; + return d; +} #endif /* HAVE_CLOCK_GETTIME && HAVE_CLOCK_MONOTONIC */ /* Send (daemon) state-change notifications to an @@ -716,14 +783,18 @@ int upsnotify(upsnotify_state_t state, const char *fmt, ...) char msgbuf[LARGEBUF]; size_t msglen = 0; -#if defined(HAVE_CLOCK_GETTIME) && defined(HAVE_CLOCK_MONOTONIC) && HAVE_CLOCK_GETTIME && HAVE_CLOCK_MONOTONIC +#if defined(WITH_LIBSYSTEMD) && (WITH_LIBSYSTEMD) && !(defined(WITHOUT_LIBSYSTEMD) && (WITHOUT_LIBSYSTEMD)) +# ifdef HAVE_SD_NOTIFY +# if defined(HAVE_CLOCK_GETTIME) && defined(HAVE_CLOCK_MONOTONIC) && HAVE_CLOCK_GETTIME && HAVE_CLOCK_MONOTONIC /* In current systemd, this is only used for RELOADING/READY after * a reload action for Type=notify-reload; for more details see * https://github.com/systemd/systemd/blob/main/src/core/service.c#L2618 */ struct timespec monoclock_ts; int got_monoclock = clock_gettime(CLOCK_MONOTONIC, &monoclock_ts); -#endif /* HAVE_CLOCK_GETTIME && HAVE_CLOCK_MONOTONIC */ +# endif /* HAVE_CLOCK_GETTIME && HAVE_CLOCK_MONOTONIC */ +# endif /* HAVE_SD_NOTIFY */ +#endif /* WITH_LIBSYSTEMD */ /* Prepare the message (if any) as a string */ msgbuf[0] = '\0'; diff --git a/common/state.c b/common/state.c index 519e7a1ff7..6eaf18ab6c 100644 --- a/common/state.c +++ b/common/state.c @@ -35,6 +35,8 @@ #include "state.h" #include "parseconf.h" +/* internal helpers */ + static void val_escape(st_tree_t *node) { char etmp[ST_MAX_VALUE_LEN]; @@ -128,6 +130,65 @@ static void st_tree_node_add(st_tree_t **nptr, st_tree_t *sptr) *nptr = sptr; } +static int st_tree_node_refresh_timestamp(const st_tree_t *node) +{ + if (!node) + return -1; + + return state_get_timestamp((st_tree_timespec_t *)&node->lastset); +} + +/* interface */ + +/* As underlying system methods: + * return 0 on success, -1 and errno on error + */ +int state_get_timestamp(st_tree_timespec_t *now) +{ + if (!now) + return -1; + +#if defined(HAVE_CLOCK_GETTIME) && defined(HAVE_CLOCK_MONOTONIC) && HAVE_CLOCK_GETTIME && HAVE_CLOCK_MONOTONIC + return clock_gettime(CLOCK_MONOTONIC, now); +#else + return gettimeofday(now, NULL); +#endif +} + +/* Returns -1 if the node->lastset is "older" than cutoff, + * 0 if it is equal, or +1 if it is newer. + * Returns -2 or -3 if node or cutoff are null. + */ +int st_tree_node_compare_timestamp( + const st_tree_t *node, + const st_tree_timespec_t *cutoff +) { + double d; + + if (!node) + return -2; + + if (!cutoff) + return -3; + + /* Like in difftime(), the first arg is "finish" and + * the second arg is "start" of a time range (below), + * so if the diff is negative, then "lastset" happened + * before "cutoff": + */ +#if defined(HAVE_CLOCK_GETTIME) && defined(HAVE_CLOCK_MONOTONIC) && HAVE_CLOCK_GETTIME && HAVE_CLOCK_MONOTONIC + d = difftimespec(node->lastset, *cutoff); +#else + d = difftimeval(node->lastset, *cutoff); +#endif + + if (d < 0) + return -1; + if (d > 0) + return 1; + return 0; +} + /* remove a variable from a tree * except for variables with ST_FLAG_IMMUTABLE * (for override.* to survive) per issue #737 @@ -167,7 +228,46 @@ int state_delinfo(st_tree_t **nptr, const char *var) return 0; /* not found */ } -/* interface */ +int state_delinfo_olderthan(st_tree_t **nptr, const char *var, const st_tree_timespec_t *cutoff) +{ + while (*nptr) { + + st_tree_t *node = *nptr; + + if (strcasecmp(node->var, var) > 0) { + nptr = &node->left; + continue; + } + + if (strcasecmp(node->var, var) < 0) { + nptr = &node->right; + continue; + } + + if (node->flags & ST_FLAG_IMMUTABLE) { + upsdebugx(6, "%s: not deleting immutable variable [%s]", __func__, var); + return 0; + } + + if (st_tree_node_compare_timestamp(node, cutoff) >= 0) { + upsdebugx(6, "%s: not deleting recently updated variable [%s]", __func__, var); + return 0; + } + upsdebugx(6, "%s: deleting variable [%s] last updated too long ago", __func__, var); + + /* whatever is on the left, hang it off current right */ + st_tree_node_add(&node->right, node->left); + + /* now point the parent at the old right child */ + *nptr = node->right; + + st_tree_node_free(node); + + return 1; + } + + return 0; /* not found */ +} int state_setinfo(st_tree_t **nptr, const char *var, const char *val) { @@ -185,6 +285,9 @@ int state_setinfo(st_tree_t **nptr, const char *var, const char *val) continue; } + /* refresh even if "skip-writing" same info value */ + st_tree_node_refresh_timestamp(node); + /* updating an existing entry */ if (!strcasecmp(node->raw, val)) { return 0; /* no change */ @@ -214,6 +317,7 @@ int state_setinfo(st_tree_t **nptr, const char *var, const char *val) (*nptr)->var = xstrdup(var); (*nptr)->raw = xstrdup(val); (*nptr)->rawsize = strlen(val) + 1; + st_tree_node_refresh_timestamp(*nptr); val_escape(*nptr); @@ -261,6 +365,7 @@ int state_addenum(st_tree_t *root, const char *var, const char *val) /* smooth over any oddities in the enum value */ pconf_encode(val, enc, sizeof(enc)); + st_tree_node_refresh_timestamp(sttmp); return st_tree_enum_add(&sttmp->enum_list, enc); } @@ -309,6 +414,7 @@ int state_addrange(st_tree_t *root, const char *var, const int min, const int ma return 0; /* failed */ } + st_tree_node_refresh_timestamp(sttmp); return st_tree_range_add(&sttmp->range_list, min, max); } @@ -326,6 +432,7 @@ int state_setaux(st_tree_t *root, const char *var, const char *auxs) return -1; /* failed */ } + st_tree_node_refresh_timestamp(sttmp); aux = strtol(auxs, (char **) NULL, 10); /* silently ignore matches */ @@ -422,6 +529,7 @@ void state_setflags(st_tree_t *root, const char *var, size_t numflags, char **fl return; } + st_tree_node_refresh_timestamp(sttmp); sttmp->flags = 0; for (i = 0; i < numflags; i++) { @@ -562,6 +670,7 @@ int state_delenum(st_tree_t *root, const char *var, const char *val) return 0; } + st_tree_node_refresh_timestamp(sttmp); return st_tree_del_enum(&sttmp->enum_list, val); } @@ -599,6 +708,7 @@ int state_delrange(st_tree_t *root, const char *var, const int min, const int ma return 0; } + st_tree_node_refresh_timestamp(sttmp); return st_tree_del_range(&sttmp->range_list, min, max); } diff --git a/configure.ac b/configure.ac index 8108e989a0..4c276269c8 100644 --- a/configure.ac +++ b/configure.ac @@ -12,7 +12,7 @@ dnl primarily for better messaging in the script itself. dnl If the NUT codebase in this workspace is being developed and rebuilt dnl without reconfiguration, detailed version in the binaries will differ. (command -v git >/dev/null 2>/dev/null) \ -&& NUT_SOURCE_GITREV="`git describe --tags 2>/dev/null | sed -e 's/^v\([0-9]\)/\1/' -e 's,^.*/,,'`" \ +&& NUT_SOURCE_GITREV="`(git describe --tags --match 'v[0-9]*.[0-9]*.[0-9]' --exclude '*-signed' --exclude '*rc*' --exclude '*alpha*' --exclude '*beta*' 2>/dev/null || git describe --tags --exclude '*rc*' --exclude '*alpha*' --exclude '*beta*' --exclude '*Windows*' --exclude '*IPM*' 2>/dev/null ) | sed -e 's/^v\([0-9]\)/\1/' -e 's,^.*/,,'`" \ || NUT_SOURCE_GITREV="" dnl Note: except for experiments, do not pass this into config.h - use @@ -863,7 +863,7 @@ AC_CACHE_CHECK([for clock_gettime(CLOCK_MONOTONIC,ts)], ], [struct timespec monoclock_ts; int got_monoclock = clock_gettime(CLOCK_MONOTONIC, &monoclock_ts); -if (ts.tv_sec < 0 || ts.tv_nsec < 0) return 1])], +if (monoclock_ts.tv_sec < 0 || monoclock_ts.tv_nsec < 0) return 1])], [ac_cv_func_clock_gettime=yes], [ac_cv_func_clock_gettime=no] )]) AS_IF([test x"${ac_cv_func_clock_gettime}" = xyes], @@ -1560,6 +1560,12 @@ dnl installing these features or not. dnl Note: more for tests than other reasons, there is also an option dnl value to "force" the installation. +dnl The gettext "msgfmt" tool (or equivalent) can be used to maintain +dnl human-language text translations. Currently this is used specifically +dnl in the Python NUT-Monitor app sources (*.po => *.mo conversions). +AC_PATH_PROGS([MSGFMT], [msgfmt], [none]) +AM_CONDITIONAL([HAVE_MSGFMT], [test "x${MSGFMT}" != "xnone"]) + dnl ---------------------------------------------------------------------- dnl checks related to --with-serial diff --git a/data/html/header.html.in b/data/html/header.html.in index 6e222a5b1e..53e4778226 100644 --- a/data/html/header.html.in +++ b/data/html/header.html.in @@ -13,7 +13,7 @@ Network UPS Tools - +
diff --git a/data/html/index.html b/data/html/index.html index 953cc376ce..15cff115d2 100644 --- a/data/html/index.html +++ b/data/html/index.html @@ -2,7 +2,7 @@ -Network UPS Tools -- http://www.networkupstools.org +Network UPS Tools -- https://www.networkupstools.org diff --git a/docs/FAQ.txt b/docs/FAQ.txt index 805e175f9b..a04d1d29f2 100644 --- a/docs/FAQ.txt +++ b/docs/FAQ.txt @@ -141,7 +141,7 @@ wandered off, one can be built rather easily with some connectors and cable -- there's no fancy wiring or resistors. See this URL for a handy diagram: -http://www.networkupstools.org/cables/940-0024C.jpg +https://www.networkupstools.org/cables/940-0024C.jpg There is also a text version of that diagram in the docs/cables directory of the NUT source distribution. Either one should allow @@ -581,7 +581,7 @@ There are several driver to support USB models. Refer to the 'driver-name' (8) man page for more information. You can also consult the Hardware Compatibility List (HCL) and filter on USB: -http://www.networkupstools.org/stable-hcl.html?connection=USB +https://www.networkupstools.org/stable-hcl.html?connection=USB == My USB UPS has a bogus Vendor ID 0x0001 and Product ID 0x0000, what driver supports it? @@ -736,7 +736,7 @@ Or a variation like... == I can't run this because there's no package for it. Why isn't this in a package yet? Sorry, can't help you there. All official releases are source code -and are posted on http://www.networkupstools.org/ along with PGP +and are posted on https://www.networkupstools.org/ along with PGP signatures for verification. This means all packages have been built by a third party. If you diff --git a/docs/Makefile.am b/docs/Makefile.am index f602ce4d64..e05aae8bf2 100644 --- a/docs/Makefile.am +++ b/docs/Makefile.am @@ -274,7 +274,7 @@ if HAVE_ASPELL SPELLCHECK_SRC = $(ALL_TXT_SRC) ../README ../INSTALL.nut ../UPGRADING ../NEWS \ ../TODO ../scripts/ufw/README ../scripts/augeas/README ../lib/README \ ../tools/nut-scanner/README \ - ../AUTHORS ../COPYING ../LICENSE-GPL2 ../LICENSE-GPL3 + ../AUTHORS ../COPYING ../LICENSE-GPL2 ../LICENSE-GPL3 ../LICENSE-DCO # Directory SPELLCHECK_SRC files are relative to. Overriden by other Makefiles. SPELLCHECK_DIR = $(srcdir) diff --git a/docs/asciidoc.conf b/docs/asciidoc.conf index fedf952a37..10a6487efa 100644 --- a/docs/asciidoc.conf +++ b/docs/asciidoc.conf @@ -48,7 +48,7 @@ endif::chunked_format[] # FIXME: linkdoc does not support 'anchor' ifdef::pdf_format[] [linkman-inlinemacro] -{target}{0?({0})} +{target}{0?({0})} [linkdoc-inlinemacro] {1} endif::pdf_format[] diff --git a/docs/config-prereqs.txt b/docs/config-prereqs.txt index 43d33802f9..ebecf9f1ec 100644 --- a/docs/config-prereqs.txt +++ b/docs/config-prereqs.txt @@ -141,6 +141,15 @@ metadata about recently published package revisions: # :; apt-get install python3 python3.9 # You can find a list of what is (pre-)installed with: # :; dpkg -l | grep -Ei 'perl|python' +# +# For localization maintenance (currently in Python NUT-Monitor app), +# provide an `msgfmt` implementation, e.g.: +# :; apt-get install gettext +# +# To install the Python NUT-Monitor app, you may need some modules: +# :; apt-get install pip +# For Python3: +# :; python3 -m pip install PyQt5 configparser # For spell-checking, highly recommended if you would propose pull requests: :; apt-get install \ diff --git a/docs/developers.txt b/docs/developers.txt index 763e3498a3..5ff7db481e 100644 --- a/docs/developers.txt +++ b/docs/developers.txt @@ -434,8 +434,8 @@ Integrated Development Environments (IDEs) and debugging NUT ------------------------------------------------------------ Much of NUT has been coded using classic editors of developers' preference, -like `vi`, `nano`, Midnight Commander `mcedit`, NotePad++ and tools like -`meld` or WinMerge for file comparison and merge. +like `vi`, `nano`, Midnight Commander `mcedit`, `gedit`/`pluma`, NotePad++ +and tools like `meld` or WinMerge for file comparison and merge. Modern IDEs however do offer benefits, specifically for live debugging sessions in a more convenient fashion than with command-line `gdb` directly. @@ -443,7 +443,9 @@ They also simplify writing AsciiDoc files with real-time rendering support. NOTE: Due to use of `libtool` wrappers in "autotools" driven projects, it may be tricky to attach the debugger (mixing the correct `LD_LIBRARY_PATH` -or equivalent with a binary under a `.libs` subdirectory). +or equivalent with a binary under a `.libs` subdirectory; on some platforms +you may be better off copying shared objects to the directory with the binary +being tested). IDEs that were tested to work with NUT development and real-time debugger tracing include: @@ -453,37 +455,370 @@ tracing include: * Apache NetBeans 17 on Windows with MSYS2 support (as MinGW toolkit); * Visual Studio Code (VSCode) on Windows with MSYS2 support. +Some supporting maintenance and development is doable with IntelliJ IDEA, +making some things easier to do than with a simple Notepad, but it does +not handle C/C++ development as such. + IDE notes on Windows ~~~~~~~~~~~~~~~~~~~~ +General settings for builds on Windows +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + When working in a native Windows environment with link:https://www.msys2.org/[MSYS2] (providing MinGW x64 among other things), -make sure it is in the `PATH`: Control Panel => "Edit the system environment -variables" => "Environment variables..." (button) => Edit or create New "Path" -setting => Make sure `C:\msys64\mingw64\bin` is there (assuming you installed -MSYS2 into `C:\msys64` by default). Restart the IDE (if already running) for -it to acknowledge the system configuration change. - -Otherwise, NetBeans for example claims there is no shell for it to run `make`, -and fails to start the built programs due to lack of DLL files it linked -against (such as `libssl` for networked part of the codebase). +you may need to ensure certain environment variables are set before you start +the IDE (shortcuts and wrappers that start your console apply them via shell). + +WARNING: If you set such environment variables system-wide for your user +profile (or wrap the IDE start-up by a script to set them), it may compromise +your ability to use *other* MSYS2 profiles and/or other builds of these +toolkits (packaged by e.g. Git for Windows or PERL for Windows projects) +generally, or in the same IDE session, respectively. +You may want to do this in a dedicated user account! + +Examples below assume you installed MSYS2 into `C:\msys64` (by default) and +are using the "MinGW X64" profile for GCC builds (nuances may differ for +32-bit, CLANG, UCRT and other profile variants). + +Also keep in mind that not all dependencies and tools involved in a +fully-fledged NUT build are easily available or usable on Windows (e.g. +the spell checker). See the link:config-prereqs.txt[] for better detailed +package lists for different operating systems including Windows, and feel +welcome to post pull requests with suggestions about new tool-chains that +might fare better than those already tried and documented. + +* Make sure its tools are in the `PATH`: ++ +Control Panel => "Edit the system environment variables" => + "Environment variables..." (button) => + "Edit..." or create "New..." `Path` setting ("User variable" level suffices) => + +** Make sure `C:\msys64\mingw64\bin` and `C:\msys64\usr\bin` are both there. +** Depending on further installed toolkits, you may want to add + `C:\Program Files\Git\cmd` or `C:\Program Files\Microsoft VS Code\bin` + (preferably use deployment-dependent spellings without white-space like + `Progra~1` to err on the safe side of variable expansions later). + +* Make sure that MSYS2 (and tools which integrate with it) know its home: ++ +Open Environment variables window as above, and + "Edit..." or create "New..." `MSYS_HOME` setting => + Set to `C:\msys64\mingw64\bin` +* Restart the IDE (if already running) for it to acknowledge the system + configuration change. + +Otherwise, NetBeans for example claims there is no shell for it to run `make` +or open Terminal pane windows, and fails to start the built programs due to +lack of DLL files they were linked against (such as `libssl` usually needed +for any networked part of the codebase). You might still have to fiddle with DLL files built in other directories of the NUT project, when preparing to debug certain programs, e.g. for `dummy-ups` -you may need to: -```` +testing you may need to: +------ :; cp ./clients/.libs/libupsclient-6.dll ./drivers/.libs/ -```` +------ + +To ensure builds with debug symbols, you may add `CFLAGS` and `CXXFLAGS` set +to `-g3 -gdwarf-2` or similar to `configure` options, or if that confuses +the cross-build (it tends to assume those values are part of GCC path), +you may have to hack them into your local copy of `configure.ac`, after the +`AM_INIT_AUTOMAKE([subdir-objects])` line: +------ +CFLAGS="$CFLAGS -g3 -gdwarf-2" +CXXFLAGS="$CXXFLAGS -g3 -gdwarf-2" +------ +...and re-run the `./autogen.sh` script. + +GDB on Windows +^^^^^^^^^^^^^^ + +Examples below assume that whichever IDE you are using, the primary goal is +to debug some issues with NUT on that platform. + +This may require you to craft a configuration file for the GNU Debugger, +e.g. `C:\Users\abuild\.gdbinit` for the examples below. One is not required +however, and may be missing. + +Another thing to keep in mind is that with `libtool` involved, the actual +binary for testing would be in a `.libs` subdirectory and you may have some +fun with ensuring that DLLs are found to start them -- see the notes above. + +NetBeans on Windows +^^^^^^^^^^^^^^^^^^^ + +When you install newer link:https://netbeans.apache.org/[Apache NetBeans] +releases (14, 17 as of this writing), you may need to enable the use of +"NetBeans 8.2 Plugin Portal" (check under Tools/Plugins/Settings) and +install the "C/C++" plugin only available there at the moment. +In turn, that older build of a plugin package may require that your system +provides the `unpack200(.exe)` tool which was shipped with JDK11 or older +(you may have to install that just to get the tool, or copy its binary from +another system). + +Under Tools/Options menu open the C/C++ tab and further its Build Tools sub-tab. + +NOTE: NetBeans allows you to easily define different Tool Collections, +including those associated with a different build host (accessible over SSH +and source/build paths optionally shared over NFS or similar technology, or +copied over). This allows you to run the IDE on your desktop while debugging +a build running on a server or embedded system. + +Make sure you have a MinGW Tool Collection for the "localhost" build host with +such settings as: + +|=== +| Option name | Sample value + +| Family | GNU MinGW +| Encoding | UTF-8 +| Base Directory | `C:\msys64\mingw64\bin` +| C Compiler | `C:\msys64\mingw64\bin\gcc.exe` +| C++ Compiler | `C:\msys64\mingw64\bin\g++.exe` +| Assembler | `C:\msys64\mingw64\bin\as.exe` +| Make Command | `C:\msys64\usr\bin\make.exe` +| Debugger Command | `C:\msys64\mingw64\bin\gdb.exe` +|=== + +In the Code Assistance sub-tab check that there are toolkit-specific and +general include paths, e.g. both C and C++ Compiler settings might involve: + +|=== +| `C:\msys64\mingw64\lib\gcc\x86_64-w64-mingw32\12.2.0\include` +| `C:\msys64\mingw64\include` +| `C:\msys64\mingw64\lib\gcc\x86_64-w64-mingw32\12.2.0\include-fixed` +| `C:\msys64\mingw64\x86_64-w64-mingw32\include` +|=== + +On top of that, C++ Compiler settings may include: + +|=== +| `C:\msys64\mingw64\include\12.2.0` +| `C:\msys64\mingw64\include\12.2.0\x86_64-w64-mingw32` +| `C:\msys64\mingw64\include\12.2.0\backward` +|=== + +In the "Other" sub-tab, set default standards to C99 and C++11 to match common +NUT codebase expectations. + +Finally, open/create a "nut" project pointing to your git checkout workspace. + +Next part of configuration regards build/debug configurations, which you can +find on the toolbar or as File / Project Properties. + +The main configuration for debugging a particular binary (and NUT has tons +of those, good luck in case you want to debug several simultaneously) is +in the *Run* and *Debug* categories. You may want to define different +Configuration profiles to track the individual Run/Debug settings for +different tested binaries, while the Build/Make settings would remain the same. +Alternatively, you may set the *Make* category's "Build Result" as the path to +the binary you would test, and use `${OUTPUT_PATH}` variable as its name in +the "Run Command" (still likely need custom arguments) and "Symbol File" below. + +When you investigate interactions of two or more programs, but only want to +debug (step through) just one of them, you are advised to run each of the +others from a dedicated terminal session, and just bump their debug verbosity. + +* In the *Build* category, set the Build Host (localhost) and Tool Collection + (MinGW). In expert part of the settings, un-check "platform-independent" + and revise that the `TOOLS_PATH=C:\msys64\mingw64\bin` while the + `UTILITIES_PATH=C:\msys64\usr\bin`. + +* In the *Pre-Build* category likely keep the Working Directory as `.` and + the `Pre-Build First` generally unchecked (so only enable it to reconfigure + the project, which takes time and is not needed for every rebuild iteration), + but you may still pre-set the Command line to something like the following + (on one line): ++ +------ +bash -c "rm -f configure Makefile; ./autogen.sh && + ./configure CC='${IDE_CC}' CXX='${IDE_CXX}' + --with-all=auto --with-docs=skip" +------ ++ +In some cases, NOT specifying the `CC`, `CXX` and the flags actually succeeds +while passing their options fails the configuration ("Compiler can not create +executables" etc.) probably due to path resolution issues between the native +and MinGW environments. ++ +NOTE: In practice, you may have an easier time using NUT `./ci_build.sh` helper or +running a more specific `./autogen.sh && ./configure ...` spell similar to +the above example or customized otherwise, in the MinGW x64 console window +to actually configure a NUT source code setup, than to maintain one via the IDE. +Running (re-)builds with the IDE (as you just edit non-recipe sources and +iterate with a debugger) using externally configured Makefiles works fine. + +* In the *Make* category you may want to customize for parallelized builds on + multi-CPU systems with something like: +** Build Command: `${MAKE} -j 6 -f Makefile` +** Clean Command: `${MAKE} -f Makefile clean` + +* In the *Run* category you should set the "Run Command" to point to your + binary (note the `.libs` sub-directory, and see comments above regarding + possibly needed copies of shared objects) and its arguments (all on one + line), e.g.: ++ +------ +C:\Users\abuild\Desktop\nut\drivers\.libs\usbhid-ups.exe -s ups -x port=auto + -d1 -DDDDDD +------ ++ +Other useful settings may be to keep "Build First" checked, and if the +"Internal Terminal" does not work for you as the debugged program's console -- +set the "Console Type" to "External Terminal" of type "Command Window". +Unfortunately, NetBeans on Windows may have issues running terminal tabs +unless CygWin is installed. + +* In the *Debug* category you should set the "Symbol File" to point to your + tested binary (e.g. `C:\Users\abuild\Desktop\nut\drivers\.libs\usbhid-ups.exe` + to match the "Run Command" example above) and specify "Follow Fork Mode" as + "child" and "Detach On Fork" as "off". "Reverse Debugging" may be useful too + in some situations. Finally, select your "Gdb Init File" if you have one, + e.g. `C:\Users\abuild\.gdbinit`. + +Microsoft VS Code +^^^^^^^^^^^^^^^^^ + +With this IDE you can benefit from numerous Extensions from its Marketplace, +the ones found useful for NUT development and debugging include: + +* AsciiDoc (by asciidoctor) +* EditorConfig for VS Code (by EditorConfig) +* C/C++ (by Microsoft) +* C/C++ Extension pack (by Microsoft) +* Makefile tool (by Microsoft) +* MSYS2/Cygwin/MinGW/Clang support (by okhlybov) +* Native Debug (GDB, LLDB ... Debugger support; by WebFreak) + +Configurations are tracked locally in JSON files where you would need to add +some entries. Examples below highlight the needed keys and values; your files +may have others: + +* `.vscode/launch.json` (can create one via Run/Add Configuration... menu + defines ways to launch the debug session for a program: ++ +------ +{ + "configurations": [ + { + "name": "CPPDBG GDB usbhid-ups", + "type": "cppdbg", + "request": "launch", + "program": "C:\\Users\\abuild\\Desktop\\nut\\drivers\\.libs\\usbhid-ups.exe", + "additionalSOLibSearchPath": "C:\\Users\\abuild\\Desktop\\nut\\.inst\\mingw64\\bin", + "stopAtConnect": true, + "args": ["-s", "ups", "-DDDDDD", "-d1", "-x", "port=auto"], + "stopAtEntry": false, + "cwd": "C:\\Users\\abuild\\Desktop\\nut", + "environment": [], + "externalConsole": false, + "MIMode": "gdb", + "miDebuggerPath": "C:\\msys64\\mingw64\\bin\\gdb.exe", + "targetArchitecture": "x64", + "setupCommands": [ + { + "description": "Enable pretty-printing for gdb", + "text": "-enable-pretty-printing", + "ignoreFailures": true + }, + { + "description": "Set Disassembly Flavor to Intel", + "text": "-gdb-set disassembly-flavor intel", + "ignoreFailures": true + } + ], + "preLaunchTask": "make usbhid-ups" + }, + { + // Alternately with LLDB (clang), the rest looks like above: + "name": "CPPDBG LLDB usbhid-ups", + "MIMode": "lldb", + "miDebuggerPath": "C:\\msys64\\usr\\bin\\lldb.exe", + }, + ... + ] +} +------ + +* `.vscode/tasks.json` defines other tasks, such as the `preLaunchTask` + mentioned above (assuming you have configured the build externally in + the MinGW x64 terminal session): ++ +------ +{ + "tasks": [ + { + "type": "shell", + "label": "make usbhid-ups", + "command": "C:\\msys64\\usr\\bin\\make usbhid-ups", + "options": { + "cwd": "${workspaceFolder}/drivers" + }, + "problemMatcher": [ + "$gcc" + ], + "group": { + "kind": "build", + "isDefault": true + } + }, + ... + ] +} +------ + +* `.vscode/c_cpp_properties.json` defines general compiler settings, e.g.: ++ +------ +{ + "configurations": [ + { + "name": "Win32", + "includePath": [ + "${workspaceFolder}/**", + "C:\\msys64\\mingw64\\include\\libusb-1.0", + "C:\\msys64\\mingw64\\include", + "C:\\msys64\\usr\\include" + ], + "defines": [ + "_DEBUG", + "UNICODE", + "_UNICODE" + ], + "compilerPath": "C:\\msys64\\mingw64\\bin\\gcc.exe", + "cStandard": "c99", + "cppStandard": "c++11", + "intelliSenseMode": "windows-gcc-x64", + "configurationProvider": "ms-vscode.makefile-tools" + } + ], + "version": 4 +} +------ -//////// -TODO: Expand on adding include and library paths to NetBeans on Windows. -Plugins: unpack200 from JDK11 or older to install NB8.2 repo C/C++ plugins. -TODO: Expand on tools.json and launcher.json in VSCode on Windows +IntelliJ IDEA +^^^^^^^^^^^^^ -TODO: Expand on envvars settings for MSYS to be callable on Windows -(e.g. avoid NetBeans claims of missing shell). +It is worth mentioning IntelliJ IDEA as another free (as of Community Edition) +and popular IDE, however it is of limited use for NUT development. +Its ecosystem does feature a good AsciiDoc plugin, Python and of course the +Java/Groovy support, so IDEA is helpful for maintenance of NUT documentation, +helper scripts and CI recipes. + +It lacks however C/C++ language support (allegedly a different product in the +IntelliJ portfolio is dedicated to that), so for the core NUT project sources +it is just a fancy text editor (with `.editorconfig` support) without syntax +highlighting or codebase cross-reference aids, build/run/debug support, etc. + +Still, it is possible to run builds and tests in embedded or external terminal +session -- so it is not worse than editing with legacy tools, and navigation +or code-base-wide search is arguably easier. + +//////// +TODO: Make note of settings (and Run as Administrator) to use symlinks in MinGW x64. Check if required for sane (iterative re-)builds? ;) //////// @@ -965,6 +1300,43 @@ You may notice that some older commits have `[[SVN:####]]` tags and Fossil-ID footers. These were lifted from the old SVN commit messages using reposurgeon, and should *not* be used as a guide for future commits. +Commit sign-off +--------------- + +Please also note that since 2023 we explicitly ask for contributions to be +"Signed Off" according to "Developer Certificate of Origin" as represented +in the `LICENSE-DCO` file in the root of NUT source tree (verbatim copy of +Version 1.1 of DCO published at https://developercertificate.org/ web site). +This is exactly the same one created and used by the Linux kernel developers. + +This is a developer's certification that he or she has the right to submit +the patch for inclusion into the project. Simply submitting a contribution +implies this agreement, however, please include a "Signed-off-by" tag in +every patch (this tag is a conventional way to confirm that you agree to +the DCO). In other words, this tag certifies that committer has the rights +to submit this work under the same license as the project and agrees to the +terms of a Developer Certificate of Origin. + +Note that while git commit hook tricks are available to automatically sign +off all commits, these signatures are intended to be a conscious (legally +meaningful) act -- hence they are not automated in git core with an easy +configuration option. + +For more details see: + +* https://github.com/networkupstools/nut/issues/1994 +* https://stackoverflow.com/questions/1962094/what-is-the-sign-off-feature-in-git-for +* https://stackoverflow.com/questions/15015894/git-add-signed-off-by-line-using-format-signoff-not-working + +You are also encouraged to set up a PGP key, make its public part known, and +use it to sign your git commits (in addition to the `Signed-Off-By` tag) by +also passing a `-S` option or calling `git config commit.gpgsign true` once. +Numerous public articles can walk you through this ordeal, including: + +* https://docs.github.com/en/authentication/managing-commit-signature-verification/signing-commits +* https://docs.github.com/en/authentication/managing-commit-signature-verification/telling-git-about-your-signing-key +* https://www.kernel.org/doc/html/v4.19/process/maintainer-pgp-guide.html + Repository etiquette and quality assurance ------------------------------------------ @@ -1015,11 +1387,11 @@ Here is an example workflow: # Hack away git add changed-file.c - git commit + git commit -s # Fix a typo in a file or commit message: - git commit -a --amend + git commit -s -a --amend # Someone committed something to the central repository. Fetch it. diff --git a/docs/documentation.txt b/docs/documentation.txt index 2a855b9f01..6f5b8035d0 100644 --- a/docs/documentation.txt +++ b/docs/documentation.txt @@ -12,7 +12,7 @@ ifdef::website[] - NUT User Manual (link:docs/user-manual.chunked/index.html[online]) (link:docs/user-manual.pdf[PDF]) - Cables information (link:cables.html[online]) (link:docs/cables.pdf[PDF]) - link:docs/man/index.html#User_man[User manual pages] -- link:ddl/index.html#_supported_devices[Devices Dumps Library (DDL)]: Provides information on how devices are supported +- link:ddl/index.html#_supported_devices[Devices Dumps Library (DDL)]: Provides information on how devices are supported; see also link:stable-hcl.html[the HCL] - link:docs/solaris-usb.html[Notes on NUT monitoring of USB devices in Solaris and related operating systems] endif::website[] ifndef::website[] @@ -20,10 +20,11 @@ ifndef::website[] - linkdoc:user-manual[NUT user manual] - <> - link:../man/index.html#User_man[User manual pages] -- link:http://www.networkupstools.org/ddl/index.html#_supported_devices[Devices Dumps Library (DDL)]: Provides information on how devices are supported +- link:https://www.networkupstools.org/ddl/index.html#_supported_devices[Devices Dumps Library (DDL)]: Provides information on how devices are supported; see also link:https://www.networkupstools.org/stable-hcl.html[the HCL] - link:../solaris-usb.html[Notes on NUT monitoring of USB devices in Solaris and related operating systems] endif::website[] - link:https://github.com/networkupstools/ConfigExamples/releases/latest[NUT Configuration Examples] book maintained by Roger Price +- link:https://github.com/networkupstools/nut/wiki[NUT GitHub Wiki] Developer Documentation ----------------------- @@ -42,7 +43,7 @@ ifndef::website[] - link:ups-protocols.html[UPS protocols library] - link:../man/index.html#Developer_man[Developer manual pages] - link:nut-qa.html[NUT Quality Assurance] -- link:http://www.networkupstools.org/ddl/index.html[Devices Dumps Library (DDL)]: Provides simulation data to the linkman:dummy-ups[8] driver +- link:https://www.networkupstools.org/ddl/index.html[Devices Dumps Library (DDL)]: Provides simulation data to the linkman:dummy-ups[8] driver endif::website[] Data dumps for the DDL diff --git a/docs/download.txt b/docs/download.txt index 8cd0fc252a..a605ef7dcb 100644 --- a/docs/download.txt +++ b/docs/download.txt @@ -12,7 +12,7 @@ You should always use PGP/GPG to verify the signatures before using any source c You can use the ifdef::website[] -link:docs/user-manual.chunked/ar01s09.html#verifySourceSig[following procedure] +link:docs/user-manual.chunked/ar01s10.html#verifySourceSig[following procedure] endif::website[] ifndef::website[] <>. @@ -23,14 +23,14 @@ to do so. Stable tree: {tree_version} ~~~~~~~~~~~~~~~~~~~~~~~~~~~ -- link:http://www.networkupstools.org/source/{tree_version}/nut-{revision}.tar.gz[nut-{revision}.tar.gz] -- link:http://www.networkupstools.org/source/{tree_version}/nut-{revision}.tar.gz.sig[PGP/GPG signature] -- link:http://www.networkupstools.org/source/{tree_version}/nut-{revision}.tar.gz.sha256[SHA-256 sum] -- link:http://www.networkupstools.org/source/{tree_version}/nut-{revision}.tar.gz.md5[MD5 sum] -- link:http://www.networkupstools.org/source/{tree_version}/new-{revision}.txt[Release notes] -- link:http://www.networkupstools.org/source/{tree_version}/ChangeLog[ChangeLog] +- link:https://www.networkupstools.org/source/{tree_version}/nut-{revision}.tar.gz[nut-{revision}.tar.gz] +- link:https://www.networkupstools.org/source/{tree_version}/nut-{revision}.tar.gz.sig[PGP/GPG signature] +- link:https://www.networkupstools.org/source/{tree_version}/nut-{revision}.tar.gz.sha256[SHA-256 sum] +- link:https://www.networkupstools.org/source/{tree_version}/nut-{revision}.tar.gz.md5[MD5 sum] +- link:https://www.networkupstools.org/source/{tree_version}/new-{revision}.txt[Release notes] +- link:https://www.networkupstools.org/source/{tree_version}/ChangeLog[ChangeLog] -You can also browse the link:http://www.networkupstools.org/source/{tree_version}/[stable source directory]. +You can also browse the link:https://www.networkupstools.org/source/{tree_version}/[stable source directory]. Development tree: ~~~~~~~~~~~~~~~~~ @@ -107,7 +107,7 @@ latest *[tarball]* link towards the top of the page, and be sure to check the Older versions ~~~~~~~~~~~~~~ -link:http://www.networkupstools.org/source/[Browse source directory] +link:https://www.networkupstools.org/source/[Browse source directory] Binary packages @@ -165,7 +165,7 @@ link:https://github.com/networkupstools/nut/wiki/Links-to-distribution-packaging - Windows (complete port, Beta): - * link:http://www.networkupstools.org/package/windows/NUT-Installer-2.6.5-6.msi[Windows MSI installer 2.6.5-6] + * link:https://www.networkupstools.org/package/windows/NUT-Installer-2.6.5-6.msi[Windows MSI installer 2.6.5-6] Java packages @@ -175,10 +175,10 @@ Java packages link:https://github.com/networkupstools/jNut[GitHub repository]. - NUT Java support (client side, Beta) - link:http://www.networkupstools.org/package/java/jNut-0.2-SNAPSHOT.tar.gz[jNUT 0.2-SNAPSHOT] + link:https://www.networkupstools.org/package/java/jNut-0.2-SNAPSHOT.tar.gz[jNUT 0.2-SNAPSHOT] - NUT Java Web support (client side using REST, Beta) - link:http://www.networkupstools.org/package/java/jNutWebAPI-0.2-SNAPSHOT-src.tar.gz[jNutWebAPI 0.2-SNAPSHOT (sources)] + link:https://www.networkupstools.org/package/java/jNutWebAPI-0.2-SNAPSHOT-src.tar.gz[jNutWebAPI 0.2-SNAPSHOT (sources)] Virtualization packages ----------------------- @@ -186,7 +186,25 @@ Virtualization packages VMware ~~~~~~ -- NUT client 2.7.4 for ESXi 5.0, 5.1, 5.5 and 6.0 (offsite, René Garcia) - - * link:http://rene.margar.fr/2012/05/client-nut-pour-esxi-5-0/[blog entry (French)] - * link:http://rene.margar.fr/downloads/NutClient-ESXi500-1.4.0.tar.gz[VIB package (v1.4.0)] +- NUT client for VMware ESXi (several versions of both; offsite, by René Garcia). + Since the hypervisor manager environment lacks access to hardware ports, this + package only includes the `upsmon` client integration, and a NUT server must + run in a VM with passed-through ports. ++ +See link:https://github.com/networkupstools/nut/wiki/NUT-and-VMware-(ESXi)[NUT + and VMware (ESXi) page on NUT Wiki] for more community-contributed details. ++ +Note that the VIB package versioning is independent of NUT or VMware versions, + they are however mentioned in downloadable file names. As of this writing, + there are builds spanning VMware ESXi 5.0-8.0 and NUT 2.7.4-2.8.0. ++ +WARNING: This module is provided "as is" and is not approved by VMware, +you may lose VMware support if you install it. Use it at your own risks. + + * link:https://github.com/rgc2000/NutClient-ESXi[GitHub repository with build recipes], + including link:https://github.com/rgc2000/NutClient-ESXi/releases[binary releases] + * link:https://rene.margar.fr/2012/05/client-nut-pour-esxi-5-0/[Original blog entry (French)] + * link:https://rene.margar.fr/2012/05/client-nut-pour-esxi-5-0/comment-page-22/#comment-13325[Historic + details of the recipe evolution] + * link:https://rene.margar.fr/downloads/NutClient-ESXi500-1.4.0.tar.gz[VIB package + (in fact automatically redirects to latest build)] diff --git a/docs/features.txt b/docs/features.txt index 631bdbcac5..502e7fc88b 100644 --- a/docs/features.txt +++ b/docs/features.txt @@ -5,7 +5,7 @@ NUT provides many features, and is always improving. Thus this list may lag behind the current code. Features frequently appear during the development cycles, so be sure to look at -the link:http://www.networkupstools.org/download.html[release notes and change logs] +the link:https://www.networkupstools.org/download.html[release notes and change logs] to see the latest additions. //////////////////////////////////////////////////////////////////////////////// @@ -18,7 +18,7 @@ More and more appliances manufacturers are bundling NUT... Multiple manufacturer and device support ---------------------------------------- -- Monitors many UPS, PDU, ATS, PSU and SCD models from more than 140 +- Monitors many UPS, PDU, ATS, PSU and SCD models from more than 170 manufacturers with a unified interface (link:stable-hcl.html[Hardware Compatibility List]). @@ -26,7 +26,7 @@ manufacturers with a unified interface common interface: * serial, * USB, - * network (SNMP, Eaton / MGE XML/HTTP). + * network (SNMP, Eaton / MGE XML/HTTP, IPMI). Multiple architecture support ----------------------------- @@ -38,7 +38,7 @@ common set of tools, even crossing architectures. Apple's OS X, commercial Solaris and open-source illumos distros, IRIX, HP/UX, Tru64 Unix, and AIX. -- Windows users may be able to build it directly with Cygwin. +- Windows users may be able to build it directly with MSYS2, MinGW or Cygwin. There is also a port of the client-side monitoring to Windows called WinNUT. - Your system will probably run it too. You just need a good C compiler and diff --git a/docs/hid-subdrivers.txt b/docs/hid-subdrivers.txt index 731fdcfa38..253bb2cab3 100644 --- a/docs/hid-subdrivers.txt +++ b/docs/hid-subdrivers.txt @@ -324,7 +324,7 @@ Typical troubleshooting of suspected firmware/protocol issues goes like this: the first step above, and run it through HIDRDD * Look at the HIDRDD output, with reference to any documents related to your device and the USB/HID power devices class available in NUT documentation, - e.g. at https://networkupstools.org/ups-protocols.html + e.g. at https://www.networkupstools.org/ups-protocols.html * Especially look for inconsistencies in the USB HID report descriptors (RD): * between the min/max (logical and physical) values, * the sizes of the report fields they apply to, diff --git a/docs/history.txt b/docs/history.txt index 4db0a359e3..633e6b2c71 100644 --- a/docs/history.txt +++ b/docs/history.txt @@ -350,7 +350,7 @@ attached to exploits.org is not going to work. The solution was to register a new domain and set up mirrors. There are two initial web servers, with more on the way. The main project URL has changed -from `http://www.exploits.org/nut/` to http://www.networkupstools.org. +from `http://www.exploits.org/nut/` to https://www.networkupstools.org. The actual content is hosted on various mirrors which are updated regularly with rsync, so the days of dribbling bits through my DSL should be over. diff --git a/docs/maintainer-guide.txt b/docs/maintainer-guide.txt index 62269bbe94..ea5d5e6794 100644 --- a/docs/maintainer-guide.txt +++ b/docs/maintainer-guide.txt @@ -82,6 +82,9 @@ SANDBOX (to be completed and pushed) * update version to (ex: 2.7.3) in nut/configure.ac * create a GPG-signed tag v (ex: v2.7.3) +** try to avoid adding signed tags later (ex. v2.8.0-signed) to avoid the + mess in GitHub release URLs (or do amend that post-factum), for more + details see e.g. https://github.com/networkupstools/nut/issues/1971 * `make dist` * maybe update nut/configure.ac version to .1 (ex: 2.7.3.1) * push commits and tag diff --git a/docs/man/Makefile.am b/docs/man/Makefile.am index ac12283aea..e5f79bbaf7 100644 --- a/docs/man/Makefile.am +++ b/docs/man/Makefile.am @@ -190,6 +190,7 @@ SRC_DEV_PAGES = \ nutscan_init.txt \ nutscan_get_serial_ports_list.txt \ libupsclient-config.txt \ + sockdebug.txt \ skel.txt if WITH_MANS @@ -314,10 +315,14 @@ upscli_sendline_timeout.3: upscli_sendline.3 MAN1_DEV_PAGES = \ libupsclient-config.1 + +MAN8_DEV_PAGES = \ + sockdebug.8 endif if WITH_DEV man3_MANS = $(MAN3_DEV_PAGES) +man8_MANS += $(MAN8_DEV_PAGES) if !WITH_PKG_CONFIG man1_MANS = $(MAN1_DEV_PAGES) @@ -371,6 +376,7 @@ HTML_DEV_MANS = \ nutscan_get_serial_ports_list.html \ nutscan_init.html \ libupsclient-config.html \ + sockdebug.html \ skel.html @@ -693,6 +699,7 @@ MAN_MANS += \ $(MAN8_CGI_PAGES) \ $(MAN1_DEV_PAGES) \ $(MAN3_DEV_PAGES) \ + $(MAN8_DEV_PAGES) \ $(MAN_SERIAL_PAGES) \ $(MAN_SNMP_PAGES) \ $(MAN_USB_LIBUSB_PAGES) \ diff --git a/docs/man/adelsystem_cbi.txt b/docs/man/adelsystem_cbi.txt index e8d1bd9e03..5cbe3d45c1 100644 --- a/docs/man/adelsystem_cbi.txt +++ b/docs/man/adelsystem_cbi.txt @@ -107,5 +107,5 @@ linkman:nutupsdrv[8], linkman:ups.conf[5] Internet resources: ~~~~~~~~~~~~~~~~~~~ -* The NUT (Network UPS Tools) home page: http://www.networkupstools.org/ +* The NUT (Network UPS Tools) home page: https://www.networkupstools.org/ * libmodbus home page: http://libmodbus.org diff --git a/docs/man/al175.txt b/docs/man/al175.txt index 7ba616b730..c6a9b1da6d 100644 --- a/docs/man/al175.txt +++ b/docs/man/al175.txt @@ -80,4 +80,4 @@ linkman:nutupsdrv[8] Internet resources: ~~~~~~~~~~~~~~~~~~~ -The NUT (Network UPS Tools) home page: http://www.networkupstools.org/ +The NUT (Network UPS Tools) home page: https://www.networkupstools.org/ diff --git a/docs/man/apcsmart-old.txt b/docs/man/apcsmart-old.txt index 6ca4cffe35..200dffe351 100644 --- a/docs/man/apcsmart-old.txt +++ b/docs/man/apcsmart-old.txt @@ -40,7 +40,7 @@ definition described below. If your 940-0024C cable is broken or missing, use this diagram to build a clone: -http://www.networkupstools.org/cables/940-0024C.jpg +https://www.networkupstools.org/cables/940-0024C.jpg EXTRA ARGUMENTS --------------- @@ -106,4 +106,4 @@ linkman:nutupsdrv[8] Internet resources: ~~~~~~~~~~~~~~~~~~~ -The NUT (Network UPS Tools) home page: http://www.networkupstools.org/ +The NUT (Network UPS Tools) home page: https://www.networkupstools.org/ diff --git a/docs/man/apcsmart.txt b/docs/man/apcsmart.txt index 9a314519e0..09ba08e011 100644 --- a/docs/man/apcsmart.txt +++ b/docs/man/apcsmart.txt @@ -94,7 +94,7 @@ definition described below. If your 940-xx24X cable is broken or missing, use this diagram to build a clone: -http://www.networkupstools.org/cables.html#_940_0024c_clone +https://www.networkupstools.org/cables.html#_940_0024c_clone NOTE: The "xx" is either "00" for a short cable, or the number of feet of a longer cable. The "X" is a letter representing the minor revision @@ -409,6 +409,6 @@ linkman:solis[8] Internet resources: ~~~~~~~~~~~~~~~~~~~ -The NUT (Network UPS Tools) home page: http://www.networkupstools.org/ +The NUT (Network UPS Tools) home page: https://www.networkupstools.org/ // vim: tw=80 ai si ts=8 sts=4 sw=4 et : diff --git a/docs/man/apcupsd-ups.txt b/docs/man/apcupsd-ups.txt index 74f2b164c5..83af59d8ac 100644 --- a/docs/man/apcupsd-ups.txt +++ b/docs/man/apcupsd-ups.txt @@ -111,5 +111,5 @@ linkman:nutupsdrv[8] Internet Resources: ~~~~~~~~~~~~~~~~~~~ -* The NUT (Network UPS Tools) home page: http://www.networkupstools.org/ +* The NUT (Network UPS Tools) home page: https://www.networkupstools.org/ * The apcupsd home page: http://www.apcupsd.org/ diff --git a/docs/man/asem.txt b/docs/man/asem.txt index 838ddafc70..277a3279de 100644 --- a/docs/man/asem.txt +++ b/docs/man/asem.txt @@ -87,4 +87,4 @@ Internet resources: * PB1300 specifications: http://www.asem.it/en/products/industrial-automation/box-pcs/performance/pb1300/ * BQ2060 datasheet: http://www.ti.com/lit/ds/symlink/bq2060.pdf -* The NUT (Network UPS Tools) home page: http://www.networkupstools.org/ +* The NUT (Network UPS Tools) home page: https://www.networkupstools.org/ diff --git a/docs/man/bcmxcp.txt b/docs/man/bcmxcp.txt index 303d404132..b9ca0e61d2 100644 --- a/docs/man/bcmxcp.txt +++ b/docs/man/bcmxcp.txt @@ -97,4 +97,4 @@ linkman:bcmxcp_usb[8] Internet resources: ~~~~~~~~~~~~~~~~~~~ -The NUT (Network UPS Tools) home page: http://www.networkupstools.org/ +The NUT (Network UPS Tools) home page: https://www.networkupstools.org/ diff --git a/docs/man/bcmxcp_usb.txt b/docs/man/bcmxcp_usb.txt index 4906be1c30..5151a1885d 100644 --- a/docs/man/bcmxcp_usb.txt +++ b/docs/man/bcmxcp_usb.txt @@ -133,4 +133,4 @@ linkman:nutupsdrv[8] Internet resources: ~~~~~~~~~~~~~~~~~~~ -The NUT (Network UPS Tools) home page: http://www.networkupstools.org/ +The NUT (Network UPS Tools) home page: https://www.networkupstools.org/ diff --git a/docs/man/belkin.txt b/docs/man/belkin.txt index 57e032042d..5db6d91560 100644 --- a/docs/man/belkin.txt +++ b/docs/man/belkin.txt @@ -61,4 +61,4 @@ linkman:usbhid-ups[8] Internet resources: ~~~~~~~~~~~~~~~~~~~ -The NUT (Network UPS Tools) home page: http://www.networkupstools.org/ +The NUT (Network UPS Tools) home page: https://www.networkupstools.org/ diff --git a/docs/man/belkinunv.txt b/docs/man/belkinunv.txt index 0bbbb7710c..dd6424e894 100644 --- a/docs/man/belkinunv.txt +++ b/docs/man/belkinunv.txt @@ -356,8 +356,8 @@ linkman:usbhid-ups[8] Internet resources: ~~~~~~~~~~~~~~~~~~~ -* The NUT (Network UPS Tools) home page: http://www.networkupstools.org/ +* The NUT (Network UPS Tools) home page: https://www.networkupstools.org/ * The documentation for the protocol used by this UPS: link:http://www.mscs.dal.ca/~selinger/ups/belkin-universal-ups.html[belkin-universal-ups.html] - (link:https://networkupstools.org/protocols/belkin-universal.html[replica + (link:https://www.networkupstools.org/protocols/belkin-universal.html[replica on NUT site]) diff --git a/docs/man/bestfcom.txt b/docs/man/bestfcom.txt index cc40c2be31..7309cebb29 100644 --- a/docs/man/bestfcom.txt +++ b/docs/man/bestfcom.txt @@ -45,4 +45,4 @@ linkman:nutupsdrv[8] Internet resources: ~~~~~~~~~~~~~~~~~~~ -The NUT (Network UPS Tools) home page: http://www.networkupstools.org/ +The NUT (Network UPS Tools) home page: https://www.networkupstools.org/ diff --git a/docs/man/bestfortress.txt b/docs/man/bestfortress.txt index d2b7ef6f4b..5593619cf7 100644 --- a/docs/man/bestfortress.txt +++ b/docs/man/bestfortress.txt @@ -55,4 +55,4 @@ linkman:bestups[8], linkman:bestuferrups[8], linkman:bestfcom[8] Internet resources: ~~~~~~~~~~~~~~~~~~~ -The NUT (Network UPS Tools) home page: http://www.networkupstools.org/ +The NUT (Network UPS Tools) home page: https://www.networkupstools.org/ diff --git a/docs/man/bestuferrups.txt b/docs/man/bestuferrups.txt index cfe857db89..33059090ac 100644 --- a/docs/man/bestuferrups.txt +++ b/docs/man/bestuferrups.txt @@ -42,4 +42,4 @@ linkman:nutupsdrv[8] Internet resources: ~~~~~~~~~~~~~~~~~~~ -The NUT (Network UPS Tools) home page: http://www.networkupstools.org/ +The NUT (Network UPS Tools) home page: https://www.networkupstools.org/ diff --git a/docs/man/bestups.txt b/docs/man/bestups.txt index d4287e573c..6c4561c9a1 100644 --- a/docs/man/bestups.txt +++ b/docs/man/bestups.txt @@ -133,4 +133,4 @@ linkman:nutupsdrv[8] Internet resources: ~~~~~~~~~~~~~~~~~~~ -The NUT (Network UPS Tools) home page: http://www.networkupstools.org/ +The NUT (Network UPS Tools) home page: https://www.networkupstools.org/ diff --git a/docs/man/blazer-common.txt b/docs/man/blazer-common.txt index 7124cccdaa..d9d6f99096 100644 --- a/docs/man/blazer-common.txt +++ b/docs/man/blazer-common.txt @@ -311,5 +311,5 @@ linkman:nutupsdrv[8], linkman:upsc[8], linkman:upscmd[8], linkman:upsrw[8] Internet Resources: ~~~~~~~~~~~~~~~~~~~ -* The NUT (Network UPS Tools) home page: http://www.networkupstools.org/ -* The NUT HCL: http://www.networkupstools.org/stable-hcl.html +* The NUT (Network UPS Tools) home page: https://www.networkupstools.org/ +* The NUT HCL: https://www.networkupstools.org/stable-hcl.html diff --git a/docs/man/clone.txt b/docs/man/clone.txt index 555e5c7478..b4bb54e5e7 100644 --- a/docs/man/clone.txt +++ b/docs/man/clone.txt @@ -142,4 +142,4 @@ linkman:dummy-ups[8] Internet Resources: ~~~~~~~~~~~~~~~~~~~ -The NUT (Network UPS Tools) home page: http://www.networkupstools.org/ +The NUT (Network UPS Tools) home page: https://www.networkupstools.org/ diff --git a/docs/man/dummy-ups.txt b/docs/man/dummy-ups.txt index e3ed2f656a..8ef2f555fa 100644 --- a/docs/man/dummy-ups.txt +++ b/docs/man/dummy-ups.txt @@ -128,7 +128,7 @@ linkman:upsc[8] dump (`: `). So you can easily create definition files from an existing UPS using `upsc > file.dev`. Note that the Network UPS project provides an extensive -link:https://networkupstools.org/ddl/index.html[DDL (Devices Dumps Library)] +link:https://www.networkupstools.org/ddl/index.html[DDL (Devices Dumps Library)] with files which can be used for modelling real devices. Entries for the DDL library are best prepared with the link:https://raw.githubusercontent.com/networkupstools/nut/master/tools/nut-ddl-dump.sh[`tools/nut-ddl-dump.sh`] @@ -282,4 +282,4 @@ linkman:clone[8] Internet Resources: ~~~~~~~~~~~~~~~~~~~ -The NUT (Network UPS Tools) home page: http://www.networkupstools.org/ +The NUT (Network UPS Tools) home page: https://www.networkupstools.org/ diff --git a/docs/man/etapro.txt b/docs/man/etapro.txt index 86d921286a..f5eeca0cbb 100644 --- a/docs/man/etapro.txt +++ b/docs/man/etapro.txt @@ -40,4 +40,4 @@ linkman:nutupsdrv[8] Internet resources: ~~~~~~~~~~~~~~~~~~~ -The NUT (Network UPS Tools) home page: http://www.networkupstools.org/ +The NUT (Network UPS Tools) home page: https://www.networkupstools.org/ diff --git a/docs/man/everups.txt b/docs/man/everups.txt index 7700982051..564d823587 100644 --- a/docs/man/everups.txt +++ b/docs/man/everups.txt @@ -47,4 +47,4 @@ linkman:nutupsdrv[8] Internet resources: ~~~~~~~~~~~~~~~~~~~ -The NUT (Network UPS Tools) home page: http://www.networkupstools.org/ +The NUT (Network UPS Tools) home page: https://www.networkupstools.org/ diff --git a/docs/man/gamatronic.txt b/docs/man/gamatronic.txt index 95122954ba..dcf1aafb63 100644 --- a/docs/man/gamatronic.txt +++ b/docs/man/gamatronic.txt @@ -41,4 +41,4 @@ linkman:nutupsdrv[8] Internet resources ~~~~~~~~~~~~~~~~~~ -The NUT (Network UPS Tools) home page: http://www.networkupstools.org/ +The NUT (Network UPS Tools) home page: https://www.networkupstools.org/ diff --git a/docs/man/generic_gpio.txt b/docs/man/generic_gpio.txt index 4899378706..5e859254f4 100644 --- a/docs/man/generic_gpio.txt +++ b/docs/man/generic_gpio.txt @@ -123,5 +123,5 @@ linkman:nutupsdrv[8], linkman:ups.conf[5] Internet resources: ~~~~~~~~~~~~~~~~~~~ -* The NUT (Network UPS Tools) home page: http://www.networkupstools.org/ +* The NUT (Network UPS Tools) home page: https://www.networkupstools.org/ * libgpiod home page: https://git.kernel.org/pub/scm/libs/libgpiod/libgpiod.git/ diff --git a/docs/man/generic_modbus.txt b/docs/man/generic_modbus.txt index 6041a76c8d..627474f45c 100644 --- a/docs/man/generic_modbus.txt +++ b/docs/man/generic_modbus.txt @@ -245,5 +245,5 @@ linkman:nutupsdrv[8], linkman:ups.conf[5] Internet resources: ~~~~~~~~~~~~~~~~~~~ -* The NUT (Network UPS Tools) home page: http://www.networkupstools.org/ +* The NUT (Network UPS Tools) home page: https://www.networkupstools.org/ * libmodbus home page: http://libmodbus.org diff --git a/docs/man/genericups.txt b/docs/man/genericups.txt index 54c4a6b01d..a67eb68289 100644 --- a/docs/man/genericups.txt +++ b/docs/man/genericups.txt @@ -404,4 +404,4 @@ linkman:nutupsdrv[8] Internet resources: ~~~~~~~~~~~~~~~~~~~ -The NUT (Network UPS Tools) home page: http://www.networkupstools.org/ +The NUT (Network UPS Tools) home page: https://www.networkupstools.org/ diff --git a/docs/man/hosts.conf.txt b/docs/man/hosts.conf.txt index 8d86ea8789..1bf23da3c2 100644 --- a/docs/man/hosts.conf.txt +++ b/docs/man/hosts.conf.txt @@ -37,4 +37,4 @@ linkman:upsset.cgi[8], linkman:upsstats.cgi[8], linkman:upsimage.cgi[8] Internet resources: ~~~~~~~~~~~~~~~~~~~ -The NUT (Network UPS Tools) home page: http://www.networkupstools.org/ +The NUT (Network UPS Tools) home page: https://www.networkupstools.org/ diff --git a/docs/man/huawei-ups2000.txt b/docs/man/huawei-ups2000.txt index 51418d9634..f2c0f676c0 100644 --- a/docs/man/huawei-ups2000.txt +++ b/docs/man/huawei-ups2000.txt @@ -395,7 +395,7 @@ linkman:nutupsdrv[8] Internet resources: ~~~~~~~~~~~~~~~~~~~ -* The NUT (Network UPS Tools) home page: http://www.networkupstools.org/ +* The NUT (Network UPS Tools) home page: https://www.networkupstools.org/ * Huawei UPS2000-A (1 kVA-3 kVA) User Manual: https://support.huawei.com/enterprise/en/doc/EDOC1000084260 * Huawei UPS2000 (1 kVA-3 kVA) Modbus Protocol Development Guide: diff --git a/docs/man/index.txt b/docs/man/index.txt index 65a5caf286..ad63c3dd4c 100644 --- a/docs/man/index.txt +++ b/docs/man/index.txt @@ -65,6 +65,7 @@ Developer manual pages - linkman:libupsclient-config[1] - linkman:nut-recorder[8] - linkman:skel[8] +- linkman:sockdebug[8] [[devclient]] Client library diff --git a/docs/man/isbmex.txt b/docs/man/isbmex.txt index 985f0ff429..ba7c76b8a1 100644 --- a/docs/man/isbmex.txt +++ b/docs/man/isbmex.txt @@ -40,4 +40,4 @@ linkman:nutupsdrv[8] Internet resources: ~~~~~~~~~~~~~~~~~~~ -The NUT (Network UPS Tools) home page: http://www.networkupstools.org/ +The NUT (Network UPS Tools) home page: https://www.networkupstools.org/ diff --git a/docs/man/ivtscd.txt b/docs/man/ivtscd.txt index 0696c87847..c45aafd4a4 100644 --- a/docs/man/ivtscd.txt +++ b/docs/man/ivtscd.txt @@ -39,4 +39,4 @@ linkman:nutupsdrv[8] Internet resources: ~~~~~~~~~~~~~~~~~~~ -The NUT (Network UPS Tools) home page: http://www.networkupstools.org/ +The NUT (Network UPS Tools) home page: https://www.networkupstools.org/ diff --git a/docs/man/libupsclient-config.txt b/docs/man/libupsclient-config.txt index 526276c301..1e496c7645 100644 --- a/docs/man/libupsclient-config.txt +++ b/docs/man/libupsclient-config.txt @@ -46,4 +46,4 @@ linkman:upsclient[3] Internet resources: ~~~~~~~~~~~~~~~~~~~ -The NUT (Network UPS Tools) home page: http://www.networkupstools.org/ +The NUT (Network UPS Tools) home page: https://www.networkupstools.org/ diff --git a/docs/man/liebert-esp2.txt b/docs/man/liebert-esp2.txt index 876f3a5ecd..fb6509a862 100644 --- a/docs/man/liebert-esp2.txt +++ b/docs/man/liebert-esp2.txt @@ -66,4 +66,4 @@ linkman:nutupsdrv[8] Internet resources: ~~~~~~~~~~~~~~~~~~~ -The NUT (Network UPS Tools) home page: http://www.networkupstools.org/ +The NUT (Network UPS Tools) home page: https://www.networkupstools.org/ diff --git a/docs/man/liebert.txt b/docs/man/liebert.txt index b91365989b..5798851839 100644 --- a/docs/man/liebert.txt +++ b/docs/man/liebert.txt @@ -50,4 +50,4 @@ linkman:nutupsdrv[8] Internet resources: ~~~~~~~~~~~~~~~~~~~ -The NUT (Network UPS Tools) home page: http://www.networkupstools.org/ +The NUT (Network UPS Tools) home page: https://www.networkupstools.org/ diff --git a/docs/man/macosx-ups.txt b/docs/man/macosx-ups.txt index c7140caec3..16752ca271 100644 --- a/docs/man/macosx-ups.txt +++ b/docs/man/macosx-ups.txt @@ -82,5 +82,5 @@ linkman:nutupsdrv[8] Internet resources: ~~~~~~~~~~~~~~~~~~~ -* The NUT (Network UPS Tools) home page: http://www.networkupstools.org/ +* The NUT (Network UPS Tools) home page: https://www.networkupstools.org/ * The apcupsd home page: http://www.apcupsd.org/ diff --git a/docs/man/masterguard.txt b/docs/man/masterguard.txt index 373fc2f450..69ff47c67c 100644 --- a/docs/man/masterguard.txt +++ b/docs/man/masterguard.txt @@ -58,4 +58,4 @@ linkman:nutupsdrv[8] Internet resources: ~~~~~~~~~~~~~~~~~~~ -The NUT (Network UPS Tools) home page: http://www.networkupstools.org/ +The NUT (Network UPS Tools) home page: https://www.networkupstools.org/ diff --git a/docs/man/metasys.txt b/docs/man/metasys.txt index d134fe5fc8..68d3f6dbe6 100644 --- a/docs/man/metasys.txt +++ b/docs/man/metasys.txt @@ -66,4 +66,4 @@ linkman:nutupsdrv[8] Internet resources: ~~~~~~~~~~~~~~~~~~~ -The NUT (Network UPS Tools) home page: http://www.networkupstools.org/ +The NUT (Network UPS Tools) home page: https://www.networkupstools.org/ diff --git a/docs/man/mge-shut.txt b/docs/man/mge-shut.txt index 91d96b7fa8..d558613f2e 100644 --- a/docs/man/mge-shut.txt +++ b/docs/man/mge-shut.txt @@ -96,4 +96,4 @@ linkman:nutupsdrv[8] Internet resources ~~~~~~~~~~~~~~~~~~ -The NUT (Network UPS Tools) home page: http://www.networkupstools.org/ +The NUT (Network UPS Tools) home page: https://www.networkupstools.org/ diff --git a/docs/man/mge-utalk.txt b/docs/man/mge-utalk.txt index 4dd0384b02..b287f56ba2 100644 --- a/docs/man/mge-utalk.txt +++ b/docs/man/mge-utalk.txt @@ -97,4 +97,4 @@ linkman:nutupsdrv[8] Internet resources ~~~~~~~~~~~~~~~~~~ -The NUT (Network UPS Tools) home page: http://www.networkupstools.org/ +The NUT (Network UPS Tools) home page: https://www.networkupstools.org/ diff --git a/docs/man/microdowell.txt b/docs/man/microdowell.txt index a23ead2aff..820a86695c 100644 --- a/docs/man/microdowell.txt +++ b/docs/man/microdowell.txt @@ -41,4 +41,4 @@ linkman:nutupsdrv[8] Internet resources: ~~~~~~~~~~~~~~~~~~~ -The NUT (Network UPS Tools) home page: http://www.networkupstools.org/ +The NUT (Network UPS Tools) home page: https://www.networkupstools.org/ diff --git a/docs/man/microsol-apc.txt b/docs/man/microsol-apc.txt index 74e3225445..015f9866db 100644 --- a/docs/man/microsol-apc.txt +++ b/docs/man/microsol-apc.txt @@ -70,4 +70,4 @@ linkman:nutupsdrv[8] Internet resources: ~~~~~~~~~~~~~~~~~~~ -The NUT (Network UPS Tools) home page: http://www.networkupstools.org/ +The NUT (Network UPS Tools) home page: https://www.networkupstools.org/ diff --git a/docs/man/netxml-ups.txt b/docs/man/netxml-ups.txt index acc672ee08..84e8d4f222 100644 --- a/docs/man/netxml-ups.txt +++ b/docs/man/netxml-ups.txt @@ -122,4 +122,4 @@ linkman:nutupsdrv[8] Internet resources: ~~~~~~~~~~~~~~~~~~~ -The NUT (Network UPS Tools) home page: http://www.networkupstools.org/ +The NUT (Network UPS Tools) home page: https://www.networkupstools.org/ diff --git a/docs/man/nut-driver-enumerator.txt b/docs/man/nut-driver-enumerator.txt index 6fe92dbafa..5b177d5a37 100644 --- a/docs/man/nut-driver-enumerator.txt +++ b/docs/man/nut-driver-enumerator.txt @@ -147,4 +147,4 @@ linkman:upsdrvsvcctl[8], linkman:ups.conf[5] Internet resources: ~~~~~~~~~~~~~~~~~~~ -The NUT (Network UPS Tools) home page: http://www.networkupstools.org/ +The NUT (Network UPS Tools) home page: https://www.networkupstools.org/ diff --git a/docs/man/nut-ipmipsu.txt b/docs/man/nut-ipmipsu.txt index fc6a5e4761..8cda9c28ea 100644 --- a/docs/man/nut-ipmipsu.txt +++ b/docs/man/nut-ipmipsu.txt @@ -116,5 +116,5 @@ linkman:nutupsdrv[8] Internet resources: ~~~~~~~~~~~~~~~~~~~ -* The NUT (Network UPS Tools) home page: http://www.networkupstools.org/ +* The NUT (Network UPS Tools) home page: https://www.networkupstools.org/ * GNU FreeIPMI home page: http://www.gnu.org/software/freeipmi/ diff --git a/docs/man/nut-recorder.txt b/docs/man/nut-recorder.txt index edde4ae0bb..2758844d6d 100644 --- a/docs/man/nut-recorder.txt +++ b/docs/man/nut-recorder.txt @@ -77,4 +77,4 @@ linkman:dummy-ups[8] Internet resources: ~~~~~~~~~~~~~~~~~~~ -The NUT (Network UPS Tools) home page: http://www.networkupstools.org/ +The NUT (Network UPS Tools) home page: https://www.networkupstools.org/ diff --git a/docs/man/nut-scanner.txt b/docs/man/nut-scanner.txt index cf77596bfd..e45dd51720 100644 --- a/docs/man/nut-scanner.txt +++ b/docs/man/nut-scanner.txt @@ -126,6 +126,7 @@ SNMP V3 OPTIONS *-l* | *--secLevel* 'security level':: Set the 'security level' used for SNMPv3 messages. Allowed values are: noAuthNoPriv, authNoPriv and authPriv. +This parameter is mandatory if you use non-trivial authentication. *-u* | *--secName* 'security name':: Set the 'security name' used for authenticated SNMPv3 messages. @@ -253,4 +254,4 @@ linkman:ups.conf[5] Internet resources: ~~~~~~~~~~~~~~~~~~~ -The NUT (Network UPS Tools) home page: http://www.networkupstools.org/ +The NUT (Network UPS Tools) home page: https://www.networkupstools.org/ diff --git a/docs/man/nut.conf.txt b/docs/man/nut.conf.txt index 90f7106a41..0d4930520f 100644 --- a/docs/man/nut.conf.txt +++ b/docs/man/nut.conf.txt @@ -110,4 +110,4 @@ linkman:upsmon.conf[5] Internet resources: ~~~~~~~~~~~~~~~~~~~ -The NUT (Network UPS Tools) home page: http://www.networkupstools.org/ +The NUT (Network UPS Tools) home page: https://www.networkupstools.org/ diff --git a/docs/man/nutdrv_atcl_usb.txt b/docs/man/nutdrv_atcl_usb.txt index 77bdeb6b00..66ac7c9d60 100644 --- a/docs/man/nutdrv_atcl_usb.txt +++ b/docs/man/nutdrv_atcl_usb.txt @@ -92,4 +92,4 @@ linkman:nutdrv_qx[8] (`fuji` subdriver) Internet resources: ~~~~~~~~~~~~~~~~~~~ -The NUT (Network UPS Tools) home page: http://www.networkupstools.org/ +The NUT (Network UPS Tools) home page: https://www.networkupstools.org/ diff --git a/docs/man/nutdrv_qx.txt b/docs/man/nutdrv_qx.txt index 7f0c6e2a94..71b11f1cd3 100644 --- a/docs/man/nutdrv_qx.txt +++ b/docs/man/nutdrv_qx.txt @@ -176,7 +176,7 @@ The acceptable range is +60..599940+ seconds. The acceptable range is +12..5940+ seconds. *pins_shutdown_mode =* 'value':: -Set http://www.networkupstools.org/protocols/sola.html#_shutdown_set_command[shutdown mode functionality of Pin 1 and Pin 7] on the UPS DB9 communication port (Per Best Power's EPS-0059) to 'value' [+0..6+]. +Set https://www.networkupstools.org/protocols/sola.html#_shutdown_set_command[shutdown mode functionality of Pin 1 and Pin 7] on the UPS DB9 communication port (Per Best Power's EPS-0059) to 'value' [+0..6+]. MASTERGUARD PROTOCOL @@ -820,5 +820,5 @@ linkman:upsrw[8] Internet Resources: ~~~~~~~~~~~~~~~~~~~ -* The NUT (Network UPS Tools) home page: http://www.networkupstools.org/ -* The NUT HCL: http://www.networkupstools.org/stable-hcl.html +* The NUT (Network UPS Tools) home page: https://www.networkupstools.org/ +* The NUT HCL: https://www.networkupstools.org/stable-hcl.html diff --git a/docs/man/nutdrv_siemens_sitop.txt b/docs/man/nutdrv_siemens_sitop.txt index 854a38f883..6c95c52978 100644 --- a/docs/man/nutdrv_siemens_sitop.txt +++ b/docs/man/nutdrv_siemens_sitop.txt @@ -200,4 +200,4 @@ linkman:nutupsdrv[8] Internet resources: ~~~~~~~~~~~~~~~~~~~ -The NUT (Network UPS Tools) home page: http://www.networkupstools.org/ +The NUT (Network UPS Tools) home page: https://www.networkupstools.org/ diff --git a/docs/man/nutupsdrv.txt b/docs/man/nutupsdrv.txt index 756ccf089c..38e64552a9 100644 --- a/docs/man/nutupsdrv.txt +++ b/docs/man/nutupsdrv.txt @@ -272,4 +272,4 @@ include::{builddir}/linkman-driver-names.txt[] Internet resources: ~~~~~~~~~~~~~~~~~~~ -The NUT (Network UPS Tools) home page: http://www.networkupstools.org/ +The NUT (Network UPS Tools) home page: https://www.networkupstools.org/ diff --git a/docs/man/oneac.txt b/docs/man/oneac.txt index beb257ebc7..dd38f126eb 100644 --- a/docs/man/oneac.txt +++ b/docs/man/oneac.txt @@ -128,4 +128,4 @@ linkman:nutupsdrv[8] Internet resources: ~~~~~~~~~~~~~~~~~~~ -The NUT (Network UPS Tools) home page: http://www.networkupstools.org/ +The NUT (Network UPS Tools) home page: https://www.networkupstools.org/ diff --git a/docs/man/optiups.txt b/docs/man/optiups.txt index 1e1d90417a..740bd76b28 100644 --- a/docs/man/optiups.txt +++ b/docs/man/optiups.txt @@ -96,4 +96,4 @@ linkman:nutupsdrv[8] Internet resources: ~~~~~~~~~~~~~~~~~~~ -The NUT (Network UPS Tools) home page: http://www.networkupstools.org/ +The NUT (Network UPS Tools) home page: https://www.networkupstools.org/ diff --git a/docs/man/phoenixcontact_modbus.txt b/docs/man/phoenixcontact_modbus.txt index e173089d61..a9f22cdc05 100644 --- a/docs/man/phoenixcontact_modbus.txt +++ b/docs/man/phoenixcontact_modbus.txt @@ -103,5 +103,5 @@ linkman:nutupsdrv[8] Internet resources: ~~~~~~~~~~~~~~~~~~~ -* The NUT (Network UPS Tools) home page: http://www.networkupstools.org/ +* The NUT (Network UPS Tools) home page: https://www.networkupstools.org/ * libmodbus home page: http://libmodbus.org diff --git a/docs/man/pijuice.txt b/docs/man/pijuice.txt index 801646af60..bb87607279 100644 --- a/docs/man/pijuice.txt +++ b/docs/man/pijuice.txt @@ -85,4 +85,4 @@ Internet resources: * Product home page: https://uk.pi-supply.com/products/pijuice-standard -* The NUT (Network UPS Tools) home page: http://www.networkupstools.org/ +* The NUT (Network UPS Tools) home page: https://www.networkupstools.org/ diff --git a/docs/man/powercom.txt b/docs/man/powercom.txt index db7e936f7e..84b0bebd4c 100644 --- a/docs/man/powercom.txt +++ b/docs/man/powercom.txt @@ -229,4 +229,4 @@ linkman:nutupsdrv[8] Internet resources: ~~~~~~~~~~~~~~~~~~~ -The NUT (Network UPS Tools) home page: http://www.networkupstools.org/ +The NUT (Network UPS Tools) home page: https://www.networkupstools.org/ diff --git a/docs/man/powerman-pdu.txt b/docs/man/powerman-pdu.txt index 5eeac31064..30d2fcda97 100644 --- a/docs/man/powerman-pdu.txt +++ b/docs/man/powerman-pdu.txt @@ -89,5 +89,5 @@ linkman:nutupsdrv[8] Internet resources: ~~~~~~~~~~~~~~~~~~~ -* The NUT (Network UPS Tools) home page: http://www.networkupstools.org/ +* The NUT (Network UPS Tools) home page: https://www.networkupstools.org/ * The PowerMan home page: https://github.com/chaos/powerman diff --git a/docs/man/powerpanel.txt b/docs/man/powerpanel.txt index 4e8450d0bc..861d911eea 100644 --- a/docs/man/powerpanel.txt +++ b/docs/man/powerpanel.txt @@ -156,4 +156,4 @@ linkman:snmp-ups[8] Internet resources: ~~~~~~~~~~~~~~~~~~~ -The NUT (Network UPS Tools) home page: http://www.networkupstools.org/ +The NUT (Network UPS Tools) home page: https://www.networkupstools.org/ diff --git a/docs/man/rhino.txt b/docs/man/rhino.txt index bdb30f892a..fe3ec333a8 100644 --- a/docs/man/rhino.txt +++ b/docs/man/rhino.txt @@ -62,4 +62,4 @@ linkman:nutupsdrv[8] Internet resources: ~~~~~~~~~~~~~~~~~~~ -The NUT (Network UPS Tools) home page: http://www.networkupstools.org/ +The NUT (Network UPS Tools) home page: https://www.networkupstools.org/ diff --git a/docs/man/richcomm_usb.txt b/docs/man/richcomm_usb.txt index 4ee57e6006..527f7aa805 100644 --- a/docs/man/richcomm_usb.txt +++ b/docs/man/richcomm_usb.txt @@ -63,4 +63,4 @@ linkman:genericups[8] Internet resources: ~~~~~~~~~~~~~~~~~~~ -The NUT (Network UPS Tools) home page: http://www.networkupstools.org/ +The NUT (Network UPS Tools) home page: https://www.networkupstools.org/ diff --git a/docs/man/riello_ser.txt b/docs/man/riello_ser.txt index cbc326b0a6..a9c684f51f 100644 --- a/docs/man/riello_ser.txt +++ b/docs/man/riello_ser.txt @@ -42,4 +42,4 @@ linkman:nutupsdrv[8] Internet resources ~~~~~~~~~~~~~~~~~~ -The NUT (Network UPS Tools) home page: http://www.networkupstools.org/ +The NUT (Network UPS Tools) home page: https://www.networkupstools.org/ diff --git a/docs/man/riello_usb.txt b/docs/man/riello_usb.txt index 4301894e3a..737aa499f7 100644 --- a/docs/man/riello_usb.txt +++ b/docs/man/riello_usb.txt @@ -45,4 +45,4 @@ linkman:nutupsdrv[8] Internet resources ~~~~~~~~~~~~~~~~~~ -The NUT (Network UPS Tools) home page: http://www.networkupstools.org/ +The NUT (Network UPS Tools) home page: https://www.networkupstools.org/ diff --git a/docs/man/safenet.txt b/docs/man/safenet.txt index 00aa02f929..136d2bfbbd 100644 --- a/docs/man/safenet.txt +++ b/docs/man/safenet.txt @@ -107,4 +107,4 @@ linkman:nutupsdrv[8] Internet resources: ~~~~~~~~~~~~~~~~~~~ -The NUT (Network UPS Tools) home page: http://www.networkupstools.org/ +The NUT (Network UPS Tools) home page: https://www.networkupstools.org/ diff --git a/docs/man/skel.txt b/docs/man/skel.txt index 8e310943e0..286c101dd4 100644 --- a/docs/man/skel.txt +++ b/docs/man/skel.txt @@ -126,4 +126,4 @@ linkman:nutupsdrv[8] Internet resources: ~~~~~~~~~~~~~~~~~~~ -The NUT (Network UPS Tools) home page: http://www.networkupstools.org/ +The NUT (Network UPS Tools) home page: https://www.networkupstools.org/ diff --git a/docs/man/snmp-ups.txt b/docs/man/snmp-ups.txt index a37452205e..5f94d022c7 100644 --- a/docs/man/snmp-ups.txt +++ b/docs/man/snmp-ups.txt @@ -136,6 +136,7 @@ equipment which has strangeness in the three-phase power reporting. *secLevel*='value':: Set the securityLevel used for SNMPv3 messages (default=noAuthNoPriv, allowed: authNoPriv,authPriv) +This parameter is mandatory if you use non-trivial authentication. *secName*='value':: Set the securityName used for authenticated SNMPv3 messages (no default) @@ -231,9 +232,9 @@ linkman:nutupsdrv[8] NUT SNMP Protocols Library ~~~~~~~~~~~~~~~~~~~~~~~~~~ -Available at: http://www.networkupstools.org/ups-protocols.html#_snmp +Available at: https://www.networkupstools.org/ups-protocols.html#_snmp Internet resources: ~~~~~~~~~~~~~~~~~~~ -The NUT (Network UPS Tools) home page: http://www.networkupstools.org/ +The NUT (Network UPS Tools) home page: https://www.networkupstools.org/ diff --git a/docs/man/sockdebug.txt b/docs/man/sockdebug.txt new file mode 100644 index 0000000000..f79bde71be --- /dev/null +++ b/docs/man/sockdebug.txt @@ -0,0 +1,83 @@ +SOCKDEBUG(8) +============ + +NAME +---- + +sockdebug - simple developer/troubleshooting aid utility to communicate +with a NUT driver using the socket protocol + +SYNOPSIS +-------- + +*sockdebug* socketname + +For example (WIN32 and POSIX builds): + + sockdebug.exe dummy-ups-UPS1 + +For example (POSIX-compliant systems using an alternate state path): + + sockdebug /var/state/ups/dummy-ups-UPS1 + +DESCRIPTION +----------- + +*sockdebug* is a tool built when NUT `configure --with-dev` is enabled. +It may alternatively be built by calling `make sockdebug` in the root +of the build workspace. Actual source files used depend on the platform. + +It is used to connect to a NUT driver using the socket protocol on an +Unix socket or Windows pipe, similarly to how the linkman:upsd[8] data +server talks to the locally running drivers in order to represent them +on the network further using the common NUT protocol of the Network UPS +Tools project, or how driver programs can communicate to their already +running instances to implement commands like live `reload-or-error`. + +This tool allows a developer or troubleshooter to watch the broadcast +updates emitted by the driver, as well as to issue unicast commands and +receive replies (during an interactive investigation session, you may +want to command `NOBROADCAST` first). + +For more details see the `docs/sock-protocol.txt` file in NUT sources. + +OPTIONS +------- + +*sockdebug* accepts (and requires) the following option: + +*socketname*:: +Either a full path (in POSIX builds) or the base name of device socket/pipe +(on all platforms), comprised of a `drivername-devicename` tuple, e.g. some +`dummy-ups-UPS1` for a `dummy-ups` driver instance handling an `UPS1` device +configuration (which in turn may originate in the `ups.conf` file or be +dynamically constructed for tests by calling the driver program with a +`-s TMP` CLI option). ++ +On POSIX systems, if this argument only represents a base name and not a +full path to the Unix socket file, the tool should first look for the file +in the current directory, and then fall back to configured (built-in) state +path or the value of `NUT_STATEPATH` environment variable, if set; e.g.: ++ +------ + NUT_STATEPATH=/tmp ./server/sockdebug dummy-ups-UPS1 +------ + +AUTHORS +------- + +This manual page was written by Jim Klimov . + +The program was originally written by +Russell Kroll (POSIX version), and by +Frederic Bohe (Windows version). + +SEE ALSO +-------- + +linkman:upsd[8] + +Internet resources: +~~~~~~~~~~~~~~~~~~~ + +The NUT (Network UPS Tools) home page: https://www.networkupstools.org/ diff --git a/docs/man/socomec_jbus.txt b/docs/man/socomec_jbus.txt index 0563668d56..8d0fecd552 100644 --- a/docs/man/socomec_jbus.txt +++ b/docs/man/socomec_jbus.txt @@ -160,7 +160,7 @@ linkman:nutupsdrv[8] Internet resources: ~~~~~~~~~~~~~~~~~~~ -* The NUT (Network UPS Tools) home page: http://www.networkupstools.org/ +* The NUT (Network UPS Tools) home page: https://www.networkupstools.org/ * Socomec JBUS/Modbus Reference Guide: https://www.socomec.com/files/live/sites/systemsite/files/GB-JBUS-MODBUS-for-Delphys-MP-and-Delphys-MX-operating-manual.pdf * libmodbus home page: http://libmodbus.org diff --git a/docs/man/solis.txt b/docs/man/solis.txt index 532112b25a..d5e13830ca 100644 --- a/docs/man/solis.txt +++ b/docs/man/solis.txt @@ -70,4 +70,4 @@ linkman:nutupsdrv[8] Internet resources: ~~~~~~~~~~~~~~~~~~~ -The NUT (Network UPS Tools) home page: http://www.networkupstools.org/ +The NUT (Network UPS Tools) home page: https://www.networkupstools.org/ diff --git a/docs/man/tripplite.txt b/docs/man/tripplite.txt index 9ec37f295d..8d104807fc 100644 --- a/docs/man/tripplite.txt +++ b/docs/man/tripplite.txt @@ -67,4 +67,4 @@ linkman:tripplitesu[8], linkman:tripplite_usb[8], linkman:usbhid-ups[8] Internet resources: ~~~~~~~~~~~~~~~~~~~ -The NUT (Network UPS Tools) home page: http://www.networkupstools.org/ +The NUT (Network UPS Tools) home page: https://www.networkupstools.org/ diff --git a/docs/man/tripplite_usb.txt b/docs/man/tripplite_usb.txt index 92ea4834d4..252697a52c 100644 --- a/docs/man/tripplite_usb.txt +++ b/docs/man/tripplite_usb.txt @@ -180,4 +180,4 @@ regex(7), lsusb(8) Internet resources: ~~~~~~~~~~~~~~~~~~~ -The NUT (Network UPS Tools) home page: http://www.networkupstools.org/ +The NUT (Network UPS Tools) home page: https://www.networkupstools.org/ diff --git a/docs/man/tripplitesu.txt b/docs/man/tripplitesu.txt index 9194a1229d..7272f52b39 100644 --- a/docs/man/tripplitesu.txt +++ b/docs/man/tripplitesu.txt @@ -50,4 +50,4 @@ linkman:tripplite[8], linkman:tripplite_usb[8], linkman:usbhid-ups[8] Internet resources: ~~~~~~~~~~~~~~~~~~~ -The NUT (Network UPS Tools) home page: http://www.networkupstools.org/ +The NUT (Network UPS Tools) home page: https://www.networkupstools.org/ diff --git a/docs/man/ups.conf.txt b/docs/man/ups.conf.txt index 314c2f7029..4c640d0aa0 100644 --- a/docs/man/ups.conf.txt +++ b/docs/man/ups.conf.txt @@ -319,4 +319,4 @@ linkman:upsdrvsvcctl[8] Internet resources ~~~~~~~~~~~~~~~~~~ -The NUT (Network UPS Tools) home page: http://www.networkupstools.org/ +The NUT (Network UPS Tools) home page: https://www.networkupstools.org/ diff --git a/docs/man/upsc.txt b/docs/man/upsc.txt index 2e89c5071a..1d4c8e4bda 100644 --- a/docs/man/upsc.txt +++ b/docs/man/upsc.txt @@ -118,4 +118,4 @@ linkman:upsd[8] Internet resources: ~~~~~~~~~~~~~~~~~~~ -The NUT (Network UPS Tools) home page: http://www.networkupstools.org/ +The NUT (Network UPS Tools) home page: https://www.networkupstools.org/ diff --git a/docs/man/upscmd.txt b/docs/man/upscmd.txt index b8c80d8274..b60cab9843 100644 --- a/docs/man/upscmd.txt +++ b/docs/man/upscmd.txt @@ -110,4 +110,4 @@ linkman:upsd[8], linkman:upsrw[8] Internet resources: ~~~~~~~~~~~~~~~~~~~ -The NUT (Network UPS Tools) home page: http://www.networkupstools.org/ +The NUT (Network UPS Tools) home page: https://www.networkupstools.org/ diff --git a/docs/man/upscode2.txt b/docs/man/upscode2.txt index 2044a08548..24afbacbfc 100644 --- a/docs/man/upscode2.txt +++ b/docs/man/upscode2.txt @@ -103,4 +103,4 @@ linkman:nutupsdrv[8] Internet resources: ~~~~~~~~~~~~~~~~~~~ -The NUT (Network UPS Tools) home page: http://www.networkupstools.org/ +The NUT (Network UPS Tools) home page: https://www.networkupstools.org/ diff --git a/docs/man/upsd.conf.txt b/docs/man/upsd.conf.txt index 410910e99e..8287e54a56 100644 --- a/docs/man/upsd.conf.txt +++ b/docs/man/upsd.conf.txt @@ -155,4 +155,4 @@ linkman:upsd[8], linkman:nutupsdrv[8], linkman:upsd.users[5] Internet resources: ~~~~~~~~~~~~~~~~~~~ -The NUT (Network UPS Tools) home page: http://www.networkupstools.org/ +The NUT (Network UPS Tools) home page: https://www.networkupstools.org/ diff --git a/docs/man/upsd.txt b/docs/man/upsd.txt index eb2358c301..28918c3775 100644 --- a/docs/man/upsd.txt +++ b/docs/man/upsd.txt @@ -201,4 +201,4 @@ include::{builddir}/linkman-driver-names.txt[] Internet resources: ~~~~~~~~~~~~~~~~~~~ -The NUT (Network UPS Tools) home page: http://www.networkupstools.org/ +The NUT (Network UPS Tools) home page: https://www.networkupstools.org/ diff --git a/docs/man/upsd.users.txt b/docs/man/upsd.users.txt index 6b287d02e5..2a0889f2db 100644 --- a/docs/man/upsd.users.txt +++ b/docs/man/upsd.users.txt @@ -88,5 +88,5 @@ linkman:upsd[8], linkman:upsd.conf[5] Internet resources: ~~~~~~~~~~~~~~~~~~~ -The NUT (Network UPS Tools) home page: http://www.networkupstools.org/ +The NUT (Network UPS Tools) home page: https://www.networkupstools.org/ diff --git a/docs/man/upsdrvctl.txt b/docs/man/upsdrvctl.txt index c9228fa1e3..446ed2d411 100644 --- a/docs/man/upsdrvctl.txt +++ b/docs/man/upsdrvctl.txt @@ -179,4 +179,4 @@ linkman:upsdrvsvcctl[8], linkman:nutupsdrv[8], linkman:upsd[8], linkman:ups.conf Internet resources: ~~~~~~~~~~~~~~~~~~~ -The NUT (Network UPS Tools) home page: http://www.networkupstools.org/ +The NUT (Network UPS Tools) home page: https://www.networkupstools.org/ diff --git a/docs/man/upsdrvsvcctl.txt b/docs/man/upsdrvsvcctl.txt index 97855851fc..66dacdf866 100644 --- a/docs/man/upsdrvsvcctl.txt +++ b/docs/man/upsdrvsvcctl.txt @@ -204,4 +204,4 @@ linkman:nut-driver-enumerator[8], linkman:ups.conf[5] Internet resources: ~~~~~~~~~~~~~~~~~~~ -The NUT (Network UPS Tools) home page: http://www.networkupstools.org/ +The NUT (Network UPS Tools) home page: https://www.networkupstools.org/ diff --git a/docs/man/upsimage.cgi.txt b/docs/man/upsimage.cgi.txt index bdf23b83f6..d9f6b636f7 100644 --- a/docs/man/upsimage.cgi.txt +++ b/docs/man/upsimage.cgi.txt @@ -45,5 +45,5 @@ linkman:upsd[8], linkman:upsstats.cgi[8] Internet resources: ~~~~~~~~~~~~~~~~~~~ -* The NUT (Network UPS Tools) home page: http://www.networkupstools.org/ +* The NUT (Network UPS Tools) home page: https://www.networkupstools.org/ * The gd home page: http://libgd.bitbucket.org diff --git a/docs/man/upslog.txt b/docs/man/upslog.txt index a35f89baa1..1f0b64efc0 100644 --- a/docs/man/upslog.txt +++ b/docs/man/upslog.txt @@ -47,6 +47,9 @@ within this string are: %PID%;; insert the pid of upslog %VAR varname%;; insert the value of variable varname +(see NUT developer documentation chapter "Variables" on-line or in +the `docs/nut-names.txt` file in sources of the NUT version you have +installed for more details) The default format string is: @@ -132,4 +135,4 @@ linkman:upsrw[8], linkman:upsmon[8], linkman:upssched[8] Internet resources: ~~~~~~~~~~~~~~~~~~~ -The NUT (Network UPS Tools) home page: http://www.networkupstools.org/ +The NUT (Network UPS Tools) home page: https://www.networkupstools.org/ diff --git a/docs/man/upsmon.conf.txt b/docs/man/upsmon.conf.txt index 1d4f6c3df4..2ebd18f419 100644 --- a/docs/man/upsmon.conf.txt +++ b/docs/man/upsmon.conf.txt @@ -432,4 +432,4 @@ linkman:upsmon[8], linkman:upsd[8], linkman:nutupsdrv[8]. Internet resources: ~~~~~~~~~~~~~~~~~~~ -The NUT (Network UPS Tools) home page: http://www.networkupstools.org/ +The NUT (Network UPS Tools) home page: https://www.networkupstools.org/ diff --git a/docs/man/upsmon.txt b/docs/man/upsmon.txt index dc49d97ef5..6aa35d0ba3 100644 --- a/docs/man/upsmon.txt +++ b/docs/man/upsmon.txt @@ -519,4 +519,4 @@ linkman:upsset.cgi[8], linkman:upsstats.cgi[8], linkman:upsimage.cgi[8] Internet resources: ~~~~~~~~~~~~~~~~~~~ -The NUT (Network UPS Tools) home page: http://www.networkupstools.org/ +The NUT (Network UPS Tools) home page: https://www.networkupstools.org/ diff --git a/docs/man/upsrw.txt b/docs/man/upsrw.txt index ebcd2056d1..7e93d02d1f 100644 --- a/docs/man/upsrw.txt +++ b/docs/man/upsrw.txt @@ -124,4 +124,4 @@ linkman:upsd[8], linkman:upscmd[8] Internet resources: ~~~~~~~~~~~~~~~~~~~ -The NUT (Network UPS Tools) home page: http://www.networkupstools.org/ +The NUT (Network UPS Tools) home page: https://www.networkupstools.org/ diff --git a/docs/man/upssched.conf.txt b/docs/man/upssched.conf.txt index 52a028c77d..f6ea00e457 100644 --- a/docs/man/upssched.conf.txt +++ b/docs/man/upssched.conf.txt @@ -108,4 +108,4 @@ linkman:upssched[8], linkman:upsmon[8] Internet resources: ~~~~~~~~~~~~~~~~~~~ -The NUT (Network UPS Tools) home page: http://www.networkupstools.org/ +The NUT (Network UPS Tools) home page: https://www.networkupstools.org/ diff --git a/docs/man/upssched.txt b/docs/man/upssched.txt index 3c582fc719..44cdb3d9ae 100644 --- a/docs/man/upssched.txt +++ b/docs/man/upssched.txt @@ -108,6 +108,11 @@ ENVIRONMENT VARIABLES were provided on command line, but does not request that the daemon runs in foreground mode. +NOTE: Unlike some other NUT daemons, `upssched` with enabled debug +does not stop reporting on `stderr`! It forks a background process +with the first call as an event handler, which exits soon after all +tracked timers have elapsed and were handled (if needed). + *UPSNAME* and *NOTIFYTYPE* are required, as detailed above. They are set by `upsmon` when it calls `upssched` as its choice of `NOTIFYCMD`. @@ -128,4 +133,4 @@ linkman:upsmon[8] Internet resources: ~~~~~~~~~~~~~~~~~~~ -The NUT (Network UPS Tools) home page: http://www.networkupstools.org/ +The NUT (Network UPS Tools) home page: https://www.networkupstools.org/ diff --git a/docs/man/upsset.cgi.txt b/docs/man/upsset.cgi.txt index 78912dda12..3bae6a1d5c 100644 --- a/docs/man/upsset.cgi.txt +++ b/docs/man/upsset.cgi.txt @@ -95,4 +95,4 @@ SEE ALSO Internet resources: ~~~~~~~~~~~~~~~~~~~ -The NUT (Network UPS Tools) home page: http://www.networkupstools.org/ +The NUT (Network UPS Tools) home page: https://www.networkupstools.org/ diff --git a/docs/man/upsset.conf.txt b/docs/man/upsset.conf.txt index 6fab07a7e3..cfb422928d 100644 --- a/docs/man/upsset.conf.txt +++ b/docs/man/upsset.conf.txt @@ -74,4 +74,4 @@ linkman:upsset.cgi[8] Internet resources: ~~~~~~~~~~~~~~~~~~~ -The NUT (Network UPS Tools) home page: http://www.networkupstools.org/ +The NUT (Network UPS Tools) home page: https://www.networkupstools.org/ diff --git a/docs/man/upsstats.cgi.txt b/docs/man/upsstats.cgi.txt index e79e5395ca..0c6435b539 100644 --- a/docs/man/upsstats.cgi.txt +++ b/docs/man/upsstats.cgi.txt @@ -60,4 +60,4 @@ linkman:upsimage.cgi[8] Internet resources: ~~~~~~~~~~~~~~~~~~~ -The NUT (Network UPS Tools) home page: http://www.networkupstools.org/ +The NUT (Network UPS Tools) home page: https://www.networkupstools.org/ diff --git a/docs/man/upsstats.html.txt b/docs/man/upsstats.html.txt index ec869f480a..91c4e7bf6e 100644 --- a/docs/man/upsstats.html.txt +++ b/docs/man/upsstats.html.txt @@ -233,4 +233,4 @@ linkman:upsstats.cgi[8], linkman:upsimage.cgi[8] Internet resources: ~~~~~~~~~~~~~~~~~~~ -The NUT (Network UPS Tools) home page: http://www.networkupstools.org/ +The NUT (Network UPS Tools) home page: https://www.networkupstools.org/ diff --git a/docs/man/usbhid-ups.txt b/docs/man/usbhid-ups.txt index 5a93a16925..9b86737991 100644 --- a/docs/man/usbhid-ups.txt +++ b/docs/man/usbhid-ups.txt @@ -293,4 +293,4 @@ linkman:nutupsdrv[8] Internet resources ~~~~~~~~~~~~~~~~~~ -The NUT (Network UPS Tools) home page: http://www.networkupstools.org/ +The NUT (Network UPS Tools) home page: https://www.networkupstools.org/ diff --git a/docs/man/victronups.txt b/docs/man/victronups.txt index 17be94d7aa..d51d09f9c8 100644 --- a/docs/man/victronups.txt +++ b/docs/man/victronups.txt @@ -66,4 +66,4 @@ linkman:nutupsdrv[8] Internet resources: ~~~~~~~~~~~~~~~~~~~ -The NUT (Network UPS Tools) home page: http://www.networkupstools.org/ +The NUT (Network UPS Tools) home page: https://www.networkupstools.org/ diff --git a/docs/new-clients.txt b/docs/new-clients.txt index 1b07900071..48cff0660e 100644 --- a/docs/new-clients.txt +++ b/docs/new-clients.txt @@ -40,7 +40,7 @@ functions documentation referenced in the same file. Clients like upsc are provided as examples of how to retrieve data using the upsclient functions. -link:http://www.networkupstools.org/projects.html[Other programs] not included +link:https://www.networkupstools.org/projects.html[Other programs] not included in this package may also use this library, such as wmnut. High level library: libnutclient diff --git a/docs/nut-names.txt b/docs/nut-names.txt index 12f0f526c8..af804d2ec4 100644 --- a/docs/nut-names.txt +++ b/docs/nut-names.txt @@ -18,7 +18,15 @@ as used in commands and messages between the Attachment Daemon (the `upsd` in case of NUT implementation of the standard) and the clients. ==== -This document defines the standard names of NUT commands and variables. +This document defines the standard names of NUT commands and variables +(not to be confused with <<_status_data,device status data>> described in +ifdef::website[] +another chapter). +endif::website[] +ifndef::website[] +the `docs/new-drivers.txt` in NUT source codebase). +endif::website[] + Developers should use the names recorded here, with dstate functions and data mappings provided in NUT drivers for interactions with power devices. @@ -116,7 +124,7 @@ ups: General unit information [options="header"] |=============================================================================== | Name | Description | Example value -| ups.status | UPS status | linkdoc:developer-guide[OL,_status_data] +| ups.status | UPS status | <<_status_data,OL>> | ups.alarm | UPS alarms | OVERHEAT | ups.time | Internal UPS clock time (opaque string) | 12:34 @@ -724,7 +732,7 @@ server: Internal server information |=============================================================================== | Name | Description | Example value | server.info | Server information | Network UPS Tools upsd vX.Y.Z - - http://www.networkupstools.org/ + https://www.networkupstools.org/ | server.version | Server version | X.Y.Z |=============================================================================== diff --git a/docs/nut.dict b/docs/nut.dict index eda6c51c46..21f5195b53 100644 --- a/docs/nut.dict +++ b/docs/nut.dict @@ -1,4 +1,4 @@ -personal_ws-1.1 en 3127 utf-8 +personal_ws-1.1 en 3196 utf-8 AAS ABI ACFAIL @@ -188,6 +188,7 @@ CPAN CPE CPM CPP +CPPDBG CPPFLAGS CPUs CRC @@ -233,10 +234,13 @@ Cuvellard Cyber CyberPower CyberShield +CygWin Cygwin DATACABLE DATAPATH DCE +DCF +DCO DDD DDDDD DDDDDD @@ -256,6 +260,7 @@ DF DHEA DIGYS DISCHRG +DLLs DMF DN DNS @@ -319,6 +324,7 @@ ETIME EUROCASE EXtreme Economou +EditorConfig Edlman Edmundsson Edscott @@ -427,6 +433,7 @@ Gomes Goncalves Gordeev Gough +Grafana Grafenthal Gtec GuardEnd @@ -513,6 +520,7 @@ Infosec Innova Integrators IntelCC +IntelliJ InvCDly InvCPol InvMin @@ -592,6 +600,7 @@ LINEV LISTINSTCMD LISTRW LISTVARS +LLDB LLNC LOADPCT LOCKFN @@ -638,10 +647,12 @@ MAXPARMAKES MBATTCHG MCOL MCU +MDigest MEC MEGATAEC MH MIBs +MIMode MINLINEV MINSUPPLIES MINTIMEL @@ -828,6 +839,7 @@ OnTmDays OneAC OpenBSD OpenIndiana +OpenPGP OpenSSL OpenSolaris OpenSource @@ -958,6 +970,7 @@ PresentStatus Priv Procomm ProductID +Progra Proxmox Prynych Pulizzi @@ -965,6 +978,7 @@ PwrOut PyGTK PyNUT PyNUTClient +PyQt QBDR QBT QBV @@ -1366,6 +1380,7 @@ WTU Waldie WantedBy WatchdogSec +WebFreak Werror Wextra WhizBang @@ -1433,6 +1448,7 @@ adb addcmd addenum addinfo +additionalSOLibSearchPath addr addrange addvars @@ -1493,6 +1509,7 @@ armhf asapm ascii asciidoc +asciidoctor asem aspell ast @@ -1573,6 +1590,7 @@ bestfort bestfortress bestuferrups bestups +bfe bigbox bigone bigserver @@ -1596,6 +1614,7 @@ bsv bt bti btnG +btn btt buckboosthyst buckvolts @@ -1610,6 +1629,7 @@ busybox bv bypassvolts byv +cStandard cablepower calloc cb @@ -1619,6 +1639,7 @@ cblimit ccache cd cdc +cdf centos cerr certfile @@ -1648,6 +1669,7 @@ chargermode chargetime charset checksum +checksums chgrp chipset chkconfig @@ -1689,9 +1711,12 @@ colspan command's commandlen compat +compilerPath conf config +configparser configs +configurationProvider configureaz configureaza confpath @@ -1709,7 +1734,9 @@ cout coverity cp cpp +cppStandard cppcheck +cppdbg cppnit cppunit cpqpower @@ -1734,6 +1761,7 @@ cua cuaa customizations cvt +cwd cx cyberpower d'un @@ -1775,6 +1803,7 @@ devctl devd devel deviceGetClients +devicename devscan dfl dhcp @@ -1883,6 +1912,7 @@ executables executeCommand execve extendedhistory +externalConsole extradata fabula facto @@ -1890,6 +1920,7 @@ fallthrough fatalx faultsensitivity fc +fcb fcntl fd fds @@ -1936,8 +1967,11 @@ gcpp gd gd's gdb +gdbinit gdlib +gdwarf ge +gedit genericsups genericups genesisII @@ -1954,6 +1988,7 @@ getconf getent getenv getopt +gettext getvar gitcache github @@ -1967,6 +2002,7 @@ google goto gotos gpg +gpgsign gpio gpiochip graphviz @@ -2036,7 +2072,9 @@ idm ie ietf ifdef +ifeval ifndef +ignoreFailures ignorelb ignoreoff ignoresab @@ -2045,6 +2083,7 @@ illumos im img imv +includePath includedir inductor infos @@ -2065,6 +2104,8 @@ installcheck installurl instcmd instcmds +intel +intelliSenseMode intercharacter internet interoperability @@ -2094,6 +2135,7 @@ ipmimonitoring ipmipsu ippon ipv +isDefault isbmex ish iso @@ -2118,6 +2160,7 @@ kVA kadets kaminski kde +keychain keyclick keygen keyout @@ -2202,6 +2245,7 @@ listDeviceClients listdef littleguy lk +lldb lm ln loadPercentage @@ -2247,6 +2291,7 @@ mailx maintainer's maintainership maj +makefile makevartable mandir manpage @@ -2280,6 +2325,7 @@ mge mgeups mgexml mgmt +miDebuggerPath mib mibs microcontroller @@ -2320,8 +2366,10 @@ monuser morbo mozilla msec +msgfmt msi msvcrt +msys multi multicommands multilib @@ -2433,6 +2481,7 @@ offtimedays oftd oids ok +okhlybov oksh ol oldmac @@ -2471,6 +2520,7 @@ outliers pF pacman pacstrap +parallelized param paramkeywords parsable @@ -2506,6 +2556,7 @@ pigz pijuice pinout pinouts +pipename pkg pkgconf pkgconfig @@ -2513,6 +2564,7 @@ pkgin plaintext plugin plugnplay +pluma pmset pmu png @@ -2548,6 +2600,7 @@ ppro pragma pragmas pre +preLaunchTask prepend prepended preprocess @@ -2560,6 +2613,7 @@ prgshut printf privPassword privProtocol +problemMatcher probu proc productid @@ -2598,6 +2652,7 @@ rackmount raritan ratedva ratedwatts +raquo rb rcctl readline @@ -2705,11 +2760,13 @@ setpci setpoint setq setuid +setupCommands setvar setvar's sfr sgml sgs +sha shm shutdownArguments shutdowndebounce @@ -2749,6 +2806,7 @@ snprintfcat snr socat sockdebug +socketname socomec solaris solis @@ -2774,12 +2832,15 @@ stan startIP startdelay startup +statefilepath statepath stayoff stderr stdlib stdout stdupsv +stopAtConnect +stopAtEntry stopIP str strace @@ -2802,6 +2863,7 @@ stylesheet stylesheets su subcommand +subdir subdirectories subdirectory subdriver @@ -2850,6 +2912,7 @@ tabledef tagname tapswitchdelay tapswitchphase +targetArchitecture tbody tcflush tcgetattr @@ -2882,6 +2945,7 @@ tios tmp tmpfiles tmpfs +tmpring toolchain toolkits topbot @@ -2924,6 +2988,7 @@ udev udevadm ufw ugen +uid uint ukUNV ul @@ -2935,6 +3000,7 @@ unconfigured undefine undervoltage unescaped +unicast uninstall uninterruptible uniq @@ -3054,6 +3120,7 @@ vo vod voltronic von +vscode wDescriptorLength waitbeforereconnect wakeup @@ -3062,6 +3129,7 @@ wchar webNUT webnut webserver +websitelayout wf wget whitespace @@ -3074,6 +3142,7 @@ wmnut wordformat workflow workspace +workspaceFolder workspaces writability writeinfo diff --git a/docs/security.txt b/docs/security.txt index 09c101cf4f..51a50c5fcc 100644 --- a/docs/security.txt +++ b/docs/security.txt @@ -22,31 +22,137 @@ How to verify the NUT source code signature In order to verify the NUT source code signature for releases, perform the following steps: -- Retrieve the link:http://www.networkupstools.org/download.html[NUT source code] +- Retrieve the link:https://www.networkupstools.org/download.html[NUT source code] (nut-X.Y.Z.tar.gz) and the matching signature (nut-X.Y.Z.tar.gz.sig) -- Retrieve the link:http://www.networkupstools.org/source/nut-key.gpg[NUT maintainer's signature]: +- Retrieve the link:https://www.networkupstools.org/source/nut-key.gpg[NUT +maintainer's signature keyring]: - $ gpg --fetch-keys http://www.networkupstools.org/source/nut-key.gpg + $ gpg --fetch-keys https://www.networkupstools.org/source/nut-key.gpg -NOTE: As of NUT 2.7.3, a new release key is used. In order to verify a previous -release, please use -link:http://www.networkupstools.org/source/nut-old-key.gpg[NUT old maintainer's signature] +[NOTE] +====== +As of NUT 2.8.0, a new release key is used, but the `nut-key.gpg` should +be cumulative with older chain key files (includes them). You can view the key +list in a downloaded copy of the URL above with: + + $ gpg --with-colons --import-options import-show --dry-run --import < nut-key.gpg + +...and as of this writing, it should contain two key sets for various identities +of "Arnaud Quette" and one set of "Jim Klimov". +====== + +Just in case, the previous key file used since NUT 2.7.3 release is stored as +link:https://www.networkupstools.org/source/nut-key-2.7.3.gpg[NUT +old maintainer's signature for 2.7.3-2.7.4 releases] + +In order to verify an even older release, please use +link:https://www.networkupstools.org/source/nut-old-key.gpg[NUT +old maintainer's signature since 2002 until 2.7.3 release] - Launch the GPG checking using the following command: $ gpg --verify nut-X.Y.Z.tar.gz.sig -- You should see a message mentioning a "Good signature", like: +- You should see a message mentioning a "Good signature", with formatting which + depends on your gpg version, like: + + gpg: Signature made Thu Jun 1 00:10:16 2023 CEST + ... + gpg: Good signature from "Jim Klimov ..." + ... + Primary key fingerprint: B834 59F7 76B9 0224 988F 36C0 DE01 84DA 7043 DCF7 + ... + +[NOTE] +====== +The previously used maintainer's signatures would output (with markup of +older gpg tools here): gpg: Signature made Wed Apr 15 15:55:30 2015 CEST using RSA key ID 55CA5976 gpg: Good signature from "Arnaud Quette ..." ... -NOTE: the previously used maintainer's signature would output: -+ +or: + gpg: Signature made Thu Jul 5 16:15:05 2007 CEST using DSA key ID 204DDF1B gpg: Good signature from "Arnaud Quette ..." ... +====== + +//////// +Maintainer notes for posterity: + +* See https://github.com/networkupstools/nut/issues/1963 and + https://github.com/networkupstools/nut/issues/1410 for recent + forays into this area. + +* Repo is https://github.com/networkupstools/nut-source-archive.git + +* Keys in the file can be viewed with: +---- +:; gpg --with-colons --import-options import-show --dry-run --import < nut-key.gpg +---- + +* Old keys as well as a new maintainer key can be imported first into + a temporary keyring (existing target file and a slash in its path + name argument are allegedly important): +---- +:; rm -f tmpring.gpg ; touch tmpring.gpg +:; gpg --no-default-keyring --keyring ./tmpring.gpg --import nut-key.gpg +:; gpg --no-default-keyring --keyring ./tmpring.gpg --import nut-old-key.gpg +:; gpg --no-default-keyring --keyring ./tmpring.gpg --import nut-key-2.7.3.gpg +:; gpg --no-default-keyring --keyring ./tmpring.gpg --import ~/.gnupg/HEXCODEMYNEWKEYDATA.pub +---- + +** Note that whenever the key owner edits the primary key data, e.g. to add or + remove "uid" entries with e-mail aliases, or sub-keys dedicated for specific + purposes, the `~/.gnupg/HEXCODEMYNEWKEYDATA.pub` is changed and should be + re-published to OpenPGP servers, to nut-website, to GitHub account, etc. + +* This (binary) keychain can be exported into ASCII-armor format, and also + update the keychain file used by default: +---- +:; gpg --no-default-keyring --keyring ./tmpring.gpg --export -a > nut-key.gpg +---- +//////// + +How to verify the NUT source code checksum +------------------------------------------ + +As a weaker but simpler alternative to verifying a *signature*, you can verify +just the accompanying checksums of the source archive file. This is useful +primarily to check against bit-rot in original storage or in transit. As far +as disclaimers go: ideally, you should cover all provided algorithms -- e.g. +MD5 and SHA256 -- to minimize the chance that intentional malicious tampering +on the wire goes undetected. A myriad tools can check that on various platforms; +some examples follow: + + # Example original checksum to compare with, from NUT website: + $ cat nut-2.8.0.tar.gz.sha256 + c3e5a708da797b7c70b653d37b1206a000fcb503b85519fe4cdf6353f792bfe5 nut-2.8.0.tar.gz + + # Generate checksum of downloaded archive with perl (a NUT build dependency + # generally, though you may have to install Digest::SHA module from CPAN): + $ perl -MDigest::SHA=sha256_hex -le "print sha256_hex <>" nut-2.8.0.tar.gz + c3e5a708da797b7c70b653d37b1206a000fcb503b85519fe4cdf6353f792bfe5 + + # Generate checksum of downloaded archive with openssl (another optional + # NUT build dependency): + $ openssl sha256 nut-2.8.0.tar.gz + SHA256(nut-2.8.0.tar.gz)= c3e5a708da797b7c70b653d37b1206a000fcb503b85519fe4cdf6353f792bfe5 + + # Generate checksum of downloaded archive with coreutils: + $ sha256sum nut-2.8.0.tar.gz + c3e5a708da797b7c70b653d37b1206a000fcb503b85519fe4cdf6353f792bfe5 nut-2.8.0.tar.gz + + # Auto-check downloaded checksum against downloaded archive with coreutils: + $ sha256sum -c nut-2.8.0.tar.gz.sha256 + nut-2.8.0.tar.gz: OK + + # Generate checksum of downloaded archive with GPG: + $ gpg --print-md SHA256 nut-2.8.0.tar.gz + nut-2.8.0.tar.gz: C3E5A708 DA797B7C 70B653D3 7B1206A0 + 00FCB503 B85519FE 4CDF6353 F792BFE5 System level privileges and ownership ------------------------------------- diff --git a/docs/snmp.txt b/docs/snmp.txt index 64b9c06f6f..0e058761dd 100644 --- a/docs/snmp.txt +++ b/docs/snmp.txt @@ -47,4 +47,4 @@ manpage (man 8 snmp-ups). References: - NUT SNMP Protocols Library Available at: -http://www.networkupstools.org/ups-protocols.html#_snmp +https://www.networkupstools.org/ups-protocols.html#_snmp diff --git a/docs/sock-protocol.txt b/docs/sock-protocol.txt index 8adadd57d2..bd440cbc18 100644 --- a/docs/sock-protocol.txt +++ b/docs/sock-protocol.txt @@ -20,15 +20,12 @@ to the socket (you may want to enable `NOBROADCAST` mode soon), e.g. socat - UNIX-CONNECT:/var/state/ups/dummy-ups-UPS1 For more insight, NUT provides an optional tool of its own (not built -by default), the `sockdebug`: +by default): the `sockdebug` which is built when `configure --with-dev` +is in effect, or can be requested from the root directory of the build +workspace: - # POSIX - (cd server && make sockdebug) && \ - ./server/sockdebug /var/state/ups/dummy-ups-UPS1 - - # WIN32 - (cd server && make sockdebug.exe) && \ - ./server/sockdebug.exe dummy-ups-UPS1 + make sockdebug && \ + ./server/sockdebug dummy-ups-UPS1 Formatting ---------- diff --git a/docs/support.txt b/docs/support.txt index c7d6165bcb..f0e2de46f6 100644 --- a/docs/support.txt +++ b/docs/support.txt @@ -145,4 +145,4 @@ To report new Devices Dumps Library entries, posting an issue is okay, but posting a link:https://github.com/networkupstools/nut-ddl/pulls[pull request] is a lot better -- easier for maintainers to review and merge any time. For some more detailed instructions about useful DDL reports, please see -link:https://networkupstools.org/ddl/#_file_naming_convention[NUT DDL page]. +link:https://www.networkupstools.org/ddl/#_file_naming_convention[NUT DDL page]. diff --git a/docs/user-manual.txt b/docs/user-manual.txt index 0e96ea4e25..4109b9629f 100644 --- a/docs/user-manual.txt +++ b/docs/user-manual.txt @@ -15,7 +15,7 @@ Units and Solar Controllers. NUT provides many control and monitoring <>, with a uniform control and management interface. -More than 140 different manufacturers, and several thousands of models are +More than 170 different manufacturers, and several thousands of models are <>. This software is the combined effort of many @@ -147,7 +147,7 @@ include::nut-names.txt[] Appendix D: Hardware Compatibility List ======================================= -Refer to the link:http://www.networkupstools.org/stable-hcl.html[online HCL]. +Refer to the link:https://www.networkupstools.org/stable-hcl.html[online HCL]. Appendix E: Documentation diff --git a/drivers/adelsystem_cbi.c b/drivers/adelsystem_cbi.c index e86a16a5c9..c64da36343 100644 --- a/drivers/adelsystem_cbi.c +++ b/drivers/adelsystem_cbi.c @@ -30,7 +30,7 @@ #include #define DRIVER_NAME "NUT ADELSYSTEM DC-UPS CB/CBI driver" -#define DRIVER_VERSION "0.01" +#define DRIVER_VERSION "0.02" /* variables */ static modbus_t *mbctx = NULL; /* modbus memory context */ diff --git a/drivers/al175.c b/drivers/al175.c index 70588da8b3..08b4b9b0df 100644 --- a/drivers/al175.c +++ b/drivers/al175.c @@ -52,7 +52,7 @@ typedef uint8_t byte_t; #define DRIVER_NAME "Eltek AL175/COMLI driver" -#define DRIVER_VERSION "0.13" +#define DRIVER_VERSION "0.14" /* driver description structure */ upsdrv_info_t upsdrv_info = { diff --git a/drivers/apcsmart-old.c b/drivers/apcsmart-old.c index 0a2f451382..197a7b2537 100644 --- a/drivers/apcsmart-old.c +++ b/drivers/apcsmart-old.c @@ -25,7 +25,7 @@ #include "nut_stdint.h" #define DRIVER_NAME "APC Smart protocol driver" -#define DRIVER_VERSION "2.2" +#define DRIVER_VERSION "2.30" static upsdrv_info_t table_info = { "APC command table", diff --git a/drivers/apcsmart.c b/drivers/apcsmart.c index 261b18f5f7..7867d3eeb4 100644 --- a/drivers/apcsmart.c +++ b/drivers/apcsmart.c @@ -35,6 +35,9 @@ #include "apcsmart.h" #include "apcsmart_tabs.h" +#define DRIVER_NAME "APC Smart protocol driver" +#define DRIVER_VERSION "3.30" + #ifdef WIN32 # ifndef ECANCELED # define ECANCELED ERROR_CANCELLED @@ -2082,7 +2085,7 @@ void upsdrv_help(void) printf( "\nFor detailed information, please refer to:\n" " - apcsmart(8)\n" - " - http://www.networkupstools.org/docs/man/apcsmart.html\n" + " - https://www.networkupstools.org/docs/man/apcsmart.html\n" ); } diff --git a/drivers/apcsmart.h b/drivers/apcsmart.h index 864bc73d1c..5a60f83eb5 100644 --- a/drivers/apcsmart.h +++ b/drivers/apcsmart.h @@ -23,9 +23,6 @@ #ifndef NUT_APCSMART_H_SEEN #define NUT_APCSMART_H_SEEN 1 -#define DRIVER_NAME "APC Smart protocol driver" -#define DRIVER_VERSION "3.2" - #define ALT_CABLE_1 "940-0095B" /* diff --git a/drivers/apcupsd-ups.c b/drivers/apcupsd-ups.c index 1b4289e219..cf6443f385 100644 --- a/drivers/apcupsd-ups.c +++ b/drivers/apcupsd-ups.c @@ -39,7 +39,7 @@ typedef unsigned long int nfds_t; #include "nut_stdint.h" #define DRIVER_NAME "apcupsd network client UPS driver" -#define DRIVER_VERSION "0.6" +#define DRIVER_VERSION "0.71" #define POLL_INTERVAL_MIN 10 @@ -174,6 +174,8 @@ static int getdata(void) char *data; struct pollfd p; char bfr[1024]; + st_tree_timespec_t start; + int ret = -1; #ifndef WIN32 int fd_flags; #else @@ -185,21 +187,23 @@ static int getdata(void) HANDLE event = NULL; #endif - for(x=0;nut_data[x].info_type;x++) - if(!(nut_data[x].drv_flags & DU_FLAG_INIT) && !(nut_data[x].drv_flags & DU_FLAG_PRESERVE)) - dstate_delinfo(nut_data[x].info_type); + state_get_timestamp((st_tree_timespec_t *)&start); - if (INVALID_FD_SOCK( p.fd = socket(AF_INET, SOCK_STREAM, 0) )) + if (INVALID_FD_SOCK( (p.fd = socket(AF_INET, SOCK_STREAM, 0)) )) { upsdebugx(1,"socket error"); - return -1; + /* return -1; */ + ret = -1; + goto getdata_return; } if(connect(p.fd,(struct sockaddr *)&host,sizeof(host))) { upsdebugx(1,"can't connect to apcupsd"); - close(p.fd); - return -1; + /* close(p.fd); + return -1; */ + ret = -1; + goto getdata_return; } #ifndef WIN32 @@ -207,15 +211,19 @@ static int getdata(void) fd_flags = fcntl(p.fd, F_GETFL); if (fd_flags == -1) { upsdebugx(1,"unexpected fcntl(fd, F_GETFL) failure"); - close(p.fd); - return -1; + /* close(p.fd); + return -1; */ + ret = -1; + goto getdata_return; } fd_flags |= O_NONBLOCK; if(fcntl(p.fd, F_SETFL, fd_flags) == -1) { upsdebugx(1,"unexpected fcntl(fd, F_SETFL, fd_flags|O_NONBLOCK) failure"); - close(p.fd); - return -1; + /* close(p.fd); + return -1; */ + ret = -1; + goto getdata_return; } #else event = CreateEvent( @@ -244,20 +252,14 @@ static int getdata(void) if(read(p.fd,&n,2)!=2) { upsdebugx(1,"apcupsd communication error"); - close(p.fd); -#ifdef WIN32 - CloseHandle(event); -#endif - return -1; + ret = -1; + goto getdata_return; } if(!(x=ntohs(n))) { - close(p.fd); -#ifdef WIN32 - CloseHandle(event); -#endif - return 0; + ret = 0; + goto getdata_return; } else if(x<0||x>=(int)sizeof(bfr)) /* Note: LGTM.com suggests "Comparison is always false because x >= 0" @@ -268,11 +270,8 @@ static int getdata(void) */ { upsdebugx(1,"apcupsd communication error"); - close(p.fd); -#ifdef WIN32 - CloseHandle(event); -#endif - return -1; + ret = -1; + goto getdata_return; } #ifndef WIN32 @@ -284,11 +283,8 @@ static int getdata(void) if(read(p.fd,bfr,(size_t)x)!=x) { upsdebugx(1,"apcupsd communication error"); - close(p.fd); -#ifdef WIN32 - CloseHandle(event); -#endif - return -1; + ret = -1; + goto getdata_return; } bfr[x]=0; @@ -296,21 +292,15 @@ static int getdata(void) if(!(item=strtok(bfr," \t:\r\n"))) { upsdebugx(1,"apcupsd communication error"); - close(p.fd); -#ifdef WIN32 - CloseHandle(event); -#endif - return -1; + ret = -1; + goto getdata_return; } if(!(data=strtok(NULL,"\r\n"))) { upsdebugx(1,"apcupsd communication error"); - close(p.fd); -#ifdef WIN32 - CloseHandle(event); -#endif - return -1; + ret = -1; + goto getdata_return; } while(*data==' '||*data=='\t'||*data==':')data++; @@ -318,11 +308,22 @@ static int getdata(void) } upsdebugx(1,"unexpected connection close by apcupsd"); - close(p.fd); + ret = -1; + +getdata_return: + if (VALID_FD_SOCK(p.fd)) + close(p.fd); #ifdef WIN32 - CloseHandle(event); + if (event != NULL) + CloseHandle(event); #endif - return -1; + + /* Remove any unprotected entries not refreshed in this run */ + for(x=0;nut_data[x].info_type;x++) + if(!(nut_data[x].drv_flags & DU_FLAG_INIT) && !(nut_data[x].drv_flags & DU_FLAG_PRESERVE)) + dstate_delinfo_olderthan(nut_data[x].info_type, &start); + + return ret; } void upsdrv_initinfo(void) @@ -331,7 +332,7 @@ void upsdrv_initinfo(void) if(getdata())fatalx(EXIT_FAILURE,"can't communicate with apcupsd!"); else dstate_dataok(); - poll_interval = (poll_interval > POLL_INTERVAL_MIN) ? POLL_INTERVAL_MIN : poll_interval; + poll_interval = (poll_interval < POLL_INTERVAL_MIN) ? POLL_INTERVAL_MIN : poll_interval; } void upsdrv_updateinfo(void) @@ -339,7 +340,7 @@ void upsdrv_updateinfo(void) if(getdata())upslogx(LOG_ERR,"can't communicate with apcupsd!"); else dstate_dataok(); - poll_interval = (poll_interval > POLL_INTERVAL_MIN) ? POLL_INTERVAL_MIN : poll_interval; + poll_interval = (poll_interval < POLL_INTERVAL_MIN) ? POLL_INTERVAL_MIN : poll_interval; } void upsdrv_shutdown(void) diff --git a/drivers/asem.c b/drivers/asem.c index 04abba2f76..d35a54746a 100644 --- a/drivers/asem.c +++ b/drivers/asem.c @@ -67,7 +67,7 @@ #endif #define DRIVER_NAME "ASEM" -#define DRIVER_VERSION "0.11" +#define DRIVER_VERSION "0.12" /* Valid on ASEM PB1300 UPS */ #define BQ2060_ADDRESS 0x0B diff --git a/drivers/bcmxcp.c b/drivers/bcmxcp.c index 4236edc006..958cefc5dd 100644 --- a/drivers/bcmxcp.c +++ b/drivers/bcmxcp.c @@ -118,7 +118,7 @@ TODO List: #include "bcmxcp.h" #define DRIVER_NAME "BCMXCP UPS driver" -#define DRIVER_VERSION "0.32" +#define DRIVER_VERSION "0.33" #define MAX_NUT_NAME_LENGTH 128 #define NUT_OUTLET_POSITION 7 diff --git a/drivers/bcmxcp_ser.c b/drivers/bcmxcp_ser.c index 98e5fa9d90..6979b7f9f1 100644 --- a/drivers/bcmxcp_ser.c +++ b/drivers/bcmxcp_ser.c @@ -6,7 +6,7 @@ #include "nut_stdint.h" #define SUBDRIVER_NAME "RS-232 communication subdriver" -#define SUBDRIVER_VERSION "0.21" +#define SUBDRIVER_VERSION "0.22" /* communication driver description structure */ upsdrv_info_t comm_upsdrv_info = { diff --git a/drivers/belkin.c b/drivers/belkin.c index 1eb21cf1fd..34a3f39b24 100644 --- a/drivers/belkin.c +++ b/drivers/belkin.c @@ -29,7 +29,7 @@ #include "nut_stdint.h" #define DRIVER_NAME "Belkin Smart protocol driver" -#define DRIVER_VERSION "0.25" +#define DRIVER_VERSION "0.26" static ssize_t init_communication(void); static ssize_t get_belkin_reply(char *buf); diff --git a/drivers/belkinunv.c b/drivers/belkinunv.c index 84881afa60..131e1247eb 100644 --- a/drivers/belkinunv.c +++ b/drivers/belkinunv.c @@ -94,7 +94,7 @@ #include "serial.h" #define DRIVER_NAME "Belkin 'Universal UPS' driver" -#define DRIVER_VERSION "0.08" +#define DRIVER_VERSION "0.09" /* driver description structure */ upsdrv_info_t upsdrv_info = { diff --git a/drivers/bestfcom.c b/drivers/bestfcom.c index c53aa953f2..38a996dac1 100644 --- a/drivers/bestfcom.c +++ b/drivers/bestfcom.c @@ -45,7 +45,7 @@ #include "serial.h" #define DRIVER_NAME "Best Ferrups/Fortress driver" -#define DRIVER_VERSION "0.13" +#define DRIVER_VERSION "0.14" /* driver description structure */ upsdrv_info_t upsdrv_info = { diff --git a/drivers/bestfortress.c b/drivers/bestfortress.c index 67fd681b12..d86d1b4daa 100644 --- a/drivers/bestfortress.c +++ b/drivers/bestfortress.c @@ -35,7 +35,7 @@ #endif #define DRIVER_NAME "Best Fortress UPS driver" -#define DRIVER_VERSION "0.07" +#define DRIVER_VERSION "0.08" /* driver description structure */ upsdrv_info_t upsdrv_info = { diff --git a/drivers/bestuferrups.c b/drivers/bestuferrups.c index 8bed32bfc6..7ef36347cb 100644 --- a/drivers/bestuferrups.c +++ b/drivers/bestuferrups.c @@ -33,7 +33,7 @@ #include "serial.h" #define DRIVER_NAME "Best Ferrups Series ME/RE/MD driver" -#define DRIVER_VERSION "0.04" +#define DRIVER_VERSION "0.05" /* driver description structure */ upsdrv_info_t upsdrv_info = { diff --git a/drivers/bestups.c b/drivers/bestups.c index 05a2f344f4..d388658e12 100644 --- a/drivers/bestups.c +++ b/drivers/bestups.c @@ -29,7 +29,7 @@ #include "nut_stdint.h" #define DRIVER_NAME "Best UPS driver" -#define DRIVER_VERSION "1.07" +#define DRIVER_VERSION "1.08" /* driver description structure */ upsdrv_info_t upsdrv_info = { diff --git a/drivers/blazer.c b/drivers/blazer.c index e9da47ac4b..1435452939 100644 --- a/drivers/blazer.c +++ b/drivers/blazer.c @@ -7,7 +7,7 @@ * device support from such legacy drivers over time. * * A document describing the protocol implemented by this driver can be - * found online at http://www.networkupstools.org/ups-protocols/megatec.html + * found online at https://www.networkupstools.org/ups-protocols/megatec.html * * Copyright (C) * 2008,2009 - Arjen de Korte diff --git a/drivers/blazer.h b/drivers/blazer.h index 6a8c71c24e..67597d5b4e 100644 --- a/drivers/blazer.h +++ b/drivers/blazer.h @@ -7,7 +7,7 @@ * device support from such legacy drivers over time. * * A document describing the protocol implemented by this driver can be - * found online at "http://www.networkupstools.org/protocols/megatec.html". + * found online at "https://www.networkupstools.org/protocols/megatec.html". * * Copyright (C) 2008 - Arjen de Korte * diff --git a/drivers/blazer_ser.c b/drivers/blazer_ser.c index 0986ab32e2..85bffa557c 100644 --- a/drivers/blazer_ser.c +++ b/drivers/blazer_ser.c @@ -7,7 +7,7 @@ * device support from such legacy drivers over time. * * A document describing the protocol implemented by this driver can be - * found online at "http://www.networkupstools.org/protocols/megatec.html". + * found online at "https://www.networkupstools.org/protocols/megatec.html". * * Copyright (C) 2008 - Arjen de Korte * diff --git a/drivers/blazer_usb.c b/drivers/blazer_usb.c index aee325b7b9..549019158e 100644 --- a/drivers/blazer_usb.c +++ b/drivers/blazer_usb.c @@ -7,7 +7,7 @@ * device support from such legacy drivers over time. * * A document describing the protocol implemented by this driver can be - * found online at "http://www.networkupstools.org/protocols/megatec.html". + * found online at "https://www.networkupstools.org/protocols/megatec.html". * * Copyright (C) 2003-2009 Arjen de Korte * Copyright (C) 2011-2012 Arnaud Quette diff --git a/drivers/clone-outlet.c b/drivers/clone-outlet.c index 16dbbeff28..62f3cd186d 100644 --- a/drivers/clone-outlet.c +++ b/drivers/clone-outlet.c @@ -29,7 +29,7 @@ #endif #define DRIVER_NAME "clone outlet UPS Driver" -#define DRIVER_VERSION "0.02" +#define DRIVER_VERSION "0.03" /* driver description structure */ upsdrv_info_t upsdrv_info = { diff --git a/drivers/clone.c b/drivers/clone.c index 9e9eb448f7..c12cc55d4b 100644 --- a/drivers/clone.c +++ b/drivers/clone.c @@ -31,7 +31,7 @@ #endif #define DRIVER_NAME "Clone UPS driver" -#define DRIVER_VERSION "0.03" +#define DRIVER_VERSION "0.04" /* driver description structure */ upsdrv_info_t upsdrv_info = { diff --git a/drivers/cyberpower-mib.c b/drivers/cyberpower-mib.c index cff6d64d88..89574b8744 100644 --- a/drivers/cyberpower-mib.c +++ b/drivers/cyberpower-mib.c @@ -24,12 +24,17 @@ #include "cyberpower-mib.h" -#define CYBERPOWER_MIB_VERSION "0.52" +#define CYBERPOWER_MIB_VERSION "0.53" #define CYBERPOWER_OID_MODEL_NAME ".1.3.6.1.4.1.3808.1.1.1.1.1.1.0" /* CPS-MIB::ups */ #define CYBERPOWER_SYSOID ".1.3.6.1.4.1.3808.1.1.1" +/* Per https://github.com/networkupstools/nut/issues/1997 + * some CPS devices offer the shorter vendor OID as sysOID + */ +#define CYBERPOWER_SYSOID2 ".1.3.6.1.4.1.3808" + /* https://www.cyberpowersystems.com/products/software/mib-files/ */ /* Per CPS MIB 2.9 upsBaseOutputStatus OBJECT-TYPE: */ static info_lkp_t cyberpower_power_status[] = { @@ -177,3 +182,6 @@ static snmp_info_t cyberpower_mib[] = { mib2nut_info_t cyberpower = { "cyberpower", CYBERPOWER_MIB_VERSION, NULL, CYBERPOWER_OID_MODEL_NAME, cyberpower_mib, CYBERPOWER_SYSOID, NULL }; + +mib2nut_info_t cyberpower2 = { "cyberpower", CYBERPOWER_MIB_VERSION, NULL, + CYBERPOWER_OID_MODEL_NAME, cyberpower_mib, CYBERPOWER_SYSOID2, NULL }; diff --git a/drivers/cyberpower-mib.h b/drivers/cyberpower-mib.h index 9db422250e..f8a44d24bd 100644 --- a/drivers/cyberpower-mib.h +++ b/drivers/cyberpower-mib.h @@ -5,5 +5,6 @@ #include "snmp-ups.h" extern mib2nut_info_t cyberpower; +extern mib2nut_info_t cyberpower2; #endif /* CYBERPOWER_MIB_H */ diff --git a/drivers/delta_ups-mib.c b/drivers/delta_ups-mib.c index 08b810439d..888542aef8 100644 --- a/drivers/delta_ups-mib.c +++ b/drivers/delta_ups-mib.c @@ -6,7 +6,7 @@ * Note: this subdriver was initially generated as a "stub" by the * gen-snmp-subdriver.sh script. It must be customized! * - * MIB reference: http://www.networkupstools.org/ups-protocols/snmp/DeltaUPSv4.mib + * MIB reference: https://www.networkupstools.org/ups-protocols/snmp/DeltaUPSv4.mib * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/drivers/dstate.c b/drivers/dstate.c index a6b1b0e2fb..80435f08c0 100644 --- a/drivers/dstate.c +++ b/drivers/dstate.c @@ -1400,6 +1400,20 @@ int dstate_delinfo(const char *var) return ret; } +int dstate_delinfo_olderthan(const char *var, const st_tree_timespec_t *cutoff) +{ + int ret; + + ret = state_delinfo_olderthan(&dtree_root, var, cutoff); + + /* update listeners */ + if (ret == 1) { + send_to_all("DELINFO %s\n", var); + } + + return ret; +} + int dstate_delenum(const char *var, const char *val) { int ret; diff --git a/drivers/dstate.h b/drivers/dstate.h index ec26056cf5..2fa754defa 100644 --- a/drivers/dstate.h +++ b/drivers/dstate.h @@ -75,6 +75,7 @@ void dstate_delflags(const char *var, const int delflags); void dstate_setaux(const char *var, long aux); const char *dstate_getinfo(const char *var); void dstate_addcmd(const char *cmdname); +int dstate_delinfo_olderthan(const char *var, const st_tree_timespec_t *cutoff); int dstate_delinfo(const char *var); int dstate_delenum(const char *var, const char *val); int dstate_delrange(const char *var, const int min, const int max); diff --git a/drivers/dummy-ups.c b/drivers/dummy-ups.c index c20295bd68..8a58242bce 100644 --- a/drivers/dummy-ups.c +++ b/drivers/dummy-ups.c @@ -47,7 +47,7 @@ #include "dummy-ups.h" #define DRIVER_NAME "Device simulation and repeater driver" -#define DRIVER_VERSION "0.15" +#define DRIVER_VERSION "0.16" /* driver description structure */ upsdrv_info_t upsdrv_info = diff --git a/drivers/eaton-pdu-marlin-mib.c b/drivers/eaton-pdu-marlin-mib.c index b5f5a8b7fc..94b9af7a01 100644 --- a/drivers/eaton-pdu-marlin-mib.c +++ b/drivers/eaton-pdu-marlin-mib.c @@ -451,7 +451,7 @@ static snmp_info_t eaton_marlin_mib[] = { /* FIXME: * - Voltage is only measured per phase, as mV! * so input.voltage == input.L1.voltage for both single and 3phase - * - As per NUT namespace (http://www.networkupstools.org/docs/developer-guide.chunked/apas01.html#_valid_contexts) + * - As per NUT namespace (https://www.networkupstools.org/docs/developer-guide.chunked/apas01.html#_valid_contexts) * Voltage has to be expressed either phase-phase or phase-neutral * This is depending on OID inputVoltageMeasType * INTEGER {singlePhase (1),phase1toN (2),phase2toN (3),phase3toN (4),phase1to2 (5),phase2to3 (6),phase3to1 (7) diff --git a/drivers/etapro.c b/drivers/etapro.c index 85b88d5964..2e5fa812ef 100644 --- a/drivers/etapro.c +++ b/drivers/etapro.c @@ -55,7 +55,7 @@ #include "nut_stdint.h" #define DRIVER_NAME "ETA PRO driver" -#define DRIVER_VERSION "0.05" +#define DRIVER_VERSION "0.06" /* driver description structure */ upsdrv_info_t upsdrv_info = { diff --git a/drivers/everups.c b/drivers/everups.c index 63ccea879d..dc032b0fec 100644 --- a/drivers/everups.c +++ b/drivers/everups.c @@ -21,7 +21,7 @@ #include "serial.h" #define DRIVER_NAME "Ever UPS driver (serial)" -#define DRIVER_VERSION "0.04" +#define DRIVER_VERSION "0.05" /* driver description structure */ upsdrv_info_t upsdrv_info = { diff --git a/drivers/gamatronic.c b/drivers/gamatronic.c index bf92238ffe..bf0c6ad333 100644 --- a/drivers/gamatronic.c +++ b/drivers/gamatronic.c @@ -33,7 +33,7 @@ #include "nut_stdint.h" #define DRIVER_NAME "Gamatronic UPS driver" -#define DRIVER_VERSION "0.03" +#define DRIVER_VERSION "0.04" /* driver description structure */ upsdrv_info_t upsdrv_info = { diff --git a/drivers/generic_gpio_common.h b/drivers/generic_gpio_common.h index 65c60a9e34..3b17a86c9a 100644 --- a/drivers/generic_gpio_common.h +++ b/drivers/generic_gpio_common.h @@ -1,5 +1,3 @@ -#ifndef GENERIC_GPIO_COMMON_H -#define GENERIC_GPIO_COMMON_H /* generic_gpio_common.h - common NUT driver definitions for GPIO attached UPS devices * * Copyright (C) @@ -22,47 +20,50 @@ * */ +#ifndef GENERIC_GPIO_COMMON_H_SEEN +#define GENERIC_GPIO_COMMON_H_SEEN + #include #include #include /* rules commands definition */ -#define RULES_CMD_NOT -2 -#define RULES_CMD_AND -3 -#define RULES_CMD_OR -4 -#define RULES_CMD_OBR -5 -#define RULES_CMD_CBR -6 -#define RULES_CMD_LAST RULES_CMD_CBR +#define RULES_CMD_NOT -2 +#define RULES_CMD_AND -3 +#define RULES_CMD_OR -4 +#define RULES_CMD_OBR -5 +#define RULES_CMD_CBR -6 +#define RULES_CMD_LAST RULES_CMD_CBR /* run option definitions */ -#define ROPT_REQRES 0x00000001 /* reserve GPIO lines only during request processing */ -#define ROPT_EVMODE 0x00000002 /* event driven run */ +#define ROPT_REQRES 0x00000001 /* reserve GPIO lines only during request processing */ +#define ROPT_EVMODE 0x00000002 /* event driven run */ /* buffer size for chipName arrays */ #define NUT_GPIO_CHIPNAMEBUF 32 -#define NUT_GPIO_SUBTYPEBUF 16 +#define NUT_GPIO_SUBTYPEBUF 16 typedef struct rulesint_t { /* structure to store processed rules configuration per each state */ - char stateName[12]; /* NUT state name for rules in cRules */ - int archVal; /* previous state value */ - int currVal; /* current state value */ - int subCount; /* element count in translated rules subitem */ - int cRules[]; /* translated rules subitem - rules commands followed by line number(s) */ -} rulesint; + char stateName[12]; /* NUT state name for rules in cRules */ + int archVal; /* previous state value */ + int currVal; /* current state value */ + int subCount; /* element count in translated rules subitem */ + int cRules[]; /* translated rules subitem - rules commands followed by line number(s) */ +} rulesint; typedef struct gpioups_t { - void *lib_data; /* pointer to driver's gpio support library data structure */ - const char *chipName; /* port or file name to reference GPIO chip */ - int initial; /* initialization flag - 0 on 1st entry */ - int runOptions; /* run options, not yet used */ - int aInfoAvailable; /* non-zero if previous state information is available */ - int chipLinesCount; /* gpio chip lines count, set after sucessful open */ - int upsLinesCount; /* no of lines used in rules */ - int *upsLines; /* lines numbers */ - int *upsLinesStates; /* lines states */ - int upsMaxLine; /* maximum line number referenced in rules */ - int rulesCount; /* rules subitem count: no of NUT states defined in rules*/ - struct rulesint_t **rules; + void *lib_data; /* pointer to driver's gpio support library data structure */ + const char *chipName; /* port or file name to reference GPIO chip */ + int initial; /* initialization flag - 0 on 1st entry */ + int runOptions; /* run options, not yet used */ + int aInfoAvailable; /* non-zero if previous state information is available */ + int chipLinesCount; /* gpio chip lines count, set after sucessful open */ + int upsLinesCount; /* no of lines used in rules */ + int *upsLines; /* lines numbers */ + int *upsLinesStates; /* lines states */ + int upsMaxLine; /* maximum line number referenced in rules */ + int rulesCount; /* rules subitem count: no of NUT states defined in rules*/ + struct rulesint_t **rules; } gpioups; extern struct gpioups_t *gpioupsfd; @@ -82,4 +83,4 @@ int calc_rule_states(int upsLinesStates[], int cRules[], int subCount, int sInde void update_ups_states(struct gpioups_t *gpioupsfd); # endif /* DRIVERS_MAIN_WITHOUT_MAIN */ -#endif /* GENERIC_GPIO_COMMON_H */ +#endif /* GENERIC_GPIO_COMMON_H_SEEN */ diff --git a/drivers/generic_gpio_libgpiod.c b/drivers/generic_gpio_libgpiod.c index 99116bbe0e..dded983b85 100644 --- a/drivers/generic_gpio_libgpiod.c +++ b/drivers/generic_gpio_libgpiod.c @@ -26,6 +26,9 @@ #include "generic_gpio_common.h" #include "generic_gpio_libgpiod.h" +#define DRIVER_NAME "GPIO UPS driver" +#define DRIVER_VERSION "1.01" + /* driver description structure */ upsdrv_info_t upsdrv_info = { DRIVER_NAME, diff --git a/drivers/generic_gpio_libgpiod.h b/drivers/generic_gpio_libgpiod.h index 43dd98dfda..66f13b4511 100644 --- a/drivers/generic_gpio_libgpiod.h +++ b/drivers/generic_gpio_libgpiod.h @@ -1,5 +1,3 @@ -#ifndef GENERIC_GPIO_LIBGPIOD_H -#define GENERIC_GPIO_LIBGPIOD_H /* generic_gpio_libgpiod.h - gpiod based NUT driver definitions for GPIO attached UPS devices * * Copyright (C) @@ -22,15 +20,15 @@ * */ -#include +#ifndef GENERIC_GPIO_LIBGPIOD_H_SEEN +#define GENERIC_GPIO_LIBGPIOD_H_SEEN -#define DRIVER_NAME "GPIO UPS driver" -#define DRIVER_VERSION "1.00" +#include typedef struct libgpiod_data_t { - struct gpiod_chip *gpioChipHandle; /* libgpiod chip handle when opened */ - struct gpiod_line_bulk gpioLines; /* libgpiod lines to monitor */ - struct gpiod_line_bulk gpioEventLines; /* libgpiod lines for event monitoring */ + struct gpiod_chip *gpioChipHandle; /* libgpiod chip handle when opened */ + struct gpiod_line_bulk gpioLines; /* libgpiod lines to monitor */ + struct gpiod_line_bulk gpioEventLines; /* libgpiod lines for event monitoring */ } libgpiod_data; -#endif /* GENERIC_GPIO_LIBGPIOD_H */ +#endif /* GENERIC_GPIO_LIBGPIOD_H_SEEN */ diff --git a/drivers/generic_modbus.c b/drivers/generic_modbus.c index 1b30b6e4ec..d10472b452 100644 --- a/drivers/generic_modbus.c +++ b/drivers/generic_modbus.c @@ -27,7 +27,7 @@ #include "nut_stdint.h" #define DRIVER_NAME "NUT Generic Modbus driver" -#define DRIVER_VERSION "0.03" +#define DRIVER_VERSION "0.04" /* variables */ static modbus_t *mbctx = NULL; /* modbus memory context */ diff --git a/drivers/genericups.c b/drivers/genericups.c index c5d574d03b..acd2e3f6d6 100644 --- a/drivers/genericups.c +++ b/drivers/genericups.c @@ -31,7 +31,7 @@ #include "nut_stdint.h" #define DRIVER_NAME "Generic contact-closure UPS driver" -#define DRIVER_VERSION "1.38" +#define DRIVER_VERSION "1.39" /* driver description structure */ upsdrv_info_t upsdrv_info = { diff --git a/drivers/hpe-pdu-mib.c b/drivers/hpe-pdu-mib.c index 0193f619ba..3f6c7dce70 100644 --- a/drivers/hpe-pdu-mib.c +++ b/drivers/hpe-pdu-mib.c @@ -277,7 +277,7 @@ static snmp_info_t hpe_pdu_mib[] = { /* FIXME: * - Voltage is only measured per phase, as mV! * so input.voltage == input.L1.voltage for both single and 3phase - * - As per NUT namespace (http://www.networkupstools.org/docs/developer-guide.chunked/apas01.html#_valid_contexts) + * - As per NUT namespace (https://www.networkupstools.org/docs/developer-guide.chunked/apas01.html#_valid_contexts) * Voltage has to be expressed either phase-phase or phase-neutral * This is depending on OID inputVoltageMeasType * INTEGER {singlePhase (1),phase1toN (2),phase2toN (3),phase3toN (4),phase1to2 (5),phase2to3 (6),phase3to1 (7) diff --git a/drivers/huawei-ups2000.c b/drivers/huawei-ups2000.c index b856fb6fb1..9ebf86ff28 100644 --- a/drivers/huawei-ups2000.c +++ b/drivers/huawei-ups2000.c @@ -51,7 +51,7 @@ #include "timehead.h" /* fallback gmtime_r() variants if needed (e.g. some WIN32) */ #define DRIVER_NAME "NUT Huawei UPS2000 (1kVA-3kVA) RS-232 Modbus driver" -#define DRIVER_VERSION "0.04" +#define DRIVER_VERSION "0.05" #define CHECK_BIT(var,pos) ((var) & (1<<(pos))) #define MODBUS_SLAVE_ID 1 diff --git a/drivers/isbmex.c b/drivers/isbmex.c index 6c3a7b6cef..923b46f7ee 100644 --- a/drivers/isbmex.c +++ b/drivers/isbmex.c @@ -27,7 +27,7 @@ #include #define DRIVER_NAME "ISBMEX UPS driver" -#define DRIVER_VERSION "0.07" +#define DRIVER_VERSION "0.08" /* driver description structure */ upsdrv_info_t upsdrv_info = { diff --git a/drivers/ivtscd.c b/drivers/ivtscd.c index 4f3f0a42d2..3a07c72281 100644 --- a/drivers/ivtscd.c +++ b/drivers/ivtscd.c @@ -25,7 +25,7 @@ #include "attribute.h" #define DRIVER_NAME "IVT Solar Controller driver" -#define DRIVER_VERSION "0.03" +#define DRIVER_VERSION "0.04" /* driver description structure */ upsdrv_info_t upsdrv_info = { diff --git a/drivers/libhid.c b/drivers/libhid.c index ef033179b4..003fc4b19c 100644 --- a/drivers/libhid.c +++ b/drivers/libhid.c @@ -12,7 +12,7 @@ * * The logic of this file is ripped from mge-shut driver (also from * Arnaud Quette), which is a "HID over serial link" UPS driver for - * Network UPS Tools + * Network UPS Tools * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/drivers/libusb0.c b/drivers/libusb0.c index ef94d6ca33..b07a363c0c 100644 --- a/drivers/libusb0.c +++ b/drivers/libusb0.c @@ -10,7 +10,7 @@ * * The logic of this file is ripped from mge-shut driver (also from * Arnaud Quette), which is a "HID over serial link" UPS driver for - * Network UPS Tools + * Network UPS Tools * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/drivers/libusb1.c b/drivers/libusb1.c index 530633bf6a..522d8a183d 100644 --- a/drivers/libusb1.c +++ b/drivers/libusb1.c @@ -8,7 +8,7 @@ * * The logic of this file is ripped from mge-shut driver (also from * Arnaud Quette), which is a "HID over serial link" UPS driver for - * Network UPS Tools + * Network UPS Tools * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/drivers/liebert-esp2.c b/drivers/liebert-esp2.c index b0dbf82850..ef27cc871a 100644 --- a/drivers/liebert-esp2.c +++ b/drivers/liebert-esp2.c @@ -28,7 +28,8 @@ #define IsBitSet(val, bit) ((val) & (1 << (bit))) #define DRIVER_NAME "Liebert ESP-II serial UPS driver" -#define DRIVER_VERSION "0.05" +#define DRIVER_VERSION "0.06" + #define UPS_SHUTDOWN_DELAY 12 /* it means UPS will be shutdown 120 sec */ #define SHUTDOWN_CMD_LEN 8 diff --git a/drivers/liebert-hid.c b/drivers/liebert-hid.c index 1ec525286e..7b87706fc5 100644 --- a/drivers/liebert-hid.c +++ b/drivers/liebert-hid.c @@ -5,6 +5,7 @@ * 2005 - 2006 Peter Selinger * 2007 Charles Lepple * 2018 Markus "Links2004" + * 2023 Blaž Zakrajšek * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -71,28 +72,43 @@ static hid_info_t liebert_hid2nut[] = { #if WITH_UNMAPPED_DATA_POINTS { "unmapped.ups.powersummary.flowid", 0, 0, "UPS.PowerSummary.FlowID", NULL, "%.0f", 0, NULL }, { "unmapped.ups.powersummary.powersummaryid", 0, 0, "UPS.PowerSummary.PowerSummaryID", NULL, "%.0f", 0, NULL }, - { "unmapped.ups.powersummary.designcapacity", 0, 0, "UPS.PowerSummary.DesignCapacity", NULL, "%.0f", 0, NULL }, { "unmapped.ups.powersummary.capacitygranularity1", 0, 0, "UPS.PowerSummary.CapacityGranularity1", NULL, "%.0f", 0, NULL }, { "unmapped.ups.powersummary.capacitymode", 0, 0, "UPS.PowerSummary.CapacityMode", NULL, "%.0f", 0, NULL }, { "unmapped.ups.powersummary.rechargeable", 0, 0, "UPS.PowerSummary.Rechargeable", NULL, "%.0f", 0, NULL }, { "unmapped.ups.powersummary.iproduct", 0, 0, "UPS.PowerSummary.iProduct", NULL, "%.0f", 0, NULL }, + { "unmapped.ups.powersummary.product", 0, 0, "UPS.PowerSummary.iProduct", NULL, "%s", 0, stringid_conversion }, { "unmapped.ups.powersummary.imanufacturer", 0, 0, "UPS.PowerSummary.iManufacturer", NULL, "%.0f", 0, NULL }, + { "unmapped.ups.powersummary.manufacturer", 0, 0, "UPS.PowerSummary.iManufacturer", NULL, "%s", 0, stringid_conversion }, + { "unmapped.ups.powersummary.iserialnumber", 0, 0, "UPS.PowerSummary.iSerialNumber", NULL, "%.0f", 0, NULL }, + { "unmapped.ups.powersummary.serialnumber", 0, 0, "UPS.PowerSummary.iSerialNumber", NULL, "%s", 0, stringid_conversion }, #endif /* if WITH_UNMAPPED_DATA_POINTS */ + /* Battery page */ { "battery.voltage", 0, 0, "UPS.PowerSummary.Voltage", NULL, "%.2f", 0, NULL }, - { "battery.voltage.nominal", 0, 0, "UPS.PowerSummary.ConfigVoltage", NULL, "%.2f", HU_FLAG_STATIC, NULL }, { "battery.charge", 0, 0, "UPS.PowerSummary.RemainingCapacity", NULL, "%.0f", 0, NULL }, + { "experimental.battery.capacity", 0, 0, "UPS.PowerSummary.FullChargeCapacity", NULL, "%.0f", 0, NULL }, + { "experimental.battery.capacity.nominal", 0, 0, "UPS.PowerSummary.DesignCapacity", NULL, "%.0f", 0, NULL }, { "battery.runtime", 0, 0, "UPS.PowerSummary.RunTimeToEmpty", NULL, "%.0f", 0, NULL }, { "battery.type", 0, 0, "UPS.PowerSummary.iDeviceChemistry", NULL, "%s", 0, stringid_conversion }, - { "ups.load", 0, 0, "UPS.PowerSummary.PercentLoad", NULL, "%.0f", 0, NULL }, + /* UPS page */ + { "ups.load", 0, 0, "UPS.PowerSummary.PercentLoad", NULL, "%.0f", 0, NULL }, + { "ups.power.nominal", 0, 0, "UPS.Flow.[4].ConfigApparentPower", NULL, "%.0f", HU_FLAG_SEMI_STATIC, NULL }, + { "ups.test.result", 0, 0, "UPS.BatterySystem.Battery.Test", NULL, "%s", 0, test_read_info }, + + { "ups.beeper.status", 0 ,0, "UPS.PowerSummary.AudibleAlarmControl", NULL, "%s", HU_FLAG_SEMI_STATIC, beeper_info }, + + /* Output page */ { "output.voltage", 0, 0, "UPS.PowerConverter.Output.Voltage", NULL, "%.1f", 0, NULL }, + { "output.voltage.nominal", 0, 0, "UPS.Flow.[4].ConfigVoltage", NULL, "%.0f", HU_FLAG_SEMI_STATIC, NULL }, { "output.frequency", 0, 0, "UPS.PowerConverter.Output.Frequency", NULL, "%.2f", 0, NULL }, + { "output.frequency.nominal", 0, 0, "UPS.Flow.[4].ConfigFrequency", NULL, "%.0f", HU_FLAG_SEMI_STATIC, NULL }, { "output.transfer.high", 0, 0, "UPS.PowerConverter.Output.HighVoltageTransfer", NULL, "%.1f", HU_FLAG_SEMI_STATIC, NULL }, { "output.transfer.low", 0, 0, "UPS.PowerConverter.Output.LowVoltageTransfer", NULL, "%.1f", HU_FLAG_SEMI_STATIC, NULL }, + /* Input page */ { "input.voltage", 0, 0, "UPS.PowerConverter.Input.[1].Voltage", NULL, "%.1f", 0, NULL }, { "input.frequency", 0, 0, "UPS.PowerConverter.Input.[1].Frequency", NULL, "%.2f", 0, NULL }, @@ -101,12 +117,28 @@ static hid_info_t liebert_hid2nut[] = { { "input.frequency.transfer.low", 0, 0, "UPS.PowerConverter.Output.ffff00f9", NULL, "%.0f", HU_FLAG_SEMI_STATIC, NULL }, { "input.frequency.transfer.high", 0, 0, "UPS.PowerConverter.Output.ffff00f8", NULL, "%.0f", HU_FLAG_SEMI_STATIC, NULL}, + /* Status page */ { "BOOL", 0, 0, "UPS.PowerSummary.PresentStatus.ACPresent", NULL, "%.0f", HU_FLAG_QUICK_POLL, online_info }, { "BOOL", 0, 0, "UPS.PowerSummary.PresentStatus.BelowRemainingCapacityLimit", NULL, "%.0f", HU_FLAG_QUICK_POLL, lowbatt_info }, { "BOOL", 0, 0, "UPS.PowerSummary.PresentStatus.Charging", NULL, "%.0f", HU_FLAG_QUICK_POLL, charging_info }, { "BOOL", 0, 0, "UPS.PowerSummary.PresentStatus.Discharging", NULL, "%.0f", HU_FLAG_QUICK_POLL, discharging_info }, - { "BOOL", 0, 0, "UPS.PowerSummary.PresentStatus.Overload", NULL, "%.0f", 0, overload_info }, - { "BOOL", 0, 0, "UPS.PowerSummary.PresentStatus.ShutdownImminent", NULL, "%.0f", 0, shutdownimm_info }, + { "BOOL", 0, 0, "UPS.PowerSummary.PresentStatus.Overload", NULL, "%.0f", HU_FLAG_QUICK_POLL, overload_info }, + { "BOOL", 0, 0, "UPS.PowerSummary.PresentStatus.Good", NULL, NULL, HU_FLAG_QUICK_POLL, off_info }, + { "BOOL", 0, 0, "UPS.PowerSummary.PresentStatus.InternalFailure", NULL, NULL, HU_FLAG_QUICK_POLL, commfault_info }, + { "BOOL", 0, 0, "UPS.PowerSummary.PresentStatus.ShutdownImminent", NULL, "%.0f", HU_FLAG_QUICK_POLL, shutdownimm_info }, + { "BOOL", 0, 0, "UPS.PowerConverter.Input.[1].PresentStatus.Buck", NULL, NULL, 0, trim_info }, + { "BOOL", 0, 0, "UPS.PowerConverter.Input.[1].PresentStatus.Boost", NULL, NULL, 0, boost_info }, + + /* Variables */ + { "ups.delay.start", ST_FLAG_RW | ST_FLAG_STRING, 10, "UPS.PowerSummary.DelayBeforeStartup", NULL, DEFAULT_ONDELAY, HU_FLAG_ABSENT, NULL}, + { "ups.delay.shutdown", ST_FLAG_RW | ST_FLAG_STRING, 10, "UPS.PowerSummary.DelayBeforeShutdown", NULL, DEFAULT_OFFDELAY, HU_FLAG_ABSENT, NULL}, + + /* Instant commands */ + { "test.battery.start", 0, 0, "UPS.BatterySystem.Battery.Test", NULL, "1", HU_TYPE_CMD, NULL }, + { "load.off.delay", 0, 0, "UPS.PowerSummary.DelayBeforeShutdown", NULL, DEFAULT_OFFDELAY, HU_TYPE_CMD, NULL }, + { "load.on.delay", 0, 0, "UPS.PowerSummary.DelayBeforeStartup", NULL, DEFAULT_ONDELAY, HU_TYPE_CMD, NULL }, + { "shutdown.stop", 0, 0, "UPS.PowerSummary.DelayBeforeShutdown", NULL, "-1", HU_TYPE_CMD, NULL }, + { "beeper.toggle", 0, 0, "UPS.PowerSummary.AudibleAlarmControl", NULL, "1", HU_TYPE_CMD, NULL }, /* end of structure. */ { NULL, 0, 0, NULL, NULL, NULL, 0, NULL } diff --git a/drivers/liebert.c b/drivers/liebert.c index b07e526fc0..1c21e6e0da 100644 --- a/drivers/liebert.c +++ b/drivers/liebert.c @@ -27,7 +27,7 @@ #include "attribute.h" #define DRIVER_NAME "Liebert MultiLink UPS driver" -#define DRIVER_VERSION "1.03" +#define DRIVER_VERSION "1.04" /* driver description structure */ upsdrv_info_t upsdrv_info = { diff --git a/drivers/macosx-ups.c b/drivers/macosx-ups.c index 9b4540b97a..1740320c29 100644 --- a/drivers/macosx-ups.c +++ b/drivers/macosx-ups.c @@ -29,7 +29,7 @@ #include "IOKit/ps/IOPSKeys.h" #define DRIVER_NAME "Mac OS X UPS meta-driver" -#define DRIVER_VERSION "1.3" +#define DRIVER_VERSION "1.40" /* driver description structure */ upsdrv_info_t upsdrv_info = { diff --git a/drivers/masterguard.c b/drivers/masterguard.c index cb27f233e5..37cae77651 100644 --- a/drivers/masterguard.c +++ b/drivers/masterguard.c @@ -29,7 +29,7 @@ #include "nut_stdint.h" #define DRIVER_NAME "MASTERGUARD UPS driver" -#define DRIVER_VERSION "0.25" +#define DRIVER_VERSION "0.26" /* driver description structure */ upsdrv_info_t upsdrv_info = { diff --git a/drivers/metasys.c b/drivers/metasys.c index 4857c5f625..e5003b116f 100644 --- a/drivers/metasys.c +++ b/drivers/metasys.c @@ -28,7 +28,7 @@ #include "nut_stdint.h" #define DRIVER_NAME "Metasystem UPS driver" -#define DRIVER_VERSION "0.08" +#define DRIVER_VERSION "0.09" /* driver description structure */ upsdrv_info_t upsdrv_info = { diff --git a/drivers/mge-utalk.c b/drivers/mge-utalk.c index ba8181ae29..ec27989745 100644 --- a/drivers/mge-utalk.c +++ b/drivers/mge-utalk.c @@ -69,7 +69,7 @@ /* --------------------------------------------------------------- */ #define DRIVER_NAME "MGE UPS SYSTEMS/U-Talk driver" -#define DRIVER_VERSION "0.94" +#define DRIVER_VERSION "0.95" /* driver description structure */ diff --git a/drivers/microdowell.c b/drivers/microdowell.c index 9874ead239..9b2637ea81 100644 --- a/drivers/microdowell.c +++ b/drivers/microdowell.c @@ -44,7 +44,7 @@ #define MAX_SHUTDOWN_DELAY_LEN 5 #define DRIVER_NAME "MICRODOWELL UPS driver" -#define DRIVER_VERSION "0.02" +#define DRIVER_VERSION "0.03" /* driver description structure */ upsdrv_info_t upsdrv_info = { diff --git a/drivers/microsol-apc.c b/drivers/microsol-apc.c index 20e0cd3466..329263703f 100644 --- a/drivers/microsol-apc.c +++ b/drivers/microsol-apc.c @@ -35,7 +35,7 @@ #include "microsol-apc.h" #define DRIVER_NAME "APC Back-UPS BR series UPS driver" -#define DRIVER_VERSION "0.69" +#define DRIVER_VERSION "0.70" /* driver description structure */ upsdrv_info_t upsdrv_info = { diff --git a/drivers/netxml-ups.c b/drivers/netxml-ups.c index 13b0a6da5c..f58d194e98 100644 --- a/drivers/netxml-ups.c +++ b/drivers/netxml-ups.c @@ -42,7 +42,7 @@ #include "nut_stdint.h" #define DRIVER_NAME "network XML UPS" -#define DRIVER_VERSION "0.44" +#define DRIVER_VERSION "0.45" /** *_OBJECT query multi-part body boundary */ #define FORM_POST_BOUNDARY "NUT-NETXML-UPS-OBJECTS" diff --git a/drivers/nut-ipmipsu.c b/drivers/nut-ipmipsu.c index dedbd8ab7e..1ed5ea72ad 100644 --- a/drivers/nut-ipmipsu.c +++ b/drivers/nut-ipmipsu.c @@ -27,7 +27,7 @@ #include "nut-ipmi.h" #define DRIVER_NAME "IPMI PSU driver" -#define DRIVER_VERSION "0.31" +#define DRIVER_VERSION "0.32" /* driver description structure */ upsdrv_info_t upsdrv_info = { diff --git a/drivers/nut_libusb.h b/drivers/nut_libusb.h index b7906d2ce8..8b2a644341 100644 --- a/drivers/nut_libusb.h +++ b/drivers/nut_libusb.h @@ -11,7 +11,7 @@ * * The logic of this file is ripped from mge-shut driver (also from * Arnaud Quette), which is a "HID over serial link" UPS driver for - * Network UPS Tools + * Network UPS Tools * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/drivers/nutdrv_atcl_usb.c b/drivers/nutdrv_atcl_usb.c index f88d4c6a85..b87a3eff35 100644 --- a/drivers/nutdrv_atcl_usb.c +++ b/drivers/nutdrv_atcl_usb.c @@ -28,7 +28,7 @@ /* driver version */ #define DRIVER_NAME "'ATCL FOR UPS' USB driver" -#define DRIVER_VERSION "1.16" +#define DRIVER_VERSION "1.17" /* driver description structure */ upsdrv_info_t upsdrv_info = { diff --git a/drivers/nutdrv_qx.c b/drivers/nutdrv_qx.c index c40b44f309..602acfd821 100644 --- a/drivers/nutdrv_qx.c +++ b/drivers/nutdrv_qx.c @@ -38,8 +38,6 @@ * */ -#define DRIVER_VERSION "0.34" - #include "config.h" #include "main.h" #include "attribute.h" @@ -59,6 +57,8 @@ #define DRIVER_NAME "Generic Q* Serial driver" #endif /* QX_USB */ +#define DRIVER_VERSION "0.34" + #ifdef QX_SERIAL #include "serial.h" #define SER_WAIT_SEC 1 /* 3 seconds for Best UPS */ diff --git a/drivers/nutdrv_siemens_sitop.c b/drivers/nutdrv_siemens_sitop.c index d722213a77..ec84f4609d 100644 --- a/drivers/nutdrv_siemens_sitop.c +++ b/drivers/nutdrv_siemens_sitop.c @@ -56,7 +56,7 @@ #include "nut_stdint.h" #define DRIVER_NAME "Siemens SITOP UPS500 series driver" -#define DRIVER_VERSION "0.03" +#define DRIVER_VERSION "0.04" #define RX_BUFFER_SIZE 100 diff --git a/drivers/oneac.c b/drivers/oneac.c index 4d6dd69b34..0bb30d1f47 100644 --- a/drivers/oneac.c +++ b/drivers/oneac.c @@ -48,7 +48,7 @@ int setcmd(const char* varname, const char* setvalue); int instcmd(const char *cmdname, const char *extra); #define DRIVER_NAME "Oneac EG/ON/OZ/OB UPS driver" -#define DRIVER_VERSION "0.81" +#define DRIVER_VERSION "0.82" /* driver description structure */ upsdrv_info_t upsdrv_info = { diff --git a/drivers/optiups.c b/drivers/optiups.c index ade3441d65..eddd94e173 100644 --- a/drivers/optiups.c +++ b/drivers/optiups.c @@ -28,7 +28,7 @@ #include "nut_stdint.h" #define DRIVER_NAME "Opti-UPS driver" -#define DRIVER_VERSION "1.02" +#define DRIVER_VERSION "1.03" /* driver description structure */ upsdrv_info_t upsdrv_info = { @@ -62,7 +62,7 @@ upsdrv_info_t upsdrv_info = { "It works even with a pl2303 usb-serial converter." "\n" \ "**********************************************************" "\n" -/* See http://www.networkupstools.org/protocols/optiups.html and the end of this +/* See https://www.networkupstools.org/protocols/optiups.html and the end of this * file for more information on the cable and the OPTI-UPS serial protocol used on * at least the older OPTI UPS models (420E, 820ES). */ diff --git a/drivers/phoenixcontact_modbus.c b/drivers/phoenixcontact_modbus.c index 9bfee7d916..13aa8a0b41 100644 --- a/drivers/phoenixcontact_modbus.c +++ b/drivers/phoenixcontact_modbus.c @@ -24,7 +24,7 @@ #include #define DRIVER_NAME "NUT PhoenixContact Modbus driver" -#define DRIVER_VERSION "0.02" +#define DRIVER_VERSION "0.03" #define CHECK_BIT(var,pos) ((var) & (1<<(pos))) #define MODBUS_SLAVE_ID 192 diff --git a/drivers/pijuice.c b/drivers/pijuice.c index 1229984365..2f589bcbfa 100644 --- a/drivers/pijuice.c +++ b/drivers/pijuice.c @@ -218,7 +218,7 @@ static inline __u8* i2c_smbus_read_i2c_block_data(int file, __u8 command, __u8 l #define NOMINAL_BATTERY_VOLTAGE 4.18 #define DRIVER_NAME "PiJuice UPS driver" -#define DRIVER_VERSION "0.10" +#define DRIVER_VERSION "0.11" static uint8_t i2c_address = 0x14; static uint8_t shutdown_delay = 30; diff --git a/drivers/powercom.c b/drivers/powercom.c index 7f9819a9ec..8b22f74c84 100644 --- a/drivers/powercom.c +++ b/drivers/powercom.c @@ -85,8 +85,8 @@ #include "powercom.h" #include "math.h" -#define DRIVER_NAME "PowerCom protocol UPS driver" -#define DRIVER_VERSION "0.20" +#define DRIVER_NAME "PowerCom protocol UPS driver" +#define DRIVER_VERSION "0.21" /* driver description structure */ upsdrv_info_t upsdrv_info = { diff --git a/drivers/powerman-pdu.c b/drivers/powerman-pdu.c index 46a432b21a..316950a47c 100644 --- a/drivers/powerman-pdu.c +++ b/drivers/powerman-pdu.c @@ -23,7 +23,7 @@ #include /* pm_err_t and other beasts */ #define DRIVER_NAME "Powerman PDU client driver" -#define DRIVER_VERSION "0.12" +#define DRIVER_VERSION "0.13" /* driver description structure */ upsdrv_info_t upsdrv_info = { diff --git a/drivers/powerpanel.c b/drivers/powerpanel.c index 6c677b8ef9..9ec775784e 100644 --- a/drivers/powerpanel.c +++ b/drivers/powerpanel.c @@ -36,7 +36,7 @@ static subdriver_t *subdriver[] = { }; #define DRIVER_NAME "CyberPower text/binary protocol UPS driver" -#define DRIVER_VERSION "0.28" +#define DRIVER_VERSION "0.29" /* driver description structure */ upsdrv_info_t upsdrv_info = { diff --git a/drivers/rhino.c b/drivers/rhino.c index b1eaf9e9ef..6ceab04158 100644 --- a/drivers/rhino.c +++ b/drivers/rhino.c @@ -37,8 +37,8 @@ #include "nut_stdint.h" #include "timehead.h" -#define DRIVER_NAME "Microsol Rhino UPS driver" -#define DRIVER_VERSION "0.52" +#define DRIVER_NAME "Microsol Rhino UPS driver" +#define DRIVER_VERSION "0.53" /* driver description structure */ upsdrv_info_t upsdrv_info = { diff --git a/drivers/richcomm_usb.c b/drivers/richcomm_usb.c index 42dff8953c..15451a49db 100644 --- a/drivers/richcomm_usb.c +++ b/drivers/richcomm_usb.c @@ -30,7 +30,7 @@ /* driver version */ #define DRIVER_NAME "Richcomm dry-contact to USB driver" -#define DRIVER_VERSION "0.11" +#define DRIVER_VERSION "0.12" /* driver description structure */ upsdrv_info_t upsdrv_info = { diff --git a/drivers/riello.c b/drivers/riello.c index 48cc1cd1db..fe1de5c905 100644 --- a/drivers/riello.c +++ b/drivers/riello.c @@ -4,8 +4,8 @@ * Documents describing the protocol implemented by this driver can be * found online at: * - * https://networkupstools.org/protocols/riello/PSGPSER-0104.pdf - * https://networkupstools.org/protocols/riello/PSSENTR-0100.pdf + * https://www.networkupstools.org/protocols/riello/PSGPSER-0104.pdf + * https://www.networkupstools.org/protocols/riello/PSSENTR-0100.pdf * * Copyright (C) 2012 - Elio Parisi * diff --git a/drivers/riello.h b/drivers/riello.h index a2ab948701..e513f638b2 100644 --- a/drivers/riello.h +++ b/drivers/riello.h @@ -4,8 +4,8 @@ * Documents describing the protocol implemented by this driver can be * found online at: * - * https://networkupstools.org/protocols/riello/PSGPSER-0104.pdf - * https://networkupstools.org/protocols/riello/PSSENTR-0100.pdf + * https://www.networkupstools.org/protocols/riello/PSGPSER-0104.pdf + * https://www.networkupstools.org/protocols/riello/PSSENTR-0100.pdf * * Copyright (C) 2012 - Elio Parisi * diff --git a/drivers/riello_ser.c b/drivers/riello_ser.c index cd3b8a997e..2d5e85aa1f 100644 --- a/drivers/riello_ser.c +++ b/drivers/riello_ser.c @@ -2,8 +2,8 @@ * riello_ser.c: support for Riello serial protocol based UPSes * * A document describing the protocol implemented by this driver can be - * found online at "https://networkupstools.org/protocols/riello/PSGPSER-0104.pdf" - * and "https://networkupstools.org/protocols/riello/PSSENTR-0100.pdf". + * found online at "https://www.networkupstools.org/protocols/riello/PSGPSER-0104.pdf" + * and "https://www.networkupstools.org/protocols/riello/PSSENTR-0100.pdf". * * Copyright (C) 2012 - Elio Parisi * @@ -46,7 +46,7 @@ #include "riello.h" #define DRIVER_NAME "Riello serial driver" -#define DRIVER_VERSION "0.07" +#define DRIVER_VERSION "0.08" #define DEFAULT_OFFDELAY 5 #define DEFAULT_BOOTDELAY 5 diff --git a/drivers/riello_usb.c b/drivers/riello_usb.c index f6047129b9..b0c6a51b5a 100644 --- a/drivers/riello_usb.c +++ b/drivers/riello_usb.c @@ -4,7 +4,7 @@ * A document describing the protocol implemented by this driver can be * found online at: * - * https://networkupstools.org/protocols/riello/PSGPSER-0104.pdf + * https://www.networkupstools.org/protocols/riello/PSGPSER-0104.pdf * * Copyright (C) 2012 - Elio Parisi * Copyright (C) 2016 Eaton @@ -34,7 +34,7 @@ #include "riello.h" #define DRIVER_NAME "Riello USB driver" -#define DRIVER_VERSION "0.08" +#define DRIVER_VERSION "0.09" #define DEFAULT_OFFDELAY 5 /*!< seconds (max 0xFF) */ #define DEFAULT_BOOTDELAY 5 /*!< seconds (max 0xFF) */ diff --git a/drivers/safenet.c b/drivers/safenet.c index df5da33d89..68365463fa 100644 --- a/drivers/safenet.c +++ b/drivers/safenet.c @@ -41,7 +41,7 @@ #include "safenet.h" #define DRIVER_NAME "Generic SafeNet UPS driver" -#define DRIVER_VERSION "1.7" +#define DRIVER_VERSION "1.80" /* driver description structure */ upsdrv_info_t upsdrv_info = { diff --git a/drivers/skel.c b/drivers/skel.c index e79d5d8ea8..b5033672bb 100644 --- a/drivers/skel.c +++ b/drivers/skel.c @@ -22,7 +22,7 @@ /* #define IGNCHARS "" */ #define DRIVER_NAME "Skeleton UPS driver" -#define DRIVER_VERSION "0.03" +#define DRIVER_VERSION "0.04" /* driver description structure */ upsdrv_info_t upsdrv_info = { diff --git a/drivers/snmp-ups.c b/drivers/snmp-ups.c index efb9d53f8e..558c72e61f 100644 --- a/drivers/snmp-ups.c +++ b/drivers/snmp-ups.c @@ -104,6 +104,7 @@ static mib2nut_info_t *mib2nut[] = { &bestpower, /* This struct comes from : bestpower-mib.c */ &compaq, /* This struct comes from : compaq-mib.c */ &cyberpower, /* This struct comes from : cyberpower-mib.c */ + &cyberpower2, /* This struct comes from : cyberpower-mib.c */ &delta_ups, /* This struct comes from : delta_ups-mib.c */ &eaton_ats16_nmc, /* This struct comes from : eaton-ats16-nmc-mib.c */ &eaton_ats16_nm2, /* This struct comes from : eaton-ats16-nm2-mib.c */ @@ -173,7 +174,7 @@ static const char *mibname; static const char *mibvers; #define DRIVER_NAME "Generic SNMP UPS driver" -#define DRIVER_VERSION "1.28" +#define DRIVER_VERSION "1.30" /* driver description structure */ upsdrv_info_t upsdrv_info = { diff --git a/drivers/socomec_jbus.c b/drivers/socomec_jbus.c index 8eabe35844..84d585d39b 100644 --- a/drivers/socomec_jbus.c +++ b/drivers/socomec_jbus.c @@ -31,7 +31,7 @@ #include #define DRIVER_NAME "Socomec jbus driver" -#define DRIVER_VERSION "0.06" +#define DRIVER_VERSION "0.07" #define CHECK_BIT(var,pos) ((var) & (1<<(pos))) #define MODBUS_SLAVE_ID 1 diff --git a/drivers/solis.c b/drivers/solis.c index 364a21a55e..eb1cee47d0 100644 --- a/drivers/solis.c +++ b/drivers/solis.c @@ -48,7 +48,7 @@ #include "timehead.h" #define DRIVER_NAME "Microsol Solis UPS driver" -#define DRIVER_VERSION "0.68" +#define DRIVER_VERSION "0.69" /* driver description structure */ upsdrv_info_t upsdrv_info = { diff --git a/drivers/tripplite.c b/drivers/tripplite.c index a236e5ca0d..76ec0b0a8a 100644 --- a/drivers/tripplite.c +++ b/drivers/tripplite.c @@ -117,7 +117,7 @@ #include #define DRIVER_NAME "Tripp-Lite SmartUPS driver" -#define DRIVER_VERSION "0.93" +#define DRIVER_VERSION "0.94" /* driver description structure */ upsdrv_info_t upsdrv_info = { diff --git a/drivers/tripplite_usb.c b/drivers/tripplite_usb.c index 96abce57d1..84508f8f2e 100644 --- a/drivers/tripplite_usb.c +++ b/drivers/tripplite_usb.c @@ -135,8 +135,8 @@ #include #include "usb-common.h" -#define DRIVER_NAME "Tripp Lite OMNIVS / SMARTPRO driver" -#define DRIVER_VERSION "0.33" +#define DRIVER_NAME "Tripp Lite OMNIVS / SMARTPRO driver" +#define DRIVER_VERSION "0.34" /* driver description structure */ upsdrv_info_t upsdrv_info = { diff --git a/drivers/tripplitesu.c b/drivers/tripplitesu.c index 3a0d2c5469..a5e5d05da0 100644 --- a/drivers/tripplitesu.c +++ b/drivers/tripplitesu.c @@ -125,8 +125,8 @@ #include "serial.h" #include "nut_stdint.h" -#define DRIVER_NAME "Tripp Lite SmartOnline driver" -#define DRIVER_VERSION "0.06" +#define DRIVER_NAME "Tripp Lite SmartOnline driver" +#define DRIVER_VERSION "0.07" /* driver description structure */ upsdrv_info_t upsdrv_info = { diff --git a/drivers/upscode2.c b/drivers/upscode2.c index 4bbcd976be..5dac03bf20 100644 --- a/drivers/upscode2.c +++ b/drivers/upscode2.c @@ -43,7 +43,7 @@ #include "nut_float.h" #define DRIVER_NAME "UPScode II UPS driver" -#define DRIVER_VERSION "0.90" +#define DRIVER_VERSION "0.91" /* driver description structure */ upsdrv_info_t upsdrv_info = { diff --git a/drivers/upsdrvquery.c b/drivers/upsdrvquery.c index 1cc54c079a..86f9a04c58 100644 --- a/drivers/upsdrvquery.c +++ b/drivers/upsdrvquery.c @@ -218,8 +218,8 @@ ssize_t upsdrvquery_read_timeout(udq_pipe_conn_t *conn, struct timeval tv) { return -1; */ DWORD bytesRead = 0; - BOOL res = FALSE; - time_t start, now, presleep; + BOOL res = FALSE; + struct timeval start, now, presleep; /* Is GetLastError() required to move on if pipe has more data? * if (GetLastError() == ERROR_IO_PENDING) { @@ -231,7 +231,7 @@ ssize_t upsdrvquery_read_timeout(udq_pipe_conn_t *conn, struct timeval tv) { conn->newread = 0; } - time(&start); + gettimeofday(&start, NULL); while (res == FALSE /*&& bytesRead == 0*/) { res = GetOverlappedResult(conn->sockfd, &conn->overlapped, &bytesRead, FALSE); if (res != FALSE /*|| bytesRead != 0*/) @@ -241,34 +241,64 @@ ssize_t upsdrvquery_read_timeout(udq_pipe_conn_t *conn, struct timeval tv) { upsdebugx(5, "%s: pipe read error (no incoming data), proceeding now", __func__); break; } - upsdebugx(6, "%s: pipe read error, waiting for data", __func__); - - /* Throttle down a bit */ - time(&presleep); - usleep(100); /* obsoleted in win32, so follow up below */ - - time(&now); - if (difftime(now, presleep) < 0.1) { + upsdebugx(6, "%s: pipe read error, still waiting for data", __func__); + + /* Throttle down a bit, 0.1 sec (10^5 * 10^-6) should do it conveniently */ + gettimeofday(&presleep, NULL); + usleep(100000); /* obsoleted in win32, so follow up below */ + + gettimeofday(&now, NULL); + /* NOTE: This code may report a "diff=1.-894714 (0.105286)" + * which looks bogus, but for troubleshooting we don't care + */ + upsdebugx(7, "%s: presleep=%ld.%06ld now=%ld.%06ld diff=%4.0f.%06ld (%f)", + __func__, presleep.tv_sec, presleep.tv_usec, + now.tv_sec, now.tv_usec, + difftime(now.tv_sec, presleep.tv_sec), + (long)(now.tv_usec - presleep.tv_usec), + difftimeval(now, presleep) + ); + + /* accept shorter delays, Windows does not guarantee a minimum sleep it seems */ + if (difftimeval(now, presleep) < 0.05) { /* https://stackoverflow.com/a/17283549 */ - HANDLE timer; - LARGE_INTEGER ft; + HANDLE timer; + LARGE_INTEGER ft; /* SetWaitableTimer() uses 100 nanosecond intervals, * and a negative value indicates relative time: */ - ft.QuadPart = -(10*100); /* 100 usec */ - - timer = CreateWaitableTimer(NULL, TRUE, NULL); - SetWaitableTimer(timer, &ft, 0, NULL, NULL, 0); - WaitForSingleObject(timer, INFINITE); - CloseHandle(timer); + ft.QuadPart = -(10*100000); /* 100 msec */ + + timer = CreateWaitableTimer(NULL, TRUE, NULL); + SetWaitableTimer(timer, &ft, 0, NULL, NULL, 0); + WaitForSingleObject(timer, INFINITE); + CloseHandle(timer); + + gettimeofday(&now, NULL); + upsdebugx(7, "%s: presleep=%ld.%06ld now=%ld.%06ld diff=%4.0f.%06ld (%f)", + __func__, presleep.tv_sec, presleep.tv_usec, + now.tv_sec, now.tv_usec, + difftime(now.tv_sec, presleep.tv_sec), + (long)(now.tv_usec - presleep.tv_usec), + difftimeval(now, presleep) + ); } - time(&now); - if (difftime(now, presleep) < 0.1) + /* If nothing was honored, doze off for a whole second */ + if (difftimeval(now, presleep) < 0.05) { sleep(1); - time(&now); - if (difftime(now, start) > tv.tv_sec + 0.001 * tv.tv_usec) { + gettimeofday(&now, NULL); + upsdebugx(7, "%s: presleep=%ld.%06ld now=%ld.%06ld diff=%4.0f.%06ld (%f)", + __func__, presleep.tv_sec, presleep.tv_usec, + now.tv_sec, now.tv_usec, + difftime(now.tv_sec, presleep.tv_sec), + (long)(now.tv_usec - presleep.tv_usec), + difftimeval(now, presleep) + ); + } + + if (difftimeval(now, start) > (tv.tv_sec + 0.000001 * tv.tv_usec)) { upsdebugx(5, "%s: pipe read error, timeout exceeded", __func__); break; } @@ -327,7 +357,7 @@ ssize_t upsdrvquery_write(udq_pipe_conn_t *conn, const char *buf) { } ssize_t upsdrvquery_prepare(udq_pipe_conn_t *conn, struct timeval tv) { - time_t start, now; + struct timeval start, now; /* Avoid noise */ if (upsdrvquery_write(conn, "NOBROADCAST\n") < 0) @@ -339,19 +369,54 @@ ssize_t upsdrvquery_prepare(udq_pipe_conn_t *conn, struct timeval tv) { } /* flush incoming, if any */ - time(&start); + gettimeofday(&start, NULL); + + if (upsdrvquery_write(conn, "PING\n") < 0) + goto socket_error; upsdebugx(5, "%s: waiting for a while to flush server messages", __func__); while (1) { + char *buf; upsdrvquery_read_timeout(conn, tv); - time(&now); - if (difftime(now, start) > tv.tv_sec + 0.001 * tv.tv_usec) + gettimeofday(&now, NULL); + if (difftimeval(now, start) > (tv.tv_sec + 0.000001 * tv.tv_usec)) { + upsdebugx(5, "%s: requested timeout expired", __func__); break; + } + + /* Await a PONG for quick confirmation of achieved quietness + * (should only happen after the driver handled NOBROADCAST) + */ +#ifdef WIN32 + /* Allow a new read to happen later */ + conn->newread = 1; +#endif + + buf = conn->buf; + while (buf && *buf) { + if (!strncmp(buf, "PONG\n", 5)) { + upsdebugx(5, "%s: got expected PONG", __func__); + goto finish; + } + buf = strchr(buf, '\n'); + if (buf) { +/* + upsdebugx(5, "%s: trying next line of multi-line response: %s", + __func__, buf); +*/ + buf++; /* skip EOL char */ + } + } + /* Diminishing timeouts for read() */ - tv.tv_usec -= difftime(now, start); + tv.tv_usec -= difftimeval(now, start); while (tv.tv_usec < 0) { - tv.tv_sec--; - tv.tv_usec = 1000 - tv.tv_usec; + tv.tv_sec--; + tv.tv_usec = 1000000 + tv.tv_usec; // Note it is negative + } + if (tv.tv_sec <= 0 && tv.tv_usec <= 0) { + upsdebugx(5, "%s: requested timeout expired", __func__); + break; } } @@ -368,6 +433,7 @@ ssize_t upsdrvquery_prepare(udq_pipe_conn_t *conn, struct timeval tv) { } */ +finish: upsdebugx(5, "%s: ready for tracked commands", __func__); return 1; @@ -411,7 +477,7 @@ ssize_t upsdrvquery_request( char qbuf[LARGEBUF]; size_t qlen; char tracking_id[UUID4_LEN]; - time_t start, now; + struct timeval start, now; if (snprintf(qbuf, sizeof(qbuf), "%s", query) < 0) goto socket_error; @@ -435,17 +501,17 @@ ssize_t upsdrvquery_request( upsdebugx(1, "%s: will wait indefinitely for response to %s", __func__, query); } else { - while (tv.tv_usec >= 1000) { - tv.tv_usec -= 1000; + while (tv.tv_usec >= 1000000) { + tv.tv_usec -= 1000000; tv.tv_sec++; } upsdebugx(5, "%s: will wait up to %" PRIiMAX - ".%03" PRIiMAX " sec for response to %s", + ".%06" PRIiMAX " sec for response to %s", __func__, (intmax_t)tv.tv_sec, (intmax_t)tv.tv_usec, query); } - time(&start); + gettimeofday(&start, NULL); while (1) { char *buf; if (upsdrvquery_read_timeout(conn, tv) < 1) @@ -484,15 +550,15 @@ ssize_t upsdrvquery_request( } } - time(&now); + gettimeofday(&now, NULL); if (tv.tv_sec < 1 && tv.tv_usec < 1) { - if ( ((long)(difftime(now, start))) % 60 == 0 ) + if ( ((long)(difftimeval(now, start))) % 60 == 0 ) upsdebugx(5, "%s: waiting indefinitely for response to %s", __func__, query); sleep(1); continue; } - if (difftime(now, start) > tv.tv_sec + 0.001 * tv.tv_usec) { + if (difftimeval(now, start) > (tv.tv_sec + 0.000001 * tv.tv_usec)) { upsdebugx(5, "%s: timed out waiting for expected response", __func__); return -1; @@ -511,8 +577,8 @@ ssize_t upsdrvquery_oneshot( struct timeval *ptv ) { struct timeval tv; - ssize_t ret; - udq_pipe_conn_t *conn = upsdrvquery_connect_drvname_upsname(drvname, upsname); + ssize_t ret; + udq_pipe_conn_t *conn = upsdrvquery_connect_drvname_upsname(drvname, upsname); if (!conn || INVALID_FD(conn->sockfd)) return -1; @@ -521,14 +587,14 @@ ssize_t upsdrvquery_oneshot( * being blocked on other commands, etc. Number so far is * arbitrary and optimistic. A non-zero setting causes a * long initial silence to flush incoming buffers after - * the NOBROADCAST. In practice, we do not expect messages - * from dstate::send_to_all() to be a nuisance, since we - * have just connected and posted the NOBROADCAST so there - * is little chance that something appears in that short - * time. Also now we know to ignore replies that are not - * TRACKING + * the NOBROADCAST. In practice, we do not expect messages + * from dstate::send_to_all() to be a nuisance, since we + * have just connected and posted the NOBROADCAST so there + * is little chance that something appears in that short + * time. Also now we know to ignore replies that are not + * TRACKING */ - tv.tv_sec = 0; + tv.tv_sec = 3; tv.tv_usec = 0; /* Here we have a fragile simplistic parser that diff --git a/drivers/usbhid-ups.c b/drivers/usbhid-ups.c index 38d9c35eea..3a8cc7120a 100644 --- a/drivers/usbhid-ups.c +++ b/drivers/usbhid-ups.c @@ -28,7 +28,8 @@ */ #define DRIVER_NAME "Generic HID driver" -#define DRIVER_VERSION "0.49" +#define DRIVER_VERSION "0.50" + #define HU_VAR_WAITBEFORERECONNECT "waitbeforereconnect" #include "main.h" diff --git a/drivers/victronups.c b/drivers/victronups.c index f4f6ad6045..49901f43bf 100644 --- a/drivers/victronups.c +++ b/drivers/victronups.c @@ -32,7 +32,7 @@ #include "serial.h" #define DRIVER_NAME "GE/IMV/Victron UPS driver" -#define DRIVER_VERSION "0.21" +#define DRIVER_VERSION "0.22" /* driver description structure */ upsdrv_info_t upsdrv_info = { diff --git a/include/Makefile.am b/include/Makefile.am index 38e1c69c45..e9bcdd88f6 100644 --- a/include/Makefile.am +++ b/include/Makefile.am @@ -18,7 +18,7 @@ MAINTAINERCLEANFILES = Makefile.in .dirstamp # (for builds not made from the tagged commit in a Git workspace) nut_version.h: @FORCE_NUT_VERSION@ - @GITREV="`git describe --tags 2>/dev/null | sed -e 's/^v\([0-9]\)/\1/' -e 's,^.*/,,'`" || GITREV=""; \ + @GITREV="`git describe --tags --match 'v[0-9]*.[0-9]*.[0-9]' --exclude '*-signed' --exclude '*rc*' --exclude '*alpha*' --exclude '*beta*' 2>/dev/null | sed -e 's/^v\([0-9]\)/\1/' -e 's,^.*/,,'`" || GITREV=""; \ { echo '/* Autogenerated file. Do not change. */' ; \ echo '/* This file was generated by "make". */' ; \ if [ -z "$$GITREV" ]; then \ diff --git a/include/common.h b/include/common.h index c402f5677f..3d0052f8fd 100644 --- a/include/common.h +++ b/include/common.h @@ -407,6 +407,12 @@ char * getfullpath(char * relative_path); #define PATH_LIB "\\..\\lib" #endif /* WIN32*/ +/* Return a difference of two timevals as a floating-point number */ +double difftimeval(struct timeval x, struct timeval y); +#if defined(HAVE_CLOCK_GETTIME) && defined(HAVE_CLOCK_MONOTONIC) && HAVE_CLOCK_GETTIME && HAVE_CLOCK_MONOTONIC +double difftimespec(struct timespec x, struct timespec y); +#endif + #ifndef HAVE_USLEEP /* int __cdecl usleep(unsigned int useconds); */ /* Note: if we'd need to define an useconds_t for obscure systems, diff --git a/include/state.h b/include/state.h index 97249a2726..60dc3433fe 100644 --- a/include/state.h +++ b/include/state.h @@ -32,6 +32,12 @@ extern "C" { #define ST_SOCK_BUF_LEN 512 +#if defined(HAVE_CLOCK_GETTIME) && defined(HAVE_CLOCK_MONOTONIC) && HAVE_CLOCK_GETTIME && HAVE_CLOCK_MONOTONIC +typedef struct timespec st_tree_timespec_t; +#else +typedef struct timeval st_tree_timespec_t; +#endif + typedef struct st_tree_s { char *var; char *val; /* points to raw or safe */ @@ -45,6 +51,12 @@ typedef struct st_tree_s { int flags; long aux; + /* When was this entry last written (meaning that + * val/raw/safe, flags, aux, enum or range value + * was added, changed or deleted)? + */ + st_tree_timespec_t lastset; + struct enum_s *enum_list; struct range_s *range_list; @@ -52,6 +64,8 @@ typedef struct st_tree_s { struct st_tree_s *right; } st_tree_t; +int state_get_timestamp(st_tree_timespec_t *now); +int st_tree_node_compare_timestamp(const st_tree_t *node, const st_tree_timespec_t *cutoff); int state_setinfo(st_tree_t **nptr, const char *var, const char *val); int state_addenum(st_tree_t *root, const char *var, const char *val); int state_addrange(st_tree_t *root, const char *var, const int min, const int max); @@ -67,6 +81,7 @@ void state_infofree(st_tree_t *node); void state_cmdfree(cmdlist_t *list); int state_delcmd(cmdlist_t **list, const char *cmd); int state_delinfo(st_tree_t **root, const char *var); +int state_delinfo_olderthan(st_tree_t **root, const char *var, const st_tree_timespec_t *cutoff); int state_delenum(st_tree_t *root, const char *var, const char *val); int state_delrange(st_tree_t *root, const char *var, const int min, const int max); st_tree_t *state_tree_find(st_tree_t *node, const char *var); diff --git a/indent.sh b/indent.sh index 4c1826f309..0aaf571f32 100755 --- a/indent.sh +++ b/indent.sh @@ -1,7 +1,7 @@ #!/bin/bash # Filter NUT C source file style to conform to recommendations of -# http://networkupstools.org/docs/developer-guide.chunked/ar01s03.html#_coding_style +# https://www.networkupstools.org/docs/developer-guide.chunked/ar01s03.html#_coding_style # Note that the sed filter "command does a reasonable job of converting # most C++ style comments (but not URLs and DOCTYPE strings)" so a manual # pass may be needed to revise the changes. diff --git a/scripts/Aix/nut-aix.spec.in b/scripts/Aix/nut-aix.spec.in index 37e4934745..1302160dcf 100644 --- a/scripts/Aix/nut-aix.spec.in +++ b/scripts/Aix/nut-aix.spec.in @@ -17,8 +17,8 @@ Release: 1 Group: Applications/System License: GPLv2+ Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) -Url: http://www.networkupstools.org/ -Source: http://www.networkupstools.org/source/@TREE_VERSION@/%{name}-%{version}.tar.gz +Url: https://www.networkupstools.org/ +Source: https://www.networkupstools.org/source/@TREE_VERSION@/%{name}-%{version}.tar.gz Source1: nut.init #Source2: ups.sysconfig #Source3: nut-client.tmpfiles diff --git a/scripts/Solaris/pkginfo.in b/scripts/Solaris/pkginfo.in index 39667f0a79..2cbbb3fb42 100644 --- a/scripts/Solaris/pkginfo.in +++ b/scripts/Solaris/pkginfo.in @@ -3,7 +3,7 @@ NAME="Network UPS Tools" ARCH="@target_cpu@" VERSION="@PACKAGE_VERSION@" CATEGORY="application" -VENDOR="http://www.networkupstools.org" +VENDOR="https://www.networkupstools.org" EMAIL=" " PSTAMP=" " DESCRIPTION="Network UPS Tools (NUT) is a client/server monitoring system that allows computers to share uninterruptible power supply (UPS) and power distribution unit (PDU) hardware. Clients access the hardware through the server, and are notified whenever the power status changes." diff --git a/scripts/Windows/build-mingw-nut.sh b/scripts/Windows/build-mingw-nut.sh index f4d7b28046..b557ace3c6 100755 --- a/scripts/Windows/build-mingw-nut.sh +++ b/scripts/Windows/build-mingw-nut.sh @@ -38,7 +38,7 @@ stable) # Stable version (download the latest stable archive) VER_OPT_SHORT="`echo "$VER_OPT" | awk -F. '{print $1"."$2}'`" if [ ! -s nut-$VER_OPT.tar.gz ] ; then - wget http://www.networkupstools.org/source/$VER_OPT_SHORT/nut-$VER_OPT.tar.gz + wget https://www.networkupstools.org/source/$VER_OPT_SHORT/nut-$VER_OPT.tar.gz fi rm -rf nut-$VER_OPT tar -xzf nut-$VER_OPT.tar.gz diff --git a/scripts/perl/Nut.pm b/scripts/perl/Nut.pm index f4f81f27f6..25d56dba21 100644 --- a/scripts/perl/Nut.pm +++ b/scripts/perl/Nut.pm @@ -728,7 +728,7 @@ Nut - a module to talk to a UPS via NUT (Network UPS Tools) upsd This is an object-oriented (whoo!) interface between Perl and upsd from the Network UPS Tools package version 1.5 and above -(http://www.networkupstools.org/). +(https://www.networkupstools.org/). Note that it only talks to upsd for you in a Perl-ish way. It doesn't monitor the UPS continously. diff --git a/scripts/python/Makefile.am b/scripts/python/Makefile.am index 542989d82c..68a31489dd 100644 --- a/scripts/python/Makefile.am +++ b/scripts/python/Makefile.am @@ -71,7 +71,7 @@ PYNUT_COMMON = \ module/README # Note: we both distribute and install the generated *.mo translation files -# so they are listed above and not in NUT_MONITOR_COMMON_GENERATED +# so they are listed above and not in NUT_MONITOR_COMMON_TEMPLATE NUT_MONITOR_COMMON_TEMPLATE = \ app/locale/NUT-Monitor.pot \ app/locale/fr/fr.po \ @@ -113,6 +113,32 @@ nutmonitordir = $(nut_with_nut_monitor_dir) nobase_nutmonitor_DATA = $(NUT_MONITOR_DISPATCHER_NOEXEC) $(NUT_MONITOR_COMMON) nobase_nutmonitor_SCRIPTS = $(NUT_MONITOR_DISPATCHER_SCRIPT) +if HAVE_MSGFMT +# Note lack of "$<" below - it is a non-portable GNU Make extension +# The POT-Creation-Date: is removed by current python gettext builder to avoid +# "spurious" changes that do not benefit (otherwise unmodified) contents; see: +# https://github.com/sphinx-doc/sphinx/pull/3490 +# https://github.com/sphinx-doc/sphinx/issues/3443 +# Note that OUTFILE may be in builddir (not necessarily same as srcdir) +ACT_MSGFMT = { \ + $(GREP) -v -E '^.?POT-Creation-Date: ' < "$${SRCFILE}" > "$${OUTFILE}.tmpsrc" && \ + $(MSGFMT) -o "$${OUTFILE}" "$${OUTFILE}.tmpsrc" && \ + rm -f "$${OUTFILE}.tmpsrc" ; \ +} + +app/locale/fr/LC_MESSAGES/NUT-Monitor.mo: app/locale/fr/fr.po + @$(MKDIR_P) "$(builddir)/app/locale/fr/LC_MESSAGES" + SRCFILE="$^"; OUTFILE="$@"; $(ACT_MSGFMT) + +app/locale/it/LC_MESSAGES/NUT-Monitor.mo: app/locale/it/it.po + @$(MKDIR_P) "$(builddir)/app/locale/it/LC_MESSAGES" + SRCFILE="$^"; OUTFILE="$@"; $(ACT_MSGFMT) + +app/locale/ru/LC_MESSAGES/NUT-Monitor.mo: app/locale/ru/ru.po + @$(MKDIR_P) "$(builddir)/app/locale/ru/LC_MESSAGES" + SRCFILE="$^"; OUTFILE="$@"; $(ACT_MSGFMT) +endif HAVE_MSGFMT + if WITH_NUT_MONITOR_PY2GTK2 nobase_nutmonitor_DATA += $(NUT_MONITOR_PY2GTK2) nobase_nutmonitor_SCRIPTS += $(NUT_MONITOR_PY2GTK2_GENERATED_SCRIPT) diff --git a/scripts/python/app/locale/NUT-Monitor.pot b/scripts/python/app/locale/NUT-Monitor.pot index caf9c6687c..d36e61af28 100644 --- a/scripts/python/app/locale/NUT-Monitor.pot +++ b/scripts/python/app/locale/NUT-Monitor.pot @@ -358,7 +358,7 @@ msgid "" "For more information about NUT (Network UPS Tools)\n" "please visit the author's website.\n" "\n" -"http://www.networkupstools.org\n" +"https://www.networkupstools.org\n" msgstr "" #: gui-1.3.glade.h:37 diff --git a/scripts/python/app/locale/fr/LC_MESSAGES/NUT-Monitor.mo b/scripts/python/app/locale/fr/LC_MESSAGES/NUT-Monitor.mo index ede50eb252..9b7d3f958c 100644 Binary files a/scripts/python/app/locale/fr/LC_MESSAGES/NUT-Monitor.mo and b/scripts/python/app/locale/fr/LC_MESSAGES/NUT-Monitor.mo differ diff --git a/scripts/python/app/locale/fr/fr.po b/scripts/python/app/locale/fr/fr.po index e46edd64b2..2eacbe8b2a 100644 --- a/scripts/python/app/locale/fr/fr.po +++ b/scripts/python/app/locale/fr/fr.po @@ -5,7 +5,7 @@ # msgid "" msgstr "" -"Project-Id-Version: PACKAGE VERSION\n" +"Project-Id-Version: NUT Monitor\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2013-10-14 22:47+0200\n" "PO-Revision-Date: 2013-10-14 22:50+0200\n" @@ -375,14 +375,14 @@ msgid "" "For more information about NUT (Network UPS Tools)\n" "please visit the author's website.\n" "\n" -"http://www.networkupstools.org\n" +"https://www.networkupstools.org\n" msgstr "" "Interface pour gérer les onduleurs connectés à un serveur NUT.\n" "\n" "Pour plus d'informations sur NUT (Network UPS Tools)\n" "veuillez consulter le site de l'auteur.\n" "\n" -"http://www.networkupstools.org\n" +"https://www.networkupstools.org\n" #: gui-1.3.glade.h:37 msgid "http://www.lestat.st" diff --git a/scripts/python/app/locale/it/LC_MESSAGES/NUT-Monitor.mo b/scripts/python/app/locale/it/LC_MESSAGES/NUT-Monitor.mo index 5a95c22f13..7aed48fadc 100644 Binary files a/scripts/python/app/locale/it/LC_MESSAGES/NUT-Monitor.mo and b/scripts/python/app/locale/it/LC_MESSAGES/NUT-Monitor.mo differ diff --git a/scripts/python/app/locale/it/it.po b/scripts/python/app/locale/it/it.po index ada6329947..da0287090e 100644 --- a/scripts/python/app/locale/it/it.po +++ b/scripts/python/app/locale/it/it.po @@ -375,14 +375,14 @@ msgid "" "For more information about NUT (Network UPS Tools)\n" "please visit the author's website.\n" "\n" -"http://www.networkupstools.org\n" +"https://www.networkupstools.org\n" msgstr "" "Interfaccia grafica per gestire dispositivi connessi a un server di NUT.\n" "\n" "Per maggiori informazioni su NUT (Network UPS Tools)\n" "si visiti il sito dell'autore.\n" "\n" -"http://www.networkupstools.org\n" +"https://www.networkupstools.org\n" #: gui-1.3.glade.h:37 msgid "http://www.lestat.st" diff --git a/scripts/python/app/locale/ru/LC_MESSAGES/NUT-Monitor.mo b/scripts/python/app/locale/ru/LC_MESSAGES/NUT-Monitor.mo index 89ee020832..a924cefbf7 100644 Binary files a/scripts/python/app/locale/ru/LC_MESSAGES/NUT-Monitor.mo and b/scripts/python/app/locale/ru/LC_MESSAGES/NUT-Monitor.mo differ diff --git a/scripts/python/app/locale/ru/ru.po b/scripts/python/app/locale/ru/ru.po index b163415e18..95bfcbc148 100644 --- a/scripts/python/app/locale/ru/ru.po +++ b/scripts/python/app/locale/ru/ru.po @@ -374,14 +374,14 @@ msgid "" "For more information about NUT (Network UPS Tools)\n" "please visit the author's website.\n" "\n" -"http://www.networkupstools.org\n" +"https://www.networkupstools.org\n" msgstr "" "Графическая утилита управления устройствами, подключенными к серверу NUT.\n" "\n" "Для получения дополнительной информации о NUT (Network UPS Tools)\n" "пожалуйста посетите веб-сайт проекта.\n" "\n" -"http://www.networkupstools.org\n" +"https://www.networkupstools.org\n" #: gui-1.3.glade.h:37 msgid "http://www.lestat.st" diff --git a/scripts/python/app/ui/aboutdialog1.ui b/scripts/python/app/ui/aboutdialog1.ui index c6a62148d7..f57969c33e 100644 --- a/scripts/python/app/ui/aboutdialog1.ui +++ b/scripts/python/app/ui/aboutdialog1.ui @@ -34,7 +34,7 @@ <h1>NUT-Monitor 1.3.1</h1> <p>GUI to manage devices connected a NUT server.</p> <p>For more information about NUT (Network UPS Tools) please visit the author's website.</p> -<p style="margin-bottom: 1.5em">http://www.networkupstools.org</p> +<p style="margin-bottom: 1.5em">https://www.networkupstools.org</p> <p style=" font-size:8pt;">Copyright (c) 2010 David Goncalves</p> <p><a href="http://www.lestat.st/informatique/projets/nut-monitor-en">http://www.lestat.st</a></p> diff --git a/scripts/python/app/ui/gui-1.3.glade b/scripts/python/app/ui/gui-1.3.glade index eb42aba3b0..5ab1f72836 100644 --- a/scripts/python/app/ui/gui-1.3.glade +++ b/scripts/python/app/ui/gui-1.3.glade @@ -1028,7 +1028,7 @@ want to delete from list... For more information about NUT (Network UPS Tools) please visit the author's website. -http://www.networkupstools.org +https://www.networkupstools.org http://www.lestat.st/informatique/projets/nut-monitor-en http://www.lestat.st diff --git a/scripts/python/app/ui/gui-1.3.glade.h b/scripts/python/app/ui/gui-1.3.glade.h index 8b9c95f164..33c3d4ecdd 100644 --- a/scripts/python/app/ui/gui-1.3.glade.h +++ b/scripts/python/app/ui/gui-1.3.glade.h @@ -32,7 +32,7 @@ char *s = N_("GUI to manage devices connected a NUT server.\n" "For more information about NUT (Network UPS Tools)\n" "please visit the author's website.\n" "\n" - "http://www.networkupstools.org\n" + "https://www.networkupstools.org\n" ""); char *s = N_("http://www.lestat.st"); char *s = N_("Copyright (C) 2010 David Goncalves \n" diff --git a/server/Makefile.am b/server/Makefile.am index 7e0b5d1074..fb18ff484b 100644 --- a/server/Makefile.am +++ b/server/Makefile.am @@ -38,11 +38,17 @@ else !HAVE_WINDOWS sockdebug_SOURCES = sockdebug.c endif !HAVE_WINDOWS +if WITH_DEV +# Have it installed properly +libexec_PROGRAMS = sockdebug +endif + dummy: MAINTAINERCLEANFILES = Makefile.in .dirstamp # NOTE: Do not clean ".deps" in SUBDIRS of the main project, # the root Makefile.am takes care of that! -#clean-local: +clean-local: + $(AM_V_at)rm -rf $(EXTRA_PROGRAMS) # $(AM_V_at)rm -rf $(builddir)/.deps diff --git a/server/netget.c b/server/netget.c index a5f822a569..c2a31fa354 100644 --- a/server/netget.c +++ b/server/netget.c @@ -165,7 +165,7 @@ static void get_var_server(nut_ctype_t *client, const char *upsname, const char if (!strcasecmp(var, "server.info")) { sendback(client, "VAR %s server.info " "\"Network UPS Tools upsd %s - " - "http://www.networkupstools.org/\"\n", + "https://www.networkupstools.org/\"\n", upsname, UPS_VERSION); return; } diff --git a/server/netmisc.c b/server/netmisc.c index 106d828709..ec4e8d28df 100644 --- a/server/netmisc.c +++ b/server/netmisc.c @@ -37,7 +37,7 @@ void net_ver(nut_ctype_t *client, size_t numarg, const char **arg) return; } - sendback(client, "Network UPS Tools upsd %s - http://www.networkupstools.org/\n", + sendback(client, "Network UPS Tools upsd %s - https://www.networkupstools.org/\n", UPS_VERSION); } diff --git a/server/sockdebug.c b/server/sockdebug.c index d8dbd6535c..b1c3addbdf 100644 --- a/server/sockdebug.c +++ b/server/sockdebug.c @@ -1,6 +1,8 @@ /* sockdebug.c - Network UPS Tools driver-server socket debugger + Source variant for POSIX-compliant builds of NUT Copyright (C) 2003 Russell Kroll + Copyright (C) 2023 Jim Klimov This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -30,7 +32,7 @@ #include "parseconf.h" #include "nut_stdint.h" - PCONF_CTX_t sock_ctx; +static PCONF_CTX_t sock_ctx; static void sock_arg(size_t numarg, char **arg) { @@ -64,6 +66,12 @@ static int socket_connect(const char *sockfn) ret = connect(fd, (struct sockaddr *) &sa, sizeof(sa)); + if (ret < 0 && !strchr(sockfn, '/')) { + snprintf(sa.sun_path, sizeof(sa.sun_path), "%s/%s", + dflt_statepath(), sockfn); + ret = connect(fd, (struct sockaddr *) &sa, sizeof(sa)); + } + if (ret < 0) { perror("connect"); exit(EXIT_FAILURE); @@ -128,8 +136,11 @@ int main(int argc, char **argv) || (argc > 1 && (!strcmp(argv[1], "-h") || !strcmp(argv[1], "--help"))) ) { fprintf(stderr, "usage: %s \n", prog); - fprintf(stderr, " %s /var/state/ups/apcsmart-ttyS1.newsock\n", + fprintf(stderr, " %s /var/state/ups/apcsmart-ttyS1\n", argv[0]); + fprintf(stderr, " or %s apcsmart-ttyS1\n", + argv[0]); + fprintf(stderr, " for socket files placed in the standard location\n"); exit(EXIT_SUCCESS); } @@ -175,6 +186,20 @@ int main(int argc, char **argv) } } +#if (defined HAVE_PRAGMA_GCC_DIAGNOSTIC_PUSH_POP) && (defined HAVE_PRAGMA_GCC_DIAGNOSTIC_IGNORED_UNREACHABLE_CODE) +# pragma GCC diagnostic push +# pragma GCC diagnostic ignored "-Wunreachable-code" +#endif +#ifdef __clang__ +# pragma clang diagnostic push +# pragma clang diagnostic ignored "-Wunreachable-code" +#endif /* NOTREACHED */ exit(EXIT_FAILURE); +#ifdef __clang__ +# pragma clang diagnostic pop +#endif +#if (defined HAVE_PRAGMA_GCC_DIAGNOSTIC_PUSH_POP) && (defined HAVE_PRAGMA_GCC_DIAGNOSTIC_IGNORED_UNREACHABLE_CODE) +# pragma GCC diagnostic pop +#endif } diff --git a/tests/.gitignore b/tests/.gitignore index a8aa04a5c3..876e375e29 100644 --- a/tests/.gitignore +++ b/tests/.gitignore @@ -13,6 +13,9 @@ /nutlogtest /nutlogtest.log /nutlogtest.trs +/nuttimetest +/nuttimetest.log +/nuttimetest.trs /getvaluetest /getvaluetest.log /getvaluetest.trs diff --git a/tests/Makefile.am b/tests/Makefile.am index 3a3b16871d..c063f6dca2 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -40,6 +40,10 @@ else TESTS += nutlogtest endif +TESTS += nuttimetest +nuttimetest_SOURCES = nuttimetest.c +nuttimetest_LDADD = $(top_builddir)/common/libcommon.la + # Separate the .deps of other dirs from this one LINKED_SOURCE_FILES = hidparser.c diff --git a/tests/NIT/nit.sh b/tests/NIT/nit.sh index 8b746f7af7..7debf2e178 100755 --- a/tests/NIT/nit.sh +++ b/tests/NIT/nit.sh @@ -876,7 +876,7 @@ testcase_sandbox_start_drivers_after_upsd() { } testcase_sandbox_upsc_query_model() { - loginfo "[testcase_sandbox_upsc_query_model] Query model from dummy device" + log_info "[testcase_sandbox_upsc_query_model] Query model from dummy device" runcmd upsc dummy@localhost:$NUT_PORT device.model || die "upsd does not respond on port ${NUT_PORT} ($?): $CMDOUT" if [ x"$CMDOUT" != x"Dummy UPS" ] ; then log_error "got this reply for upsc query when 'Dummy UPS' was expected: $CMDOUT" diff --git a/tests/nuttimetest.c b/tests/nuttimetest.c new file mode 100644 index 0000000000..49e2264298 --- /dev/null +++ b/tests/nuttimetest.c @@ -0,0 +1,154 @@ +/* nuttimetest.c - test custom NUT routines for time comparison and manipulation + * + * Copyright (C) + * 2023 Jim Klimov + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + */ + +#include "config.h" +#include "common.h" +#include "nut_stdint.h" +#include "nut_float.h" + +#include +#include + +static int check_difftime() +{ + time_t tv1, tv2; + double d1, d2; + int res = 0; + + printf("=== %s(time_t):\t", __func__); + + /* Often time_t is a long int, maybe signed */ + tv1 = 5; + printf(" tv1=%" PRIiMAX, (intmax_t)tv1); + + tv2 = 8; + printf(" tv2=%" PRIiMAX, (intmax_t)tv2); + + /* like in difftime(): (double)seconds elapsed time between older tv2 and newer tv1 */ + d1 = difftime(tv1, tv2); + if (!d_equal(d1, -3)) + res++; + printf(" => diff1(tv1, tv2)=%f (%s)", d1, d_equal(d1, -3) ? "OK" : "FAIL"); + + d2 = difftime(tv2, tv1); + if (!d_equal(d2, 3)) + res++; + printf(" => diff2(tv2, tv1)=%f (%s)", d2, d_equal(d2, 3) ? "OK" : "FAIL"); + + if (!d_equal(d1, -d2)) { + printf(" => diff1 != -diff2 (FAIL)\n"); + res++; + } else { + printf(" => diff1 == -diff2 (OK)\n"); + } + + return res; +} + +static int check_difftimeval() +{ + struct timeval tv1, tv2; + double d1, d2; + int res = 0; + + printf("=== %s(struct timeval):\t", __func__); + + tv1.tv_sec = 5; + tv1.tv_usec = 900000; + printf(" tv1=%" PRIiMAX ".%06" PRIiMAX, (intmax_t)tv1.tv_sec, (intmax_t)tv1.tv_usec); + + tv2.tv_sec = 8; + tv2.tv_usec = 230000; + printf(" tv2=%" PRIiMAX ".%06" PRIiMAX, (intmax_t)tv2.tv_sec, (intmax_t)tv2.tv_usec); + + /* like in difftime(): (double)seconds elapsed time between older tv2 and newer tv1 */ + d1 = difftimeval(tv1, tv2); + if (!d_equal(d1, -2.33)) + res++; + printf(" => diff1(tv1, tv2)=%f (%s)", d1, d_equal(d1, -2.33) ? "OK" : "FAIL"); + + d2 = difftimeval(tv2, tv1); + if (!d_equal(d2, 2.33)) + res++; + printf(" => diff2(tv2, tv1)=%f (%s)", d2, d_equal(d2, 2.33) ? "OK" : "FAIL"); + + if (!d_equal(d1, -d2)) { + printf(" => diff1 != -diff2 (FAIL)\n"); + res++; + } else { + printf(" => diff1 == -diff2 (OK)\n"); + } + + return res; +} + +static int check_difftimespec() +{ + int res = 0; +#if defined(HAVE_CLOCK_GETTIME) && defined(HAVE_CLOCK_MONOTONIC) && HAVE_CLOCK_GETTIME && HAVE_CLOCK_MONOTONIC + struct timespec tv1, tv2; + double d1, d2; + + printf("=== %s(struct timespec):\t", __func__); + + tv1.tv_sec = 5; + tv1.tv_nsec = 900000000; + printf(" tv1=%" PRIiMAX ".%09" PRIiMAX, (intmax_t)tv1.tv_sec, (intmax_t)tv1.tv_nsec); + + tv2.tv_sec = 8; + tv2.tv_nsec = 230000; + printf(" tv2=%" PRIiMAX ".%09" PRIiMAX, (intmax_t)tv2.tv_sec, (intmax_t)tv2.tv_nsec); + + /* like in difftime(): (double)seconds elapsed time between older tv2 and newer tv1 */ + d1 = difftimespec(tv1, tv2); + if (!d_equal(d1, -2.10023)) + res++; + printf(" => diff1(tv1, tv2)=%f (%s)", d1, d_equal(d1, -2.10023) ? "OK" : "FAIL"); + + d2 = difftimespec(tv2, tv1); + if (!d_equal(d2, 2.10023)) + res++; + printf(" => diff2(tv2, tv1)=%f (%s)", d2, d_equal(d2, 2.10023) ? "OK" : "FAIL"); + + if (!d_equal(d1, -d2)) { + printf(" => diff1 != -diff2 (FAIL)\n"); + res++; + } else { + printf(" => diff1 == -diff2 (OK)\n"); + } +#else + printf("=== %s(struct timespec):\tSKIP: NOT IMPLEMENTED for this build (not HAVE_CLOCK_GETTIME or not HAVE_CLOCK_MONOTONIC)\n", __func__); +#endif + + return res; +} + +int main(void) +{ + int ret = 0; + + ret += check_difftime(); + ret += check_difftimeval(); + ret += check_difftimespec(); + + return (ret != 0); +} diff --git a/tools/gitlog2changelog.py.in b/tools/gitlog2changelog.py.in index dfdf2fb403..12b80ad3e0 100755 --- a/tools/gitlog2changelog.py.in +++ b/tools/gitlog2changelog.py.in @@ -3,16 +3,17 @@ # Minor changes for NUT by Charles Lepple # Distributed under the terms of the GNU General Public License v2 or later -import string, re, os +import re +import os from textwrap import TextWrapper import sys import subprocess -rev_range = 'HEAD' +rev_range = "HEAD" if len(sys.argv) > 1: base = sys.argv[1] - rev_range = '%s..HEAD' % base + rev_range = "%s..HEAD" % base # Execute git log with the desired command line options. # Support Python2 and Python3 (esp. 3.6 and earlier) semantics @@ -22,25 +23,41 @@ fin_mode = 0 fin_chop = 0 try: p = subprocess.Popen( - ['git', 'log', '--summary', '--stat', '--no-merges', '--date=short', ('%s' % rev_range)], - encoding='utf-8', close_fds = True, - stdout=subprocess.PIPE, stderr=subprocess.PIPE) + [ + "git", + "log", + "--pretty=medium", + "--summary", + "--stat", + "--no-merges", + "--date=short", + ("%s" % rev_range), + ], + encoding="utf-8", + close_fds=True, + stdout=subprocess.PIPE, + stderr=subprocess.PIPE, + ) fin, ferr = p.communicate() if p.wait() != 0: - print ("ERROR getting git changelog") - system.exit(1) + print("ERROR getting git changelog") + sys.exit(1) fin = fin.splitlines() fin_mode = 3 except TypeError: - fin = os.popen('git log --summary --stat --no-merges --date=short %s' % rev_range, 'r') + fin = os.popen( + "git log --pretty=medium --summary --stat --no-merges --date=short %s" + % rev_range, + "r", + ) fin_mode = 2 fin_chop = 1 # Create a ChangeLog file in the current directory. if fin_mode == 3: - fout = open('ChangeLog', 'w', encoding='UTF-8') + fout = open("ChangeLog", "w", encoding="UTF-8") else: - fout = open('ChangeLog', 'w') + fout = open("ChangeLog", "w") # Set up the loop variables in order to locate the blocks we want authorFound = False @@ -52,12 +69,13 @@ messageNL = False files = "" prevAuthorLine = "" -wrapper = TextWrapper(initial_indent="\t", subsequent_indent="\t ") +# See also: https://github.com/python/cpython/blob/main/Lib/textwrap.py +wrapper = TextWrapper(initial_indent="\t", subsequent_indent="\t ", break_on_hyphens=False, break_long_words=False) # The main part of the loop for line in fin: # The commit line marks the start of a new commit object. - if line.startswith('commit'): + if line.startswith("commit"): # Start all over again... authorFound = False dateFound = False @@ -69,35 +87,35 @@ for line in fin: continue # Match the author line and extract the part we want # (Don't use startswith to allow Author override inside commit message.) - elif 'Author:' in line: - authorList = re.split(': ', line, 1) + elif "Author:" in line: + authorList = re.split(": ", line, 1) try: author = authorList[1] - author = author[0:len(author) - fin_chop] + author = author[0 : len(author) - fin_chop] authorFound = True except: - print ("Could not parse authorList = '%s'" % (line)) + print("Could not parse authorList = '%s'" % (line)) # Match the date line - elif line.startswith('Date:'): - dateList = re.split(': ', line, 1) + elif line.startswith("Date:"): + dateList = re.split(": ", line, 1) try: date = dateList[1] - date = date[0:len(date) - fin_chop] + date = date[0 : len(date) - fin_chop] dateFound = True except: - print ("Could not parse dateList = '%s'" % (line)) + print("Could not parse dateList = '%s'" % (line)) # The Fossil-IDs are ignored: - elif line.startswith(' Fossil-ID:') or line.startswith(' [[SVN:'): + elif line.startswith(" Fossil-ID:") or line.startswith(" [[SVN:"): continue # The svn-id lines are ignored - elif ' git-svn-id:' in line: + elif " git-svn-id:" in line: continue # The sign off line is ignored too - elif 'Signed-off-by' in line: + elif "Signed-off-by" in line: continue # Extract the actual commit message for this commit - elif authorFound & dateFound & messageFound == False: + elif authorFound and dateFound and messageFound is False: # Find the commit message if we can if len(line) == fin_chop: if messageNL: @@ -112,19 +130,19 @@ for line in fin: else: message = message + " " + line.strip() # If this line is hit all of the files have been stored for this commit - elif re.search('files? changed', line): + elif re.search("files? changed", line): filesFound = True continue # Collect the files for this commit. FIXME: Still need to add +/- to files - elif authorFound & dateFound & messageFound: - fileList = re.split(' \| ', line, 2) + elif authorFound and dateFound and messageFound: + fileList = re.split(r' \| ', line, 2) if len(fileList) > 1: if len(files) > 0: files = files + ", " + fileList[0].strip() else: files = fileList[0].strip() # All of the parts of the commit have been found - write out the entry - if authorFound & dateFound & messageFound & filesFound: + if authorFound and dateFound and messageFound and filesFound: # First the author line, only outputted if it is the first for that # author on this day authorLine = date + " " + author @@ -145,8 +163,8 @@ for line in fin: namesF = None namesM = None try: - namesM = sorted(re.split(r'[ ,]', message.split(":")[0])) - namesF = sorted(re.split(r'[ ,]', files)) + namesM = sorted(re.split(r"[ ,]", message.split(":")[0])) + namesF = sorted(re.split(r"[ ,]", files)) except: pass @@ -158,7 +176,7 @@ for line in fin: # Write out the commit line fout.write(wrapper.fill(commitLine) + "\n") - #Now reset all the variables ready for a new commit block. + # Now reset all the variables ready for a new commit block. authorFound = False dateFound = False messageFound = False diff --git a/tools/nut-ddl-dump.sh b/tools/nut-ddl-dump.sh index 326a06daa2..4a1a9f3958 100755 --- a/tools/nut-ddl-dump.sh +++ b/tools/nut-ddl-dump.sh @@ -2,13 +2,15 @@ ################################################################################ # A script to ease the generation of NUT device dumps for NUT Devices Dumps Library ################################################################################ -# Author: (C) Arnaud Quette +# Authors: +# Copyright (C) 2015 - 2017 by Arnaud Quette +# Copyright (C) 2020 - 2023 by Jim Klimov # License: GPL v2+ ################################################################################ # FIXME: # - check if a previous report exists, and increase report number #  - we currently use the .dev format ; but also consider the NDS format -# http://www.networkupstools.org/ddl/ +# https://www.networkupstools.org/ddl/ ################################################################################ strUsage="Usage: $0 " @@ -18,48 +20,66 @@ if [ -z "$1" ]; then echo "$strUsage" exit else - DDL_DEVICE_NAME=$1 + DDL_DEVICE_NAME="$1" fi # Test communication with the device -upscResult="`upsc ${DDL_DEVICE_NAME} 2> /dev/null`" +upscResult="`upsc "${DDL_DEVICE_NAME}" 2> /dev/null`" if [ $? -gt 0 ]; then - echo "Can't communicate with ${DDL_DEVICE_NAME}" + echo "Can't communicate with ${DDL_DEVICE_NAME}" >&2 exit fi # Collect more information dumpDate="`date -R`" -upsrwResult="`upsrw ${DDL_DEVICE_NAME} 2> /dev/null`" -upscmdResult="`upscmd -l ${DDL_DEVICE_NAME} 2> /dev/null`" +upsrwResult="`upsrw "${DDL_DEVICE_NAME}" 2> /dev/null`" +upscmdResult="`upscmd -l "${DDL_DEVICE_NAME}" 2> /dev/null`" # Build the filename # ________. # Process the Manufacturer name -RAW_DDL_MFR="`upsc ${DDL_DEVICE_NAME} device.mfr 2>/dev/null`" +RAW_DDL_MFR="`upsc "${DDL_DEVICE_NAME}" device.mfr 2>/dev/null`" if [ "${RAW_DDL_MFR}" = "EATON" ]; then RAW_DDL_MFR="Eaton" fi # Replace spaces with underscores -DDL_MFR="`echo ${RAW_DDL_MFR} | sed s/\ /_/g`" +DDL_MFR="`echo "${RAW_DDL_MFR}" | sed s/\ /_/g`" # Process the Model name # Replace spaces with underscores -RAW_DDL_MODEL="`upsc ${DDL_DEVICE_NAME} device.model 2>/dev/null`" -DDL_MODEL="`echo ${RAW_DDL_MODEL} | sed s/\ /_/g`" +RAW_DDL_MODEL="`upsc "${DDL_DEVICE_NAME}" device.model 2>/dev/null`" +DDL_MODEL="`echo "${RAW_DDL_MODEL}" | sed s/\ /_/g`" # Process the driver name and NUT version -DDL_DRIVER_NAME="`upsc ${DDL_DEVICE_NAME} driver.name 2>/dev/null`" -DDL_NUT_VERSION="`upsc ${DDL_DEVICE_NAME} driver.version 2>/dev/null`" -# TODO: check if a similar file exists, to update Report nb +DDL_DRIVER_NAME="`upsc "${DDL_DEVICE_NAME}" driver.name 2>/dev/null`" +DDL_NUT_VERSION="`upsc "${DDL_DEVICE_NAME}" driver.version 2>/dev/null`" +# TODO: check if a similar file exists in nut-ddl repo, to update Report nb DDL_REPORT_NUMBER="01" DDL_FILENAME="${DDL_MFR}__${DDL_MODEL}__${DDL_DRIVER_NAME}__${DDL_NUT_VERSION}__${DDL_REPORT_NUMBER}.dev" # Dump device data into the file -echo "# Device dump generated by $0 on $dumpDate" > ${DDL_FILENAME} -echo "# upsrw output:" >> ${DDL_FILENAME} -echo "${upsrwResult}" | sed -e 's/^/# /' >> ${DDL_FILENAME} -echo "# upscmd output:" >> ${DDL_FILENAME} -echo "${upscmdResult}" | sed -e 's/^/# /' >> ${DDL_FILENAME} -echo "" >> ${DDL_FILENAME} -echo "# upsc output:" >> ${DDL_FILENAME} -echo "${upscResult}" >> ${DDL_FILENAME} -echo "${DDL_FILENAME} generated using ${DDL_DEVICE_NAME} " +( + echo "# Please add if relevant: DEVICE:URL:REPORT: " + echo "# Please add if relevant: DEVICE:URL:VENDOR: " + echo "" + echo "# Please add comments for humans here and perhaps raise concerns about the data points," + echo "# see https://networkupstools.org/ddl/#devseq-files for comment-tag syntax" + echo "# strip sensitive data (passwords, SNMP community, serial number, IP address, host name...)" + echo "# and post as a pull request to https://github.com/networkupstools/nut-ddl/" + echo "# DEVICE:COMMENT:" + echo "# Device dump generated by $0 on ${dumpDate}" + echo "# DEVICE:EOC" + echo "" + echo "# :; upsc ${DDL_DEVICE_NAME}" + echo "${upscResult}" + echo "" + echo "# DEVICE:COMMENT-BLOCK:FIXME:UPSRW: ${DDL_DEVICE_NAME}" + echo "${upsrwResult}" | sed -e 's/^/# /' -e 's/^# $/#/' + echo "# DEVICE:EOC" + echo "" + echo "# DEVICE:COMMENT-BLOCK:FIXME:UPSCMD: ${DDL_DEVICE_NAME}" + echo "${upscmdResult}" | sed -e 's/^/# /' -e 's/^# $/#/' + echo "# DEVICE:EOC" + echo "" +) > ${DDL_FILENAME} + +echo "${DDL_FILENAME} generated using ${DDL_DEVICE_NAME} on ${dumpDate}" +echo "Please revise and post as a pull request to https://github.com/networkupstools/nut-ddl/" diff --git a/tools/nut-usbinfo.pl b/tools/nut-usbinfo.pl index bba85ccf1c..20d72934e4 100755 --- a/tools/nut-usbinfo.pl +++ b/tools/nut-usbinfo.pl @@ -116,7 +116,7 @@ sub gen_usb_files my $out_devd = do {local *OUT_DEVD}; open $out_devd, ">$output_devd" || die "error $output_devd : $!"; print $out_devd '# This file is generated and installed by the Network UPS Tools package.'."\n"; - print $out_devd "# Homepage: http://www.networkupstools.org/\n\n"; + print $out_devd "# Homepage: https://www.networkupstools.org/\n\n"; # UPower file header my $outUPower = do {local *OUT_UPOWER};