diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index 639fa20c8e..3087cbeb6a 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -27,6 +27,8 @@ of "real" changes in the other commits. Similarly for typo fixes in comments or text documents. +- [ ] Please star NUT on GitHub, this helps with sponsorships! ;) + ## Frequent "underwater rocks" for driver addition/update PRs - [ ] Revised existing driver families and added a sub-driver if applicable diff --git a/.github/workflows/PyNUTClient.yml b/.github/workflows/PyNUTClient.yml new file mode 100644 index 0000000000..018562485b --- /dev/null +++ b/.github/workflows/PyNUTClient.yml @@ -0,0 +1,78 @@ +name: Publish PyNUT client bindings for NUT 🐍 distributions đŸ“Ļ to PyPI +# based on https://medium.com/@VersuS_/automate-pypi-releases-with-github-actions-4c5a9cfe947d +# and https://packaging.python.org/en/latest/guides/publishing-package-distribution-releases-using-github-actions-ci-cd-workflows/ + +# NOTE: We may need to split this workflow into two files to do only +# paths for master branch, and run always for (release) tags? +on: + push: + paths: + - 'scripts/python/module/*' + - '.github/workflows/PyNUTClient.yml' + tags: + - '*' + branches: + - 'master' + +permissions: + id-token: write + +jobs: + build-n-publish: + if: github.repository_owner == 'networkupstools' + name: Build and publish Python 🐍 distributions đŸ“Ļ to PyPI + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@master + with: + fetch-depth: 0 + fetch-tags: true + - name: Set up Python 3.10 + uses: actions/setup-python@v3 + with: + python-version: '3.10' + - name: Extract python interpreter path name + id: pythoncmd + run: >- + set -x ; + echo "PYTHON=$(command -v python)" >> $GITHUB_OUTPUT + - name: Extract tag name + id: tag + # Note: this is all a single shell line in the end, + # so we need semicolons between commands! + run: >- + set -x ; + TAG_NAME="$(echo $GITHUB_REF | cut -d / -f 3)" ; + if [ x"$TAG_NAME" = xmaster ]; then + { TAG_NAME="$(git describe --tags --match 'v[0-9]*.[0-9]*.[0-9]' --exclude '*-signed' --exclude '*rc*' --exclude '*alpha*' --exclude '*beta*')" \ + || TAG_NAME="$(git describe --tags --exclude '*rc*' --exclude '*alpha*' --exclude '*beta*' --exclude '*Windows*' --exclude '*IPM*')" ; } \ + && test -n "${TAG_NAME}" \ + || TAG_NAME="2.8.1-`TZ=UTC date +%s`" ; + fi >&2 ; + TAG_NAME="$(echo "$TAG_NAME" | sed -e 's/^v\([0-9]\)/\1/' -e 's,^.*/,,' -e 's/^v//' -e 's/-g.*$//' -e 's/-/./g')" ; + echo "TAG_NAME=$TAG_NAME" >> $GITHUB_OUTPUT + - name: Install pypa/setuptools + run: >- + ${{ steps.pythoncmd.outputs.PYTHON }} -m + pip install wheel build + - name: Prepare source layout and Build a binary wheel + run: >- + set -e ; + cd scripts/python/module ; + cp -f Makefile.am Makefile ; + make -f Makefile.am clean-local dist NUT_SOURCE_GITREV_NUMERIC="${{ steps.tag.outputs.TAG_NAME }}" PYTHON="${{ steps.pythoncmd.outputs.PYTHON }}" top_srcdir="../../.." srcdir="." builddir="." ; + find . -ls + - name: Publish master distribution đŸ“Ļ to Test PyPI + # https://github.com/pypa/gh-action-pypi-publish + if: ${{ !startsWith(github.ref, 'refs/tags') }} + uses: pypa/gh-action-pypi-publish@release/v1 + with: + packages-dir: scripts/python/module/dist + password: ${{ secrets.TEST_PYPI_API_TOKEN }} + repository-url: https://test.pypi.org/legacy/ + - name: Publish tagged release distribution đŸ“Ļ to PyPI + if: startsWith(github.ref, 'refs/tags') + uses: pypa/gh-action-pypi-publish@release/v1 + with: + packages-dir: scripts/python/module/dist + password: ${{ secrets.PYPI_API_TOKEN }} diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index a9868e7013..2438bd0555 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -43,7 +43,7 @@ jobs: # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL - uses: github/codeql-action/init@v2 + uses: github/codeql-action/init@v3 with: languages: ${{ matrix.language }} # If you wish to specify custom queries, you can do so here or in a config file. @@ -57,7 +57,7 @@ jobs: # Autobuild attempts to build any compiled languages (C/C++, C#, Go, or Java). # If this step fails, then you should remove it and run the build manually (see below) - name: Autobuild - uses: github/codeql-action/autobuild@v2 + uses: github/codeql-action/autobuild@v3 # ℹī¸ Command-line programs to run using the OS shell. # 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun @@ -70,6 +70,6 @@ jobs: # ./location_of_script_within_repo/buildscript.sh - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v2 + uses: github/codeql-action/analyze@v3 with: category: "/language:${{matrix.language}}" diff --git a/.gitignore b/.gitignore index 26991a7786..bc2e70a1a3 100644 --- a/.gitignore +++ b/.gitignore @@ -49,6 +49,7 @@ Makefile.in /missing /test-driver *-spellchecked +*-prepped *.adoc-parsed *.adoc*.tmp *.txt*.tmp diff --git a/INSTALL.nut.adoc b/INSTALL.nut.adoc index 5563f81b17..302b3b5948 100644 --- a/INSTALL.nut.adoc +++ b/INSTALL.nut.adoc @@ -633,8 +633,8 @@ It should currently be possible to build the codebase in native Windows with MSYS2/MinGW and cross-building from Linux with mingw (preferably in a Debian/Ubuntu container). Refer to link:config-prereqs.txt[Prerequisites for building NUT on different OSes] -and link:scripts/Windows/README[scripts/Windows/README file] for respective -build environment preparation instructions. +and link:scripts/Windows/README.adoc[scripts/Windows/README.adoc file] +for respective build environment preparation instructions. Note that to use NUT for Windows, non-system dependency DLL files must be located in same directory as each EXE file that uses them. This can be @@ -679,7 +679,7 @@ Building for Windows For suggestions about setting up the NUT build environment variants for Windows, please see link:docs/config-prereqs.txt and/or -link:scripts/Windows/README files. Note this is rather experimental +link:scripts/Windows/README.adoc files. Note this is rather experimental at this point. diff --git a/Jenkinsfile-dynamatrix b/Jenkinsfile-dynamatrix index c8fcb5b80d..11e14f15bf 100644 --- a/Jenkinsfile-dynamatrix +++ b/Jenkinsfile-dynamatrix @@ -12,7 +12,10 @@ def buildCommit = '86a32237c7df45c5aba640746f7afc4de09505a1' // See https://github.com/networkupstools/jenkins-dynamatrix/ for the lib // Agent setup evolves at https://ci.networkupstools.org/computer/ -@Library('jenkins-dynamatrix') _ +// NOTE: The "${BRANCH_NAME}" below IS NOT A VARIABLE! +// Special notation per custom plugin build including changes from +// https://github.com/jenkinsci/pipeline-groovy-lib-plugin/pull/19/ +@Library('jenkins-dynamatrix@${BRANCH_NAME}') _ import org.nut.dynamatrix.dynamatrixGlobalState; import org.nut.dynamatrix.*; @@ -27,6 +30,13 @@ import org.nut.dynamatrix.*; dynacfgPipeline.disableSlowBuildCIBuild = false dynacfgPipeline.disableSlowBuildCIBuildExperimental = false + // NOTE: Disabled by default because with -std=c* the compiler and linker + // (at least on environments NUT CI farm has) do not "see" many things, + // and do not even define WIN32, and this is unrelated to NUT codebase. + // This toggle aims to only disable 'c' builds in the scenario; but the + //'gnu' ones should still happen if it is enabled overall. + dynacfgPipeline.disableStrictCIBuild_CrossWindows = true + // At this time, GCC succeeds building C89/GNU89 mode for NUT // while CLANG complains about things we can't fix easily. dynacfgPipeline.axisCombos_COMPILER_GCC = [~/COMPILER=GCC/] @@ -1218,7 +1228,7 @@ set | sort -n """ dynamatrixAxesVirtualLabelsMap: [ 'BITS': [64, 32], 'CSTDVERSION_${KEY}': [ ['c': '99', 'cxx': '11'] ], - 'CSTDVARIANT': ['c', 'gnu'], + 'CSTDVARIANT': ['gnu'] + (dynacfgPipeline.disableStrictCIBuild_CrossWindows ? [] : ['c']), ], dynamatrixAxesCommonEnv: [ ['LANG=C','LC_ALL=C','TZ=UTC', @@ -1285,6 +1295,14 @@ if ( env?.BRANCH_NAME ==~ /.*verbose.*/ ) dynamatrixGlobalState.enableDebugErrors = true dynamatrixGlobalState.enableDebugMilestones = true dynamatrixGlobalState.enableDebugMilestonesDetails = true + dynamatrixGlobalState.enableDebugTraceGithubStatusHighlights = true +} + +//if (true) // <<< (Un-)comment away in select runs/branches +//if (false) // <<< (Un-)comment away in select runs/branches +if ( env?.BRANCH_NAME ==~ /.*fightwarn.*/ ) +{ + dynamatrixGlobalState.enableDebugTraceGithubStatusHighlights = true } dynamatrixPipeline(dynacfgBase, dynacfgPipeline) diff --git a/Makefile.am b/Makefile.am index c367c904a2..bac4f8eb2b 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,5 +1,14 @@ # top-level Makefile for NUT +# Export certain values for ccache which NUT ci_build.sh can customize, +# to facilitate developer iteration re-runs of "make" later. +# At least GNU and BSD make implementations are okay with this syntax. +@NUT_AM_MAKE_CAN_EXPORT@export CCACHE_NAMESPACE=@CCACHE_NAMESPACE@ +@NUT_AM_MAKE_CAN_EXPORT@export CCACHE_BASEDIR=@CCACHE_BASEDIR@ +@NUT_AM_MAKE_CAN_EXPORT@export CCACHE_DIR=@CCACHE_DIR@ +@NUT_AM_MAKE_CAN_EXPORT@export CCACHE_PATH=@CCACHE_PATH@ +@NUT_AM_MAKE_CAN_EXPORT@export PATH=@PATH_DURING_CONFIGURE@ + # include directory for aclocal ACLOCAL_AMFLAGS = -I m4 @@ -65,11 +74,11 @@ DISTCHECK_CONFIGURE_FLAGS = ${DISTCHECK_FLAGS} \ --with-pynut=app --with-nut_monitor=force distcheck-light: - $(MAKE) $(AM_MAKEFLAGS) DISTCHECK_FLAGS="$(DISTCHECK_LIGHT_FLAGS)" distcheck + +$(MAKE) $(AM_MAKEFLAGS) DISTCHECK_FLAGS="$(DISTCHECK_LIGHT_FLAGS)" distcheck # Make a distcheck (and check in particular) with enabled valgrind and debug info memcheck distcheck-valgrind: - $(MAKE) $(AM_MAKEFLAGS) DISTCHECK_FLAGS="$(DISTCHECK_VALGRIND_FLAGS)" distcheck + +$(MAKE) $(AM_MAKEFLAGS) DISTCHECK_FLAGS="$(DISTCHECK_VALGRIND_FLAGS)" distcheck # workaround the dist generated files that are also part of the distribution # Note that distcleancheck is disabled for now, while waiting for a proper @@ -117,10 +126,10 @@ maintainer-clean-local: # should be available during their clean-up). Just in case, we make sure # here that their sub-distcleans complete first. distclean-local: - @for DIR in $(SUBDIRS) ; do \ + +@for DIR in $(SUBDIRS) ; do \ if test -f "$${DIR}/Makefile" ; then \ echo " DISTCLEAN in $${DIR}" >&2 ; \ - ( cd "$${DIR}" && $(MAKE) -s distclean ) || exit ; \ + ( cd "$${DIR}" && $(MAKE) $(AM_MAKEFLAGS) -s distclean ) || exit ; \ fi ; \ done $(AM_V_at)rm -rf .inst tmp autom4te.cache @@ -128,12 +137,27 @@ distclean-local: # Hook the documentation building and validating recipes # Note: these are optionally available (as determined during configure runs) +# Maint: grep -l 'SPELLCHECK_' `git grep -lw spellcheck '*.am'` spellcheck spellcheck-interactive: - @RES=0; \ - (cd $(builddir)/docs && $(MAKE) -s $@) || RES=$$? ; \ - (cd $(builddir)/docs/man && $(MAKE) -s $@) || RES=$$? ; \ - (cd $(builddir)/conf && $(MAKE) -s $@) || RES=$$? ; \ - (cd $(builddir)/data && $(MAKE) -s $@) || RES=$$? ; \ + +@RES=0; \ + (cd $(builddir)/docs && $(MAKE) $(AM_MAKEFLAGS) -s $(abs_top_builddir)/docs/.prep-src-docs) || RES=$$? ; \ + (cd $(builddir)/docs/man && $(MAKE) $(AM_MAKEFLAGS) -s $(abs_top_builddir)/docs/.prep-src-docs) || RES=$$? ; \ + (cd $(builddir)/docs && $(MAKE) $(AM_MAKEFLAGS) -s $@) || RES=$$? ; \ + (cd $(builddir)/docs/man && $(MAKE) $(AM_MAKEFLAGS) -s $@) || RES=$$? ; \ + (cd $(builddir)/conf && $(MAKE) $(AM_MAKEFLAGS) -s $@) || RES=$$? ; \ + (cd $(builddir)/data && $(MAKE) $(AM_MAKEFLAGS) -s $@) || RES=$$? ; \ + (cd $(builddir)/data/html && $(MAKE) $(AM_MAKEFLAGS) -s $@) || RES=$$? ; \ + (cd $(builddir)/scripts && $(MAKE) $(AM_MAKEFLAGS) -s $@) || RES=$$? ; \ + (cd $(builddir)/scripts/Solaris && $(MAKE) $(AM_MAKEFLAGS) -s $@) || RES=$$? ; \ + (cd $(builddir)/scripts/Windows && $(MAKE) $(AM_MAKEFLAGS) -s $@) || RES=$$? ; \ + (cd $(builddir)/scripts/devd && $(MAKE) $(AM_MAKEFLAGS) -s $@) || RES=$$? ; \ + (cd $(builddir)/scripts/hotplug && $(MAKE) $(AM_MAKEFLAGS) -s $@) || RES=$$? ; \ + (cd $(builddir)/scripts/installer && $(MAKE) $(AM_MAKEFLAGS) -s $@) || RES=$$? ; \ + (cd $(builddir)/scripts/python && $(MAKE) $(AM_MAKEFLAGS) -s $@) || RES=$$? ; \ + (cd $(builddir)/scripts/systemd && $(MAKE) $(AM_MAKEFLAGS) -s $@) || RES=$$? ; \ + (cd $(builddir)/scripts/udev && $(MAKE) $(AM_MAKEFLAGS) -s $@) || RES=$$? ; \ + (cd $(builddir)/scripts/upsdrvsvcctl && $(MAKE) $(AM_MAKEFLAGS) -s $@) || RES=$$? ; \ + (cd $(builddir)/tests/NIT && $(MAKE) $(AM_MAKEFLAGS) -s $@) || RES=$$? ; \ exit $$RES # Note: the "all-docs" and "check-docs" targets may require tools not @@ -144,10 +168,10 @@ spellcheck spellcheck-interactive: doc spellcheck-sortdict \ all-docs check-docs \ man all-man man-man check-man man-html all-html: - cd $(builddir)/docs && $(MAKE) $@ + +cd $(builddir)/docs && $(MAKE) $(AM_MAKEFLAGS) $@ INSTALL.nut UPGRADING NEWS README: - cd $(builddir)/docs && $(MAKE) ../$(@F).adoc-parsed && cp -f ../$(@F).adoc-parsed ../$(@F) + +cd $(builddir)/docs && $(MAKE) $(AM_MAKEFLAGS) ../$(@F).adoc-parsed && cp -f ../$(@F).adoc-parsed ../$(@F) # Workarounds for https://github.com/github/markup/issues/1095 # require direct definition of our attributes in each source @@ -203,7 +227,7 @@ maintainer-asciidocs: ) check-NIT check-NIT-devel: - cd $(builddir)/tests/NIT && $(MAKE) $@ + +cd $(builddir)/tests/NIT && $(MAKE) $(AM_MAKEFLAGS) $@ # This target adds syntax-checking for committed shell script files, # to avoid surprises and delays in finding fatal typos after packaging @@ -277,7 +301,7 @@ cppcheck: endif !HAVE_CPPCHECK sockdebug: - cd $(builddir)/server && $(MAKE) $(AM_MAKEFLAGS) sockdebug$(EXEEXT) + +cd $(builddir)/server && $(MAKE) $(AM_MAKEFLAGS) sockdebug$(EXEEXT) # ---------------------------------------------------------------------- # Automatically generate the ChangeLog from Git logs: @@ -293,18 +317,29 @@ GITLOG_START_POINT=v2.6.0 # Force ChangeLog regeneration upon make dist (due to nonexistant 'dummy-stamp'), # in case it has already been generated previously -# Note that the script is hard-coded to generate "ChangeLog" in the current dir +# Note that the script is hard-coded to inspect Git workspace which contains +# the current dir, and defaults to generate a "ChangeLog" in the current dir. +# The script itself is generated from a template, so resides in builddir. dummy-stamp: ChangeLog: tools/gitlog2changelog.py dummy-stamp - cd $(top_builddir) && \ - ./tools/gitlog2changelog.py $(GITLOG_START_POINT) || \ - { echo "gitlog2changelog.py failed to generate the ChangeLog. See https://github.com/networkupstools/nut/commits/master" > $@ ; } + cd $(abs_top_srcdir) && \ + if test -e .git ; then \ + CHANGELOG_FILE="$@" $(abs_top_builddir)/tools/gitlog2changelog.py $(GITLOG_START_POINT) || \ + { printf "gitlog2changelog.py failed to generate the ChangeLog.\n\nNOTE: See https://github.com/networkupstools/nut/commits/master for change history.\n\n" > "$@" ; } ; \ + else \ + if ! test -s "$@" ; then \ + printf "Failed to generate the ChangeLog.\n\nNOTE: See https://github.com/networkupstools/nut/commits/master for change history.\n\n" > "$@" ; \ + fi ; \ + fi + +ChangeLog.adoc: ChangeLog + +cd $(abs_top_builddir)/docs && $(MAKE) $(AM_MAKEFLAGS) ../ChangeLog.adoc nut_version.h include/nut_version.h: - cd $(abs_top_builddir)/include && $(MAKE) nut_version.h + +cd $(abs_top_builddir)/include && $(MAKE) $(AM_MAKEFLAGS) nut_version.h tools/gitlog2changelog.py: tools/gitlog2changelog.py.in - cd $(@D) && $(MAKE) -s $(@F) + +cd $(@D) && $(MAKE) $(AM_MAKEFLAGS) -s $(@F) # ---------------------------------------------------------------------- # Maintainers targets: distribution signature and hashes @@ -330,35 +365,35 @@ build: @echo $(WARN) @echo "Warning: 'make build' is deprecated. Use 'make all' instead." @echo $(WARN) - $(MAKE) $(AM_MAKEFLAGS) all + +$(MAKE) $(AM_MAKEFLAGS) all install-bin: @echo $(WARN) @echo "Warning: 'make install-bin' is deprecated." @echo "Use 'make install-exec' instead for a similar effect." @echo $(WARN) - cd common; $(MAKE) $(AM_MAKEFLAGS) install - cd drivers; $(MAKE) $(AM_MAKEFLAGS) install - cd server; $(MAKE) $(AM_MAKEFLAGS) install - cd clients; $(MAKE) $(AM_MAKEFLAGS) install + +cd common; $(MAKE) $(AM_MAKEFLAGS) install + +cd drivers; $(MAKE) $(AM_MAKEFLAGS) install + +cd server; $(MAKE) $(AM_MAKEFLAGS) install + +cd clients; $(MAKE) $(AM_MAKEFLAGS) install install-man: install-data-recursive @echo $(WARN) @echo "Warning: 'make install-man' is deprecated." @echo "Use 'cd man; make install' instead." @echo $(WARN) - cd man; $(MAKE) $(AM_MAKEFLAGS) install + +cd man; $(MAKE) $(AM_MAKEFLAGS) install install-conf: @echo $(WARN) @echo "Warning: 'make install-conf' is deprecated." @echo "Use 'cd conf; make install' instead." @echo $(WARN) - cd conf; $(MAKE) $(AM_MAKEFLAGS) install + +cd conf; $(MAKE) $(AM_MAKEFLAGS) install # The target install-data already has a standardized meaning under automake install-dirs: @echo $(WARN) @echo "Warning: 'make install-dirs' is deprecated." @echo "Use 'make installdirs' instead." @echo $(WARN) - $(MAKE) installdirs + +$(MAKE) installdirs cgi build-cgi install-cgi install-cgi-dir install-cgi-bin \ install-cgi-man install-cgi-conf install-cgi-html: @echo "Error: 'make $@' no longer exists." @@ -393,7 +428,7 @@ MAINTAINERCLEANFILES += $(MAINTAINERCLEANFILES_DISTBALL) MAINTAINERCLEANFILES += $(MAINTAINERCLEANFILES_PACKAGES) package: dist - DESTDIR="$(abs_builddir)/_install_pkgprotodir" ; export DESTDIR; \ + +DESTDIR="$(abs_builddir)/_install_pkgprotodir" ; export DESTDIR; \ rm -rf "$$DESTDIR"; \ case "`uname -s`" in \ "HP-UX") \ @@ -433,8 +468,8 @@ if HAVE_WINDOWS # anything. install-win-bundle: all @if test -z "$(DESTDIR)" ; then echo "ERROR: '$@': Bundle may only be installed to some DESTDIR prototype area'" >&2 ; exit 1; fi - $(MAKE) $(AM_MAKEFLAGS) DESTDIR='$(DESTDIR)' install - $(MAKE) $(AM_MAKEFLAGS) DESTDIR='$(DESTDIR)' install-win-bundle-thirdparty + +$(MAKE) $(AM_MAKEFLAGS) DESTDIR='$(DESTDIR)' install + +$(MAKE) $(AM_MAKEFLAGS) DESTDIR='$(DESTDIR)' install-win-bundle-thirdparty install-win-bundle-thirdparty: @if test -z "$(DESTDIR)" ; then echo "ERROR: '$@': Bundle may only be installed to some DESTDIR prototype area'" >&2 ; exit 1; fi diff --git a/NEWS.adoc b/NEWS.adoc index 60cbf82ae8..10319c9cd2 100644 --- a/NEWS.adoc +++ b/NEWS.adoc @@ -13,7 +13,7 @@ ChangeLog file (generated for release archives), or to the Git version control history for "live" codebase. -PLANNED: Release notes for NUT 2.8.3 - what's new since 2.8.2 +PLANNED: Release notes for NUT 2.8.4 - what's new since 2.8.3 ------------------------------------------------------------- https://github.com/networkupstools/nut/milestone/9 @@ -23,10 +23,10 @@ https://github.com/networkupstools/nut/milestone/9 and modernized on the fly [Ported from 42ITy project] -PLANNED: Release notes for NUT 2.8.2 - what's new since 2.8.1 +PLANNED: Release notes for NUT 2.8.3 - what's new since 2.8.2 ------------------------------------------------------------- -https://github.com/networkupstools/nut/milestone/10 +https://github.com/networkupstools/nut/milestone/11 - (expected) clean-up of libusb API variants support [#300 and follow-ups] @@ -40,9 +40,175 @@ https://github.com/networkupstools/nut/milestone/10 - (expected) Bug fixes for fallout possible due to "fightwarn" effort in 2.8.0 -PLANNED: Release notes for NUT 2.8.1 - what's new since 2.8.0 +PLANNED: Release notes for NUT 2.8.2 - what's new since 2.8.1 ------------------------------------------------------------- +https://github.com/networkupstools/nut/milestone/10 + + - Fix fallout of development in NUT v2.8.0 and/or v2.8.1: + * dstate machinery: a segmentation fault (null pointer dereference) was + possible with `INSTCMD` processing of commands without parameters nor + `TRACKING` identifier. [#2155] + * USB bus number detection for libusb-1.0 builds was overly zealous and + wrongly considered zero values as an error. [#2198] + * `upsmon` recognition of `CAL` state could linger after the calibration + activity was completed by the hardware, which led to mis-processing of + shutdown triggers. Also, notification was added to report "finished + calibration". [issue #2168, PR #2169] + * `upsmon` recognition of `OFF` state as a trigger for FSD (forced shut + down) criticality considered also the input line state, which may be + an independently evolving circumstance. [issue #2278, PR #2279] + * `upsmon` support for `POLLFAIL_LOG_THROTTLE_MAX` did not neuter the + applied setting when live-reloading configuration, so commenting it + away in `upsmon.conf` did not have the effect of resetting the logging + frequency to default. It also did not reset the counters to certainly + follow the new configuration for existing faults. [issue #2207, PR #2209] + * `upsmon` support for `POLLFAIL_LOG_THROTTLE_MAX` had an off-by-one error + (e.g. reporting "Data stale" or "Driver not connected" every 30 sec with + `POLLFAIL_LOG_THROTTLE_MAX 5` and `POLLFREQ 5` settings). [#2207] + * Drivers running with non-default user account (e.g. with `user=root` + in their configuration) failed to apply group ownership and permissions + to their Unix socket file for interaction with the local data server. + [#2185, #2096] + * Dispatcher script `scripts/python/app/NUT-Monitor` referenced `py3qt3` + instead of the correct `py3qt5`. It also tries to check both `py2gtk2` + and `py3qt5` implementations verbosely, even if one is not installed. + [#2199, #2201] + * Set the `DesktopFileName` in `scripts/python/app/NUT-Monitor-py3qt5`, + this binds the application with the desktop file and allow the Open + Desktop compatible implementation to display the proper icon and + application name. [#2205] + * Original recipe for `apc_modbus` strictly required USB support even if + building NUT without it. [#2262] + * Builds requested with a specific C/C++ language standard revision via + `CFLAGS` and `CXXFLAGS` should again be honoured. [PR #2306] + * Allow requesting detailed debug builds (with disabled optimizations for + binaries to best match the source code) for supported compilers using + `configure` script option `--with-debuginfo`. Note that default autoconf + behavior usually embeds moderate optimizations and debug information on + its own. [PR #2310] + + - nut-usbinfo.pl, nut-scanner and libnutscan: + * Library API version for `libnutscan` was bumped from 2.2.0 to 2.5.0 + during evolution of this NUT release. + * USB VendorID:ProductID support list files generated by the script for + different OS frameworks now include a comment with other possibly + compatible driver names, where the respective file format allows for + comments. + * Added the concept of `alt_driver_names` in `nutscan_device_t` structure + for ability to suggest a comment with other possibly compatible driver + names in configuration snippets generated by `nut-scanner`; practical + support implemented for USB connected drivers. + * Added the concept of commented-away suggested option values `comment_tag` + and a method to `nutscan_add_commented_option_to_device()`, instead of + hacks in prepared config data which broke some use-cases. [#2221] + * Command-line option `-U` for USB scan can now be specified several times + to increase the detail level about hardware link to the device (this was + previously always suggested, but may be not reliable if USB enumeration + gets changed over time). [#2221] + * Added generation of FreeBSD/pfSense quirks for USB devices supported + by NUT (may get installed to `$datadir` e.g. `/usr/local/share/nut` + and need to be pasted into your `/boot/loader.conf.local`). [#2159] + * nut-scanner now avoids creating ambiguous `nutdevN` device section names + when called separately to scan different media buses (one at a time). + Now the "bus" name would be embedded (e.g. non-colliding `nutdev-usb1` + and `nutdev-snmp1`). [#2247] + * nut-scanner can now discover NUT simulated devices (`.dev` and `.seq` + files) located in your sysconfig directory, and prepare configuration + sections with the simulation driver (currently `dummy-ups`). [#2246] + * nut-scanner now reports `dummy-ups` as driver when scanning NUT "bus" + with Old or Avahi method. [#2236, #2245] + + - upsd: Fixed conditions for "no listening interface available" diagnosis + to check how many listeners we succeeded with, not whether the first one + succeeded or not. If not all requested (non-localhost) listeners were + available, default to fail the daemon start-up attempt; support for an + `ALLOW_NOT_ALL_LISTENERS` setting was added to control this behavior. [#723] + + - NUT CI improvements: + * Added publishing recipes for PyNUT client bindings for NUT, so it ends + up in the link:https://pypi.org/project/PyNUTClient[PyPI repository]. + [#2158] + * Added support for new `ccache` namespace concept, where possible. [#2256] + * Fixed an issue for builds configured `--without-usb`. [#2263] + * Added a fallback for `libgd` discovery (for CGI etc. builds). [#2287] + * Made `aspell` TeX module detection more reliable. [#2206] + * Fixed recipes for completely out-of-tree builds to pass with documentation + generation and checking on all tested "make" implementations. [#2318] + * Various other recipe and documentation clean-up efforts. [#2284, #2269, + #2261] + + - main driver core codebase: + * Help users of drivers that can be built to support optionally USB and + other media (like `nutdrv_qx` built for serial-only support), and built + in fact without USB support but used for USB devices, with some more + information to make troubleshooting easier. [issue #2259, PR #2260] + * Driver programs with debug tracing support via `-D` CLI option and/or + the `NUT_DEBUG_LEVEL` environment variable now check those earlier in + their life-time, so that initialization routine can be debugged. [#2259] + + - nut-driver-enumerator (NDE) service/script: + * The optional daemon mode (primarily useful for systems which monitor + a large and dynamic population of power devices) was enhanced with a + `--daemon-after` variant which parses the configuration once before + daemonization and this has a chance to fail while not forked off, as + well as to allow only completing the service unit initialization when + everything is actually ready to work (so further dependencies can start + at the proper time). [#682] + * Also applied other optimizations to the script implementation. [#682] + + - powerpanel text driver now handles status responses in any format and should + support most devices. [#2156] + + - tripplite_usb driver now allows any device to match if a particular Unit ID + was not specified in `ups.conf`. [PR #2297, issues #2282 and #2258] + + - snmp-ups driver: + * added support for Eaton EMP002 sensor for ATS16 NM2 sub-driver. [#2286] + * mapping table updates for apc-mib sub-driver. [#2264] + + - usbhid-ups driver: + * `arduino-hid` subdriver was enhanced from "initial bare bones" experimental + set of mapped data points to support some 20 more mappings to make it more + useful as an UPS driver, not just a controller developer sandbox. [#2188] + * `cps-hid` subdriver now supports devices branded as Cyber Energy and built + by cooperation with Cyber Power Systems. [#2312] + * The `onlinedischarge` configuration flag name was too ambiguous and got + deprecated (will be supported but no longer promoted by documentation), + introducing `onlinedischarge_onbattery` as the meaningful alias. [#2213] + * Logged notifications about `OL+DISCHRG` state should now be throttled + (see the driver manual page for more details) [#2214, #2215]: + - If `battery.charge` is available, make the message when entering the + state and then only if the charge differs from that when we posted + the earlier message (e.g. really discharging) and is under + `onlinedischarge_log_throttle_hovercharge` value (defaults to 100%); + - Also can throttle to a time frequency configurable by a new option + `onlinedischarge_log_throttle_sec`, by default 30 sec if `battery.charge` + is not reported by the device (should be frequent by default, in case + the UPS-reported state combination does reflect a bad power condition). + + - Various code and documentation fixes for NSS crypto support. [#2274, #2268] + + - Laid foundations for the SmartNUT effort (aiming to integrate drivers with + some other backends than the networked NUT data server process). + + - Eaton contributed recipes and scripts used to create the IPP for Unix bundle + (UPS software companion), delivering NUT packages with an interactive + installer and some system integration scripts (events, notifications, + status, shutdown daemon...) -- provided "as is" at the moment, and may + later serve as foundation or inspiration for new NUT features. [#2288] + + - nutconf (C++ library and tool to read and manage NUT configuration files) + was started in the open by Eaton employees and used in the IPP installer, + but the code lingered in a side branch. It was now brushed up to our common + best practices and added to the main codebase. As of this import, there are + known deficiencies in Windows platform support, as well as some un-awareness + about configuration key words which appeared in NUT since 2013. [#2290] + + +Release notes for NUT 2.8.1 - what's new since 2.8.0 +---------------------------------------------------- + https://github.com/networkupstools/nut/milestone/8 - "UPS management protocol", Informational RFC 9271 published @@ -114,6 +280,7 @@ as part of https://github.com/networkupstools/nut/issues/1410 solution. (without specifying the single device) [#1759, #1806, #1875] * The `apcsmart` and `apcsmart-old` handled invalid data too zealously and aborted instead of skipping over it, like they did before [#2015] + * A bit maths optimization in `riello_ser` and `riello_usb` misfired [#2137] * Something about compile-time macros or other warnings-related refactoring seems to have confused the MGE SHUT (Serial HID UPS Transfer) driver support [#2022] @@ -217,13 +384,23 @@ as part of https://github.com/networkupstools/nut/issues/1410 solution. commits to apcupsd sources were in 2017 (with last release 3.14.14 in May 2016): https://sourceforge.net/p/apcupsd/svn/HEAD/tree/ + - dummy-ups: + * Added an `repeater_disable_strict_start` option to disable the driver + exiting upon encountering any kind of error at startup (as repeater). + This option should allow for collective `upsdrvctl` startup despite + individual target UPS to be repeated or `upsd` not having come up yet. + [#2132] + * Revised detection of file path (for "dummy" mode) which misfired under + some conditions, and unified several implementations. [#2118] + - 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]. It is known that at this time some features are not complete, for more details see https://github.com/orgs/networkupstools/projects/2/views/1 * Cross-builds of NUT for Windows using Linux and MinGW (and many custom - built dependency packages, as documented in link:scripts/Windows/README[]) + built dependency packages, as documented in the + link:scripts/Windows/README.adoc[scripts/Windows/README.adoc file]) are now regularly tested on NUT CI farm with moderate integration via custom build script `scripts/Windows/build-mingw-nut.sh` [#1489] * Semi-native NUT for Windows builds with MSYS2/MinGW x64 environment are @@ -389,6 +566,8 @@ as part of https://github.com/networkupstools/nut/issues/1410 solution. - nutclient C++ library: * added `listDeviceClients()` and `deviceGetClients(dev)` to `Client` classes, and `Device::getClients()` to match PyNUT capabilities [#549] + * published artifacts may include a `libnutclientstub` which is an + implementation of a NUT TCP client in C++ with in-memory data store. - upsclient C library: * added support for `NUT_QUIET_INIT_SSL` environment variable to hide @@ -419,28 +598,44 @@ as part of https://github.com/networkupstools/nut/issues/1410 solution. - Clarified documentation in codebase according to end-user feedback [#1721, #1750 and others over time] - - Several fixes for `upsmon` behavior [#1761, #1680...], including new - ability to configure default POWERDOWNFLAG location -- packagers are - encouraged to pick optimal location for their distributions (which - remains mounted at least read-only late in shutdown) and a new optional - POLLFAIL_LOG_THROTTLE_MAX setting [#529, #506] - - - Also `upsmon` should now recognize `OFF` and `BYPASS` flags in `ups.status` - and report that these states begin or end. The `OFF` state usually means - than an administrative action happened to power off the load, but the UPS - device is still alive and communicating (USB, SNMP, etc.); corresponding - `MONITOR`'ed amount of power sources are considered not being "fed" for - the power value calculation purposes. The `BYPASS` state is now treated - similarly to `ONBATT`: currently this UPS "feeds" its load, but if later - communications fail, it is considered dead. This may have unintended - consequences for devices (or NUT drivers) that do not report these modes - correctly (e.g. an APC calibration routine seems to start with a few - seconds of "OFF" state), so the reported status is only considered as a - loss of feed if it persists for more than `OFFDURATION` seconds. [#2044, - #2104] + - upsmon client changes include: + * Several fixes for `upsmon` behavior [#1761, #1680...], including new + ability to configure default POWERDOWNFLAG location -- packagers are + encouraged to pick optimal location for their distributions (which + remains mounted at least read-only late in shutdown) and a new optional + POLLFAIL_LOG_THROTTLE_MAX setting [#529, #506] + * Also `upsmon` should now recognize `OFF` and `BYPASS` flags in `ups.status` + and report that these states begin or end. The `OFF` state usually means + than an administrative action happened to power off the load, but the UPS + device is still alive and communicating (USB, SNMP, etc.); corresponding + `MONITOR`'ed amount of power sources are considered not being "fed" for + the power value calculation purposes. The `BYPASS` state is now treated + similarly to `ONBATT`: currently this UPS "feeds" its load, but if later + communications fail, it is considered dead. This may have unintended + consequences for devices (or NUT drivers) that do not report these modes + correctly (e.g. an APC calibration routine seems to start with a few + seconds of "OFF" state), so the reported status is only considered as a + loss of feed if it persists for more than `OFFDURATION` seconds. [#2044, + #2104] + * Introduced `SHUTDOWNEXIT no` configuration toggle for systems which + require a long time to stop their workload such as virtual machines. + Since the disconnection of a "secondary" client is treated by the + "primary" system as permission to proceed with its own shutdown and + power-off for the UPS, the original (now merely default) behavior to + call `SHUTDOWNCMD` and immediately exit could be counter-productive. + An optional delay can also be introduced. [#2133] + * Note there were other changes detailed below which impacted several NUT + programs, including `upsmon`. - Extended Linux systemd support with optional notifications about daemon state (READY, RELOADING, STOPPING) and watchdog keep-alive messages [#1590] + * Normally *inability* to send such notifications (e.g. lack of systemd + or similar framework on the particular platform) would be reported once + per daemon uptime on its console log, to help troubleshooting situations + where such lack of notifications can cause automated service restarts. + These messages can be hidden by setting `NUT_QUIET_INIT_UPSNOTIFY=true` + environment variable in init-scripts on platforms where such frameworks + are not expected. [#2136] - Extended Linux systemd units with aliases named after the daemons: `nut-server.service` as `upsd.service`, and `nut-monitor.service` as @@ -1817,7 +2012,7 @@ NOTE: Per original semantic versioning, there were no public NUT 2.3.x releases. - NUT now embeds Python client support through the PyNUTClient module and the NUT-Monitor application. Both are from David Goncalves, and are still available from http://www.lestat.st. - For more information, refer to link:scripts/python/README[]. + For more information, refer to link:scripts/python/README.adoc[]. - the dummy-ups driver now supports a "repeater" mode. This allows it to act as a NUT client, and to forward data. This can be useful for supervision and diff --git a/README.adoc b/README.adoc index 6cf0da879a..2121366665 100644 --- a/README.adoc +++ b/README.adoc @@ -1,5 +1,5 @@ Network UPS Tools Overview -=========================== +========================== // NOTE: No blank line here, document-header include processing should kick in! //GH_MARKUP_1095//ifdef::top_srcdir[] //GH_MARKUP_1095//include::{top_srcdir}docs/asciidoc-vars.conf[] @@ -128,6 +128,9 @@ endif::env-github[] // // - on GitHub: ifdef::env-github[] +// In our normal builds, Makefile variables convey the needed paths +// (used relatively below as `image:images/ci/...png` etc.) +:imagesdir: docs // * xref -> link // syntax: {xref}{x-s}[] // In order for it to work, can reference at most a section of @@ -158,6 +161,7 @@ endif::asciidoc-vars-nut-included[] // //GH_MARKUP_1095_INCLUDE_END// + Description ----------- @@ -187,6 +191,44 @@ also provided to log information regularly, monitor status through your web browser, and more. +NUT and the ecosystem +--------------------- + +NUT comes pre-packaged for many operating systems and embedded in storage, +automation or virtualization appliances, and is also often shipped as the +software companion by several UPS vendors. Of course, it is quite normal +and supported to build your own -- whether for an operating system which +lacks it yet, or for an older distribution which lacks the current NUT +version; whether to take advantage of new features or to troubleshoot a +new UPS deployment with a debugger in hand. + +Given its core position at the heart of your systems' lifecycle, we make +it a point to have current NUT building and running anywhere, especially +where older releases did work before (including "abandonware" like the +servers and OSes from the turn of millennium): if those boxes are still +alive and in need of power protection, they should be able to get it. + +[TIP] +===== +If you like how the NUT project helps protect your systems from power +outages, please consider sponsoring or at least "starring" it on GitHub at +https://github.com/networkupstools/nut/ - these stars are among metrics +which the larger potential sponsors consider when choosing how to help +FOSS projects. Keeping the lights shining in such a large non-regression +build matrix is a big undertaking! + +See <> for an overview of the shared effort. +===== + +As a FOSS project, for over a quarter of a century we welcome contributions +of both core code (drivers and other features), build recipes and other +integration elements to make it work on your favourite system, documentation +revisions to make it more accessible to newcomers, as well as hardware vendor +cooperation with first-hand driver and protocol submissions, and just about +anything else you can think of. + + Installing ---------- @@ -709,3 +751,87 @@ Acknowledgements / Contributions The many people who have participated in creating and improving NUT are listed in the user manual {xref}Acknowledgements{x-s}[acknowledgements appendix]. + +[[acknowledgements-ci-ops]] + +We would like to highlight some organizations which provide continuous +support to the NUT project (and many other FOSS projects) on technological +and organizational sides, such as helping keep the donations transparent, +NUT CI farm afloat, and public resources visible. Thanks for keeping the +clocks ticking, day and night: + +//////////// +FIXME: Use different (better-resolution) images for PDF rendering? + +FIXME: PDF cells seem to align weirdly, like setting the bottom of the first +line of text to be on the same level as bottom of the image, or similar to that. + +NOTE: GitHub renderer (or CSS stack?) ignores style settings and squashes the +logo column into a fixed-width monster with either our specified heights, or +with teeny-tiny thumbnail magnitude images, so it is prettier to leave it as +a "single-column table" by default. Grid/Frame settings are also ignored, but +we can try our best anyway. + +NOTE: The classic asciidoc/a2x renderer seems to not support link/url options, +but at least does not complain about them either. +//////////// + +ifndef::env-github[] +[frame="none",grid="none",cols="^.<1,<.<2"] +endif::env-github[] +ifdef::env-github[] +[frame="none",grid="none",cols="<1*"] +endif::env-github[] +|=== +| image:images/ci/GitHub-Mark-140pxW.png[alt="GitHub logo",width="140",height="140",link="https://github.com/"] +| The link:https://github.com/networkupstools/["NetworkUPSTools" organization + on GitHub] arranges a lot of things, including source code hosting for NUT + itself and several related projects, team management, projects, issue and + pull request discussions, sponsorship, nut-website rendering and hosting, + some automated actions, and more... + +| image:images/ci/jenkins-nut-transparent-bg-140pxW.png[alt="Jenkins and NUT logo",width="139",height="104",link="https://www.jenkins.io/"] +| The link:https://www.jenkins.io/[Jenkins CI] project and its huge plugin + ecosystem provides the technological foundation for the largest island of + the link:https://ci.networkupstools.org/[self-hosted NUT CI farm]. + There is a fair amount of cross-pollination between the upstream project + and community, and the development done originally for the NUT CI farm. + + See more at link:https://stories.jenkins.io/user-story/jenkins-is-the-way-for-networkupstools/[Jenkins + is the way to build multi-platform NUT] article. + +| image:images/ci/fosshost_org_Host_Light_38px.png[alt="Fosshost logo",width="112",height="38"] +| Fosshost provided virtual machines where the multi-platform NUT CI farm with + a link:https://github.com/networkupstools/jenkins-dynamatrix/[jenkins-dynamatrix] + link:https://github.com/networkupstools/nut/blob/master/Jenkinsfile-dynamatrix[setup] + runs to arrange builds in numerous operating environments and a lot of toolkit + versions and implementations. Some workers running on NUT community members' + machines can also dial in to provide an example of their favourite platforms. + Literally hundreds of NUT builds run for each iteration, to make sure NUT can + always build and work everywhere. + + This allows us to ensure that NUT remains portable across two decades' worth + of operating systems, compilers, script interpreters, tools and third-party + dependencies. + +| image:images/ci/CircleCI_vertical_black_logo.png[alt="CircleCI logo",width="130",height="107",link="https://circleci.com/"] +| The + link:https://app.circleci.com/pipelines/github/networkupstools/nut/[CircleCI + NUT pipeline] allows us to test NUT CI builds on MacOS. + +| image:images/ci/AppVeyor_logo-ar21.png[alt="AppVeyor logo",width="120",height="60",link="https://www.appveyor.com/"] +| The link:https://ci.appveyor.com/project/nut-travis/nut/[AppVeyor + NUT pipeline] allows us to test NUT CI builds on Windows (and publish + preview tarballs with binaries). + +| image:images/ci/DO_Powered_by_Badge_blue_140pxW.png[alt="DigitalOcean logo",width="140",height="29",link="https://www.digitalocean.com/?refcode=d2fbf2b9e082&utm_campaign=Referral_Invite&utm_medium=Referral_Program&utm_source=badge"] +| The link:https://www.digitalocean.com/?refcode=d2fbf2b9e082&utm_campaign=Referral_Invite&utm_medium=Referral_Program&utm_source=badge[DigitalOcean] droplets allow us to host + NUT CI farm build agents, and eventually re-house the Jenkins controller too. + +| image:images/ci/gandi-ar21.png[alt="Gandi.Net logo",width="120",height="60",link="https://www.gandi.net/"] +| link:https://www.gandi.net/[Gandi.Net] took up the costs of NUT DNS hosting. + +| image:images/ci/OC_logo_merged_140x26.png[alt="Open Collective logo",width="140",height="26",link="https://opencollective.com/"] +| https://opencollective.com/networkupstools allows us to arrange monetary + donations and spending, with public transparency of everything that happens. +|=== diff --git a/UPGRADING.adoc b/UPGRADING.adoc index 6cdfd2bae5..2ede05ee5a 100644 --- a/UPGRADING.adoc +++ b/UPGRADING.adoc @@ -21,11 +21,32 @@ be beneficial to add `--enable-option-checking=fatal` to the `./configure` command line, in order to quickly pick up any other removed option flags. ====== -Changes from 2.8.0 to 2.8.1 +Changes from 2.8.2 to 2.8.3 --------------------------- - PLANNED: Keep track of any further API clean-up? + +Changes from 2.8.1 to 2.8.2 +--------------------------- + +- Builds requested with a specific C/C++ language standard revision via + `CFLAGS` and `CXXFLAGS` should again be honoured. There was a mishap + with the `m4` scripting for `autoconf` which could have caused use of + C11/C++11 if compiler supported it, regardless of a request. [PR #2306] + +- Added generation of FreeBSD/pfSense quirks for USB devices supported + by NUT (may get installed to `$datadir` e.g. `/usr/local/share/nut` + and need to be pasted into your `/boot/loader.conf.local`). [#2159] + +- nut-scanner now does not propose active `bus`, `busport` and `device` + values when generating device configurations by default. They may + appear as comments, or enabled by specifying the `-U` command-line + option several times. [#2221] + +Changes from 2.8.0 to 2.8.1 +--------------------------- + - NUT documentation recipes were revised, so many of the text source files were renamed to `*.adoc` pattern. Newly, a `release-notes.pdf` and HTML equivalents are generated. Packages which deliver documentation may need @@ -128,10 +149,26 @@ Changes from 2.8.0 to 2.8.1 and exposed in `libnutscan.so` builds in particular - API version for the public library was bumped [#317] -- A `NUT_DEBUG_PID` envvar (presence) support was added to add current - process ID to tags with debug-level identifiers. This may be useful - when many NUT daemons write to the same console or log file, such as - in containers/plugins for Home Assistant, storage appliances, etc. [#2118] +- Some environment variable support was added to NUT programs, primarily + aimed at wrappers such as init scripts and service unit definitions, + allowing to tweak what (and whether) they write into debug traces, and + so "make noise" or "bring invaluable insights" to logs or terminal: + * A `NUT_DEBUG_LEVEL=NUM` envvar allows to temporarily boost debugging + of many daemons (`upsd`, `upsmon`, drivers, `upsdrvctl`, `upssched`) + without changes to configuration files or scripted command lines. [#1915] + * A `NUT_DEBUG_PID` envvar (presence) support was added to add current + process ID to tags with debug-level identifiers. This may be useful + when many NUT daemons write to the same console or log file, such as + in containers/plugins for Home Assistant, storage appliances, etc. [#2118] + * A `NUT_QUIET_INIT_SSL` envvar (presence or "true" value) prevents + `libupsclient` consumers (notoriously `upsc`) from reporting whether + they have initialized SSL support. [#1662] + * A `NUT_QUIET_INIT_UPSNOTIFY` envvar (presence or "true" value) + prevents daemons which can notify service management frameworks (such + as systemd) about passing their lifecycle milestones, to not report + loudly if they could not do so (e.g. running on a system without a + framework, or misconfigured so they could not report and the OS would + restart the false-positively "unresponsive" service). [#2136] - `configure` script, reference init-script and packaging templates updated to eradicate `@PIDPATH@/nut` ambiguity in favor of `@ALTPIDPATH@` for the diff --git a/appveyor.yml b/appveyor.yml index 1ab71e3f99..ba5101aa18 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -6,7 +6,7 @@ # https://www.appveyor.com/docs/build-configuration/ # https://www.appveyor.com/docs/windows-images-software/ -version: 2.8.0.{build}-{branch} +version: 2.8.1.{build}-{branch} # base image image: Visual Studio 2022 @@ -27,6 +27,7 @@ environment: CCACHE_DIR: /home/appveyor/.ccache # https://github.com/networkupstools/nut/blob/Windows-v2.8.0-1/docs/config-prereqs.txt#L951 +# or look for the chapter in nearby lines in later (current) revisions. # Note: not using `time` in scripts currently - they did upset # AppVeyor console log scanner with a /^sys.*/ match (apparently) install: @@ -40,7 +41,7 @@ install: REM Normal update (same command again): C:\msys64\usr\bin\bash -lc "date -u; pacman --noconfirm -Syuu" - cmd: | - REM Prerequisites for NUT per https://github.com/networkupstools/nut/blob/Windows-v2.8.0-1/docs/config-prereqs.txt : + REM Prerequisites for NUT per https://github.com/networkupstools/nut/blob/master/docs/config-prereqs.txt : C:\msys64\usr\bin\bash -lc "date -u; pacman --noconfirm -S --needed base-devel mingw-w64-x86_64-toolchain autoconf-wrapper automake-wrapper libtool mingw-w64-x86_64-libltdl gcc ccache mingw-w64-x86_64-ccache git aspell aspell-en python mingw-w64-x86_64-python-pygments mingw-w64-x86_64-winpthreads-git mingw-w64-x86_64-libusb mingw-w64-x86_64-libusb-compat-git mingw-w64-x86_64-neon libneon-devel mingw-w64-x86_64-libmodbus-git mingw-w64-x86_64-libgd mingw-w64-x86_64-cppunit" - cmd: | REM Assorted stats after package processing: @@ -55,7 +56,7 @@ install: before_build: - cmd: | REM Ensure we have a net-snmp to build against - REM Adapted from scripts/Windows/README document. + REM Adapted from scripts/Windows/README.adoc document. REM Here we hope to build it once, then use the REM stashed version across Appveyor rebuilds. REM Preserve the current working directory: @@ -90,7 +91,7 @@ test_script: REM Start a 64 bit Mingw environment: set MSYSTEM=MINGW64 REM Start Mingw-based integration and unit checks: - C:\msys64\usr\bin\bash -lc 'date -u; PATH="/mingw64/bin:$PATH" make -s check' + C:\msys64\usr\bin\bash -lc 'date -u; NUT_STATEPATH="C:\\Users\\appveyor\\AppData\\Local\\Temp\\nut-test"; mkdir -p "${NUT_STATEPATH}"; export NUT_STATEPATH; PATH="/mingw64/bin:$PATH" make -s check || bash -lc "for F in tests/*.log tests/*.trs ; do echo \"===---=== $F :\"; cat \"$F\"; done; exit 1;" ' REM Start a Mingw-based documentation spellcheck: C:\msys64\usr\bin\bash -lc 'date -u; PATH="/mingw64/bin:$PATH" make -s -j 4 spellcheck' diff --git a/autogen.sh b/autogen.sh index 87ef062949..afcf3d647b 100755 --- a/autogen.sh +++ b/autogen.sh @@ -39,6 +39,10 @@ else PYTHON="" # FIXME: Use something like TAB-completion to find every name on PATH? for P in python python3 python2 \ + python-3.14 python3.14 \ + python-3.13 python3.13 \ + python-3.12 python3.12 \ + python-3.11 python3.11 \ python-3.10 python3.10 \ python-3.9 python3.9 \ python-3.7 python3.7 \ @@ -90,12 +94,21 @@ fi # grep -i '">' tools/nut-usbinfo.pl # * List the names involved: # grep -E 'output.*=' tools/nut-usbinfo.pl +# Also check that the last re-generation is newer than the sources involved +# (stay on top of CI rebuilds, development, Git branch switching...) +# Someone please tell me why GNU `find dir -newer X -name Y -o -name Z` does +# not filter away layer by layer, but rather finds the names Z and beyond +# (same for the other way around)? Anyway, dumbed down for the most trivial +# `find` implementations out there... if [ ! -f scripts/udev/nut-usbups.rules.in -o \ ! -f scripts/hotplug/libhid.usermap -o \ ! -f scripts/upower/95-upower-hid.hwdb -o \ ! -f scripts/devd/nut-usb.conf.in -o \ - ! -f tools/nut-scanner/nutscan-usb.h ] -then + ! -f scripts/devd/nut-usb.quirks -o \ + ! -f tools/nut-scanner/nutscan-usb.h ] \ +|| [ -n "`find drivers -newer scripts/hotplug/libhid.usermap | grep -E '(-hid|nutdrv_qx|usb.*)\.c'`" ] \ +|| [ -n "`find drivers -not -newer tools/nut-usbinfo.pl | grep -E '(-hid|nutdrv_qx|usb.*)\.c'`" ] \ +; then if perl -e 1; then VERBOSE_FLAG_PERL="" if $DEBUG ; then diff --git a/ci_build.sh b/ci_build.sh index 66699ab2dc..83e395e447 100755 --- a/ci_build.sh +++ b/ci_build.sh @@ -96,6 +96,9 @@ if [ "$BUILD_TYPE" = fightwarn ]; then #[ -n "$NUT_USB_VARIANTS" ] || NUT_USB_VARIANTS=auto fi +# configure default is "no"; an "auto" value is "yes unless CFLAGS say something" +[ -n "${BUILD_DEBUGINFO-}" ] || BUILD_DEBUGINFO="" + # Set this to enable verbose profiling [ -n "${CI_TIME-}" ] || CI_TIME="" case "$CI_TIME" in @@ -293,6 +296,18 @@ for L in $NODE_LABELS ; do "NUT_BUILD_CAPS=cppunit"|"NUT_BUILD_CAPS=cppunit=yes") [ -n "$CANBUILD_CPPUNIT_TESTS" ] || CANBUILD_CPPUNIT_TESTS=yes ;; + # This should cover both the --with-nutconf tool setting + # and the cppunit tests for it (if active per above). + # By default we would nowadays guess (requires C++11). + "NUT_BUILD_CAPS=nutconf=no") + [ -n "$CANBUILD_NUTCONF" ] || CANBUILD_NUTCONF=no ;; + "NUT_BUILD_CAPS=nutconf=no-gcc") + [ -n "$CANBUILD_NUTCONF" ] || CANBUILD_NUTCONF=no-gcc ;; + "NUT_BUILD_CAPS=nutconf=no-clang") + [ -n "$CANBUILD_NUTCONF" ] || CANBUILD_NUTCONF=no-clang ;; + "NUT_BUILD_CAPS=nutconf"|"NUT_BUILD_CAPS=nutconf=yes") + [ -n "$CANBUILD_NUTCONF" ] || CANBUILD_NUTCONF=yes ;; + # Some (QEMU) builders have issues running valgrind as a tool "NUT_BUILD_CAPS=valgrind=no") [ -n "$CANBUILD_VALGRIND_TESTS" ] || CANBUILD_VALGRIND_TESTS=no ;; @@ -644,11 +659,18 @@ check_gitignore() { return 0 fi - # One invocation should report to log: - git status $GIT_ARGS -s -- "${FILE_GLOB}" \ - | grep -E -v '^.. \.ci.*\.log.*' \ - | grep -E "${FILE_REGEX}" \ - || echo "WARNING: Could not query git repo while in `pwd`" >&2 + # One invocation should report to log if there was any discrepancy + # to report in the first place (GITOUT may be empty without error): + GITOUT="`git status $GIT_ARGS -s -- "${FILE_GLOB}"`" \ + || { echo "WARNING: Could not query git repo while in `pwd`" >&2 ; GITOUT=""; } + + if [ -n "${GITOUT-}" ] ; then + echo "$GITOUT" \ + | grep -E -v '^.. \.ci.*\.log.*' \ + | grep -E "${FILE_REGEX}" + else + echo "Got no output and no errors querying git repo while in `pwd`: seems clean" >&2 + fi echo "===" # Another invocation checks that there was nothing to complain about: @@ -774,7 +796,7 @@ fi echo "Processing BUILD_TYPE='${BUILD_TYPE}' ..." echo "Build host settings:" -set | grep -E '^(PATH|.*CCACHE.*|CI_.*|OS_.*|CANBUILD_.*|NODE_LABELS|MAKE|C.*FLAGS|LDFLAGS|ARCH.*|BITS.*|CC|CXX|CPP|DO_.*|BUILD_.*)=' || true +set | grep -E '^(PATH|[^ ]*CCACHE[^ ]*|CI_[^ ]*|OS_[^ ]*|CANBUILD_[^ ]*|NODE_LABELS|MAKE|C[^ ]*FLAGS|LDFLAGS|ARCH[^ ]*|BITS[^ ]*|CC|CXX|CPP|DO_[^ ]*|BUILD_[^ ]*)=' || true uname -a echo "LONG_BIT:`getconf LONG_BIT` WORD_BIT:`getconf WORD_BIT`" || true if command -v xxd >/dev/null ; then xxd -c 1 -l 6 | tail -1; else if command -v od >/dev/null; then od -N 1 -j 5 -b | head -1 ; else hexdump -s 5 -n 1 -C | head -1; fi; fi < /bin/ls 2>/dev/null | awk '($2 == 1){print "Endianness: LE"}; ($2 == 2){print "Endianness: BE"}' || true @@ -1060,6 +1082,40 @@ default|default-alldrv|default-alldrv:no-distcheck|default-all-errors|default-sp CONFIG_OPTS+=("--enable-cppunit=no") fi + if ( [ "${CANBUILD_NUTCONF-}" = "no-gcc" ] && [ "$COMPILER_FAMILY" = "GCC" ] ) \ + || ( [ "${CANBUILD_NUTCONF-}" = "no-clang" ] && [ "$COMPILER_FAMILY" = "CLANG" ] ) \ + ; then + CANBUILD_NUTCONF=no + fi + + case "${CANBUILD_NUTCONF-}" in + yes) + # Depends on C++11 or newer, so let configure script try this tediously + # unless we know we would not build for the too-old language revision + case "${CXXFLAGS-}" in + *-std=c++98*|*-std=gnu++98*|*-std=c++03*|*-std=gnu++03*) + echo "WARNING: Build agent says it can build nutconf, but requires a test with C++ revision too old - so not requiring the experimental feature (auto-try)" >&2 + CONFIG_OPTS+=("--with-nutconf=auto") + ;; + *-std=c++0x*|*-std=gnu++0x*|*-std=c++1*|*-std=gnu++1*|*-std=c++2*|*-std=gnu++2*) + echo "WARNING: Build agent says it can build nutconf, and requires a test with a sufficiently new C++ revision - so requiring the experimental feature" >&2 + CONFIG_OPTS+=("--with-nutconf=yes") + ;; + *) + echo "WARNING: Build agent says it can build nutconf, and does not specify a test with prticular C++ revision - so not requiring the experimental feature (auto-try)" >&2 + CONFIG_OPTS+=("--with-nutconf=auto") + ;; + esac + ;; + no) + echo "WARNING: Build agent says it can not build nutconf, disabling the feature (do not even try)" >&2 + CONFIG_OPTS+=("--with-nutconf=no") + ;; + "") + CONFIG_OPTS+=("--with-nutconf=auto") + ;; + esac + if [ "${CANBUILD_VALGRIND_TESTS-}" = no ] ; then echo "WARNING: Build agent says it has a broken valgrind, adding configure option to skip tests with it" >&2 CONFIG_OPTS+=("--with-valgrind=no") @@ -1299,6 +1355,10 @@ default|default-alldrv|default-alldrv:no-distcheck|default-all-errors|default-sp # and errors are found more easily in a wall of text: CONFIG_OPTS+=("--enable-Wcolor") + if [ -n "${BUILD_DEBUGINFO-}" ]; then + CONFIG_OPTS+=("--with-debuginfo=${BUILD_DEBUGINFO}") + fi + # Note: modern auto(re)conf requires pkg-config to generate the configure # script, so to stage the situation of building without one (as if on an # older system) we have to remove it when we already have the script. @@ -1317,6 +1377,15 @@ default|default-alldrv|default-alldrv:no-distcheck|default-all-errors|default-sp fi fi + # When itertating configure.ac or m4 sources, we can end up with an + # existing but useless scropt file - nuke it and restart from scratch! + if [ -s "${CI_BUILDDIR}"/configure ] ; then + if ! sh -n "${CI_BUILDDIR}"/configure 2>/dev/null ; then + echo "=== Starting initial clean-up (from old build products): TAKING SHORTCUT because current configure script syntax is broken" + rm -f "${CI_BUILDDIR}"/Makefile "${CI_BUILDDIR}"/configure + fi + fi + if [ -s Makefile ]; then # Let initial clean-up be at default verbosity @@ -1893,9 +1962,9 @@ bindings) pushd "./bindings/${BINDING}" && ./ci_build.sh ;; ""|inplace) - echo "ERROR: No BUILD_TYPE was specified, doing a minimal default ritual without any required options" >&2 + echo "WARNING: No BUILD_TYPE was specified, doing a minimal default ritual without any *required* build products and with developer-oriented options" >&2 if [ -n "${BUILD_WARNOPT}${BUILD_WARNFATAL}" ]; then - echo "WARNING: BUILD_WARNOPT and BUILD_WARNFATAL settings are ignored in this mode" >&2 + echo "WARNING: BUILD_WARNOPT and BUILD_WARNFATAL settings are ignored in this mode (warnings are always enabled and fatal for these developer-oriented builds)" >&2 sleep 5 fi echo "" @@ -1925,6 +1994,15 @@ bindings) fi fi + # When itertating configure.ac or m4 sources, we can end up with an + # existing but useless scropt file - nuke it and restart from scratch! + if [ -s "${CI_BUILDDIR}"/configure ] ; then + if ! sh -n "${CI_BUILDDIR}"/configure 2>/dev/null ; then + echo "=== Starting initial clean-up (from old build products): TAKING SHORTCUT because current configure script syntax is broken" + rm -f "${CI_BUILDDIR}"/Makefile "${CI_BUILDDIR}"/configure + fi + fi + if [ -s Makefile ]; then # Help developers debug: # Let initial clean-up be at default verbosity @@ -1941,6 +2019,7 @@ bindings) # enable whatever is auto-detectable (except docs), and highlight # any warnings if we can. CONFIG_OPTS=(--enable-Wcolor \ + --enable-warnings --enable-Werror \ --enable-keep_nut_report_feature \ --with-all=auto --with-cgi=auto --with-serial=auto \ --with-dev=auto --with-doc=skip \ @@ -1957,6 +2036,12 @@ bindings) CONFIG_OPTS+=("--disable-silent-rules") fi + if [ -n "${BUILD_DEBUGINFO-}" ]; then + CONFIG_OPTS+=("--with-debuginfo=${BUILD_DEBUGINFO}") + else + CONFIG_OPTS+=("--with-debuginfo=auto") + fi + ${CONFIGURE_SCRIPT} "${CONFIG_OPTS[@]}" # NOTE: Currently parallel builds are expected to succeed (as far @@ -1982,9 +2067,9 @@ bindings) # These mingw modes below are currently experimental and not too integrated # with this script per se; it is intended to run for NUT CI farm on prepared -# Linux+mingw worker nodes (see scripts/Windows/README) in an uniform manner, -# using mostly default settings (warnings in particular) and some hardcoded -# in that script (ARCH, CFLAGS, ...). +# Linux+mingw worker nodes (see scripts/Windows/README.adoc) in an uniform +# manner, using mostly default settings (warnings in particular) and some +# values hardcoded in that script (ARCH, CFLAGS, ...). # Note that semi-native builds with e.g. MSYS2 on Windows should "just work" as # on any other supported platform (more details in docs/config-prereqs.txt). cross-windows-mingw*) diff --git a/clients/Makefile.am b/clients/Makefile.am index 8d88eba14c..b873046cc0 100644 --- a/clients/Makefile.am +++ b/clients/Makefile.am @@ -1,4 +1,14 @@ # Network UPS Tools: clients + +# Export certain values for ccache which NUT ci_build.sh can customize, +# to facilitate developer iteration re-runs of "make" later. +# At least GNU and BSD make implementations are okay with this syntax. +@NUT_AM_MAKE_CAN_EXPORT@export CCACHE_NAMESPACE=@CCACHE_NAMESPACE@ +@NUT_AM_MAKE_CAN_EXPORT@export CCACHE_BASEDIR=@CCACHE_BASEDIR@ +@NUT_AM_MAKE_CAN_EXPORT@export CCACHE_DIR=@CCACHE_DIR@ +@NUT_AM_MAKE_CAN_EXPORT@export CCACHE_PATH=@CCACHE_PATH@ +@NUT_AM_MAKE_CAN_EXPORT@export PATH=@PATH_DURING_CONFIGURE@ + EXTRA_DIST = # nutclient.cpp for some legacy reason (maybe initial detached development?) @@ -10,7 +20,7 @@ AM_CXXFLAGS = -DHAVE_NUTCOMMON=1 -I$(top_srcdir)/include $(top_builddir)/common/libcommon.la \ $(top_builddir)/common/libcommonclient.la \ $(top_builddir)/common/libparseconf.la: dummy - @cd $(@D) && $(MAKE) $(AM_MAKEFLAGS) $(@F) + +@cd $(@D) && $(MAKE) $(AM_MAKEFLAGS) $(@F) LDADD_FULL = $(top_builddir)/common/libcommon.la libupsclient.la $(NETLIBS) if WITH_SSL diff --git a/clients/cgilib.c b/clients/cgilib.c index 09606ad04c..160618e354 100644 --- a/clients/cgilib.c +++ b/clients/cgilib.c @@ -17,9 +17,11 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include "common.h" + #include +#include -#include "common.h" #include "cgilib.h" #include "parseconf.h" diff --git a/clients/upsc.c b/clients/upsc.c index 4a01682b9f..71715f4731 100644 --- a/clients/upsc.c +++ b/clients/upsc.c @@ -240,7 +240,7 @@ int main(int argc, char **argv) case 'V': nut_report_config_flags(); - fatalx(EXIT_SUCCESS, "Network UPS Tools upscmd %s", UPS_VERSION); + fatalx(EXIT_SUCCESS, "Network UPS Tools upsc %s", UPS_VERSION); #ifndef HAVE___ATTRIBUTE__NORETURN exit(EXIT_SUCCESS); /* Should not get here in practice, but compiler is afraid we can fall through */ #endif diff --git a/clients/upsmon.c b/clients/upsmon.c index 68ab3380fe..1b4af7cfb4 100644 --- a/clients/upsmon.c +++ b/clients/upsmon.c @@ -3,6 +3,7 @@ Copyright (C) 1998 Russell Kroll 2012 Arnaud Quette + 2020-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 @@ -60,8 +61,9 @@ static unsigned int pollfreq = 5, pollfreqalert = 5; * will only be repeated every so many POLLFREQ loops. * If pollfail_log_throttle_max == 0, such error messages will * only be reported once when that situation starts, and ends. - * By default it is logged every pollfreq (which can abuse syslog - * and its storage). + * By default (or for negative values) it is logged every pollfreq + * loop cycle (which can abuse syslog and its storage), same as + * if "max = 1". * To support this, each utype_t (UPS) structure tracks individual * pollfail_log_throttle_count and pollfail_log_throttle_state */ @@ -112,6 +114,7 @@ static char *certpasswd = NULL; static int certverify = 0; /* don't verify by default */ static int forcessl = 0; /* don't require ssl by default */ +static int shutdownexitdelay = 0; /* by default doshutdown() exits immediately */ static int userfsd = 0, pipefd[2]; /* Should we run "all in one" (e.g. as root) or split * into two upsmon processes for some more security? */ @@ -215,7 +218,8 @@ typedef struct async_notify_s { int flags; char *ntype; char *upsname; - char *date; } async_notify_t; + char *date; +} async_notify_t; static unsigned __stdcall async_notify(LPVOID param) { @@ -466,7 +470,8 @@ static int apply_for_primary(utype_t *ups) return 0; } -/* authenticate to upsd, plus do LOGIN and MASTER if applicable */ +/* authenticate to upsd, plus do LOGIN and apply for PRIMARY/MASTER privileges + * if applicable to this ups device MONITORing configuration */ static int do_upsd_auth(utype_t *ups) { char buf[SMALLBUF]; @@ -811,6 +816,28 @@ static void doshutdown(void) shutdowncmd); } + if (shutdownexitdelay == 0) { + upsdebugx(1, + "Exiting upsmon immediately " + "after initiating shutdown, by default"); + } else + if (shutdownexitdelay < 0) { + upslogx(LOG_WARNING, + "Configured to not exit upsmon " + "after initiating shutdown"); + /* Technically, here we sleep until SIGTERM or poweroff */ + do { + sleep(1); + } while (!exit_flag); + } else { + upslogx(LOG_WARNING, + "Configured to only exit upsmon %d sec " + "after initiating shutdown", shutdownexitdelay); + do { + sleep(1); + shutdownexitdelay--; + } while (!exit_flag && shutdownexitdelay); + } exit(EXIT_SUCCESS); } @@ -1073,10 +1100,11 @@ static int is_ups_critical(utype_t *ups) /* administratively OFF (long enough, see OFFDURATION) */ if (flag_isset(ups->status, ST_OFF) && offdurationtime >= 0 - && (ups->linestate == 0 || ups->offstate == 1)) { + && ups->offstate == 1) { upslogx(LOG_WARNING, "UPS [%s] is reported as (administratively) OFF", ups->sys); + upsdebugx(1, "UPS [%s] is now critical being OFF for too long. In case of persisting unwanted shutdowns, consider disabling the upsmon 'OFFDURATION' option.", ups->sys); return 1; } @@ -1188,7 +1216,7 @@ static void upsreplbatt(utype_t *ups) } } -static void ups_cal(utype_t *ups) +static void ups_is_cal(utype_t *ups) { if (flag_isset(ups->status, ST_CAL)) { /* no change */ upsdebugx(4, "%s: %s (no change)", __func__, ups->sys); @@ -1203,6 +1231,16 @@ static void ups_cal(utype_t *ups) setflag(&ups->status, ST_CAL); } +static void ups_is_notcal(utype_t *ups) +{ + /* Called when CAL is NOT among known states */ + if (flag_isset(ups->status, ST_CAL)) { /* actual change */ + do_notify(ups, NOTIFY_NOTCAL); + clearflag(&ups->status, ST_CAL); + try_restore_pollfreq(ups); + } +} + static void ups_fsd(utype_t *ups) { if (flag_isset(ups->status, ST_FSD)) { /* no change */ @@ -1221,10 +1259,21 @@ static void ups_fsd(utype_t *ups) /* cleanly close the connection to a given UPS */ static void drop_connection(utype_t *ups) { - upsdebugx(2, "Dropping connection to UPS [%s]", ups->sys); + if (ups->linestate == 1 && flag_isset(ups->status, ST_ONLINE)) + upsdebugx(2, "Dropping connection to UPS [%s], last seen as fully online.", ups->sys); + else + upsdebugx(2, "Dropping connection to UPS [%s], last seen as not fully online (might be considered critical later).", ups->sys); + + if(ups->offstate == 1 || flag_isset(ups->status, ST_OFF)) + upsdebugx(2, "Disconnected UPS [%s] was last seen in status OFF, this UPS might be considered critical later.", ups->sys); + + if(ups->bypassstate == 1 || flag_isset(ups->status, ST_BYPASS)) + upsdebugx(2, "Disconnected UPS [%s] was last seen in status BYPASS, this UPS might be considered critical later.", ups->sys); + + if(flag_isset(ups->status, ST_CAL)) + upsdebugx(2, "Disconnected UPS [%s] was last seen in status CAL, this UPS might be considered critical later.", ups->sys); ups->commstate = 0; - ups->linestate = 0; /* forget poll-failure logging throttling */ ups->pollfail_log_throttle_count = -1; @@ -1570,6 +1619,28 @@ static int parse_conf_arg(size_t numargs, char **arg) return 1; } + /* SHUTDOWNEXIT */ + if (!strcmp(arg[0], "SHUTDOWNEXIT")) { + if (!strcasecmp(arg[1], "on") + || !strcasecmp(arg[1], "yes") + || !strcasecmp(arg[1], "true")) { + shutdownexitdelay = 0; + } else + if (!strcasecmp(arg[1], "off") + || !strcasecmp(arg[1], "no") + || !strcasecmp(arg[1], "false")) { + shutdownexitdelay = -1; + } else { + if (!str_to_int(arg[1], &shutdownexitdelay, 10)) { + upslogx(LOG_WARNING, + "SHUTDOWNEXIT value not recognized, " + "defaulting to 'yes'"); + shutdownexitdelay = 0; + } + } + return 1; + } + /* POWERDOWNFLAG */ if (!strcmp(arg[0], "POWERDOWNFLAG")) { checkmode(arg[0], powerdownflag, arg[1], reload_flag); @@ -1709,7 +1780,7 @@ static int parse_conf_arg(size_t numargs, char **arg) /* DEBUG_MIN (NUM) */ /* debug_min (NUM) also acceptable, to be on par with ups.conf */ if (!strcasecmp(arg[0], "DEBUG_MIN")) { - int lvl = -1; // typeof common/common.c: int nut_debug_level + int lvl = -1; /* typeof common/common.c: int nut_debug_level */ if ( str_to_int (arg[1], &lvl, 10) && lvl >= 0 ) { nut_debug_level_global = lvl; } else { @@ -1781,6 +1852,7 @@ static void upsmon_err(const char *errmsg) static void loadconfig(void) { PCONF_CTX_t ctx; + int numerrors = 0; pconf_init(&ctx, upsmon_err); @@ -1800,12 +1872,34 @@ static void loadconfig(void) * (or commented away) the debug_min * setting, detect that */ nut_debug_level_global = -1; + + if (pollfail_log_throttle_max >= 0) { + utype_t *ups; + + upslogx(LOG_INFO, + "Forgetting POLLFAIL_LOG_THROTTLE_MAX=%d and " + "resetting UPS error-state counters before " + "a configuration reload", + pollfail_log_throttle_max); + pollfail_log_throttle_max = -1; + + /* forget poll-failure logging throttling, so that we + * rediscover the error-states and the counts involved + */ + ups = firstups; + while (ups) { + ups->pollfail_log_throttle_count = -1; + ups->pollfail_log_throttle_state = UPSCLI_ERR_NONE; + ups = ups->next; + } + } } while (pconf_file_next(&ctx)) { if (pconf_parse_error(&ctx)) { upslogx(LOG_ERR, "Parse error: %s:%d: %s", configfile, ctx.linenum, ctx.errmsg); + numerrors++; continue; } @@ -1824,6 +1918,7 @@ static void loadconfig(void) snprintfcat(errmsg, sizeof(errmsg), " %s", ctx.arglist[i]); + numerrors++; upslogx(LOG_WARNING, "%s", errmsg); } } @@ -1831,7 +1926,7 @@ static void loadconfig(void) if (reload_flag == 1) { if (nut_debug_level_global > -1) { upslogx(LOG_INFO, - "Applying debug_min=%d from upsmon.conf", + "Applying DEBUG_MIN %d from upsmon.conf", nut_debug_level_global); nut_debug_level = nut_debug_level_global; } else { @@ -1845,11 +1940,18 @@ static void loadconfig(void) if (pollfail_log_throttle_max >= 0) { upslogx(LOG_INFO, - "Applying pollfail_log_throttle_max=%d from upsmon.conf", + "Applying POLLFAIL_LOG_THROTTLE_MAX %d from upsmon.conf", pollfail_log_throttle_max); } } + /* FIXME: Per legacy behavior, we silently went on. + * Maybe should abort on unusable configs? + */ + if (numerrors) { + upslogx(LOG_ERR, "Encountered %d config errors, those entries were ignored", numerrors); + } + pconf_finish(&ctx); } @@ -2074,6 +2176,10 @@ static void parse_status(utype_t *ups, char *status) clearflag(&ups->status, ST_LOWBATT); if (!strstr(status, "FSD")) clearflag(&ups->status, ST_FSD); + + /* similar to above - clear these flags and send notifications */ + if (!strstr(status, "CAL")) + ups_is_notcal(ups); if (!strstr(status, "OFF")) ups_is_notoff(ups); if (!strstr(status, "BYPASS")) @@ -2098,7 +2204,7 @@ static void parse_status(utype_t *ups, char *status) if (!strcasecmp(statword, "RB")) upsreplbatt(ups); if (!strcasecmp(statword, "CAL")) - ups_cal(ups); + ups_is_cal(ups); if (!strcasecmp(statword, "OFF")) ups_is_off(ups); if (!strcasecmp(statword, "BYPASS")) @@ -2179,9 +2285,11 @@ static void pollups(utype_t *ups) * failure state */ pollfail_log = 0; } else { - /* Only log once for start, every MAX iterations, - * and end of the same failure state */ - if (ups->pollfail_log_throttle_count++ >= pollfail_log_throttle_max) { + /* here (pollfail_log_throttle_max > 0) : + * only log once for start, every MAX iterations, + * and end of the same failure state + */ + if (ups->pollfail_log_throttle_count++ >= (pollfail_log_throttle_max - 1)) { /* ping... */ pollfail_log = 1; ups->pollfail_log_throttle_count = 0; @@ -2202,9 +2310,10 @@ static void pollups(utype_t *ups) upslogx(LOG_ERR, "Poll UPS [%s] failure state code " "changed from %d to %d; " "report below will only be repeated to syslog " - "every %d polling loop cycles:", + "every %d polling loop cycles (%d sec):", ups->sys, ups->pollfail_log_throttle_state, - upserror, pollfail_log_throttle_max); + upserror, pollfail_log_throttle_max, + pollfail_log_throttle_max * pollfreq); } ups->pollfail_log_throttle_state = upserror; diff --git a/clients/upsmon.h b/clients/upsmon.h index 25c760b479..767e146709 100644 --- a/clients/upsmon.h +++ b/clients/upsmon.h @@ -96,10 +96,11 @@ typedef struct { #define NOTIFY_NOCOMM 8 /* UPS hasn't been contacted in a while */ #define NOTIFY_NOPARENT 9 /* privileged parent process died */ #define NOTIFY_CAL 10 /* UPS is performing calibration */ -#define NOTIFY_OFF 11 /* UPS is administratively OFF or asleep*/ -#define NOTIFY_NOTOFF 12 /* UPS is not anymore administratively OFF or asleep*/ -#define NOTIFY_BYPASS 13 /* UPS is administratively on bypass */ -#define NOTIFY_NOTBYPASS 14 /* UPS is not anymore administratively on bypass */ +#define NOTIFY_NOTCAL 11 /* UPS is performing calibration */ +#define NOTIFY_OFF 12 /* UPS is administratively OFF or asleep*/ +#define NOTIFY_NOTOFF 13 /* UPS is not anymore administratively OFF or asleep*/ +#define NOTIFY_BYPASS 14 /* UPS is administratively on bypass */ +#define NOTIFY_NOTBYPASS 15 /* UPS is not anymore administratively on bypass */ /* notify flag values */ @@ -140,6 +141,7 @@ static struct { { NOTIFY_NOCOMM, "NOCOMM", NULL, "UPS %s is unavailable", NOTIFY_DEFAULT }, { NOTIFY_NOPARENT, "NOPARENT", NULL, "upsmon parent process died - shutdown impossible", NOTIFY_DEFAULT }, { NOTIFY_CAL, "CAL", NULL, "UPS %s: calibration in progress", NOTIFY_DEFAULT }, + { NOTIFY_NOTCAL, "NOTCAL", NULL, "UPS %s: calibration finished", NOTIFY_DEFAULT }, { NOTIFY_OFF, "OFF", NULL, "UPS %s: administratively OFF or asleep", NOTIFY_DEFAULT }, { NOTIFY_NOTOFF, "NOTOFF", NULL, "UPS %s: no longer administratively OFF or asleep", NOTIFY_DEFAULT }, { NOTIFY_BYPASS, "BYPASS", NULL, "UPS %s: on bypass (powered, not protecting)", NOTIFY_DEFAULT }, diff --git a/clients/upssched.c b/clients/upssched.c index 029736bf07..9a8d00dd46 100644 --- a/clients/upssched.c +++ b/clients/upssched.c @@ -683,6 +683,7 @@ static int sock_read(conn_t *conn) * fit in the US_MAX_READ length limit - at worst we would * "return 0", and continue with pconf_char() next round. */ + size_t numarg; #ifndef WIN32 errno = 0; ret = read(conn->fd, &ch, 1); @@ -768,7 +769,7 @@ static int sock_read(conn_t *conn) /* 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++) + for (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); @@ -1440,6 +1441,7 @@ static void checkconf(void) { char fn[SMALLBUF]; PCONF_CTX_t ctx; + int numerrors = 0; snprintf(fn, sizeof(fn), "%s/upssched.conf", confpath()); @@ -1454,6 +1456,7 @@ static void checkconf(void) if (pconf_parse_error(&ctx)) { upslogx(LOG_ERR, "Parse error: %s:%d: %s", fn, ctx.linenum, ctx.errmsg); + numerrors++; continue; } @@ -1471,10 +1474,19 @@ static void checkconf(void) snprintfcat(errmsg, sizeof(errmsg), " %s", ctx.arglist[i]); + numerrors++; upslogx(LOG_WARNING, "%s", errmsg); } } + + /* FIXME: Per legacy behavior, we silently went on. + * Maybe should abort on unusable configs? + */ + if (numerrors) { + upslogx(LOG_ERR, "Encountered %d config errors, those entries were ignored", numerrors); + } + pconf_finish(&ctx); } diff --git a/common/Makefile.am b/common/Makefile.am index a6914d6698..569ad9c6ec 100644 --- a/common/Makefile.am +++ b/common/Makefile.am @@ -1,72 +1,99 @@ # Network UPS Tools: common -AM_CFLAGS = -I$(top_srcdir)/include +# Export certain values for ccache which NUT ci_build.sh can customize, +# to facilitate developer iteration re-runs of "make" later. +# At least GNU and BSD make implementations are okay with this syntax. +@NUT_AM_MAKE_CAN_EXPORT@export CCACHE_NAMESPACE=@CCACHE_NAMESPACE@ +@NUT_AM_MAKE_CAN_EXPORT@export CCACHE_BASEDIR=@CCACHE_BASEDIR@ +@NUT_AM_MAKE_CAN_EXPORT@export CCACHE_DIR=@CCACHE_DIR@ +@NUT_AM_MAKE_CAN_EXPORT@export CCACHE_PATH=@CCACHE_PATH@ +@NUT_AM_MAKE_CAN_EXPORT@export PATH=@PATH_DURING_CONFIGURE@ + +AM_CFLAGS = -I$(top_builddir)/include -I$(top_srcdir)/include +AM_CXXFLAGS = -I$(top_builddir)/include -I$(top_srcdir)/include AM_LDFLAGS = -no-undefined EXTRA_DIST = +CLEANFILES = noinst_LTLIBRARIES = libparseconf.la libcommon.la libcommonclient.la +if WITH_NUTCONF + # We define the recipe below in any case, but only activate it by default + # if the build configuration tells us to: + noinst_LTLIBRARIES += libnutconf.la +endif WITH_NUTCONF + libparseconf_la_SOURCES = parseconf.c +libnutconf_la_SOURCES = nutconf.cpp nutstream.cpp nutwriter.cpp nutipc.cpp + # do not hard depend on '../include/nut_version.h', since it blocks # 'dist', and is only required for actual build, in which case # BUILT_SOURCES (in ../include) will ensure nut_version.h will # be built before anything else... but do depend on its build area: if BUILDING_IN_TREE -# No need for symlink hack -common.c: $(top_builddir)/include/nut_version.h -else -# Surprisingly, for some "make" implementations this dependency means -# that the "common.c" required for builds below will be seeked in the -# current directory. So for out-of-tree builds like distcheck, we have -# to symlink the "real" source to build area: -common.c: $(top_builddir)/include/nut_version.h $(srcdir)/common.c + # No need for symlink hack + common.c: $(top_builddir)/include/nut_version.h +else !BUILDING_IN_TREE + # Surprisingly, for some "make" implementations this dependency means + # that the "common.c" required for builds below will be seeked in the + # current directory. So for out-of-tree builds like distcheck, we have + # to symlink the "real" source to build area: + common.c: $(top_builddir)/include/nut_version.h $(srcdir)/common.c test -s "$@" || ln -s -f "$(top_srcdir)/common/common.c" "$@" -endif +endif !BUILDING_IN_TREE $(top_builddir)/include/nut_version.h: - @cd $(@D) && $(MAKE) $(AM_MAKEFLAGS) $(@F) + +@cd $(@D) && $(MAKE) $(AM_MAKEFLAGS) $(@F) libcommon_la_SOURCES = state.c str.c upsconf.c libcommonclient_la_SOURCES = state.c str.c if BUILDING_IN_TREE -libcommon_la_SOURCES += common.c -libcommonclient_la_SOURCES += common.c -else -nodist_libcommon_la_SOURCES = common.c -nodist_libcommonclient_la_SOURCES = common.c -CLEANFILES = $(top_builddir)/common/common.c -BUILT_SOURCES = common.c -endif + libcommon_la_SOURCES += common.c + libcommonclient_la_SOURCES += common.c +else !BUILDING_IN_TREE + nodist_libcommon_la_SOURCES = common.c + nodist_libcommonclient_la_SOURCES = common.c + CLEANFILES += $(top_builddir)/common/common.c + BUILT_SOURCES = common.c +endif !BUILDING_IN_TREE if HAVE_STRPTIME -EXTRA_DIST += strptime.c -else -# fall back to NetBSD implem -libcommon_la_SOURCES += strptime.c -libcommonclient_la_SOURCES += strptime.c -endif + EXTRA_DIST += strptime.c +else !HAVE_STRPTIME + # fall back to NetBSD implem + libcommon_la_SOURCES += strptime.c + libcommonclient_la_SOURCES += strptime.c +endif !HAVE_STRPTIME if HAVE_STRNLEN -EXTRA_DIST += strnlen.c -else -# fall back to FreeBSD implem -libcommon_la_SOURCES += strnlen.c -libcommonclient_la_SOURCES += strnlen.c -endif + EXTRA_DIST += strnlen.c +else !HAVE_STRNLEN + # fall back to FreeBSD implem + libcommon_la_SOURCES += strnlen.c + libcommonclient_la_SOURCES += strnlen.c +endif !HAVE_STRNLEN if HAVE_STRSEP -EXTRA_DIST += strsep.c -else -# fall back to simple implem -libcommon_la_SOURCES += strsep.c -libcommonclient_la_SOURCES += strsep.c -endif - -# TODO: libnutwincompat.la? + EXTRA_DIST += strsep.c +else !HAVE_STRSEP + # fall back to simple implem + libcommon_la_SOURCES += strsep.c + libcommonclient_la_SOURCES += strsep.c +endif !HAVE_STRSEP + if HAVE_WINDOWS -libcommon_la_SOURCES += wincompat.c $(top_srcdir)/include/wincompat.h -libcommonclient_la_SOURCES += wincompat.c $(top_srcdir)/include/wincompat.h -endif + libnutwincompat_la_SOURCES = wincompat.c $(top_srcdir)/include/wincompat.h + libnutwincompat_la_LDFLAGS = + libnutwincompat_la_LIBADD = + # Assume setenv() provided by OS or nut_setenv() provided by + # another NUT library and linked to the final NUT program/lib + # (anyhow, avoid a link-time conflict with two definitions): + libnutwincompat_la_CFLAGS = $(AM_CFLAGS) -DHAVE_SETENV=1 + noinst_LTLIBRARIES += libnutwincompat.la + + libcommon_la_SOURCES += wincompat.c $(top_srcdir)/include/wincompat.h + libcommonclient_la_SOURCES += wincompat.c $(top_srcdir)/include/wincompat.h +endif HAVE_WINDOWS # ensure inclusion of local implementation of missing systems functions # using LTLIBOBJS. Refer to configure.in/.ac -> AC_REPLACE_FUNCS @@ -76,13 +103,18 @@ libcommonclient_la_LIBADD = libparseconf.la @LTLIBOBJS@ @NETLIBS@ libcommon_la_CFLAGS = $(AM_CFLAGS) libcommonclient_la_CFLAGS = $(AM_CFLAGS) +if WITH_NUTCONF + libnutconf_la_CXXFLAGS = $(AM_CXXFLAGS) + libnutconf_la_LIBADD = @LTLIBOBJS@ @NETLIBS@ libcommonclient.la +endif WITH_NUTCONF + if HAVE_LIBREGEX libcommon_la_CFLAGS += $(LIBREGEX_CFLAGS) libcommon_la_LIBADD += $(LIBREGEX_LIBS) libcommonclient_la_CFLAGS += $(LIBREGEX_CFLAGS) libcommonclient_la_LIBADD += $(LIBREGEX_LIBS) -endif +endif HAVE_LIBREGEX # Did the user request, and build env support, tighter integration with # libsystemd methods such as sd_notify()? @@ -95,7 +127,7 @@ if WITH_LIBSYSTEMD # libcommonclient_la_CFLAGS += $(LIBSYSTEMD_CFLAGS) # libcommonclient_la_LIBADD += $(LIBSYSTEMD_LIBS) libcommonclient_la_CFLAGS += -DWITHOUT_LIBSYSTEMD=1 -endif +endif WITH_LIBSYSTEMD MAINTAINERCLEANFILES = Makefile.in .dirstamp diff --git a/common/common.c b/common/common.c index 7633a3defa..8e20c9607c 100644 --- a/common/common.c +++ b/common/common.c @@ -52,6 +52,7 @@ static int upsnotify_reported_disabled_systemd = 0; #endif /* Similarly for only reporting once if the notification subsystem is not built-in */ static int upsnotify_reported_disabled_notech = 0; +static int upsnotify_report_verbosity = -1; /* the reason we define UPS_VERSION as a static string, rather than a macro, is to make dependency tracking easier (only common.o depends @@ -796,6 +797,34 @@ int upsnotify(upsnotify_state_t state, const char *fmt, ...) # endif /* HAVE_SD_NOTIFY */ #endif /* WITH_LIBSYSTEMD */ + /* Were we asked to be quiet on the console? */ + if (upsnotify_report_verbosity < 0) { + char *quiet_init = getenv("NUT_QUIET_INIT_UPSNOTIFY"); + if (quiet_init == NULL) { + /* No envvar, default is to inform once on the console */ + upsnotify_report_verbosity = 0; + } else { + /* Envvar is set, does it tell us to be quiet? + * NOTE: Empty also means "yes" */ + if (*quiet_init == '\0' + || (strcasecmp(quiet_init, "true") + && strcasecmp(quiet_init, "yes") + && strcasecmp(quiet_init, "on") + && strcasecmp(quiet_init, "1") ) + ) { + upsdebugx(1, + "NUT_QUIET_INIT_UPSNOTIFY='%s' value " + "was not recognized, ignored", + quiet_init); + upsnotify_report_verbosity = 0; + } else { + /* Avoid the verbose message below + * (only seen with non-zero debug) */ + upsnotify_report_verbosity = 1; + } + } + } + /* Prepare the message (if any) as a string */ msgbuf[0] = '\0'; if (fmt) { @@ -832,14 +861,16 @@ int upsnotify(upsnotify_state_t state, const char *fmt, ...) NUT_UNUSED_VARIABLE(buf); NUT_UNUSED_VARIABLE(msglen); if (!upsnotify_reported_disabled_systemd) - upsdebugx(0, "%s: notify about state %i with libsystemd: " - "skipped for libcommonclient build, " - "will not spam more about it", __func__, state); + upsdebugx(upsnotify_report_verbosity, + "%s: notify about state %i with libsystemd: " + "skipped for libcommonclient build, " + "will not spam more about it", __func__, state); upsnotify_reported_disabled_systemd = 1; # else if (!getenv("NOTIFY_SOCKET")) { if (!upsnotify_reported_disabled_systemd) - upsdebugx(0, "%s: notify about state %i with libsystemd: " + upsdebugx(upsnotify_report_verbosity, + "%s: notify about state %i with libsystemd: " "was requested, but not running as a service unit now, " "will not spam more about it", __func__, state); @@ -1110,17 +1141,25 @@ int upsnotify(upsnotify_state_t state, const char *fmt, ...) ) { if (ret == -127) { if (!upsnotify_reported_disabled_notech) - upsdebugx(0, "%s: failed to notify about state %i: no notification tech defined, will not spam more about it", __func__, state); + upsdebugx(upsnotify_report_verbosity, + "%s: failed to notify about state %i: " + "no notification tech defined, " + "will not spam more about it", + __func__, state); upsnotify_reported_disabled_notech = 1; } else { - upsdebugx(6, "%s: failed to notify about state %i", __func__, state); + upsdebugx(6, + "%s: failed to notify about state %i", + __func__, state); } } #if defined(WITH_LIBSYSTEMD) && (WITH_LIBSYSTEMD) # if ! DEBUG_SYSTEMD_WATCHDOG if (state == NOTIFY_STATE_WATCHDOG && !upsnotify_reported_watchdog_systemd) { - upsdebugx(0, "%s: logged the systemd watchdog situation once, will not spam more about it", __func__); + upsdebugx(upsnotify_report_verbosity, + "%s: logged the systemd watchdog situation once, " + "will not spam more about it", __func__); upsnotify_reported_watchdog_systemd = 1; } # endif @@ -2256,7 +2295,8 @@ static char * get_libname_in_dir(const char* base_libname, size_t base_libname_l # ifdef WIN32 if (!libname_path) { - for (char *p = current_test_path; *p != '\0' && (p - current_test_path) < LARGEBUF; p++) { + char *p; + for (p = current_test_path; *p != '\0' && (p - current_test_path) < LARGEBUF; p++) { if (*p == '/') *p = '\\'; } upsdebugx(3, "%s: WIN32: re-checking with %s", __func__, current_test_path); diff --git a/common/nutconf.cpp b/common/nutconf.cpp new file mode 100644 index 0000000000..33adb3c47c --- /dev/null +++ b/common/nutconf.cpp @@ -0,0 +1,1612 @@ +/* + nutconf.cpp - configuration API + + Copyright (C) + 2012 Emilien Kia + + 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 "nutconf.hpp" +#include "nutwriter.hpp" + +#include +#include +#include + +#include +#include +#include + + +namespace nut { + +/* Trivial implementations out of class declaration to avoid + * error: 'ClassName' has no out-of-line virtual method definitions; its vtable + * will be emitted in every translation unit [-Werror,-Wweak-vtables] + */ +Serialisable::~Serialisable() {} +BaseConfiguration::~BaseConfiguration() {} +GenericConfiguration::~GenericConfiguration() {} +UpsConfiguration::~UpsConfiguration() {} +NutParser::~NutParser() {} + +// +// Tool functions +// + +/** + * Parse a specified type from a string and set it as Settable if success. + */ +template +Settable StringToSettableNumber(const std::string & src) +{ + std::stringstream ss(src); + T result; + if(ss >> result) + { + return Settable(result); + } + else + { + return Settable(); + } +} + + +// +// NutParser +// + +NutParser::NutParser(const char* buffer, unsigned int options) : +_options(options), +_buffer(buffer), +_pos(0) { +} + +NutParser::NutParser(const std::string& buffer, unsigned int options) : +_options(options), +_buffer(buffer), +_pos(0) { +} + +void NutParser::setOptions(unsigned int options, bool set) +{ + if(set) + { + _options |= options; + } + else + { + _options &= ~options; + } +} + +char NutParser::get() { + if (_pos >= _buffer.size()) + return 0; + else + return _buffer[_pos++]; +} + +char NutParser::peek() { + return _buffer[_pos]; +} + +size_t NutParser::getPos()const { + return _pos; +} + +void NutParser::setPos(size_t pos) { + _pos = pos; +} + +char NutParser::charAt(size_t pos)const { + return _buffer[pos]; +} + +void NutParser::pushPos() { + _stack.push_back(_pos); +} + +size_t NutParser::popPos() { + size_t pos = _stack.back(); + _stack.pop_back(); + return pos; +} + +void NutParser::rewind() { + _pos = popPos(); +} + +void NutParser::back() { + if (_pos > 0) + --_pos; +} + +/* Parse a string source for a CHARS and return its size if found or 0, if not. + * CHARS ::= CHAR+ + * CHAR ::= __ASCIICHAR__ - ( __SPACES__ | '\\' | '\"' | '#' ) + * | '\\' ( __SPACES__ | '\\' | '\"' | '#' ) + * TODO: accept "\t", "\s", "\r", "\n" ?? + */ +std::string NutParser::parseCHARS() { + bool escaped = false; // Is char escaped ? + std::string res; // Stored string + + pushPos(); + + for (char c = get(); c != 0 /*EOF*/; c = get()) { + if (escaped) { + if (isspace(c) || c == '\\' || c == '"' || c == '#') { + res += c; + } else { + /* WTF ??? */ + } + escaped = false; + } else { + if (c == '\\') { + escaped = true; + } else if (isgraph(c) /*&& c != '\\'*/ && c != '"' && c != '#') { + res += c; + } else { + back(); + break; + } + } + } + + popPos(); + return res; +} + +/* Parse a string source for a STRCHARS and return its size if found or 0, if not. + * STRCHARS ::= STRCHAR+ + * STRCHAR ::= __ASCIICHAR__ - ( '\\' | '\"') + * | '\\' ( '\\' | '\"' ) + * TODO: accept "\t", "\s", "\r", "\n" ?? + */ +std::string NutParser::parseSTRCHARS() { + bool escaped = false; // Is char escaped ? + std::string str; // Stored string + + pushPos(); + + for (char c = get(); c != 0 /*EOF*/; c = get()) { + if (escaped) { + if (isspace(c) || c == '\\' || c == '"') { + str += c; + } else { + /* WTF ??? */ + } + escaped = false; + } else { + if (c == '\\') { + escaped = true; + } else if (isprint(c) && c != '\\' && c != '"') { + str += c; + } else { + back(); + break; + } + } + } + + popPos(); + return str; +} + +/** Parse a string source for getting the next token, ignoring spaces. + * \return Token type. + */ +NutParser::Token NutParser::parseToken() { + + /** Lexical parsing machine state enumeration.*/ + typedef enum { + LEXPARSING_STATE_DEFAULT, + LEXPARSING_STATE_QUOTED_STRING, + LEXPARSING_STATE_STRING, + LEXPARSING_STATE_COMMENT + } LEXPARSING_STATE_e; + LEXPARSING_STATE_e state = LEXPARSING_STATE_DEFAULT; + + Token token; + bool escaped = false; + + pushPos(); + + for (char c = get(); c != 0 /*EOF*/; c = get()) { + switch (state) { + case LEXPARSING_STATE_DEFAULT: /* Wait for a non-space char */ + { + if (c == ' ' || c == '\t') { + /* Space : do nothing */ + } else if (c == '[') { + token = Token(Token::TOKEN_BRACKET_OPEN, c); + popPos(); + return token; + } else if (c == ']') { + token = Token(Token::TOKEN_BRACKET_CLOSE, c); + popPos(); + return token; + } else if (c == ':' && !hasOptions(OPTION_IGNORE_COLON)) { + token = Token(Token::TOKEN_COLON, c); + popPos(); + return token; + } else if (c == '=') { + token = Token(Token::TOKEN_EQUAL, c); + popPos(); + return token; + } else if (c == '\r' || c == '\n') { + token = Token(Token::TOKEN_EOL, c); + popPos(); + return token; + } else if (c == '#') { + token.type = Token::TOKEN_COMMENT; + state = LEXPARSING_STATE_COMMENT; + } else if (c == '"') { + /* Begin of QUOTED STRING */ + token.type = Token::TOKEN_QUOTED_STRING; + state = LEXPARSING_STATE_QUOTED_STRING; + } else if (c == '\\') { + /* Begin of STRING with escape */ + token.type = Token::TOKEN_STRING; + state = LEXPARSING_STATE_STRING; + escaped = true; + } else if (isgraph(c)) { + /* Begin of STRING */ + token.type = Token::TOKEN_STRING; + state = LEXPARSING_STATE_STRING; + token.str += c; + } else { + rewind(); + return Token(Token::TOKEN_UNKNOWN); + } + break; + } + case LEXPARSING_STATE_QUOTED_STRING: + { + if (c == '"') { + if (escaped) { + escaped = false; + token.str += '"'; + } else { + popPos(); + return token; + } + } else if (c == '\\') { + if (escaped) { + escaped = false; + token.str += '\\'; + } else { + escaped = true; + } + } else if (c == ' ' || c == '\t' || isgraph(c)) { + token.str += c; + } else if (c == '\r' || c == '\n') /* EOL */{ + /* WTF ? consider it as correct ? */ + back(); + popPos(); + return token; + } else if (c == 0) /* EOF */ { + popPos(); + return token; + } else /* Bad character ?? */ { + /* WTF ? Keep, Ignore ? */ + } + /* TODO What about other escaped character ? */ + break; + } + case LEXPARSING_STATE_STRING: + { + if (c == ' ' || c == '\t' || c == '"' || c == '#' || c == '[' || c == ']' + || (c == ':' && !hasOptions(OPTION_IGNORE_COLON)) + || c == '=' + ) { + if (escaped) { + escaped = false; + token.str += c; + } else { + back(); + popPos(); + return token; + } + } else if (c == '\\') { + if (escaped) { + escaped = false; + token.str += c; + } else { + escaped = true; + } + } else if (c == '\r' || c == '\n') /* EOL */{ + back(); + popPos(); + return token; + } else if (c == 0) /* EOF */ { + popPos(); + return token; + }else if (isgraph(c)) { + token.str += c; + } else /* Bad character ?? */ { + /* WTF ? Keep, Ignore ? */ + } + /* TODO What about escaped character ? */ + break; + } + case LEXPARSING_STATE_COMMENT: + { + if (c == '\r' || c == '\n') { + return token; + } else { + token.str += c; + } + break; + } + +#if (defined HAVE_PRAGMA_GCC_DIAGNOSTIC_PUSH_POP) && ( (defined HAVE_PRAGMA_GCC_DIAGNOSTIC_IGNORED_COVERED_SWITCH_DEFAULT) || (defined HAVE_PRAGMA_GCC_DIAGNOSTIC_IGNORED_UNREACHABLE_CODE) ) +# pragma GCC diagnostic push +#endif +#ifdef HAVE_PRAGMA_GCC_DIAGNOSTIC_IGNORED_COVERED_SWITCH_DEFAULT +# pragma GCC diagnostic ignored "-Wcovered-switch-default" +#endif +#ifdef HAVE_PRAGMA_GCC_DIAGNOSTIC_IGNORED_UNREACHABLE_CODE +# pragma GCC diagnostic ignored "-Wunreachable-code" +#endif +/* Older CLANG (e.g. clang-3.4) seems to not support the GCC pragmas above */ +#ifdef __clang__ +# pragma clang diagnostic push +# pragma clang diagnostic ignored "-Wunreachable-code" +# pragma clang diagnostic ignored "-Wcovered-switch-default" +#endif + default: + /* Must not occur. */ + break; +#ifdef __clang__ +# pragma clang diagnostic pop +#endif +#if (defined HAVE_PRAGMA_GCC_DIAGNOSTIC_PUSH_POP) && ( (defined HAVE_PRAGMA_GCC_DIAGNOSTIC_IGNORED_COVERED_SWITCH_DEFAULT) || (defined HAVE_PRAGMA_GCC_DIAGNOSTIC_IGNORED_UNREACHABLE_CODE) ) +# pragma GCC diagnostic pop +#endif + } + } + popPos(); + return token; +} + +std::list NutParser::parseLine() { + std::list res; + + while (true) { + NutParser::Token token = parseToken(); + + switch (token.type) { + case Token::TOKEN_STRING: + case Token::TOKEN_QUOTED_STRING: + case Token::TOKEN_BRACKET_OPEN: + case Token::TOKEN_BRACKET_CLOSE: + case Token::TOKEN_EQUAL: + case Token::TOKEN_COLON: + res.push_back(token); + break; + case Token::TOKEN_COMMENT: + res.push_back(token); + // Should return (EOL)Token::TOKEN_COMMENT: + return res; + case Token::TOKEN_UNKNOWN: + case Token::TOKEN_NONE: + case Token::TOKEN_EOL: + return res; + } + } +} + +// +// NutConfigParser +// + +NutConfigParser::NutConfigParser(const char* buffer, unsigned int options) : +NutParser(buffer, options) { +} + +NutConfigParser::NutConfigParser(const std::string& buffer, unsigned int options) : +NutParser(buffer, options) { +} + +void NutConfigParser::parseConfig(BaseConfiguration* config) { + NUT_UNUSED_VARIABLE(config); + parseConfig(); +} + +void NutConfigParser::parseConfig() { + onParseBegin(); + + enum ConfigParserState { + CPS_DEFAULT, + CPS_SECTION_OPENED, + CPS_SECTION_HAVE_NAME, + CPS_SECTION_CLOSED, + CPS_DIRECTIVE_HAVE_NAME, + CPS_DIRECTIVE_VALUES + } state = CPS_DEFAULT; + + Token tok; + std::string name; + std::list values; + char sep = 0; + +#if (defined HAVE_PRAGMA_GCC_DIAGNOSTIC_PUSH_POP) && ( (defined HAVE_PRAGMA_GCC_DIAGNOSTIC_IGNORED_COVERED_SWITCH_DEFAULT) || (defined HAVE_PRAGMA_GCC_DIAGNOSTIC_IGNORED_UNREACHABLE_CODE) ) +# pragma GCC diagnostic push +#endif +#ifdef HAVE_PRAGMA_GCC_DIAGNOSTIC_IGNORED_COVERED_SWITCH_DEFAULT +# pragma GCC diagnostic ignored "-Wcovered-switch-default" +#endif +#ifdef HAVE_PRAGMA_GCC_DIAGNOSTIC_IGNORED_UNREACHABLE_CODE +# pragma GCC diagnostic ignored "-Wunreachable-code" +#endif +/* Older CLANG (e.g. clang-3.4) seems to not support the GCC pragmas above */ +#ifdef __clang__ +# pragma clang diagnostic push +# pragma clang diagnostic ignored "-Wunreachable-code" +# pragma clang diagnostic ignored "-Wcovered-switch-default" +#endif + while (1) { + tok = parseToken(); + if (!tok) + break; + switch (state) { + case CPS_DEFAULT: + switch (tok.type) { + case Token::TOKEN_COMMENT: + onParseComment(tok.str); + /* Clean and return to default */ + break; + case Token::TOKEN_BRACKET_OPEN: + state = CPS_SECTION_OPENED; + break; + case Token::TOKEN_STRING: + case Token::TOKEN_QUOTED_STRING: + name = tok.str; + state = CPS_DIRECTIVE_HAVE_NAME; + break; + + case Token::TOKEN_UNKNOWN: + case Token::TOKEN_NONE: + case Token::TOKEN_BRACKET_CLOSE: + case Token::TOKEN_EQUAL: + case Token::TOKEN_COLON: + case Token::TOKEN_EOL: + default: + /* WTF ? */ + break; + } + break; + case CPS_SECTION_OPENED: + switch (tok.type) { + case Token::TOKEN_STRING: + case Token::TOKEN_QUOTED_STRING: + /* Should occur ! */ + name = tok.str; + state = CPS_SECTION_HAVE_NAME; + break; + case Token::TOKEN_BRACKET_CLOSE: + /* Empty section name */ + state = CPS_SECTION_CLOSED; + break; + case Token::TOKEN_COMMENT: + /* Lack of closing bracket !!! */ + onParseSectionName(name, tok.str); + /* Clean and return to default */ + name.clear(); + state = CPS_DEFAULT; + break; + case Token::TOKEN_EOL: + /* Lack of closing bracket !!! */ + onParseSectionName(name); + /* Clean and return to default */ + name.clear(); + state = CPS_DEFAULT; + break; + + case Token::TOKEN_UNKNOWN: + case Token::TOKEN_NONE: + case Token::TOKEN_BRACKET_OPEN: + case Token::TOKEN_EQUAL: + case Token::TOKEN_COLON: + default: + /* WTF ? */ + break; + } + break; + case CPS_SECTION_HAVE_NAME: + switch (tok.type) { + case Token::TOKEN_BRACKET_CLOSE: + /* Must occur ! */ + state = CPS_SECTION_CLOSED; + break; + case Token::TOKEN_COMMENT: + /* Lack of closing bracket !!! */ + onParseSectionName(name, tok.str); + /* Clean and return to default */ + name.clear(); + state = CPS_DEFAULT; + break; + case Token::TOKEN_EOL: + /* Lack of closing bracket !!! */ + onParseSectionName(name); + /* Clean and return to default */ + name.clear(); + state = CPS_DEFAULT; + break; + + case Token::TOKEN_QUOTED_STRING: + case Token::TOKEN_BRACKET_OPEN: + case Token::TOKEN_COLON: + case Token::TOKEN_EQUAL: + case Token::TOKEN_UNKNOWN: + case Token::TOKEN_NONE: + case Token::TOKEN_STRING: + default: + /* WTF ? */ + break; + } + break; + case CPS_SECTION_CLOSED: + switch (tok.type) { + case Token::TOKEN_COMMENT: + /* Could occur ! */ + onParseSectionName(name, tok.str); + /* Clean and return to default */ + name.clear(); + state = CPS_DEFAULT; + break; + case Token::TOKEN_EOL: + /* Could occur ! */ + onParseSectionName(name); + /* Clean and return to default */ + name.clear(); + state = CPS_DEFAULT; + break; + + case Token::TOKEN_QUOTED_STRING: + case Token::TOKEN_BRACKET_OPEN: + case Token::TOKEN_BRACKET_CLOSE: + case Token::TOKEN_UNKNOWN: + case Token::TOKEN_NONE: + case Token::TOKEN_STRING: + case Token::TOKEN_COLON: + case Token::TOKEN_EQUAL: + default: + /* WTF ? */ + break; + } + break; + case CPS_DIRECTIVE_HAVE_NAME: + switch (tok.type) { + case Token::TOKEN_COMMENT: + /* Could occur ! */ + onParseDirective(name, 0, std::list (), tok.str); + /* Clean and return to default */ + name.clear(); + state = CPS_DEFAULT; + break; + case Token::TOKEN_EOL: + /* Could occur ! */ + onParseDirective(name); + /* Clean and return to default */ + name.clear(); + state = CPS_DEFAULT; + break; + case Token::TOKEN_COLON: + case Token::TOKEN_EQUAL: + /* Could occur ! */ + sep = tok.str[0]; + state = CPS_DIRECTIVE_VALUES; + break; + case Token::TOKEN_STRING: + case Token::TOKEN_QUOTED_STRING: + /* Could occur ! */ + values.push_back(tok.str); + state = CPS_DIRECTIVE_VALUES; + break; + + case Token::TOKEN_UNKNOWN: + case Token::TOKEN_NONE: + case Token::TOKEN_BRACKET_OPEN: + case Token::TOKEN_BRACKET_CLOSE: + default: + /* WTF ? */ + break; + } + break; + case CPS_DIRECTIVE_VALUES: + switch (tok.type) { + case Token::TOKEN_COMMENT: + /* Could occur ! */ + onParseDirective(name, sep, values, tok.str); + /* Clean and return to default */ + name.clear(); + values.clear(); + sep = 0; + state = CPS_DEFAULT; + break; + case Token::TOKEN_EOL: + /* Could occur ! */ + onParseDirective(name, sep, values); + /* Clean and return to default */ + name.clear(); + values.clear(); + sep = 0; + state = CPS_DEFAULT; + break; + case Token::TOKEN_STRING: + case Token::TOKEN_QUOTED_STRING: + /* Could occur ! */ + values.push_back(tok.str); + state = CPS_DIRECTIVE_VALUES; + break; + + case Token::TOKEN_UNKNOWN: + case Token::TOKEN_NONE: + case Token::TOKEN_BRACKET_OPEN: + case Token::TOKEN_BRACKET_CLOSE: + case Token::TOKEN_EQUAL: + case Token::TOKEN_COLON: + default: + /* WTF ? */ + break; + } + break; + } + } + + switch(state) + { + case CPS_SECTION_OPENED: + case CPS_SECTION_HAVE_NAME: + /* Lack of closing bracket !!! */ + onParseSectionName(name); + break; + case CPS_SECTION_CLOSED: + /* Could occur ! */ + onParseSectionName(name); + break; + case CPS_DIRECTIVE_HAVE_NAME: + /* Could occur ! */ + onParseDirective(name); + break; + case CPS_DIRECTIVE_VALUES: + /* Could occur ! */ + onParseDirective(name, sep, values); + break; + case CPS_DEFAULT: + /* TOTHINK: no-op? */ + break; + } +#ifdef __clang__ +#pragma clang diagnostic pop +#endif +#if (defined HAVE_PRAGMA_GCC_DIAGNOSTIC_PUSH_POP) && ( (defined HAVE_PRAGMA_GCC_DIAGNOSTIC_IGNORED_COVERED_SWITCH_DEFAULT) || (defined HAVE_PRAGMA_GCC_DIAGNOSTIC_IGNORED_UNREACHABLE_CODE) ) +# pragma GCC diagnostic pop +#endif + + onParseEnd(); +} + + + +// +// DefaultConfigParser +// + +DefaultConfigParser::DefaultConfigParser(const char* buffer) : +NutConfigParser(buffer) { +} + +DefaultConfigParser::DefaultConfigParser(const std::string& buffer) : +NutConfigParser(buffer) { +} + +void DefaultConfigParser::onParseBegin() { + // Start with empty section (i.e. global one) + _section.clear(); +} + +void DefaultConfigParser::onParseComment(const std::string& /*comment*/) { + // Comments are ignored for now +} + +void DefaultConfigParser::onParseSectionName(const std::string& sectionName, const std::string& /*comment*/) { + // Comments are ignored for now + + // Process current section. + if (!_section.empty()) { + onParseSection(_section); + _section.clear(); + } + + // Start a new section + _section.name = sectionName; +} + +void DefaultConfigParser::onParseDirective(const std::string& directiveName, char /*sep*/, const ConfigParamList& values, const std::string& /*comment*/) { + // Comments are ignored for now + // Separator has no specific semantic in this context + + // Save values + _section.entries[directiveName].name = directiveName; + _section.entries[directiveName].values = values; + + // TODO Can probably be optimized. +} + +void DefaultConfigParser::onParseEnd() { + // Process current (last) section + if (!_section.empty()) { + onParseSection(_section); + _section.clear(); + } +} + + +// +// GenericConfigSection +// + +bool GenericConfigSection::empty()const { + return name.empty() && entries.empty(); +} + +void GenericConfigSection::clear() { + name.clear(); + entries.clear(); +} + +// +// GenericConfigParser +// + +GenericConfigParser::GenericConfigParser(const char* buffer): +DefaultConfigParser(buffer), +_config(nullptr) +{ +} + +GenericConfigParser::GenericConfigParser(const std::string& buffer): +DefaultConfigParser(buffer), +_config(nullptr) +{ +} + +void GenericConfigParser::parseConfig(BaseConfiguration* config) +{ + if(config!=nullptr) + { + _config = config; + NutConfigParser::parseConfig(); + _config = nullptr; + } +} + + +void GenericConfigParser::onParseSection(const GenericConfigSection& section) +{ + if(_config!=nullptr) + { + _config->setGenericConfigSection(section); + } +} + +// +// GenericConfiguration +// + +void GenericConfiguration::setGenericConfigSection(const GenericConfigSection& section) +{ + sections[section.name] = section; +} + + +void GenericConfiguration::parseFromString(const std::string& str) +{ + GenericConfigParser parser(str); + parser.parseConfig(this); +} + + +bool GenericConfiguration::parseFrom(NutStream & istream) +{ + // TODO: The parser is highly inefficient, it should use NutStream, directly + std::string str; + + if (NutStream::NUTS_OK != istream.getString(str)) + return false; + + parseFromString(str); + + return true; +} + + +bool GenericConfiguration::writeTo(NutStream & ostream) const +{ + GenericConfigWriter writer(ostream); + + return NutWriter::NUTW_OK == writer.writeConfig(*this); +} + + +bool GenericConfiguration::get(const std::string & section, const std::string & entry, ConfigParamList & params) const +{ + // Get section + SectionMap::const_iterator section_iter = sections.find(section); + if (section_iter == sections.end()) + return false; + + // Get entry + const GenericConfigSection::EntryMap & entries = section_iter->second.entries; + + GenericConfigSection::EntryMap::const_iterator entry_iter = entries.find(entry); + if (entry_iter == entries.end()) + return false; + + // Provide parameters values + params = entry_iter->second.values; + + return true; +} + + +void GenericConfiguration::set(const std::string & section, const std::string & entry, const ConfigParamList & params) +{ + // Get section + SectionMap::iterator section_iter = sections.lower_bound(section); + if (sections.end() == section_iter || section_iter->first != section) { + section_iter = sections.insert(section_iter, + std::pair(section, GenericConfigSection())); + + section_iter->second.name = section; + } + + // Get entry + GenericConfigSection::EntryMap & entries = section_iter->second.entries; + + GenericConfigSection::EntryMap::iterator entry_iter = entries.lower_bound(entry); + if (entries.end() == entry_iter || entry_iter->first != entry) { + entry_iter = entries.insert(entry_iter, + std::pair(entry, GenericConfigSectionEntry())); + + entry_iter->second.name = entry; + } + + // Set parameters values + entry_iter->second.values = params; +} + + +void GenericConfiguration::add(const std::string & section, const std::string & entry, const ConfigParamList & params) +{ + // No job is another job well done + if (params.empty()) + return; + + // Note that the implementation is quite naive and inefficient. + // However, efficiency isn't our aim at the moment. + + // Get current parameters + ConfigParamList current_params; + + get(section, entry, current_params); + + // Add the provided parameters + current_params.insert(current_params.end(), params.begin(), params.end()); + + set(section, entry, current_params); +} + + +void GenericConfiguration::remove(const std::string & section, const std::string & entry) +{ + // Get section + SectionMap::iterator section_iter = sections.find(section); + if (sections.end() == section_iter) + return; + + // Get entry + GenericConfigSection::EntryMap & entries = section_iter->second.entries; + + GenericConfigSection::EntryMap::iterator entry_iter = entries.find(entry); + if (entries.end() == entry_iter) + return; + + entries.erase(entry_iter); +} + + +void GenericConfiguration::removeSection(const std::string & section) +{ + // Get section + SectionMap::iterator section_iter = sections.find(section); + if (sections.end() == section_iter) + return; + + sections.erase(section_iter); +} + + +std::string GenericConfiguration::getStr(const std::string & section, const std::string & entry) const +{ + std::string str; + + ConfigParamList params; + + if (!get(section, entry, params)) + return str; + + if (params.empty()) + return str; + + return params.front(); +} + + +void GenericConfiguration::setStr( + const std::string & section, + const std::string & entry, + const std::string & value) +{ + ConfigParamList param; + + param.push_back(value); + + set(section, entry, param); +} + + +long long int GenericConfiguration::getInt(const std::string & section, const std::string & entry, long long int val) const +{ + ConfigParamList params; + + if (!get(section, entry, params)) + return val; + + if (params.empty()) + return val; + + // TBD: What if there are multiple values? + std::stringstream val_str(params.front()); + + val_str >> val; + + return val; +} + + +void GenericConfiguration::setInt(const std::string & section, const std::string & entry, long long int val) +{ + std::stringstream val_str; + val_str << val; + + set(section, entry, ConfigParamList(1, val_str.str())); +} + + +bool GenericConfiguration::str2bool(const std::string & str) +{ + if ("true" == str) return true; + if ("on" == str) return true; + if ("1" == str) return true; + if ("yes" == str) return true; + if ("ok" == str) return true; + + return false; +} + + +const std::string & GenericConfiguration::bool2str(bool val) +{ + static const std::string b0("off"); + static const std::string b1("on"); + + return val ? b1 : b0; +} + + +// +// UpsmonConfiguration +// + +UpsmonConfiguration::UpsmonConfiguration() +{ +} + +void UpsmonConfiguration::parseFromString(const std::string& str) +{ + UpsmonConfigParser parser(str); + parser.parseUpsmonConfig(this); +} + +UpsmonConfiguration::NotifyFlag UpsmonConfiguration::NotifyFlagFromString(const std::string& str) +{ + if(str=="SYSLOG") + return NOTIFY_SYSLOG; + else if(str=="WALL") + return NOTIFY_WALL; + else if(str=="EXEC") + return NOTIFY_EXEC; + else if(str=="IGNORE") + return NOTIFY_IGNORE; + else + return NOTIFY_IGNORE; +} + +UpsmonConfiguration::NotifyType UpsmonConfiguration::NotifyTypeFromString(const std::string& str) +{ + if(str=="ONLINE") + return NOTIFY_ONLINE; + else if(str=="ONBATT") + return NOTIFY_ONBATT; + else if(str=="LOWBATT") + return NOTIFY_LOWBATT; + else if(str=="FSD") + return NOTIFY_FSD; + else if(str=="COMMOK") + return NOTIFY_COMMOK; + else if(str=="COMMBAD") + return NOTIFY_COMMBAD; + else if(str=="SHUTDOWN") + return NOTIFY_SHUTDOWN; + else if(str=="REPLBATT") + return NOTIFY_REPLBATT; + else if(str=="NOCOMM") + return NOTIFY_NOCOMM; + else if(str=="NOPARENT") + return NOTIFY_NOPARENT; + else + return NOTIFY_TYPE_MAX; +} + + +bool UpsmonConfiguration::parseFrom(NutStream & istream) +{ + // TODO: The parser is highly inefficient, it should use NutStream, directly + std::string str; + + if (NutStream::NUTS_OK != istream.getString(str)) + return false; + + parseFromString(str); + + return true; +} + + +bool UpsmonConfiguration::writeTo(NutStream & ostream) const +{ + UpsmonConfigWriter writer(ostream); + + return NutWriter::NUTW_OK == writer.writeConfig(*this); +} + + +// +// UpsmonConfigParser +// + +UpsmonConfigParser::UpsmonConfigParser(const char* buffer): +NutConfigParser(buffer) +{ +} + +UpsmonConfigParser::UpsmonConfigParser(const std::string& buffer): +NutConfigParser(buffer) +{ +} + +void UpsmonConfigParser::parseUpsmonConfig(UpsmonConfiguration* config) +{ + if(config!=nullptr) + { + _config = config; + NutConfigParser::parseConfig(); + _config = nullptr; + } +} + +void UpsmonConfigParser::onParseBegin() +{ + // Do nothing +} + +void UpsmonConfigParser::onParseComment(const std::string& /*comment*/) +{ + // Comments are ignored for now +} + +void UpsmonConfigParser::onParseSectionName(const std::string& /*sectionName*/, const std::string& /*comment*/) +{ + // There must not be sections in upsmon.conf. + // Ignore it + // TODO Add error reporting ? +} + + +void UpsmonConfigParser::onParseDirective(const std::string& directiveName, char /*sep*/, const ConfigParamList& values, const std::string& /*comment*/) +{ + // NOTE: separators are always ignored + + if(_config) + { + if(directiveName == "RUN_AS_USER") + { + if(values.size()>0) + { + _config->runAsUser = values.front(); + } + } + else if(directiveName == "MONITOR") + { + if (values.size() == 5 || values.size() == 6) + { + UpsmonConfiguration::Monitor monitor; + ConfigParamList::const_iterator it = values.begin(); + std::stringstream upsAtHost(*it++); + std::string wordToken; + /* + * Why didn't the original author just receive the words + * into their target strings?.. e.g.: + * std::getline(upsAtHost, monitor.upsname, '@'); + * std::getline(upsAtHost, monitor.hostname); + */ + monitor.upsname = (static_cast(std::getline(upsAtHost, wordToken, '@')), wordToken); + monitor.hostname = (static_cast(std::getline(upsAtHost, wordToken)), wordToken); + monitor.port = (values.size() == 6 ? *StringToSettableNumber(*it++) : 0u); + monitor.powerValue = StringToSettableNumber(*it++); + monitor.username = *it++; + monitor.password = *it++; + monitor.isMaster = (*it) == "master"; + _config->monitors.push_back(monitor); + } + } + else if(directiveName == "MINSUPPLIES") + { + if(values.size()>0) + { + _config->minSupplies = StringToSettableNumber(values.front()); + } + } + else if(directiveName == "SHUTDOWNCMD") + { + if(values.size()>0) + { + _config->shutdownCmd = values.front(); + } + } + else if(directiveName == "NOTIFYCMD") + { + if(values.size()>0) + { + _config->notifyCmd = values.front(); + } + } + else if(directiveName == "POLLFREQ") + { + if(values.size()>0) + { + _config->poolFreq = StringToSettableNumber(values.front()); + } + } + else if(directiveName == "POLLFREQALERT") + { + if(values.size()>0) + { + _config->poolFreqAlert = StringToSettableNumber(values.front()); + } + } + else if(directiveName == "HOSTSYNC") + { + if(values.size()>0) + { + _config->hotSync = StringToSettableNumber(values.front()); + } + } + else if(directiveName == "DEADTIME") + { + if(values.size()>0) + { + _config->deadTime = StringToSettableNumber(values.front()); + } + } + else if(directiveName == "POWERDOWNFLAG") + { + if(values.size()>0) + { + _config->powerDownFlag = values.front(); + } + } + else if(directiveName == "NOTIFYMSG") + { + if(values.size()==2) + { + UpsmonConfiguration::NotifyType type = UpsmonConfiguration::NotifyTypeFromString(values.front()); + if(type!=UpsmonConfiguration::NOTIFY_TYPE_MAX) + { + _config->notifyMessages[static_cast(type)] = *(++values.begin()); + } + } + } + else if(directiveName == "NOTIFYFLAG") + { + if(values.size()==2) + { + UpsmonConfiguration::NotifyType type = UpsmonConfiguration::NotifyTypeFromString(values.front()); + if(type!=UpsmonConfiguration::NOTIFY_TYPE_MAX) + { + unsigned int flags = 0; + std::string word; + std::stringstream stream(*(++values.begin())); + while( std::getline(stream, word, '+') ) + { + flags |= UpsmonConfiguration::NotifyFlagFromString(word); + } + _config->notifyFlags[static_cast(type)] = flags; + } + } + } + else if(directiveName == "RBWARNTIME") + { + if(values.size()>0) + { + _config->rbWarnTime = StringToSettableNumber(values.front()); + } + } + else if(directiveName == "NOCOMMWARNTIME") + { + if(values.size()>0) + { + _config->noCommWarnTime = StringToSettableNumber(values.front()); + } + } + else if(directiveName == "FINALDELAY") + { + if(values.size()>0) + { + _config->finalDelay = StringToSettableNumber(values.front()); + } + } + else + { + // TODO WTF with unknown commands ? + } + } +} + +void UpsmonConfigParser::onParseEnd() +{ + // Do nothing +} + +// +// NutConfiguration +// + +NutConfiguration::NutConfiguration(): + mode(MODE_UNKNOWN) +{ +} + +void NutConfiguration::parseFromString(const std::string& str) +{ + NutConfConfigParser parser(str); + parser.parseNutConfConfig(this); +} + +NutConfiguration::NutMode NutConfiguration::NutModeFromString(const std::string& str) +{ + if(str == "none") + return MODE_NONE; + else if(str == "standalone") + return MODE_STANDALONE; + else if(str == "netserver") + return MODE_NETSERVER; + else if(str == "netclient") + return MODE_NETCLIENT; + else if(str == "controlled") + return MODE_CONTROLLED; + else if(str == "manual") + return MODE_MANUAL; + else + return MODE_UNKNOWN; +} + + +bool NutConfiguration::parseFrom(NutStream & istream) +{ + // TODO: The parser is highly inefficient, it should use NutStream, directly + std::string str; + + if (NutStream::NUTS_OK != istream.getString(str)) + return false; + + parseFromString(str); + + return true; +} + + +bool NutConfiguration::writeTo(NutStream & ostream) const +{ + NutConfConfigWriter writer(ostream); + + return NutWriter::NUTW_OK == writer.writeConfig(*this); +} + + +// +// NutConfConfigParser +// + +NutConfConfigParser::NutConfConfigParser(const char* buffer): +NutConfigParser(buffer) +{ +} + +NutConfConfigParser::NutConfConfigParser(const std::string& buffer): +NutConfigParser(buffer) +{ +} + +void NutConfConfigParser::parseNutConfConfig(NutConfiguration* config) +{ + if(config!=nullptr) + { + _config = config; + NutConfigParser::parseConfig(); + _config = nullptr; + } +} + +void NutConfConfigParser::onParseBegin() +{ + // Do nothing +} + +void NutConfConfigParser::onParseComment(const std::string& /*comment*/) +{ + // Comments are ignored for now +} + +void NutConfConfigParser::onParseSectionName(const std::string& /*sectionName*/, const std::string& /*comment*/) +{ + // There must not be sections in nutconf.conf. + // Ignore it + // TODO Add error reporting ? +} + +void NutConfConfigParser::onParseDirective(const std::string& directiveName, char /*sep*/, const ConfigParamList& values, const std::string& /*comment*/) +{ + // Comments are ignored for now + // NOTE: although sep must be '=', sep is not verified. + if(_config && directiveName=="MODE" && values.size()==1) + { + std::string val = values.front(); + NutConfiguration::NutMode mode = NutConfiguration::NutModeFromString(val); + if(mode != NutConfiguration::MODE_UNKNOWN) + _config->mode = mode; + } + else + { + // TODO WTF with errors ? + } +} + +void NutConfConfigParser::onParseEnd() +{ + // Do nothing +} + + +// +// UpsdConfiguration +// + +UpsdConfiguration::UpsdConfiguration() +{ +} + +void UpsdConfiguration::parseFromString(const std::string& str) +{ + UpsdConfigParser parser(str); + parser.parseUpsdConfig(this); +} + + +bool UpsdConfiguration::parseFrom(NutStream & istream) +{ + // TODO: The parser is highly inefficient, it should use NutStream, directly + std::string str; + + if (NutStream::NUTS_OK != istream.getString(str)) + return false; + + parseFromString(str); + + return true; +} + + +bool UpsdConfiguration::writeTo(NutStream & ostream) const +{ + UpsdConfigWriter writer(ostream); + + return NutWriter::NUTW_OK == writer.writeConfig(*this); +} + + +// +// UpsdConfigParser +// + +UpsdConfigParser::UpsdConfigParser(const char* buffer): +NutConfigParser(buffer, NutParser::OPTION_IGNORE_COLON) +{ +} + +UpsdConfigParser::UpsdConfigParser(const std::string& buffer): +NutConfigParser(buffer, NutParser::OPTION_IGNORE_COLON) +{ +} + +void UpsdConfigParser::parseUpsdConfig(UpsdConfiguration* config) +{ + if(config!=nullptr) + { + _config = config; + NutConfigParser::parseConfig(); + _config = nullptr; + } +} + +void UpsdConfigParser::onParseBegin() +{ + // Do nothing +} + +void UpsdConfigParser::onParseComment(const std::string& comment) +{ + // Comments are ignored for now + NUT_UNUSED_VARIABLE(comment); +} + +void UpsdConfigParser::onParseSectionName(const std::string& sectionName, const std::string& comment) +{ + // There must not be sections in upsd.conf. + // Ignore it + // TODO Add error reporting ? + NUT_UNUSED_VARIABLE(sectionName); + NUT_UNUSED_VARIABLE(comment); +} + +void UpsdConfigParser::onParseDirective(const std::string& directiveName, char sep, const ConfigParamList& values, const std::string& comment) +{ + // NOTE: separators are always ignored + NUT_UNUSED_VARIABLE(sep); + NUT_UNUSED_VARIABLE(comment); + + if(_config) + { + if(directiveName == "MAXAGE") + { + if(values.size()>0) + { + _config->maxAge = StringToSettableNumber(values.front()); + } + } + else if(directiveName == "STATEPATH") + { + if(values.size()>0) + { + _config->statePath = values.front(); + } + } + else if(directiveName == "MAXCONN") + { + if(values.size()>0) + { + _config->maxConn = StringToSettableNumber(values.front()); + } + } + else if(directiveName == "CERTFILE") + { + if(values.size()>0) + { + _config->certFile = values.front(); + } + } + else if(directiveName == "LISTEN") + { + if(values.size()==1 || values.size()==2) + { + UpsdConfiguration::Listen listen; + listen.address = values.front(); + if(values.size()==2) + { + listen.port = StringToSettableNumber(*(++values.begin())); + } + _config->listens.push_back(listen); + } + } + else + { + // TODO WTF with unknown commands ? + } + } +} + +void UpsdConfigParser::onParseEnd() +{ + // Do nothing +} + + +// +// UpsdUsersConfiguration +// + +UpsdUsersConfiguration::upsmon_mode_t UpsdUsersConfiguration::getUpsmonMode() const +{ + std::string mode_str = getStr("upsmon", "upsmon"); + + if ("master" == mode_str) + return UPSMON_MASTER; + + if ("slave" == mode_str) + return UPSMON_SLAVE; + + return UPSMON_UNDEF; +} + + +void UpsdUsersConfiguration::setUpsmonMode(upsmon_mode_t mode) +{ + assert(UPSMON_UNDEF != mode); + + setStr("upsmon", "upsmon", (UPSMON_MASTER == mode ? "master" : "slave")); +} + + +bool UpsdUsersConfiguration::parseFrom(NutStream & istream) +{ + // TODO: The parser is highly inefficient, it should use NutStream, directly + std::string str; + + if (NutStream::NUTS_OK != istream.getString(str)) + return false; + + parseFromString(str); + + return true; +} + + +bool UpsdUsersConfiguration::writeTo(NutStream & ostream) const +{ + UpsdUsersConfigWriter writer(ostream); + + return NutWriter::NUTW_OK == writer.writeConfig(*this); +} + +} /* namespace nut */ diff --git a/common/nutipc.cpp b/common/nutipc.cpp new file mode 100644 index 0000000000..eaa2829f8e --- /dev/null +++ b/common/nutipc.cpp @@ -0,0 +1,305 @@ +/* + nutipc.cpp - NUT IPC + + Copyright (C) 2012 Eaton + + Author: Vaclav Krpec + + 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" + +/* For C++ code below, we do not actually use the fallback time methods + * (on mingw mostly), but in C++ context they happen to conflict with + * time.h or ctime headers, while native-C does not. Just disable the + * fallback localtime_r(), gmtime_r() etc. if/when NUT common.h gets + * included by the header chain: + */ +#ifndef HAVE_GMTIME_R +# define HAVE_GMTIME_R 111 +#endif +#ifndef HAVE_LOCALTIME_R +# define HAVE_LOCALTIME_R 111 +#endif + +#include "nutipc.hpp" +#include "nutstream.hpp" + +#include + + +namespace nut { + +/* Trivial implementations out of class declaration to avoid + * error: 'ClassName' has no out-of-line virtual method definitions; its vtable + * will be emitted in every translation unit [-Werror,-Wweak-vtables] + */ +Process::Main::~Main() {} +Signal::Handler::~Handler() {} + +pid_t Process::getPID() +#if (defined __cplusplus) && (__cplusplus < 201100) + throw() +#endif +{ + return getpid(); +} + + +pid_t Process::getPPID() +#if (defined __cplusplus) && (__cplusplus < 201100) + throw() +#endif +{ +#ifdef WIN32 + /* FIXME: Detect HAVE_GETPPID in configure; throw exceptions here?.. + * NOTE: Does not seem to be currently used in nutconf codebase. */ + return -1; +#else + return getppid(); +#endif +} + + +/** + * \brief Command line segmentation + * + * The function parses the \c command and chops off (and return) + * the first command line word (i.e. does segmentation based + * on white spaces, unless quoted). + * White spaces are removed from the returned words. + * + * \param[in,out] command Command line + * + * \return Command line word + */ +static std::string getCmdLineWord(std::string & command) { + size_t len = 0; + + // Remove initial whitespace + while (len < command.size()) { + if (' ' != command[len] && '\t' != command[len]) + break; + + ++len; + } + + command.erase(0, len); + + // Seek word end + bool bslsh = false; + char quote = 0; + + for (len = 0; len < command.size(); ++len) { + char ch = command[len]; + + // White space (may be inside quotes) + if (' ' == ch || '\t' == ch) { + if (!quote) + break; + } + + // Backspace (second one cancels the first) + else if ('\\' == ch) { + bslsh = bslsh ? false : true; + } + + // Double quote (may be escaped or nested) + else if ('"' == ch) { + if (!bslsh) { + if (!quote) + quote = '"'; + + // Final double quote + else if ('"' == quote) + quote = 0; + } + } + + // Single quote (can't be escaped) + else if ('\'' == ch) { + if (!quote) + quote = '\''; + + else if ('\'' == quote) + quote = 0; + } + + // Cancel backslash + if ('\\' != ch) + bslsh = false; + } + + // Extract the word + std::string word = command.substr(0, len); + + command.erase(0, len); + + return word; +} + + +Process::Executor::Executor(const std::string & command) { + std::string cmd(command); + + m_bin = getCmdLineWord(cmd); + + for (;;) { + std::string arg = getCmdLineWord(cmd); + + if (arg.empty()) + break; + + m_args.push_back(arg); + } +} + + +int Process::Executor::operator () () +#if (defined __cplusplus) && (__cplusplus < 201100) + throw(std::runtime_error) +#endif +{ + const char ** args_c_str = new const char *[m_args.size() + 2]; + + const char * bin_c_str = m_bin.c_str(); + + args_c_str[0] = bin_c_str; + + Arguments::const_iterator arg = m_args.begin(); + + size_t i = 1; + + for (; arg != m_args.end(); ++arg, ++i) { + args_c_str[i] = (*arg).c_str(); + } + + args_c_str[i] = nullptr; + + int status = ::execvp(bin_c_str, const_cast(args_c_str)); + + // Upon successful execution, the execvp function never returns + // (since the process context is replaced, completely) + + delete[] args_c_str; + + std::stringstream e; + + e << "Failed to execute binary " << m_bin << ": " << status; + + throw std::runtime_error(e.str()); +} + + +int sigPipeWriteCmd(int fh, void * cmd, size_t cmd_size) +#if (defined __cplusplus) && (__cplusplus < 201100) + throw(std::runtime_error) +#endif +{ + char * cmd_bytes = reinterpret_cast(cmd); + + do { + ssize_t written = ::write(fh, cmd_bytes, cmd_size); + + if (written < 0) + return errno; + + cmd_bytes += written; + cmd_size -= static_cast(written); + + } while (cmd_size); + + return 0; +} + + +int Signal::send(Signal::enum_t signame, pid_t pid) +#if (defined __cplusplus) && (__cplusplus < 201100) + throw(std::logic_error) +#endif +{ + int sig = static_cast(signame); +#ifdef WIN32 + /* FIXME: Implement (for NUT processes) via pipes? + * See e.g. upsdrvctl implementation. */ + std::stringstream e; + + e << "Can't send signal " << sig << " to PID " << pid << + ": not implemented on this platform yet"; + + throw std::logic_error(e.str()); +#else + int status = ::kill(pid, sig); + + if (0 == status) + return 0; + + if (EINVAL != errno) + return errno; + + std::stringstream e; + + e << "Can't send invalid signal " << sig; + + throw std::logic_error(e.str()); +#endif +} + + +int Signal::send(Signal::enum_t signame, const std::string & pid_file) { + NutFile file(pid_file, NutFile::READ_ONLY); + + std::string pid_str; + + NutStream::status_t read_st = file.getString(pid_str); + + if (NutStream::NUTS_OK != read_st) { + std::stringstream e; + + e << "Failed to read PID from " << pid_file << ": " << read_st; + + throw std::runtime_error(e.str()); + } + + std::stringstream pid_conv(pid_str); + + pid_t pid; + + if (!(pid_conv >> pid)) { + std::stringstream e; + + e << "Failed to convert contents of " << pid_file << " to PID"; + + throw std::runtime_error(e.str()); + } + + return send(signame, pid); +} + + +int NutSignal::send(NutSignal::enum_t signame, const std::string & process) { + std::string pid_file; + + // TBD: What's ALTPIDPATH and shouldn't we also consider it? + pid_file += PIDPATH; + pid_file += '/'; + pid_file += process; + pid_file += ".pid"; + + return Signal::send(signame, pid_file); +} + +} // end of namespace nut diff --git a/common/nutstream.cpp b/common/nutstream.cpp new file mode 100644 index 0000000000..555cc44f15 --- /dev/null +++ b/common/nutstream.cpp @@ -0,0 +1,1333 @@ +/* + nutstream.cpp - NUT stream + + Copyright (C) + 2012 Vaclav Krpec + + 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 "nutstream.hpp" + +#include +#include +#include +#include +#include +#include + +extern "C" { + +/* For C++ code below, we do not actually use the fallback time methods + * (on mingw mostly), but in C++ context they happen to conflict with + * time.h or ctime headers, while native-C does not. Just disable the + * fallback localtime_r(), gmtime_r() etc. if/when NUT timehead.h gets + * included by the header chain from common.h: + */ +#ifndef HAVE_GMTIME_R +# define HAVE_GMTIME_R 111 +#endif +#ifndef HAVE_LOCALTIME_R +# define HAVE_LOCALTIME_R 111 +#endif +#include "common.h" + +#include +#include +#include +#include + +/* Windows/Linux Socket compatibility layer, lifted from nutclient.cpp + * (note we do not use wincompat.h here as it slightly conflicts, with + * extern vs. static etc.) */ +/* Thanks to Benjamin Roux (http://broux.developpez.com/articles/c/sockets/) */ +#ifdef WIN32 +# define SOCK_OPT_CAST(x) reinterpret_cast(x) + +/* equivalent of W32_NETWORK_CALL_OVERRIDE + * invoked by wincompat.h in upsclient.c: + */ +static inline int sktconnect(int fh, struct sockaddr * name, int len) +{ + int ret = connect(fh,name,len); + errno = WSAGetLastError(); + return ret; +} +static inline int sktread(int fh, void *buf, int size) +{ + int ret = recv(fh,(char*)buf,size,0); + errno = WSAGetLastError(); + return ret; +} +static inline int sktwrite(int fh, const void*buf, int size) +{ + int ret = send(fh,(char*)buf,size,0); + errno = WSAGetLastError(); + return ret; +} +static inline int sktclose(int fh) +{ + int ret = closesocket((SOCKET)fh); + errno = WSAGetLastError(); + return ret; +} + +#else /* not WIN32 */ + +# include +# include +# include +# include +# include +# include /* gethostbyname */ +# include +# ifndef INVALID_SOCKET +# define INVALID_SOCKET -1 +# endif +# ifndef SOCKET_ERROR +# define SOCKET_ERROR -1 +# endif +# ifndef closesocket +# define closesocket(s) close(s) +# endif +# define SOCK_OPT_CAST(x) reinterpret_cast(x) + typedef int SOCKET; + typedef struct sockaddr_in SOCKADDR_IN; + typedef struct sockaddr SOCKADDR; + typedef struct in_addr IN_ADDR; + +# define sktconnect(h,n,l) ::connect(h,n,l) +# define sktread(h,b,s) ::read(h,b,s) +# define sktwrite(h,b,s) ::write(h,b,s) +# define sktclose(h) ::close(h) + +/* WA for Solaris/i386 bug: non-blocking connect sets errno to ENOENT */ +# if (defined NUT_PLATFORM_SOLARIS) +# define SOLARIS_i386_NBCONNECT_ENOENT(status) ( (!strcmp("i386", CPU_TYPE)) ? (ENOENT == (status)) : 0 ) +# else +# define SOLARIS_i386_NBCONNECT_ENOENT(status) (0) +# endif /* end of Solaris/i386 WA for non-blocking connect */ + +/* WA for AIX bug: non-blocking connect sets errno to 0 */ +# if (defined NUT_PLATFORM_AIX) +# define AIX_NBCONNECT_0(status) (0 == (status)) +# else +# define AIX_NBCONNECT_0(status) (0) +# endif /* end of AIX WA for non-blocking connect */ + +#endif /* WIN32 */ +/* End of Windows/Linux Socket compatibility layer */ +} + + +namespace nut { + +/* Trivial implementation out of class declaration to avoid + * error: 'ClassName' has no out-of-line virtual method definitions; its vtable + * will be emitted in every translation unit [-Werror,-Wweak-vtables] + */ +NutStream::~NutStream() {} + +NutStream::status_t NutMemory::getChar(char & ch) { + if (m_pos == m_impl.size()) + return NUTS_EOF; + + if (m_pos > m_impl.size()) + return NUTS_ERROR; + + ch = m_impl.at(m_pos); + + return NUTS_OK; +} + + +void NutMemory::readChar() { + if (m_pos < m_impl.size()) + ++m_pos; +} + + +NutStream::status_t NutMemory::getString(std::string & str) { + str = m_impl.substr(m_pos); + + m_pos = m_impl.size(); + + return NUTS_OK; +} + + +NutStream::status_t NutMemory::putChar(char ch) { + m_impl += ch; + + return NUTS_OK; +} + + +NutStream::status_t NutMemory::putString(const std::string & str) { + m_impl += str; + + return NUTS_OK; +} + + +NutStream::status_t NutMemory::putData(const std::string & data) { + return putString(data); +} + + +/* Here we align with OS envvars like TMPDIR or TEMPDIR, + * consider portability to Windows, or use of tmpfs like + * /dev/shm or (/var)/run on some platforms - e.g. NUT + * STATEPATH, (ALT)PIDPATH or similar locations desired + * by packager who knows their system. */ + +static bool checkExistsWritableDir(const char *s) { +#ifdef DEBUG + std::cerr << "checkExistsWritableDir(" << (s ? s : "") << "): "; +#endif + if (!s || *s == '\0') { +#ifdef DEBUG + std::cerr << "null or empty string" << std::endl; +#endif + return false; + } + + if (!opendir(s)) { +#ifdef DEBUG + std::cerr << "not a dir" << std::endl; +#endif + return false; + } + + /* POSIX: If the requested access is permitted, access() succeeds + * and shall return 0; otherwise, -1 shall be returned and errno + * shall be set to indicate the error. */ + if (access(s, X_OK)) { +#ifdef DEBUG + std::cerr << "not traversable" << std::endl; +#endif + return false; + } + + if (access(s, W_OK)) { +#ifdef DEBUG + std::cerr << "not writeable" << std::endl; +#endif + return false; + } + +#ifdef DEBUG + std::cerr << "is ok" << std::endl; +#endif + return true; +} + +static const char* getTmpDirPath() { + const char *s; + +#ifdef WIN32 + /* Suggestions from https://sourceforge.net/p/mingw/bugs/666/ */ + static char pathbuf[MAX_PATH]; + int i; +#endif + + if (checkExistsWritableDir(s = ::altpidpath())) + return s; + + /* NOTE: For C++17 or newer we might also call + * https://en.cppreference.com/w/cpp/filesystem/temp_directory_path + */ + +#ifdef WIN32 + i = GetTempPathA(sizeof(pathbuf), pathbuf); + if ((i > 0) && (i < MAX_PATH) && checkExistsWritableDir(pathbuf)) + return (const char *)pathbuf; +#endif + + if (checkExistsWritableDir(s = ::getenv("TMPDIR"))) + return s; + if (checkExistsWritableDir(s = ::getenv("TEMPDIR"))) + return s; + if (checkExistsWritableDir(s = ::getenv("TEMP"))) + return s; + if (checkExistsWritableDir(s = ::getenv("TMP"))) + return s; + + /* Some OS-dependent locations */ +#ifdef WIN32 + if (checkExistsWritableDir(s = "C:\\Temp")) + return s; + if (checkExistsWritableDir(s = "C:\\Windows\\Temp")) + return s; + if (checkExistsWritableDir(s = "/c/Temp")) + return s; + if (checkExistsWritableDir(s = "/c/Windows/Temp")) + return s; +#else + if (checkExistsWritableDir(s = "/dev/shm")) + return s; + if (checkExistsWritableDir(s = "/run")) + return s; + if (checkExistsWritableDir(s = "/var/run")) + return s; +#endif + + /* May be applicable to WIN32 depending on emulation environment/mapping */ + if (checkExistsWritableDir(s = "/tmp")) + return s; + if (checkExistsWritableDir(s = "/var/tmp")) + return s; + + /* Maybe ok, for tests at least: a current working directory */ + if (checkExistsWritableDir(s = ".")) + return s; + + return "/tmp"; +} + +const std::string NutFile::m_tmp_dir(getTmpDirPath()); + +NutFile::NutFile(anonymous_t): + m_name(""), + m_impl(nullptr), + m_current_ch('\0'), + m_current_ch_valid(false) +{ +#ifdef WIN32 + /* Suggestions from https://sourceforge.net/p/mingw/bugs/666/ because + * msvcrt tmpfile() uses C: root dir and lacks permissions to actually + * use it, and mingw tends to call that OS method so far */ + char filename[MAX_PATH]; + memset(filename, 0, sizeof(filename)); + + GetTempFileNameA(m_tmp_dir.c_str(), "nuttemp", 0, filename); + /* if (verbose) std::cerr << "TMP FILE: " << filename << std::endl; */ + std::string mode_str = std::string(strAccessMode(READ_WRITE_CLEAR)); + /* ...Still, we ask to auto-delete where supported: */ + mode_str += std::string("D"); + /* Per https://en.cppreference.com/w/cpp/io/c/tmpfile it is binary + * for POSIX code, so match the behavior here: */ + mode_str += std::string("b"); + m_impl = ::fopen(filename, mode_str.c_str()); + /* If it were not "const" we might assign it. But got no big need to. + * m_name = std::string(filename); + */ +#else + /* TOTHINK: How to make this use m_tmp_dir? Is it possible generally? */ + /* Safer than tmpnam() but we don't know the filename here. + * Not that we need it, system should auto-delete it. */ + m_impl = ::tmpfile(); +#endif + + if (nullptr == m_impl) { + int err_code = errno; + + std::stringstream e; + e << "Failed to create temporary file: " << err_code + << ": " << ::strerror(err_code); + +#ifdef WIN32 + e << ": tried using temporary location " << m_tmp_dir; + if (filename[0] != '\0') + e << ": OS suggested filename " << filename; +#endif + + throw std::runtime_error(e.str()); + } +} + + +bool NutFile::exists(int & err_code, std::string & err_msg) const +#if (defined __cplusplus) && (__cplusplus < 201100) + throw() +#endif +{ + struct stat info; + int status; + + /* An opened file pointer is assumed to be backed by a file at this + * moment (even if unlinked, temporary with unknown name, etc.) */ + if (m_impl != nullptr) + return true; + + /* Can not stat an unknown file name */ + if (m_name.empty()) + return false; + + status = ::stat(m_name.c_str(), &info); + + if (!status) + return true; + + err_code = errno; + err_msg = std::string(::strerror(err_code)); + + return false; +} + + +const char * NutFile::strAccessMode(access_t mode) +#if (defined __cplusplus) && (__cplusplus < 201100) + throw() +#endif +{ + /* NOTE: Currently we use OS-default binary/text choice of content mode + * since we primarily expect to manipulate user-editable config files */ + static const char *read_only = "r"; + static const char *write_only = "w"; + static const char *read_write = "r+"; + static const char *read_write_clear = "w+"; + static const char *append_only = "a"; + static const char *read_append = "a+"; + + const char *mode_str = nullptr; + + switch (mode) { + case READ_ONLY: + mode_str = read_only; + break; + case WRITE_ONLY: + mode_str = write_only; + break; + case READ_WRITE: + mode_str = read_write; + break; + case READ_WRITE_CLEAR: + mode_str = read_write_clear; + break; + case READ_APPEND: + mode_str = read_append; + break; + case APPEND_ONLY: + mode_str = append_only; + break; + } + + assert(nullptr != mode_str); + + return mode_str; +} + +bool NutFile::open(access_t mode, int & err_code, std::string & err_msg) +#if (defined __cplusplus) && (__cplusplus < 201100) + throw() +#endif +{ + const char *mode_str; + + /* Can not open an unknown file name */ + if (m_name.empty()) { + err_code = ENOENT; + err_msg = std::string("No file name was specified"); + return false; + } + + if (nullptr != m_impl) { + /* TOTHINK: Should we care about errors in this close()? */ + ::fclose(m_impl); + } + +#ifdef WIN32 + /* This currently fails with mingw due to looking at POSIXified paths: + * - Failed to open file /c/Users/abuild/Documents/FOSS/nut/conf/nut.conf.sample: 2: No such file or directory + * while the file does exist (for git-bash and mingw shells): + * $ ls -la /c/Users/abuild/Documents/FOSS/nut/conf/nut.conf.sample + * -rw-r--r-- 1 abuild Users 4774 Jan 28 03:38 /c/Users/abuild/Documents/FOSS/nut/conf/nut.conf.sample + * + * For the test suite it is not a great problem, can be fixed + * by using `cygpath` or `pwd -W` in `configure` script. + * The run-time behavior is more troublesome: per discussion at + * https://sourceforge.net/p/mingw/mailman/mingw-users/thread/gq8fi0$pk0$2@ger.gmane.org/ + * mingw uses fopen() from msvcrt directly, and it does not know + * such paths (e.g. '/c/Users/...' means "C:\\c\\Users\\..." to it). + * Paths coming from MSYS shell arguments are handled by the shell, + * and this is more than about slash type (WINNT is okay with both), + * but also e.g. prefixing an msys installation path 'C:\\msys64' or + * similar when using absolute POSIX-style paths. Do we need a private + * converter?.. Would an end user have MSYS installed at all? + */ +#endif + + mode_str = strAccessMode(mode); + m_impl = ::fopen(m_name.c_str(), mode_str); + + if (nullptr != m_impl) + return true; + + err_code = errno; + err_msg = "Failed to open file '" + m_name + "': " + + std::string(::strerror(err_code)); + + return false; +} + + +bool NutFile::flush(int & err_code, std::string & err_msg) +#if (defined __cplusplus) && (__cplusplus < 201100) + throw() +#endif +{ + if (nullptr == m_impl) { + err_code = EBADF; + err_msg = std::string(::strerror(err_code)); + return false; + } + + err_code = ::fflush(m_impl); + + if (0 != err_code) { + err_msg = std::string(::strerror(err_code)); + + return false; + } + + return true; +} + + +bool NutFile::close(int & err_code, std::string & err_msg) +#if (defined __cplusplus) && (__cplusplus < 201100) + throw() +#endif +{ + /* Already closed (or never opened) - goal achieved */ + if (nullptr == m_impl) { + return true; + } + + err_code = ::fclose(m_impl); + + if (0 != err_code) { + err_msg = std::string(::strerror(err_code)); + + return false; + } + + m_impl = nullptr; + + return true; +} + + +bool NutFile::remove(int & err_code, std::string & err_msg) +#if (defined __cplusplus) && (__cplusplus < 201100) + throw() +#endif +{ + /* Can not unlink an unknown file name */ + if (m_name.empty()) { + err_code = ENOENT; + err_msg = std::string("No file name was specified"); + return false; + } + + /* FWIW, note that if the file descriptor is opened by this + * or any other process(es), it remains usable only by them + * after un-linking, and the file system resources would be + * released only when everyone closes it. */ + err_code = ::unlink(m_name.c_str()); + + if (0 != err_code) { + err_code = errno; + + err_msg = std::string(::strerror(err_code)); + + return false; + } + + return true; +} + + +NutFile::NutFile(const std::string & name, access_t mode): + m_name(name), + m_impl(nullptr), + m_current_ch('\0'), + m_current_ch_valid(false) +{ + openx(mode); +} + + +NutFile::NutFile(access_t mode): + NutFile(ANONYMOUS) +{ + const char *mode_str = strAccessMode(mode); + m_impl = ::freopen(nullptr, mode_str, m_impl); + + if (nullptr == m_impl) { + int err_code = errno; + + std::stringstream e; + e << "Failed to re-open temporary file with mode '" << mode_str + << "': " << err_code + << ": " << ::strerror(err_code); + + throw std::runtime_error(e.str()); + } +} + + +/** + * \brief C fgetc wrapper + * + * \param[in] file File + * \param[out] ch Character + * + * \retval NUTS_OK on success + * \retval NUTS_EOF on end-of-file + * \retval NUTS_ERROR on read error + */ +inline static NutStream::status_t fgetcWrapper(FILE * file, char & ch) { + assert(nullptr != file); + + errno = 0; + + int c = ::fgetc(file); + + if (EOF == c) { + if (0 == errno) + return NutStream::NUTS_EOF; + + return NutStream::NUTS_ERROR; + } + + ch = static_cast(c); + + return NutStream::NUTS_OK; +} + + +NutStream::status_t NutFile::getChar(char & ch) +#if (defined __cplusplus) && (__cplusplus < 201100) + throw() +#endif +{ + if (m_current_ch_valid) { + ch = m_current_ch; + + return NUTS_OK; + } + + if (nullptr == m_impl) + return NUTS_ERROR; + + status_t status = fgetcWrapper(m_impl, ch); + + if (NUTS_OK != status) + return status; + + // Cache the character for future reference + m_current_ch = ch; + m_current_ch_valid = true; + + return NUTS_OK; +} + + +void NutFile::readChar() +#if (defined __cplusplus) && (__cplusplus < 201100) + throw() +#endif +{ + m_current_ch_valid = false; +} + + +NutStream::status_t NutFile::getString(std::string & str) +#if (defined __cplusplus) && (__cplusplus < 201100) + throw() +#endif +{ + if (m_current_ch_valid) + str += m_current_ch; + + m_current_ch_valid = false; + + if (nullptr == m_impl) + return NUTS_ERROR; + + // Note that ::fgetc is used instead of ::fgets + // That's because of \0 char. support + for (;;) { + char ch; + + status_t status = fgetcWrapper(m_impl, ch); + + if (NUTS_ERROR == status) + return status; + + if (NUTS_EOF == status) + return NUTS_OK; + + str += ch; + } +} + + +NutStream::status_t NutFile::putChar(char ch) +#if (defined __cplusplus) && (__cplusplus < 201100) + throw() +#endif +{ + int c; + + if (nullptr == m_impl) + return NUTS_ERROR; + + c = ::fputc(static_cast(ch), m_impl); + + return EOF == c ? NUTS_ERROR : NUTS_OK; +} + + +NutStream::status_t NutFile::putString(const std::string & str) +#if (defined __cplusplus) && (__cplusplus < 201100) + throw() +#endif +{ + int c; + + if (nullptr == m_impl) + return NUTS_ERROR; + + c = ::fputs(str.c_str(), m_impl); + + return EOF == c ? NUTS_ERROR : NUTS_OK; +} + + +NutStream::status_t NutFile::putData(const std::string & data) +#if (defined __cplusplus) && (__cplusplus < 201100) + throw() +#endif +{ + // Unfortunately, C FILE interface doesn't have non C-string + // put function (i.e. function for raw data output with size specifier + for (size_t i = 0; i < data.size(); ++i) { + status_t st = putChar(data.at(i)); + + if (NUTS_ERROR == st) + return NUTS_ERROR; + } + + return NUTS_OK; +} + + +NutFile::~NutFile() { + if (nullptr != m_impl) + closex(); +} + + +void NutSocket::Address::init_unix(Address & addr, const std::string & path) { +#ifdef WIN32 + /* FIXME: Windows pipes where available? See e.g. clone drivers */ + NUT_UNUSED_VARIABLE(addr); + NUT_UNUSED_VARIABLE(path); + + std::stringstream e; + e << "Unix sockets not implemented for this platform yet: " << path; +// addr.str() << ":" << path; + + throw std::logic_error(e.str()); +#else + struct sockaddr_un * un_addr = reinterpret_cast(::malloc(sizeof(struct sockaddr_un))); + + if (nullptr == un_addr) + throw std::bad_alloc(); + + un_addr->sun_family = AF_UNIX; + + assert(sizeof(un_addr->sun_path) / sizeof(char) > path.size()); + + for (size_t i = 0; i < path.size(); ++i) + un_addr->sun_path[i] = path.at(i); + + un_addr->sun_path[path.size()] = '\0'; + + addr.m_sock_addr = reinterpret_cast(un_addr); + addr.m_length = sizeof(*un_addr); +#endif +} + + +void NutSocket::Address::init_ipv4(Address & addr, const std::vector & qb, uint16_t port) { + assert(4 == qb.size()); + + uint32_t packed_qb = 0; + + struct sockaddr_in * in4_addr = reinterpret_cast(::malloc(sizeof(struct sockaddr_in))); + + if (nullptr == in4_addr) + throw std::bad_alloc(); + + packed_qb = static_cast(qb.at(0)); + packed_qb |= static_cast(qb.at(1)) << 8; + packed_qb |= static_cast(qb.at(2)) << 16; + packed_qb |= static_cast(qb.at(3)) << 24; + + in4_addr->sin_family = AF_INET; + in4_addr->sin_port = htons(port); + in4_addr->sin_addr.s_addr = packed_qb; + + addr.m_sock_addr = reinterpret_cast(in4_addr); + addr.m_length = sizeof(*in4_addr); +} + + +void NutSocket::Address::init_ipv6(Address & addr, const std::vector & hb, uint16_t port) { + assert(16 == hb.size()); + + struct sockaddr_in6 * in6_addr = reinterpret_cast(::malloc(sizeof(struct sockaddr_in6))); + + if (nullptr == in6_addr) + throw std::bad_alloc(); + + in6_addr->sin6_family = AF_INET6; + in6_addr->sin6_port = htons(port); + in6_addr->sin6_flowinfo = 0; // TODO: check that + in6_addr->sin6_scope_id = 0; // TODO: check that + + for (size_t i = 0; i < 16; ++i) + in6_addr->sin6_addr.s6_addr[i] = hb.at(i); + + addr.m_sock_addr = reinterpret_cast(in6_addr); + addr.m_length = sizeof(*in6_addr); +} + + +NutSocket::Address::Address( + unsigned char msb, + unsigned char msb2, + unsigned char lsb2, + unsigned char lsb, + uint16_t port) +{ + std::vector qb; + + qb.reserve(4); + qb.push_back(msb); + qb.push_back(msb2); + qb.push_back(lsb2); + qb.push_back(lsb); + + init_ipv4(*this, qb, port); +} + + +NutSocket::Address::Address(const std::vector & bytes, uint16_t port) +#if (defined __cplusplus) && (__cplusplus < 201100) + throw(std::logic_error) +#endif +{ + switch (bytes.size()) { + case 4: + init_ipv4(*this, bytes, port); + break; + + case 16: + init_ipv6(*this, bytes, port); + break; + + default: { + std::stringstream e; + e << "Unsupported IP address size: " << bytes.size(); + + throw std::logic_error(e.str()); + } + } +} + + +NutSocket::Address::Address(const Address & orig): m_sock_addr(nullptr), m_length(orig.m_length) { + void * copy = ::malloc(m_length); + + if (nullptr == copy) + throw std::bad_alloc(); + + ::memcpy(copy, orig.m_sock_addr, m_length); + + m_sock_addr = reinterpret_cast(copy); +} + + +/** + * \brief Format IPv4 address + * + * \param packed 4 bytes in network byte order + * + * \return IPv4 address string + */ +static std::string formatIPv4addr(uint32_t packed) { + std::stringstream ss; + + ss << (packed & 0x000000ff) << "."; + ss << (packed >> 8 & 0x000000ff) << "."; + ss << (packed >> 16 & 0x000000ff) << "."; + ss << (packed >> 24 & 0x000000ff); + + return ss.str(); +} + + +/** + * \brief Format IPv6 address + * + * \param bytes 16 bytes in network byte order + * + * \return IPv6 address string + */ +static std::string formatIPv6addr(unsigned char const bytes[16]) { + // Check for special form addresses + bool zero_at_0_9 = true; + bool zero_at_0_14 = false; + + for (size_t i = 0; zero_at_0_9 && i < 10; ++i) + zero_at_0_9 = 0 == bytes[i]; + + if (zero_at_0_9) { + zero_at_0_14 = true; + + for (size_t i = 10; zero_at_0_14 && i < 15; ++i) + zero_at_0_14 = 0 == bytes[i]; + } + + // Loopback + if (zero_at_0_14 && 1 == bytes[15]) + return "::1"; + + std::stringstream ss; + + // IPv4 mapped on IPv6 address + if (zero_at_0_9 && 0xff == bytes[10] && 0xff == bytes[11]) { + ss << "::FFFF:"; + ss << bytes[12] << '.' << bytes[13] << '.'; + ss << bytes[14] << '.' << bytes[15]; + + return ss.str(); + } + + // Standard form + // TODO: ommition (REVIEW: omission?) of lengthy zero word strings + ss << std::uppercase << std::hex << std::setfill('0'); + + for (size_t i = 0; ; ) { + uint16_t w = static_cast(static_cast(bytes[2 * i]) << 8) | static_cast(bytes[2 * i + 1]); + + ss << std::setw(4) << w; + + if (8 == ++i) + break; + + ss << ':'; + } + + return ss.str(); +} + + +std::string NutSocket::Address::str() const { + assert(nullptr != m_sock_addr); + + /* Note: we do not cache a copy of "family" because + * its data type varies per platform, easier to just + * request it each time - not a hot spot anyway. */ + std::stringstream ss; + ss << "nut::NutSocket::Address(family: " << m_sock_addr->sa_family; + + switch (m_sock_addr->sa_family) { +#ifndef WIN32 + /* FIXME: Add support for pipes on Windows? */ + case AF_UNIX: { + struct sockaddr_un * addr = reinterpret_cast(m_sock_addr); + + ss << " (UNIX domain socket), file: " << addr->sun_path; + + break; + } +#endif + + case AF_INET: { + struct sockaddr_in * addr = reinterpret_cast(m_sock_addr); + + ss << " (IPv4 address), " << formatIPv4addr(addr->sin_addr.s_addr) << ":" << addr->sin_port; + + break; + } + + case AF_INET6: { + struct sockaddr_in6 * addr = reinterpret_cast(m_sock_addr); + + ss << " (IPv6 address), " << formatIPv6addr(addr->sin6_addr.s6_addr) << ":" << addr->sin6_port; + + break; + } + + default: { + std::stringstream e; + e << "NOT IMPLEMENTED: Socket address family " << m_sock_addr->sa_family << " unsupported"; + + throw std::logic_error(e.str()); + } + } + + ss << ")"; + + return ss.str(); +} + + +NutSocket::Address::~Address() { + ::free(m_sock_addr); +} + + +/* NOTE: static class method */ +bool NutSocket::accept( + NutSocket & sock, + const NutSocket & listen_sock, + int & err_code, + std::string & err_msg) +#if (defined __cplusplus) && (__cplusplus < 201100) + throw(std::logic_error) +#endif +{ + assert(-1 == sock.m_impl); + + struct sockaddr sock_addr; + socklen_t sock_addr_size = sizeof(sock_addr); + + sock.m_impl = ::accept(listen_sock.m_impl, &sock_addr, &sock_addr_size); + sock.m_domain = listen_sock.m_domain; + sock.m_type = listen_sock.m_type; + + if (-1 != sock.m_impl) + return true; + + err_code = errno; + err_msg = std::string(::strerror(err_code)); + + // The following reasons of unsuccessful termination are non-exceptional + switch (err_code) { + case EAGAIN: // Non-blocking listen socket, no conn. pending + case ECONNABORTED: // Connection has been aborted + case EINTR: // Interrupted by a signal + case EMFILE: // Open file descriptors per-process limit was reached + case ENFILE: // Open file descriptors per-system limit was reached + case EPROTO: // Protocol error + return false; + } + + std::stringstream e; + e << "Failed to accept connection: " << err_code << ": " << err_msg; + + throw std::logic_error(e.str()); +} + + +NutSocket::NutSocket(domain_t dom, type_t type, proto_t proto): + m_impl(-1), + m_domain(dom), + m_type(type), + m_current_ch('\0'), + m_current_ch_valid(false) +{ + int cdom = static_cast(dom); + int ctype = static_cast(type); + int cproto = static_cast(proto); + + m_impl = ::socket(cdom, ctype, cproto); + + if (-1 == m_impl) { + int erno = errno; + + std::stringstream e; + e << "Failed to create socket domain: "; + e << cdom << ", type: " << ctype << ", proto: " << cproto; + e << ": " << erno << ": " << ::strerror(erno); + + throw std::runtime_error(e.str()); + } +} + + +bool NutSocket::bind(const Address & addr, int & err_code, std::string & err_msg) +#if (defined __cplusplus) && (__cplusplus < 201100) + throw() +#endif +{ + if (m_domain == NUTSOCKD_UNDEFINED) { + m_domain = static_cast(addr.m_sock_addr->sa_family); + } + else if (static_cast(m_domain) != static_cast(addr.m_sock_addr->sa_family)) { + err_code = EINVAL; + err_msg = std::string(::strerror(err_code)) + + ": bind() with a different socket address family than this object was created for"; + } + + if (m_type == NUTSOCKT_UNDEFINED) { + /* We should have this from constructor or accept() */ + err_code = EINVAL; + err_msg = std::string(::strerror(err_code)) + + ": bind() with bad socket type"; + } + + err_code = ::bind(m_impl, addr.m_sock_addr, addr.m_length); + + if (0 == err_code) + return true; + + err_code = errno; + err_msg = std::string(::strerror(err_code)); + + return false; +} + + +bool NutSocket::listen(int backlog, int & err_code, std::string & err_msg) +#if (defined __cplusplus) && (__cplusplus < 201100) + throw() +#endif +{ + err_code = ::listen(m_impl, backlog); + + if (0 == err_code) + return true; + + err_code = errno; + err_msg = std::string(::strerror(err_code)); + + return false; +} + + +bool NutSocket::connect(const Address & addr, int & err_code, std::string & err_msg) +#if (defined __cplusplus) && (__cplusplus < 201100) + throw() +#endif +{ + if (m_domain == NUTSOCKD_UNDEFINED) { + m_domain = static_cast(addr.m_sock_addr->sa_family); + } + else if (static_cast(m_domain) != static_cast(addr.m_sock_addr->sa_family)) { + err_code = EINVAL; + err_msg = std::string(::strerror(err_code)) + + ": connect() with a different socket address family than this object was created for"; + } + + if (m_type == NUTSOCKT_UNDEFINED) { + /* We should have this from constructor or accept() */ + err_code = EINVAL; + err_msg = std::string(::strerror(err_code)) + + ": connect() with bad socket type"; + } + + err_code = sktconnect(m_impl, addr.m_sock_addr, addr.m_length); + + if (0 == err_code) + return true; + + err_code = errno; + err_msg = std::string(::strerror(err_code)); + + return false; +} + + +bool NutSocket::flush(int & err_code, std::string & err_msg) +#if (defined __cplusplus) && (__cplusplus < 201100) + throw() +#endif +{ + if (-1 == m_impl) { + err_code = EBADF; + err_msg = std::string(::strerror(err_code)); + return false; + } + + if (m_type == NUTSOCKT_STREAM && m_domain == NUTSOCKD_INETv4) { + /* Assume IPv4 TCP: https://stackoverflow.com/a/71417876/4715872 */ + int flag = 1; + if (!setsockopt(m_impl, IPPROTO_TCP, TCP_NODELAY, SOCK_OPT_CAST(&flag), sizeof(int))) { + err_code = errno; + err_msg = std::string(::strerror(err_code)); + return false; + } + if (!sktwrite(m_impl, nullptr, 0)) { + err_code = errno; + err_msg = std::string(::strerror(err_code)); + return false; + } + flag = 0; + if (!setsockopt(m_impl, IPPROTO_TCP, TCP_NODELAY, SOCK_OPT_CAST(&flag), sizeof(int))) { + err_code = errno; + err_msg = std::string(::strerror(err_code)); + return false; + } + } /* else Unix, UDP (or several other socket families generally); PRs welcome */ + + return true; +} + + +bool NutSocket::close(int & err_code, std::string & err_msg) +#if (defined __cplusplus) && (__cplusplus < 201100) + throw() +#endif +{ + err_code = sktclose(m_impl); + + if (0 == err_code) { + m_impl = -1; + + return true; + } + + err_code = errno; + err_msg = std::string(::strerror(err_code)); + + return false; +} + + +NutSocket::~NutSocket() { + if (-1 != m_impl) + closex(); +} + + +NutStream::status_t NutSocket::getChar(char & ch) +#if (defined __cplusplus) && (__cplusplus < 201100) + throw() +#endif +{ + if (m_current_ch_valid) { + ch = m_current_ch; + + return NUTS_OK; + } + + // TBD: Perhaps we should buffer more bytes at once + // However, buffering is already done in kernel space, + // so unless we need greater reading efficiency, char-by-char + // reading should be sufficient + + ssize_t read_cnt = ::read(m_impl, &ch, 1); + + if (1 == read_cnt) { + m_current_ch = ch; + m_current_ch_valid = true; + + return NUTS_OK; + } + + if (0 == read_cnt) + return NUTS_EOF; + + assert(-1 == read_cnt); + + // TODO: At least logging of the error (errno), if not propagation + + return NUTS_ERROR; +} + + +void NutSocket::readChar() +#if (defined __cplusplus) && (__cplusplus < 201100) + throw() +#endif +{ + m_current_ch_valid = false; +} + + +NutStream::status_t NutSocket::getString(std::string & str) +#if (defined __cplusplus) && (__cplusplus < 201100) + throw() +#endif +{ + if (m_current_ch_valid) + str += m_current_ch; + + m_current_ch_valid = false; + + char buffer[512]; + + for (;;) { + ssize_t read_cnt = sktread(m_impl, buffer, sizeof(buffer) / sizeof(buffer[0])); + + if (read_cnt < 0) + return NUTS_ERROR; + + if (0 == read_cnt) + return NUTS_OK; + + str.append(buffer, static_cast(read_cnt)); + } +} + + +NutStream::status_t NutSocket::putChar(char ch) +#if (defined __cplusplus) && (__cplusplus < 201100) + throw() +#endif +{ + ssize_t write_cnt = sktwrite(m_impl, &ch, 1); + + if (1 == write_cnt) + return NUTS_OK; + + assert(-1 == write_cnt); + + // TODO: At least logging of the error (errno), if not propagation + + return NUTS_ERROR; +} + + +NutStream::status_t NutSocket::putString(const std::string & str) +#if (defined __cplusplus) && (__cplusplus < 201100) + throw() +#endif +{ + size_t str_len = str.size(); + + // Avoid the costly system call unless necessary + if (0 == str_len) + return NUTS_OK; + + ssize_t write_cnt = sktwrite(m_impl, str.data(), str_len); + + // TODO: Under certain circumstances, less than the whole + // string might be written + // Review the code if async. I/O is supported (in which case + // the function shall have to implement the blocking using + // select/poll/epoll on its own (probably select for portability) + + assert(write_cnt > 0); + + if (static_cast(write_cnt) == str_len) + return NUTS_OK; + + // TODO: At least logging of the error (errno), if not propagation + + return NUTS_ERROR; +} + +} // end of namespace nut diff --git a/common/nutwriter.cpp b/common/nutwriter.cpp new file mode 100644 index 0000000000..8cc232bcdc --- /dev/null +++ b/common/nutwriter.cpp @@ -0,0 +1,755 @@ +/* + nutwriter.cpp - NUT writer + + Copyright (C) + 2012 Vaclav Krpec + + 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 "nutwriter.hpp" + +#include +#include +#include +#include +#include +#include + + +/** + * \brief NUT configuration directive generator + * + * The macro is used to simplify generation of + * NUT config. directives. + * + * IMPORTANT NOTE: + * In case of writing error, the macro causes immediate + * return from the calling function (propagating the writing status). + * + * \param name Directive name + * \param arg_t Directive argument implementation type + * \param arg Directive argument + * \param quote_arg Boolean flag; check to quote the argument + */ +#define CONFIG_DIRECTIVEX(name, arg_t, arg, quote_arg) \ + do { \ + if ((arg).set()) { \ + const arg_t & arg_val = (arg); \ + std::stringstream ss; \ + ss << name << ' '; \ + if (quote_arg) \ + ss << '"'; \ + ss << arg_val; \ + if (quote_arg) \ + ss << '"'; \ + status_t status = writeDirective(ss.str()); \ + if (NUTW_OK != status) \ + return status; \ + } \ + } while (0) + + +namespace nut { + + +/* Trivial implementations out of class declaration to avoid + * error: 'ClassName' has no out-of-line virtual method definitions; its vtable + * will be emitted in every translation unit [-Werror,-Wweak-vtables] + */ +NutConfigWriter::~NutConfigWriter() {} +NutConfConfigWriter::~NutConfConfigWriter() {} +UpsmonConfigWriter::~UpsmonConfigWriter() {} +UpsdConfigWriter::~UpsdConfigWriter() {} + +// End-of-Line separators (arch. dependent) + +/** UNIX style EoL */ +static const std::string LF("\n"); + +// TODO: Make a compile-time selection +#if (0) +// M$ Windows EoL +static const std::string CRLF("\r\n"); + +// Apple MAC EoL +static const std::string CR("\r"); +#endif // end of #if (0) + + +const std::string & NutWriter::eol(LF); + +const std::string GenericConfigWriter::s_default_section_entry_indent("\t"); +const std::string GenericConfigWriter::s_default_section_entry_separator(" = "); + + +NutWriter::status_t NutWriter::writeEachLine(const std::string & str, const std::string & pref) { + for (size_t pos = 0; pos < str.size(); ) { + // Prefix every line + status_t status = write(pref); + + if (NUTW_OK != status) + return status; + + // Write up to the next EoL (or till the end) + size_t eol_pos = str.find(eol, pos); + + if (str.npos == eol_pos) + return write(str.substr(pos) + eol); + + eol_pos += eol.size(); + + status = write(str.substr(pos, eol_pos)); + + if (NUTW_OK != status) + return status; + + // Update position + pos = eol_pos; + } + + return NUTW_OK; +} + + +NutWriter::status_t SectionlessConfigWriter::writeDirective(const std::string & str) { + return write(str + eol); +} + + +NutWriter::status_t SectionlessConfigWriter::writeComment(const std::string & str) { + return writeEachLine(str, "# "); +} + + +NutWriter::status_t SectionlessConfigWriter::writeSectionName(const std::string & name) { + std::string e("INTERNAL ERROR: Attempt to write section name "); + e += name + " to a section-less configuration file"; + + throw std::logic_error(e); +} + + +NutWriter::status_t NutConfConfigWriter::writeConfig(const NutConfiguration & config) { + status_t status; + + // Mode + // TBD: How should I serialize an unknown mode? + if (config.mode.set()) { + std::string mode_str; + + NutConfiguration::NutMode mode = config.mode; + + switch (mode) { + case NutConfiguration::MODE_UNKNOWN: + // BEWARE! Intentional fall-through to MODE_NONE branch + + case NutConfiguration::MODE_NONE: + mode_str = "none"; + break; + + case NutConfiguration::MODE_STANDALONE: + mode_str = "standalone"; + break; + + case NutConfiguration::MODE_NETSERVER: + mode_str = "netserver"; + break; + + case NutConfiguration::MODE_NETCLIENT: + mode_str = "netclient"; + break; + + case NutConfiguration::MODE_CONTROLLED: + mode_str = "controlled"; + break; + + case NutConfiguration::MODE_MANUAL: + mode_str = "manual"; + break; + } + + status = writeDirective("MODE=" + mode_str); + + if (NUTW_OK != status) + return status; + } + + return NUTW_OK; +} + + +/** Notify types & flags strings */ +struct NotifyFlagsStrings { + // TBD: Shouldn't this mapping be shared with the parser? + // This is an obvious redundancy... + + /** Notify type strings list */ + typedef const char * TypeStrings[UpsmonConfiguration::NOTIFY_TYPE_MAX]; + + /** Notify flag strings map */ + typedef std::map FlagStrings; + + /** Notify type strings */ + static const TypeStrings type_str; + + /** Notify flag strings */ + static const FlagStrings flag_str; + + /** + * \brief Initialize notify flag strings + * + * \return Notify flag strings map + */ + static FlagStrings initFlagStrings() { + FlagStrings str; + + str[UpsmonConfiguration::NOTIFY_IGNORE] = "IGNORE"; + str[UpsmonConfiguration::NOTIFY_SYSLOG] = "SYSLOG"; + str[UpsmonConfiguration::NOTIFY_WALL] = "WALL"; + str[UpsmonConfiguration::NOTIFY_EXEC] = "EXEC"; + + return str; + } + +}; // end of struct NotifyFlagsStrings + + +const NotifyFlagsStrings::TypeStrings NotifyFlagsStrings::type_str = { + "ONLINE", // NOTIFY_ONLINE + "ONBATT", // NOTIFY_ONBATT + "LOWBATT", // NOTIFY_LOWBATT + "FSD\t", // NOTIFY_FSD (including padding) + "COMMOK", // NOTIFY_COMMOK + "COMMBAD", // NOTIFY_COMMBAD + "SHUTDOWN", // NOTIFY_SHUTDOWN + "REPLBATT", // NOTIFY_REPLBATT + "NOCOMM", // NOTIFY_NOCOMM + "NOPARENT", // NOTIFY_NOPARENT +}; + + +const NotifyFlagsStrings::FlagStrings NotifyFlagsStrings::flag_str = + NotifyFlagsStrings::initFlagStrings(); + + +/** + * \brief upsmon notify flags serializer + * + * \param type Notification type + * \param flags Notification flags + * + * \return NOTIFYFLAG directive string + */ +static std::string serializeNotifyFlags(UpsmonConfiguration::NotifyType type, unsigned int flags) { + static const NotifyFlagsStrings::FlagStrings::const_iterator ignore_str_iter = + NotifyFlagsStrings::flag_str.find(UpsmonConfiguration::NOTIFY_IGNORE); + + static const std::string ignore_str(ignore_str_iter->second); + + assert(type < UpsmonConfiguration::NOTIFY_TYPE_MAX); + + std::string directive("NOTIFYFLAG "); + + directive += NotifyFlagsStrings::type_str[type]; + + char separator = '\t'; + + // The IGNORE flag is actually no-flag case + if (UpsmonConfiguration::NOTIFY_IGNORE == flags) { + directive += separator; + directive += ignore_str; + + return directive; + } + + NotifyFlagsStrings::FlagStrings::const_iterator fl_iter = + NotifyFlagsStrings::flag_str.begin(); + + for (; fl_iter != NotifyFlagsStrings::flag_str.end(); ++fl_iter) { + if (fl_iter->first & flags) { + directive += separator; + directive += fl_iter->second; + + separator = '+'; + } + } + + return directive; +} + + +/** + * \brief upsmon notify messages serializer + * + * \param type Notification type + * \param msg Notification message + * + * \return NOTIFYMSG directive string + */ +static std::string serializeNotifyMessage(UpsmonConfiguration::NotifyType type, const std::string & msg) { + assert(type < UpsmonConfiguration::NOTIFY_TYPE_MAX); + + std::string directive("NOTIFYMSG "); + + directive += NotifyFlagsStrings::type_str[type]; + directive += '\t'; + directive += '"' + msg + '"'; + + return directive; +} + + +/** + * \brief Get notify type successor + * + * TBD: Should be in nutconf.hpp + * + * \param type Notify type + * + * \return Notify type successor + */ +inline static UpsmonConfiguration::NotifyType nextNotifyType(UpsmonConfiguration::NotifyType type) { + assert(type < UpsmonConfiguration::NOTIFY_TYPE_MAX); + + int type_ord = static_cast(type); + + return static_cast(type_ord + 1); +} + + +/** + * \brief Notify type pre-increment + * + * TBD: Should be in nutconf.hpp + * + * \param[in,out] type Notify type + * + * \return \c type successor + */ +inline static UpsmonConfiguration::NotifyType operator ++(UpsmonConfiguration::NotifyType & type) { + return type = nextNotifyType(type); +} + + +/** + * \brief Notify type post-increment + * + * TBD: Should be in nutconf.hpp + * + * \param[in,out] type Notify type + * + * \return \c type + */ +/* // CURRENTLY UNUSED +inline static UpsmonConfiguration::NotifyType operator ++(UpsmonConfiguration::NotifyType & type, int) { + UpsmonConfiguration::NotifyType type_copy = type; + + type = nextNotifyType(type); + + return type_copy; +} +*/ + +/** + * \brief UPS monitor definition serializer + * + * \param monitor Monitor + * + * \return Monitor config. directive + */ +static std::string serializeMonitor(const UpsmonConfiguration::Monitor & monitor) { + std::stringstream directive; + + directive << "MONITOR "; + + // System + directive << monitor.upsname << '@' << monitor.hostname; + + if (monitor.port) + directive << ':' << monitor.port; + + directive << ' '; + + // Power value + directive << monitor.powerValue << ' '; + + // Username & password + directive << monitor.username << ' ' << monitor.password << ' '; + + // Master/slave + directive << (monitor.isMaster ? "master" : "slave"); + + return directive.str(); +} + + +NutWriter::status_t UpsmonConfigWriter::writeConfig(const UpsmonConfiguration & config) { + /** + * \brief upsmon directive generator + * + * The macro is locally used to simplify generation of + * upsmon config. directives (except those with enumerated + * arguments). + * + * NOTE that the macro may cause return from the function + * (upon writing error). + * See \ref CONFIG_DIRECTIVEX for more information. + * + * \param name Directive name + * \param arg_t Directive argument implementation type + * \param arg Directive argument + * \param quote_arg Boolean flag; check to quote the argument + */ + #define UPSMON_DIRECTIVEX(name, arg_t, arg, quote_arg) \ + CONFIG_DIRECTIVEX(name, arg_t, arg, quote_arg) + +/* The "false" arg in macro below evaluates to `if (false) ...` after + * pre-processing, and causes warnings about unreachable code */ +#if (defined HAVE_PRAGMA_GCC_DIAGNOSTIC_PUSH_POP) && (defined HAVE_PRAGMA_GCC_DIAGNOSTIC_IGNORED_UNREACHABLE_CODE) +# pragma GCC diagnostic push +#endif +#ifdef HAVE_PRAGMA_GCC_DIAGNOSTIC_IGNORED_UNREACHABLE_CODE +# pragma GCC diagnostic ignored "-Wunreachable-code" +#endif +/* Older CLANG (e.g. clang-3.4) seems to not support the GCC pragmas above */ +#ifdef __clang__ +# pragma clang diagnostic push +# pragma clang diagnostic ignored "-Wunreachable-code" +#endif + UPSMON_DIRECTIVEX("RUN_AS_USER", std::string, config.runAsUser, false); + UPSMON_DIRECTIVEX("SHUTDOWNCMD", std::string, config.shutdownCmd, true); + UPSMON_DIRECTIVEX("NOTIFYCMD", std::string, config.notifyCmd, true); + UPSMON_DIRECTIVEX("POWERDOWNFLAG", std::string, config.powerDownFlag, false); + UPSMON_DIRECTIVEX("MINSUPPLIES", unsigned int, config.minSupplies, false); + UPSMON_DIRECTIVEX("POLLFREQ", unsigned int, config.poolFreq, false); + UPSMON_DIRECTIVEX("POLLFREQALERT", unsigned int, config.poolFreqAlert, false); + UPSMON_DIRECTIVEX("HOSTSYNC", unsigned int, config.hotSync, false); + UPSMON_DIRECTIVEX("DEADTIME", unsigned int, config.deadTime, false); + UPSMON_DIRECTIVEX("RBWARNTIME", unsigned int, config.rbWarnTime, false); + UPSMON_DIRECTIVEX("NOCOMMWARNTIME", unsigned int, config.noCommWarnTime, false); + UPSMON_DIRECTIVEX("FINALDELAY", unsigned int, config.finalDelay, false); +#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 + + #undef UPSMON_DIRECTIVEX + + UpsmonConfiguration::NotifyType type; + + // Notify flags + type = UpsmonConfiguration::NOTIFY_ONLINE; + + for (; type < UpsmonConfiguration::NOTIFY_TYPE_MAX; ++type) { + if (config.notifyFlags[type].set()) { + std::string directive = serializeNotifyFlags(type, config.notifyFlags[type]); + + status_t status = writeDirective(directive); + + if (NUTW_OK != status) + return status; + } + } + + // Notify messages + type = UpsmonConfiguration::NOTIFY_ONLINE; + + for (; type < UpsmonConfiguration::NOTIFY_TYPE_MAX; ++type) { + if (config.notifyMessages[type].set()) { + std::string directive = serializeNotifyMessage(type, config.notifyMessages[type]); + + status_t status = writeDirective(directive); + + if (NUTW_OK != status) + return status; + } + } + + // Monitors + std::list::const_iterator mon_iter = config.monitors.begin(); + + for (; mon_iter != config.monitors.end(); ++mon_iter) { + std::string directive = serializeMonitor(*mon_iter); + + status_t status = writeDirective(directive); + + if (NUTW_OK != status) + return status; + } + + return NUTW_OK; +} + + +/** + * \brief upsd listen address serializer + * + * \param address Listen address + * + * \return Serialized listen address + */ +static std::string serializeUpsdListenAddress(const UpsdConfiguration::Listen & address) { + std::stringstream directive; + + directive << "LISTEN " << address.address; + + if (address.port.set()) + directive << ' ' << static_cast(address.port); + + return directive.str(); +} + + +NutWriter::status_t UpsdConfigWriter::writeConfig(const UpsdConfiguration & config) { + /** + * \brief upsd directive generator + * + * The macro is locally used to simplify generation of + * upsd config. directives (except the listen addresses). + * + * NOTE that the macro may cause return from the function + * (upon writing error). + * See \ref CONFIG_DIRECTIVEX for more information. + * + * \param name Directive name + * \param arg_t Directive argument implementation type + * \param arg Directive argument + */ + #define UPSD_DIRECTIVEX(name, arg_t, arg) \ + CONFIG_DIRECTIVEX(name, arg_t, arg, false) + +/* The "false" arg in macro below evaluates to `if (false) ...` after + * pre-processing, and causes warnings about unreachable code */ +#if (defined HAVE_PRAGMA_GCC_DIAGNOSTIC_PUSH_POP) && (defined HAVE_PRAGMA_GCC_DIAGNOSTIC_IGNORED_UNREACHABLE_CODE) +# pragma GCC diagnostic push +#endif +#ifdef HAVE_PRAGMA_GCC_DIAGNOSTIC_IGNORED_UNREACHABLE_CODE +# pragma GCC diagnostic ignored "-Wunreachable-code" +#endif +/* Older CLANG (e.g. clang-3.4) seems to not support the GCC pragmas above */ +#ifdef __clang__ +# pragma clang diagnostic push +# pragma clang diagnostic ignored "-Wunreachable-code" +#endif + UPSD_DIRECTIVEX("MAXAGE", unsigned int, config.maxAge); + UPSD_DIRECTIVEX("MAXCONN", unsigned int, config.maxConn); + UPSD_DIRECTIVEX("STATEPATH", std::string, config.statePath); + UPSD_DIRECTIVEX("CERTFILE", std::string, config.certFile); +#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 + + #undef UPSD_DIRECTIVEX + + // Listen addresses + std::list::const_iterator la_iter = config.listens.begin(); + + for (; la_iter != config.listens.end(); ++la_iter) { + std::string directive = serializeUpsdListenAddress(*la_iter); + + status_t status = writeDirective(directive); + + if (NUTW_OK != status) + return status; + } + + return NUTW_OK; +} + + +NutWriter::status_t DefaultConfigWriter::writeComment(const std::string & str) { + return writeEachLine(str, "# "); +} + + +NutWriter::status_t DefaultConfigWriter::writeSectionName(const std::string & name) { + std::string section_line("["); + section_line += name + "]" + eol; + + return write(section_line); +} + + +NutWriter::status_t DefaultConfigWriter::writeDirective(const std::string & str) { + return write(str + eol); +} + + +/** + * \brief Value quoting and escaping + * + * The function checks whether the value string contains + * any spaces and/or '=' characters. + * If so, the result is double-quoted and all inner double + * quotes shall be escaped using backslash. + * + * \param val Value string + * + * \return Value string ready for serialization + */ +static std::string encodeValue(const std::string & val) { + // Check the string for spaces and '=' + bool quote = false; + + for (size_t i = 0; i < val.size() && !quote; ++i) { + char ch = val[i]; + + quote = ' ' == ch || '=' == ch || ':' == ch; + } + + if (!quote) + return val; + + // Quote value and escape inner quotes + std::string qval; + + qval += '"'; + + for (size_t i = 0; i < val.size(); ++i) { + char ch = val[i]; + + if ('"' == ch) + qval += '\\'; + + qval += ch; + } + + qval += '"'; + + return qval; +} + + +NutWriter::status_t GenericConfigWriter::writeSectionEntry( + const GenericConfigSectionEntry & entry, + const std::string & indent, + const std::string & kv_sep) +{ + ConfigParamList::const_iterator value_iter = entry.values.begin(); + + for (; value_iter != entry.values.end(); ++value_iter) { + std::string value = encodeValue(*value_iter); + + status_t status = writeDirective(indent + entry.name + kv_sep + value); + + if (NUTW_OK != status) + return status; + } + + return NUTW_OK; +} + + +NutWriter::status_t GenericConfigWriter::writeSection(const GenericConfigSection & section) { + status_t status; + + // Note that global scope definitions are in section + // with an empty name + // The section name won't be written and the assignments + // won't be indented + std::string indent; + + if (!section.name.empty()) { + status = writeSectionName(section.name); + + if (NUTW_OK != status) + return status; + + indent += "\t"; + } + + // Write section name/value pairs + GenericConfigSection::EntryMap::const_iterator entry_iter = section.entries.begin(); + + for (; entry_iter != section.entries.end(); ++entry_iter) { + status = writeSectionEntry(entry_iter->second, indent); + + if (NUTW_OK != status) + return status; + } + + return NUTW_OK; +} + + +NutWriter::status_t GenericConfigWriter::writeConfig(const GenericConfiguration & config) { + // Write sections + // Note that lexicographic ordering places the global + // (i.e. empty-name) section as the first one + GenericConfiguration::SectionMap::const_iterator section_iter = config.sections.begin(); + + for (; section_iter != config.sections.end(); ++section_iter) { + status_t status = writeSection(section_iter->second); + + if (NUTW_OK != status) + return status; + + // TBD: Write one empty line as section separator + status = write(eol); + + if (NUTW_OK != status) + return status; + } + + return NUTW_OK; +} + + +NutWriter::status_t UpsdUsersConfigWriter::writeSection(const GenericConfigSection & section) { + static const std::string upsmon_entry_separator(" "); + + status_t status; + + // upsmon section requires special handling because of the upsmon (master|slave) directive + if ("upsmon" != section.name) + return GenericConfigWriter::writeSection(section); + + status = writeSectionName(section.name); + + if (NUTW_OK != status) + return status; + + // Write section name/value pairs + GenericConfigSection::EntryMap::const_iterator entry_iter = section.entries.begin(); + + for (; entry_iter != section.entries.end(); ++entry_iter) { + // Special case of upsmon parameter + if ("upsmon" == entry_iter->second.name) { + status = writeSectionEntry(entry_iter->second, + s_default_section_entry_indent, + upsmon_entry_separator); + } + + // Standard entry serialization + else { + status = writeSectionEntry(entry_iter->second); + } + + if (NUTW_OK != status) + return status; + } + + return NUTW_OK; +} + +} // end of namespace nut diff --git a/common/strptime.c b/common/strptime.c index ab7a44aa4f..8909aea6cf 100644 --- a/common/strptime.c +++ b/common/strptime.c @@ -32,6 +32,10 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ + +/* Use NUT build configuration */ +#include "config.h" + /* #include #if defined(LIBC_SCCS) && !defined(lint) @@ -77,13 +81,13 @@ static char gmt[] = { "GMT" }; static char utc[] = { "UTC" }; /* RFC-822/RFC-2822 */ static const char * const nast[5] = { - "EST", "CST", "MST", "PST", "\0\0\0" + "EST", "CST", "MST", "PST", "\0\0\0" }; static const char * const nadt[5] = { - "EDT", "CDT", "MDT", "PDT", "\0\0\0" + "EDT", "CDT", "MDT", "PDT", "\0\0\0" }; static const char * const am_pm[2] = { - "am", "pm" + "am", "pm" }; static const char * const day[7] = { "sunday", "monday", "tuesday", "wednesday", "thursday", "friday", "saturday" @@ -107,7 +111,7 @@ static const u_char *find_string(const u_char *, int *, const char * const *, static int strncasecmp(const char *a, const char *b, size_t c) { - return _strnicmp(a, b, c); + return _strnicmp(a, b, c); } #endif */ @@ -163,11 +167,11 @@ again: switch (c = *fmt++) { /* * "Complex" conversion rules, implemented through recursion. */ - /* we do not need 'c' - case 'c': Date and time, using the locale's format. +/* // we do not need 'c': + case 'c': Date and time, using the locale's format. new_fmt = _ctloc(d_t_fmt); goto recurse; - */ +*/ case 'D': /* The date as "%m/%d/%y". */ new_fmt = "%m/%d/%y"; @@ -185,7 +189,7 @@ again: switch (c = *fmt++) { goto recurse; case 'r': /* The time in 12-hour clock representation. */ - new_fmt = "%I:%M:S %p";//_ctloc(t_fmt_ampm); + new_fmt = "%I:%M:S %p";/*_ctloc(t_fmt_ampm); */ LEGAL_ALT(0); goto recurse; @@ -194,18 +198,20 @@ again: switch (c = *fmt++) { LEGAL_ALT(0); goto recurse; - /* we don't use 'X' - case 'X': The time, using the locale's format. +/* // we don't use 'X' + case 'X': The time, using the locale's format. new_fmt =_ctloc(t_fmt); goto recurse; - */ +*/ + +/* // we do not need 'x' + case 'x': The date, using the locale's format. + new_fmt =_ctloc(d_fmt); +*/ - /* we do not need 'x' - case 'x': The date, using the locale's format. - new_fmt =_ctloc(d_fmt);*/ recurse: bp = (const u_char *)strptime((const char *)bp, - new_fmt, tm); + new_fmt, tm); LEGAL_ALT(ALT_E); continue; @@ -319,7 +325,7 @@ again: switch (c = *fmt++) { } tm = localtime(&sse); - if (tm == NULL) + if (tm == NULL) bp = NULL; } continue; @@ -356,9 +362,9 @@ again: switch (c = *fmt++) { case 'G': /* The year corresponding to the ISO week * number with century. */ - do + do { bp++; - while (isdigit(*bp)); + } while (isdigit(*bp)); continue; case 'V': /* The ISO 8601:1988 week number as decimal */ @@ -392,7 +398,8 @@ again: switch (c = *fmt++) { case 'Z': _tzset(); if (strncasecmp((const char *)bp, gmt, 3) == 0 - || strncasecmp((const char *)bp, utc, 3) == 0) { + || strncasecmp((const char *)bp, utc, 3) == 0 + ) { tm->tm_isdst = 0; #ifdef TM_GMTOFF tm->TM_GMTOFF = 0; @@ -403,8 +410,8 @@ again: switch (c = *fmt++) { bp += 3; } else { ep = find_string(bp, &i, - (const char * const *)tzname, - NULL, 2); + (const char * const *)tzname, + NULL, 2); if (ep != NULL) { tm->tm_isdst = i; #ifdef TM_GMTOFF @@ -490,12 +497,13 @@ again: switch (c = *fmt++) { } if ((*bp >= 'A' && *bp <= 'I') || - (*bp >= 'L' && *bp <= 'Y')) { + (*bp >= 'L' && *bp <= 'Y') + ) { #ifdef TM_GMTOFF /* Argh! No 'J'! */ if (*bp >= 'A' && *bp <= 'I') tm->TM_GMTOFF = - ('A' - 1) - (int)*bp; + ('A' - 1) - (int)*bp; else if (*bp >= 'L' && *bp <= 'M') tm->TM_GMTOFF = 'A' - (int)*bp; else if (*bp >= 'N' && *bp <= 'Y') diff --git a/conf/Makefile.am b/conf/Makefile.am index 8adf280071..873d288324 100644 --- a/conf/Makefile.am +++ b/conf/Makefile.am @@ -19,22 +19,25 @@ nodist_sysconf_DATA = upssched.conf.sample upsmon.conf.sample SPELLCHECK_SRC = $(dist_sysconf_DATA) \ upssched.conf.sample.in upsmon.conf.sample.in -# NOTE: Due to portability, we do not use a GNU percent-wildcard extension: +# NOTE: Due to portability, we do not use a GNU percent-wildcard extension. +# We also have to export some variables that may be tainted by relative +# paths when parsing the other makefile (e.g. MKDIR_P that may be defined +# via expanded $(top_builddir)/install_sh): #%-spellchecked: % Makefile.am $(top_srcdir)/docs/Makefile.am $(abs_srcdir)/$(NUT_SPELL_DICT) -# $(MAKE) -s -f $(top_builddir)/docs/Makefile SPELLCHECK_SRC_ONE="$<" SPELLCHECK_SRCDIR="$(srcdir)" SPELLCHECK_BUILDDIR="$(builddir)" $@ +# +$(MAKE) -s -f $(top_builddir)/docs/Makefile $(AM_MAKEFLAGS) MKDIR_P="$(MKDIR_P)" builddir="$(builddir)" srcdir="$(srcdir)" top_builddir="$(top_builddir)" top_srcdir="$(top_srcdir)" SPELLCHECK_SRC_ONE="$<" SPELLCHECK_SRCDIR="$(srcdir)" SPELLCHECK_BUILDDIR="$(builddir)" $@ # NOTE: Portable suffix rules do not allow prerequisites, so we shim them here # by a wildcard target in case the make implementation can put the two together. *-spellchecked: Makefile.am $(top_srcdir)/docs/Makefile.am $(abs_srcdir)/$(NUT_SPELL_DICT) .sample.sample-spellchecked: - $(MAKE) -s -f $(top_builddir)/docs/Makefile SPELLCHECK_SRC_ONE="$<" SPELLCHECK_SRCDIR="$(srcdir)" SPELLCHECK_BUILDDIR="$(builddir)" $@ + +$(MAKE) -s -f $(top_builddir)/docs/Makefile $(AM_MAKEFLAGS) MKDIR_P="$(MKDIR_P)" builddir="$(builddir)" srcdir="$(srcdir)" top_builddir="$(top_builddir)" top_srcdir="$(top_srcdir)" SPELLCHECK_SRC_ONE="$<" SPELLCHECK_SRCDIR="$(srcdir)" SPELLCHECK_BUILDDIR="$(builddir)" $@ .in.in-spellchecked: - $(MAKE) -s -f $(top_builddir)/docs/Makefile SPELLCHECK_SRC_ONE="$<" SPELLCHECK_SRCDIR="$(srcdir)" SPELLCHECK_BUILDDIR="$(builddir)" $@ + +$(MAKE) -s -f $(top_builddir)/docs/Makefile $(AM_MAKEFLAGS) MKDIR_P="$(MKDIR_P)" builddir="$(builddir)" srcdir="$(srcdir)" top_builddir="$(top_builddir)" top_srcdir="$(top_srcdir)" SPELLCHECK_SRC_ONE="$<" SPELLCHECK_SRCDIR="$(srcdir)" SPELLCHECK_BUILDDIR="$(builddir)" $@ spellcheck spellcheck-interactive spellcheck-sortdict: - $(MAKE) -f $(top_builddir)/docs/Makefile SPELLCHECK_SRC="$(SPELLCHECK_SRC)" SPELLCHECK_SRCDIR="$(srcdir)" SPELLCHECK_BUILDDIR="$(builddir)" $@ + +$(MAKE) -f $(top_builddir)/docs/Makefile $(AM_MAKEFLAGS) MKDIR_P="$(MKDIR_P)" builddir="$(builddir)" srcdir="$(srcdir)" top_builddir="$(top_builddir)" top_srcdir="$(top_srcdir)" SPELLCHECK_SRC="$(SPELLCHECK_SRC)" SPELLCHECK_SRCDIR="$(srcdir)" SPELLCHECK_BUILDDIR="$(builddir)" $@ MAINTAINERCLEANFILES = Makefile.in .dirstamp diff --git a/conf/nut.conf.sample b/conf/nut.conf.sample index 4cd84dd054..71d5465d92 100644 --- a/conf/nut.conf.sample +++ b/conf/nut.conf.sample @@ -43,15 +43,25 @@ MODE=none -# Uncomment this to allow starting the service even if `ups.conf` has no device -# sections configured at the moment. This environment variable overrides the -# built-in "false" flag in `upsd`, and an optional same-named default flag that -# can be set in `upsd.conf`. If you want a data server always running, even if -# it initially has nothing to serve (may be live-reloaded later, when devices -# become configured), this option is for you. +# Uncomment this to allow starting the `upsd` data server even if `ups.conf` +# has no device sections configured at the moment. This environment variable +# overrides the built-in "false" flag in `upsd`, and an optional same-named +# default flag that can be set in `upsd.conf`. If you want a data server always +# running, even if it initially has nothing to serve (may be live-reloaded +# later, when devices become configured), this option is for you. #ALLOW_NO_DEVICE=true #export ALLOW_NO_DEVICE +# Uncomment this to allow starting the `upsd` data server even if not all +# `LISTEN` directives can be honoured at the moment. This environment variable +# overrides the built-in "false" flag in `upsd`, and an optional same-named +# default flag that can be set in `upsd.conf`. If you want a data server always +# running, even if it would potentially not serve all clients on every uptime, +# this option is for you (note you would have to restart `upsd` to pick up the +# `LISTEN`ed IP address if it appears later). Probably `LISTEN *` is better. +#ALLOW_NOT_ALL_LISTENERS=true +#export ALLOW_NOT_ALL_LISTENERS + # The optional 'UPSD_OPTIONS' allow to set upsd specific command-line options. # It is ignored when 'MODE' above indicates that no upsd should be running. # It may be redundant in comparison to options which can be set in `upsd.conf`. diff --git a/conf/ups.conf.sample b/conf/ups.conf.sample index dba6d92fbf..3a37f82ad4 100644 --- a/conf/ups.conf.sample +++ b/conf/ups.conf.sample @@ -88,6 +88,16 @@ maxretry = 3 # upsdrvctl will wait for the driver to finish starting. # This keeps your system from getting stuck due to a # broken driver or UPS. +# Note that after this time upsdrvctl would just move +# along with its business (whether retrying the same +# driver if `maxretry>1`, or trying another driver if +# starting them all, or just eventually exit); however, +# each such most recently started "stuck" driver process +# may be further initializing in the background, and +# might even succeed eventually. +# They would not be actively killed by upsdrvctl after +# this timeout expires. +# # The default is 45 seconds. # # debug_min: OPTIONAL. Specify a minimum debug level for all driver daemons diff --git a/conf/upsd.conf.sample b/conf/upsd.conf.sample index 277e58417f..dfbdf9e5ba 100644 --- a/conf/upsd.conf.sample +++ b/conf/upsd.conf.sample @@ -44,6 +44,25 @@ # Boolean values 'false', 'no', 'off' and '0' mean that the server should refuse # to start if zero device sections were found in ups.conf. This is the default. +# ======================================================================= +# ALLOW_NOT_ALL_LISTENERS +# ALLOW_NOT_ALL_LISTENERS true +# +# Normally upsd requires that all `LISTEN` directives can be honoured at the +# moment the daemon starts. If your LAN IP address (or host name) used in one +# of the `LISTEN` directives may be not always accessible, and for some reason +# do not want to just `LISTEN *` on the wildcard interface, but e.g. you still +# want to use `upsmon` on `localhost`, this option can help. Note you would +# have to restart `upsd` to pick up the `LISTEN`ed IP address if it appears +# later. +# +# Boolean values 'true', 'yes', 'on' and '1' mean that the server would not +# refuse to start if it can listen on at least one interface. +# +# Boolean values 'false', 'no', 'off' and '0' mean that the server should +# refuse to start if it can not LISTEN on each and every (non-localhost) +# interface found in upsd.conf. This is the default. + # ======================================================================= # STATEPATH # STATEPATH /var/run/nut diff --git a/conf/upsmon.conf.sample.in b/conf/upsmon.conf.sample.in index e26b487c91..bcda24a549 100644 --- a/conf/upsmon.conf.sample.in +++ b/conf/upsmon.conf.sample.in @@ -159,6 +159,39 @@ MINSUPPLIES 1 SHUTDOWNCMD "/sbin/shutdown -h +0" +# -------------------------------------------------------------------------- +# SHUTDOWNEXIT +# +# After initiating shutdown, should this upsmon daemon itself exit? +# By doing so NUT secondary systems can tell the NUT primary that +# it can proceed with its own shutdown and eventually tell the UPS +# to cut power for the load. ("Yes" by default) +# +# Some "secondary" systems with workloads that take considerable time +# to stop (e.g. virtual machines or large databases) can benefit from +# reporting (by virtue of logging off the data server) that they are +# ready for the "primary" system to begin its own shutdown and eventually +# to tell the UPS to cut the power - not as soon as they have triggered +# their own shutdown, but at a later point (e.g. when the upsmon service +# is stopped AFTER the heavier workloads). +# +# Note that the actual ability to complete such shutdown depends on the +# remaining battery run-time at the moment when UPS power state becomes +# considered critical and the shutdowns begin. You may also have to tune +# HOSTSYNC on the NUT primary to be long enough for those secondaries to +# stop their services. In practice, it may be worthwhile to investigate +# ways to trigger shutdowns earlier on these systems, e.g. by setting up +# `upssched` integration, or `dummy-ups` driver with overrides for stricter +# `battery.charge` or `battery.runtime` triggers than used by the rest of +# your servers. +# +# This option supports Boolean-style strings (yes/on/true or no/off/false) +# or numbers to define a delay (in seconds) between calling SHUTDOWNCMD +# and exiting the daemon. Zero means immediate exit (default), negative +# values mean never exiting on its own accord. +# +#SHUTDOWNEXIT yes + # -------------------------------------------------------------------------- # NOTIFYCMD # @@ -281,6 +314,7 @@ POWERDOWNFLAG "@POWERDOWNFLAG@" # NOTIFYMSG NOCOMM "UPS %s is unavailable" # NOTIFYMSG NOPARENT "upsmon parent process died - shutdown impossible" # NOTIFYMSG CAL "UPS %s: calibration in progress" +# NOTIFYMSG NOTCAL "UPS %s: calibration finished" # NOTIFYMSG OFF "UPS %s: administratively OFF or asleep" # NOTIFYMSG NOTOFF "UPS %s: no longer administratively OFF or asleep" # NOTIFYMSG BYPASS "UPS %s: on bypass (powered, not protecting)" @@ -321,6 +355,12 @@ POWERDOWNFLAG "@POWERDOWNFLAG@" # NOTIFYFLAG REPLBATT SYSLOG+WALL # NOTIFYFLAG NOCOMM SYSLOG+WALL # NOTIFYFLAG NOPARENT SYSLOG+WALL +# NOTIFYFLAG CAL SYSLOG+WALL +# NOTIFYFLAG NOTCAL SYSLOG+WALL +# NOTIFYFLAG OFF SYSLOG+WALL +# NOTIFYFLAG NOTOFF SYSLOG+WALL +# NOTIFYFLAG BYPASS SYSLOG+WALL +# NOTIFYFLAG NOTBYPASS SYSLOG+WALL # # Possible values for the flags: # @@ -381,8 +421,11 @@ NOCOMMWARNTIME 300 # extended timeframe, you can use this throttle to reduce the stress on # syslog traffic and storage, by posting these messages only once in every # several loop cycles, and when the error condition has changed or cleared. -# A negative value means standard behavior, and a zero value means to never -# repeat the message (log only on start and end/change of the failure state). +# A negative value means standard behavior (log on every loop, same as when +# max=1), and a zero value means to never repeat the message (log only on +# start and end/change of the failure state). +# Note that this throttle only applies to one latest-active error state per +# monitored device. # #POLLFAIL_LOG_THROTTLE_MAX 100 diff --git a/configure.ac b/configure.ac index 102d03027e..640c715840 100644 --- a/configure.ac +++ b/configure.ac @@ -5,7 +5,7 @@ dnl +------------------------------------------------------------------+ dnl NUT version number is defined here, with a Git suffixed macro like dnl NUT_VERSION_MACRO "2.7.4-2838-gdfc3ac08" dnl in include/nut_version.h (generated by make) -AC_INIT([nut],[2.8.0.1],[https://github.com/networkupstools/nut/issues]) +AC_INIT([nut],[2.8.1.1],[https://github.com/networkupstools/nut/issues]) dnl See docs/maintainer-guide.txt about releases - updating the version dnl above is a small part of the consistent ritual! @@ -19,6 +19,9 @@ dnl (that one comes from the NUT_VERSION_MACRO from nut_version.h file). && 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 Gitrev-based build identifier which can be used for e.g. PyPI uploads: +NUT_SOURCE_GITREV_NUMERIC="`echo "${NUT_SOURCE_GITREV}" | sed -e 's/^v//' -e 's/-g.*$//' -e 's/-/./g'`" + dnl Note: except for experiments, do not pass this into config.h - use dnl the NUT_VERSION_MACRO from nut_version.h instead. Developers may dnl want to disable their "force-nut-version-header" configure option @@ -86,6 +89,32 @@ AC_CONFIG_HEADERS([include/config.h]) AC_PREFIX_DEFAULT(/usr/local/ups) AM_INIT_AUTOMAKE([subdir-objects]) +AS_CASE([${target_os}], + [*mingw*], [AS_CASE([${CFLAGS-}${CXXFLAGS-}], + [*"-std=c"*|*-ansi*], [ + AC_MSG_NOTICE( +[----------------------------------------------------------------------- +WARNING: It seems you are building with MinGW and requested a strict C/C++ +language mode. Per https://stackoverflow.com/a/76780217/4715872 MinGW may +not define WIN32 and other options needed for proper building and linking. +If this happens, please retry with GNU C/C++ language mode options instead. +-----------------------------------------------------------------------]) + sleep 5 + ])] +) + +dnl +------------------------------------------------------------------- +dnl Help avoid "polluting" CFLAGS etc. with auto-settings like "-g -O2" +dnl at least if we intend to tune --with-debuginfo anyway (where we check +dnl if the caller asked for specific optimizations). Following some +dnl experimentation, we do not want to actually mangle the flags provided +dnl by autoconf - for GCC at least, the rightmost mentions of conflicting +dnl flags on command line win. We just want to know when it is okay to add +dnl ours. They may be inherited from "in-place" build setup though. +test -n "${CONFIG_CFLAGS-}" || CONFIG_CFLAGS="${CFLAGS-}" +test -n "${CONFIG_CXXFLAGS-}" || CONFIG_CXXFLAGS="${CXXFLAGS-}" +dnl +------------------------------------------------------------------- + dnl Default to `configure --enable-silent-rules` or `make V=1` for details? dnl This feature seems to require automake-1.13 or newer (1.11+ by other info) dnl On very old systems can comment it away with little loss (then automake-1.10 @@ -93,25 +122,67 @@ dnl is known to suffice): m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])], [AC_MSG_NOTICE([Silent Rules feature not defined in this automake version, skipped])]) +dnl +------------------------------------------------------------------- dnl we need Autoconf 2.61 or better to enable features of Posix that are extensions to C dnl (and actually 2.64 or better for m4/ax_check_compile_flag.m4 when it is sourced) dnl UPDATE: As tested on CentOS 6, its "autoconf-2.63-5.1.el6.noarch" also suffices. dnl But OpenBSD 6.5 requires autoconf-2.65 and automake-1.13 or newer... +dnl AC_MSG_NOTICE([CFLAGS_BEFORE_ACPROG="${CFLAGS-}"]) +dnl AC_MSG_NOTICE([CXXFLAGS_BEFORE_ACPROG="${CXXFLAGS-}"]) AC_MSG_CHECKING(for autoconf macro to enable system extensions) m4_version_prereq(2.61, [ AC_MSG_RESULT(yes) + dnl Causes calls to ac_prog stuff, so dittoed below if "no" AC_USE_SYSTEM_EXTENSIONS ], [ AC_MSG_RESULT(no) + AC_PROG_CC ]) AC_PREREQ([2.63]) dnl #AC_PREREQ([2.64]) +dnl Macro AC_PROG_CC_C99 is obsolete; use AC_PROG_CC +dnl Note that NUT does not support building with C89 anyway +dnl AC_PROG_CC_C99 +dnl Needed for per-target flags +AM_PROG_CC_C_O +AC_PROG_CPP +AC_PROG_CXX +AC_PROG_CXX_C_O + +CFLAGS_AFTER_ACPROG="${CFLAGS-}" +CXXFLAGS_AFTER_ACPROG="${CXXFLAGS-}" + +dnl AC_MSG_NOTICE([CFLAGS_AFTER_ACPROG="${CFLAGS-}"]) +dnl AC_MSG_NOTICE([CXXFLAGS_AFTER_ACPROG="${CXXFLAGS-}"]) + +dnl # LEGACY DEFAULT FALLBACK which NUT had since 2005 or before: +dnl # if autoconf does not set any options, use default/moderate optimizations +CFLAGS=${CFLAGS-"-O"} +dnl # Not so far a legacy, added for consistency in 2024 :) +CXXFLAGS=${CXXFLAGS-"-O"} + +dnl +------------------------------------------------------------------- + dnl Use "./configure --enable-maintainer-mode" to keep Makefile.in and Makefile dnl in sync after Git updates. AM_MAINTAINER_MODE +dnl GNU and BSD make are okay with the syntax, but Sun make/dmake are not: +AC_MSG_CHECKING([whether this make implementation supports export VAR=VAL syntax]) +dnl # using printf formatting for some funniner shells out there +nut_am_output="`printf 'export VAR=VAL\ntest:\n\t@echo "VAR=%s%sVAR%s"\n' '\$' '(' ')' | ${MAKE-make} -f - test`" +nut_am_result="$?" +AS_IF([test x"${nut_am_result}" = x0 -a x"${nut_am_output}" = x"VAR=VAL"], [ + NUT_AM_MAKE_CAN_EXPORT="" + AC_MSG_RESULT(yes) +], [ + NUT_AM_MAKE_CAN_EXPORT="#ThisMakeCanNotExport# " + AC_MSG_RESULT(no: got '${nut_am_output}') +]) +AC_SUBST(NUT_AM_MAKE_CAN_EXPORT) + dnl Some systems have older autotools without direct macro support for PKG_CONF* NUT_CHECK_PKGCONFIG @@ -140,8 +211,6 @@ dnl Fix this early so we can expand with eval later test "${prefix}" = "NONE" && prefix="${ac_default_prefix}" test "${exec_prefix}" = "NONE" && exec_prefix='${prefix}' -CFLAGS=${CFLAGS-"-O"} - dnl Note: for practical and platform-independent use, see AX_REALPATH macro AC_CHECK_PROGS([REALPATH], [realpath], []) @@ -409,6 +478,21 @@ AS_IF([test x"$nut_enable_inplace_runtime" = xyes -a x"${NUT_VERSION_DEPLOYED-}" eval conftemp=\"${conftemp}\" LIBDIR="${conftemp}" + AS_CASE(["${CONFIG_FLAGS_DEPLOYED} ${CONFIG_FLAGS}"], + [*--libexecdir=*], [ + for F in ${CONFIG_FLAGS_DEPLOYED} ${CONFIG_FLAGS} ; do + case "$F" in + "--libexecdir="*) libexecdir="`echo "$F" | ( IFS='=' read K V ; echo "$V" )`" ;; + esac + done + ] + ) + + conftemp="${libexecdir}" + eval conftemp=\"${conftemp}\" + eval conftemp=\"${conftemp}\" + LIBEXECDIR="${conftemp}" + AS_CASE(["${CONFIG_FLAGS_DEPLOYED} ${CONFIG_FLAGS}"], [*--with-pkgconfig-dir=*], [ for F in ${CONFIG_FLAGS_DEPLOYED} ${CONFIG_FLAGS} ; do @@ -528,11 +612,21 @@ AS_IF([test x"$nut_enable_inplace_runtime" = xyes -a x"${NUT_VERSION_DEPLOYED-}" NUT_VERSION_DEPLOYED="" ]) export NUT_VERSION_DEPLOYED + dnl # Avoid replacement after re-entering: + test -n "${CONFIG_CFLAGS-}" || CONFIG_CFLAGS=" " + test -n "${CONFIG_CXXFLAGS-}" || CONFIG_CXXFLAGS=" " + export CONFIG_CFLAGS + export CONFIG_CXXFLAGS eval exec "$0" $CONFIG_FLAGS_DEPLOYED $CONFIG_FLAGS --disable-inplace-runtime ],[ AC_MSG_NOTICE([No CONFIG_FLAGS were reported or discovered from existing NUT deployment (if any); restarting script for a clean run]) NUT_VERSION_DEPLOYED="" export NUT_VERSION_DEPLOYED + dnl # Avoid replacement after re-entering: + test -n "${CONFIG_CFLAGS-}" || CONFIG_CFLAGS=" " + test -n "${CONFIG_CXXFLAGS-}" || CONFIG_CXXFLAGS=" " + export CONFIG_CFLAGS + export CONFIG_CXXFLAGS AC_MSG_NOTICE([exec "$0" $CONFIG_FLAGS --disable-inplace-runtime]) eval exec "$0" $CONFIG_FLAGS --disable-inplace-runtime ]) @@ -543,15 +637,6 @@ AC_CONFIG_LIBOBJ_DIR([common]) dnl +------------------------------------------------------------------- -dnl AC_PROG_CC -dnl Macro AC_PROG_CC_C99 is obsolete; use AC_PROG_CC -dnl Note that NUT does not support building with C89 anyway -dnl AC_PROG_CC_C99 -dnl Needed for per-target flags -AM_PROG_CC_C_O -AC_PROG_CPP -AC_PROG_CXX -AC_PROG_CXX_C_O AC_PROG_INSTALL AC_PROG_MKDIR_P AC_PROG_LN_S @@ -1046,7 +1131,6 @@ AC_CHECK_FUNCS(vsnprintf snprintf, [], [ AC_TYPE_LONG_LONG_INT ]) - AC_REPLACE_FUNCS(setenv strerror atexit) case ${target_os} in @@ -1504,7 +1588,7 @@ dnl check for --with-all (or --without-all, or --with-all=auto) flag AC_MSG_CHECKING(for --with-all) AC_ARG_WITH(all, - AS_HELP_STRING([--with-all], [enable serial, usb, snmp, neon, ipmi, powerman, modbus, gpio (currently on Linux released after ~2018), linux_i2c (on Linux), macosx-ups (on MacOS), cgi, dev, avahi, nut-scanner, pynut]), + AS_HELP_STRING([--with-all], [enable serial, usb, snmp, neon, ipmi, powerman, modbus, gpio (currently on Linux released after ~2018), linux_i2c (on Linux), macosx-ups (on MacOS), cgi, dev, avahi, nut-scanner, nutconf, pynut]), [ if test -n "${withval}"; then dnl Note: we allow "no" as a positive value, because @@ -1548,6 +1632,7 @@ AC_ARG_WITH(all, if test -z "${with_dev}"; then with_dev="${withval}"; fi if test -z "${with_avahi}"; then with_avahi="${withval}"; fi if test -z "${with_nut_scanner}"; then with_nut_scanner="${withval}"; fi + if test -z "${with_nutconf}"; then with_nutconf="${withval}"; fi if test -n "${PYTHON}${PYTHON2}${PYTHON3}" -a x"${withval}" = xyes \ || test x"${withval}" != xyes \ @@ -1563,7 +1648,7 @@ AC_ARG_WITH(all, dnl # if test -z "${with_nut_monitor}"; then with_nut_monitor="${withval}"; fi fi - AC_MSG_RESULT("${withval}") + AC_MSG_RESULT([${withval}]) else AC_MSG_RESULT(not given) fi @@ -1577,6 +1662,8 @@ dnl they are listed near the top by "./configure --help"; however, dnl note that options with further investigation methods are listed dnl a bit below to be grouped with their additional with/enable help. +NUT_ARG_WITH([nutconf], [build and install the nutconf tool (experimental, has compiler/coverage warnings)], [auto]) + NUT_ARG_WITH([dev], [build and install the development files], [no]) dnl Activate WITH_UNMAPPED_DATA_POINTS for troubleshooting and evolution? @@ -1607,6 +1694,9 @@ NUT_ARG_ENABLE([warnings], NUT_ARG_ENABLE([Werror], [fail the build if compiler emits any warnings (treat them as errors)], [no]) +NUT_ARG_WITH([debuginfo], + [enable compiler options for debug-friendly builds of all NUT binaries ("no" by default; "auto" means "yes unless CFLAGS say otherwise")], + [no]) dnl To help find warning/error details in a wall of text, see --enable-Wcolor handled above dnl ---------------------------------------------------------------------- @@ -1648,7 +1738,6 @@ dnl NUT_ARG_WITH([openipmi], [enable IPMI support using OpenIPMI], [auto]) dnl Platform-dependent drivers, currently their detection code is directly dnl spelled out in configure.ac NUT_ARG_WITH([macosx_ups], [build and install Mac OS X Power Sources meta-driver], [auto]) - NUT_ARG_WITH([linux_i2c], [build and install i2c drivers], [auto]) dnl A Python GUI client application for the sysadmin desktop @@ -2556,11 +2645,13 @@ dnl to detect if we can build the wanted documentation format and yet dnl not fail if we have no tools to generate it (so add to SKIP list). html-single*) - AC_MSG_CHECKING([if asciidoc version can build ${nut_doc_build_target_base} (minimum required ${ASCIIDOC_MIN_VERSION})]) + AC_MSG_CHECKING([if asciidoc and a2x versions can build ${nut_doc_build_target_base} (minimum required asciidoc-${ASCIIDOC_MIN_VERSION} a2x-${A2X_MIN_VERSION})]) can_build_doc_html_single=no AX_COMPARE_VERSION([${ASCIIDOC_VERSION}], [ge], [${ASCIIDOC_MIN_VERSION}], [ - ( cd "$DOCTESTDIR" && ${A2X} --attribute=xhtml11_format --format=xhtml --xsl-file="${abs_srcdir}"/docs/xhtml.xsl --destination-dir=. "${abs_srcdir}"/docs/asciidoc.txt && test -s asciidoc.html ) && can_build_doc_html_single=yes - rm -f "$DOCTESTDIR"/asciidoc*.htm* + AX_COMPARE_VERSION([${A2X_VERSION}], [ge], [${A2X_MIN_VERSION}], [ + ( cd "$DOCTESTDIR" && ${A2X} --attribute=xhtml11_format --format=xhtml --xsl-file="${abs_srcdir}"/docs/xhtml.xsl --destination-dir=. "${abs_srcdir}"/docs/asciidoc.txt && test -s asciidoc.html ) && can_build_doc_html_single=yes + rm -f "$DOCTESTDIR"/asciidoc*.htm* + ], []) ], []) if test "${can_build_doc_html_single}" = yes ; then AC_MSG_RESULT(yes) @@ -2577,11 +2668,13 @@ dnl not fail if we have no tools to generate it (so add to SKIP list). ;; html-chunked*) - AC_MSG_CHECKING([if a2x version can build ${nut_doc_build_target_base} (minimum required ${ASCIIDOC_MIN_VERSION})]) + AC_MSG_CHECKING([if asciidoc and a2x versions can build ${nut_doc_build_target_base} (minimum required asciidoc-${ASCIIDOC_MIN_VERSION} a2x-${A2X_MIN_VERSION})]) can_build_doc_html_chunked=no - AX_COMPARE_VERSION([${A2X_VERSION}], [ge], [${ASCIIDOC_MIN_VERSION}], [ - ( cd "$DOCTESTDIR" && ${A2X} --attribute=chunked_format --format=chunked --xsl-file="${abs_srcdir}"/docs/chunked.xsl --destination-dir=. "${abs_srcdir}"/docs/FAQ.txt && test -s FAQ.chunked/index.html ) && can_build_doc_html_chunked=yes - rm -rf "${DOCTESTDIR}"/FAQ*.chunked* + AX_COMPARE_VERSION([${ASCIIDOC_VERSION}], [ge], [${ASCIIDOC_MIN_VERSION}], [ + AX_COMPARE_VERSION([${A2X_VERSION}], [ge], [${A2X_MIN_VERSION}], [ + ( cd "$DOCTESTDIR" && ${A2X} --attribute=chunked_format --format=chunked --xsl-file="${abs_srcdir}"/docs/chunked.xsl --destination-dir=. "${abs_srcdir}"/docs/FAQ.txt && test -s FAQ.chunked/index.html ) && can_build_doc_html_chunked=yes + rm -rf "${DOCTESTDIR}"/FAQ*.chunked* + ], []) ], []) if test "${can_build_doc_html_chunked}" = yes ; then AC_MSG_RESULT(yes) @@ -2785,8 +2878,17 @@ if test "x$WINDMC" != "xnone" -a "x$WINDRES" != "xnone" ; then fi AM_CONDITIONAL([HAVE_MINGW_RESGEN], [test "${nut_have_mingw_resgen}" = "yes"]) -dnl Also define a generic AM_CONDITIONAL for general Windows compilation -AM_CONDITIONAL([HAVE_WINDOWS], [test "${nut_have_mingw_resgen}" = "yes"]) + +dnl Also define a generic automake condition for general Windows compilation: +dnl do we at least have the header file(s) we require for the platform +dnl (more files may be optional e.g. for different generations of networking) +dnl Could just use ..._COND_IF([HAVE_WINDOWS_H],... but it is not present in +dnl some older versions of autotools. (Note autoconf expands in comments too). +AS_IF([test "x$nut_cv_header_windows_h" = xyes], + [AM_CONDITIONAL([HAVE_WINDOWS], [test "${nut_have_mingw_resgen}" = "yes"])], + [AM_CONDITIONAL([HAVE_WINDOWS], [false])] + ) + dnl ---------------------------------------------------------------------- @@ -3114,7 +3216,6 @@ fi AC_MSG_RESULT([${solarispkg_svr4}]) AM_CONDITIONAL(WITH_SOLARIS_PKG_SVR4, test x"$solarispkg_svr4" = x"yes") - AC_MSG_CHECKING(whether to make Solaris IPS packages) solarispkg_ips="auto" AC_ARG_WITH([solaris-pkg-ips], @@ -3263,7 +3364,6 @@ dnl This option is only provided so that make distcheck can override it, dnl otherwise we ask pkg-config whenever --with-systemdsystemunitdir is dnl given - AC_MSG_CHECKING(whether to install systemd shutdown files) AC_ARG_WITH([systemdshutdowndir], AS_HELP_STRING([--with-systemdshutdowndir=DIR], [Directory for systemd shutdown scripts (auto)]), @@ -3297,7 +3397,6 @@ else AC_MSG_RESULT(no) fi - dnl Note: if (systemd-)tmpfiles tech is present, it can be useful even for dnl daemons starting not as systemd units, to pre-create /var/run/nut etc. AC_MSG_CHECKING([whether to install systemd tmpfiles files]) @@ -3491,7 +3590,7 @@ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[${CPLUSPLUS_DECL}]], [[${CPLUSPLUS_MAIN}]]) [AC_MSG_RESULT([yes, out of the box]) have_cxx11=yes], [AS_CASE(["${CXXFLAGS}"], - [*"-std="*], [ + [*"-std="*|*"-ansi"*], [ AC_MSG_RESULT([no, not with the standard already set in CXXFLAGS='${CXXFLAGS}']) have_cxx11=no ],[ @@ -3514,6 +3613,9 @@ unset CPLUSPLUS_DECL AC_MSG_CHECKING(for have_cppunit) have_cppunit="no" +dnl CPPUNIT_NUT_CXXFLAGS are set below if suitable, but can be +dnl disabled further below if nut_with_debuginfo gets applied +dnl for all NUT build products: CPPUNIT_NUT_CXXFLAGS="" AS_IF([test x"$have_PKG_CONFIG" = xyes], [AS_IF([test x"${have_cxx11}" = xyes], @@ -3597,16 +3699,38 @@ return res ? 0 : 1; dnl # By default keep the originally detected have_cppunit value AC_MSG_CHECKING(for impact from --enable-cppunit option - should we build cppunit tests?) AC_ARG_ENABLE(cppunit, - [AS_HELP_STRING([--enable-cppunit], [enable CPPUNIT tests for C++ bindings])], + [AS_HELP_STRING([--enable-cppunit], [enable CPPUNIT tests for C++ bindings (yes, no, force, auto)])], [AS_CASE(["${enableval}"], - ["yes"], [AS_IF([test x"${have_cppunit}" = xyes], [], [AC_MSG_ERROR([--with-cppunit=yes can not be satisfied])])], + ["force"], [AS_IF([test x"${have_cppunit}" = xyes], [], [ + AC_MSG_WARN([--enable-cppunit=yes can not be satisfied, but developer asked for it]) + have_cppunit=yes + ])], + ["yes"], [AS_IF([test x"${have_cppunit}" = xyes], [], [AC_MSG_ERROR([--enable-cppunit=yes can not be satisfied])])], ["no"], [have_cppunit=no] + dnl # "auto" and other values keep what was detected (or not) )]) AC_MSG_RESULT(${have_cppunit}) NUT_REPORT_FEATURE([build C++ tests with CPPUNIT], [${have_cppunit}], [], [HAVE_CPPUNIT], [Define to enable CPPUNIT tests]) -AC_DEFINE_UNQUOTED(CPPUNIT_NUT_CXXFLAGS, $CPPUNIT_NUT_CXXFLAGS, [Compiler flags for cppunit tests]) + +dnl ---------------------------------------------------------------------- + +AC_MSG_CHECKING(whether we can and want to build nutconf configuration-management tool) + +AS_CASE(["${nut_with_nutconf}"], + ["auto"], [AS_IF([test x"${have_cxx11}" = xyes], [nut_with_nutconf="yes"], [nut_with_nutconf="no"])], + ["yes"], [AS_IF([test x"${have_cxx11}" = xyes], [], [AC_MSG_ERROR([explicit --with-nutconf=yes can not be satisfied: C++11 support not enabled])])], + ["no"], [nut_with_nutconf=no] + ) +AC_MSG_RESULT(${nut_with_nutconf}) + +AM_CONDITIONAL(WITH_NUTCONF, test "${nut_with_nutconf}" = "yes") +NUT_REPORT_FEATURE([build and install the nutconf tool (experimental, may lack support for recent NUT options)], + [${nut_with_nutconf}], [], + [WITH_NUTCONF], [Define to enable nutconf tool support]) + +dnl ---------------------------------------------------------------------- AC_MSG_CHECKING(whether to install Augeas configuration-management lenses) AC_ARG_WITH(augeas-lenses-dir, @@ -3760,6 +3884,60 @@ else fi AM_CONDITIONAL(WITH_DEVD, test -n "${devddir}") +dnl FreeBSD quirks support: + +freebsdquirksdir="" +AC_MSG_CHECKING(whether to install FreeBSD site-local USB quirks file) +AC_ARG_WITH(freebsd-quirks-dir, + AS_HELP_STRING([--with-freebsd-quirks-dir=PATH], [where to install nut-usb.quirks file (${datadir}; typically /usr/local/share/nut)]), +[ + case "${withval}" in + yes) dnl Typically /usr/local/share/nut + freebsdquirksdir="${datadir}" + ;; + auto) + dnl Are we building for FreeBSD with such customizations? + if test -s /boot/loader.conf.local ; then + freebsdquirksdir="${datadir}" + fi + if test "${nut_with_usb}" = yes && ! test -s scripts/devd/nut-usb.quirks ; then + AC_MSG_WARN([freebsd-quirks-dir directory skipped because a non-trivial scripts/devd/nut-usb.quirks was not provided by autogen.sh or dist archive]) + freebsdquirksdir="" + fi + ;; + no) + freebsdquirksdir="" + ;; + *) + freebsdquirksdir="${withval}" + ;; + esac +], []) +if test -n "${freebsdquirksdir}"; then + AC_MSG_RESULT(using ${freebsdquirksdir}) + NUT_REPORT_PATH_INTEGRATIONS([FreeBSD site-local USB quirks directory (add into /boot/loader.conf.local)], [${freebsdquirksdir}]) +else + AC_MSG_RESULT(no) +fi + +if test -n "${freebsdquirksdir}" ; then + dnl Expand datadir or similar macros in this path + conftemp="${freebsdquirksdir}" + eval conftemp=\"${conftemp}\" + eval conftemp=\"${conftemp}\" + freebsdquirksdir="${conftemp}" + + if test -z "${freebsdquirksdir}"; then + AC_MSG_ERROR([freebsd-quirks-dir requested but not found (resolved as empty)]) + fi + + if test "${nut_with_usb}" = yes && ! test -s scripts/devd/nut-usb.quirks ; then + AC_MSG_ERROR([freebsd-quirks-dir directory and USB driver support requested, but a non-trivial scripts/devd/nut-usb.quirks was not provided by autogen.sh or dist archive]) + fi +fi + +AM_CONDITIONAL(WITH_FREEBSD_QUIRKS_DIR, test -n "${freebsdquirksdir}") + dnl dnl AIX system @@ -4024,6 +4202,7 @@ AC_SUBST(TREE_VERSION) AC_SUBST(NUT_NETVERSION) AC_SUBST(FORCE_NUT_VERSION) AC_SUBST(NUT_SOURCE_GITREV) +AC_SUBST(NUT_SOURCE_GITREV_NUMERIC) AC_SUBST(LIBSSL_CFLAGS) AC_SUBST(LIBSSL_LIBS) AC_SUBST(LIBSSL_REQUIRES) @@ -4097,6 +4276,7 @@ AC_SUBST(WORDS_BIGENDIAN) AC_SUBST(cgiexecdir) AC_SUBST(devddir) AC_SUBST(driverexecdir) +AC_SUBST(freebsdquirksdir) AC_SUBST(htmldir) AC_SUBST(pkgconfigdir) AC_SUBST(systemdsystemunitdir) @@ -4171,7 +4351,7 @@ AS_CASE(["${nut_enable_warnings}"], nut_enable_warnings="no" ] ) -AC_MSG_RESULT(["${nut_enable_warnings}"]) +AC_MSG_RESULT([${nut_enable_warnings}]) dnl # Nothing special for gcc - we tend to survive it with GNU standard >= 99 dnl # and fail with strict C standard. Suggestions welcome for "gcc-hard" to @@ -4200,6 +4380,9 @@ dnl # -Wno-padded -- NSPR and NSS headers get to issue lots of that dnl # -Wno-c++98-compat-pedantic -Wno-c++98-compat -- our C++ code uses nullptr dnl # as requested by newer linters, and C++98 does not. We require C++11 dnl # or newer anyway, and skip building C++ library and test otherwise. +dnl # -Wno-exit-time-destructors -- "(static) const something" items would be +dnl # de-allocated en-masse when the program exits, not GC'ed at run-time. +dnl # Oh well... dnl # -Wno-fuse-ld-path -- not much in our control what recipes the autotools dnl # on the build host generate... this tries to avoid failures due to: dnl # clang-13: error: '-fuse-ld=' taking a path is deprecated. @@ -4208,7 +4391,15 @@ dnl # -Wno-unsafe-buffer-usage -- clang-16 introduced a check too smart for dnl # its own good. It detects use of pointer aritmetics as arrays are dnl # walked, which is indeed potentially dangerous. And also is nearly dnl # unavoidable in C (at least not without major rewrites of the world). +dnl # -Wno-documentation-unknown-command -fcomment-block-commands=retval -- +dnl # some clang versions sanity-check Doxygen style comments, but do not +dnl # recognize "\retval" key word. These options try to both ignore the +dnl # problematic area, and to add it as recognized (TODO: scripted check +dnl # for abilities of the current build's compiler instead) dnl ### Special exclusion picks for clang-medium (same as hard, plus...): +dnl # -Wno-global-constructors -- using "const something" out of method context +dnl # potentially impacts start-up time and may be prone to race conditions +dnl # (for non-trivial interconnected objects), better be re-architected. dnl # -Wno-float-conversion -Wno-double-promotion -Wno-implicit-float-conversion dnl # -- reduce noise due to floating-point literals like "3.14" being a C dnl # double type (a "3.14f" literal is a C float) cast implicitly into @@ -4232,22 +4423,29 @@ dnl # versions care less about this situation). dnl # -Wno-disabled-macro-expansion -- some system definitions of strncmp() dnl # and other routines are in fact recursive macros. The -Weverything dnl # mode of clang(-3.4) disables their handling, unless told otherwise. +dnl # -Wno-incompatible-function-pointer-types-strict -- some system definitions +dnl # of methods for signals are not compatible with even those systems' +dnl # definitions of default signals, e.g. void vs. int arguments: +dnl # #define SIG_IGN (void (*)())1 +dnl # extern void (*signal(int, void (*)(int)))(int); +dnl # (NUT signal handler methods do have the int signal number) +dnl # This is currently quiesced for clang-17; better solutions are welcome. AS_CASE(["${nut_enable_warnings}"], [all], [ CFLAGS="${CFLAGS} -Wall" CXXFLAGS="${CXXFLAGS} -Wall" ], [clang-hard], [ - CFLAGS="${CFLAGS} -ferror-limit=0 -Wno-system-headers -Wall -Wextra -Weverything -Wno-disabled-macro-expansion -Wno-unused-macros -Wno-reserved-id-macro -Wno-padded -Wno-documentation -Wno-cast-qual -pedantic -Wno-fuse-ld-path -Wno-unsafe-buffer-usage" - CXXFLAGS="${CXXFLAGS} -ferror-limit=0 -Wno-system-headers -Wall -Wextra -Weverything -Wno-disabled-macro-expansion -Wno-unused-macros -Wno-reserved-id-macro -Wno-padded -Wno-documentation -Wno-cast-qual -Wno-c++98-compat-pedantic -Wno-c++98-compat -Wno-fuse-ld-path -Wno-unsafe-buffer-usage" + CFLAGS="${CFLAGS} -ferror-limit=0 -Wno-system-headers -Wall -Wextra -Weverything -Wno-disabled-macro-expansion -Wno-unused-macros -Wno-reserved-id-macro -Wno-padded -Wno-documentation -fcomment-block-commands=retval -Wno-documentation-unknown-command -Wno-cast-qual -pedantic -Wno-fuse-ld-path -Wno-unsafe-buffer-usage" + CXXFLAGS="${CXXFLAGS} -ferror-limit=0 -Wno-system-headers -Wall -Wextra -Weverything -Wno-disabled-macro-expansion -Wno-unused-macros -Wno-reserved-id-macro -Wno-padded -Wno-documentation -fcomment-block-commands=retval -Wno-documentation-unknown-command -Wno-cast-qual -Wno-c++98-compat-pedantic -Wno-c++98-compat -Wno-exit-time-destructors -Wno-fuse-ld-path -Wno-unsafe-buffer-usage" ], [clang-medium], [ - CFLAGS="${CFLAGS} -ferror-limit=0 -Wno-system-headers -Wall -Wextra -Weverything -Wno-disabled-macro-expansion -Wno-unused-macros -Wno-reserved-id-macro -Wno-padded -Wno-documentation -Wno-cast-qual -pedantic -Wno-fuse-ld-path -Wno-unsafe-buffer-usage -Wno-float-conversion -Wno-double-promotion -Wno-implicit-float-conversion -Wno-conversion -Wno-incompatible-pointer-types-discards-qualifiers" - CXXFLAGS="${CXXFLAGS} -ferror-limit=0 -Wno-system-headers -Wall -Wextra -Weverything -Wno-disabled-macro-expansion -Wno-unused-macros -Wno-reserved-id-macro -Wno-padded -Wno-documentation -Wno-cast-qual -Wno-c++98-compat-pedantic -Wno-c++98-compat -Wno-fuse-ld-path -Wno-unsafe-buffer-usage" + CFLAGS="${CFLAGS} -ferror-limit=0 -Wno-system-headers -Wall -Wextra -Weverything -Wno-disabled-macro-expansion -Wno-unused-macros -Wno-reserved-id-macro -Wno-padded -Wno-documentation -fcomment-block-commands=retval -Wno-documentation-unknown-command -Wno-cast-qual -pedantic -Wno-fuse-ld-path -Wno-unsafe-buffer-usage -Wno-float-conversion -Wno-double-promotion -Wno-implicit-float-conversion -Wno-conversion -Wno-incompatible-pointer-types-discards-qualifiers -Wno-incompatible-function-pointer-types-strict" + CXXFLAGS="${CXXFLAGS} -ferror-limit=0 -Wno-system-headers -Wall -Wextra -Weverything -Wno-disabled-macro-expansion -Wno-unused-macros -Wno-reserved-id-macro -Wno-padded -Wno-documentation -fcomment-block-commands=retval -Wno-documentation-unknown-command -Wno-cast-qual -Wno-c++98-compat-pedantic -Wno-c++98-compat -Wno-exit-time-destructors -Wno-global-constructors -Wno-fuse-ld-path -Wno-unsafe-buffer-usage" ], [clang-minimal], [ - CFLAGS="${CFLAGS} -ferror-limit=0 -Wall -Wextra -Wno-documentation" - CXXFLAGS="${CXXFLAGS} -ferror-limit=0 -Wall -Wextra -Wno-documentation" + CFLAGS="${CFLAGS} -ferror-limit=0 -Wall -Wextra -Wno-documentation -Wno-documentation-unknown-command -fcomment-block-commands=retval" + CXXFLAGS="${CXXFLAGS} -ferror-limit=0 -Wall -Wextra -Wno-documentation -Wno-documentation-unknown-command -fcomment-block-commands=retval" ], [gcc-legacy], [CFLAGS="${CFLAGS} -Wall -Wsign-compare"], [gcc-minimal], [ @@ -4300,7 +4498,7 @@ AS_CASE(["${nut_enable_Werror}"], CXXFLAGS="${CXXFLAGS} -Wno-error" ] ) -AC_MSG_RESULT(["${nut_enable_Werror}"]) +AC_MSG_RESULT([${nut_enable_Werror}]) dnl Some compilers (e.g. older clang-3.4) have issues with built-in methods dnl that are implemented as macros in system headers -- but only for some @@ -4432,12 +4630,36 @@ AS_IF([test -n "${ac_abs_top_builddir}" && test -d "${ac_abs_top_builddir}"], TOP_BUILDDIR="`cd "$TOP_BUILDDIR" && pwd`" || AC_MSG_ERROR([Can not detect TOP_BUILDDIR])] )] ) -AC_MSG_RESULT(["${TOP_BUILDDIR}"]) +dnl Quoted in case someone copy-pastes this path and it has whitespaces: +AC_MSG_RESULT(['${TOP_BUILDDIR}']) ABS_TOP_BUILDDIR="`cd "${TOP_BUILDDIR}" && pwd`" || AC_MSG_ERROR([Can not detect ABS_TOP_BUILDDIR]) ABS_TOP_SRCDIR="`cd "${abs_srcdir}" && pwd`" || AC_MSG_ERROR([Can not detect ABS_TOP_SRCDIR]) AM_CONDITIONAL([BUILDING_IN_TREE], [test "${ABS_TOP_BUILDDIR}" = "${ABS_TOP_SRCDIR}"]) +dnl When building ON Windows (mingw/MSYS2, cygwin, etc.) fudge these +dnl path strings back to what native OS methods would recognize. +AS_CASE([${target_os}], + [*mingw*], [ + dnl Cygwin path resolver + AC_CHECK_TOOL([CYGPATH], [cygpath], [none]) + AS_IF([test "x${CYGPATH}" != "xnone"], [ + tmp="`${CYGPATH} -m "${ABS_TOP_BUILDDIR}" | sed -e 's,/,\\\\\\\\,g'`" && test -n "$tmp" && test -d "$tmp" && ABS_TOP_BUILDDIR="$tmp" + tmp="`${CYGPATH} -m "${ABS_TOP_SRCDIR}" | sed 's,/,\\\\\\\\,g'`" && test -n "$tmp" && test -d "$tmp" && ABS_TOP_SRCDIR="$tmp" + ],[ + dnl MSYS pwd with -W option to resolve + AC_CHECK_TOOL([PWD], [pwd], [none]) + AS_IF([test "x${PWD}" != "xnone"], [ + tmp="`(cd "${ABS_TOP_BUILDDIR}" && ${PWD} -W) | sed 's,/,\\\\\\\\,g'`" && test -n "$tmp" && test -d "$tmp" && ABS_TOP_BUILDDIR="$tmp" + tmp="`(cd "${ABS_TOP_SRCDIR}" && ${PWD} -W) | sed 's,/,\\\\\\\\,g'`" && test -n "$tmp" && test -d "$tmp" && ABS_TOP_SRCDIR="$tmp" + ]) + ]) +]) + +dnl Use these at best for tests (e.g. nutconf), not production code: +AC_DEFINE_UNQUOTED([ABS_TOP_SRCDIR], ["${ABS_TOP_SRCDIR}"], [NUT source directory when the build was configured]) +AC_DEFINE_UNQUOTED([ABS_TOP_BUILDDIR], ["${ABS_TOP_BUILDDIR}"], [NUT build directory when the build was configured]) + AC_MSG_CHECKING([whether to customize ${TOP_BUILDDIR}/scripts/systemd/nut-common-tmpfiles.conf.in for this system]) dnl TOTHINK: Some distributions make the directories below owned dnl by "root:${RUN_AS_GROUP}" with 77x permissions. Is it safer?.. @@ -4482,6 +4704,122 @@ EOF]) ]) AC_MSG_RESULT([done]) +dnl # ccache versions 4.5 and newer support namespacing of the objects +dnl # to facilitate more targeted eviction with --evict-namespace and +dnl # perhaps --evict-older-than options. Here we bolt a namespace with +dnl # NUT as the project and CPU architecture for resulting binaries; +dnl # maybe we might use distro as well but some overlaps may be possible +dnl # that result in same objects for different-looking build roots. +dnl # Note this is enabled by default (explicit --without-... disables it). +dnl # Has practical effect if NUT_AM_MAKE_CAN_EXPORT test is successful. +AS_IF([test x"${CCACHE_NAMESPACE}" = x], [ + CCACHE_NAMESPACE="nut" + dnl # Variables in this list are defined earlier in the script + for T in "${compiler_multiarch}" "${target_alias}" "${target}" "${target_cpu}-${target_os}" ; do + if test x"$T" != x -a x"$T" != x- ; then + CCACHE_NAMESPACE="${CCACHE_NAMESPACE}:${T}" + break + fi + done + unset T +]) +AC_ARG_WITH(CCACHE_NAMESPACE, + AS_HELP_STRING([--with-CCACHE_NAMESPACE=namespace], [which ccache namespace to use for built binaries; typically nut:${autotools_target})]), +[ + case "${withval}" in + no) + CCACHE_NAMESPACE="" + ;; + yes) # Use user envvar or calculation above + ;; + *) + CCACHE_NAMESPACE="${withval}" + ;; + esac +], []) +NUT_REPORT_TARGET(CCACHE_NAMESPACE, "${CCACHE_NAMESPACE}", [ccache namespace tag (if ccache is used and new enough)]) +AS_IF([test x"$CCACHE_NAMESPACE" != x -a x"$NUT_AM_MAKE_CAN_EXPORT" != x], [ + AC_MSG_WARN([CCACHE_NAMESPACE setting may have no effect: this make implementation seems to not support "export VAR=VAL" syntax]) +]) + +dnl # Mark it as a "precious variable", for more details see +dnl # https://www.gnu.org/software/autoconf/manual/autoconf-2.69/html_node/Setting-Output-Variables.html +AC_ARG_VAR(CCACHE_NAMESPACE) + +dnl # Also list some other ccache options which ci_build.sh can fiddle with. +dnl # While that script "exports" them so it can call both configuration and +dnl # the build, their values may be unknown when a developer re-runs "make". +dnl # Normally most of the options would persist under $CCACHE_DIR/ccache.conf +dnl # and we would not pass them via envvars. +AC_ARG_VAR(CCACHE_BASEDIR) +AC_ARG_VAR(CCACHE_DIR) +AC_ARG_VAR(CCACHE_PATH) + +PATH_DURING_CONFIGURE="$PATH" +AC_SUBST(PATH_DURING_CONFIGURE) + +dnl Some binaries, like CPPUNIT tests, have similar flags already added +dnl We might wipe their specific options below if consistently applying +dnl debug-friendly options to everything +AC_MSG_NOTICE([CONFIG_CFLAGS='${CONFIG_CFLAGS}']) +AC_MSG_NOTICE([CONFIG_CXXFLAGS='${CONFIG_CXXFLAGS}']) +AC_MSG_CHECKING([whether to enable debug info in all NUT binaries]) +nut_with_debuginfo_C="${nut_with_debuginfo}" +nut_with_debuginfo_CXX="${nut_with_debuginfo}" +AS_CASE(["${CONFIG_CFLAGS}"], + [*-O*|*-g*], [ + AS_IF([test x"${nut_with_debuginfo_C}" = xauto], [ + nut_with_debuginfo_C="Related settings already specified by caller CFLAGS, not changing anything" + ]) + ], + [ dnl No competing options are provided + AS_IF([test x"${nut_with_debuginfo_C}" = xauto], [nut_with_debuginfo_C="yes"]) + ]) + +AS_CASE(["${CONFIG_CXXFLAGS}"], + [*-O*|*-g*], [ + AS_IF([test x"${nut_with_debuginfo_CXX}" = xauto], [ + nut_with_debuginfo_CXX="Related settings already specified by caller CXXFLAGS, not changing anything" + ]) + ], + [ dnl No competing options are provided + AS_IF([test x"${nut_with_debuginfo_CXX}" = xauto], [nut_with_debuginfo_CXX="yes"]) + ]) + +AS_CASE(["${nut_with_debuginfo_C}"], + [yes], [ + AS_IF([test x"${CLANGCC}" = x"yes" -o x"${GCC}" = x"yes"], [ + CFLAGS="${CFLAGS} -O0 -g3 -gdwarf-2" + ],[nut_with_debuginfo_C="Unknown C compiler, not adding options"] + )], + dnl # [no]: By default we do not add debug info + [legacy], [ + dnl # Apply legacy defaults if no flags were specified by caller or detected by autoconf + AS_IF([test x"${CFLAGS_AFTER_ACPROG}" = x], [CFLAGS="-O ${CFLAGS}"]) + ] +) + +AS_CASE(["${nut_with_debuginfo_CXX}"], + [yes], [ + AS_IF([test "x$CLANGXX" = xyes -o "x$GXX" = xyes], [ + dnl Where we can enable debug, minimize the optimizations + CXXFLAGS="${CXXFLAGS} -O0 -g3 -gdwarf-2" + dnl Use same settings for CPPUNIT tests (they bump their own by default) + CPPUNIT_NUT_CXXFLAGS="" + ],[nut_with_debuginfo_CXX="Unknown C++ compiler, not adding options"] + )], + dnl # [no]: By default we do not add debug info + [legacy], [ + dnl # Apply legacy defaults if no flags were specified by caller or detected by autoconf + AS_IF([test x"${CXXFLAGS_AFTER_ACPROG}" = x], [CXXFLAGS="-O ${CXXFLAGS}"]) + ] +) + +AC_MSG_RESULT([C: ${nut_with_debuginfo_C}; C++: ${nut_with_debuginfo_CXX}]) + +dnl Only in the end, do you understand... +AC_SUBST(CPPUNIT_NUT_CXXFLAGS) + AC_MSG_NOTICE([Generating "data" files from templates, see below for executable scripts]) AC_CONFIG_FILES([ clients/Makefile @@ -4519,8 +4857,11 @@ AC_CONFIG_FILES([ scripts/hotplug/Makefile scripts/hotplug/libhidups scripts/HP-UX/nut.psf + scripts/installer/Makefile scripts/python/Makefile + scripts/python/module/Makefile scripts/python/module/PyNUT.py + scripts/python/module/setup.py scripts/upsdrvsvcctl/Makefile scripts/systemd/Makefile scripts/systemd/nut-common-tmpfiles.conf @@ -4529,6 +4870,9 @@ AC_CONFIG_FILES([ scripts/systemd/nut-server.service scripts/systemd/nut-driver-enumerator.service scripts/systemd/nut-driver-enumerator.path + scripts/systemd/nut-driver-enumerator-daemon.service + scripts/systemd/nut-driver-enumerator-daemon-activator.service + scripts/systemd/nut-driver-enumerator-daemon-activator.path scripts/Solaris/nut-driver-enumerator.xml scripts/Solaris/nut-driver.xml scripts/Solaris/nut-monitor.xml @@ -4541,10 +4885,12 @@ AC_CONFIG_FILES([ scripts/ufw/Makefile scripts/ufw/nut.ufw.profile scripts/Windows/Makefile + scripts/Windows/Installer/NUT-Installer.xml scripts/Makefile server/Makefile tools/Makefile tools/nut-scanner/Makefile + tools/nutconf/Makefile tests/Makefile tests/NIT/Makefile Makefile diff --git a/data/Makefile.am b/data/Makefile.am index df4cd1a8d1..5fba2e442b 100644 --- a/data/Makefile.am +++ b/data/Makefile.am @@ -6,15 +6,18 @@ dist_data_DATA = cmdvartab nodist_data_DATA = driver.list EXTRA_DIST = evolution500.seq epdu-managed.dev -# NOTE: Due to portability, we do not use a GNU percent-wildcard extension: +# NOTE: Due to portability, we do not use a GNU percent-wildcard extension. +# We also have to export some variables that may be tainted by relative +# paths when parsing the other makefile (e.g. MKDIR_P that may be defined +# via expanded $(top_builddir)/install_sh): #%-spellchecked: % Makefile.am $(top_srcdir)/docs/Makefile.am $(abs_srcdir)/$(NUT_SPELL_DICT) -# $(MAKE) -s -f $(top_builddir)/docs/Makefile SPELLCHECK_SRC_ONE="$<" SPELLCHECK_SRCDIR="$(srcdir)" SPELLCHECK_BUILDDIR="$(builddir)" $@ +# +$(MAKE) -s -f $(top_builddir)/docs/Makefile $(AM_MAKEFLAGS) MKDIR_P="$(MKDIR_P)" builddir="$(builddir)" srcdir="$(srcdir)" top_builddir="$(top_builddir)" top_srcdir="$(top_srcdir)" SPELLCHECK_SRC_ONE="$<" SPELLCHECK_SRCDIR="$(srcdir)" SPELLCHECK_BUILDDIR="$(builddir)" $@ cmdvartab-spellchecked: cmdvartab Makefile.am $(top_srcdir)/docs/Makefile.am $(abs_srcdir)/$(NUT_SPELL_DICT) - $(MAKE) -s -f $(top_builddir)/docs/Makefile SPELLCHECK_SRC_ONE="$<" SPELLCHECK_SRCDIR="$(srcdir)" SPELLCHECK_BUILDDIR="$(builddir)" $@ + +$(MAKE) -s -f $(top_builddir)/docs/Makefile $(AM_MAKEFLAGS) MKDIR_P="$(MKDIR_P)" builddir="$(builddir)" srcdir="$(srcdir)" top_builddir="$(top_builddir)" top_srcdir="$(top_srcdir)" SPELLCHECK_SRC_ONE="$<" SPELLCHECK_SRCDIR="$(srcdir)" SPELLCHECK_BUILDDIR="$(builddir)" $@ spellcheck spellcheck-interactive spellcheck-sortdict: - $(MAKE) -f $(top_builddir)/docs/Makefile SPELLCHECK_SRC="cmdvartab" SPELLCHECK_SRCDIR="$(srcdir)" SPELLCHECK_BUILDDIR="$(builddir)" $@ + +$(MAKE) -f $(top_builddir)/docs/Makefile $(AM_MAKEFLAGS) MKDIR_P="$(MKDIR_P)" builddir="$(builddir)" srcdir="$(srcdir)" top_builddir="$(top_builddir)" top_srcdir="$(top_srcdir)" SPELLCHECK_SRC="cmdvartab" SPELLCHECK_SRCDIR="$(srcdir)" SPELLCHECK_BUILDDIR="$(builddir)" $@ MAINTAINERCLEANFILES = Makefile.in .dirstamp CLEANFILES = *.pdf *.html *-spellchecked diff --git a/data/driver.list.in b/data/driver.list.in index 1bb1bee82d..32b795cb2e 100644 --- a/data/driver.list.in +++ b/data/driver.list.in @@ -221,6 +221,8 @@ "Crown" "ups" "2" "CMU-SP1200IEC" "USB" "nutdrv_qx port=auto vendorid=0001 productid=0000 protocol=hunnox langid_fix=0x0409 novendor noscanlangid" # https://github.com/networkupstools/nut/pull/638 caveats at https://github.com/networkupstools/nut/issues/1014 +"Cyber Energy" "ups" "3" "Models with USB ID 0483:A430" "USB" "usbhid-ups" # https://alioth-lists.debian.net/pipermail/nut-upsdev/2024-February/007966.html + "Cyber Power Systems" "ups" "1" "550SL" "" "genericups upstype=7" "Cyber Power Systems" "ups" "1" "725SL" "" "genericups upstype=7" "Cyber Power Systems" "ups" "1" "CPS1100AVR" "" "powerpanel" @@ -607,7 +609,7 @@ "Legrand" "ups" "2" "Keor Line RT" "Serial" "nutdrv_qx" "Legrand" "ups" "2" "Keor Line RT" "USB" "nutdrv_qx" "Legrand" "ups" "2" "Keor LP" "Serial" "nutdrv_qx" -"Legrand" "ups" "2" "Keor Multiplug" "USB" "nutdrv_qx" +"Legrand" "ups" "2" "Keor Multiplug" "USB" "nutdrv_qx" # NOTE: As of 2023 reports, the "NEW Keor Multiplug" is not supported (also by older vendor SW) "Legrand" "ups" "2" "Keor S" "Serial" "nutdrv_qx" "Legrand" "ups" "2" "Keor S" "USB" "nutdrv_qx" "Legrand" "ups" "3" "Keor PDU" "USB" "usbhid-ups" @@ -905,6 +907,9 @@ "Numeric" "ups" "2" "3000 SW" "" "blazer_ser" "Numeric" "ups" "2" "Digital 800 plus" "USB" "nutdrv_qx or blazer_usb" +"NUT" "ups" "5" "all supported NUT devices, through remote upsd" "" "dummy-ups" +"NUT" "ups" "5" "Simulated devices" "" "dummy-ups" + "Oneac" "ups" "1" "ON400" "advanced interface" "oneac" "Oneac" "ups" "1" "ON600" "advanced interface" "oneac" "Oneac" "ups" "1" "ON900" "advanced interface" "oneac" diff --git a/data/html/Makefile.am b/data/html/Makefile.am index 4d0620ac68..19436e12da 100644 --- a/data/html/Makefile.am +++ b/data/html/Makefile.am @@ -1,10 +1,35 @@ # Network UPS Tools: data/html + # install these only if configured --with-cgi if WITH_CGI dist_html_DATA = index.html bottom.html nut-banner.png nodist_html_DATA = header.html endif -EXTRA_DIST = README +EXTRA_DIST = README.adoc + +SPELLCHECK_SRC = README.adoc + +# NOTE: Due to portability, we do not use a GNU percent-wildcard extension. +# We also have to export some variables that may be tainted by relative +# paths when parsing the other makefile (e.g. MKDIR_P that may be defined +# via expanded $(top_builddir)/install_sh): +#%-spellchecked: % Makefile.am $(top_srcdir)/docs/Makefile.am $(abs_srcdir)/$(NUT_SPELL_DICT) +# +$(MAKE) -s -f $(top_builddir)/docs/Makefile $(AM_MAKEFLAGS) MKDIR_P="$(MKDIR_P)" builddir="$(builddir)" srcdir="$(srcdir)" top_builddir="$(top_builddir)" top_srcdir="$(top_srcdir)" SPELLCHECK_SRC_ONE="$<" SPELLCHECK_SRCDIR="$(srcdir)" SPELLCHECK_BUILDDIR="$(builddir)" $@ + +# NOTE: Portable suffix rules do not allow prerequisites, so we shim them here +# by a wildcard target in case the make implementation can put the two together. +*-spellchecked: Makefile.am $(top_srcdir)/docs/Makefile.am $(abs_srcdir)/$(NUT_SPELL_DICT) + +.sample.sample-spellchecked: + +$(MAKE) -s -f $(top_builddir)/docs/Makefile $(AM_MAKEFLAGS) MKDIR_P="$(MKDIR_P)" builddir="$(builddir)" srcdir="$(srcdir)" top_builddir="$(top_builddir)" top_srcdir="$(top_srcdir)" SPELLCHECK_SRC_ONE="$<" SPELLCHECK_SRCDIR="$(srcdir)" SPELLCHECK_BUILDDIR="$(builddir)" $@ + +.in.in-spellchecked: + +$(MAKE) -s -f $(top_builddir)/docs/Makefile $(AM_MAKEFLAGS) MKDIR_P="$(MKDIR_P)" builddir="$(builddir)" srcdir="$(srcdir)" top_builddir="$(top_builddir)" top_srcdir="$(top_srcdir)" SPELLCHECK_SRC_ONE="$<" SPELLCHECK_SRCDIR="$(srcdir)" SPELLCHECK_BUILDDIR="$(builddir)" $@ + +spellcheck spellcheck-interactive spellcheck-sortdict: + +$(MAKE) -f $(top_builddir)/docs/Makefile $(AM_MAKEFLAGS) MKDIR_P="$(MKDIR_P)" builddir="$(builddir)" srcdir="$(srcdir)" top_builddir="$(top_builddir)" top_srcdir="$(top_srcdir)" SPELLCHECK_SRC="$(SPELLCHECK_SRC)" SPELLCHECK_SRCDIR="$(srcdir)" SPELLCHECK_BUILDDIR="$(builddir)" $@ + +CLEANFILES = *-spellchecked MAINTAINERCLEANFILES = Makefile.in .dirstamp # Generated by configure script: diff --git a/data/html/README b/data/html/README deleted file mode 100644 index ccaf070fc8..0000000000 --- a/data/html/README +++ /dev/null @@ -1,97 +0,0 @@ -Desc: NUT HTML complementary information -File: README -Date: 27 Jul 2005 -Auth: Arnaud Quette - Dave Breiland - -This file provides some complementary information -about the use and integration of NUT HTML pages. - -1) Introduction ---------------- - -NUT HTML pages have been created as a central point -that ease the access to the various CGI scripts -providing the NUT web interface. - -It consists of three .html files: -- index.html: defines the two container frames, -topFrame and mainFrame -- header.html: contain the header including links -to NUT website, and upsstat.cgi/upsset.cgi -- bottom.html: empty frame that will be replaced -with the content of upsstat.cgi or upsset.cgi. - -2) Integration --------------- - -You first need to install NUT CGI (ie using ./configure --with-cgi). -Refer to the README file for more information - -There are two ways to integrate NUT HTML with your -webserver, with the same results: - -a) take advantage of the existing tree -====================================== - -- the cgi are for example installed in /usr/lib/cgi-bin, -which is already configured in your webserver as the -default CGI path - -- in the same spirit, we will use the existing DocumentRoot -and create a "nut" subdirectory, and copy the three .html -files (index, header and bottom) - -Note that the links to cgi scripts in header.html are -pre configured to work in this situation, which ease -the packagers work. - -b) configure manually -===================== - -- copy the data/html directory to somepath (ie /usr/local/nut -for a standard installation from source) - --Now edit your webserver configuration file, adding for -example (for Apache): - -#Begin Section -ScriptAlias /nut/cgi-bin/ /usr/local/nut/cgi-bin/ - - AllowOverride AuthConfig - Options ExecCGI - Order allow,deny - Allow from all - - -Alias /nut/ /usr/local/nut/html/ - - Options None - AllowOverride AuthConfig - Order allow,deny - Allow from all - -#End Section - --Make sure to change the links path in header.html according to your -configuration and installation. - -3) Conclusion -============= - -- Make sure to restart your webserver. - --Configure the CGI scripts. Manpages can be found from: ---prompt> man -M /usr/local/nut/man/ upsstats.cgi ---prompt> man -M /usr/local/nut/man/ upsset.cgi ---prompt> man -M /usr/local/nut/man/ upsimage.cgi ---prompt> man -M /usr/local/nut/man/ hosts.conf - --It is recommended that you use .htaccess files in the cgi-bin folder and the -html folder. Please reference: -http://httpd.apache.org/docs/howto/htaccess.html - -- You will then be able to access the NUT HTML page at: -http://localhost/nut - - diff --git a/data/html/README.adoc b/data/html/README.adoc new file mode 100644 index 0000000000..fdd6659885 --- /dev/null +++ b/data/html/README.adoc @@ -0,0 +1,103 @@ +NUT HTML complementary information +================================== +Arnaud Quette , Dave Breiland +v1.0, 27 Jul 2005 (start date) + +This file provides some complementary information +about the use and integration of NUT HTML pages. + +1) Introduction +--------------- + +NUT HTML pages have been created as a central point +that ease the access to the various CGI scripts +providing the NUT web interface. + +It consists of three HTML files: + +* `index.html`: defines the two container frames, + `topFrame` and `mainFrame` +* `header.html`: contains the header including links + to NUT website, and `upsstats.cgi`/`upsset.cgi` +* `bottom.html`: empty frame that will be replaced + with the content of `upsstats.cgi` or `upsset.cgi`. + +2) Integration +-------------- + +You first need to install NUT CGI, i.e. using +---- +:; ./configure --with-cgi +---- + +Refer to the NUT documentation for more information. + +There are two ways to integrate NUT HTML with your +webserver, with the same results: + +a) take advantage of the existing tree +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +- the cgi programs are (for example) installed in `/usr/lib/cgi-bin`, + which is already configured in your webserver as the default CGI path + +- in the same spirit, we will use the existing `DocumentRoot` (in terms + of Apache webserver) and create a `nut` subdirectory, and copy the + three `.html` files (`index`, `header` and `bottom`) + +Note that the links to cgi programs in `header.html` are pre-configured +to work in this situation, which eases the packagers' work. + +b) configure manually +~~~~~~~~~~~~~~~~~~~~~ + +- copy the `data/html` directory to some path (i.e. `/usr/local/nut` + for a standard installation from source) + +- Now edit your webserver configuration file, adding for + example (for Apache): +---- +#Begin Section +ScriptAlias /nut/cgi-bin/ /usr/local/nut/cgi-bin/ + + AllowOverride AuthConfig + Options ExecCGI + Order allow,deny + Allow from all + + +Alias /nut/ /usr/local/nut/html/ + + Options None + AllowOverride AuthConfig + Order allow,deny + Allow from all + +#End Section +---- + +- Make sure to change the links path in `header.html` according to your + configuration and installation. + +3) Conclusion +------------- + +- Make sure to restart your webserver. + +- Configure the CGI scripts. Manpages can be found from: +---- +:; man -M /usr/local/nut/man/ upsstats.cgi +:; man -M /usr/local/nut/man/ upsset.cgi +:; man -M /usr/local/nut/man/ upsimage.cgi +:; man -M /usr/local/nut/man/ hosts.conf +---- + +- It is recommended that you use `.htaccess` files in the `cgi-bin` folder + and the `html` folder. Please reference: + http://httpd.apache.org/docs/howto/htaccess.html + +- You will then be able to access the NUT HTML page at: + http://localhost/nut + +- Further protection with HTTPS is recommended, especially for installations + on networks accessible by someone other than yourself. diff --git a/docs/.gitignore b/docs/.gitignore index c4d2f30a87..6d00f93f51 100644 --- a/docs/.gitignore +++ b/docs/.gitignore @@ -25,3 +25,4 @@ nut.dict.sorted /tmp/ docinfo.xml.in.tmp /asciidoc-vars.conf.lastrev.tmp +.prep-src-docs* diff --git a/docs/Makefile.am b/docs/Makefile.am index 82185719df..33f0ff5d77 100644 --- a/docs/Makefile.am +++ b/docs/Makefile.am @@ -1,6 +1,10 @@ +# Network UPS Tools: main docs + MAINTAINERCLEANFILES = Makefile.in .dirstamp EXTRA_DIST = +all: doc + # Is "egrep == grep -E" always valid? (maybe all a job for configure.ac) #EGREP = egrep EGREP = grep -E @@ -18,6 +22,41 @@ IMAGE_FILES = images/asciidoc.png \ images/bizarre.png \ images/old-cgi.png +# Logos which pop up in README.adoc acknowledgements and maybe other places: +IMAGE_LOGO_FILES = \ + images/ci/AppVeyor_logo-2x.png \ + images/ci/AppVeyor_logo-ar21.png \ + images/ci/CircleCI_vertical_black_logo.png \ + images/ci/DO_Powered_by_Badge_blue.png \ + images/ci/DO_Powered_by_Badge_blue_140pxW.png \ + images/ci/fosshost_org_Host_Dark_56px.png \ + images/ci/fosshost_org_Host_Light_309px.png \ + images/ci/fosshost_org_Host_Light_38px.png \ + images/ci/gandi-ar21.png \ + images/ci/gandi-ar21.svg \ + images/ci/GitHub-Mark-140pxW.png \ + images/ci/GitHub-Mark-ea2971cee799.png \ + images/ci/OC_logotype.png \ + images/ci/OC_logo-watercolor-256.png \ + images/ci/OC_logo_merged_171x32.png \ + images/ci/OC_logo_merged_140x26.png + +IMAGE_LOGO_FILES_JENKINS_NUT = \ + images/ci/jenkins-nut-large-256px.png \ + images/ci/jenkins-nut-large-squared.png \ + images/ci/jenkins-nut-large.pdn \ + images/ci/jenkins-nut-large.png \ + images/ci/jenkins-nut-small-256px.png \ + images/ci/jenkins-nut-small.pdn \ + images/ci/jenkins-nut-small.png \ + images/ci/jenkins-nut-squared.png \ + images/ci/jenkins-nut-transparent-bg-140pxW.png \ + images/ci/jenkins-nut-transparent-bg-40px.png \ + images/ci/jenkins-nut-transparent-bg.png \ + images/ci/jenkins-nut.css \ + images/ci/jenkins-nut.png \ + images/ci/jenkins-nut.txt + # Only track here the local deps SHARED_DEPS = nut-names.txt daisychain.txt asciidoc.conf asciidoc.txt @@ -51,7 +90,7 @@ ALL_TXT_SRC = nut-names.txt daisychain.txt \ ASPELL_FILTER_PATH = @ASPELL_FILTER_PATH@ NUT_SPELL_DICT = nut.dict EXTRA_DIST += $(ALL_TXT_SRC) $(SHARED_DEPS) $(IMAGE_FILES) \ - $(CABLES_IMAGES) $(NUT_SPELL_DICT) \ + $(IMAGE_LOGO_FILES) $(IMAGE_LOGO_FILES_JENKINS_NUT) $(CABLES_IMAGES) $(NUT_SPELL_DICT) \ docinfo.xml common.xsl xhtml.xsl chunked.xsl asciidoc.txt asciidoc-vars.conf ASCIIDOC_HTML_SINGLE = user-manual.html \ @@ -82,9 +121,7 @@ ASCIIDOC_PDF = user-manual.pdf \ FAQ.pdf SUBDIRS = man cables -SUFFIXES = .txt .html .pdf -spellchecked - -all: doc +SUFFIXES = .txt .html .pdf -spellchecked .txt-prepped # This list is defined by configure script choices and options: CHECK_LOCAL_TARGETS = @DOC_CHECK_LIST@ @@ -93,8 +130,11 @@ CHECK_LOCAL_TARGETS += spellcheck endif WITH_SPELLCHECK check-local: $(CHECK_LOCAL_TARGETS) +# Make sure sources are there for out-of-tree builds: +@DOC_BUILD_LIST@ $(ASCIIDOC_PDF) $(ASCIIDOC_HTML_SINGLE) $(ASCIIDOC_HTML_CHUNKED): $(abs_top_builddir)/docs/.prep-src-docs + # This list is defined by configure script choices and options: -doc: @DOC_BUILD_LIST@ +doc: $(abs_top_builddir)/docs/.prep-src-docs @DOC_BUILD_LIST@ # This target can be called by developers to go around the configure # script choices at their risk (e.g. missing tools are possible): @@ -145,19 +185,15 @@ check-html-chunked: $(ASCIIDOC_HTML_CHUNKED) # chosen during configure script execution. The "all-man" and "all-html" # rules build everything documented. check-man all-man man-man all-html html-man: - cd $(top_builddir)/docs/man/ && $(MAKE) -f Makefile $@ + +cd $(top_builddir)/docs/man/ && $(MAKE) $(AM_MAKEFLAGS) -f Makefile $@ man: - cd $(top_builddir)/docs/man/ && $(MAKE) -f Makefile all + +cd $(top_builddir)/docs/man/ && $(MAKE) $(AM_MAKEFLAGS) -f Makefile all CLEANFILES = *.xml *.html *.pdf *-spellchecked docbook-xsl.css docinfo.xml.in.tmp CLEANFILES += $(top_builddir)/INSTALL.nut $(top_builddir)/UPGRADING $(top_builddir)/NEWS $(top_builddir)/ChangeLog.adoc $(top_builddir)/README CLEANFILES += $(top_builddir)/*.adoc-parsed *.adoc-parsed -# Dirs to clean -clean-local: - $(AM_V_at)rm -rf *.chunked *.bak tmp - ### TODO: general automatic dependency generation # Prepare text files (currently a manually tracked list) @@ -179,6 +215,7 @@ DOCBUILD_FILTER_GITHUB_LINKS = { \ -e 's%\#\(\#[1-9][0-9]*\)%\1%g' \ ; } +# The $< is okay here, it is used in a suffix rule below DOCBUILD_CONVERT_GITHUB_LINKS = { \ echo " DOC-ASCIIDOC-GITHUB-LINKS Parsing GitHub link patterns $< => $@"; \ cat "$<" | $(DOCBUILD_FILTER_GITHUB_LINKS) > "$@.tmp" \ @@ -189,8 +226,8 @@ DOCBUILD_CONVERT_GITHUB_LINKS = { \ @$(DOCBUILD_CONVERT_GITHUB_LINKS) $(top_builddir)/ChangeLog: - @echo " DOC-CHANGELOG-GENERATE $@" \ - && cd $(top_builddir) && $(MAKE) $(AM_FLAGS) $(@F) + +@echo " DOC-CHANGELOG-GENERATE $@" \ + && cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) $(@F) # BSD Make dislikes the path resolution here and does not always populate "$<" # (and claims why: "Using $< in a non-suffix rule context is a GNUmake idiom"), @@ -211,6 +248,7 @@ $(top_builddir)/ChangeLog.adoc: $(top_builddir)/ChangeLog && TABCHAR="`printf '\t'`" \ && $(SED) \ -e 's,^\([0-9a-zA-Z]\),=== \1,' \ + -e 's,^=== \(NOTE: \),\1,' \ -e 's,/[+],/\\\\\+,g' \ -e 's,[+][+],\\\+\\\+,g' \ -e 's,^\([ '"$${TABCHAR}"'][^+]*\)\([^+/\]\)[+],\1\2\\\+,g' \ @@ -315,6 +353,12 @@ DOCBUILD_END = { \ fi ; \ } +### Call the prep step consistently to create symlinks (out-of-tree) +### or just touch-files for peace of mind (in-tree builds). Then we +### use these path names (truncated "-prepped") now surely located +### in the builddir as the sources for rendered docs. +*.txt-prepped: $(abs_top_builddir)/docs/.prep-src-docs + # PORTABILITY NOTE: POSIX Make forbids the suffix rule definitions with # prerequisites like done below, and GNU Make of some versions complains; # https://www.gnu.org/software/make/manual/html_node/Error-Messages.html @@ -326,31 +370,43 @@ DOCBUILD_END = { \ # as done below may be pointless in the end (with regard to a portable way # to trigger builds by a changed dependency), but at least predictable and # not toxic. +###.txt.txt-prepped: $(abs_top_builddir)/docs/.prep-src-docs + *.html: common.xsl xhtml.xsl -.txt.html: +.txt-prepped.html: @A2X_OUTDIR="tmp/html-single.$(@F).$$$$" ; \ echo " DOC-HTML Generating $@"; \ $(DOCBUILD_BEGIN) ; RES=0; \ - $(A2X) $(A2X_COMMON_OPTS) --attribute=xhtml11_format --format=xhtml --xsl-file=$(srcdir)/xhtml.xsl $< || RES=$$? ; \ + $(A2X) $(A2X_COMMON_OPTS) --attribute=xhtml11_format --format=xhtml --xsl-file=$(srcdir)/xhtml.xsl "$(&2 ; exit 0; fi; \ - case "$@" in *-spellchecked) ;; *) echo "SKIP: Bogus spellcheck call for non '*-spellchecked' target filename (with make target $@)" >&2 ; exit 0;; esac; \ + if test x"$(SPELLCHECK_SRC_ONE)" = x ; then echo "SKIP: Bogus spellcheck call for empty target filename (with make target $@ from `pwd`)" >&2 ; exit 0; fi; \ + case "$@" in *-spellchecked) ;; *) echo "SKIP: Bogus spellcheck call for non '*-spellchecked' target filename (with make target $@ from `pwd`)" >&2 ; exit 0;; esac; \ rm -f "$@" || true ; \ - echo " ASPELL Spell checking on $(SPELLCHECK_SRCDIR)/$(SPELLCHECK_SRC_ONE)"; \ + $(MKDIR_P) "$(@D)" || exit ; \ + REPORT_SRCDIR="$(SPELLCHECK_SRCDIR)"; \ + REPORT_SRC_ONE="$(SPELLCHECK_SRC_ONE)"; \ + REPORT_PREFIX="" ; \ + case "$(SPELLCHECK_SRC_ONE)" in \ + /*) ;; \ + */*) if [ x"$${REPORT_SRCDIR}" = x ] ; then \ + echo EMPTY >$(SPELLCHECK_RECIPE_DEBUG_STREAM) ; \ + REPORT_SRCDIR="`dirname "$(SPELLCHECK_SRC_ONE)"`"; \ + else \ + echo "APPEND: SPELLCHECK_SRCDIR='$(SPELLCHECK_SRCDIR)' SPELLCHECK_SRC_ONE='$(SPELLCHECK_SRC_ONE)' dirname='`dirname "$(SPELLCHECK_SRC_ONE)"`'" >$(SPELLCHECK_RECIPE_DEBUG_STREAM) ; \ + REPORT_SRCDIR="$${REPORT_SRCDIR}/`dirname "$(SPELLCHECK_SRC_ONE)"`"; \ + fi ; \ + REPORT_SRC_ONE="`basename "$(SPELLCHECK_SRC_ONE)"`"; \ + ;; \ + *) ;; \ + esac; \ + if [ x"$${REPORT_SRCDIR}" != x ] ; then \ + tmpREPORT_PREFIX="NUT source root :: $${REPORT_SRCDIR} :: " ; \ + REPORT_SRCDIR="`cd "$${REPORT_SRCDIR}" && { pwd >$(SPELLCHECK_RECIPE_DEBUG_STREAM) ; pwd | sed 's|^'"$(abs_top_srcdir)"'/*||' ; }`" \ + || { REPORT_SRCDIR="$(SPELLCHECK_SRCDIR)" ; REPORT_SRC_ONE="$(SPELLCHECK_SRC_ONE)" ; REPORT_PREFIX="" ; } ; \ + fi ; \ + echo "=== Got REPORT_SRCDIR='$${REPORT_SRCDIR}'" >$(SPELLCHECK_RECIPE_DEBUG_STREAM) ; \ + case "$${REPORT_SRCDIR}" in \ + "") ;; \ + */) ;; \ + *) REPORT_SRCDIR="$${REPORT_SRCDIR}/" ;; \ + esac ; \ + echo " ASPELL Spell checking on $${REPORT_PREFIX}$${REPORT_SRCDIR}$${REPORT_SRC_ONE}"; \ OUT="`(sed 's,^\(.*\)$$, \1,' | $(ASPELL) -a $(ASPELL_NUT_TEXMODE_ARGS) $(ASPELL_NUT_COMMON_ARGS) 2>&1) < "$(SPELLCHECK_SRCDIR)/$(SPELLCHECK_SRC_ONE)"`" \ && { if test -n "$$OUT" ; then OUT="`echo "$$OUT" | $(EGREP) -b -v '$(ASPELL_OUT_NOTERRORS)' `" ; fi; \ test -z "$$OUT" ; } \ @@ -441,16 +522,16 @@ spellcheck: echo "ASPELL DEBUG : information about the setup follows:"; \ LANG=$(ASPELL_ENV_LANG); LC_ALL=$(ASPELL_ENV_LANG); export LANG; export LC_ALL; \ $(ASPELL) --help || true; \ - dpkg -l |grep -i aspell || true ; \ + (command -v dpkg) && ( dpkg -l | grep -i aspell ) || true ; \ echo "ASPELL automatic execution line is : ( sed 's,^\(.*\)$$, \1,' < docfile.txt | $(ASPELL) -a $(ASPELL_NUT_TEXMODE_ARGS) $(ASPELL_NUT_COMMON_ARGS) | $(EGREP) -b -v '$(ASPELL_OUT_NOTERRORS)' )" ; \ echo "ASPELL proceeding to spellchecking job..."; \ else true; fi - @FAILED="" ; LANG=C; LC_ALL=C; export LANG; export LC_ALL; \ + +@FAILED="" ; LANG=C; LC_ALL=C; export LANG; export LC_ALL; \ for docsrc in $(SPELLCHECK_SRC); do \ if test "$(SPELLCHECK_ENV_DEBUG)" != no ; then \ echo "ASPELL MAKEFILE DEBUG: Will see from `pwd` if '$(SPELLCHECK_SRCDIR)/$${docsrc}-spellchecked' is up to date" >&2; \ else true ; fi ; \ - $(MAKE) -s -f "$(abs_top_builddir)/docs/Makefile" SPELLCHECK_SRC_ONE="$${docsrc}" SPELLCHECK_BUILDDIR="$(SPELLCHECK_BUILDDIR)" SPELLCHECK_SRCDIR="$(SPELLCHECK_SRCDIR)" "$(SPELLCHECK_BUILDDIR)/$${docsrc}-spellchecked" \ + $(MAKE) $(AM_MAKEFLAGS) -s -f "$(abs_top_builddir)/docs/Makefile" SPELLCHECK_SRC="" SPELLCHECK_SRC_ONE="$${docsrc}" SPELLCHECK_BUILDDIR="$(SPELLCHECK_BUILDDIR)" SPELLCHECK_SRCDIR="$(SPELLCHECK_SRCDIR)" "$(SPELLCHECK_BUILDDIR)/$${docsrc}-spellchecked" \ || FAILED="$$FAILED $(SPELLCHECK_SRCDIR)/$$docsrc"; \ done ; \ if test -n "$$FAILED" ; then \ @@ -482,14 +563,14 @@ spellcheck-sortdict: $(abs_builddir)/$(NUT_SPELL_DICT).sorted $(abs_builddir)/$(NUT_SPELL_DICT).sorted: $(abs_srcdir)/$(NUT_SPELL_DICT) @cp -pf $(abs_srcdir)/$(NUT_SPELL_DICT) $(abs_builddir)/$(NUT_SPELL_DICT).bak-pre-sorting @LANG=$(ASPELL_ENV_LANG); LC_ALL=$(ASPELL_ENV_LANG); export LANG; export LC_ALL; ( \ - WORDLIST="`tail -n +2 < "$<" | sort | uniq`"; \ + WORDLIST="`tail -n +2 < "$?" | sort | uniq`"; \ WORDCOUNT="`echo "$$WORDLIST" | wc -l`"; \ - head -1 < "$<" | while read P L C E ; do echo "$$P $$L $$WORDCOUNT $$E"; break; done ; \ + head -1 < "$?" | while read P L C E ; do echo "$$P $$L $$WORDCOUNT $$E"; break; done ; \ echo "$$WORDLIST"; \ ) > "$@" @cp -f "$@" "$(abs_builddir)/$(NUT_SPELL_DICT)" @if [ "$(abs_builddir)" != "$(abs_srcdir)" ] ; then \ - cp -f "$@" "$<" || true ; \ + cp -f "$@" "$?" || true ; \ cp -f "$(abs_builddir)/$(NUT_SPELL_DICT).bak-pre-sorting" "$(abs_srcdir)/" || true ; \ fi @@ -505,7 +586,7 @@ spellcheck-interactive: echo "FAILED interactive spellcheck for the following sources (relative to `pwd`): $$FAILED" >&2 ; \ exit 1; \ fi ; exit 0 - $(MAKE) spellcheck-sortdict + +$(MAKE) $(AM_MAKEFLAGS) spellcheck-sortdict @echo "------------------------------------------------------------------------"; \ echo "Custom dictionary file $(NUT_SPELL_DICT) may have been updated now."; \ echo "Use 'git add -p docs/$(NUT_SPELL_DICT) && git checkout -- docs/$(NUT_SPELL_DICT) && make spellcheck-sortdict && git add -p docs/$(NUT_SPELL_DICT)'"; \ @@ -523,4 +604,87 @@ spellcheck-interactive: @echo "Documentation spell check not available since 'aspell' was not found." endif !HAVE_ASPELL + +# When building out-of-tree, be sure to have all asciidoc resources +# under the same dir structure (tool limitation) +PREP_SRC = $(EXTRA_DIST) $(SPELLCHECK_SRC_DEFAULT) + +# NOTE: Some "make" implementations prefix a relative or absent path to +# the filenames in PREP_SRC, others (e.g. Sun make) prepend the absolute +# path to locate the sources, so we end up with bogus trees under docs/. +# Code below tries to detect and truncate this mess, including possible +# source texts located in/under parent dirs. +$(abs_top_builddir)/docs/.prep-src-docs: $(PREP_SRC) + @cd "$(@D)" || exit ; \ + linkroot="$(abs_builddir)" ; \ + if test x"$(abs_srcdir)" = x"$(abs_builddir)" ; then \ + COUNT=0; \ + for F in $(PREP_SRC) ; do \ + case "$$F" in \ + /*) F="`echo "$$F" | sed "s#^$(abs_top_srcdir)/*#./#"`"; \ + if test x"$${linkroot}" = x"$(abs_builddir)" ; then \ + linkroot="$(abs_top_builddir)" ; \ + cd "$(abs_top_builddir)" ; \ + fi ;; \ + esac ; \ + if ! test -e "$${F}-prepped" ; then \ + touch "$${F}-prepped" || exit ; \ + COUNT="`expr $$COUNT + 1`" ; \ + fi ; \ + done ; \ + if ! test -e "$@" ; then touch "$@" ; fi ; \ + else \ + COUNT=30 ; \ + touch "$@.$$$$" ; \ + while test -e "$@.working" -a "$$COUNT" -gt 0 ; do sleep 1; COUNT="`expr $$COUNT - 1`"; done ; \ + touch "$@.working" ; \ + if test -n "`find "$@" -newer "$@.$$$$" 2>/dev/null`" ; then \ + rm -f "$@.$$$$" "$@.working" ; \ + exit 0; \ + fi ; \ + rm -f "$@.$$$$" ; \ + COUNT=0; \ + linksrcroot="$(abs_srcdir)" ; \ + for F in `echo $(PREP_SRC) | tr ' ' '\n' | sort -n | uniq` ; do \ + case "$$F" in \ + /*) F="`echo "$$F" | sed "s#^$(abs_top_srcdir)/*#./#"`"; \ + if test x"$${linkroot}" = x"$(abs_builddir)" ; then \ + linkroot="$(abs_top_builddir)" ; \ + linksrcroot="$(abs_top_srcdir)" ; \ + cd "$(abs_top_builddir)" ; \ + fi ;; \ + "$(srcdir)"/*) F="`echo "$$F" | sed 's#^$(srcdir)/*#./#'`" ;; \ + esac ; \ + D="`dirname "$$F"`" ; \ + $(MKDIR_P) "$${linkroot}/$$D" || { rm -f "$@.working" ; exit 1 ; } ; \ + if ! test -s "$${linkroot}/$$F" && test -s "$${linksrcroot}/$$F" ; then \ + echo " LN '$${linksrcroot}/$$F' => '$${linkroot}/$$F' (PWD = '`pwd`')" >&2 ; \ + ln -fs "$${linksrcroot}/$$F" "$${linkroot}/$$F" || { rm -f "$@.working" ; exit 1 ; } ; \ + COUNT="`expr $$COUNT + 1`" ; \ + fi ; \ + if ! test -e "$${linkroot}/$${F}-prepped" ; then \ + touch "$${linkroot}/$${F}-prepped" || { rm -f "$@.working" ; exit 1 ; } ; \ + COUNT="`expr $$COUNT + 1`" ; \ + fi ; \ + done ; \ + fi ; \ + if test "$$COUNT" -gt 0 -o ! -e "$@" ; then touch "$@" ; fi + @rm -f "$@.working" + +# Dirs to clean, etc. +clean-local: + $(AM_V_at)rm -rf *.chunked *.bak tmp + $(AM_V_at)for F in $(PREP_SRC) ; do \ + case "$$F" in \ + /*) F="`echo "$$F" | sed "s#^$(abs_top_srcdir)/*#./#"`"; cd "$(abs_top_builddir)" ;; \ + esac ; \ + if test x"$(abs_srcdir)" != x"$(abs_builddir)" ; then \ + if test -L "$$F" || test -h "$$F" ; then \ + rm -f "$$F" ; \ + fi ; \ + fi ; \ + rm -f "$${F}-prepped" ; \ + done ; \ + rm -f "$(abs_top_builddir)/docs/.prep-src-docs"* + .PHONY: html html-chunked html-single pdf man diff --git a/docs/asciidoc-vars.conf b/docs/asciidoc-vars.conf index 8d8dc89750..d194923745 100644 --- a/docs/asciidoc-vars.conf +++ b/docs/asciidoc-vars.conf @@ -118,6 +118,9 @@ endif::env-github[] // // - on GitHub: ifdef::env-github[] +// In our normal builds, Makefile variables convey the needed paths +// (used relatively below as `image:images/ci/...png` etc.) +:imagesdir: docs // * xref -> link // syntax: {xref}{x-s}[] // In order for it to work, can reference at most a section of diff --git a/docs/cables/Makefile.am b/docs/cables/Makefile.am index 8cdb1d3a70..6e8a2c4efd 100644 --- a/docs/cables/Makefile.am +++ b/docs/cables/Makefile.am @@ -1,2 +1,4 @@ +# Network UPS Tools: cable docs + CLEANFILES = *-spellchecked MAINTAINERCLEANFILES = Makefile.in .dirstamp diff --git a/docs/ci-farm-lxc-setup.txt b/docs/ci-farm-lxc-setup.txt index dd32950a07..221a171515 100644 --- a/docs/ci-farm-lxc-setup.txt +++ b/docs/ci-farm-lxc-setup.txt @@ -14,6 +14,31 @@ have in their environments. Common preparations ~~~~~~~~~~~~~~~~~~~ +* Example list of packages for Debian-based systems may include (not + necessarily is limited to): ++ +---- +:; apt install lxc lxcfs lxc-templates \ + ipxe-qemu qemu-kvm qemu-system-common qemu-system-data \ + qemu-system-sparc qemu-system-x86 qemu-user-static qemu-utils \ + virt-manager virt-viewer virtinst ovmf \ + libvirt-daemon-system-systemd libvirt-daemon-system \ + libvirt-daemon-driver-lxc libvirt-daemon-driver-qemu \ + libvirt-daemon-config-network libvirt-daemon-config-nwfilter \ + libvirt-daemon libvirt-clients + +# TODO: Where to find virt-top - present in some but not all releases? +# Can fetch sources from https://packages.debian.org/sid/virt-top and follow +# https://www.linuxfordevices.com/tutorials/debian/build-packages-from-source +# Be sure to use 1.0.x versions, since 1.1.x uses a "better-optimized API" +# which is not implemented by libvirt/LXC backend. +---- ++ +NOTE: This claims a footprint of over a gigabyte of new packages when + unpacked and installed to a minimally prepared OS. Much of that would + be the graphical environment dependencies required by several engines + and tools. + * Prepare LXC and LIBVIRT-LXC integration, including an "independent" (aka "masqueraded) bridge for NAT, following https://wiki.debian.org/LXC and https://wiki.debian.org/LXC/SimpleBridge @@ -26,6 +51,9 @@ Common preparations pairs, one per line (so one per container) *** `systemctl restart lxc-net` to apply config (is this needed after setup of containers too, to apply new items before booting them?) +*** For troubleshooting, see `/var/lib/misc/dnsmasq.lxcbr0.leases` + (in some cases you may have to rename it away and reboot host to + fix IP address delegation) * Install qemu with its `/usr/bin/qemu-*-static` and registration in `/var/lib/binfmt` diff --git a/docs/config-notes.txt b/docs/config-notes.txt index 8ed3269fd9..6451b1c9fb 100644 --- a/docs/config-notes.txt +++ b/docs/config-notes.txt @@ -252,6 +252,17 @@ at its startup. This helper service should be triggered whenever your system (re-)starts the `nut-server` service, so that it runs against an up-to-date list of NUT driver processes. +Two service bundles are provided for this feature: a set of +`nut-driver-enumerator-daemon*` units starts the script as a daemon +to regularly inspect and apply the NUT configuration to OS service unit +wrappings (mainly intended for monitoring systems with a dynamic set of +monitored power devices, or for systems where filesystem events monitoring +is not a clockwork-reliable mechanism to 100% rely on); while the other +`nut-driver-enumerator.*` units run the script once per triggering of +the service (usually during boot-up; configuration file changes can be +detected and propagated by systemd most of the time, but not by SMF out +of the box). + A service-oriented solution also allows to consider that different drivers have different dependencies -- such as that networked drivers should begin startup after IP addresses have been assigned, while directly-connected @@ -356,6 +367,16 @@ but still want the data server to run, respond and report zero devices (e.g. on an automatically managed monitoring deployment), you can enable the `ALLOW_NO_DEVICE true` option in the 'upsd.conf' file. +NOTE: Normally `upsd` requires that at all `LISTEN` directives defined +in the 'upsd.conf' file are honoured (except for mishaps possible with +many names of `localhost`), and refuses to start otherwise. If you want +to allow start-up in cases where at least one but possibly not all of +the `LISTEN` directives were honoured, you can enable the +`ALLOW_NOT_ALL_LISTENERS true` option in the 'upsd.conf' file. +Note you would have to restart `upsd` to pick up the `LISTEN`ed IP address +if it appears later, so probably configuring `LISTEN *` is a better choice +in such cases. + On operating systems with service management frameworks, the data server life-cycle is managed by `nut-server` service. diff --git a/docs/config-prereqs.txt b/docs/config-prereqs.txt index ebecf9f1ec..600f822952 100644 --- a/docs/config-prereqs.txt +++ b/docs/config-prereqs.txt @@ -88,8 +88,8 @@ recommended for build agents with immutable system areas, etc. Build prerequisites to make NUT from scratch on various Operating Systems ------------------------------------------------------------------------- -Debian 10/11 -~~~~~~~~~~~~ +Debian 10/11/12 +~~~~~~~~~~~~~~~ Being a popular baseline among Linux distributions, Debian is an important build target. Related common operating systems include @@ -188,8 +188,9 @@ metadata about recently published package revisions: :; apt-get install \ libgpiod-dev -:; apt-get install \ - lua5.1-dev +# NOTE: Some distributions lack a lua*-dev and only offer the base package +:; apt-get install lua5.1 +:; apt-get install lua5.1-dev || true :; apt-get install \ bash dash ksh busybox @@ -495,6 +496,165 @@ required: jre11-openjdk-headless ------ +Slackware Linux 15 +~~~~~~~~~~~~~~~~~~ + +Another long-term presence in the Linux landscape, and sometimes the baseline +for appliances, the Slackware project recently hit release 15 in 2022, averaging +two years per major release. + +It can be installed e.g. in a VM, using ISO images from the project site; see: + +* http://www.slackware.com/ => http://www.slackware.com/getslack/ => + https://mirrors.slackware.com/slackware/slackware-iso/slackware64-15.0-iso/ +* https://slackware.nl/slackware/slackware64-current-iso/ + +You would have to first log in as `root` and run `cgdisk` to define partitioning +for your virtual HDD, such as the common `/boot`, `swap` and `/` Linux layout, +and run `setup` to install "everything". + +Note that "out of the box" Slackware does not currently on networked package +repositories and calculated dependency trees, so one has to know exactly what +they want installed. + +Third-party projects for package managers are also available, e.g. +link:https://slackpkg.org/documentation.html[`slackpkg`] => see also +https://docs.slackware.com/slackware:slackpkg and +https://slackpkg.org/stable/ : +---- +:; wget https://slackpkg.org/stable/slackpkg-15.0.10-noarch-1.txz && \ + installpkg slackpkg-15.0.10-noarch-1.txz +---- + +Uncomment a mirror from `/etc/slackpkg/mirrors` according to your location +and other preferences (or use the top-listed default), and begin with: +---- +:; slackpkg update +---- + +Note that packages may be only installed or re-installed/upgraded as separate +explicit operations, so the procedure to bring your system into needed shape +is a bit cumbersome (and each command may by default be interactive with a +choice menu), e.g.: +---- +:; for P in \ + bash mc vim sudo \ + ; do slackpkg info "$P" || slackpkg install $P || break ; done +---- + +For procedures below, this is automated via `root` profile to become a +`slackpkg-install` command: +---- +:; grep "slackpkg-install" ~/.profile || { + echo 'slackpkg-install() { for P in "$@" ; do echo "=== $P:"; slackpkg info "$P" || slackpkg install "$P" || break ; done; }' >> ~/.profile + } +:; . ~/.profile +---- + +If something has a hiccup, it suggests to look for the right name, e.g.: +---- +:; slackpkg search python +---- + +For NUT dependencies and build tools: +---- +:; slackpkg update + +# Baseline toolkits: +# Note there is no cppcheck, cppunit, valgrind... +# Note clang compiler tools are part of llvm package +:; slackpkg-install \ + ccache time \ + coreutils diffutils \ + git python3 perl curl \ + make autoconf automake libtool binutils \ + pkg-config \ + gcc llvm + +# For spell-checking, highly recommended if you would propose pull requests: +:; slackpkg-install aspell{,-en} + +# Note there is no direct "asciidoc" nor "a2x", just the competing project +# "rubygem-asciidoctor" that NUT currently has no recipes for, so you can +# not compile man/html/pdf docs here, per the default repository. See below +# for tools from alternative repositories, which seem to work well. Manpage +# compilation would require docbook-xml resources; older versions are in +# this package https://slackbuilds.org/repository/15.0/system/docbook-xml/ +# and recent ones are in not-installed part of main repository: +:; slackpkg-install linuxdoc-tools + +# More on Python (for NUT-Monitor UI): +:; slackpkg-install \ + python-pip qt5 gettext-tools gettext + +# For CGI graph generation - massive packages (X11): +:; slackpkg-install \ + gd + +# General dependencies: +:; slackpkg-install \ + openssl openssl-solibs mozilla-nss \ + libusb \ + net-snmp \ + neon + +# Shells: +:; slackpkg-install \ + bash dash ksh93 +---- + +Some more packages are available on the side, including Java (useful +e.g. to make this environment into a fully fledged Jenkins worker). +Other common NUT dependencies absent from primary Slackware repositories +can be found and downloaded (seek `*.txz` package files, although a few +are named `*.tgz`) from here, and passed to `installpkg`: + +* http://www.slackware.com/~alien/slackbuilds/openjdk11/ +* http://www.slackware.com/~alien/slackbuilds/asciidoc/ +* http://www.slackware.com/~alien/slackbuilds/cppunit/ +* http://www.slackware.com/~alien/slackbuilds/lua/ (5.1 in "stable") and + http://www.slackware.com/~alien/slackbuilds/lua53/ (5.4 in "current" + as of Slackware 15.1 candidate in the works) -- note that LUA is not + needed for the current NUT code base, but may become needed after import + of features from forks + +...and even the environment for Windows cross-builds, ancient compilers +and modern toolkits to cover all bases: + +* http://www.slackware.com/~alien/slackbuilds/MinGW-w64/ +* http://www.slackware.com/~alien/slackbuilds/docker/ +* http://www.slackware.com/~alien/slackbuilds/gcc34/ +* http://www.slackware.com/~alien/slackbuilds/gcc5/ + +FWIW, another "more official" but older Java package seems to be at: + +* http://www.slackware.com/~alien/slackbuilds/openjdk/ +* https://slackbuilds.org/repository/15.0/development/jdk/ + +An example routine to install the latest instance of a package could be +like this: +---- +:; wget -m -l1 http://www.slackware.com/~alien/slackbuilds/asciidoc/pkg/ && \ + find . -name '*.t?z' + +:; installpkg ./www.slackware.com/~alien/slackbuilds/asciidoc/pkg/asciidoc-8.1.0-noarch-2.tgz +---- + +Upon community members' recommendations, Sotirov's SlackPack is also considered +a reputable repository: https://sotirov-bg.net/slackpack/ and should cover most +if not all of the dependencies required for NUT building (including PowerMan, +IPMI etc.) + +NOTE: If setting up a CI farm agent with builds in RAM disk, keep in mind that +default mount options for `/dev/shm` preclude script execution. Either set up +the agent in a non-standard fashion (to use another work area), or if this is +a dedicated machine -- relax the mount options in `/etc/fstab`. Here is an +example with `noexec` which we *must avoid* for such use-case: +---- +:; mount | grep /dev/shm +tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev,noexec,relatime,inode64) +---- + FreeBSD 12.2 ~~~~~~~~~~~~ @@ -1189,9 +1349,9 @@ script or later during the build to fail. If that happens to you, disable the antivirus completely or exempt at least the NUT build area from protection. Windows with mingw ------------------- +^^^^^^^^^^^^^^^^^^ -See `scripts/Windows/README` for original recommendations for the effort, +See `scripts/Windows/README.adoc` for original recommendations for the effort, including possibilities of cross-builds with mingw available in Linux. Unfortunately these did not work for me at the time of testing, yielding @@ -1209,10 +1369,10 @@ and redirect on SourceForge. You can download and unpack 7z archives from https://sourceforge.net/projects/mingw-w64/files/mingw-w64/mingw-w64-release/ into e.g. `C:\Progra~1\mingw-w64\x86_64-8.1.0-release-posix-seh-rt_v6-rev0` location on your Windows system. Then for building further NUT dependencies -see `scripts/Windows/README`. +see `scripts/Windows/README.adoc`. Windows with MSYS2 ------------------- +^^^^^^^^^^^^^^^^^^ The MSYS2 ecosystem is available at https://www.msys2.org/ and builds upon earlier work by link:https://www.mingw-w64.org[MinGW-w64] (in turn a fork @@ -1344,7 +1504,7 @@ involved is very important. Notable packages *not found* in the repo: -* snmp (net-snmp, ucd-snmp) -- instructions in `scripts/Windows/README` +* snmp (net-snmp, ucd-snmp) -- instructions in `scripts/Windows/README.adoc` document now covers building it from source in MSYS2 MinGW x64 environment, essentially same as for Linux cross builds with proper `ARCH` and `PREFIX` * libregex (C version, direct NUT `configure` script support was added by diff --git a/docs/configure.txt b/docs/configure.txt index 81aef71408..623e5ec1cc 100644 --- a/docs/configure.txt +++ b/docs/configure.txt @@ -34,8 +34,8 @@ to produce a replacement by asking NUT programs for `--help` or for ---- :; upsd -DV -Network UPS Tools upsd 2.8.0.1 -Network UPS Tools version 2.8.0.1 configured with flags: --with-all=auto --with-doc=skip ... +Network UPS Tools upsd 2.8.1 +Network UPS Tools version 2.8.1 configured with flags: --with-all=auto --with-doc=skip ... ---- A more industrial approach is to use `lib/libupsclient-config --config-flags` diff --git a/docs/developer-guide.txt b/docs/developer-guide.txt index 18936a960b..ec60aa3982 100644 --- a/docs/developer-guide.txt +++ b/docs/developer-guide.txt @@ -113,6 +113,17 @@ Here is an example to setup a device simulation: For more information, refer to linkman:dummy-ups[8] manual page. +[[dev-simu-disco]] + +Simulated devices discovery +--------------------------- + +Any simulation file that is saved in the sysconfig directory can be +automatically discovered and configured using nut-scanner: ++ + $ nut-scanner -n + $ nut-scanner --nut_simulation_scan ++ [[dev-recording]] diff --git a/docs/developers.txt b/docs/developers.txt index 722d1699ea..b989da0424 100644 --- a/docs/developers.txt +++ b/docs/developers.txt @@ -170,7 +170,7 @@ Other hints ~~~~~~~~~~~ TIP: At this point NUT is expected to work correctly when built with a -C99 (or rather GNU99 on many systems) or newer standard. +"strict" C99 (or rather GNU99 on many systems) or newer standard. The NUT codebase may build in a mode without warnings made fatal on C89 (GNU89), but the emitted warnings indicate that those binaries may crash. @@ -178,8 +178,18 @@ By the end of 2021, NUT codebase has been revised to pass GNU and strict-C mode builds with C89 standard with the GCC toolkit (and on systems that do have the newer features in libraries, just hide them in standard headers); however CLANG toolkit is more restrictive about the C99+ syntax used. -If somebody in the community requires to build and run NUT on systems -that old, pull requests to fix the offending coding issues are welcome. +That said, some systems refuse to expose methods or types available in +their system headers and binary libraries if strict-C mode is used alone, +without extra system-specific defines to enable more than the baseline. + +It was also seen that cross-builds (e.g. NUT for Windows using mingw on +Linux) may be unable to define `WIN32` and/or find symbols for linking +when using a strict-C language standard. + +The C++ support expects C++11 or newer (not really configured or tested +for older C++98 or C++03), modulo features that were deprecated in later +language revisions (C++14 onwards) as highlighted by warnings from newer +compilers. Note also that the NUT codebase currently relies on certain features, such as the printf format modifiers for `(s)size_t`, use of `long long`, @@ -190,8 +200,16 @@ revisions). Many of the "offences" against the older standard actually come from system and third-party header files. That said, the NUT CI farm does run non-regression builds with GNU C89 -and strict C89 standard revisions and minimal passing warnings level, +and "strict" C89 standard revisions and minimal passing warnings level, to ensure that codebase is and remains at least basically compliant. +We try to cover a few distributions from early 2000's for this, either +in regular CI builds or one-off local builds for community members with +a zoo of old systems. + +If somebody in the community actually requires to build and run NUT on +systems that old, where newer compilers are not available, pull requests +to fix the offending coding issues in some way that does not break other +use-cases are welcome. Continuous Integration and Automated Builds ------------------------------------------- @@ -299,7 +317,8 @@ Jenkins CI ^^^^^^^^^^ Since mid-2021, the NUT CI farm is implemented by several virtual servers -courteously provided by http://fosshost.org +courteously provided by link:http://fosshost.org[Fosshost] and later by +link:https://www.digitalocean.com/?refcode=d2fbf2b9e082&utm_campaign=Referral_Invite&utm_medium=Referral_Program&utm_source=badge[DigitalOcean]. These run various operating systems as build agents, and a Jenkins instance to orchestrate the builds of NUT branches and pull requests on those agents. diff --git a/docs/docinfo.xml.in b/docs/docinfo.xml.in index 026db780c0..20284705e6 100644 --- a/docs/docinfo.xml.in +++ b/docs/docinfo.xml.in @@ -17,7 +17,7 @@ 2.8.1 - TBD + 2023-10-31 JK Some changes to API, docs and recipes, in particular to simplify local diff --git a/docs/images/ci/AppVeyor_logo-2x.png b/docs/images/ci/AppVeyor_logo-2x.png new file mode 100644 index 0000000000..f289509e1e Binary files /dev/null and b/docs/images/ci/AppVeyor_logo-2x.png differ diff --git a/docs/images/ci/AppVeyor_logo-ar21.png b/docs/images/ci/AppVeyor_logo-ar21.png new file mode 100644 index 0000000000..f3c277613b Binary files /dev/null and b/docs/images/ci/AppVeyor_logo-ar21.png differ diff --git a/docs/images/ci/CircleCI_vertical_black_logo.png b/docs/images/ci/CircleCI_vertical_black_logo.png new file mode 100644 index 0000000000..9691c7e881 Binary files /dev/null and b/docs/images/ci/CircleCI_vertical_black_logo.png differ diff --git a/docs/images/ci/DO_Powered_by_Badge_blue.png b/docs/images/ci/DO_Powered_by_Badge_blue.png new file mode 100644 index 0000000000..0d0163b023 Binary files /dev/null and b/docs/images/ci/DO_Powered_by_Badge_blue.png differ diff --git a/docs/images/ci/DO_Powered_by_Badge_blue_140pxW.png b/docs/images/ci/DO_Powered_by_Badge_blue_140pxW.png new file mode 100644 index 0000000000..cb9a3136d5 Binary files /dev/null and b/docs/images/ci/DO_Powered_by_Badge_blue_140pxW.png differ diff --git a/docs/images/ci/GitHub-Mark-140pxW.png b/docs/images/ci/GitHub-Mark-140pxW.png new file mode 100644 index 0000000000..755ab5e84d Binary files /dev/null and b/docs/images/ci/GitHub-Mark-140pxW.png differ diff --git a/docs/images/ci/GitHub-Mark-ea2971cee799.png b/docs/images/ci/GitHub-Mark-ea2971cee799.png new file mode 100644 index 0000000000..e28a837306 Binary files /dev/null and b/docs/images/ci/GitHub-Mark-ea2971cee799.png differ diff --git a/docs/images/ci/OC_logo-watercolor-256.png b/docs/images/ci/OC_logo-watercolor-256.png new file mode 100644 index 0000000000..7302bd9742 Binary files /dev/null and b/docs/images/ci/OC_logo-watercolor-256.png differ diff --git a/docs/images/ci/OC_logo_merged_140x26.png b/docs/images/ci/OC_logo_merged_140x26.png new file mode 100644 index 0000000000..67a6d7bc61 Binary files /dev/null and b/docs/images/ci/OC_logo_merged_140x26.png differ diff --git a/docs/images/ci/OC_logo_merged_171x32.png b/docs/images/ci/OC_logo_merged_171x32.png new file mode 100644 index 0000000000..a50bb86c32 Binary files /dev/null and b/docs/images/ci/OC_logo_merged_171x32.png differ diff --git a/docs/images/ci/OC_logotype.png b/docs/images/ci/OC_logotype.png new file mode 100644 index 0000000000..e34eae456a Binary files /dev/null and b/docs/images/ci/OC_logotype.png differ diff --git a/docs/images/ci/fosshost.org_Host_Dark_56px.png b/docs/images/ci/fosshost_org_Host_Dark_56px.png similarity index 100% rename from docs/images/ci/fosshost.org_Host_Dark_56px.png rename to docs/images/ci/fosshost_org_Host_Dark_56px.png diff --git a/docs/images/ci/fosshost.org_Host_Light_309px.png b/docs/images/ci/fosshost_org_Host_Light_309px.png similarity index 100% rename from docs/images/ci/fosshost.org_Host_Light_309px.png rename to docs/images/ci/fosshost_org_Host_Light_309px.png diff --git a/docs/images/ci/fosshost.org_Host_Light_38px.png b/docs/images/ci/fosshost_org_Host_Light_38px.png similarity index 100% rename from docs/images/ci/fosshost.org_Host_Light_38px.png rename to docs/images/ci/fosshost_org_Host_Light_38px.png diff --git a/docs/images/ci/gandi-ar21.png b/docs/images/ci/gandi-ar21.png new file mode 100644 index 0000000000..08e19e6183 Binary files /dev/null and b/docs/images/ci/gandi-ar21.png differ diff --git a/docs/images/ci/gandi-ar21.svg b/docs/images/ci/gandi-ar21.svg new file mode 100644 index 0000000000..9f543bde84 --- /dev/null +++ b/docs/images/ci/gandi-ar21.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/docs/images/ci/jenkins-nut-transparent-bg-140pxW.png b/docs/images/ci/jenkins-nut-transparent-bg-140pxW.png new file mode 100644 index 0000000000..e5cfeb9c4d Binary files /dev/null and b/docs/images/ci/jenkins-nut-transparent-bg-140pxW.png differ diff --git a/docs/images/ci/jenkins-nut.css b/docs/images/ci/jenkins-nut.css index 464f0e2d45..634bc00de0 100644 --- a/docs/images/ci/jenkins-nut.css +++ b/docs/images/ci/jenkins-nut.css @@ -6,8 +6,8 @@ * as published at https://www.jenkins.io/artwork/ collection * under https://creativecommons.org/licenses/by-sa/3.0/ license * - * Fosshost logo derived (resized to readable height in banner line) - * from https://fosshost.org/media/ + * DigitalOcean logo derived (resized to readable height in banner line) + * from https://opensource.nyc3.cdn.digitaloceanspaces.com/attribution/assets/PoweredByDO/DO_Powered_by_Badge_blue.png */ /* Custom style for Jenkins */ @@ -39,33 +39,33 @@ object-fit: contain; } .logo:after { -content: "CI for NUT"; +content: "NUT CI farm"; font-weight: bold; -font-size: 40px; +font-size: 24px; /* font-family: "Brush Script MT", cursive; */ margin-left: 20px; margin-right: 200px; color: Gold; -line-height: 40px; +line-height: 24px; } .logo { -background: url("/userContent/layout/fosshost.org_Host_Dark_56px.png"); +background: url("/userContent/layout/DO_Powered_by_Badge_blue_140pxW.png"); background-repeat: no-repeat; /* background-attachment: fixed; */ background-position: right; background-origin: content-box; - padding-right: 4px; - /* Glue to the search box, to hide FH logo plank color gap with background on the right side */ + padding-right: 14px; + /* Glue to the search box, to hide DO logo plank color gap with background on the right side */ } -/* Match color of fosshost logo */ +/* Match/contrast color of DigitalOcean logo */ .page-header { background-color: #2a2a2a; } /* .page-footer__footer-id-placeholder { -background: url("/userContent/layout/fosshost.org_Host_Dark_56px.png") no-repeat; +background: url("/userContent/layout/fosshost_org_Host_Dark_56px.png") no-repeat; } */ diff --git a/docs/images/ci/jenkins-nut.txt b/docs/images/ci/jenkins-nut.txt index d7356823e7..b7ca13378a 100644 --- a/docs/images/ci/jenkins-nut.txt +++ b/docs/images/ci/jenkins-nut.txt @@ -16,7 +16,11 @@ downscaled image for the Jenkins dashboard banner. There are variants in several resolutions available, and options with a larger or smaller NUT logo served on the Jenkins butler's plate. -The fosshost.org_Host_Dark_56px.png was downscaled from resources +The fosshost_org_Host_Dark_56px.png was downscaled from resources at https://fosshost.org/media/ to fit into the Jenkins dashboard banner and remain readable. Thanks to Fosshost for providing the machines involved in the new NUT CI farm! + +Logos of CI hosting companies and other organizations which help +the NUT project in daily operations were downloaded in 2023 for +the Acknowledgements chapter in the top-level `README.adoc`. diff --git a/docs/maintainer-guide.txt b/docs/maintainer-guide.txt index 331da3ae75..51c7561ab4 100644 --- a/docs/maintainer-guide.txt +++ b/docs/maintainer-guide.txt @@ -79,34 +79,84 @@ I insist on the *validation* to enter the trunk, since some changes might have to wait for major releases, to match our current release process. -SANDBOX (to be completed and pushed) +MAINTAINER SANDBOX (to be completed and pushed) + +* be sure to proceed with the below steps on a system provisioned with all + possible build prerequisites for NUT, especially regarding documentation + and nut-website building and checking, and with maintainer GPG keys in + the chain * clean up "in-development" bits from files, e.g.: -** TODO etc. referring planned future in the `NEWS` and `UPDATING` files +** TODO etc. referring planned future in the `NEWS.adoc` and `UPDATING.adoc` + files ** comment away the top-most (auto-resolved) NUT version and build date in `docs/docinfo.xml.in` -- DO NOT add (or at least commit) an entry for the actual fixed release version and date just yet ** NOTE: The `docs/docinfo.xml.sh` script can help update the list for existing git tags, if some were skipped before. This can be used to cheat a bit about adding the new entry (with a draft tag). -** commit this change (to add a revert-commit after the release tag) +** commit this change (to add a revert-commit after the release tag), e.g.: +---- +:; git commit -sm 'NEWS.adoc, UPGRADING.adoc, docs/docinfo.xml.in: finalize text before NUT v2.8.0 release' +---- + +* revise the contents of `NEWS.adoc` and `UPDATING.adoc` files; verify that + any recent changes to drivers (including `main.c` and other major impact + from common code) and sub-drivers (`*-hid.c` for `usbhid-ups`, `*-mib.c` + for `snmp-ups`, `nutdrv_qx_*` etc.) have been reflected in bumps to their + `DRIVER_VERSION` or equivalen macros +** ideally maintained during development, as features are getting merged for + community testing and future development baseline in the master branch +* NOTE that the `ChangeLog` file is currently not tracked in SCM +* update this document: `docs/maintainer-guide.txt` as it inevitably requires +* commit these finishing touches * bump the release identification: -** add an entry in `docs/docinfo.xml` for the actual fixed release version +** add an entry in `docs/docinfo.xml.in` for the actual fixed release version and date -** update version to (ex: 2.7.3) in nut/configure.ac -** revise the `NEWS` and `UPDATING` files -** generate/revise Changelog if needed - -* create a GPG-signed tag v (ex: v2.7.3) +** revise `.github/workflows/PyNUTClient.yml` for fallback `TAG_NAME` naming +** revise `appveyor.yml` for branch naming +** revise `scripts/Windows/build-mingw-nut.sh` for fallback value of `VER_OPT` +** update version to (ex: 2.8.0) in `configure.ac` +** commit with a relevant release message, e.g.: +---- +:; git commit -sm 'Update versions for release of NUT v2.8.0' +---- + +* last-minute update against possible master-branch changes (and be sure to + apply the release-version changes described above to your local copy of + the `master` branch, even if originally staged in another): +---- +:; git fetch --all && git rebase upstream/master +---- +* run the last-minute build to be sure the release is sane (no typos in any + recently changed document files, etc.) with `./ci_build.sh` or full ritual: +---- +:; rm -f Makefile configure +:; ./autogen.sh && \ + ./configure --with-all --with-dev --with-doc --enable-spellcheck \ + --enable-warnings --enable-Werror --enable-maintainer-mode && \ + make -j 8 all && \ + make -j 8 spellcheck && \ + make -j 8 distcheck +---- +* create a GPG-signed tag v (ex: v2.8.0): +---- +:; git tag -sm 'Release NUT v2.8.0' +---- ** 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 +* don't forget to push not only the code, but also the tag: +---- +:; git push upstream && git push --tags upstream +---- -* `make dist` to store the source tarball, checksum and signature iles +* `make dist` (if you did not `make distcheck` above or had some changes since + then) to store the source tarball, checksum and signature files * post-release update of the "in-development" codebase: -** maybe update nut/configure.ac version to .1 (ex: 2.7.3.1) +** maybe update nut/configure.ac version to .1 (ex: 2.8.0.1) ** `git revert` the commit which cleaned up "in-development" bits above ** Possibly resolve relevant merge conflicts for the changed context @@ -135,6 +185,14 @@ SANDBOX (to be completed and pushed) * draft and publish a GitHub release based on the signed tag ** attach the same copy of tarball, checksum and hash files as for nut-website +* Make sure that the PyNUT module for the tagged release got published to + the main PyPI repository, as a build associated with the NUT release + version. This *should* be ensured by the GitHub actions, but the curent + workflow definition uses both `paths` and `branches`/`tags` triggers and + this may cause a release to be skipped if the PyNUT sources did not change. + The `scripts/python/module/Makefile.am` recipes automate the needed actions + to happen from a prepared maintainer's operating environment. + * announce on mailing list, IRC, etc. ////////////////////////////////////////////////////////////////////////////// diff --git a/docs/man/Makefile.am b/docs/man/Makefile.am index 03e4d1bca0..2931bc5252 100644 --- a/docs/man/Makefile.am +++ b/docs/man/Makefile.am @@ -1,4 +1,4 @@ -# Network UPS Tools: man +# Network UPS Tools: man pages # # Notes: @@ -20,6 +20,8 @@ #EGREP = egrep EGREP = grep -E +all: + # Base configuration and client manpages, always installed SRC_CONF_PAGES = \ nut.conf.txt \ @@ -98,15 +100,15 @@ HTML_CLIENT_MANS = \ upsrw.html \ upssched.html -SRC_TOOL_PAGES = nut-scanner.txt nut-recorder.txt +SRC_TOOL_PAGES = nut-scanner.txt nut-recorder.txt nutconf.txt if WITH_MANS -MAN_TOOL_PAGES = nut-scanner.8 nut-recorder.8 +MAN_TOOL_PAGES = nut-scanner.8 nut-recorder.8 nutconf.8 endif WITH_MANS man8_MANS += $(MAN_TOOL_PAGES) -HTML_TOOL_MANS = nut-scanner.html nut-recorder.html +HTML_TOOL_MANS = nut-scanner.html nut-recorder.html nutconf.html # CGI (--with-cgi) related manpages SRC_CGI_PAGES = \ @@ -174,6 +176,7 @@ SRC_DEV_PAGES = \ nutscan_scan_usb.txt \ nutscan_scan_xml_http_range.txt \ nutscan_scan_nut.txt \ + nutscan_scan_nut_simulation.txt \ nutscan_scan_avahi.txt \ nutscan_scan_ipmi.txt \ nutscan_scan_eaton_serial.txt \ @@ -291,6 +294,7 @@ MAN3_DEV_PAGES = \ nutscan_scan_usb.3 \ nutscan_scan_xml_http_range.3 \ nutscan_scan_nut.3 \ + nutscan_scan_nut_simulation.3 \ nutscan_scan_avahi.3 \ nutscan_scan_ipmi.3 \ nutscan_scan_eaton_serial.3 \ @@ -303,6 +307,7 @@ MAN3_DEV_PAGES = \ nutscan_new_device.3 \ nutscan_free_device.3 \ nutscan_add_option_to_device.3 \ + nutscan_add_commented_option_to_device.3 \ nutscan_add_device_to_device.3 \ nutscan_get_serial_ports_list.3 \ nutscan_init.3 @@ -313,6 +318,10 @@ upscli_readline_timeout.3: upscli_readline.3 upscli_sendline_timeout.3: upscli_sendline.3 touch $@ +# Alias page for one text describing two commands: +nutscan_add_commented_option_to_device.3: nutscan_add_option_to_device.3 + touch $@ + MAN1_DEV_PAGES = \ libupsclient-config.1 @@ -360,6 +369,7 @@ HTML_DEV_MANS = \ nutscan_scan_usb.html \ nutscan_scan_xml_http_range.html \ nutscan_scan_nut.html \ + nutscan_scan_nut_simulation.html \ nutscan_scan_avahi.html \ nutscan_scan_ipmi.html \ nutscan_scan_eaton_serial.html \ @@ -379,6 +389,13 @@ HTML_DEV_MANS = \ sockdebug.html \ skel.html +# Can't make this work on all make implementations at once, so disabled for now +# Anyway it would be the same man-like page for several functions +HTML_DEV_MANS_FICTION = \ + nutscan_add_commented_option_to_device.html + +nutscan_add_commented_option_to_device.html: nutscan_add_option_to_device.html + test -n "$?" -a -s "$@" && rm -f $@ && ln -s $? $@ # Drivers related manpages @@ -822,7 +839,7 @@ LINKMAN_INCLUDE_GENERATED = linkman-driver-names.txt linkman-drivertool-names.tx LINKMAN_INCLUDE_CONSUMERS = index.txt upsd.txt nutupsdrv.txt linkman-driver-names.txt: - @if test x"$(srcdir)" != x"$(builddir)" ; then \ + @if test x"$(abs_srcdir)" != x"$(abs_builddir)" ; then \ if ! test -s "$(builddir)/$@" && test -s "$(srcdir)/$(@F)" ; then \ ln -fs "$(srcdir)/$(@F)" "$(builddir)/" ; \ fi ; \ @@ -837,7 +854,7 @@ linkman-driver-names.txt: @if test ! -s "$@" ; then echo "- No NUT drivers were built" > "$@" ; fi linkman-drivertool-names.txt: - @if test x"$(srcdir)" != x"$(builddir)" ; then \ + @if test x"$(abs_srcdir)" != x"$(abs_builddir)" ; then \ if ! test -s "$(builddir)/$@" && test -s "$(srcdir)/$(@F)" ; then \ ln -fs "$(srcdir)/$(@F)" "$(builddir)/" ; \ fi ; \ @@ -858,7 +875,8 @@ $(LINKMAN_INCLUDE_CONSUMERS): linkman-driver-names.txt linkman-drivertool-names. # git, and not part of tarball (to be in builddir) - so not in EXTRA_DIST. DISTCLEANFILES = $(LINKMAN_INCLUDE_GENERATED) -all: +# Make sure sources are there for out-of-tree builds: +$(HTML_MANS) $(MAN_MANS) index.html: $(abs_top_builddir)/docs/man/.prep-src-docs all-html html-man: $(HTML_MANS) index.html @@ -887,7 +905,7 @@ check-html-man: $(HTML_MANS) @FAILED=""; CHECKED=0; LANG=C; LC_ALL=C; export LANG; export LC_ALL; \ for F in $(HTML_MANS) ; do \ CHECKED="`expr $$CHECKED + 1`"; \ - test -s "$$F" && { file "$$F" | $(EGREP) -i '(XML|HTML.*document)' > /dev/null ; } || FAILED="$$FAILED $$F" ; \ + test -s "$$F" && { file "$$F" | $(EGREP) -i '(XML|HTML.*document|symbolic link)' > /dev/null ; } || FAILED="$$FAILED $$F" ; \ done; if test -n "$$FAILED" ; then \ echo "FAILED HTML-man sanity check for:$$FAILED" >&2 ; file $$FAILED >&2 ; exit 1; \ fi; echo "PASSED HTML-man sanity check (checked $$CHECKED files)"; exit 0 @@ -928,9 +946,9 @@ check-man-txt: $(SRC_ALL_PAGES) echo "FAILED man-source sanity check for:$$FAILED" >&2 ; file $$FAILED >&2 ; exit 1; \ fi; echo "PASSED man-source sanity check (checked $$CHECKED files)"; exit 0 -CLEANFILES = *-spellchecked +CLEANFILES = *-spellchecked .prep-src-docs *-prepped -SUFFIXES = .txt .html .1 .3 .5 .8 +SUFFIXES = .txt-prepped .txt .html .1 .3 .5 .8 # For builds with allowed installation of prebuild man pages, check that # they exist in sources (make would pull them automatically as a fallback @@ -963,11 +981,6 @@ DOCBUILD_BEGIN = { \ && ! test -w "${builddir}/docbook-xsl.css" \ ; then chmod u+w "${builddir}/docbook-xsl.css" ; fi ; \ chmod -R u+w "./$${A2X_OUTDIR}" || true ; \ - if test x"$(srcdir)" != x"$(builddir)" ; then \ - if ! test -s "$(builddir)/$<" && test -s "$(srcdir)/`basename $<`" ; then \ - ln -fs "$(srcdir)/`basename $<`" "$(builddir)/" ; \ - fi ; \ - fi ; \ A2X_VERBOSE="$(ASCIIDOC_VERBOSE)"; if [ "$(V)" = 1 ]; then A2X_VERBOSE="--verbose"; fi; \ } @@ -987,6 +1000,14 @@ DOCBUILD_END = { \ fi ; \ } +### Call the prep step consistently to create symlinks (out-of-tree) +### or just touch-files for peace of mind (in-tree builds). Then we +### use these path names (truncated "-prepped") now surely located +### in the builddir as the sources for rendered docs. +*.txt-prepped: $(abs_top_builddir)/docs/man/.prep-src-docs + +#.txt.txt-prepped: $(abs_top_builddir)/docs/man/.prep-src-docs + ### Regarding absolute paths in attributes below: by default asciidoc ### resolves include paths relative to the main document, so while we ### see the relative builddir as "." in the makefile, for included @@ -994,7 +1015,7 @@ DOCBUILD_END = { \ ### Note: `(top_)srcdir` and `(top_)builddir` must end with a path ### separator, or be empty -- so in all cases letting the resulting ### string resolve meaningfully in the filesystem during docs build. -.txt.html: +.txt-prepped.html: @A2X_OUTDIR="tmp/man-html.$(@F).$$$$" ; \ echo " DOC-MAN-HTML Generating $@"; \ $(DOCBUILD_BEGIN) ; RES=0; \ @@ -1006,7 +1027,7 @@ DOCBUILD_END = { \ --attribute builddir="$(abs_builddir)/" \ --attribute top_srcdir="$(abs_top_srcdir)/" \ --attribute top_builddir="$(abs_top_builddir)/" \ - -o "$${A2X_OUTDIR}/$(@F)" $< || RES=$$? ; \ + -o "$${A2X_OUTDIR}/$(@F)" "$(/dev/null`" ; then \ + rm -f "$@.$$$$" "$@.working" ; \ + exit 0; \ + fi ; \ + rm -f "$@.$$$$" ; \ + COUNT=0; \ + linksrcroot="$(abs_srcdir)" ; \ + for F in `echo $(PREP_SRC) | tr ' ' '\n' | sort -n | uniq` ; do \ + case "$$F" in \ + /*) F="`echo "$$F" | sed "s#^$(abs_top_srcdir)/*#./#"`"; \ + if test x"$${linkroot}" = x"$(abs_builddir)" ; then \ + linkroot="$(abs_top_builddir)" ; \ + linksrcroot="$(abs_top_srcdir)" ; \ + cd "$(abs_top_builddir)" ; \ + fi ;; \ + "$(srcdir)"/*) F="`echo "$$F" | sed 's#^$(srcdir)/*#./#'`" ;; \ + esac ; \ + D="`dirname "$$F"`" ; \ + $(MKDIR_P) "$${linkroot}/$$D" || { rm -f "$@.working" ; exit 1 ; } ; \ + if ! test -e "$${linkroot}/$$F" && test -s "$${linksrcroot}/$$F" ; then \ + echo " LN '$${linksrcroot}/$$F' => '$${linkroot}/$$F' (PWD = '`pwd`')" >&2 ; \ + ln -fs "$${linksrcroot}/$$F" "$${linkroot}/$$F" || { rm -f "$@.working" ; exit 1 ; } ; \ + COUNT="`expr $$COUNT + 1`" ; \ + fi ; \ + if ! test -e "$${linkroot}/$${F}-prepped" ; then \ + touch "$${linkroot}/$${F}-prepped" || { rm -f "$@.working" ; exit 1 ; } ; \ + COUNT="`expr $$COUNT + 1`" ; \ + fi ; \ + done ; \ + fi ; \ + if test "$$COUNT" -gt 0 -o ! -e "$@" ; then touch "$@" ; fi + @rm -f "$@.working" MAINTAINERCLEANFILES = Makefile.in .dirstamp clean-local: $(AM_V_at)rm -rf tmp + $(AM_V_at)for F in $(PREP_SRC) ; do \ + case "$$F" in \ + /*) F="`echo "$$F" | sed "s#^$(abs_top_srcdir)/*#./#"`"; cd "$(abs_top_builddir)" ;; \ + esac ; \ + if test x"$(abs_srcdir)" != x"$(abs_builddir)" ; then \ + if test -L "$$F" || test -h "$$F" ; then \ + rm -f "$$F" ; \ + fi ; \ + fi ; \ + rm -f "$${F}-prepped" ; \ + done ; \ + rm -f "$(abs_top_builddir)/docs/man/.prep-src-docs"* diff --git a/docs/man/al175.txt b/docs/man/al175.txt index c6a9b1da6d..276f85f11b 100644 --- a/docs/man/al175.txt +++ b/docs/man/al175.txt @@ -6,10 +6,14 @@ NAME al175 - Driver for Eltek UPS models with AL175 alarm module -NOTE ----- +SYNOPSIS +-------- + +*al175* -h + +*al175* -a 'UPS_NAME' ['OPTIONS'] -This man page only documents the hardware-specific features of the +NOTE: This man page only documents the hardware-specific features of the *al175* driver. For information about the core driver, see linkman:nutupsdrv[8]. diff --git a/docs/man/apc_modbus.txt b/docs/man/apc_modbus.txt index d26f7787cd..07cac400f6 100644 --- a/docs/man/apc_modbus.txt +++ b/docs/man/apc_modbus.txt @@ -6,11 +6,20 @@ NAME apc_modbus - Driver for APC Smart-UPS Modbus protocol +SYNOPSIS +-------- + +*apc_modbus* -h + +*apc_modbus* -a 'UPS_NAME' ['OPTIONS'] + SUPPORTED HARDWARE ------------------ Generally this driver should work for all the APC Modbus UPS devices. Some devices might expose more than is currently supported, like multiple phases. +A general rule of thumb is that APC devices (or firmware versions) released +after 2010 are more likely to support Modbus than the USB HID standard. Tested with the following hardware: @@ -21,6 +30,23 @@ Tested with the following hardware: Note that you will have to enable Modbus communication. In the front panel of the UPS, go to Advanced Menu mode, under Configuration and enable Modbus. +NOTE: This driver was tested with Serial, TCP and USB interfaces for Modbus. +Notably, the Serial ports are not available on all devices nowadays; the TCP +support may require a purchase of an additional network management card; and +the USB support *currently* requires a non-standard build of libmodbus (pull +request against the upstream library is pending, as of at the time of this +publication) as a pre-requisite to building NUT with this part of the support. +For more details (including how to build the custom library and NUT with it) +please see link:https://github.com/networkupstools/nut/pull/2063[NUT PR #2063] + +NOTE: As currently published, this driver supports reading information from +the UPS. Implementation of support to write (set modifiable variables or send +commands) is expected with a later release. This can impact the host shutdown +routines in particular (no ability to actively tell the UPS to power off or +cycle in the end). As a workaround, you can try integrating `apctest` (from +the "apcupsd" project) with a "Test to kill power" into your late-shutdown +procedure, if needed. + EXTRA ARGUMENTS --------------- diff --git a/docs/man/apcupsd-ups.txt b/docs/man/apcupsd-ups.txt index 83af59d8ac..710db8e60f 100644 --- a/docs/man/apcupsd-ups.txt +++ b/docs/man/apcupsd-ups.txt @@ -6,10 +6,14 @@ NAME apcupsd-ups - Driver for apcupsd client access -NOTE ----- +SYNOPSIS +-------- + +*apcupsd-ups* -h + +*apcupsd-ups* -a 'UPS_NAME' ['OPTIONS'] -This man page only documents the specific features of the +NOTE: This man page only documents the specific features of the *apcupsd-ups* driver. For information about the core driver, see linkman:nutupsdrv[8]. diff --git a/docs/man/asem.txt b/docs/man/asem.txt index 277a3279de..ccafdcda71 100644 --- a/docs/man/asem.txt +++ b/docs/man/asem.txt @@ -6,10 +6,14 @@ NAME asem - driver for UPS in ASEM PB1300 -NOTE ----- +SYNOPSIS +-------- + +*asem* -h + +*asem* -a 'UPS_NAME' ['OPTIONS'] -This man page only documents the hardware-specific features of the +NOTE: This man page only documents the hardware-specific features of the *asem* driver. For information about the core driver, see linkman:nutupsdrv[8]. diff --git a/docs/man/bcmxcp.txt b/docs/man/bcmxcp.txt index b9ca0e61d2..cfae0ebe76 100644 --- a/docs/man/bcmxcp.txt +++ b/docs/man/bcmxcp.txt @@ -6,10 +6,14 @@ NAME bcmxcp - Driver for UPSes supporting the serial BCM/XCP protocol -NOTE ----- +SYNOPSIS +-------- + +*bcmxcp* -h + +*bcmxcp* -a 'UPS_NAME' ['OPTIONS'] -This man page only documents the hardware-specific features of the +NOTE: This man page only documents the hardware-specific features of the bcmxcp driver. For information about the core driver, see linkman:nutupsdrv[8]. diff --git a/docs/man/bcmxcp_usb.txt b/docs/man/bcmxcp_usb.txt index 5151a1885d..bf980a416e 100644 --- a/docs/man/bcmxcp_usb.txt +++ b/docs/man/bcmxcp_usb.txt @@ -7,14 +7,19 @@ NAME bcmxcp_usb - Experimental driver for UPSes supporting the BCM/XCP protocol over USB -NOTE ----- +SYNOPSIS +-------- + +*bcmxcp_usb* -h -This man page only documents the hardware-specific features of the +*bcmxcp_usb* -a 'UPS_NAME' ['OPTIONS'] + +NOTE: This man page only documents the hardware-specific features of the bcmxcp_usb driver. For information about the core driver, see linkman:nutupsdrv[8]. -This driver is a variant of the serial driver bcmxcp and uses the same -core code. + +NOTE: This driver is a variant of the serial driver linkman:bcmxcp[8] and +uses the same core code. SUPPORTED HARDWARE ------------------ diff --git a/docs/man/belkin.txt b/docs/man/belkin.txt index 5db6d91560..d12c90ab68 100644 --- a/docs/man/belkin.txt +++ b/docs/man/belkin.txt @@ -6,10 +6,14 @@ NAME belkin - Driver for Belkin serial UPS equipment -NOTE ----- +SYNOPSIS +-------- + +*belkin* -h + +*belkin* -a 'UPS_NAME' ['OPTIONS'] -This man page only documents the hardware-specific features of the +NOTE: This man page only documents the hardware-specific features of the belkin driver. For information about the core driver, see linkman:nutupsdrv[8]. diff --git a/docs/man/belkinunv.txt b/docs/man/belkinunv.txt index dd6424e894..1723acc197 100644 --- a/docs/man/belkinunv.txt +++ b/docs/man/belkinunv.txt @@ -6,15 +6,19 @@ NAME belkinunv - Driver for Belkin "Universal UPS" and compatible -NOTE ----- +SYNOPSIS +-------- + +*belkinunv* -h + +*belkinunv* -a 'UPS_NAME' ['OPTIONS'] -This man page only documents the hardware-specific features of the +NOTE: This man page only documents the hardware-specific features of the belkin driver. For information about the core driver, see linkman:nutupsdrv[8]. -This driver only supports serial connections. If your UPS has a USB port, -please consult the Hardware Compatibility List (HCL) to see which of +NOTE: This driver only supports serial connections. If your UPS has a USB +port, please consult the Hardware Compatibility List (HCL) to see which of the USB drivers you should use. SUPPORTED HARDWARE diff --git a/docs/man/bestfcom.txt b/docs/man/bestfcom.txt index 7309cebb29..567bba2168 100644 --- a/docs/man/bestfcom.txt +++ b/docs/man/bestfcom.txt @@ -6,10 +6,14 @@ NAME bestfcom - Driver for Best Power Fortress/Ferrups -NOTE ----- +SYNOPSIS +-------- + +*bestfcom* -h + +*bestfcom* -a 'UPS_NAME' ['OPTIONS'] -This man page only documents the hardware-specific features of the +NOTE: This man page only documents the hardware-specific features of the bestfcom driver. For information about the core driver, see linkman:nutupsdrv[8]. diff --git a/docs/man/bestfortress.txt b/docs/man/bestfortress.txt index 5593619cf7..9c4101ac92 100644 --- a/docs/man/bestfortress.txt +++ b/docs/man/bestfortress.txt @@ -6,10 +6,14 @@ NAME bestfortress - Driver for old Best Fortress UPS equipment -NOTE ----- +SYNOPSIS +-------- + +*bestfortress* -h + +*bestfortress* -a 'UPS_NAME' ['OPTIONS'] -This man page only documents the hardware-specific features of the +NOTE: This man page only documents the hardware-specific features of the bestfortress driver. For information about the core driver, see linkman:nutupsdrv[8]. diff --git a/docs/man/bestuferrups.txt b/docs/man/bestuferrups.txt index 33059090ac..382e13a29a 100644 --- a/docs/man/bestuferrups.txt +++ b/docs/man/bestuferrups.txt @@ -6,10 +6,14 @@ NAME bestuferrups - Driver for Best Power Micro-Ferrups -NOTE ----- +SYNOPSIS +-------- + +*bestuferrups* -h + +*bestuferrups* -a 'UPS_NAME' ['OPTIONS'] -This man page only documents the hardware-specific features of the +NOTE: This man page only documents the hardware-specific features of the bestuferrups driver. For information about the core driver, see linkman:nutupsdrv[8]. diff --git a/docs/man/bestups.txt b/docs/man/bestups.txt index 6c4561c9a1..90f5960c2b 100644 --- a/docs/man/bestups.txt +++ b/docs/man/bestups.txt @@ -6,10 +6,14 @@ NAME bestups - Driver for Best Power / SOLA (Phoenixtec protocol) UPS equipment -NOTE ----- +SYNOPSIS +-------- + +*bestups* -h + +*bestups* -a 'UPS_NAME' ['OPTIONS'] -This man page only documents the hardware-specific features of the +NOTE: This man page only documents the hardware-specific features of the bestups driver. For information about the core driver, see linkman:nutupsdrv[8]. diff --git a/docs/man/blazer_ser.txt b/docs/man/blazer_ser.txt index 344e98ff6c..48f68c362f 100644 --- a/docs/man/blazer_ser.txt +++ b/docs/man/blazer_ser.txt @@ -7,4 +7,11 @@ NAME blazer_ser - Driver for Megatec/Q1 protocol serial based UPS equipment +SYNOPSIS +-------- + +*blazer_ser* -h + +*blazer_ser* -a 'UPS_NAME' ['OPTIONS'] + include::blazer-common.txt[] diff --git a/docs/man/blazer_usb.txt b/docs/man/blazer_usb.txt index 1fa4e8e0dc..21ec6b4bf7 100644 --- a/docs/man/blazer_usb.txt +++ b/docs/man/blazer_usb.txt @@ -7,4 +7,11 @@ NAME blazer_usb - Driver for Megatec/Q1 protocol USB based UPS equipment +SYNOPSIS +-------- + +*blazer_usb* -h + +*blazer_usb* -a 'UPS_NAME' ['OPTIONS'] + include::blazer-common.txt[] diff --git a/docs/man/clone.txt b/docs/man/clone.txt index b4bb54e5e7..d5ee2e4a8c 100644 --- a/docs/man/clone.txt +++ b/docs/man/clone.txt @@ -6,10 +6,14 @@ NAME clone - UPS driver clone -NOTE ----- +SYNOPSIS +-------- + +*clone* -h + +*clone* -a 'UPS_NAME' ['OPTIONS'] -This man page only documents the specific features of the +NOTE: This man page only documents the specific features of the clone driver. For information about the core driver, see linkman:nutupsdrv[8]. diff --git a/docs/man/dummy-ups.txt b/docs/man/dummy-ups.txt index 8ef2f555fa..b45de7d85d 100644 --- a/docs/man/dummy-ups.txt +++ b/docs/man/dummy-ups.txt @@ -6,10 +6,14 @@ NAME dummy-ups - Driver for multi-purpose UPS emulation -NOTE ----- +SYNOPSIS +-------- + +*dummy-ups* -h -This man page only documents the specific features of the +*dummy-ups* -a 'UPS_NAME' ['OPTIONS'] + +NOTE: This man page only documents the specific features of the *dummy-ups* driver. For information about the core driver, see linkman:nutupsdrv[8]. @@ -174,7 +178,7 @@ second), independently of (and/or in addition to) any `TIMER` keywords. Repeater Mode ~~~~~~~~~~~~~ -In this context, `port` in the `ups.conf` block is the name of a remote UPS, +In this context, `port` in the `ups.conf` block is the name of the target UPS, using the NUT format, i.e.: @[:] @@ -195,6 +199,11 @@ bit between data-requesting cycles (currently this delay is hardcoded to one second), so propagation of data updates available to a remote `upsd` may lag by this much. +Beware that any error encountered at repeater mode startup (e.g. when not all +target UPS to be repeated or `upsd` instances are connectable yet) will cause +*dummy-ups* driver to terminate prematurely. This behaviour can be changed by +setting the `repeater_disable_strict_start` flag, making such errors non-fatal. + INTERACTION ----------- diff --git a/docs/man/etapro.txt b/docs/man/etapro.txt index f5eeca0cbb..3100fe4b34 100644 --- a/docs/man/etapro.txt +++ b/docs/man/etapro.txt @@ -6,10 +6,14 @@ NAME etapro - Driver for ETA UPS equipment -NOTE ----- +SYNOPSIS +-------- + +*etapro* -h + +*etapro* -a 'UPS_NAME' ['OPTIONS'] -This man page only documents the hardware-specific features of the +NOTE: This man page only documents the hardware-specific features of the etapro driver. For information about the core driver, see linkman:nutupsdrv[8]. diff --git a/docs/man/everups.txt b/docs/man/everups.txt index 564d823587..8945f19aad 100644 --- a/docs/man/everups.txt +++ b/docs/man/everups.txt @@ -6,10 +6,14 @@ NAME everups - Driver for Ever UPS models -NOTE ----- +SYNOPSIS +-------- + +*everups* -h + +*everups* -a 'UPS_NAME' ['OPTIONS'] -This man page only documents the hardware-specific features of the +NOTE: This man page only documents the hardware-specific features of the everups driver. For information about the core driver, see linkman:nutupsdrv[8]. diff --git a/docs/man/gamatronic.txt b/docs/man/gamatronic.txt index dcf1aafb63..29d071b9fb 100644 --- a/docs/man/gamatronic.txt +++ b/docs/man/gamatronic.txt @@ -6,10 +6,14 @@ NAME gamatronic - Driver for Gamatronic UPS equipment -NOTE ----- +SYNOPSIS +-------- + +*gamatronic* -h + +*gamatronic* -a 'UPS_NAME' ['OPTIONS'] -This man page only documents the hardware-specific features of the +NOTE: This man page only documents the hardware-specific features of the gamatronic driver. For information about the core driver, see linkman:nutupsdrv[8]. diff --git a/docs/man/genericups.txt b/docs/man/genericups.txt index a67eb68289..31a2b93d94 100644 --- a/docs/man/genericups.txt +++ b/docs/man/genericups.txt @@ -6,10 +6,14 @@ NAME genericups - Driver for contact-closure UPS equipment -NOTE ----- +SYNOPSIS +-------- + +*genericups* -h + +*genericups* -a 'UPS_NAME' ['OPTIONS'] -This man page only documents the specific features of the genericups +NOTE: This man page only documents the specific features of the genericups driver. For information about the core driver, see linkman:nutupsdrv[8]. SUPPORTED HARDWARE diff --git a/docs/man/huawei-ups2000.txt b/docs/man/huawei-ups2000.txt index f2c0f676c0..fadd11c39c 100644 --- a/docs/man/huawei-ups2000.txt +++ b/docs/man/huawei-ups2000.txt @@ -1,5 +1,5 @@ HUAWEI_UPS2000(8) -================== +================= NAME ---- diff --git a/docs/man/isbmex.txt b/docs/man/isbmex.txt index ba7c76b8a1..f8638e3b6f 100644 --- a/docs/man/isbmex.txt +++ b/docs/man/isbmex.txt @@ -6,10 +6,14 @@ NAME isbmex - Driver for ISBMEX UPS equipment -NOTE ----- +SYNOPSIS +-------- + +*isbmex* -h + +*isbmex* -a 'UPS_NAME' ['OPTIONS'] -This man page only documents the hardware-specific features of the +NOTE: This man page only documents the hardware-specific features of the isbmex driver. For information about the core driver, see linkman:nutupsdrv[8]. diff --git a/docs/man/ivtscd.txt b/docs/man/ivtscd.txt index c45aafd4a4..5d6da16972 100644 --- a/docs/man/ivtscd.txt +++ b/docs/man/ivtscd.txt @@ -6,10 +6,14 @@ NAME ivtscd - driver for the IVT Solar Controller Device -NOTE ----- +SYNOPSIS +-------- + +*ivtscd* -h + +*ivtscd* -a 'UPS_NAME' ['OPTIONS'] -This man page only documents the hardware-specific features of the +NOTE: This man page only documents the hardware-specific features of the *ivtscd* driver. For information about the core driver, see linkman:nutupsdrv[8]. diff --git a/docs/man/liebert-esp2.txt b/docs/man/liebert-esp2.txt index fb6509a862..95b364878b 100644 --- a/docs/man/liebert-esp2.txt +++ b/docs/man/liebert-esp2.txt @@ -1,15 +1,19 @@ LIEBERT-ESP2(8) -============== +=============== NAME ---- liebert-esp2 - Driver for Liebert UPS, using the ESP-II serial protocol -NOTE ----- +SYNOPSIS +-------- + +*liebert-esp2* -h + +*liebert-esp2* -a 'UPS_NAME' ['OPTIONS'] -This man page only documents the hardware-specific features of the +NOTE: This man page only documents the hardware-specific features of the liebert-esp2 driver. For information about the core driver, see linkman:nutupsdrv[8]. diff --git a/docs/man/liebert.txt b/docs/man/liebert.txt index 5798851839..ce8bb6c9e3 100644 --- a/docs/man/liebert.txt +++ b/docs/man/liebert.txt @@ -6,10 +6,14 @@ NAME liebert - Driver for Liebert contact-closure UPS equipment -NOTE ----- +SYNOPSIS +-------- + +*liebert* -h + +*liebert* -a 'UPS_NAME' ['OPTIONS'] -This man page only documents the hardware-specific features of the +NOTE: This man page only documents the hardware-specific features of the liebert driver. For information about the core driver, see linkman:nutupsdrv[8]. diff --git a/docs/man/macosx-ups.txt b/docs/man/macosx-ups.txt index 16752ca271..bd57e38b7b 100644 --- a/docs/man/macosx-ups.txt +++ b/docs/man/macosx-ups.txt @@ -6,10 +6,14 @@ NAME macosx-ups - monitor for Mac OS X built-in UPS and battery driver -NOTE ----- +SYNOPSIS +-------- + +*macosx-ups* -h + +*macosx-ups* -a 'UPS_NAME' ['OPTIONS'] -This man page only documents the hardware-specific features of the +NOTE: This man page only documents the hardware-specific features of the *macosx-ups* driver. For information about the core driver, see linkman:nutupsdrv[8]. diff --git a/docs/man/masterguard.txt b/docs/man/masterguard.txt index 69ff47c67c..9a2a06f50c 100644 --- a/docs/man/masterguard.txt +++ b/docs/man/masterguard.txt @@ -6,10 +6,14 @@ NAME masterguard - Driver for Masterguard UPS equipment -NOTE ----- +SYNOPSIS +-------- + +*masterguard* -h + +*masterguard* -a 'UPS_NAME' ['OPTIONS'] -This man page only documents the hardware-specific features of the +NOTE: This man page only documents the hardware-specific features of the masterguard driver. For information about the core driver, see linkman:nutupsdrv[8]. diff --git a/docs/man/metasys.txt b/docs/man/metasys.txt index 68d3f6dbe6..519c294700 100644 --- a/docs/man/metasys.txt +++ b/docs/man/metasys.txt @@ -6,10 +6,14 @@ NAME metasys - Driver for Meta System UPS equipment -NOTE ----- +SYNOPSIS +-------- + +*metasys* -h + +*metasys* -a 'UPS_NAME' ['OPTIONS'] -This man page only documents the hardware-specific features of the +NOTE: This man page only documents the hardware-specific features of the metasys driver. For information about the core driver, see linkman:nutupsdrv[8]. diff --git a/docs/man/microdowell.txt b/docs/man/microdowell.txt index 820a86695c..a2dc8ea32d 100644 --- a/docs/man/microdowell.txt +++ b/docs/man/microdowell.txt @@ -6,10 +6,14 @@ NAME microdowell - Driver for Microdowell Enterprise UPS series -NOTE ----- +SYNOPSIS +-------- + +*microdowell* -h + +*microdowell* -a 'UPS_NAME' ['OPTIONS'] -This man page only documents the hardware-specific features of the +NOTE: This man page only documents the hardware-specific features of the Microdowell driver. For information about the core driver, see linkman:nutupsdrv[8]. diff --git a/docs/man/microsol-apc.txt b/docs/man/microsol-apc.txt index 015f9866db..096602f0c6 100644 --- a/docs/man/microsol-apc.txt +++ b/docs/man/microsol-apc.txt @@ -6,10 +6,14 @@ NAME microsol-apc - Driver for APC Back-UPS BR UPS equipment -NOTE ----- +SYNOPSIS +-------- + +*microsol-apc* -h + +*microsol-apc* -a 'UPS_NAME' ['OPTIONS'] -This man page only documents the hardware-specific features of the +NOTE: This man page only documents the hardware-specific features of the microsol-apc driver. For information about the core driver, see linkman:nutupsdrv[8]. diff --git a/docs/man/netxml-ups.txt b/docs/man/netxml-ups.txt index 84e8d4f222..658168cb9b 100644 --- a/docs/man/netxml-ups.txt +++ b/docs/man/netxml-ups.txt @@ -7,10 +7,14 @@ NAME netxml-ups - Driver for Eaton / MGE Network Management Card / Proxy (XML/HTTP Protocol) equipment -NOTE ----- +SYNOPSIS +-------- + +*netxml-ups* -h + +*netxml-ups* -a 'UPS_NAME' ['OPTIONS'] -This man page only documents the hardware-specific features of the +NOTE: This man page only documents the hardware-specific features of the netxml-ups driver. For information about the core driver, see linkman:nutupsdrv[8]. diff --git a/docs/man/nut-driver-enumerator.txt b/docs/man/nut-driver-enumerator.txt index 5b177d5a37..51b8b6f66f 100644 --- a/docs/man/nut-driver-enumerator.txt +++ b/docs/man/nut-driver-enumerator.txt @@ -52,6 +52,12 @@ Update wrapping of devices into services Update wrapping of devices into services in an infinite loop; Default freq is 60 sec. +*nut-driver-enumerator.sh --daemon-after(=freq)*:: +Update wrapping of devices into services in an infinite loop; +first do one run of the loop though, then daemonize (this way +service unit is deemed started only when NUT config and driver +instances are in sync). Default freq is 60 sec. + *nut-driver-enumerator.sh --reconfigure*:: Stop and un-register all service instances and recreate them (e.g. if new dependency template was defined in a new diff --git a/docs/man/nut-scanner.txt b/docs/man/nut-scanner.txt index e45dd51720..df635160f3 100644 --- a/docs/man/nut-scanner.txt +++ b/docs/man/nut-scanner.txt @@ -19,6 +19,10 @@ DESCRIPTION *nut-scanner* scans available communication buses and displays any NUT-compatible devices it has found. +*nut-scanner* can also display the detected devices in various formats, +including ups.conf, and ensures that the generated devices name are unique +across buses. + INSTALLATION ------------ @@ -55,6 +59,18 @@ Scan all available communication buses (default behavior) *-U* | *--usb_scan*:: List all NUT-compatible USB devices currently plugged in. ++ +This option can be specified several times, for more hardware link-specific +details; these can be counter-productive in case of USB enumeration changes +over time: ++ +| `-U` | do not report any bus/device/busport details | +| `-UU` | report bus and busport, if available | +| `-UUU` | report bus/device/busport details | +| `-UUUU` | report bus/device/busport details, and bcdDevice (limited use and benefit) | ++ +NOTE: For reliability, it is preferable to match just by vendor and product +identification, and a serial number if available and unique. *-S* | *--snmp_scan*:: Scan SNMP devices. Requires at least a 'start IP', and optionally, @@ -67,6 +83,9 @@ interfaces to retrieve XML/HTTP capable devices. No IP required in this mode. *-O* | *--oldnut_scan*:: Scan NUT devices (i.e. upsd daemon) on IP ranging from 'start IP' to 'end IP'. +*-n* | *--nut_simulation_scan*:: +Scan NUT simulated devices (.dev files in $CONFPATH). + *-A* | *--avahi_scan*:: Scan NUT servers using Avahi request on the current network interfaces. No IP required. @@ -88,7 +107,6 @@ ports using 'X-Y', where X and Y are characters referring to the port number. - a single port name. - a list of ports name, coma separated, like '/dev/ttyS1,/dev/ttyS4'. - NETWORK OPTIONS --------------- @@ -216,35 +234,65 @@ EXAMPLES To scan USB devices only: -*nut-scanner -U* +---- +:; nut-scanner -U + +[nutdev-usb1] + driver = "snmp-ups" + port = "192.168.0.42" +---- To scan SNMP v1 device with public community on address range 192.168.0.0 to 192.168.0.255: -*nut-scanner -S -s 192.168.0.0 -e 192.168.0.255* +---- +:; nut-scanner -S -s 192.168.0.0 -e 192.168.0.255 + +[nutdev-snmp1] + driver = "snmp-ups" + port = "192.168.0.42" +---- The same using CIDR notation: -*nut-scanner -S -m 192.168.0.0/24* +---- +:; nut-scanner -S -m 192.168.0.0/24 + +[nutdev-snmp1] + driver = "snmp-ups" + port = "192.168.0.42" +---- To scan NUT servers with a timeout of 10 seconds on IP range 192.168.0.0 to 192.168.0.127 using CIDR notation: -*nut-scanner -O -t 10 -m 192.168.0.0/25* +---- +:; nut-scanner -O -t 10 -m 192.168.0.0/25 + +[nutdev-nut1] + driver = "dummy-ups" + port = "dummy-test@192.168.1.28" +---- To scan for power supplies, through IPMI (1.5 mode) over the network, on address range 192.168.0.0 to 192.168.0.255 using CIDR notation: -*nut-scanner -I -m 192.168.0.0/24 -b username -B password* +---- +:; nut-scanner -I -m 192.168.0.0/24 -b username -B password +---- -To scan for Eaton serial devices on ports 0 and 1 (/dev/ttyS0, -/dev/ttyUSB0, /dev/ttyS1 and /dev/ttyUSB1 on Linux): +To scan for Eaton serial devices on ports 0 and 1 (`/dev/ttyS0`, +`/dev/ttyUSB0`, `/dev/ttyS1` and `/dev/ttyUSB1` on Linux): -*nut-scanner --eaton_serial 0-1* +---- +:; nut-scanner --eaton_serial 0-1 +---- -To scan for Eaton serial devices on ports 1 and 2 (COM1 and COM2 on Windows): +To scan for Eaton serial devices on ports 1 and 2 (`COM1` and `COM2` on Windows): -*nut-scanner --eaton_serial 1-2* +---- +:; nut-scanner --eaton_serial 1-2 +---- SEE ALSO -------- diff --git a/docs/man/nut.conf.txt b/docs/man/nut.conf.txt index 182f04cd01..2df3552645 100644 --- a/docs/man/nut.conf.txt +++ b/docs/man/nut.conf.txt @@ -65,6 +65,20 @@ If you want a data server always running and responding on the network, even if it initially has nothing to serve (may be live-reloaded later, when devices become configured), this option is for you. +*ALLOW_NOT_ALL_LISTENERS*:: +Optional, defaults to `false`. Set this to `true` to allow starting the `upsd` +NUT data server even if not all `LISTEN` directives can be honoured at the +moment. This environment variable overrides the built-in "false" flag in the +`upsd` program, and an optional same-named default flag that can be set in +`upsd.conf`. ++ +If you want a data server always running, even if it would potentially not +serve all clients on every uptime, this option is for you (note you would +have to restart `upsd` to pick up the `LISTEN`ed IP address if it appears +later). ++ +Probably configuring `LISTEN *` is a better choice in such cases. + *UPSD_OPTIONS*:: Optional. Set upsd specific options. See linkman:upsd[8] for more details. It is ignored when 'MODE' above indicates that no upsd diff --git a/docs/man/nutconf.txt b/docs/man/nutconf.txt new file mode 100644 index 0000000000..2485f94aaa --- /dev/null +++ b/docs/man/nutconf.txt @@ -0,0 +1,257 @@ +NUTCONF(8) +========== + + +NAME +---- +nutconf - NUT configuration tool + +SYNOPSIS +-------- +*nutconf* --help + +*nutconf* ['OPTIONS'] + +DESCRIPTION +----------- + +*nutconf* tool is used to create and manipulate NUT configuration files. +It also supports device scanning (to suggest configuration of devices). + +INSTALLATION +------------ + +The scanning feature depends on the very same compile time and run time +dependencies as the *nut-scanner*. + +OPTIONS +------- + +*-h* | *-help* | *--help*:: +Display the help text. + +*-v* | *--verbose*:: +Increase output verbosity (may be used multiple times). + +*--is-configured*:: +Checks whether NUT was configured, before. + +*--system*:: +System configuration directory shall be used. + +*--local* 'directory':: +Sets alternative configuration directory. + +*--get-mode*:: +Prints current NUT configuration mode + +*--set-mode* 'mode':: +Sets NUT configuration mode. + + :: +Known modes are: + +- standalone +- netserver +- netclient +- controlled +- manual +- none + +CONFIGURATION ENTRY SET/ADD OPTIONS +----------------------------------- + +These options mostly have 2 forms: '--set-...' or '--add-...'. + +The difference is that the set options discard previous settings +while the add options keep them. + +Note that such options may be specified multiple times for one run +(to enable setting multiple entries at once). + +*--set-monitor* | *--add-monitor* '':: +Sets/adds a NUT monitor. + + :: +Arguments: +'' '[:]' '' '' '' '(\"master\"|\"slave\")' + +*--set-listen* | *--add-listen* '
' '[]':: +Sets/adds 'upsd' daemon listen address + +*--set-device* | *--add-device* '':: +Sets/adds a device (typically a UPS). + + :: +Arguments: +'' '' '' '[=]*' + + :: +The attribute/value pairs follow device configuration syntax. +Devices may have very different configuration attributes depending on the driver. +Exhaustive description of them is beyond this man page and may be found in NUT documentation. + +*--set-notifyflags* | *--add-notifyflags* '' '+':: +Sets/adds notification flags for the notification type. + + :: +Notification types are: + +- 'ONLINE' (mains is present) +- 'ONBATT' (mains is gone) +- 'LOWBATT' (remaining battery capacity is low) +- 'FSD' (shutdown was forced) +- 'COMMOK' (communication with device established) +- 'COMMBAD' (lost communication with device) +- 'SHUTDOWN' (system is going down, now) +- 'REPLBATT' (UPS battery needs replacing) +- 'NOCOMM' (device is unavailable) +- 'NOPARENT' (upsmon parent process died, shutdown is impossible) + + :: +Notification flags: + +- 'SYSLOG' (use syslogd to log the notification) +- 'WALL' (push a message to users' terminals) +- 'EXEC' (execute a command) +- 'IGNORE' (don't act) + +*--set-notifymsg* '' '':: +Sets message for the specified notification type. + +*--set-shutdowncmd* '':: +Sets command used to shut the system down. + +*--set-user* | *--add-user* '':: +Sets/adds NUT user. + + :: +Arguments: + +- '' (specifies user name). +For 'upsmon' user, it has a special form of +'upsmon=(master|slave)' which specifies the monitoring mode. +- 'password=' sets password for the user +- 'actions=' sets actions ('SET', 'FSD' are supported) +- 'instcmds=' sets instant commands allowed for the user +(may be used multiple times) + +SCANNING OPTIONS +---------------- + +Availability of each scanning option depends on availability of +various 3rd-party libraries both at compile time and run time. + +Issue the tool with the *--help* option to check which of the +*--scan-...* options are actually supported. + +All timeouts are in microseconds. + +*--scan-snmp* '' '' '[=]*':: +Scans for SNMP devices on IP addresses from the specified range. + + :: +Known attributes are: + +- 'timeout' device scan timeout +- 'community' SNMP community (default: *public*) +- 'sec-level' security level (SNMPv3); one of *noAuthNoPriv* *authNoPriv*, *authPriv* +- 'sec-name' security name (SNMPv3); mandatory companion of *sec-level* +- 'auth-password' authentication password (SNMPv3); mandatory for *authNoPriv* and *authPriv* +- 'priv-password' privacy password (SNMPv3); mandatory for *authPriv* +- 'auth-protocol' authentication protocol (SNMPv3): *MD5* or *SHA*, *MD5* is the default +- 'priv-protocol' priv. protocol (SNMPv3): *DES* or *AES*, *DES* is the default +- 'peer-name' peer name + +*--scan-usb*:: +Scans the USB bus for known devices + +*--scan-xml-http* '[]':: +Scans for XML/HTTP devices on the network. + +*--scan-nut* '' '' '' '[]':: +Scans for NUT (pseudo-)devices on the network. + +*--scan-avahi* '[]':: +Scans for Avahi devices. + +*--scan-ipmi* '' '' '[=]'*:: +Scans for IPMI devices on IP addresses from the specified range. + + :: +Known attributes are: + +- 'username' username (mandatory for IPMI/LAN) +- 'password' user password (mandatory for IPMI/LAN) +- 'auth-type' authentication type (see below) +- 'cipher-suite-id' cipher suite ID (see below) +- 'K-g-BMC-key' optional second key (???) +- 'priv-level' priv. level +- 'workaround-flags' +- 'version' (1.5 or 2.0) + + :: +Authentication types: + :: +Specifies the IPMI 1.5 authentication type to use (NONE, STRAIGHT_PASSWORD_KEY, MD2, and MD5) with the remote host (default=MD5). +This forces connection through the 'lan' IPMI interface , thus in IPMI 1.5 mode. + +- 'none' (authentication is disabled) +- 'MD2' +- 'MD5' (default) +- 'plain-password' (no ciphering used for password sending) +- 'OEM' +- 'RMCPplus' + + :: +Cipher suite IDs: + :: +Specifies the IPMI 2.0 cipher suite ID to use. The Cipher Suite ID identifies a set of authentication, integrity, and +confidentiality algorithms to use for IPMI 2.0 communication. The authentication algorithm identifies the algorithm +to use for session setup, the integrity algorithm identifies the algorithm to use for session packet signatures, and the +confidentiality algorithm identifies the algorithm to use for payload encryption (default=3). + :: +The following cipher suite ids are currently supported (Authentication; Integrity; Confidentiality): + +- '0': None; None; None +- '1': HMAC-SHA1; None; None +- '2': HMAC-SHA1; HMAC-SHA1-96; None +- '3': HMAC-SHA1; HMAC-SHA1-96; AES-CBC-128 +- '6': HMAC-MD5; None; None +- '7': HMAC-MD5; HMAC-MD5-128; None +- '8': HMAC-MD5; HMAC-MD5-128; AES-CBC-128 +- '11': HMAC-MD5; MD5-128; None +- '12': HMAC-MD5; MD5-128; AES-CBC-128 +- '15': HMAC-SHA256; None; None +- '16': HMAC-SHA256; HMAC_SHA256_128; None +- '17': HMAC-SHA256; HMAC_SHA256_128; AES-CBC-128 + +*--scan-serial* ''*:: +Scans for serial devices (of supported types) on the specified +serial ports. + +EXAMPLES +-------- + +To set alternative directory for configuration files: + +*nutconf --local ~/test/nut/etc* + +To add another user (keeping the existing ones): + +*nutconf --add-user bart password=qwerty* + +To scan USB devices and serial devices (on the 1st two ports): + +*nutconf --scan-usb --scan-serial /dev/ttyS1 /dev/ttyS2* + +SEE ALSO +-------- + +linkman:ups.conf[5] +linkman:nut-scanner[8] + +INTERNET RESOURCES +------------------ + +The NUT (Network UPS Tools) home page: http://www.networkupstools.org/ diff --git a/docs/man/nutdrv_atcl_usb.txt b/docs/man/nutdrv_atcl_usb.txt index 66ac7c9d60..3f8e12105c 100644 --- a/docs/man/nutdrv_atcl_usb.txt +++ b/docs/man/nutdrv_atcl_usb.txt @@ -6,10 +6,14 @@ NAME nutdrv_atcl_usb - Driver for 'ATCL FOR UPS' equipment -NOTE ----- +SYNOPSIS +-------- + +*nutdrv_atcl_usb* -h + +*nutdrv_atcl_usb* -a 'UPS_NAME' ['OPTIONS'] -This man page only documents the specific features of the nutdrv_atcl_usb +NOTE: This man page only documents the specific features of the nutdrv_atcl_usb driver. For information about the core driver, see linkman:nutupsdrv[8]. SUPPORTED HARDWARE diff --git a/docs/man/nutdrv_qx.txt b/docs/man/nutdrv_qx.txt index 0298e03434..0af25b016b 100644 --- a/docs/man/nutdrv_qx.txt +++ b/docs/man/nutdrv_qx.txt @@ -7,11 +7,16 @@ NAME nutdrv_qx - Driver for Q* protocol serial and USB based UPS equipment -NOTE ----- +SYNOPSIS +-------- + +*nutdrv_qx* -h + +*nutdrv_qx* -a 'UPS_NAME' ['OPTIONS'] -This man page only documents the hardware-specific features of the *nutdrv_qx* driver. -For information about the core driver, see linkman:nutupsdrv[8]. +NOTE: This man page only documents the hardware-specific features of the +*nutdrv_qx* driver. For information about the core driver, see +linkman:nutupsdrv[8]. SUPPORTED HARDWARE diff --git a/docs/man/nutdrv_siemens_sitop.txt b/docs/man/nutdrv_siemens_sitop.txt index 6c95c52978..87bf629a16 100644 --- a/docs/man/nutdrv_siemens_sitop.txt +++ b/docs/man/nutdrv_siemens_sitop.txt @@ -6,10 +6,14 @@ NAME nutdrv_siemens_sitop - driver for the Siemens SITOP UPS500 series UPS -NOTE ----- +SYNOPSIS +-------- + +*nutdrv_siemens_sitop* -h + +*nutdrv_siemens_sitop* -a 'UPS_NAME' ['OPTIONS'] -This man page only documents the hardware-specific features of the +NOTE: This man page only documents the hardware-specific features of the *nutdrv_siemens_sitop* driver. For information about the core driver, see linkman:nutupsdrv[8]. diff --git a/docs/man/nutscan_add_device_to_device.txt b/docs/man/nutscan_add_device_to_device.txt index 6f5aed610a..2cde5523f8 100644 --- a/docs/man/nutscan_add_device_to_device.txt +++ b/docs/man/nutscan_add_device_to_device.txt @@ -23,6 +23,7 @@ The `nutscan_device_t` contains the following variables: nutscan_device_type_t type; char * driver; + char * alt_driver_names; char * port; nutscan_options_t opt; struct nutscan_device * prev; diff --git a/docs/man/nutscan_add_option_to_device.txt b/docs/man/nutscan_add_option_to_device.txt index b7a5262402..b24ff8e3a7 100644 --- a/docs/man/nutscan_add_option_to_device.txt +++ b/docs/man/nutscan_add_option_to_device.txt @@ -4,18 +4,30 @@ NUTSCAN_ADD_OPTION_TO_DEVICE(3) NAME ---- -nutscan_add_option_to_device - Add option data to the specified device. +nutscan_add_option_to_device, nutscan_add_commented_option_to_device - Add +option data to the specified device. + SYNOPSIS -------- #include + /* Add enabled option data to the specified device. */ void nutscan_add_option_to_device( nutscan_device_t * device, char * option_name, char * value); + /* Since libnutscan version 2.5.0: + * Add option data to the specified device with an optional comment tag + * for options suggested, but not currently enabled for actual use. */ + void nutscan_add_commented_option_to_device( + nutscan_device_t * device, + char * option_name, + char * value, + char * comment_tag); + DESCRIPTION ----------- @@ -24,6 +36,7 @@ The `nutscan_device_t` contains the following variables: nutscan_device_type_t type; char * driver; + char * alt_driver_names; char * port; nutscan_options_t opt; struct nutscan_device * prev; @@ -34,9 +47,15 @@ its `type`, its `driver` name, its `port` and any number of optional data. The *nutscan_add_option_to_device()* adds an optional data in the given device. Optional data are made of an 'option_name' and an -associated 'value'. Copies of 'option_name' and 'value' are stored -in the device, so the caller can safely free both of the original -strings used as arguments. +associated 'value', and optionally a 'comment_tag'. Copies of the +'option_name', 'value' and 'comment_tag' are stored in the device, +so the caller can safely free all of the original strings used as +arguments. + +NOTE: A non-`NULL` value of the 'comment_tag' makes the option not-enabled +for current use. Depending on the output format, it may be either completely +ignored, or rendered as a comment with this value as a prefix (a zero-length +string `"\0"` may be passed to have no prefix). Such options and their values may be further sanity-checked and reported as warnings by *nutscan_display_sanity_check()* dispatcher and its related diff --git a/docs/man/nutscan_init.txt b/docs/man/nutscan_init.txt index 6d372e0ce3..27768d270b 100644 --- a/docs/man/nutscan_init.txt +++ b/docs/man/nutscan_init.txt @@ -27,6 +27,7 @@ This depends on the libraries installed on the system: nutscan_avail_avahi = 1 : AVAHI scan is available nutscan_avail_ipmi = 1 : IPMI scan is available nutscan_avail_nut = 1 : Old NUT method is available + nutscan_avail_nut_simulation = 1 : NUT simulation devices method is available nutscan_avail_snmp = 1 : SNMP method is available nutscan_avail_usb = 1 : USB method is available nutscan_avail_xml_http = 1 : XML HTTP method is available @@ -44,9 +45,9 @@ SEE ALSO linkman:nutscan_init[3], linkman:nutscan_scan_usb[3], linkman:nutscan_scan_snmp[3], linkman:nutscan_scan_xml_http_range[3], -linkman:nutscan_scan_nut[3], linkman:nutscan_scan_avahi[3], -linkman:nutscan_scan_ipmi[3], linkman:nutscan_display_ups_conf[3], -linkman:nutscan_display_sanity_check[3], +linkman:nutscan_scan_nut[3], linkman:nutscan_scan_nut_simulation[3], +linkman:nutscan_scan_avahi[3], linkman:nutscan_scan_ipmi[3], +linkman:nutscan_display_ups_conf[3], linkman:nutscan_display_sanity_check[3], linkman:nutscan_display_sanity_check_serial[3], linkman:nutscan_display_ups_conf_with_sanity_check[3], linkman:nutscan_display_parsable[3], linkman:nutscan_new_device[3], diff --git a/docs/man/nutscan_scan_nut_simulation.txt b/docs/man/nutscan_scan_nut_simulation.txt new file mode 100644 index 0000000000..8e7ba1999c --- /dev/null +++ b/docs/man/nutscan_scan_nut_simulation.txt @@ -0,0 +1,47 @@ +NUTSCAN_SCAN_NUT_SIMULATION(3) +============================== + +NAME +---- + +nutscan_scan_nut_simulation - Scan your sysconfig directory for NUT simulation devices. + +SYNOPSIS +-------- + + #include + #include /* useconds_t */ + + nutscan_device_t * nutscan_scan_nut_simulation(); + +DESCRIPTION +----------- + +The *nutscan_scan_nut_simulation()* function try to detect available NUT +simulation devices, by finding .dev and .seq files in your sysconfig +directory. + +You MUST call linkman:nutscan_init[3] before using this function. + +RETURN VALUE +------------ + +The *nutscan_scan_nut_simulation()* function returns a pointer to a +`nutscan_device_t` structure containing all found devices or NULL if an +error occurs or no device is found. + +SEE ALSO +-------- + +linkman:nutscan_init[3], +linkman:nutscan_scan_usb[3], linkman:nutscan_scan_xml_http_range[3], +linkman:nutscan_scan_snmp[3], linkman:nutscan_scan_avahi[3], +linkman:nutscan_scan_ipmi[3], linkman:nutscan_scan_nut[3], +linkman:nutscan_display_sanity_check[3], +linkman:nutscan_display_sanity_check_serial[3], +linkman:nutscan_display_ups_conf_with_sanity_check[3], +linkman:nutscan_display_ups_conf[3], +linkman:nutscan_display_parsable[3], linkman:nutscan_new_device[3], +linkman:nutscan_free_device[3], linkman:nutscan_add_option_to_device[3], +linkman:nutscan_add_device_to_device[3], linkman:nutscan_scan_eaton_serial[3], +linkman:nutscan_cidr_to_ip[3] diff --git a/docs/man/nutscan_scan_usb.txt b/docs/man/nutscan_scan_usb.txt index 25d2b6ddb0..f9632bdd00 100644 --- a/docs/man/nutscan_scan_usb.txt +++ b/docs/man/nutscan_scan_usb.txt @@ -11,12 +11,43 @@ SYNOPSIS #include + nutscan_device_t * nutscan_scan_usb(nutscan_usb_t * scanopts); + +NOTE +---- + +Before `libnutscan` version 2.5.0 there was no argument: + nutscan_device_t * nutscan_scan_usb(void); +After the API update to have an argument, equivalent default activity can +be achieved by passing `NULL` value for the argument. + DESCRIPTION ----------- -The *nutscan_scan_usb()* function try to detect NUT compatible USB devices. +The *nutscan_scan_usb()* function tries to detect NUT compatible USB devices. + +The `scanopts` argument contains toggles about values that would be reported +into the generated device section. Currently they regard physical link details +which can change over time (e.g. USB re-enumeration due to software or hardware +re-connections); see `nut-scan.h` for current details: + +---- +/* USB scan options structure */ +typedef struct nutscan_usb { + /* Hardware link related values below are not reliable for run-time + * matching (they can change over time) but can be useful if e.g. + * "serial" is not available or unique */ + int report_bus; + int report_busport; + int report_device; + + /* The value is not currently used for device matching, but might be + * used later, and it is available from discovery */ + int report_bcdDevice; +} nutscan_usb_t; +---- You MUST call linkman:nutscan_init[3] before using this function. diff --git a/docs/man/oneac.txt b/docs/man/oneac.txt index dd38f126eb..b6fda081fc 100644 --- a/docs/man/oneac.txt +++ b/docs/man/oneac.txt @@ -6,10 +6,14 @@ NAME oneac - Driver for Oneac UPS equipment -NOTE ----- +SYNOPSIS +-------- + +*oneac* -h + +*oneac* -a 'UPS_NAME' ['OPTIONS'] -This man page only documents the hardware-specific features of the +NOTE: This man page only documents the hardware-specific features of the oneac driver. For information about the core driver, see linkman:nutupsdrv[8]. diff --git a/docs/man/optiups.txt b/docs/man/optiups.txt index 740bd76b28..d3bdf6ec0a 100644 --- a/docs/man/optiups.txt +++ b/docs/man/optiups.txt @@ -6,10 +6,14 @@ NAME optiups - Driver for Opti-UPS (Viewsonic) UPS and Zinto D (ONLINE-USV) equipment -NOTE ----- +SYNOPSIS +-------- + +*optiups* -h + +*optiups* -a 'UPS_NAME' ['OPTIONS'] -This man page only documents the hardware-specific features of the +NOTE: This man page only documents the hardware-specific features of the optiups driver. For information about the core driver, see linkman:nutupsdrv[8]. diff --git a/docs/man/pijuice.txt b/docs/man/pijuice.txt index bb87607279..f97bce4bb0 100644 --- a/docs/man/pijuice.txt +++ b/docs/man/pijuice.txt @@ -6,10 +6,14 @@ NAME pijuice - driver for UPS in PiJuice HAT -NOTE ----- +SYNOPSIS +-------- + +*pijuice* -h + +*pijuice* -a 'UPS_NAME' ['OPTIONS'] -This man page only documents the hardware-specific features of the +NOTE: This man page only documents the hardware-specific features of the *pijuice* driver. For information about the core driver, see linkman:nutupsdrv[8]. diff --git a/docs/man/powercom.txt b/docs/man/powercom.txt index 84b0bebd4c..62b7a6c223 100644 --- a/docs/man/powercom.txt +++ b/docs/man/powercom.txt @@ -6,10 +6,14 @@ NAME powercom - UPS driver for serial Powercom/Trust/Advice UPS equipment -NOTE ----- +SYNOPSIS +-------- + +*powercom* -h + +*powercom* -a 'UPS_NAME' ['OPTIONS'] -This man page only documents the hardware-specific features of the +NOTE: This man page only documents the hardware-specific features of the powercom driver. For information about the core driver, see linkman:nutupsdrv[8]. diff --git a/docs/man/powerpanel.txt b/docs/man/powerpanel.txt index 861d911eea..8e86742545 100644 --- a/docs/man/powerpanel.txt +++ b/docs/man/powerpanel.txt @@ -6,10 +6,14 @@ NAME powerpanel - Driver for serial PowerPanel Plus compatible UPS equipment -NOTE ----- +SYNOPSIS +-------- + +*powerpanel* -h + +*powerpanel* -a 'UPS_NAME' ['OPTIONS'] -This man page only documents the hardware-specific features of the +NOTE: This man page only documents the hardware-specific features of the powerpanel driver. For information about the core driver, see linkman:nutupsdrv[8]. diff --git a/docs/man/rhino.txt b/docs/man/rhino.txt index fe3ec333a8..ed97f717ec 100644 --- a/docs/man/rhino.txt +++ b/docs/man/rhino.txt @@ -6,10 +6,14 @@ NAME rhino - Driver for Brazilian Microsol RHINO UPS equipment -NOTE ----- +SYNOPSIS +-------- + +*rhino* -h + +*rhino* -a 'UPS_NAME' ['OPTIONS'] -This man page only documents the hardware-specific features of the +NOTE: This man page only documents the hardware-specific features of the rhino driver. For information about the core driver, see linkman:nutupsdrv[8]. diff --git a/docs/man/richcomm_usb.txt b/docs/man/richcomm_usb.txt index 527f7aa805..fd37343400 100644 --- a/docs/man/richcomm_usb.txt +++ b/docs/man/richcomm_usb.txt @@ -7,10 +7,14 @@ NAME richcomm_usb - Driver UPS equipment using Richcomm dry-contact to USB solution -NOTE ----- +SYNOPSIS +-------- + +*richcomm_usb* -h + +*richcomm_usb* -a 'UPS_NAME' ['OPTIONS'] -This man page only documents the specific features of the richcomm_usb +NOTE: This man page only documents the specific features of the richcomm_usb driver. For information about the core driver, see linkman:nutupsdrv[8]. SUPPORTED HARDWARE diff --git a/docs/man/safenet.txt b/docs/man/safenet.txt index 136d2bfbbd..62ca249eb6 100644 --- a/docs/man/safenet.txt +++ b/docs/man/safenet.txt @@ -6,10 +6,14 @@ NAME safenet - Driver for SafeNet compatible UPS equipment -NOTE ----- +SYNOPSIS +-------- + +*safenet* -h + +*safenet* -a 'UPS_NAME' ['OPTIONS'] -This man page only documents the hardware-specific features of the +NOTE: This man page only documents the hardware-specific features of the safenet driver. For information about the core driver, see linkman:nutupsdrv[8]. diff --git a/docs/man/skel.txt b/docs/man/skel.txt index 286c101dd4..034e3034af 100644 --- a/docs/man/skel.txt +++ b/docs/man/skel.txt @@ -6,10 +6,14 @@ NAME skel - skeleton driver man page -NOTE ----- +SYNOPSIS +-------- + +*skel* -h + +*skel* -a 'UPS_NAME' ['OPTIONS'] -This man page only documents the hardware-specific features of the +NOTE: This man page only documents the hardware-specific features of the *skel* driver. For information about the core driver, see linkman:nutupsdrv[8]. diff --git a/docs/man/snmp-ups.txt b/docs/man/snmp-ups.txt index 5f94d022c7..221e081ab1 100644 --- a/docs/man/snmp-ups.txt +++ b/docs/man/snmp-ups.txt @@ -6,10 +6,14 @@ NAME snmp-ups - Multi-MIB Driver for SNMP UPS equipment -NOTE ----- +SYNOPSIS +-------- + +*snmp-ups* -h + +*snmp-ups* -a 'UPS_NAME' ['OPTIONS'] -This man page only documents the hardware-specific features of the +NOTE: This man page only documents the hardware-specific features of the snmp-ups driver. For information about the core driver, see linkman:nutupsdrv[8]. diff --git a/docs/man/solis.txt b/docs/man/solis.txt index d5e13830ca..7c1bf016e8 100644 --- a/docs/man/solis.txt +++ b/docs/man/solis.txt @@ -6,10 +6,14 @@ NAME solis - Driver for Brazilian Microsol SOLIS UPS equipment -NOTE ----- +SYNOPSIS +-------- + +*solis* -h + +*solis* -a 'UPS_NAME' ['OPTIONS'] -This man page only documents the hardware-specific features of the +NOTE: This man page only documents the hardware-specific features of the solis driver. For information about the core driver, see linkman:nutupsdrv[8]. diff --git a/docs/man/tripplite.txt b/docs/man/tripplite.txt index 8d104807fc..986afc5a75 100644 --- a/docs/man/tripplite.txt +++ b/docs/man/tripplite.txt @@ -6,10 +6,14 @@ NAME tripplite - Driver for Tripp-Lite SmartPro UPS equipment -NOTE ----- +SYNOPSIS +-------- + +*tripplite* -h + +*tripplite* -a 'UPS_NAME' ['OPTIONS'] -This man page only documents the hardware-specific features of the +NOTE: This man page only documents the hardware-specific features of the tripplite driver. For information about the core driver, see linkman:nutupsdrv[8]. diff --git a/docs/man/tripplitesu.txt b/docs/man/tripplitesu.txt index 7272f52b39..a279a25827 100644 --- a/docs/man/tripplitesu.txt +++ b/docs/man/tripplitesu.txt @@ -6,10 +6,14 @@ NAME tripplitesu - Driver for Tripp-Lite SmartOnline (SU) UPS equipment -NOTE ----- +SYNOPSIS +-------- + +*tripplitesu* -h + +*tripplitesu* -a 'UPS_NAME' ['OPTIONS'] -This man page only documents the hardware-specific features of the +NOTE: This man page only documents the hardware-specific features of the tripplitesu driver. For information about the core driver, see linkman:nutupsdrv[8]. diff --git a/docs/man/ups.conf.txt b/docs/man/ups.conf.txt index 4c640d0aa0..aa98feff1e 100644 --- a/docs/man/ups.conf.txt +++ b/docs/man/ups.conf.txt @@ -247,6 +247,14 @@ definition and it can also be set in a UPS section. This value controls how long upsdrvctl will wait for the driver to finish starting. This keeps your system from getting stuck due to a broken driver or UPS. + +Note that after this time `upsdrvctl` would just move along with its +business (whether retrying the same driver if `maxretry>1`, or trying +another driver if starting them all, or just eventually exit); however, +each such most recently started "stuck" driver process may be further +initializing in the background, and might even succeed eventually. ++ +They would not be actively killed by `upsdrvctl` after this timeout expires. ++ The default is 45 seconds. *synchronous*:: diff --git a/docs/man/upscode2.txt b/docs/man/upscode2.txt index 24afbacbfc..07618f2406 100644 --- a/docs/man/upscode2.txt +++ b/docs/man/upscode2.txt @@ -6,10 +6,14 @@ NAME upscode2 - Driver for UPScode II compatible UPS equipment -NOTE ----- +SYNOPSIS +-------- + +*upscode2* -h + +*upscode2* -a 'UPS_NAME' ['OPTIONS'] -This man page only documents the hardware-specific features of the +NOTE: This man page only documents the hardware-specific features of the upscode2 driver. For information about the core driver, see linkman:nutupsdrv[8]. diff --git a/docs/man/upsd.conf.txt b/docs/man/upsd.conf.txt index af8582a700..5597f483c5 100644 --- a/docs/man/upsd.conf.txt +++ b/docs/man/upsd.conf.txt @@ -48,6 +48,26 @@ unless the calling environment sets a same-named variable to enforce a value for the current run. One way this can happen is somebody un-commenting it in the 'nut.conf' file used by init-scripts and service unit method scripts. +"ALLOW_NOT_ALL_LISTENERS 'Boolean'":: + +Normally upsd requires that all `LISTEN` directives can be honoured at the +moment the daemon starts. If your LAN IP address (or host name) used in one +of the `LISTEN` directives may be not always accessible, and for some reason +do not want to just `LISTEN *` on the wildcard interface, but e.g. you still +want to use `upsmon` on `localhost`, this option can help. Note you would +have to restart `upsd` to pick up the `LISTEN`ed IP address if it appears +later. ++ +Boolean values 'true', 'yes', 'on' and '1' mean that the server would not +refuse to start if it can listen on at least one interface. ++ +Boolean values 'false', 'no', 'off' and '0' mean that the server should +refuse to start if it can not LISTEN on each and every (non-localhost) +interface found in upsd.conf. This is the default, unless the calling +environment sets a same-named variable to enforce a value for the current run. +One way this can happen is somebody un-commenting it in the 'nut.conf' file +used by init-scripts and service unit method scripts. + "STATEPATH 'path'":: Tell upsd to look for the driver state sockets in 'path' rather @@ -104,6 +124,7 @@ connections. Only set this if you know exactly what you're doing. When compiled with SSL support with OpenSSL backend, you can enter the certificate file here. ++ The certificates must be in PEM format and must be sorted starting with the subject's certificate (server certificate), followed by intermediate CA certificates (if applicable_ and the highest level (root) CA. It should @@ -114,6 +135,7 @@ NUT user manual for more information on the SSL support in NUT. When compiled with SSL support with NSS backend, you can enter the certificate path here. ++ Certificates are stored in a dedicated database (data split in 3 files). Specify the path of the database directory. @@ -122,12 +144,16 @@ Specify the path of the database directory. When compiled with SSL support with NSS backend, you can specify the certificate name to retrieve from database to authenticate itself and the password required to access certificate related private key. ++ +NOTE: Be sure to enclose "certificate name" in double-quotes if you +are using a value with spaces in it. "CERTREQUEST 'certificate request level'":: When compiled with SSL support with NSS backend and client certificate validation (disabled by default, see 'docs/security.txt'), you can specify if upsd requests or requires client's' certificates. ++ Possible values are : - '0' to not request to clients to provide any certificate - '1' to require to all clients a certificate @@ -138,6 +164,7 @@ Possible values are : Tell upsd to disable older/weak SSL/TLS protocols and ciphers. With relatively recent versions of OpenSSL or NSS it will be restricted to TLSv1.2 or better. ++ Unless you have really ancient clients, you probably want to enable this. Currently disabled by default to ensure compatibility with existing setups. diff --git a/docs/man/upsdrvsvcctl.txt b/docs/man/upsdrvsvcctl.txt index 66dacdf866..e6e00de697 100644 --- a/docs/man/upsdrvsvcctl.txt +++ b/docs/man/upsdrvsvcctl.txt @@ -68,6 +68,12 @@ Enable testing mode. Testing mode makes upsdrvsvcctl display the actions it would execute without actually doing them. +*--timeout-cmd * and *--timeout-args *:: +Service management calls will be time-limited by calling the specified +program with its args. By default, if coreutils timeout is found, it +would be used to limit service calls by 90 sec, to avoid/work around +certain hangs that happen in some systemd version under stress. + OPTIONS OF UPSDRVCTL NOT (CURRENTLY) APPLICABLE TO UPSDRVSVCCTL --------------------------------------------------------------- diff --git a/docs/man/upsmon.conf.txt b/docs/man/upsmon.conf.txt index faf3135c9c..a50edb86f7 100644 --- a/docs/man/upsmon.conf.txt +++ b/docs/man/upsmon.conf.txt @@ -103,55 +103,63 @@ Each UPS that you need to be monitor should have a MONITOR line. Not all of these need supply power to the system that is running upsmon. You may monitor other systems if you want to be able to send notifications about status changes on them. - ++ You must have at least one MONITOR directive in `upsmon.conf`. - -'system' is a UPS identifier. It is in this form: - ++ +* 'system' is a UPS identifier. It is in this form: ++ +[@[:]]+ - ++ The default hostname is "localhost". Some examples: - - - "su700@mybox" means a UPS called "su700" on a system called "mybox". ++ + - "su700@mybox" means a UPS called "su700" on a system called "mybox". This is the normal form. - - "fenton@bigbox:5678" is a UPS called "fenton" on a system called + - "fenton@bigbox:5678" is a UPS called "fenton" on a system called "bigbox" which runs linkman:upsd[8] on port "5678". -'powervalue' is an integer representing the number of power supplies ++ +* 'powervalue' is an integer representing the number of power supplies that the UPS feeds on this system. Most normal computers have one power supply, and the UPS feeds it, so this value will be 1. You need a very large or special system to have anything higher here. - ++ You can set the 'powervalue' to 0 if you want to monitor a UPS that doesn't actually supply power to this system. This is useful when you want to have upsmon do notifications about status changes on a UPS without shutting down when it goes critical. -The 'username' and 'password' on this line must match an entry in ++ +* The 'username' and 'password' on this line must match an entry in the `upsd` server system's linkman:upsd.users[5] file. - ++ If your username is "observer" and your password is "abcd", the MONITOR line might look like this (likely on a remote secondary system): - -+MONITOR myups@bigserver 1 observer abcd secondary+ - ++ +---- +MONITOR myups@bigserver 1 observer abcd secondary +---- ++ Meanwhile, the `upsd.users` on `bigserver` would look like this: ++ +---- +[observer] + password = abcd + upsmon secondary - [observer] - password = abcd - upsmon secondary - - [upswired] - password = blah - upsmon primary - +[upswired] + password = blah + upsmon primary +---- ++ And the copy of upsmon on that bigserver would run with the primary configuration: ++ +---- +MONITOR myups@bigserver 1 upswired blah primary +---- -+MONITOR myups@bigserver 1 upswired blah primary+ - - -The 'type' refers to the relationship with linkman:upsd[8]. It can ++ +* The 'type' refers to the relationship with linkman:upsd[8]. It can be either "primary" or "secondary". See linkman:upsmon[8] for more information on the meaning of these modes. The mode you pick here also goes in the `upsd.users` file, as seen in the example above. @@ -171,9 +179,13 @@ system log as configured. If your devices are expected to be AWOL for an extended timeframe, you can use this throttle to reduce the stress on syslog traffic and storage, by posting these messages only once in every several loop cycles, and when the error condition has changed or cleared. - -A negative value means standard behavior, and a zero value means to never -repeat the message (log only on start and end/change of the failure state). ++ +A negative value means standard behavior (log on every loop, effectively +same as when `max=1`), and a zero value means to never repeat the message +(log only on start and end/change of the failure state). ++ +Note that this throttle only applies to one latest-active error state per +monitored device. *NOTIFYCMD* 'command':: @@ -242,6 +254,8 @@ NOPARENT;; `upsmon` parent process died - shutdown impossible CAL;; UPS calibration in progress +NOTCAL;; UPS calibration finished + OFF;; UPS administratively OFF or asleep NOTOFF;; UPS no longer administratively OFF or asleep @@ -384,6 +398,36 @@ together, i.e.: SHUTDOWNCMD "/sbin/shutdown -h +0" +*SHUTDOWNEXIT* 'boolean|number':: + +After initiating shutdown, should this upsmon daemon itself exit? +By doing so NUT secondary systems can tell the NUT primary that +it can proceed with its own shutdown and eventually tell the UPS +to cut power for the load. ("Yes" by default) ++ +Some "secondary" systems with workloads that take considerable time +to stop (e.g. virtual machines or large databases) can benefit from +reporting (by virtue of logging off the data server) that they are +ready for the "primary" system to begin its own shutdown and eventually +to tell the UPS to cut the power - not as soon as they have triggered +their own shutdown, but at a later point (e.g. when the upsmon service +is stopped AFTER the heavier workloads). ++ +Note that the actual ability to complete such shutdown depends on the +remaining battery run-time at the moment when UPS power state becomes +considered critical and the shutdowns begin. You may also have to tune +`HOSTSYNC` on the NUT primary to be long enough for those secondaries to +stop their services. In practice, it may be worthwhile to investigate +ways to trigger shutdowns earlier on these systems, e.g. by setting up +`upssched` integration, or `dummy-ups` driver with overrides for stricter +`battery.charge` or `battery.runtime` triggers than used by the rest of +your servers. ++ +This option supports Boolean-style strings (yes/on/true or no/off/false) +or numbers to define a delay (in seconds) between calling `SHUTDOWNCMD` +and exiting the daemon. Zero means immediate exit (default), negative +values mean never exiting on its own accord. + *CERTPATH* 'certificate file or database':: When compiled with SSL support, you can enter the certificate path here. @@ -402,6 +446,9 @@ When compiled with SSL support, you can enter the certificate path here. When compiled with SSL support with NSS, you can specify the certificate name to retrieve from database to authenticate itself and the password required to access certificate related private key. ++ +NOTE: Be sure to enclose "certificate name" in double-quotes if you +are using a value with spaces in it. *CERTHOST* 'hostname' 'certificate name' 'certverify' 'forcessl':: @@ -411,6 +458,9 @@ for each server you can contact. Each entry maps server name with the expected certificate name and flags indicating if the server certificate is verified and if the connection must be secure. ++ +NOTE: Be sure to enclose "certificate name" in double-quotes if you +are using a value with spaces in it. *CERTVERIFY* '0 | 1':: diff --git a/docs/man/upsmon.txt b/docs/man/upsmon.txt index 464ba705f6..afe4ad6692 100644 --- a/docs/man/upsmon.txt +++ b/docs/man/upsmon.txt @@ -163,6 +163,9 @@ The UPS can't be contacted for monitoring. *CAL*:: UPS calibration in progress. +*NOTCAL*:: +UPS calibration finished. + *OFF*:: UPS administratively OFF or asleep. @@ -414,7 +417,7 @@ load and don't want some systems to be powered off while others remain running if the "wall power" returns at the wrong moment as usual, the "FSD" flag can not be removed from the data server unless its daemon is restarted. If we do take the first step in critical mode, then we normally intend to go -all the way -- shut down all the servers gracefully, and power down the UPS. +all the way -- shut down all the servers gracefully, and power down the UPS. Keep in mind that some UPS devices and corresponding drivers would also latch or otherwise resurface the "FSD" state again even if "wall power" is available, @@ -475,9 +478,12 @@ system log as configured. If your devices are expected to be AWOL for an extended timeframe, you can use POLLFAIL_LOG_THROTTLE_MAX to reduce the stress on syslog traffic and storage, by posting these messages only once in every several loop cycles, and when the error condition has changed or -cleared. A negative value means standard behavior, and a zero value means -to never repeat the message (log only on start and end/change of the failure -state). +cleared. A negative value means standard behavior (log on every loop, +effectively same as when `max=1`), and a zero value means to never repeat +the message (log only on start and end/change of the failure state). + +Note that this throttle only applies to one latest-active error state per +monitored device. RELOADING NUANCES ----------------- diff --git a/docs/man/usbhid-ups.txt b/docs/man/usbhid-ups.txt index c54e2bfa76..323fe53deb 100644 --- a/docs/man/usbhid-ups.txt +++ b/docs/man/usbhid-ups.txt @@ -6,10 +6,14 @@ NAME usbhid-ups - Driver for USB/HID UPS equipment -NOTE ----- +SYNOPSIS +-------- + +*usbhid-ups* -h -This man page only documents the hardware-specific features of the +*usbhid-ups* -a 'UPS_NAME' ['OPTIONS'] + +NOTE: This man page only documents the hardware-specific features of the usbhid-ups driver. For information about the core driver, see linkman:nutupsdrv[8]. @@ -110,12 +114,17 @@ If this flag is set, the driver will not use Interrupt In transfers during the shorter "pollinterval" cycles (not recommended, but needed if these reports are broken on your UPS). -*onlinedischarge*:: -If this flag is set, the driver will treat `OL+DISCHRG` status as offline. +*onlinedischarge_battery*:: +If this flag is set, the driver will treat `OL+DISCHRG` status as +offline/on-battery. ++ For most devices this combination means calibration or similar maintenance; however some UPS models (e.g. CyberPower UT series) emit `OL+DISCHRG` when wall power is lost -- and need this option to handle shutdowns. +*onlinedischarge*:: +DEPRECATED, old name for `onlinedischarge_battery` described above. + *onlinedischarge_calibration*:: If this flag is set, the driver will treat `OL+DISCHRG` status as calibration. Some UPS models (e.g. APC were seen to do so) report `OL+DISCHRG` when they @@ -126,6 +135,31 @@ NOTE: If it takes so long on your device that a shutdown gets issued, you may want to look at `upsmon` option `OFFDURATION` used to filter out temporary values of "administrative OFF" as not a loss of a feed for the powered load. +*onlinedischarge_log_throttle_sec*='num':: +Set the minimum frequency (in seconds) at which warnings would be emitted +for an otherwise not handled `OL+DISCHRG` device status combination. +Negative values disable sequentially repeated messages (when this state +appears and persists). ++ +If the device does not report `battery.charge`, the default value is 30 seconds +(fairly frequent, in case the UPS-reported state combination does reflect a +bad power condition and so the situation is urgent). ++ +If it does report `battery.charge`, by default the repeated notifications +would only be logged if this charge is different from when the message was +emitted previously (e.g. when the battery is really discharging). ++ +If both this option is set, and `battery.charge` is correctly reported, +either of these rules allow the notification to be logged. + +*onlinedischarge_log_throttle_hovercharge*='num':: +See details in `onlinedischarge_log_throttle_sec` and `battery.charge` based +log message throttling description above. This option adds a concept of UPS +"hovering" a battery charge at some level deemed safe for its chemistry, and +not forcing it to be fully charged all the time. As long as the current value +of `battery.charge` remains at or above this threshold percentage (default 100), +the `OL+DISCHRG` message logging is not triggered by variations of the charge. + *disable_fix_report_desc*:: Set to disable fix-ups for broken USB encoding, etc. which we apply by default on certain models (vendors/products) which were reported as not following the diff --git a/docs/man/victronups.txt b/docs/man/victronups.txt index d51d09f9c8..c9a113ffe2 100644 --- a/docs/man/victronups.txt +++ b/docs/man/victronups.txt @@ -6,10 +6,14 @@ NAME victronups - Driver for IMV/Victron UPS unit Match, Match Lite, NetUps -NOTE ----- +SYNOPSIS +-------- + +*victronups* -h + +*victronups* -a 'UPS_NAME' ['OPTIONS'] -This man page only documents the hardware-specific features of the the +NOTE: This man page only documents the hardware-specific features of the the victronups driver. For information about the core driver, see linkman:nutupsdrv[8]. diff --git a/docs/nut.dict b/docs/nut.dict index 16b9ffb2f0..96b530f9c3 100644 --- a/docs/nut.dict +++ b/docs/nut.dict @@ -1,4 +1,4 @@ -personal_ws-1.1 en 3255 utf-8 +personal_ws-1.1 en 3468 utf-8 AAC AAS ABI @@ -79,6 +79,7 @@ AsciiDoc Asium Ates AudibleAlarmControl +AuthConfig AutoFrq AutoMsg AutoRst @@ -100,6 +101,7 @@ BCD BCHARGE BCM BD +BMC BNT BOH BP @@ -174,6 +176,7 @@ CERTIDENT CERTREQUEST CERTVERIF CEST +CHOST CHRG CL CLANGVER @@ -215,6 +218,7 @@ ChangeLog ChargdV Chatziathanassiou CheckUPS +CheckUPSAvailable Checksum Chiou Chu @@ -264,6 +268,7 @@ DF DHEA DIGYS DISCHRG +DLDIR DLLs DMF DN @@ -271,38 +276,52 @@ DNS DOCTYPE DOMAINs DPC +DPURIFY DRIVERLIST DS DSA DSHUTD DSL DTE +DTrace DUMPALL DUMPDONE DWAKE DWITH DX Daniele +Dashjr DataRoom Dbnc +Ddtrace DeepTstFail Defensor DeltaUPSv +DesktopFileName DeviceID DeviceKit DeviceLogin +DeviceLogout +Dgtk Dharm DiSplay Diehl Dietze +DigitalOcean Digitus Digys Dimitris +Dinstalled Disassembly +Dlibelf Dly +Dman Dmitry DocBook +DocumentRoot Doxygen +DriverInstaller +Dsystemtap Dynamix Dynex EAGAIN @@ -354,6 +373,7 @@ Eriksson Evgeny Exar ExecCGI +ExecStartPre FD FEMEA FFF @@ -377,6 +397,7 @@ FTS FTTx FTUPS FV +FWIW Faber Fabio Fabrice @@ -400,12 +421,15 @@ FreqSens Frolov FullLoad Fuß +GC GCCVER GES GETADDRINFO GID GKrellM GND +GNUmakefile +GObject GPIO GPIOCHIP GPL @@ -413,6 +437,7 @@ GPSER GRs GTK GUESSTIMATION +GUID GUIs GWD GXE @@ -426,6 +451,10 @@ Gathman Gembe GenTestFail Gert +GetRWVars +GetUPSCommands +GetUPSList +GetUPSNames GetUPSVars Ghali Giese @@ -434,6 +463,7 @@ GitHub GitHub's Gnd Gnomovision +GnuTLS Goebl Golang Gomes @@ -449,6 +479,7 @@ GuideBook Guillen HB HC +HDD HEADs HEHn HELn @@ -488,6 +519,7 @@ Homebrew Homebridge Hoogervorst Hough +Hrusecky Hunnox Hurd HÃĨvard @@ -517,6 +549,8 @@ IPAR IPBX IPC IPM +IPP +IPSS IPs IPv IRC @@ -525,6 +559,7 @@ ITEMP ITy IVT IZ +ImageFiles Infosec Innova Integrators @@ -555,6 +590,7 @@ Javadoc Javascript Jenkinsfile JoinControllers +Jong Joon Jumpered KNutClient @@ -594,6 +630,8 @@ LDADD LDFLAGS LDLC LDRIVER +LDSHARED +LDSHAREDLIBC LEDs LGTM LH @@ -749,6 +787,7 @@ NAK NAS NBF NConfigs +NDE NETVER NETVERSION NFS @@ -776,6 +815,7 @@ NONUT NOP NOPARENT NOTBYPASS +NOTCAL NOTIFYCMD NOTIFYFLAG NOTIFYFLAGS @@ -784,6 +824,7 @@ NOTOFF NQA NTP NUT's +NUTCONF NUTClient NUTSRC NUTServer @@ -796,10 +837,12 @@ NaturalDocs Necedah NetBSD NetBeans +NetInvent NetPro NetServer NetUps Netman +NetworkUPSTools Neus Niels Niklas @@ -813,6 +856,7 @@ NomVOut NotePad Novell NrLoBatt +NuGet NutException Nxx OAH @@ -864,6 +908,7 @@ Opengear's Opensource Opti OptiUPS +Orsiris Orvaldi Orzechowski OutletSystem @@ -898,6 +943,8 @@ POSIX POWERDOWNFLAG POWEREX POWERLINE +POWERSTATE +PPA PPD PPDn PPDnnn @@ -924,6 +971,7 @@ PV PWLv PWR PXG +PYTHONPATH PaaS Pac PackageRequired @@ -991,9 +1039,12 @@ Proxmox Prynych Pulizzi PwrOut +PyDOC PyGTK PyNUT PyNUTClient +PyNUTError +PyPI PyQt QBDR QBT @@ -1038,6 +1089,7 @@ RETPCT REXX RK RMCARD +RMCPplus RMXL RNF RNG @@ -1083,16 +1135,19 @@ Rodríguez Rouben Rozman Rucelf +RunUPSCommand RuntimeWarning RxD RxHs Ryabov SAI +SASU SCM SCO SCR SDA SDE +SDFLAG SDR SDRnnnnn SDT @@ -1111,6 +1166,8 @@ SG SGI SHA SHUTDOWNCMD +SHUTDOWNEXIT +SHUTDOWNSCRIPT SIG SIGHUP SIGINT @@ -1142,6 +1199,7 @@ SOFF SOLA SOLA's SOMECO +SOURCEMODE SOV SPARC SPC @@ -1152,6 +1210,7 @@ SRC SSSS STARTTLS STB +STDCALL STESTI STI STIME @@ -1162,6 +1221,7 @@ SUNWugen SUNWusb SURTD SUSE +SVR SX SXI SXL @@ -1185,12 +1245,15 @@ Sep Sequentializing SerialNumber Serv +Serveur +SetRWVar Shara ShareAlike Shaul ShdnDbnc ShdnDly ShdnPol +ShutDown Shutdn Sibbald Sicon @@ -1201,9 +1264,11 @@ Silvino Sinline Sistem Sistemas +SlackPack Slackware SmartBoost SmartCell +SmartNUT SmartOnline SmartPro SmartSlot @@ -1218,6 +1283,7 @@ Solaris Soltec Soltys SomeVendor +Sotirov's SourceForge Soyntec Spanier @@ -1293,6 +1359,7 @@ Tigra Tnn ToddGreenfield Tomek +Toolset TopGuard Toth Traceback @@ -1320,13 +1387,15 @@ UNV UPGUARDS UPM UPOII +UPP UPS's UPSCONN UPSDESC UPSHOST -upsid UPSIMAGEPATH UPSLC +UPSNOTIFY +UPSName UPSOutletSystemOutletDelayBeforeReboot UPSOutletSystemOutletDelayBeforeShutdown UPSOutletSystemOutletDelayBeforeStartup @@ -1351,6 +1420,7 @@ USVs UTC UTalk UUU +UUUU UX Ubuntu Ulf @@ -1397,10 +1467,13 @@ WARNOPT WCH WELI WHAD +WIP WIPO WMNut WS +WSDIR WSE +WSL WTU Waldie WantedBy @@ -1410,11 +1483,13 @@ Werror Weverything Wextra WhizBang +WiX Wikipedia WinMerge WinNUT WinPower Wireshark +Wl WordFmt Wrede XAU @@ -1431,10 +1506,12 @@ XSL XT XUPS XXXX +XXXXXXXXXXXX XYZ Xfer XferDly XfmrRes +Xlinker Xpert Xups Xymon @@ -1456,6 +1533,7 @@ Zaika Zampieri Zawadzki ZeroMQ +abandonware abcd ablerex abuild @@ -1470,6 +1548,7 @@ acpi acquisited acvoltsin acvoltsout +acx adb addcmd addenum @@ -1522,8 +1601,10 @@ apcsmart apctest apcupsd aphel +apinames appveyor ar +architecting archlinux arduino arg @@ -1567,6 +1648,7 @@ autogen automagically automake automessage +autopoint autoreconf autorestart autosaving @@ -1580,7 +1662,10 @@ avahi avr awd awk +b'some +b'string bAlternateSetting +bUps backend backends backgrounding @@ -1589,6 +1674,7 @@ backported backports backupspro badpassword +bart baseurl bashrc batchable @@ -1620,6 +1706,7 @@ bestfortress bestuferrups bestups bfe +bg bigbox bigone bigserver @@ -1639,6 +1726,7 @@ bootable bp br brazil +brotli bsd bsv bt @@ -1654,6 +1742,7 @@ bugfix bugfixes buildbots builddir +buildtype bullseye busport busybox @@ -1671,6 +1760,7 @@ ccache cd cdc cdf +cee centos cerr certfile @@ -1691,6 +1781,7 @@ cfg cfgadm cflag cflags +cgdisk cgi cgipath cgroup @@ -1727,6 +1818,7 @@ clepple clicky cls clueful +clusterware cmake cmd cmdline @@ -1776,12 +1868,14 @@ cpqpower cpsups cr crestfactor +criticality crlf cron crontab crossbuild crt crw +crypto csh cshdelay css @@ -1799,6 +1893,9 @@ cx cyberpower d'un da +daemonization +daemonize +daemonized daisychain daisychained databits @@ -1809,25 +1906,30 @@ dataok datasheet datastale dayofweek +dbgsym dblatex dcd dcn +ddk ddl de deUNV debian debootstrap debouncing +debuginfo deci decrement decrypt dedb dedup deduplication +defs defun dep dephasing deps +dereference desc deschis descr @@ -1843,6 +1945,7 @@ dfl dhcp dialout difftool +diffutils dipsw dir disassembly @@ -1865,6 +1968,7 @@ dockapp docs dod domxml +dotnet downloadable dpkg dq @@ -1908,6 +2012,7 @@ ei el emacs emptor +emptyDir endchar enddate endian @@ -1948,6 +2053,7 @@ executables executeCommand execve extendedhistory +extern externalConsole extradata fabula @@ -1980,25 +2086,32 @@ firewalling firmwares flts fmt +fno +fontconfig footnoteref forceshutdown forcessl formatconfig formatparam +formatstring +fosshost fp freebsd freeipmi +freetype freqsensitivity frob frontends fs fsd fsr +fstab ftdi fuji fullload func gamatronic +gandi gcc gcpp gd @@ -2026,11 +2139,13 @@ getent getenv getopt gettext +gettextize getvar gitcache github gitignore gitk +gitlab gmail gmake gnuplot @@ -2038,6 +2153,7 @@ gnutls google goto gotos +gperf gpg gpgsign gpio @@ -2078,6 +2194,7 @@ hostnames hostsfile hotplug hotplugging +hovercharge hpe href htaccess @@ -2099,7 +2216,9 @@ iUSB ib ibattery icd +iconv icp +icu idProduct idVendor ident @@ -2118,6 +2237,7 @@ ignoresab ignset illumos im +imagesdir img imv includePath @@ -2135,12 +2255,17 @@ initinfo initscripts initups inline +inlined innotech +inode inplace +installable installcheck +installpkg installurl instcmd instcmds +integrations intel intelliSenseMode intercharacter @@ -2151,6 +2276,7 @@ interoperating interprocess interruptonly interruptsize +intltool invcontdelay invcontpolarity inverter @@ -2170,8 +2296,10 @@ ipmi ipmidetectd ipmimonitoring ipmipsu +ipp ippon ipv +ipxe isDefault isbmex ish @@ -2187,6 +2315,7 @@ jenkins jessie jimklimov journalctl +jpeg jpg jpgraph jre @@ -2211,6 +2340,7 @@ kr krauler ksh ktrace +kvm labcd lan langid @@ -2240,13 +2370,18 @@ libgpiod libhid libhidups libi +libiconv +libintl libipmimonitoring libltdl +liblzma libmodbus libneon +libnetsnmp libnss libnut libnutclient +libnutclientstub libnutclientsub libnutconfig libnutscan @@ -2266,9 +2401,12 @@ libusb's libusbugen libusbx libvirt +libwdi libwrap +libxml libxslt libxxx +libz licensor licensors liebert @@ -2279,14 +2417,17 @@ linevoltage linkdoc linksingledoc linux +linuxdoc lipo listDeviceClients listdef littleguy lk lldb +llvm lm ln +lnetsnmp loadPercentage localhost localtime @@ -2308,6 +2449,7 @@ lowruntime lowvoltsout lposix lr +lregex lsd lsusb lt @@ -2316,9 +2458,11 @@ lu lua lv lvo +lws lxc lxcbr lxccontainer +lxcfs lxml lxyz lz @@ -2328,6 +2472,7 @@ mS macaddr macosx mailx +mainFrame maintainer's maintainership maj @@ -2337,6 +2482,7 @@ mandir manpage manpages masterguard +matcher maxacvi maxacvo maxd @@ -2445,6 +2591,7 @@ nashkaminski natively nb nbr +nbsp nd ndcv nds @@ -2468,13 +2615,17 @@ nitram nl nlb nlogic +nls nm nn nnn noAuthNoPriv nobody's nobt +nodev +nodownload nodtk +noexec noflag nogroup nohang @@ -2491,8 +2642,11 @@ noout norating noro noscanlangid +nosuid notAfter +notifyflags notifyme +notifymsg notifytype notransferoids novendor @@ -2501,6 +2655,7 @@ nowarn np nss ntUPSd +nuget num numOfBytesFromUPS numa @@ -2508,7 +2663,9 @@ numlogins numq nutclient nutclientmem +nutconf nutdev +nutdevN nutdrv nutmon nutscan @@ -2517,6 +2674,7 @@ nutupsdrv nutvalue nvi nvo +nwfilter odette odt offdelay @@ -2534,6 +2692,7 @@ oldmge oldnut omnios onbatt +onbattery onbattwarn onclick ondelay @@ -2544,6 +2703,7 @@ ont ontd ontimedays ontiniedays +onwards ooce openSUSE opencollective @@ -2562,6 +2722,7 @@ ostream otherprotocols otheruser outliers +ovmf pF pacman pacstrap @@ -2580,6 +2741,7 @@ pathnames pbzip pc pconf +pcre pcs pdf pdu @@ -2588,6 +2750,7 @@ peasy peername pem perl +pfSense pfexec pfy ph @@ -2602,6 +2765,7 @@ pijuice pinout pinouts pipename +pixmaps pkg pkgconf pkgconfig @@ -2621,11 +2785,13 @@ pollonly popa portname porttype +posix powercom powerdev powerdown powerdownflag powerfactor +powerfail powerman powermand powermust @@ -2657,6 +2823,7 @@ prereqs pretentiousVariableNamingSchemes prgshut printf +priv privPassword privProtocol problemMatcher @@ -2667,6 +2834,8 @@ prog prtconf ps psu +pthread +pthreads pts pty pulizzi @@ -2675,6 +2844,7 @@ pwl pwmib pwro px +pxW pxg pxgx py @@ -2682,6 +2852,7 @@ pycparser pydoc pygments pynut +qDEB qa qemu qfs @@ -2720,8 +2891,10 @@ refactoring referencenominal regex regtype +relatime releasekeyring relicensing +remoting renderer renderers repo @@ -2761,7 +2934,10 @@ rqt rsa rsync rts +ru +rubygem runlevel +runnable runtime runtimecal runtimek @@ -2773,7 +2949,9 @@ safenet salicru sbin sbindir +scanopts scd +sched scm screenshot screenshots @@ -2781,6 +2959,7 @@ scriptname sd sdb sddelay +sdk sdl sdorder sdtime @@ -2821,6 +3000,7 @@ sgs sha shm shutdownArguments +shutdowncmd shutdowndebounce shutdowndelay shutdownpolarity @@ -2840,6 +3020,7 @@ sitop sizeof ske skel +slackpkg slaveid slavesync slewrate @@ -2862,11 +3043,14 @@ sockdebug socketname socomec solaris +solibs solis +somename somepass something's sp spanish +sparc spectype spellcheck splitaddr @@ -2897,6 +3081,7 @@ stopAtEntry stopIP stopbits str +strUps strace strarr strcasecmp @@ -2940,6 +3125,7 @@ svcs svn sw symlink +symlinked symlinking symlinks symmetrathreephase @@ -2952,6 +3138,7 @@ syscalls sysconfdir sysconfig syslog +syslogd systemctl systemd systemdshutdowndir @@ -2987,6 +3174,7 @@ testtime testuser textproc tgcware +tgz th timeframe timehead @@ -3002,6 +3190,8 @@ tmpfs tmpring toolchain toolkits +toolset +topFrame topbot tport transmitxhs @@ -3028,6 +3218,7 @@ tw tx txg txt +txz typedef uA uD @@ -3043,6 +3234,7 @@ udev udevadm ufw ugen +ui uid uint ukUNV @@ -3056,11 +3248,13 @@ undefine undervoltage unescaped unicast +unicode uninstall uninterruptible uniq unistd unitidentify +unix unmapped unmounts unpowered @@ -3076,6 +3270,7 @@ upsIdent upsIdentModel upsMIB upsObjects +upsadmin upsc upscli upsclient @@ -3096,6 +3291,7 @@ upsfetch upsgone upsh upshandler +upsid upsidentmodel upsimage upsload @@ -3106,6 +3302,7 @@ upsmon's upsmonuser upsname upsonbatt +upspass upspasswd upsrw upssched @@ -3124,7 +3321,9 @@ usbconfig usbfs usbhid usbif +usbinfo usbmisc +usbscan usbups usbus usd @@ -3141,6 +3340,7 @@ usleep usr utalk utf +utils uu uucp vCPU @@ -3171,7 +3371,10 @@ victronups vid vin virsh +virt +virtinst virtualization +virtualized vivo vo vod @@ -3183,6 +3386,7 @@ waitbeforereconnect wakeup wc wchar +wdi webNUT webnut webserver @@ -3191,9 +3395,12 @@ wf wget whitespace wiki +wildcard wildcards +wininit winnutclient winpthreads +wix wmNUT wmnut wordformat @@ -3226,10 +3433,13 @@ xfmrresistance xh xhci xhtml +xjf xmalloc xml xmllint +xmlto xpg +xpm xr xrealloc xsl @@ -3240,6 +3450,8 @@ xu xxxAP xxxx xxxxAP +xz +xzf yaml yml youruid diff --git a/docs/security.txt b/docs/security.txt index 92673eb86e..99e85b7ee7 100644 --- a/docs/security.txt +++ b/docs/security.txt @@ -187,7 +187,7 @@ During the initial <>, we have created a monitoring user for `upsmon`. -You can also create an 'administrator' user with full power using: +You can also create an `administrator` user in NUT with full power using: [administrator] password = mypass @@ -295,10 +295,10 @@ Configuring SSL SSL is available as a build option (`--with-ssl`). -It encrypts sessions between upsd and clients, and can also be used to +It encrypts sessions between `upsd` and clients, and can also be used to authenticate servers. -This means that stealing port 3493 from upsd will no longer net you interesting +This means that stealing port 3493 from `upsd` will no longer net you interesting passwords. Several things must happen before this will work, however. This chapter will @@ -375,18 +375,18 @@ Example: cp upsd.crt /usr/local/ups/etc/certs/0123abcd.0 If you already have a file with that name in there, increment the -0 until you get a unique filename that works. +`0` part until you get a unique filename that works. -If you have multiple client systems (like upsmon instances in +If you have multiple client systems (like `upsmon` instances in secondary mode), be sure to install this file on them as well. We recommend making a directory under your existing confpath to keep everything in the same place. Remember the path you created, -since you will need to put it in upsmon.conf later. +since you will need to put it in `upsmon.conf` later. It must not be writable by unprivileged users, since someone could -insert a new client certificate and fool upsmon into trusting a -fake upsd. +insert a new client certificate and fool `upsmon` into trusting a +fake `upsd`. Create the combined file for upsd ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -398,12 +398,12 @@ To do so, use the below commands: chmod 0640 upsd.pem This file must be kept secure, since anyone possessing it could -pretend to be upsd and harvest authentication data if they get a +pretend to be `upsd` and harvest authentication data if they get a hold of port 3493. -Having it be owned by 'root' and readable by group 'nut' allows upsd +Having it owned by `root` and readable by group `nut` allows `upsd` to read the file without being able to change the contents. This -is done to minimize the impact if someone should break into upsd. +is done to minimize the impact if someone should break into `upsd`. NUT reads the key and certificate files after dropping privileges and forking. @@ -439,13 +439,13 @@ Restart upsd It should come back up without any complaints. If it says something about keys or certificates, then you probably missed a step. -If you run upsd as a separate user id (like nutsrv), make sure that -user can read the upsd.pem file. +If you run `upsd` as a separate user id (like `nutsrv`), make sure that +user can read the `upsd.pem` file. Point upsmon at the certificates ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -Edit your upsmon.conf, and tell it where the CERTPATH is: +Edit your `upsmon.conf`, and tell it where the `CERTPATH` is: CERTPATH @@ -456,27 +456,27 @@ Example: Recommended: make upsmon verify all connections with certificates ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -Put this in upsmon.conf: +Put this in `upsmon.conf`: CERTVERIFY 1 -Without this, there is no guarantee that the upsd is the right host. +Without this, there is no guarantee that the `upsd` is the right host. Enabling this greatly reduces the risk of man in the middle attacks. This effectively forces the use of SSL, so don't use this unless -all of your upsd hosts are ready for SSL and have their certificates +all of your `upsd` hosts are ready for SSL and have their certificates in order. Recommended: force upsmon to use SSL ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -Again in upsmon.conf: +Again in `upsmon.conf`: FORCESSL 1 If you don't use `CERTVERIFY 1`, then this will at least make sure that nobody can sniff your sessions without a large effort. Setting -this will make upsmon drop connections if the remote upsd doesn't +this will make `upsmon` drop connections if the remote `upsd` doesn't support SSL, so don't use it unless all of them have it running. NSS backend usage @@ -510,12 +510,12 @@ Certificates should be signed by a certification authorities (CAs). Following commands are typical samples, contact your SSL guru or security officer to follow your company procedures. -.Generate a server certificate for upsd: +.Generate a server certificate for `upsd`: - Create a directory where store the certificate database: `mkdir cert_db` - Create the certificate database : `certutil -N -d cert_db` - Import the CA certificate: `certutil -A -d cert_db -n "My Root CA" -t "TC,," -a -i rootca.crt` -- Create a server certificate request (here called 'My nut server'): +- Create a server certificate request (here called "My nut server"): `certutil -R -d cert_db -s "CN=My nut server,O=MyCompany,ST=MyState,C=US" -a -o server.req` - Make your CA sign the certificate (produces server.crt) - Import the signed certificate into server database: @@ -542,8 +542,8 @@ an "official" certificate authority. `certutil -N -d CA_db` - Generate a certificate for CA: `certutil -S -d CA_db -n "My Root CA" -s "CN=My CA,O=MyCompany,ST=MyState,C=US" -t "CT,," -x -2` -(Do not forget to answer 'Yes' to the question 'Is this a CA certificate [y/N]?') -- Extract the CA certificate to be able to import it in upsd (or upsmon) +(Do not forget to answer `Yes` to the question "Is this a CA certificate [y/N]?") +- Extract the CA certificate to be able to import it in `upsd` (or `upsmon`) certificate database: `certutil -L -d CA_db -n "My Root CA" -a -o rootca.crt` - Sign a certificate request with the CA certificate (simulate a real CA @@ -562,14 +562,14 @@ database .db files) to the right place, such as `/usr/local/ups/etc/`: upsd (required): certificate database and self certificate ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -Edit the upsd.conf to tell where find the certificate database: +Edit the `upsd.conf` to tell where find the certificate database: CERTPATH /usr/local/ups/etc/cert_db Also tell which is the certificate to send to clients to authenticate itself and the password to decrypt private key associated to certificate: - CERTIDENT 'certificate name' 'database password' + CERTIDENT "certificate name" "database password" NOTE: Generally, the certificate name is the server domain name, but is not a hard rule. The certificate can be named as useful. @@ -583,7 +583,7 @@ NUT with `WITH_CLIENT_CERTIFICATE_VALIDATION` defined: make CFLAGS="-DWITH_CLIENT_CERTIFICATE_VALIDATION" UPSD can accept three levels of client authentication. Just specify it with -the directive `CERTREQUEST` with the corresponding value in the upsd.conf +the directive `CERTREQUEST` with the corresponding value in the `upsd.conf` file: - NO: no client authentication. @@ -593,28 +593,29 @@ If the client does not send any certificate, the connection is closed. - REQUIRE: a certificate is requested to the client and if it is not valid (no validation chain) the connection is closed. -Like CA certificates, you can add many 'trusted' client and CA certificates +Like CA certificates, you can add many "trusted" client and CA certificates in server's certificate databases. upsmon (required): upsd authentication ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -In order for upsmon to securely connect to upsd, it must authenticate it. -You must associate an upsd host name to security rules in upsmon.conf -with the directive 'CERTHOST'. +In order for `upsmon` to securely connect to `upsd`, it must authenticate it. +You must associate an `upsd` host name to security rules in `upsmon.conf` +with the directive `CERTHOST`. -'CERTHOST' associates a hostname to a certificate name. It also determines +`CERTHOST` associates a hostname to a certificate name. It also determines whether a SSL connection is mandatory, and if the server certificate must be validated. - CERTHOST 'hostname' 'certificate name' 'certverify' 'forcessl' + CERTHOST "hostname" "certificate name" "certverify" "forcessl" -If the flag `forcessl` is set to `1`, and upsd answers that it can not +If the flag `forcessl` is set to `1`, and `upsd` answers that it can not connect with SSL, the connection closes. + If the flag `certverify` is set to `1` and the connection is done in SSL, -upsd's certificate is verified and its name must be the specified -'certificate name'. +`upsd`'s certificate is verified and its name must be the specified +`"certificate name"`. To prevent security leaks, you should set all `certverify` and `forcessl` flags to `1` (force SSL connection and validate all certificates for all @@ -631,14 +632,15 @@ name is its hostname. upsmon (optional): certificate database and self certificate ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -Like upsd, upsmon may need to authenticate itself (upsd's `CERTREQUEST` +Like `upsd`, `upsmon` may need to authenticate itself (`upsd`'s `CERTREQUEST` directive set to `REQUEST` or `REQUIRE`). + It must access to a certificate (and its private key) in a certificate -database configuring `CERTPATH` and `CERTIDENT` in upsmon.conf in the -same way as upsd. +database configuring `CERTPATH` and `CERTIDENT` in `upsmon.conf` in the +same way as `upsd`. CERTPATH /usr/local/ups/etc/cert_db - CERTIDENT 'certificate name' 'database password' + CERTIDENT "certificate name" "database password" Restart upsd @@ -647,21 +649,21 @@ Restart upsd It should come back up without any complaints. If it says something about keys or certificates, then you probably missed a step. -If you run upsd as a separate user ID (like nutsrv), make sure that +If you run `upsd` as a separate user ID (like `nutsrv`), make sure that user can read files in the certificate directory. NUT reads the keys and certificates after forking and dropping privileges. Restart upsmon ~~~~~~~~~~~~~~ -You should see something like this in the syslog from upsd: +You should see something like this in the syslog from `upsd`: foo upsd[1234]: Client mon@localhost logged in to UPS [myups] (SSL) -If upsd or upsmon give any error messages, or the `(SSL)` is missing, +If `upsd` or `upsmon` give any error messages, or the `(SSL)` is missing, then something isn't right. -If in doubt about upsmon, start it with -D so it will stay in +If in doubt about `upsmon`, start it with `-D` so it will stay in the foreground and print debug messages. It should print something like this every couple of seconds: @@ -731,7 +733,7 @@ Note that the replacement of OpenSSL by Mozilla Network Security Services chrooting and other forms of paranoia ------------------------------------- -It has been possible to run the drivers and upsd in a chrooted jail for +It has been possible to run the drivers and `upsd` in a chrooted jail for some time, but it involved a number of evil hacks. From the 1.3 series, a much saner chroot behavior exists, using BIND 9 as an inspiration. @@ -763,7 +765,7 @@ programs have been built with the default prefix, so they are using cp -a /usr/local/ups/etc/upsd.conf . cp -a /usr/local/ups/etc/ups.conf . -We're using 'cp -a' to maintain the permissions on those files. +We're using `cp -a` to maintain the permissions on those files. Now bring over your state path, maintaining the same permissions as before. @@ -803,7 +805,7 @@ symlinks ~~~~~~~~ After you do this, you will have two copies of many things, like the -confpath and the state path. I recommend deleting the 'real' +confpath and the state path. I recommend deleting the "real" `/var/state/ups`, replacing it with a symlink to `/chroot/nut/var/state/ups`. That will let other programs reference the `.pid` files without a lot of hassle. @@ -811,7 +813,7 @@ confpath and the state path. I recommend deleting the 'real' You can also do this with your confpath and point `/usr/local/ups/etc` (or equivalent on your system) at `/chroot/nut/usr/local/ups/etc` unless you're worried about something hurting the files inside that directory. In that -case, you should maintain a 'golden' copy and push it into the chroot path +case, you should maintain a "golden" copy and push it into the chroot path after making changes. The `upsdrvctl` itself does not chroot, so the `ups.conf` still needs to be @@ -820,9 +822,9 @@ in the usual confpath. upsmon ~~~~~~ -This has not yet been applied to upsmon, since it can be quite +This has not yet been applied to `upsmon`, since it can be quite complicated when there are notifiers that need to be run. One -possibility would be for upsmon to have three instances: +possibility would be for `upsmon` to have three instances: - privileged root parent that listens for a shutdown command diff --git a/drivers/Makefile.am b/drivers/Makefile.am index b07741d566..3eede11ff7 100644 --- a/drivers/Makefile.am +++ b/drivers/Makefile.am @@ -1,10 +1,19 @@ # Network UPS Tools: drivers +# Export certain values for ccache which NUT ci_build.sh can customize, +# to facilitate developer iteration re-runs of "make" later. +# At least GNU and BSD make implementations are okay with this syntax. +@NUT_AM_MAKE_CAN_EXPORT@export CCACHE_NAMESPACE=@CCACHE_NAMESPACE@ +@NUT_AM_MAKE_CAN_EXPORT@export CCACHE_BASEDIR=@CCACHE_BASEDIR@ +@NUT_AM_MAKE_CAN_EXPORT@export CCACHE_DIR=@CCACHE_DIR@ +@NUT_AM_MAKE_CAN_EXPORT@export CCACHE_PATH=@CCACHE_PATH@ +@NUT_AM_MAKE_CAN_EXPORT@export PATH=@PATH_DURING_CONFIGURE@ + # Make sure out-of-dir dependencies exist (especially when dev-building parts): $(top_builddir)/common/libcommon.la \ $(top_builddir)/common/libparseconf.la \ $(top_builddir)/clients/libupsclient.la: dummy - @cd $(@D) && $(MAKE) $(AM_MAKEFLAGS) $(@F) + +@cd $(@D) && $(MAKE) $(AM_MAKEFLAGS) $(@F) # by default, link programs in this directory with libcommon.la # (libtool version of the static lib, in order to access LTLIBOBJS) @@ -294,8 +303,16 @@ generic_modbus_SOURCES = generic_modbus.c generic_modbus_LDADD = $(LDADD_DRIVERS) $(LIBMODBUS_LIBS) adelsystem_cbi_SOURCES = adelsystem_cbi.c adelsystem_cbi_LDADD = $(LDADD_DRIVERS) $(LIBMODBUS_LIBS) -apc_modbus_SOURCES = apc_modbus.c $(LIBUSB_IMPL) hidparser.c usb-common.c -apc_modbus_LDADD = $(LDADD_DRIVERS) $(LIBMODBUS_LIBS) $(LIBUSB_LIBS) + +# APC Modbus driver (with support of modbus over different media) +# Note that a version of libmodbus built with USB support is also needed +# for USB connections. Legacy versions work for Serial and TCP links. +apc_modbus_SOURCES = apc_modbus.c +apc_modbus_LDADD = $(LDADD_DRIVERS) $(LIBMODBUS_LIBS) +if WITH_USB + apc_modbus_SOURCES += $(LIBUSB_IMPL) hidparser.c usb-common.c + apc_modbus_LDADD += $(LIBUSB_LIBS) +endif # Huawei UPS2000 driver # (this is both a Modbus and a serial driver) diff --git a/drivers/apc-ats-mib.c b/drivers/apc-ats-mib.c index 5cb8cc50be..c172f3445d 100644 --- a/drivers/apc-ats-mib.c +++ b/drivers/apc-ats-mib.c @@ -24,430 +24,429 @@ #include "apc-ats-mib.h" -#define APC_ATS_MIB_VERSION "0.6" +#define APC_ATS_MIB_VERSION "0.60" #define APC_ATS_SYSOID ".1.3.6.1.4.1.318.1.3.11" #define APC_ATS_OID_MODEL_NAME ".1.3.6.1.4.1.318.1.1.8.1.5.0" static info_lkp_t apc_ats_sensitivity_info[] = { - { 1, "high", NULL, NULL }, - { 2, "low", NULL, NULL }, - { 0, NULL, NULL, NULL } + info_lkp_default(1, "high"), + info_lkp_default(2, "low"), + info_lkp_sentinel }; static info_lkp_t apc_ats_output_status_info[] = { - { 1, "OFF", NULL, NULL }, /* fail */ - { 2, "OL", NULL, NULL }, /* ok */ - { 0, NULL, NULL, NULL } + info_lkp_default(1, "OFF"), /* fail */ + info_lkp_default(2, "OL"), /* ok */ + info_lkp_sentinel }; static info_lkp_t apc_ats_outletgroups_name_info[] = { - { 1, "total", NULL, NULL }, - { 2, "bank1", NULL, NULL }, - { 3, "bank2", NULL, NULL }, - { 0, NULL, NULL, NULL } + info_lkp_default(1, "total"), + info_lkp_default(2, "bank1"), + info_lkp_default(3, "bank2"), + info_lkp_sentinel }; static info_lkp_t apc_ats_outletgroups_status_info[] = { - { 1, "OL", NULL, NULL }, /* normal */ - { 2, "", NULL, NULL }, /* lowload */ - { 3, "", NULL, NULL }, /* nearoverload */ - { 4, "OVER", NULL, NULL }, /* overload */ - { 0, NULL, NULL, NULL } + info_lkp_default(1, "OL"), /* normal */ + info_lkp_default(2, ""), /* lowload */ + info_lkp_default(3, ""), /* nearoverload */ + info_lkp_default(4, "OVER"), /* overload */ + info_lkp_sentinel }; /* APC ATS Snmp2NUT lookup table */ static snmp_info_t apc_ats_mib[] = { /* standard MIB items */ - { "device.description", ST_FLAG_STRING | ST_FLAG_RW, SU_INFOSIZE, ".1.3.6.1.2.1.1.1.0", NULL, SU_FLAG_OK, NULL }, - { "device.contact", ST_FLAG_STRING | ST_FLAG_RW, SU_INFOSIZE, ".1.3.6.1.2.1.1.4.0", NULL, SU_FLAG_OK, NULL }, - { "device.location", ST_FLAG_STRING | ST_FLAG_RW, SU_INFOSIZE, ".1.3.6.1.2.1.1.6.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("device.description", ST_FLAG_STRING | ST_FLAG_RW, SU_INFOSIZE, ".1.3.6.1.2.1.1.1.0", NULL, SU_FLAG_OK, NULL), + snmp_info_default("device.contact", ST_FLAG_STRING | ST_FLAG_RW, SU_INFOSIZE, ".1.3.6.1.2.1.1.4.0", NULL, SU_FLAG_OK, NULL), + snmp_info_default("device.location", ST_FLAG_STRING | ST_FLAG_RW, SU_INFOSIZE, ".1.3.6.1.2.1.1.6.0", NULL, SU_FLAG_OK, NULL), /* Device collection */ - { "device.type", ST_FLAG_STRING, SU_INFOSIZE, NULL, "ats", SU_FLAG_STATIC | SU_FLAG_ABSENT | SU_FLAG_OK, NULL }, + snmp_info_default("device.type", ST_FLAG_STRING, SU_INFOSIZE, NULL, "ats", SU_FLAG_STATIC | SU_FLAG_ABSENT | SU_FLAG_OK, NULL), /* ats2IdentManufacturer.0 = STRING: EATON */ - { "device.mfr", ST_FLAG_STRING, SU_INFOSIZE, NULL, "APC", SU_FLAG_STATIC | SU_FLAG_ABSENT | SU_FLAG_OK, NULL }, + snmp_info_default("device.mfr", ST_FLAG_STRING, SU_INFOSIZE, NULL, "APC", SU_FLAG_STATIC | SU_FLAG_ABSENT | SU_FLAG_OK, NULL), /* atsIdentModelNumber.0 = STRING: "AP7724" */ - { "device.model", ST_FLAG_STRING, SU_INFOSIZE, APC_ATS_OID_MODEL_NAME, NULL, SU_FLAG_OK, NULL }, + snmp_info_default("device.model", ST_FLAG_STRING, SU_INFOSIZE, APC_ATS_OID_MODEL_NAME, NULL, SU_FLAG_OK, NULL), /* FIXME: RFC for device.firmware! */ /* atsIdentHardwareRev.0 = STRING: "R01" */ - { "ups.firmware", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.1.8.1.1.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("ups.firmware", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.1.8.1.1.0", NULL, SU_FLAG_OK, NULL), /* FIXME: RFC for device.firmware.aux! */ /* atsIdentFirmwareRev.0 = STRING: "3.0.5" */ - { "ups.firmware.aux", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.1.8.1.2.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("ups.firmware.aux", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.1.8.1.2.0", NULL, SU_FLAG_OK, NULL), /* atsIdentFirmwareDate.0 = STRING: "09/13/11" */ - /*{ "unmapped.atsIdentFirmwareDate", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.1.8.1.3.0", NULL, SU_FLAG_OK, NULL },*/ + /*snmp_info_default("unmapped.atsIdentFirmwareDate", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.1.8.1.3.0", NULL, SU_FLAG_OK, NULL),*/ /* atsIdentSerialNumber.0 = STRING: "5A1516T15268" */ - { "device.serial", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.1.8.1.6.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("device.serial", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.1.8.1.6.0", NULL, SU_FLAG_OK, NULL), /* FIXME: RFC for device.mfr.date! */ /* atsIdentDateOfManufacture.0 = STRING: "04/18/2015" */ - { "ups.mfr.date", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.1.8.1.4.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("ups.mfr.date", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.1.8.1.4.0", NULL, SU_FLAG_OK, NULL), /* atsConfigProductName.0 = STRING: "m-ups-04" */ - { "ups.id", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.1.8.4.1.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("ups.id", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.1.8.4.1.0", NULL, SU_FLAG_OK, NULL), /* Input collection */ /* atsIdentNominalLineVoltage.0 = INTEGER: 230 */ - { "input.voltage.nominal", 0, 1, ".1.3.6.1.4.1.318.1.1.8.1.7.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("input.voltage.nominal", 0, 1, ".1.3.6.1.4.1.318.1.1.8.1.7.0", NULL, SU_FLAG_OK, NULL), /* atsIdentNominalLineFrequency.0 = INTEGER: 50 */ - { "input.frequency.nominal", 0, 1, ".1.3.6.1.4.1.318.1.1.8.1.8.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("input.frequency.nominal", 0, 1, ".1.3.6.1.4.1.318.1.1.8.1.8.0", NULL, SU_FLAG_OK, NULL), /* atsStatusSelectedSource.0 = INTEGER: sourceB(2) */ - { "input.source", 0, 1, ".1.3.6.1.4.1.318.1.1.8.5.1.2.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("input.source", 0, 1, ".1.3.6.1.4.1.318.1.1.8.5.1.2.0", NULL, SU_FLAG_OK, NULL), /* atsConfigPreferredSource.0 = INTEGER: sourceB(2) */ - { "input.source.preferred", ST_FLAG_RW, 1, ".1.3.6.1.4.1.318.1.1.8.4.2.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("input.source.preferred", ST_FLAG_RW, 1, ".1.3.6.1.4.1.318.1.1.8.4.2.0", NULL, SU_FLAG_OK, NULL), /* atsInputVoltage.1.1.1 = INTEGER: 216 */ - { "input.1.voltage", 0, 1, ".1.3.6.1.4.1.318.1.1.8.5.3.3.1.3.1.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("input.1.voltage", 0, 1, ".1.3.6.1.4.1.318.1.1.8.5.3.3.1.3.1.1.1", NULL, SU_FLAG_OK, NULL), /* atsInputVoltage.2.1.1 = INTEGER: 215 */ - { "input.2.voltage", 0, 1, ".1.3.6.1.4.1.318.1.1.8.5.3.3.1.3.2.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("input.2.voltage", 0, 1, ".1.3.6.1.4.1.318.1.1.8.5.3.3.1.3.2.1.1", NULL, SU_FLAG_OK, NULL), /* atsInputFrequency.1 = INTEGER: 50 */ - { "input.1.frequency", 0, 1, ".1.3.6.1.4.1.318.1.1.8.5.3.2.1.4.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("input.1.frequency", 0, 1, ".1.3.6.1.4.1.318.1.1.8.5.3.2.1.4.1", NULL, SU_FLAG_OK, NULL), /* atsInputFrequency.2 = INTEGER: 50 */ - { "input.2.frequency", 0, 1, ".1.3.6.1.4.1.318.1.1.8.5.3.2.1.4.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("input.2.frequency", 0, 1, ".1.3.6.1.4.1.318.1.1.8.5.3.2.1.4.2", NULL, SU_FLAG_OK, NULL), /* atsConfigVoltageSensitivity.0 = INTEGER: high(1) */ - { "input.sensitivity", ST_FLAG_RW, 1, ".1.3.6.1.4.1.318.1.1.8.4.4.0", NULL, SU_FLAG_OK, &apc_ats_sensitivity_info[0] }, + snmp_info_default("input.sensitivity", ST_FLAG_RW, 1, ".1.3.6.1.4.1.318.1.1.8.4.4.0", NULL, SU_FLAG_OK, &apc_ats_sensitivity_info[0]), /* FIXME: RFC for input.count! */ /* atsNumInputs.0 = INTEGER: 2 */ - { "input.count", 0, 1, ".1.3.6.1.4.1.318.1.1.8.5.3.1.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("input.count", 0, 1, ".1.3.6.1.4.1.318.1.1.8.5.3.1.0", NULL, SU_FLAG_OK, NULL), /* Output collection */ /* atsOutputFrequency.1 = INTEGER: 50 */ - { "output.frequency", 0, 1, ".1.3.6.1.4.1.318.1.1.8.5.4.2.1.4.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("output.frequency", 0, 1, ".1.3.6.1.4.1.318.1.1.8.5.4.2.1.4.1", NULL, SU_FLAG_OK, NULL), /* atsOutputBankOutputVoltage.1 = INTEGER: 215 */ - { "output.voltage", 0, 1, ".1.3.6.1.4.1.318.1.1.8.5.4.5.1.6.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("output.voltage", 0, 1, ".1.3.6.1.4.1.318.1.1.8.5.4.5.1.6.1", NULL, SU_FLAG_OK, NULL), /* UPS collection */ /* FIXME: RFC for device.status! */ /* atsStatusVoltageOutStatus.0 = INTEGER: ok(2) */ - { "ups.status", 0, 1, ".1.3.6.1.4.1.318.1.1.8.5.1.15.0", NULL, SU_FLAG_OK, &apc_ats_output_status_info[0] }, + snmp_info_default("ups.status", 0, 1, ".1.3.6.1.4.1.318.1.1.8.5.1.15.0", NULL, SU_FLAG_OK, &apc_ats_output_status_info[0]), /* Outlet groups collection */ /* Note: prefer the OutputBank data to the ConfigBank ones */ /* atsConfigBankTableSize.0 = INTEGER: 3 */ - /*{ "outlet.group.count", 0, 1, ".1.3.6.1.4.1.318.1.1.8.4.13.0", NULL, SU_FLAG_OK, NULL },*/ + /*snmp_info_default("outlet.group.count", 0, 1, ".1.3.6.1.4.1.318.1.1.8.4.13.0", NULL, SU_FLAG_OK, NULL),*/ /* atsOutputBankTableSize.0 = INTEGER: 3 */ - { "outlet.group.count", 0, 1, ".1.3.6.1.4.1.318.1.1.8.5.4.4.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("outlet.group.count", 0, 1, ".1.3.6.1.4.1.318.1.1.8.5.4.4.0", NULL, SU_FLAG_OK, NULL), /* atsConfigBankTableIndex.%i = INTEGER: %i */ - /*{ "outlet.group.%i.id", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.1.8.4.14.1.1.%i", NULL, SU_FLAG_OK, NULL },*/ + /*snmp_info_default("outlet.group.%i.id", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.1.8.4.14.1.1.%i", NULL, SU_FLAG_OK, NULL),*/ /* atsOutputBankTableIndex.%i = INTEGER: %i */ - { "outlet.group.%i.id", 0, 1, ".1.3.6.1.4.1.318.1.1.8.5.4.5.1.1.%i", NULL, SU_FLAG_OK | SU_OUTLET_GROUP, NULL }, + snmp_info_default("outlet.group.%i.id", 0, 1, ".1.3.6.1.4.1.318.1.1.8.5.4.5.1.1.%i", NULL, SU_FLAG_OK | SU_OUTLET_GROUP, NULL), /* atsConfigBank.%i = INTEGER: total(1) */ - /*{ "outlet.group.%i.name", 0, 1, ".1.3.6.1.4.1.318.1.1.8.4.14.1.2.%i", NULL, SU_FLAG_STATIC | SU_OUTLET_GROUP, &apc_ats_group_name_info[0] },*/ + /*snmp_info_default("outlet.group.%i.name", 0, 1, ".1.3.6.1.4.1.318.1.1.8.4.14.1.2.%i", NULL, SU_FLAG_STATIC | SU_OUTLET_GROUP, &apc_ats_group_name_info[0]),*/ /* atsOutputBank.1 = INTEGER: total(1) */ - { "outlet.group.%i.name", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.1.8.5.4.5.1.3.%i", NULL, SU_FLAG_STATIC | SU_OUTLET_GROUP, &apc_ats_outletgroups_name_info[0] }, + snmp_info_default("outlet.group.%i.name", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.1.8.5.4.5.1.3.%i", NULL, SU_FLAG_STATIC | SU_OUTLET_GROUP, &apc_ats_outletgroups_name_info[0]), /* atsOutputBankCurrent.%i = Gauge32: 88 */ - { "outlet.group.%i.current", 0, 0.1, ".1.3.6.1.4.1.318.1.1.8.5.4.5.1.4.%i", NULL, SU_OUTLET_GROUP, NULL }, + snmp_info_default("outlet.group.%i.current", 0, 0.1, ".1.3.6.1.4.1.318.1.1.8.5.4.5.1.4.%i", NULL, SU_OUTLET_GROUP, NULL), /* atsOutputBankState.%i = INTEGER: normal(1) */ - { "outlet.group.%i.status", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.1.8.5.4.5.1.5.%i", NULL, SU_OUTLET_GROUP, &apc_ats_outletgroups_status_info[0] }, + snmp_info_default("outlet.group.%i.status", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.1.8.5.4.5.1.5.%i", NULL, SU_OUTLET_GROUP, &apc_ats_outletgroups_status_info[0]), /* atsOutputBankOutputVoltage.%i = INTEGER: 215 */ - { "outlet.group.%i.voltage", 0, 1, ".1.3.6.1.4.1.318.1.1.8.5.4.5.1.6.%i", NULL, SU_OUTLET_GROUP, NULL }, + snmp_info_default("outlet.group.%i.voltage", 0, 1, ".1.3.6.1.4.1.318.1.1.8.5.4.5.1.6.%i", NULL, SU_OUTLET_GROUP, NULL), /* atsOutputBankPower.1 = INTEGER: 1883 */ - { "outlet.group.%i.realpower", 0, 1, ".1.3.6.1.4.1.318.1.1.8.5.4.5.1.15.%i", NULL, SU_FLAG_NEGINVALID | SU_OUTLET_GROUP, NULL }, - + snmp_info_default("outlet.group.%i.realpower", 0, 1, ".1.3.6.1.4.1.318.1.1.8.5.4.5.1.15.%i", NULL, SU_FLAG_NEGINVALID | SU_OUTLET_GROUP, NULL), #if WITH_UNMAPPED_DATA_POINTS /* FIXME: Remaining data to be processed */ /* atsIdentDeviceRating.0 = INTEGER: 32 */ - { "unmapped.atsIdentDeviceRating", 0, 1, ".1.3.6.1.4.1.318.1.1.8.1.9.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.atsIdentDeviceRating", 0, 1, ".1.3.6.1.4.1.318.1.1.8.1.9.0", NULL, SU_FLAG_OK, NULL), /* atsCalibrationNumInputs.0 = INTEGER: 2 */ - { "unmapped.atsCalibrationNumInputs", 0, 1, ".1.3.6.1.4.1.318.1.1.8.2.1.1.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.atsCalibrationNumInputs", 0, 1, ".1.3.6.1.4.1.318.1.1.8.2.1.1.0", NULL, SU_FLAG_OK, NULL), /* atsCalibrationNumInputPhases.0 = INTEGER: 1 */ - { "unmapped.atsCalibrationNumInputPhases", 0, 1, ".1.3.6.1.4.1.318.1.1.8.2.1.2.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.atsCalibrationNumInputPhases", 0, 1, ".1.3.6.1.4.1.318.1.1.8.2.1.2.0", NULL, SU_FLAG_OK, NULL), /* atsCalibrationInputTableIndex.1.1.1 = INTEGER: 1 */ - { "unmapped.atsCalibrationInputTableIndex", 0, 1, ".1.3.6.1.4.1.318.1.1.8.2.1.3.1.1.1.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.atsCalibrationInputTableIndex", 0, 1, ".1.3.6.1.4.1.318.1.1.8.2.1.3.1.1.1.1.1", NULL, SU_FLAG_OK, NULL), /* atsCalibrationInputTableIndex.2.1.1 = INTEGER: 2 */ - { "unmapped.atsCalibrationInputTableIndex", 0, 1, ".1.3.6.1.4.1.318.1.1.8.2.1.3.1.1.2.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.atsCalibrationInputTableIndex", 0, 1, ".1.3.6.1.4.1.318.1.1.8.2.1.3.1.1.2.1.1", NULL, SU_FLAG_OK, NULL), /* atsCalibrationInputPhaseTableIndex.1.1.1 = INTEGER: 1 */ - { "unmapped.atsCalibrationInputPhaseTableIndex", 0, 1, ".1.3.6.1.4.1.318.1.1.8.2.1.3.1.2.1.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.atsCalibrationInputPhaseTableIndex", 0, 1, ".1.3.6.1.4.1.318.1.1.8.2.1.3.1.2.1.1.1", NULL, SU_FLAG_OK, NULL), /* atsCalibrationInputPhaseTableIndex.2.1.1 = INTEGER: 1 */ - { "unmapped.atsCalibrationInputPhaseTableIndex", 0, 1, ".1.3.6.1.4.1.318.1.1.8.2.1.3.1.2.2.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.atsCalibrationInputPhaseTableIndex", 0, 1, ".1.3.6.1.4.1.318.1.1.8.2.1.3.1.2.2.1.1", NULL, SU_FLAG_OK, NULL), /* atsLineVoltageCalibrationFactor.1.1.1 = INTEGER: 487 */ - { "unmapped.atsLineVoltageCalibrationFactor", 0, 1, ".1.3.6.1.4.1.318.1.1.8.2.1.3.1.3.1.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.atsLineVoltageCalibrationFactor", 0, 1, ".1.3.6.1.4.1.318.1.1.8.2.1.3.1.3.1.1.1", NULL, SU_FLAG_OK, NULL), /* atsLineVoltageCalibrationFactor.2.1.1 = INTEGER: 488 */ - { "unmapped.atsLineVoltageCalibrationFactor", 0, 1, ".1.3.6.1.4.1.318.1.1.8.2.1.3.1.3.2.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.atsLineVoltageCalibrationFactor", 0, 1, ".1.3.6.1.4.1.318.1.1.8.2.1.3.1.3.2.1.1", NULL, SU_FLAG_OK, NULL), /* atsCalibrationPowerSupplyVoltages.0 = INTEGER: 5 */ - { "unmapped.atsCalibrationPowerSupplyVoltages", 0, 1, ".1.3.6.1.4.1.318.1.1.8.2.2.1.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.atsCalibrationPowerSupplyVoltages", 0, 1, ".1.3.6.1.4.1.318.1.1.8.2.2.1.0", NULL, SU_FLAG_OK, NULL), /* atsCalibrationPowerSupplyVoltageTableIndex.1 = INTEGER: 1 */ - { "unmapped.atsCalibrationPowerSupplyVoltageTableIndex", 0, 1, ".1.3.6.1.4.1.318.1.1.8.2.2.2.1.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.atsCalibrationPowerSupplyVoltageTableIndex", 0, 1, ".1.3.6.1.4.1.318.1.1.8.2.2.2.1.1.1", NULL, SU_FLAG_OK, NULL), /* atsCalibrationPowerSupplyVoltageTableIndex.2 = INTEGER: 2 */ - { "unmapped.atsCalibrationPowerSupplyVoltageTableIndex", 0, 1, ".1.3.6.1.4.1.318.1.1.8.2.2.2.1.1.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.atsCalibrationPowerSupplyVoltageTableIndex", 0, 1, ".1.3.6.1.4.1.318.1.1.8.2.2.2.1.1.2", NULL, SU_FLAG_OK, NULL), /* atsCalibrationPowerSupplyVoltageTableIndex.3 = INTEGER: 3 */ - { "unmapped.atsCalibrationPowerSupplyVoltageTableIndex", 0, 1, ".1.3.6.1.4.1.318.1.1.8.2.2.2.1.1.3", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.atsCalibrationPowerSupplyVoltageTableIndex", 0, 1, ".1.3.6.1.4.1.318.1.1.8.2.2.2.1.1.3", NULL, SU_FLAG_OK, NULL), /* atsCalibrationPowerSupplyVoltageTableIndex.4 = INTEGER: 4 */ - { "unmapped.atsCalibrationPowerSupplyVoltageTableIndex", 0, 1, ".1.3.6.1.4.1.318.1.1.8.2.2.2.1.1.4", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.atsCalibrationPowerSupplyVoltageTableIndex", 0, 1, ".1.3.6.1.4.1.318.1.1.8.2.2.2.1.1.4", NULL, SU_FLAG_OK, NULL), /* atsCalibrationPowerSupplyVoltageTableIndex.5 = INTEGER: 5 */ - { "unmapped.atsCalibrationPowerSupplyVoltageTableIndex", 0, 1, ".1.3.6.1.4.1.318.1.1.8.2.2.2.1.1.5", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.atsCalibrationPowerSupplyVoltageTableIndex", 0, 1, ".1.3.6.1.4.1.318.1.1.8.2.2.2.1.1.5", NULL, SU_FLAG_OK, NULL), /* atsCalibrationPowerSupplyVoltage.1 = INTEGER: powerSupply24V(1) */ - { "unmapped.atsCalibrationPowerSupplyVoltage", 0, 1, ".1.3.6.1.4.1.318.1.1.8.2.2.2.1.2.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.atsCalibrationPowerSupplyVoltage", 0, 1, ".1.3.6.1.4.1.318.1.1.8.2.2.2.1.2.1", NULL, SU_FLAG_OK, NULL), /* atsCalibrationPowerSupplyVoltage.2 = INTEGER: powerSupply12V(2) */ - { "unmapped.atsCalibrationPowerSupplyVoltage", 0, 1, ".1.3.6.1.4.1.318.1.1.8.2.2.2.1.2.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.atsCalibrationPowerSupplyVoltage", 0, 1, ".1.3.6.1.4.1.318.1.1.8.2.2.2.1.2.2", NULL, SU_FLAG_OK, NULL), /* atsCalibrationPowerSupplyVoltage.3 = INTEGER: powerSupply(3) */ - { "unmapped.atsCalibrationPowerSupplyVoltage", 0, 1, ".1.3.6.1.4.1.318.1.1.8.2.2.2.1.2.3", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.atsCalibrationPowerSupplyVoltage", 0, 1, ".1.3.6.1.4.1.318.1.1.8.2.2.2.1.2.3", NULL, SU_FLAG_OK, NULL), /* atsCalibrationPowerSupplyVoltage.4 = INTEGER: powerSupply24VSourceB(4) */ - { "unmapped.atsCalibrationPowerSupplyVoltage", 0, 1, ".1.3.6.1.4.1.318.1.1.8.2.2.2.1.2.4", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.atsCalibrationPowerSupplyVoltage", 0, 1, ".1.3.6.1.4.1.318.1.1.8.2.2.2.1.2.4", NULL, SU_FLAG_OK, NULL), /* atsCalibrationPowerSupplyVoltage.5 = INTEGER: powerSupplyMinus12V(5) */ - { "unmapped.atsCalibrationPowerSupplyVoltage", 0, 1, ".1.3.6.1.4.1.318.1.1.8.2.2.2.1.2.5", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.atsCalibrationPowerSupplyVoltage", 0, 1, ".1.3.6.1.4.1.318.1.1.8.2.2.2.1.2.5", NULL, SU_FLAG_OK, NULL), /* atsPowerSupplyVoltageCalibrationFactor.1 = INTEGER: 521 */ - { "unmapped.atsPowerSupplyVoltageCalibrationFactor", 0, 1, ".1.3.6.1.4.1.318.1.1.8.2.2.2.1.3.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.atsPowerSupplyVoltageCalibrationFactor", 0, 1, ".1.3.6.1.4.1.318.1.1.8.2.2.2.1.3.1", NULL, SU_FLAG_OK, NULL), /* atsPowerSupplyVoltageCalibrationFactor.2 = INTEGER: 1076 */ - { "unmapped.atsPowerSupplyVoltageCalibrationFactor", 0, 1, ".1.3.6.1.4.1.318.1.1.8.2.2.2.1.3.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.atsPowerSupplyVoltageCalibrationFactor", 0, 1, ".1.3.6.1.4.1.318.1.1.8.2.2.2.1.3.2", NULL, SU_FLAG_OK, NULL), /* atsPowerSupplyVoltageCalibrationFactor.3 = INTEGER: 2560 */ - { "unmapped.atsPowerSupplyVoltageCalibrationFactor", 0, 1, ".1.3.6.1.4.1.318.1.1.8.2.2.2.1.3.3", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.atsPowerSupplyVoltageCalibrationFactor", 0, 1, ".1.3.6.1.4.1.318.1.1.8.2.2.2.1.3.3", NULL, SU_FLAG_OK, NULL), /* atsPowerSupplyVoltageCalibrationFactor.4 = INTEGER: 521 */ - { "unmapped.atsPowerSupplyVoltageCalibrationFactor", 0, 1, ".1.3.6.1.4.1.318.1.1.8.2.2.2.1.3.4", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.atsPowerSupplyVoltageCalibrationFactor", 0, 1, ".1.3.6.1.4.1.318.1.1.8.2.2.2.1.3.4", NULL, SU_FLAG_OK, NULL), /* atsPowerSupplyVoltageCalibrationFactor.5 = INTEGER: 975 */ - { "unmapped.atsPowerSupplyVoltageCalibrationFactor", 0, 1, ".1.3.6.1.4.1.318.1.1.8.2.2.2.1.3.5", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.atsPowerSupplyVoltageCalibrationFactor", 0, 1, ".1.3.6.1.4.1.318.1.1.8.2.2.2.1.3.5", NULL, SU_FLAG_OK, NULL), /* atsCalibrationNumOutputs.0 = INTEGER: 1 */ - { "unmapped.atsCalibrationNumOutputs", 0, 1, ".1.3.6.1.4.1.318.1.1.8.2.3.1.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.atsCalibrationNumOutputs", 0, 1, ".1.3.6.1.4.1.318.1.1.8.2.3.1.0", NULL, SU_FLAG_OK, NULL), /* atsCalibrationNumOutputPhases.0 = INTEGER: 1 */ - { "unmapped.atsCalibrationNumOutputPhases", 0, 1, ".1.3.6.1.4.1.318.1.1.8.2.3.2.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.atsCalibrationNumOutputPhases", 0, 1, ".1.3.6.1.4.1.318.1.1.8.2.3.2.0", NULL, SU_FLAG_OK, NULL), /* atsCalibrationOutputTableIndex.1.phase1.1 = INTEGER: 1 */ - { "unmapped.atsCalibrationOutputTableIndex", 0, 1, ".1.3.6.1.4.1.318.1.1.8.2.3.3.1.1.1.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.atsCalibrationOutputTableIndex", 0, 1, ".1.3.6.1.4.1.318.1.1.8.2.3.3.1.1.1.1.1", NULL, SU_FLAG_OK, NULL), /* atsCalibrationOutputPhasesTableIndex.1.phase1.1 = INTEGER: phase1(1) */ - { "unmapped.atsCalibrationOutputPhasesTableIndex", 0, 1, ".1.3.6.1.4.1.318.1.1.8.2.3.3.1.2.1.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.atsCalibrationOutputPhasesTableIndex", 0, 1, ".1.3.6.1.4.1.318.1.1.8.2.3.3.1.2.1.1.1", NULL, SU_FLAG_OK, NULL), /* atsOutputCurrentCalibrationFactor.1.phase1.1 = INTEGER: 487 */ - { "unmapped.atsOutputCurrentCalibrationFactor", 0, 1, ".1.3.6.1.4.1.318.1.1.8.2.3.3.1.3.1.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.atsOutputCurrentCalibrationFactor", 0, 1, ".1.3.6.1.4.1.318.1.1.8.2.3.3.1.3.1.1.1", NULL, SU_FLAG_OK, NULL), /* atsControlResetATS.0 = INTEGER: none(1) */ - { "unmapped.atsControlResetATS", 0, 1, ".1.3.6.1.4.1.318.1.1.8.3.1.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.atsControlResetATS", 0, 1, ".1.3.6.1.4.1.318.1.1.8.3.1.0", NULL, SU_FLAG_OK, NULL), /* atsControlClearAllAlarms.0 = INTEGER: -1 */ - { "unmapped.atsControlClearAllAlarms", 0, 1, ".1.3.6.1.4.1.318.1.1.8.3.2.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.atsControlClearAllAlarms", 0, 1, ".1.3.6.1.4.1.318.1.1.8.3.2.0", NULL, SU_FLAG_OK, NULL), /* atsConfigFrontPanelLockout.0 = INTEGER: enableFrontPanel(2) */ - { "unmapped.atsConfigFrontPanelLockout", 0, 1, ".1.3.6.1.4.1.318.1.1.8.4.3.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.atsConfigFrontPanelLockout", 0, 1, ".1.3.6.1.4.1.318.1.1.8.4.3.0", NULL, SU_FLAG_OK, NULL), /* atsConfigTransferVoltageRange.0 = INTEGER: medium(2) */ - { "unmapped.atsConfigTransferVoltageRange", 0, 1, ".1.3.6.1.4.1.318.1.1.8.4.5.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.atsConfigTransferVoltageRange", 0, 1, ".1.3.6.1.4.1.318.1.1.8.4.5.0", NULL, SU_FLAG_OK, NULL), /* atsConfigCurrentLimit.0 = INTEGER: 32 */ - { "unmapped.atsConfigCurrentLimit", 0, 1, ".1.3.6.1.4.1.318.1.1.8.4.6.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.atsConfigCurrentLimit", 0, 1, ".1.3.6.1.4.1.318.1.1.8.4.6.0", NULL, SU_FLAG_OK, NULL), /* atsConfigResetValues.0 = INTEGER: -1 */ - { "unmapped.atsConfigResetValues", 0, 1, ".1.3.6.1.4.1.318.1.1.8.4.7.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.atsConfigResetValues", 0, 1, ".1.3.6.1.4.1.318.1.1.8.4.7.0", NULL, SU_FLAG_OK, NULL), /* atsConfigLineVRMS.0 = INTEGER: 230 */ - { "unmapped.atsConfigLineVRMS", 0, 1, ".1.3.6.1.4.1.318.1.1.8.4.8.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.atsConfigLineVRMS", 0, 1, ".1.3.6.1.4.1.318.1.1.8.4.8.0", NULL, SU_FLAG_OK, NULL), /* atsConfigLineVRMSNarrowLimit.0 = INTEGER: 16 */ - { "unmapped.atsConfigLineVRMSNarrowLimit", 0, 1, ".1.3.6.1.4.1.318.1.1.8.4.9.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.atsConfigLineVRMSNarrowLimit", 0, 1, ".1.3.6.1.4.1.318.1.1.8.4.9.0", NULL, SU_FLAG_OK, NULL), /* atsConfigLineVRMSMediumLimit.0 = INTEGER: 23 */ - { "unmapped.atsConfigLineVRMSMediumLimit", 0, 1, ".1.3.6.1.4.1.318.1.1.8.4.10.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.atsConfigLineVRMSMediumLimit", 0, 1, ".1.3.6.1.4.1.318.1.1.8.4.10.0", NULL, SU_FLAG_OK, NULL), /* atsConfigLineVRMSWideLimit.0 = INTEGER: 30 */ - { "unmapped.atsConfigLineVRMSWideLimit", 0, 1, ".1.3.6.1.4.1.318.1.1.8.4.11.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.atsConfigLineVRMSWideLimit", 0, 1, ".1.3.6.1.4.1.318.1.1.8.4.11.0", NULL, SU_FLAG_OK, NULL), /* atsConfigFrequencyDeviation.0 = INTEGER: two(2) */ - { "unmapped.atsConfigFrequencyDeviation", 0, 1, ".1.3.6.1.4.1.318.1.1.8.4.12.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.atsConfigFrequencyDeviation", 0, 1, ".1.3.6.1.4.1.318.1.1.8.4.12.0", NULL, SU_FLAG_OK, NULL), /* Outlet groups collection */ /* atsConfigBankLowLoadThreshold.1 = INTEGER: 0 */ - { "unmapped.atsConfigBankLowLoadThreshold", 0, 1, ".1.3.6.1.4.1.318.1.1.8.4.14.1.3.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.atsConfigBankLowLoadThreshold", 0, 1, ".1.3.6.1.4.1.318.1.1.8.4.14.1.3.1", NULL, SU_FLAG_OK, NULL), /* atsConfigBankLowLoadThreshold.2 = INTEGER: 0 */ - { "unmapped.atsConfigBankLowLoadThreshold", 0, 1, ".1.3.6.1.4.1.318.1.1.8.4.14.1.3.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.atsConfigBankLowLoadThreshold", 0, 1, ".1.3.6.1.4.1.318.1.1.8.4.14.1.3.2", NULL, SU_FLAG_OK, NULL), /* atsConfigBankLowLoadThreshold.3 = INTEGER: 0 */ - { "unmapped.atsConfigBankLowLoadThreshold", 0, 1, ".1.3.6.1.4.1.318.1.1.8.4.14.1.3.3", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.atsConfigBankLowLoadThreshold", 0, 1, ".1.3.6.1.4.1.318.1.1.8.4.14.1.3.3", NULL, SU_FLAG_OK, NULL), /* atsConfigBankNearOverLoadThreshold.1 = INTEGER: 28 */ - { "unmapped.atsConfigBankNearOverLoadThreshold", 0, 1, ".1.3.6.1.4.1.318.1.1.8.4.14.1.4.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.atsConfigBankNearOverLoadThreshold", 0, 1, ".1.3.6.1.4.1.318.1.1.8.4.14.1.4.1", NULL, SU_FLAG_OK, NULL), /* atsConfigBankNearOverLoadThreshold.2 = INTEGER: 12 */ - { "unmapped.atsConfigBankNearOverLoadThreshold", 0, 1, ".1.3.6.1.4.1.318.1.1.8.4.14.1.4.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.atsConfigBankNearOverLoadThreshold", 0, 1, ".1.3.6.1.4.1.318.1.1.8.4.14.1.4.2", NULL, SU_FLAG_OK, NULL), /* atsConfigBankNearOverLoadThreshold.3 = INTEGER: 12 */ - { "unmapped.atsConfigBankNearOverLoadThreshold", 0, 1, ".1.3.6.1.4.1.318.1.1.8.4.14.1.4.3", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.atsConfigBankNearOverLoadThreshold", 0, 1, ".1.3.6.1.4.1.318.1.1.8.4.14.1.4.3", NULL, SU_FLAG_OK, NULL), /* atsConfigBankOverLoadThreshold.1 = INTEGER: 32 */ - { "unmapped.atsConfigBankOverLoadThreshold", 0, 1, ".1.3.6.1.4.1.318.1.1.8.4.14.1.5.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.atsConfigBankOverLoadThreshold", 0, 1, ".1.3.6.1.4.1.318.1.1.8.4.14.1.5.1", NULL, SU_FLAG_OK, NULL), /* atsConfigBankOverLoadThreshold.2 = INTEGER: 16 */ - { "unmapped.atsConfigBankOverLoadThreshold", 0, 1, ".1.3.6.1.4.1.318.1.1.8.4.14.1.5.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.atsConfigBankOverLoadThreshold", 0, 1, ".1.3.6.1.4.1.318.1.1.8.4.14.1.5.2", NULL, SU_FLAG_OK, NULL), /* atsConfigBankOverLoadThreshold.3 = INTEGER: 16 */ - { "unmapped.atsConfigBankOverLoadThreshold", 0, 1, ".1.3.6.1.4.1.318.1.1.8.4.14.1.5.3", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.atsConfigBankOverLoadThreshold", 0, 1, ".1.3.6.1.4.1.318.1.1.8.4.14.1.5.3", NULL, SU_FLAG_OK, NULL), /* atsConfigPhaseTableSize.0 = INTEGER: 0 */ - { "unmapped.atsConfigPhaseTableSize", 0, 1, ".1.3.6.1.4.1.318.1.1.8.4.15.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.atsConfigPhaseTableSize", 0, 1, ".1.3.6.1.4.1.318.1.1.8.4.15.0", NULL, SU_FLAG_OK, NULL), /* atsStatusCommStatus.0 = INTEGER: atsCommEstablished(2) */ - { "unmapped.atsStatusCommStatus", 0, 1, ".1.3.6.1.4.1.318.1.1.8.5.1.1.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.atsStatusCommStatus", 0, 1, ".1.3.6.1.4.1.318.1.1.8.5.1.1.0", NULL, SU_FLAG_OK, NULL), /* atsStatusRedundancyState.0 = INTEGER: atsFullyRedundant(2) */ - { "unmapped.atsStatusRedundancyState", 0, 1, ".1.3.6.1.4.1.318.1.1.8.5.1.3.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.atsStatusRedundancyState", 0, 1, ".1.3.6.1.4.1.318.1.1.8.5.1.3.0", NULL, SU_FLAG_OK, NULL), /* atsStatusOverCurrentState.0 = INTEGER: atsCurrentOK(2) */ - { "unmapped.atsStatusOverCurrentState", 0, 1, ".1.3.6.1.4.1.318.1.1.8.5.1.4.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.atsStatusOverCurrentState", 0, 1, ".1.3.6.1.4.1.318.1.1.8.5.1.4.0", NULL, SU_FLAG_OK, NULL), /* atsStatus5VPowerSupply.0 = INTEGER: atsPowerSupplyOK(2) */ - { "unmapped.atsStatus5VPowerSupply", 0, 1, ".1.3.6.1.4.1.318.1.1.8.5.1.5.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.atsStatus5VPowerSupply", 0, 1, ".1.3.6.1.4.1.318.1.1.8.5.1.5.0", NULL, SU_FLAG_OK, NULL), /* atsStatus24VPowerSupply.0 = INTEGER: atsPowerSupplyOK(2) */ - { "unmapped.atsStatus24VPowerSupply", 0, 1, ".1.3.6.1.4.1.318.1.1.8.5.1.6.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.atsStatus24VPowerSupply", 0, 1, ".1.3.6.1.4.1.318.1.1.8.5.1.6.0", NULL, SU_FLAG_OK, NULL), /* atsStatus24VSourceBPowerSupply.0 = INTEGER: atsPowerSupplyOK(2) */ - { "unmapped.atsStatus24VSourceBPowerSupply", 0, 1, ".1.3.6.1.4.1.318.1.1.8.5.1.7.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.atsStatus24VSourceBPowerSupply", 0, 1, ".1.3.6.1.4.1.318.1.1.8.5.1.7.0", NULL, SU_FLAG_OK, NULL), /* atsStatusPlus12VPowerSupply.0 = INTEGER: atsPowerSupplyOK(2) */ - { "unmapped.atsStatusPlus12VPowerSupply", 0, 1, ".1.3.6.1.4.1.318.1.1.8.5.1.8.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.atsStatusPlus12VPowerSupply", 0, 1, ".1.3.6.1.4.1.318.1.1.8.5.1.8.0", NULL, SU_FLAG_OK, NULL), /* atsStatusMinus12VPowerSupply.0 = INTEGER: atsPowerSupplyOK(2) */ - { "unmapped.atsStatusMinus12VPowerSupply", 0, 1, ".1.3.6.1.4.1.318.1.1.8.5.1.9.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.atsStatusMinus12VPowerSupply", 0, 1, ".1.3.6.1.4.1.318.1.1.8.5.1.9.0", NULL, SU_FLAG_OK, NULL), /* atsStatusSwitchStatus.0 = INTEGER: ok(2) */ - { "unmapped.atsStatusSwitchStatus", 0, 1, ".1.3.6.1.4.1.318.1.1.8.5.1.10.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.atsStatusSwitchStatus", 0, 1, ".1.3.6.1.4.1.318.1.1.8.5.1.10.0", NULL, SU_FLAG_OK, NULL), /* atsStatusFrontPanel.0 = INTEGER: unlocked(2) */ - { "unmapped.atsStatusFrontPanel", 0, 1, ".1.3.6.1.4.1.318.1.1.8.5.1.11.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.atsStatusFrontPanel", 0, 1, ".1.3.6.1.4.1.318.1.1.8.5.1.11.0", NULL, SU_FLAG_OK, NULL), /* atsStatusSourceAStatus.0 = INTEGER: ok(2) */ - { "unmapped.atsStatusSourceAStatus", 0, 1, ".1.3.6.1.4.1.318.1.1.8.5.1.12.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.atsStatusSourceAStatus", 0, 1, ".1.3.6.1.4.1.318.1.1.8.5.1.12.0", NULL, SU_FLAG_OK, NULL), /* atsStatusSourceBStatus.0 = INTEGER: ok(2) */ - { "unmapped.atsStatusSourceBStatus", 0, 1, ".1.3.6.1.4.1.318.1.1.8.5.1.13.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.atsStatusSourceBStatus", 0, 1, ".1.3.6.1.4.1.318.1.1.8.5.1.13.0", NULL, SU_FLAG_OK, NULL), /* atsStatusPhaseSyncStatus.0 = INTEGER: inSync(1) */ - { "unmapped.atsStatusPhaseSyncStatus", 0, 1, ".1.3.6.1.4.1.318.1.1.8.5.1.14.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.atsStatusPhaseSyncStatus", 0, 1, ".1.3.6.1.4.1.318.1.1.8.5.1.14.0", NULL, SU_FLAG_OK, NULL), /* atsStatusHardwareStatus.0 = INTEGER: ok(2) */ - { "unmapped.atsStatusHardwareStatus", 0, 1, ".1.3.6.1.4.1.318.1.1.8.5.1.16.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.atsStatusHardwareStatus", 0, 1, ".1.3.6.1.4.1.318.1.1.8.5.1.16.0", NULL, SU_FLAG_OK, NULL), /* atsStatusResetMaxMinValues.0 = INTEGER: -1 */ - { "unmapped.atsStatusResetMaxMinValues", 0, 1, ".1.3.6.1.4.1.318.1.1.8.5.2.1.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.atsStatusResetMaxMinValues", 0, 1, ".1.3.6.1.4.1.318.1.1.8.5.2.1.0", NULL, SU_FLAG_OK, NULL), /* atsInputTableIndex.1 = INTEGER: 1 */ - { "unmapped.atsInputTableIndex", 0, 1, ".1.3.6.1.4.1.318.1.1.8.5.3.2.1.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.atsInputTableIndex", 0, 1, ".1.3.6.1.4.1.318.1.1.8.5.3.2.1.1.1", NULL, SU_FLAG_OK, NULL), /* atsInputTableIndex.2 = INTEGER: 2 */ - { "unmapped.atsInputTableIndex", 0, 1, ".1.3.6.1.4.1.318.1.1.8.5.3.2.1.1.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.atsInputTableIndex", 0, 1, ".1.3.6.1.4.1.318.1.1.8.5.3.2.1.1.2", NULL, SU_FLAG_OK, NULL), /* atsNumInputPhases.1 = INTEGER: 1 */ - { "unmapped.atsNumInputPhases", 0, 1, ".1.3.6.1.4.1.318.1.1.8.5.3.2.1.2.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.atsNumInputPhases", 0, 1, ".1.3.6.1.4.1.318.1.1.8.5.3.2.1.2.1", NULL, SU_FLAG_OK, NULL), /* atsNumInputPhases.2 = INTEGER: 1 */ - { "unmapped.atsNumInputPhases", 0, 1, ".1.3.6.1.4.1.318.1.1.8.5.3.2.1.2.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.atsNumInputPhases", 0, 1, ".1.3.6.1.4.1.318.1.1.8.5.3.2.1.2.2", NULL, SU_FLAG_OK, NULL), /* atsInputVoltageOrientation.1 = INTEGER: singlePhase(2) */ - { "unmapped.atsInputVoltageOrientation", 0, 1, ".1.3.6.1.4.1.318.1.1.8.5.3.2.1.3.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.atsInputVoltageOrientation", 0, 1, ".1.3.6.1.4.1.318.1.1.8.5.3.2.1.3.1", NULL, SU_FLAG_OK, NULL), /* atsInputVoltageOrientation.2 = INTEGER: singlePhase(2) */ - { "unmapped.atsInputVoltageOrientation", 0, 1, ".1.3.6.1.4.1.318.1.1.8.5.3.2.1.3.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.atsInputVoltageOrientation", 0, 1, ".1.3.6.1.4.1.318.1.1.8.5.3.2.1.3.2", NULL, SU_FLAG_OK, NULL), /* atsInputType.1 = INTEGER: main(2) */ - { "unmapped.atsInputType", 0, 1, ".1.3.6.1.4.1.318.1.1.8.5.3.2.1.5.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.atsInputType", 0, 1, ".1.3.6.1.4.1.318.1.1.8.5.3.2.1.5.1", NULL, SU_FLAG_OK, NULL), /* atsInputType.2 = INTEGER: main(2) */ - { "unmapped.atsInputType", 0, 1, ".1.3.6.1.4.1.318.1.1.8.5.3.2.1.5.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.atsInputType", 0, 1, ".1.3.6.1.4.1.318.1.1.8.5.3.2.1.5.2", NULL, SU_FLAG_OK, NULL), /* atsInputName.1 = STRING: "Source A" */ - { "unmapped.atsInputName", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.1.8.5.3.2.1.6.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.atsInputName", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.1.8.5.3.2.1.6.1", NULL, SU_FLAG_OK, NULL), /* atsInputName.2 = STRING: "Source B" */ - { "unmapped.atsInputName", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.1.8.5.3.2.1.6.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.atsInputName", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.1.8.5.3.2.1.6.2", NULL, SU_FLAG_OK, NULL), /* atsInputPhaseTableIndex.1.1.1 = INTEGER: 1 */ - { "unmapped.atsInputPhaseTableIndex", 0, 1, ".1.3.6.1.4.1.318.1.1.8.5.3.3.1.1.1.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.atsInputPhaseTableIndex", 0, 1, ".1.3.6.1.4.1.318.1.1.8.5.3.3.1.1.1.1.1", NULL, SU_FLAG_OK, NULL), /* atsInputPhaseTableIndex.2.1.1 = INTEGER: 2 */ - { "unmapped.atsInputPhaseTableIndex", 0, 1, ".1.3.6.1.4.1.318.1.1.8.5.3.3.1.1.2.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.atsInputPhaseTableIndex", 0, 1, ".1.3.6.1.4.1.318.1.1.8.5.3.3.1.1.2.1.1", NULL, SU_FLAG_OK, NULL), /* atsInputPhaseIndex.1.1.1 = INTEGER: 1 */ - { "unmapped.atsInputPhaseIndex", 0, 1, ".1.3.6.1.4.1.318.1.1.8.5.3.3.1.2.1.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.atsInputPhaseIndex", 0, 1, ".1.3.6.1.4.1.318.1.1.8.5.3.3.1.2.1.1.1", NULL, SU_FLAG_OK, NULL), /* atsInputPhaseIndex.2.1.1 = INTEGER: 1 */ - { "unmapped.atsInputPhaseIndex", 0, 1, ".1.3.6.1.4.1.318.1.1.8.5.3.3.1.2.2.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.atsInputPhaseIndex", 0, 1, ".1.3.6.1.4.1.318.1.1.8.5.3.3.1.2.2.1.1", NULL, SU_FLAG_OK, NULL), /* atsInputMaxVoltage.1.1.1 = INTEGER: -1 */ - { "unmapped.atsInputMaxVoltage", 0, 1, ".1.3.6.1.4.1.318.1.1.8.5.3.3.1.4.1.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.atsInputMaxVoltage", 0, 1, ".1.3.6.1.4.1.318.1.1.8.5.3.3.1.4.1.1.1", NULL, SU_FLAG_OK, NULL), /* atsInputMaxVoltage.2.1.1 = INTEGER: -1 */ - { "unmapped.atsInputMaxVoltage", 0, 1, ".1.3.6.1.4.1.318.1.1.8.5.3.3.1.4.2.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.atsInputMaxVoltage", 0, 1, ".1.3.6.1.4.1.318.1.1.8.5.3.3.1.4.2.1.1", NULL, SU_FLAG_OK, NULL), /* atsInputMinVoltage.1.1.1 = INTEGER: -1 */ - { "unmapped.atsInputMinVoltage", 0, 1, ".1.3.6.1.4.1.318.1.1.8.5.3.3.1.5.1.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.atsInputMinVoltage", 0, 1, ".1.3.6.1.4.1.318.1.1.8.5.3.3.1.5.1.1.1", NULL, SU_FLAG_OK, NULL), /* atsInputMinVoltage.2.1.1 = INTEGER: -1 */ - { "unmapped.atsInputMinVoltage", 0, 1, ".1.3.6.1.4.1.318.1.1.8.5.3.3.1.5.2.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.atsInputMinVoltage", 0, 1, ".1.3.6.1.4.1.318.1.1.8.5.3.3.1.5.2.1.1", NULL, SU_FLAG_OK, NULL), /* atsInputCurrent.1.1.1 = INTEGER: -1 */ - { "unmapped.atsInputCurrent", 0, 1, ".1.3.6.1.4.1.318.1.1.8.5.3.3.1.6.1.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.atsInputCurrent", 0, 1, ".1.3.6.1.4.1.318.1.1.8.5.3.3.1.6.1.1.1", NULL, SU_FLAG_OK, NULL), /* atsInputCurrent.2.1.1 = INTEGER: -1 */ - { "unmapped.atsInputCurrent", 0, 1, ".1.3.6.1.4.1.318.1.1.8.5.3.3.1.6.2.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.atsInputCurrent", 0, 1, ".1.3.6.1.4.1.318.1.1.8.5.3.3.1.6.2.1.1", NULL, SU_FLAG_OK, NULL), /* atsInputMaxCurrent.1.1.1 = INTEGER: -1 */ - { "unmapped.atsInputMaxCurrent", 0, 1, ".1.3.6.1.4.1.318.1.1.8.5.3.3.1.7.1.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.atsInputMaxCurrent", 0, 1, ".1.3.6.1.4.1.318.1.1.8.5.3.3.1.7.1.1.1", NULL, SU_FLAG_OK, NULL), /* atsInputMaxCurrent.2.1.1 = INTEGER: -1 */ - { "unmapped.atsInputMaxCurrent", 0, 1, ".1.3.6.1.4.1.318.1.1.8.5.3.3.1.7.2.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.atsInputMaxCurrent", 0, 1, ".1.3.6.1.4.1.318.1.1.8.5.3.3.1.7.2.1.1", NULL, SU_FLAG_OK, NULL), /* atsInputMinCurrent.1.1.1 = INTEGER: -1 */ - { "unmapped.atsInputMinCurrent", 0, 1, ".1.3.6.1.4.1.318.1.1.8.5.3.3.1.8.1.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.atsInputMinCurrent", 0, 1, ".1.3.6.1.4.1.318.1.1.8.5.3.3.1.8.1.1.1", NULL, SU_FLAG_OK, NULL), /* atsInputMinCurrent.2.1.1 = INTEGER: -1 */ - { "unmapped.atsInputMinCurrent", 0, 1, ".1.3.6.1.4.1.318.1.1.8.5.3.3.1.8.2.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.atsInputMinCurrent", 0, 1, ".1.3.6.1.4.1.318.1.1.8.5.3.3.1.8.2.1.1", NULL, SU_FLAG_OK, NULL), /* atsInputPower.1.1.1 = INTEGER: -1 */ - { "unmapped.atsInputPower", 0, 1, ".1.3.6.1.4.1.318.1.1.8.5.3.3.1.9.1.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.atsInputPower", 0, 1, ".1.3.6.1.4.1.318.1.1.8.5.3.3.1.9.1.1.1", NULL, SU_FLAG_OK, NULL), /* atsInputPower.2.1.1 = INTEGER: -1 */ - { "unmapped.atsInputPower", 0, 1, ".1.3.6.1.4.1.318.1.1.8.5.3.3.1.9.2.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.atsInputPower", 0, 1, ".1.3.6.1.4.1.318.1.1.8.5.3.3.1.9.2.1.1", NULL, SU_FLAG_OK, NULL), /* atsInputMaxPower.1.1.1 = INTEGER: -1 */ - { "unmapped.atsInputMaxPower", 0, 1, ".1.3.6.1.4.1.318.1.1.8.5.3.3.1.10.1.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.atsInputMaxPower", 0, 1, ".1.3.6.1.4.1.318.1.1.8.5.3.3.1.10.1.1.1", NULL, SU_FLAG_OK, NULL), /* atsInputMaxPower.2.1.1 = INTEGER: -1 */ - { "unmapped.atsInputMaxPower", 0, 1, ".1.3.6.1.4.1.318.1.1.8.5.3.3.1.10.2.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.atsInputMaxPower", 0, 1, ".1.3.6.1.4.1.318.1.1.8.5.3.3.1.10.2.1.1", NULL, SU_FLAG_OK, NULL), /* atsInputMinPower.1.1.1 = INTEGER: -1 */ - { "unmapped.atsInputMinPower", 0, 1, ".1.3.6.1.4.1.318.1.1.8.5.3.3.1.11.1.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.atsInputMinPower", 0, 1, ".1.3.6.1.4.1.318.1.1.8.5.3.3.1.11.1.1.1", NULL, SU_FLAG_OK, NULL), /* atsInputMinPower.2.1.1 = INTEGER: -1 */ - { "unmapped.atsInputMinPower", 0, 1, ".1.3.6.1.4.1.318.1.1.8.5.3.3.1.11.2.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.atsInputMinPower", 0, 1, ".1.3.6.1.4.1.318.1.1.8.5.3.3.1.11.2.1.1", NULL, SU_FLAG_OK, NULL), /* atsNumOutputs.0 = INTEGER: 1 */ - { "unmapped.atsNumOutputs", 0, 1, ".1.3.6.1.4.1.318.1.1.8.5.4.1.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.atsNumOutputs", 0, 1, ".1.3.6.1.4.1.318.1.1.8.5.4.1.0", NULL, SU_FLAG_OK, NULL), /* atsOutputTableIndex.1 = INTEGER: 1 */ - { "unmapped.atsOutputTableIndex", 0, 1, ".1.3.6.1.4.1.318.1.1.8.5.4.2.1.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.atsOutputTableIndex", 0, 1, ".1.3.6.1.4.1.318.1.1.8.5.4.2.1.1.1", NULL, SU_FLAG_OK, NULL), /* atsNumOutputPhases.1 = INTEGER: 1 */ - { "unmapped.atsNumOutputPhases", 0, 1, ".1.3.6.1.4.1.318.1.1.8.5.4.2.1.2.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.atsNumOutputPhases", 0, 1, ".1.3.6.1.4.1.318.1.1.8.5.4.2.1.2.1", NULL, SU_FLAG_OK, NULL), /* atsOutputVoltageOrientation.1 = INTEGER: singlePhase(2) */ - { "unmapped.atsOutputVoltageOrientation", 0, 1, ".1.3.6.1.4.1.318.1.1.8.5.4.2.1.3.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.atsOutputVoltageOrientation", 0, 1, ".1.3.6.1.4.1.318.1.1.8.5.4.2.1.3.1", NULL, SU_FLAG_OK, NULL), /* atsOutputPhase.1 = INTEGER: phase1(1) */ - { "unmapped.atsOutputPhase", 0, 1, ".1.3.6.1.4.1.318.1.1.8.5.4.5.1.2.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.atsOutputPhase", 0, 1, ".1.3.6.1.4.1.318.1.1.8.5.4.5.1.2.1", NULL, SU_FLAG_OK, NULL), /* atsOutputPhase.2 = INTEGER: phase1(1) */ - { "unmapped.atsOutputPhase", 0, 1, ".1.3.6.1.4.1.318.1.1.8.5.4.5.1.2.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.atsOutputPhase", 0, 1, ".1.3.6.1.4.1.318.1.1.8.5.4.5.1.2.2", NULL, SU_FLAG_OK, NULL), /* atsOutputPhase.3 = INTEGER: phase1(1) */ - { "unmapped.atsOutputPhase", 0, 1, ".1.3.6.1.4.1.318.1.1.8.5.4.5.1.2.3", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.atsOutputPhase", 0, 1, ".1.3.6.1.4.1.318.1.1.8.5.4.5.1.2.3", NULL, SU_FLAG_OK, NULL), /* atsOutputBankMaxCurrent.1 = INTEGER: -1 */ - { "unmapped.atsOutputBankMaxCurrent", 0, 1, ".1.3.6.1.4.1.318.1.1.8.5.4.5.1.7.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.atsOutputBankMaxCurrent", 0, 1, ".1.3.6.1.4.1.318.1.1.8.5.4.5.1.7.1", NULL, SU_FLAG_OK, NULL), /* atsOutputBankMaxCurrent.2 = INTEGER: -1 */ - { "unmapped.atsOutputBankMaxCurrent", 0, 1, ".1.3.6.1.4.1.318.1.1.8.5.4.5.1.7.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.atsOutputBankMaxCurrent", 0, 1, ".1.3.6.1.4.1.318.1.1.8.5.4.5.1.7.2", NULL, SU_FLAG_OK, NULL), /* atsOutputBankMaxCurrent.3 = INTEGER: -1 */ - { "unmapped.atsOutputBankMaxCurrent", 0, 1, ".1.3.6.1.4.1.318.1.1.8.5.4.5.1.7.3", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.atsOutputBankMaxCurrent", 0, 1, ".1.3.6.1.4.1.318.1.1.8.5.4.5.1.7.3", NULL, SU_FLAG_OK, NULL), /* atsOutputBankMinCurrent.1 = INTEGER: -1 */ - { "unmapped.atsOutputBankMinCurrent", 0, 1, ".1.3.6.1.4.1.318.1.1.8.5.4.5.1.8.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.atsOutputBankMinCurrent", 0, 1, ".1.3.6.1.4.1.318.1.1.8.5.4.5.1.8.1", NULL, SU_FLAG_OK, NULL), /* atsOutputBankMinCurrent.2 = INTEGER: -1 */ - { "unmapped.atsOutputBankMinCurrent", 0, 1, ".1.3.6.1.4.1.318.1.1.8.5.4.5.1.8.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.atsOutputBankMinCurrent", 0, 1, ".1.3.6.1.4.1.318.1.1.8.5.4.5.1.8.2", NULL, SU_FLAG_OK, NULL), /* atsOutputBankMinCurrent.3 = INTEGER: -1 */ - { "unmapped.atsOutputBankMinCurrent", 0, 1, ".1.3.6.1.4.1.318.1.1.8.5.4.5.1.8.3", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.atsOutputBankMinCurrent", 0, 1, ".1.3.6.1.4.1.318.1.1.8.5.4.5.1.8.3", NULL, SU_FLAG_OK, NULL), /* atsOutputBankLoad.1 = INTEGER: 1883 */ - { "unmapped.atsOutputBankLoad", 0, 1, ".1.3.6.1.4.1.318.1.1.8.5.4.5.1.9.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.atsOutputBankLoad", 0, 1, ".1.3.6.1.4.1.318.1.1.8.5.4.5.1.9.1", NULL, SU_FLAG_OK, NULL), /* atsOutputBankLoad.2 = INTEGER: 984 */ - { "unmapped.atsOutputBankLoad", 0, 1, ".1.3.6.1.4.1.318.1.1.8.5.4.5.1.9.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.atsOutputBankLoad", 0, 1, ".1.3.6.1.4.1.318.1.1.8.5.4.5.1.9.2", NULL, SU_FLAG_OK, NULL), /* atsOutputBankLoad.3 = INTEGER: 898 */ - { "unmapped.atsOutputBankLoad", 0, 1, ".1.3.6.1.4.1.318.1.1.8.5.4.5.1.9.3", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.atsOutputBankLoad", 0, 1, ".1.3.6.1.4.1.318.1.1.8.5.4.5.1.9.3", NULL, SU_FLAG_OK, NULL), /* atsOutputBankMaxLoad.1 = INTEGER: -1 */ - { "unmapped.atsOutputBankMaxLoad", 0, 1, ".1.3.6.1.4.1.318.1.1.8.5.4.5.1.10.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.atsOutputBankMaxLoad", 0, 1, ".1.3.6.1.4.1.318.1.1.8.5.4.5.1.10.1", NULL, SU_FLAG_OK, NULL), /* atsOutputBankMaxLoad.2 = INTEGER: -1 */ - { "unmapped.atsOutputBankMaxLoad", 0, 1, ".1.3.6.1.4.1.318.1.1.8.5.4.5.1.10.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.atsOutputBankMaxLoad", 0, 1, ".1.3.6.1.4.1.318.1.1.8.5.4.5.1.10.2", NULL, SU_FLAG_OK, NULL), /* atsOutputBankMaxLoad.3 = INTEGER: -1 */ - { "unmapped.atsOutputBankMaxLoad", 0, 1, ".1.3.6.1.4.1.318.1.1.8.5.4.5.1.10.3", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.atsOutputBankMaxLoad", 0, 1, ".1.3.6.1.4.1.318.1.1.8.5.4.5.1.10.3", NULL, SU_FLAG_OK, NULL), /* atsOutputBankMinLoad.1 = INTEGER: -1 */ - { "unmapped.atsOutputBankMinLoad", 0, 1, ".1.3.6.1.4.1.318.1.1.8.5.4.5.1.11.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.atsOutputBankMinLoad", 0, 1, ".1.3.6.1.4.1.318.1.1.8.5.4.5.1.11.1", NULL, SU_FLAG_OK, NULL), /* atsOutputBankMinLoad.2 = INTEGER: -1 */ - { "unmapped.atsOutputBankMinLoad", 0, 1, ".1.3.6.1.4.1.318.1.1.8.5.4.5.1.11.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.atsOutputBankMinLoad", 0, 1, ".1.3.6.1.4.1.318.1.1.8.5.4.5.1.11.2", NULL, SU_FLAG_OK, NULL), /* atsOutputBankMinLoad.3 = INTEGER: -1 */ - { "unmapped.atsOutputBankMinLoad", 0, 1, ".1.3.6.1.4.1.318.1.1.8.5.4.5.1.11.3", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.atsOutputBankMinLoad", 0, 1, ".1.3.6.1.4.1.318.1.1.8.5.4.5.1.11.3", NULL, SU_FLAG_OK, NULL), /* atsOutputBankPercentLoad.1 = INTEGER: 25 */ - { "unmapped.atsOutputBankPercentLoad", 0, 1, ".1.3.6.1.4.1.318.1.1.8.5.4.5.1.12.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.atsOutputBankPercentLoad", 0, 1, ".1.3.6.1.4.1.318.1.1.8.5.4.5.1.12.1", NULL, SU_FLAG_OK, NULL), /* atsOutputBankPercentLoad.2 = INTEGER: 13 */ - { "unmapped.atsOutputBankPercentLoad", 0, 1, ".1.3.6.1.4.1.318.1.1.8.5.4.5.1.12.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.atsOutputBankPercentLoad", 0, 1, ".1.3.6.1.4.1.318.1.1.8.5.4.5.1.12.2", NULL, SU_FLAG_OK, NULL), /* atsOutputBankPercentLoad.3 = INTEGER: 12 */ - { "unmapped.atsOutputBankPercentLoad", 0, 1, ".1.3.6.1.4.1.318.1.1.8.5.4.5.1.12.3", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.atsOutputBankPercentLoad", 0, 1, ".1.3.6.1.4.1.318.1.1.8.5.4.5.1.12.3", NULL, SU_FLAG_OK, NULL), /* atsOutputBankMaxPercentLoad.1 = INTEGER: -1 */ - { "unmapped.atsOutputBankMaxPercentLoad", 0, 1, ".1.3.6.1.4.1.318.1.1.8.5.4.5.1.13.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.atsOutputBankMaxPercentLoad", 0, 1, ".1.3.6.1.4.1.318.1.1.8.5.4.5.1.13.1", NULL, SU_FLAG_OK, NULL), /* atsOutputBankMaxPercentLoad.2 = INTEGER: -1 */ - { "unmapped.atsOutputBankMaxPercentLoad", 0, 1, ".1.3.6.1.4.1.318.1.1.8.5.4.5.1.13.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.atsOutputBankMaxPercentLoad", 0, 1, ".1.3.6.1.4.1.318.1.1.8.5.4.5.1.13.2", NULL, SU_FLAG_OK, NULL), /* atsOutputBankMaxPercentLoad.3 = INTEGER: -1 */ - { "unmapped.atsOutputBankMaxPercentLoad", 0, 1, ".1.3.6.1.4.1.318.1.1.8.5.4.5.1.13.3", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.atsOutputBankMaxPercentLoad", 0, 1, ".1.3.6.1.4.1.318.1.1.8.5.4.5.1.13.3", NULL, SU_FLAG_OK, NULL), /* atsOutputBankMinPercentLoad.1 = INTEGER: -1 */ - { "unmapped.atsOutputBankMinPercentLoad", 0, 1, ".1.3.6.1.4.1.318.1.1.8.5.4.5.1.14.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.atsOutputBankMinPercentLoad", 0, 1, ".1.3.6.1.4.1.318.1.1.8.5.4.5.1.14.1", NULL, SU_FLAG_OK, NULL), /* atsOutputBankMinPercentLoad.2 = INTEGER: -1 */ - { "unmapped.atsOutputBankMinPercentLoad", 0, 1, ".1.3.6.1.4.1.318.1.1.8.5.4.5.1.14.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.atsOutputBankMinPercentLoad", 0, 1, ".1.3.6.1.4.1.318.1.1.8.5.4.5.1.14.2", NULL, SU_FLAG_OK, NULL), /* atsOutputBankMinPercentLoad.3 = INTEGER: -1 */ - { "unmapped.atsOutputBankMinPercentLoad", 0, 1, ".1.3.6.1.4.1.318.1.1.8.5.4.5.1.14.3", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.atsOutputBankMinPercentLoad", 0, 1, ".1.3.6.1.4.1.318.1.1.8.5.4.5.1.14.3", NULL, SU_FLAG_OK, NULL), /* atsOutputBankMaxPower.1 = INTEGER: -1 */ - { "unmapped.atsOutputBankMaxPower", 0, 1, ".1.3.6.1.4.1.318.1.1.8.5.4.5.1.16.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.atsOutputBankMaxPower", 0, 1, ".1.3.6.1.4.1.318.1.1.8.5.4.5.1.16.1", NULL, SU_FLAG_OK, NULL), /* atsOutputBankMaxPower.2 = INTEGER: -1 */ - { "unmapped.atsOutputBankMaxPower", 0, 1, ".1.3.6.1.4.1.318.1.1.8.5.4.5.1.16.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.atsOutputBankMaxPower", 0, 1, ".1.3.6.1.4.1.318.1.1.8.5.4.5.1.16.2", NULL, SU_FLAG_OK, NULL), /* atsOutputBankMaxPower.3 = INTEGER: -1 */ - { "unmapped.atsOutputBankMaxPower", 0, 1, ".1.3.6.1.4.1.318.1.1.8.5.4.5.1.16.3", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.atsOutputBankMaxPower", 0, 1, ".1.3.6.1.4.1.318.1.1.8.5.4.5.1.16.3", NULL, SU_FLAG_OK, NULL), /* atsOutputBankMinPower.1 = INTEGER: -1 */ - { "unmapped.atsOutputBankMinPower", 0, 1, ".1.3.6.1.4.1.318.1.1.8.5.4.5.1.17.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.atsOutputBankMinPower", 0, 1, ".1.3.6.1.4.1.318.1.1.8.5.4.5.1.17.1", NULL, SU_FLAG_OK, NULL), /* atsOutputBankMinPower.2 = INTEGER: -1 */ - { "unmapped.atsOutputBankMinPower", 0, 1, ".1.3.6.1.4.1.318.1.1.8.5.4.5.1.17.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.atsOutputBankMinPower", 0, 1, ".1.3.6.1.4.1.318.1.1.8.5.4.5.1.17.2", NULL, SU_FLAG_OK, NULL), /* atsOutputBankMinPower.3 = INTEGER: -1 */ - { "unmapped.atsOutputBankMinPower", 0, 1, ".1.3.6.1.4.1.318.1.1.8.5.4.5.1.17.3", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.atsOutputBankMinPower", 0, 1, ".1.3.6.1.4.1.318.1.1.8.5.4.5.1.17.3", NULL, SU_FLAG_OK, NULL), /* atsOutputBankPercentPower.1 = INTEGER: 25 */ - { "unmapped.atsOutputBankPercentPower", 0, 1, ".1.3.6.1.4.1.318.1.1.8.5.4.5.1.18.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.atsOutputBankPercentPower", 0, 1, ".1.3.6.1.4.1.318.1.1.8.5.4.5.1.18.1", NULL, SU_FLAG_OK, NULL), /* atsOutputBankPercentPower.2 = INTEGER: 13 */ - { "unmapped.atsOutputBankPercentPower", 0, 1, ".1.3.6.1.4.1.318.1.1.8.5.4.5.1.18.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.atsOutputBankPercentPower", 0, 1, ".1.3.6.1.4.1.318.1.1.8.5.4.5.1.18.2", NULL, SU_FLAG_OK, NULL), /* atsOutputBankPercentPower.3 = INTEGER: 12 */ - { "unmapped.atsOutputBankPercentPower", 0, 1, ".1.3.6.1.4.1.318.1.1.8.5.4.5.1.18.3", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.atsOutputBankPercentPower", 0, 1, ".1.3.6.1.4.1.318.1.1.8.5.4.5.1.18.3", NULL, SU_FLAG_OK, NULL), /* atsOutputBankMaxPercentPower.1 = INTEGER: -1 */ - { "unmapped.atsOutputBankMaxPercentPower", 0, 1, ".1.3.6.1.4.1.318.1.1.8.5.4.5.1.19.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.atsOutputBankMaxPercentPower", 0, 1, ".1.3.6.1.4.1.318.1.1.8.5.4.5.1.19.1", NULL, SU_FLAG_OK, NULL), /* atsOutputBankMaxPercentPower.2 = INTEGER: -1 */ - { "unmapped.atsOutputBankMaxPercentPower", 0, 1, ".1.3.6.1.4.1.318.1.1.8.5.4.5.1.19.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.atsOutputBankMaxPercentPower", 0, 1, ".1.3.6.1.4.1.318.1.1.8.5.4.5.1.19.2", NULL, SU_FLAG_OK, NULL), /* atsOutputBankMaxPercentPower.3 = INTEGER: -1 */ - { "unmapped.atsOutputBankMaxPercentPower", 0, 1, ".1.3.6.1.4.1.318.1.1.8.5.4.5.1.19.3", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.atsOutputBankMaxPercentPower", 0, 1, ".1.3.6.1.4.1.318.1.1.8.5.4.5.1.19.3", NULL, SU_FLAG_OK, NULL), /* atsOutputBankMinPercentPower.1 = INTEGER: -1 */ - { "unmapped.atsOutputBankMinPercentPower", 0, 1, ".1.3.6.1.4.1.318.1.1.8.5.4.5.1.20.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.atsOutputBankMinPercentPower", 0, 1, ".1.3.6.1.4.1.318.1.1.8.5.4.5.1.20.1", NULL, SU_FLAG_OK, NULL), /* atsOutputBankMinPercentPower.2 = INTEGER: -1 */ - { "unmapped.atsOutputBankMinPercentPower", 0, 1, ".1.3.6.1.4.1.318.1.1.8.5.4.5.1.20.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.atsOutputBankMinPercentPower", 0, 1, ".1.3.6.1.4.1.318.1.1.8.5.4.5.1.20.2", NULL, SU_FLAG_OK, NULL), /* atsOutputBankMinPercentPower.3 = INTEGER: -1 */ - { "unmapped.atsOutputBankMinPercentPower", 0, 1, ".1.3.6.1.4.1.318.1.1.8.5.4.5.1.20.3", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.atsOutputBankMinPercentPower", 0, 1, ".1.3.6.1.4.1.318.1.1.8.5.4.5.1.20.3", NULL, SU_FLAG_OK, NULL), #endif /* if WITH_UNMAPPED_DATA_POINTS */ /* end of structure. */ - { NULL, 0, 0, NULL, NULL, 0, NULL } + snmp_info_sentinel }; mib2nut_info_t apc_ats = { "apc_ats", APC_ATS_MIB_VERSION, NULL, APC_ATS_OID_MODEL_NAME, apc_ats_mib, APC_ATS_SYSOID, NULL }; diff --git a/drivers/apc-epdu-mib.c b/drivers/apc-epdu-mib.c index bc8b288b11..455125c79e 100644 --- a/drivers/apc-epdu-mib.c +++ b/drivers/apc-epdu-mib.c @@ -23,206 +23,206 @@ #include "apc-epdu-mib.h" -#define APC_EPDU_MIB_VERSION "0.1" +#define APC_EPDU_MIB_VERSION "0.10" #define APC_EPDU_MIB_SYSOID ".1.3.6.1.4.1.318.1.3.4.9" static info_lkp_t apc_epdu_sw_outlet_status_info[] = { - { 1, "off", NULL, NULL }, - { 2, "on", NULL, NULL }, - { 0, NULL, NULL, NULL } + info_lkp_default(1, "off"), + info_lkp_default(2, "on"), + info_lkp_sentinel }; static info_lkp_t apc_epdu_sw_outlet_switchability_info[] = { - { 1, "yes", NULL, NULL }, - { 2, "yes", NULL, NULL }, - { 0, NULL, NULL, NULL } + info_lkp_default(1, "yes"), + info_lkp_default(2, "yes"), + info_lkp_sentinel }; /* POWERNET-MIB Snmp2NUT lookup table */ static snmp_info_t apc_epdu_mib[] = { /* Device page */ - { "device.mfr", ST_FLAG_STRING, SU_INFOSIZE, NULL, "APC", SU_FLAG_STATIC | SU_FLAG_ABSENT | SU_FLAG_OK, NULL }, + snmp_info_default("device.mfr", ST_FLAG_STRING, SU_INFOSIZE, NULL, "APC", SU_FLAG_STATIC | SU_FLAG_ABSENT | SU_FLAG_OK, NULL), /* ePDUDeviceStatusModelNumber.1 = STRING: "EPDU1016M" */ - { "device.model", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.1.30.2.1.1.4.1", "Easy ePDU", SU_FLAG_STATIC | SU_FLAG_OK, NULL }, - { "device.type", ST_FLAG_STRING, SU_INFOSIZE, NULL, "pdu", SU_FLAG_STATIC | SU_FLAG_ABSENT | SU_FLAG_OK, NULL }, - { "device.contact", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.2.1.1.4.0", NULL, SU_FLAG_STALE | SU_FLAG_OK, NULL }, - { "device.description", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.2.1.1.5.0", NULL, SU_FLAG_STALE | SU_FLAG_OK, NULL }, - { "device.location", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.2.1.1.6.0", NULL, SU_FLAG_STALE | SU_FLAG_OK, NULL }, + snmp_info_default("device.model", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.1.30.2.1.1.4.1", "Easy ePDU", SU_FLAG_STATIC | SU_FLAG_OK, NULL), + snmp_info_default("device.type", ST_FLAG_STRING, SU_INFOSIZE, NULL, "pdu", SU_FLAG_STATIC | SU_FLAG_ABSENT | SU_FLAG_OK, NULL), + snmp_info_default("device.contact", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.2.1.1.4.0", NULL, SU_FLAG_STALE | SU_FLAG_OK, NULL), + snmp_info_default("device.description", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.2.1.1.5.0", NULL, SU_FLAG_STALE | SU_FLAG_OK, NULL), + snmp_info_default("device.location", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.2.1.1.6.0", NULL, SU_FLAG_STALE | SU_FLAG_OK, NULL), /* FIXME: to be RFC'ed */ - { "device.uptime", 0, 1, ".1.3.6.1.2.1.1.3.0", NULL, SU_FLAG_OK | SU_FLAG_NEGINVALID, NULL }, + snmp_info_default("device.uptime", 0, 1, ".1.3.6.1.2.1.1.3.0", NULL, SU_FLAG_OK | SU_FLAG_NEGINVALID, NULL), /* ePDUDeviceStatusSerialNumber.1 = STRING: "506255604729" */ - { "device.serial", ST_FLAG_STRING, SU_INFOSIZE, " .1.3.6.1.4.1.318.1.1.30.2.1.1.5.1", NULL, SU_FLAG_STATIC | SU_FLAG_OK, NULL }, + snmp_info_default("device.serial", ST_FLAG_STRING, SU_INFOSIZE, " .1.3.6.1.4.1.318.1.1.30.2.1.1.5.1", NULL, SU_FLAG_STATIC | SU_FLAG_OK, NULL), /* ePDUDeviceStatusModelNumber.1 = STRING: "EPDU1016M" */ - { "device.part", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.1.30.2.1.1.4.1", NULL, SU_FLAG_STATIC | SU_FLAG_OK, NULL }, + snmp_info_default("device.part", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.1.30.2.1.1.4.1", NULL, SU_FLAG_STATIC | SU_FLAG_OK, NULL), /* ePDUDeviceStatusVersion.1 = STRING: "Ver16.10" */ - { "device.version", ST_FLAG_STRING, SU_INFOSIZE, " .1.3.6.1.4.1.318.1.1.30.2.1.1.3.1", NULL, SU_FLAG_STATIC | SU_FLAG_OK, NULL }, + snmp_info_default("device.version", ST_FLAG_STRING, SU_INFOSIZE, " .1.3.6.1.4.1.318.1.1.30.2.1.1.3.1", NULL, SU_FLAG_STATIC | SU_FLAG_OK, NULL), /* Input */ /* ePDUPhaseTableSize = INTEGER: 1 */ - { "input.phases", 0, 1, ".1.3.6.1.4.1.318.1.1.30.3.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("input.phases", 0, 1, ".1.3.6.1.4.1.318.1.1.30.3.0", NULL, SU_FLAG_OK, NULL), /* ePDUDeviceStatusActivePower.1 = INTEGER: 785 */ - { "input.realpower", 0, 1, ".1.3.6.1.4.1.318.1.1.30.2.1.1.7.1", NULL, SU_FLAG_OK | SU_FLAG_NEGINVALID, NULL }, + snmp_info_default("input.realpower", 0, 1, ".1.3.6.1.4.1.318.1.1.30.2.1.1.7.1", NULL, SU_FLAG_OK | SU_FLAG_NEGINVALID, NULL), /* Take first phase for global if single phase */ /* ePDUPhaseStatusVoltage.1 = INTEGER: 2304 */ - { "input.voltage", 0, 0.1, ".1.3.6.1.4.1.318.1.1.30.4.2.1.4.1", NULL, SU_FLAG_OK | SU_FLAG_NEGINVALID | SU_INPUT_1, NULL }, + snmp_info_default("input.voltage", 0, 0.1, ".1.3.6.1.4.1.318.1.1.30.4.2.1.4.1", NULL, SU_FLAG_OK | SU_FLAG_NEGINVALID | SU_INPUT_1, NULL), /* Take first phase for global if single phase */ /* ePDUPhaseStatusCurrent.1 = INTEGER: 355 */ - { "input.current", 0, 0.01, ".1.3.6.1.4.1.318.1.1.30.4.2.1.5.1", NULL, SU_FLAG_OK | SU_FLAG_NEGINVALID | SU_INPUT_1, NULL }, + snmp_info_default("input.current", 0, 0.01, ".1.3.6.1.4.1.318.1.1.30.4.2.1.5.1", NULL, SU_FLAG_OK | SU_FLAG_NEGINVALID | SU_INPUT_1, NULL), /* Only if tree-phase */ /* ePDUPhaseStatusVoltage.1 = INTEGER: 2304 */ - { "input.L1-N.voltage", 0, 0.1, ".1.3.6.1.4.1.318.1.1.30.4.2.1.4.1", NULL, SU_FLAG_OK | SU_FLAG_NEGINVALID | SU_INPUT_3, NULL }, + snmp_info_default("input.L1-N.voltage", 0, 0.1, ".1.3.6.1.4.1.318.1.1.30.4.2.1.4.1", NULL, SU_FLAG_OK | SU_FLAG_NEGINVALID | SU_INPUT_3, NULL), /* ePDUPhaseStatusVoltage.2 = INTEGER: 2304 */ - { "input.L2-N.voltage", 0, 0.1, ".1.3.6.1.4.1.318.1.1.30.4.2.1.4.2", NULL, SU_FLAG_OK | SU_FLAG_NEGINVALID | SU_INPUT_3, NULL }, + snmp_info_default("input.L2-N.voltage", 0, 0.1, ".1.3.6.1.4.1.318.1.1.30.4.2.1.4.2", NULL, SU_FLAG_OK | SU_FLAG_NEGINVALID | SU_INPUT_3, NULL), /* ePDUPhaseStatusVoltage.3 = INTEGER: 2304 */ - { "input.L3-N.voltage", 0, 0.1, ".1.3.6.1.4.1.318.1.1.30.4.2.1.4.3", NULL, SU_FLAG_OK | SU_FLAG_NEGINVALID | SU_INPUT_3, NULL }, + snmp_info_default("input.L3-N.voltage", 0, 0.1, ".1.3.6.1.4.1.318.1.1.30.4.2.1.4.3", NULL, SU_FLAG_OK | SU_FLAG_NEGINVALID | SU_INPUT_3, NULL), /* ePDUPhaseStatusCurrent.1 = INTEGER: 355 */ - { "input.L1.current", 0, 0.01, ".1.3.6.1.4.1.318.1.1.30.4.2.1.5.1", NULL, SU_FLAG_OK | SU_FLAG_NEGINVALID | SU_INPUT_3, NULL }, + snmp_info_default("input.L1.current", 0, 0.01, ".1.3.6.1.4.1.318.1.1.30.4.2.1.5.1", NULL, SU_FLAG_OK | SU_FLAG_NEGINVALID | SU_INPUT_3, NULL), /* ePDUPhaseStatusCurrent.2 = INTEGER: 355 */ - { "input.L2.current", 0, 0.01, ".1.3.6.1.4.1.318.1.1.30.4.2.1.5.2", NULL, SU_FLAG_OK | SU_FLAG_NEGINVALID | SU_INPUT_3, NULL }, + snmp_info_default("input.L2.current", 0, 0.01, ".1.3.6.1.4.1.318.1.1.30.4.2.1.5.2", NULL, SU_FLAG_OK | SU_FLAG_NEGINVALID | SU_INPUT_3, NULL), /* ePDUPhaseStatusCurrent.3 = INTEGER: 355 */ - { "input.L3.current", 0, 0.01, ".1.3.6.1.4.1.318.1.1.30.4.2.1.5.3", NULL, SU_FLAG_OK | SU_FLAG_NEGINVALID | SU_INPUT_3, NULL }, + snmp_info_default("input.L3.current", 0, 0.01, ".1.3.6.1.4.1.318.1.1.30.4.2.1.5.3", NULL, SU_FLAG_OK | SU_FLAG_NEGINVALID | SU_INPUT_3, NULL), /* ePDUPhaseStatusActivePower.1 = INTEGER: 785 */ - { "input.L1.realpower", 0, 1, ".1.3.6.1.4.1.318.1.1.30.4.2.1.6.1", NULL, SU_FLAG_OK | SU_FLAG_NEGINVALID | SU_INPUT_3, NULL }, + snmp_info_default("input.L1.realpower", 0, 1, ".1.3.6.1.4.1.318.1.1.30.4.2.1.6.1", NULL, SU_FLAG_OK | SU_FLAG_NEGINVALID | SU_INPUT_3, NULL), /* ePDUPhaseStatusActivePower.2 = INTEGER: 785 */ - { "input.L2.realpower", 0, 1, ".1.3.6.1.4.1.318.1.1.30.4.2.1.6.2", NULL, SU_FLAG_OK | SU_FLAG_NEGINVALID | SU_INPUT_3, NULL }, + snmp_info_default("input.L2.realpower", 0, 1, ".1.3.6.1.4.1.318.1.1.30.4.2.1.6.2", NULL, SU_FLAG_OK | SU_FLAG_NEGINVALID | SU_INPUT_3, NULL), /* ePDUPhaseStatusActivePower.3 = INTEGER: 785 */ - { "input.L3.realpower", 0, 1, ".1.3.6.1.4.1.318.1.1.30.4.2.1.6.3", NULL, SU_FLAG_OK | SU_FLAG_NEGINVALID | SU_INPUT_3, NULL }, + snmp_info_default("input.L3.realpower", 0, 1, ".1.3.6.1.4.1.318.1.1.30.4.2.1.6.3", NULL, SU_FLAG_OK | SU_FLAG_NEGINVALID | SU_INPUT_3, NULL), /* Outlets */ /* ePDUOutletTableSize.0 = INTEGER: 1 */ - { "outlet.count", 0, 1, ".1.3.6.1.4.1.318.1.1.30.5.0", NULL, SU_FLAG_STATIC | SU_FLAG_OK, NULL }, + snmp_info_default("outlet.count", 0, 1, ".1.3.6.1.4.1.318.1.1.30.5.0", NULL, SU_FLAG_STATIC | SU_FLAG_OK, NULL), /* ePDUOutletStatusIndex.%i = INTEGER: 1 */ - { "outlet.%i.id", 0, 1, ".1.3.6.1.4.1.318.1.1.30.6.1.1.1.%i", "%i", SU_FLAG_STATIC | SU_FLAG_OK | SU_FLAG_NEGINVALID | SU_OUTLET, NULL }, + snmp_info_default("outlet.%i.id", 0, 1, ".1.3.6.1.4.1.318.1.1.30.6.1.1.1.%i", "%i", SU_FLAG_STATIC | SU_FLAG_OK | SU_FLAG_NEGINVALID | SU_OUTLET, NULL), /* ePDUOutletStatusModule.%i= INTEGER: 1 */ - { "outlet.%i.name", 0, 1, ".1.3.6.1.4.1.318.1.1.30.6.2.1.2.%i", NULL, SU_FLAG_OK | SU_FLAG_NEGINVALID | SU_OUTLET, NULL }, + snmp_info_default("outlet.%i.name", 0, 1, ".1.3.6.1.4.1.318.1.1.30.6.2.1.2.%i", NULL, SU_FLAG_OK | SU_FLAG_NEGINVALID | SU_OUTLET, NULL), /* ePDUOutletStatusNumber.%i = INTEGER: 1 */ - { "outlet.%i.desc", 0, 1, NULL, "Outlet %i", SU_FLAG_STATIC | SU_FLAG_ABSENT | SU_OUTLET, NULL }, + snmp_info_default("outlet.%i.desc", 0, 1, NULL, "Outlet %i", SU_FLAG_STATIC | SU_FLAG_ABSENT | SU_OUTLET, NULL), /* ePDUOutletStatusState.%i = INTEGER: off(1) */ - { "outlet.%i.status", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.1.30.6.1.1.4.%i", NULL, SU_FLAG_OK | SU_FLAG_NEGINVALID | SU_OUTLET, &apc_epdu_sw_outlet_status_info[0] }, + snmp_info_default("outlet.%i.status", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.1.30.6.1.1.4.%i", NULL, SU_FLAG_OK | SU_FLAG_NEGINVALID | SU_OUTLET, &apc_epdu_sw_outlet_status_info[0]), /* Also use this OID to determine switchability ; its presence means "yes" */ /* ePDUOutletStatusState.%i = INTEGER: off(1) */ - { "outlet.%i.switchable", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.1.30.6.1.1.4.%i", "yes", SU_FLAG_STATIC | SU_FLAG_ABSENT | SU_FLAG_OK | SU_OUTLET, &apc_epdu_sw_outlet_switchability_info[0] }, + snmp_info_default("outlet.%i.switchable", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.1.30.6.1.1.4.%i", "yes", SU_FLAG_STATIC | SU_FLAG_ABSENT | SU_FLAG_OK | SU_OUTLET, &apc_epdu_sw_outlet_switchability_info[0]), #if WITH_UNMAPPED_DATA_POINTS /* keep following scan for future development */ /* iso.3.6.1.4.1.318.1.1.30.1.0 = INTEGER: 1 */ - { "unmapped.iso", 0, 1, ".1.3.6.1.4.1.318.1.1.30.1.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.iso", 0, 1, ".1.3.6.1.4.1.318.1.1.30.1.0", NULL, SU_FLAG_OK, NULL), /* iso.3.6.1.4.1.318.1.1.30.2.1.1.1.1 = INTEGER: 1 */ - { "unmapped.iso", 0, 1, ".1.3.6.1.4.1.318.1.1.30.2.1.1.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.iso", 0, 1, ".1.3.6.1.4.1.318.1.1.30.2.1.1.1.1", NULL, SU_FLAG_OK, NULL), /* iso.3.6.1.4.1.318.1.1.30.2.1.1.2.1 = INTEGER: 1 */ - { "unmapped.iso", 0, 1, ".1.3.6.1.4.1.318.1.1.30.2.1.1.2.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.iso", 0, 1, ".1.3.6.1.4.1.318.1.1.30.2.1.1.2.1", NULL, SU_FLAG_OK, NULL), /* iso.3.6.1.4.1.318.1.1.30.2.1.1.3.1 = STRING: "Ver16.10" */ - { "unmapped.iso", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.1.30.2.1.1.3.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.iso", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.1.30.2.1.1.3.1", NULL, SU_FLAG_OK, NULL), /* iso.3.6.1.4.1.318.1.1.30.2.1.1.4.1 = STRING: "EPDU1016M" */ - { "unmapped.iso", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.1.30.2.1.1.4.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.iso", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.1.30.2.1.1.4.1", NULL, SU_FLAG_OK, NULL), /* iso.3.6.1.4.1.318.1.1.30.2.1.1.5.1 = STRING: "506255604717" */ - { "unmapped.iso", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.1.30.2.1.1.5.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.iso", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.1.30.2.1.1.5.1", NULL, SU_FLAG_OK, NULL), /* iso.3.6.1.4.1.318.1.1.30.2.1.1.6.1 = INTEGER: 1 */ - { "unmapped.iso", 0, 1, ".1.3.6.1.4.1.318.1.1.30.2.1.1.6.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.iso", 0, 1, ".1.3.6.1.4.1.318.1.1.30.2.1.1.6.1", NULL, SU_FLAG_OK, NULL), /* iso.3.6.1.4.1.318.1.1.30.2.1.1.7.1 = INTEGER: 785 */ - { "unmapped.iso", 0, 1, ".1.3.6.1.4.1.318.1.1.30.2.1.1.7.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.iso", 0, 1, ".1.3.6.1.4.1.318.1.1.30.2.1.1.7.1", NULL, SU_FLAG_OK, NULL), /* iso.3.6.1.4.1.318.1.1.30.2.1.1.8.1 = INTEGER: -1 */ - { "unmapped.iso", 0, 1, ".1.3.6.1.4.1.318.1.1.30.2.1.1.8.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.iso", 0, 1, ".1.3.6.1.4.1.318.1.1.30.2.1.1.8.1", NULL, SU_FLAG_OK, NULL), /* iso.3.6.1.4.1.318.1.1.30.2.1.1.9.1 = INTEGER: -1 */ - { "unmapped.iso", 0, 1, ".1.3.6.1.4.1.318.1.1.30.2.1.1.9.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.iso", 0, 1, ".1.3.6.1.4.1.318.1.1.30.2.1.1.9.1", NULL, SU_FLAG_OK, NULL), /* iso.3.6.1.4.1.318.1.1.30.2.1.1.10.1 = INTEGER: 965 */ - { "unmapped.iso", 0, 1, ".1.3.6.1.4.1.318.1.1.30.2.1.1.10.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.iso", 0, 1, ".1.3.6.1.4.1.318.1.1.30.2.1.1.10.1", NULL, SU_FLAG_OK, NULL), /* iso.3.6.1.4.1.318.1.1.30.2.1.1.11.1 = INTEGER: 9114157 */ - { "unmapped.iso", 0, 1, ".1.3.6.1.4.1.318.1.1.30.2.1.1.11.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.iso", 0, 1, ".1.3.6.1.4.1.318.1.1.30.2.1.1.11.1", NULL, SU_FLAG_OK, NULL), /* iso.3.6.1.4.1.318.1.1.30.2.1.1.12.1 = INTEGER: 49988 */ - { "unmapped.iso", 0, 1, ".1.3.6.1.4.1.318.1.1.30.2.1.1.12.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.iso", 0, 1, ".1.3.6.1.4.1.318.1.1.30.2.1.1.12.1", NULL, SU_FLAG_OK, NULL), /* iso.3.6.1.4.1.318.1.1.30.2.2.1.1.1 = INTEGER: 1 */ - { "unmapped.iso", 0, 1, ".1.3.6.1.4.1.318.1.1.30.2.2.1.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.iso", 0, 1, ".1.3.6.1.4.1.318.1.1.30.2.2.1.1.1", NULL, SU_FLAG_OK, NULL), /* iso.3.6.1.4.1.318.1.1.30.2.2.1.2.1 = INTEGER: 1 */ - { "unmapped.iso", 0, 1, ".1.3.6.1.4.1.318.1.1.30.2.2.1.2.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.iso", 0, 1, ".1.3.6.1.4.1.318.1.1.30.2.2.1.2.1", NULL, SU_FLAG_OK, NULL), /* iso.3.6.1.4.1.318.1.1.30.2.2.1.3.1 = INTEGER: 0 */ - { "unmapped.iso", 0, 1, ".1.3.6.1.4.1.318.1.1.30.2.2.1.3.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.iso", 0, 1, ".1.3.6.1.4.1.318.1.1.30.2.2.1.3.1", NULL, SU_FLAG_OK, NULL), /* iso.3.6.1.4.1.318.1.1.30.2.2.1.4.1 = INTEGER: 0 */ - { "unmapped.iso", 0, 1, ".1.3.6.1.4.1.318.1.1.30.2.2.1.4.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.iso", 0, 1, ".1.3.6.1.4.1.318.1.1.30.2.2.1.4.1", NULL, SU_FLAG_OK, NULL), /* iso.3.6.1.4.1.318.1.1.30.2.2.1.5.1 = INTEGER: 2 */ - { "unmapped.iso", 0, 1, ".1.3.6.1.4.1.318.1.1.30.2.2.1.5.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.iso", 0, 1, ".1.3.6.1.4.1.318.1.1.30.2.2.1.5.1", NULL, SU_FLAG_OK, NULL), /* iso.3.6.1.4.1.318.1.1.30.3.0 = INTEGER: 1 */ - { "unmapped.iso", 0, 1, ".1.3.6.1.4.1.318.1.1.30.3.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.iso", 0, 1, ".1.3.6.1.4.1.318.1.1.30.3.0", NULL, SU_FLAG_OK, NULL), /* iso.3.6.1.4.1.318.1.1.30.4.1.1.1.1 = INTEGER: 1 */ - { "unmapped.iso", 0, 1, ".1.3.6.1.4.1.318.1.1.30.4.1.1.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.iso", 0, 1, ".1.3.6.1.4.1.318.1.1.30.4.1.1.1.1", NULL, SU_FLAG_OK, NULL), /* iso.3.6.1.4.1.318.1.1.30.4.1.1.2.1 = INTEGER: 1 */ - { "unmapped.iso", 0, 1, ".1.3.6.1.4.1.318.1.1.30.4.1.1.2.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.iso", 0, 1, ".1.3.6.1.4.1.318.1.1.30.4.1.1.2.1", NULL, SU_FLAG_OK, NULL), /* iso.3.6.1.4.1.318.1.1.30.4.1.1.3.1 = INTEGER: 1 */ - { "unmapped.iso", 0, 1, ".1.3.6.1.4.1.318.1.1.30.4.1.1.3.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.iso", 0, 1, ".1.3.6.1.4.1.318.1.1.30.4.1.1.3.1", NULL, SU_FLAG_OK, NULL), /* iso.3.6.1.4.1.318.1.1.30.4.1.1.4.1 = INTEGER: 3000 */ - { "unmapped.iso", 0, 1, ".1.3.6.1.4.1.318.1.1.30.4.1.1.4.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.iso", 0, 1, ".1.3.6.1.4.1.318.1.1.30.4.1.1.4.1", NULL, SU_FLAG_OK, NULL), /* iso.3.6.1.4.1.318.1.1.30.4.1.1.5.1 = INTEGER: 0 */ - { "unmapped.iso", 0, 1, ".1.3.6.1.4.1.318.1.1.30.4.1.1.5.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.iso", 0, 1, ".1.3.6.1.4.1.318.1.1.30.4.1.1.5.1", NULL, SU_FLAG_OK, NULL), /* iso.3.6.1.4.1.318.1.1.30.4.1.1.6.1 = INTEGER: 3200 */ - { "unmapped.iso", 0, 1, ".1.3.6.1.4.1.318.1.1.30.4.1.1.6.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.iso", 0, 1, ".1.3.6.1.4.1.318.1.1.30.4.1.1.6.1", NULL, SU_FLAG_OK, NULL), /* iso.3.6.1.4.1.318.1.1.30.4.1.1.7.1 = INTEGER: 0 */ - { "unmapped.iso", 0, 1, ".1.3.6.1.4.1.318.1.1.30.4.1.1.7.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.iso", 0, 1, ".1.3.6.1.4.1.318.1.1.30.4.1.1.7.1", NULL, SU_FLAG_OK, NULL), /* iso.3.6.1.4.1.318.1.1.30.4.2.1.1.1 = INTEGER: 1 */ - { "unmapped.iso", 0, 1, ".1.3.6.1.4.1.318.1.1.30.4.2.1.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.iso", 0, 1, ".1.3.6.1.4.1.318.1.1.30.4.2.1.1.1", NULL, SU_FLAG_OK, NULL), /* iso.3.6.1.4.1.318.1.1.30.4.2.1.2.1 = INTEGER: 1 */ - { "unmapped.iso", 0, 1, ".1.3.6.1.4.1.318.1.1.30.4.2.1.2.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.iso", 0, 1, ".1.3.6.1.4.1.318.1.1.30.4.2.1.2.1", NULL, SU_FLAG_OK, NULL), /* iso.3.6.1.4.1.318.1.1.30.4.2.1.3.1 = INTEGER: 1 */ - { "unmapped.iso", 0, 1, ".1.3.6.1.4.1.318.1.1.30.4.2.1.3.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.iso", 0, 1, ".1.3.6.1.4.1.318.1.1.30.4.2.1.3.1", NULL, SU_FLAG_OK, NULL), /* iso.3.6.1.4.1.318.1.1.30.4.2.1.4.1 = INTEGER: 2304 */ - { "unmapped.iso", 0, 1, ".1.3.6.1.4.1.318.1.1.30.4.2.1.4.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.iso", 0, 1, ".1.3.6.1.4.1.318.1.1.30.4.2.1.4.1", NULL, SU_FLAG_OK, NULL), /* iso.3.6.1.4.1.318.1.1.30.4.2.1.5.1 = INTEGER: 353 */ - { "unmapped.iso", 0, 1, ".1.3.6.1.4.1.318.1.1.30.4.2.1.5.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.iso", 0, 1, ".1.3.6.1.4.1.318.1.1.30.4.2.1.5.1", NULL, SU_FLAG_OK, NULL), /* iso.3.6.1.4.1.318.1.1.30.4.2.1.6.1 = INTEGER: 785 */ - { "unmapped.iso", 0, 1, ".1.3.6.1.4.1.318.1.1.30.4.2.1.6.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.iso", 0, 1, ".1.3.6.1.4.1.318.1.1.30.4.2.1.6.1", NULL, SU_FLAG_OK, NULL), /* iso.3.6.1.4.1.318.1.1.30.4.2.1.7.1 = INTEGER: -1 */ - { "unmapped.iso", 0, 1, ".1.3.6.1.4.1.318.1.1.30.4.2.1.7.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.iso", 0, 1, ".1.3.6.1.4.1.318.1.1.30.4.2.1.7.1", NULL, SU_FLAG_OK, NULL), /* iso.3.6.1.4.1.318.1.1.30.4.2.1.8.1 = INTEGER: -1 */ - { "unmapped.iso", 0, 1, ".1.3.6.1.4.1.318.1.1.30.4.2.1.8.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.iso", 0, 1, ".1.3.6.1.4.1.318.1.1.30.4.2.1.8.1", NULL, SU_FLAG_OK, NULL), /* iso.3.6.1.4.1.318.1.1.30.4.2.1.9.1 = INTEGER: 965 */ - { "unmapped.iso", 0, 1, ".1.3.6.1.4.1.318.1.1.30.4.2.1.9.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.iso", 0, 1, ".1.3.6.1.4.1.318.1.1.30.4.2.1.9.1", NULL, SU_FLAG_OK, NULL), /* iso.3.6.1.4.1.318.1.1.30.4.2.1.10.1 = INTEGER: 9114157 */ - { "unmapped.iso", 0, 1, ".1.3.6.1.4.1.318.1.1.30.4.2.1.10.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.iso", 0, 1, ".1.3.6.1.4.1.318.1.1.30.4.2.1.10.1", NULL, SU_FLAG_OK, NULL), /* iso.3.6.1.4.1.318.1.1.30.5.0 = INTEGER: 0 */ - { "unmapped.iso", 0, 1, ".1.3.6.1.4.1.318.1.1.30.5.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.iso", 0, 1, ".1.3.6.1.4.1.318.1.1.30.5.0", NULL, SU_FLAG_OK, NULL), /* iso.3.6.1.4.1.318.1.1.30.6.1.1.1.1 = INTEGER: -1 */ - { "unmapped.iso", 0, 1, ".1.3.6.1.4.1.318.1.1.30.6.1.1.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.iso", 0, 1, ".1.3.6.1.4.1.318.1.1.30.6.1.1.1.1", NULL, SU_FLAG_OK, NULL), /* iso.3.6.1.4.1.318.1.1.30.6.1.1.2.1 = INTEGER: -1 */ - { "unmapped.iso", 0, 1, ".1.3.6.1.4.1.318.1.1.30.6.1.1.2.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.iso", 0, 1, ".1.3.6.1.4.1.318.1.1.30.6.1.1.2.1", NULL, SU_FLAG_OK, NULL), /* iso.3.6.1.4.1.318.1.1.30.6.1.1.3.1 = INTEGER: -1 */ - { "unmapped.iso", 0, 1, ".1.3.6.1.4.1.318.1.1.30.6.1.1.3.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.iso", 0, 1, ".1.3.6.1.4.1.318.1.1.30.6.1.1.3.1", NULL, SU_FLAG_OK, NULL), /* iso.3.6.1.4.1.318.1.1.30.6.1.1.4.1 = INTEGER: -1 */ - { "unmapped.iso", 0, 1, ".1.3.6.1.4.1.318.1.1.30.6.1.1.4.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.iso", 0, 1, ".1.3.6.1.4.1.318.1.1.30.6.1.1.4.1", NULL, SU_FLAG_OK, NULL), /* iso.3.6.1.4.1.318.1.1.30.6.2.1.1.1 = INTEGER: -1 */ - { "unmapped.iso", 0, 1, ".1.3.6.1.4.1.318.1.1.30.6.2.1.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.iso", 0, 1, ".1.3.6.1.4.1.318.1.1.30.6.2.1.1.1", NULL, SU_FLAG_OK, NULL), /* iso.3.6.1.4.1.318.1.1.30.6.2.1.2.1 = INTEGER: -1 */ - { "unmapped.iso", 0, 1, ".1.3.6.1.4.1.318.1.1.30.6.2.1.2.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.iso", 0, 1, ".1.3.6.1.4.1.318.1.1.30.6.2.1.2.1", NULL, SU_FLAG_OK, NULL), /* iso.3.6.1.4.1.318.1.1.30.6.2.1.3.1 = INTEGER: -1 */ - { "unmapped.iso", 0, 1, ".1.3.6.1.4.1.318.1.1.30.6.2.1.3.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.iso", 0, 1, ".1.3.6.1.4.1.318.1.1.30.6.2.1.3.1", NULL, SU_FLAG_OK, NULL), /* iso.3.6.1.4.1.318.1.1.30.6.2.1.4.1 = INTEGER: -1 */ - { "unmapped.iso", 0, 1, ".1.3.6.1.4.1.318.1.1.30.6.2.1.4.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.iso", 0, 1, ".1.3.6.1.4.1.318.1.1.30.6.2.1.4.1", NULL, SU_FLAG_OK, NULL), /* iso.3.6.1.4.1.318.1.1.30.7.0 = INTEGER: 1 */ - { "unmapped.iso", 0, 1, ".1.3.6.1.4.1.318.1.1.30.7.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.iso", 0, 1, ".1.3.6.1.4.1.318.1.1.30.7.0", NULL, SU_FLAG_OK, NULL), /* iso.3.6.1.4.1.318.1.1.30.8.1.1.1.1 = INTEGER: 1 */ - { "unmapped.iso", 0, 1, ".1.3.6.1.4.1.318.1.1.30.8.1.1.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.iso", 0, 1, ".1.3.6.1.4.1.318.1.1.30.8.1.1.1.1", NULL, SU_FLAG_OK, NULL), /* iso.3.6.1.4.1.318.1.1.30.8.1.1.2.1 = INTEGER: 1 */ - { "unmapped.iso", 0, 1, ".1.3.6.1.4.1.318.1.1.30.8.1.1.2.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.iso", 0, 1, ".1.3.6.1.4.1.318.1.1.30.8.1.1.2.1", NULL, SU_FLAG_OK, NULL), /* iso.3.6.1.4.1.318.1.1.30.8.1.1.3.1 = INTEGER: 900 */ - { "unmapped.iso", 0, 1, ".1.3.6.1.4.1.318.1.1.30.8.1.1.3.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.iso", 0, 1, ".1.3.6.1.4.1.318.1.1.30.8.1.1.3.1", NULL, SU_FLAG_OK, NULL), /* iso.3.6.1.4.1.318.1.1.30.8.1.1.4.1 = INTEGER: 0 */ - { "unmapped.iso", 0, 1, ".1.3.6.1.4.1.318.1.1.30.8.1.1.4.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.iso", 0, 1, ".1.3.6.1.4.1.318.1.1.30.8.1.1.4.1", NULL, SU_FLAG_OK, NULL), /* iso.3.6.1.4.1.318.1.1.30.8.1.1.5.1 = INTEGER: 900 */ - { "unmapped.iso", 0, 1, ".1.3.6.1.4.1.318.1.1.30.8.1.1.5.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.iso", 0, 1, ".1.3.6.1.4.1.318.1.1.30.8.1.1.5.1", NULL, SU_FLAG_OK, NULL), /* iso.3.6.1.4.1.318.1.1.30.8.1.1.6.1 = INTEGER: 0 */ - { "unmapped.iso", 0, 1, ".1.3.6.1.4.1.318.1.1.30.8.1.1.6.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.iso", 0, 1, ".1.3.6.1.4.1.318.1.1.30.8.1.1.6.1", NULL, SU_FLAG_OK, NULL), /* iso.3.6.1.4.1.318.1.1.30.8.2.1.1.1 = INTEGER: 1 */ - { "unmapped.iso", 0, 1, ".1.3.6.1.4.1.318.1.1.30.8.2.1.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.iso", 0, 1, ".1.3.6.1.4.1.318.1.1.30.8.2.1.1.1", NULL, SU_FLAG_OK, NULL), /* iso.3.6.1.4.1.318.1.1.30.8.2.1.2.1 = INTEGER: 1 */ - { "unmapped.iso", 0, 1, ".1.3.6.1.4.1.318.1.1.30.8.2.1.2.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.iso", 0, 1, ".1.3.6.1.4.1.318.1.1.30.8.2.1.2.1", NULL, SU_FLAG_OK, NULL), /* iso.3.6.1.4.1.318.1.1.30.8.2.1.3.1 = INTEGER: 0 */ - { "unmapped.iso", 0, 1, ".1.3.6.1.4.1.318.1.1.30.8.2.1.3.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.iso", 0, 1, ".1.3.6.1.4.1.318.1.1.30.8.2.1.3.1", NULL, SU_FLAG_OK, NULL), /* iso.3.6.1.4.1.318.1.1.30.8.2.1.4.1 = INTEGER: 0 */ - { "unmapped.iso", 0, 1, ".1.3.6.1.4.1.318.1.1.30.8.2.1.4.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.iso", 0, 1, ".1.3.6.1.4.1.318.1.1.30.8.2.1.4.1", NULL, SU_FLAG_OK, NULL), #endif /* end of structure. */ - { NULL, 0, 0, NULL, NULL, 0, NULL } + snmp_info_sentinel }; mib2nut_info_t apc_pdu_epdu = { "apc", APC_EPDU_MIB_VERSION, NULL, NULL, apc_epdu_mib, APC_EPDU_MIB_SYSOID, NULL }; diff --git a/drivers/apc-mib.c b/drivers/apc-mib.c index a716844f13..1c6c575ac6 100644 --- a/drivers/apc-mib.c +++ b/drivers/apc-mib.c @@ -26,7 +26,7 @@ #include "apc-mib.h" -#define APCC_MIB_VERSION "1.6" +#define APCC_MIB_VERSION "1.60" #define APC_UPS_DEVICE_MODEL ".1.3.6.1.4.1.318.1.1.1.1.1.1.0" /* FIXME: Find a better oid_auto_check vs sysOID for this one? */ @@ -64,75 +64,97 @@ #define APCC_OID_BATT_STATUS ".1.3.6.1.4.1.318.1.1.1.2.1.1.0" /* Defines for APCC_OID_BATT_STATUS */ static info_lkp_t apcc_batt_info[] = { - { 1, "", NULL, NULL }, /* unknown */ - { 2, "", NULL, NULL }, /* batteryNormal */ - { 3, "LB", NULL, NULL }, /* batteryLow */ - { 0, NULL, NULL, NULL } -} ; + info_lkp_default(1, ""), /* unknown */ + info_lkp_default(2, ""), /* batteryNormal */ + info_lkp_default(3, "LB"), /* batteryLow */ + info_lkp_default(4, "LB"), /* batteryInFaultCondition */ + info_lkp_default(5, "LB"), /* noBatteryPresent */ + info_lkp_sentinel +}; #define APCC_OID_POWER_STATUS ".1.3.6.1.4.1.318.1.1.1.4.1.1.0" /* Defines for APCC_OID_POWER_STATUS */ static info_lkp_t apcc_pwr_info[] = { - { 1, "", NULL, NULL }, /* unknown */ - { 2, "OL", NULL, NULL }, /* onLine */ - { 3, "OB", NULL, NULL }, /* onBattery */ - { 4, "OL BOOST", NULL, NULL }, /* onSmartBoost */ - { 5, "OFF", NULL, NULL }, /* timedSleeping */ - { 6, "OFF", NULL, NULL }, /* softwareBypass */ - { 7, "OFF", NULL, NULL }, /* off */ - { 8, "", NULL, NULL }, /* rebooting */ - { 9, "BYPASS", NULL, NULL }, /* switchedBypass */ - { 10, "BYPASS", NULL, NULL }, /* hardwareFailureBypass */ - { 11, "OFF", NULL, NULL }, /* sleepingUntilPowerReturn */ - { 12, "OL TRIM", NULL, NULL }, /* onSmartTrim */ - { 0, NULL, NULL, NULL } + info_lkp_default(1, ""), /* unknown */ + info_lkp_default(2, "OL"), /* onLine */ + info_lkp_default(3, "OB"), /* onBattery */ + info_lkp_default(4, "OL BOOST"), /* onSmartBoost */ + info_lkp_default(5, "OFF"), /* timedSleeping */ + info_lkp_default(6, "OFF"), /* softwareBypass */ + info_lkp_default(7, "OFF"), /* off */ + info_lkp_default(8, ""), /* rebooting */ + info_lkp_default(9, "BYPASS"), /* switchedBypass */ + info_lkp_default(10, "BYPASS"), /* hardwareFailureBypass */ + info_lkp_default(11, "OFF"), /* sleepingUntilPowerReturn */ + info_lkp_default(12, "OL TRIM"), /* onSmartTrim */ + info_lkp_default(13, "OL ECO"), /* ecoMode */ + info_lkp_default(14, "OL"), /* hotStandby */ + info_lkp_default(15, "OL"), /* onBatteryTest */ + info_lkp_default(16, "BYPASS"), /* emergencyStaticBypass */ + info_lkp_default(17, "BYPASS"), /* staticBypassStandby */ + info_lkp_default(18, ""), /* powerSavingMode */ + info_lkp_default(19, "OL"), /* spotMode */ + info_lkp_default(20, "OL ECO"), /* eConversion */ + info_lkp_default(21, "OL"), /* chargerSpotmode */ + info_lkp_default(22, "OL"), /* inverterSpotmode */ + info_lkp_default(23, ""), /* activeLoad */ + info_lkp_default(24, "OL"), /* batteryDischargeSpotmode */ + info_lkp_default(25, "OL"), /* inverterStandby */ + info_lkp_default(26, ""), /* chargerOnly */ + info_lkp_default(27, ""), /* distributedEnergyReserve */ + info_lkp_default(28, "OL"), /* selfTest */ + info_lkp_sentinel } ; #define APCC_OID_CAL_RESULTS ".1.3.6.1.4.1.318.1.1.1.7.2.6.0" static info_lkp_t apcc_cal_info[] = { - { 1, "", NULL, NULL }, /* Calibration Successful */ - { 2, "", NULL, NULL }, /* Calibration not done, battery capacity below 100% */ - { 3, "CAL", NULL, NULL }, /* Calibration in progress */ - { 0, NULL, NULL, NULL } + info_lkp_default(1, ""), /* Calibration Successful */ + info_lkp_default(2, ""), /* Calibration not done, battery capacity below 100% */ + info_lkp_default(3, "CAL"), /* Calibration in progress */ + info_lkp_default(4, ""), /* Calibration not done, refused */ + info_lkp_default(5, ""), /* Calibration canceled by user or error */ + info_lkp_default(6, ""), /* Calibration pending, about to start */ + info_lkp_sentinel }; #define APCC_OID_NEEDREPLBATT ".1.3.6.1.4.1.318.1.1.1.2.2.4.0" static info_lkp_t apcc_battrepl_info[] = { - { 1, "", NULL, NULL }, /* No battery needs replacing */ - { 2, "RB", NULL, NULL }, /* Batteries need to be replaced */ - { 0, NULL, NULL, NULL } + info_lkp_default(1, ""), /* No battery needs replacing */ + info_lkp_default(2, "RB"), /* Batteries need to be replaced */ + info_lkp_sentinel }; #define APCC_OID_TESTDIAGRESULTS ".1.3.6.1.4.1.318.1.1.1.7.2.3.0" static info_lkp_t apcc_testdiag_results[] = { - { 1, "Ok", NULL, NULL }, - { 2, "Failed", NULL, NULL }, - { 3, "InvalidTest", NULL, NULL }, - { 4, "TestInProgress", NULL, NULL }, - { 0, NULL, NULL, NULL } + info_lkp_default(1, "Ok"), + info_lkp_default(2, "Failed"), + info_lkp_default(3, "InvalidTest"), + info_lkp_default(4, "TestInProgress"), + info_lkp_sentinel }; #define APCC_OID_SENSITIVITY ".1.3.6.1.4.1.318.1.1.1.5.2.7.0" static info_lkp_t apcc_sensitivity_modes[] = { - { 1, "auto", NULL, NULL }, - { 2, "low", NULL, NULL }, - { 3, "medium", NULL, NULL }, - { 4, "high", NULL, NULL }, - { 0, NULL, NULL, NULL } + info_lkp_default(1, "auto"), + info_lkp_default(2, "low"), + info_lkp_default(3, "medium"), + info_lkp_default(4, "high"), + info_lkp_sentinel }; #define APCC_OID_TRANSFERREASON "1.3.6.1.4.1.318.1.1.1.3.2.5.0" static info_lkp_t apcc_transfer_reasons[] = { - { 1, "noTransfer", NULL, NULL }, - { 2, "highLineVoltage", NULL, NULL }, - { 3, "brownout", NULL, NULL }, - { 4, "blackout", NULL, NULL }, - { 5, "smallMomentarySag", NULL, NULL }, - { 6, "deepMomentarySag", NULL, NULL }, - { 7, "smallMomentarySpike", NULL, NULL }, - { 8, "largeMomentarySpike", NULL, NULL }, - { 9, "selfTest", NULL, NULL }, - { 10, "rateOfVoltageChange", NULL, NULL } + info_lkp_default(1, "noTransfer"), + info_lkp_default(2, "highLineVoltage"), + info_lkp_default(3, "brownout"), + info_lkp_default(4, "blackout"), + info_lkp_default(5, "smallMomentarySag"), + info_lkp_default(6, "deepMomentarySag"), + info_lkp_default(7, "smallMomentarySpike"), + info_lkp_default(8, "largeMomentarySpike"), + info_lkp_default(9, "selfTest"), + info_lkp_default(10, "rateOfVoltageChange"), + info_lkp_sentinel }; /* --- */ @@ -152,153 +174,155 @@ static info_lkp_t apcc_transfer_reasons[] = { static snmp_info_t apcc_mib[] = { /* standard MIB items */ - { "device.description", ST_FLAG_STRING | ST_FLAG_RW, SU_INFOSIZE, ".1.3.6.1.2.1.1.1.0", NULL, SU_FLAG_OK, NULL }, - { "device.contact", ST_FLAG_STRING | ST_FLAG_RW, SU_INFOSIZE, ".1.3.6.1.2.1.1.4.0", NULL, SU_FLAG_OK, NULL }, - { "device.location", ST_FLAG_STRING | ST_FLAG_RW, SU_INFOSIZE, ".1.3.6.1.2.1.1.6.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("device.description", ST_FLAG_STRING | ST_FLAG_RW, SU_INFOSIZE, ".1.3.6.1.2.1.1.1.0", NULL, SU_FLAG_OK, NULL), + snmp_info_default("device.contact", ST_FLAG_STRING | ST_FLAG_RW, SU_INFOSIZE, ".1.3.6.1.2.1.1.4.0", NULL, SU_FLAG_OK, NULL), + snmp_info_default("device.location", ST_FLAG_STRING | ST_FLAG_RW, SU_INFOSIZE, ".1.3.6.1.2.1.1.6.0", NULL, SU_FLAG_OK, NULL), /* info elements. */ - { "ups.mfr", ST_FLAG_STRING, SU_INFOSIZE, NULL, "APC", - SU_FLAG_STATIC | SU_FLAG_ABSENT | SU_FLAG_OK, NULL }, - { "ups.model", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.1.1.1.1.1.0", "Generic Powernet SNMP device", SU_FLAG_STATIC | SU_FLAG_OK, NULL }, - { "ups.serial", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.1.1.1.2.3.0", "", SU_FLAG_STATIC | SU_FLAG_OK, NULL }, - { "ups.mfr.date", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.1.1.1.2.2.0", "", SU_FLAG_OK | SU_FLAG_STATIC, NULL }, - { "input.voltage", 0, 0.1, ".1.3.6.1.4.1.318.1.1.1.3.3.1.0", "", SU_FLAG_OK | SU_FLAG_NEGINVALID | SU_FLAG_UNIQUE, NULL }, - { "input.voltage.maximum", 0, 0.1, ".1.3.6.1.4.1.318.1.1.1.3.3.2.0", "", SU_FLAG_OK | SU_FLAG_NEGINVALID | SU_FLAG_UNIQUE, NULL }, - { "input.voltage.minimum", 0, 0.1, ".1.3.6.1.4.1.318.1.1.1.3.3.3.0", "", SU_FLAG_OK | SU_FLAG_NEGINVALID | SU_FLAG_UNIQUE, NULL }, - { "input.voltage", 0, 1, ".1.3.6.1.4.1.318.1.1.1.3.2.1.0", "", SU_FLAG_OK, NULL }, - { "input.voltage.maximum", 0, 1, ".1.3.6.1.4.1.318.1.1.1.3.2.2.0", "", SU_FLAG_OK, NULL }, - { "input.voltage.minimum", 0, 1, ".1.3.6.1.4.1.318.1.1.1.3.2.3.0", "", SU_FLAG_OK, NULL }, - { "input.phases", ST_FLAG_STRING, 2, ".1.3.6.1.4.1.318.1.1.1.9.2.2.1.2.1", "", SU_FLAG_STATIC | SU_FLAG_OK, NULL }, - { "input.L1-L2.voltage", 0, 1, ".1.3.6.1.4.1.318.1.1.1.9.2.3.1.3.1.1.1", "", SU_FLAG_OK|SU_FLAG_NEGINVALID, NULL }, - { "input.L2-L3.voltage", 0, 1, ".1.3.6.1.4.1.318.1.1.1.9.2.3.1.3.1.1.2", "", SU_FLAG_OK|SU_FLAG_NEGINVALID, NULL }, - { "input.L3-L1.voltage", 0, 1, ".1.3.6.1.4.1.318.1.1.1.9.2.3.1.3.1.1.3", "", SU_FLAG_OK|SU_FLAG_NEGINVALID, NULL }, - { "input.L1-L2.voltage.maximum", 0, 1, ".1.3.6.1.4.1.318.1.1.1.9.2.3.1.4.1.1.1", "", SU_FLAG_OK|SU_FLAG_NEGINVALID, NULL }, - { "input.L2-L3.voltage.maximum", 0, 1, ".1.3.6.1.4.1.318.1.1.1.9.2.3.1.4.1.1.2", "", SU_FLAG_OK|SU_FLAG_NEGINVALID, NULL }, - { "input.L3-L1.voltage.maximum", 0, 1, ".1.3.6.1.4.1.318.1.1.1.9.2.3.1.4.1.1.3", "", SU_FLAG_OK|SU_FLAG_NEGINVALID, NULL }, - { "input.L1-L2.voltage.minimum", 0, 1, ".1.3.6.1.4.1.318.1.1.1.9.2.3.1.5.1.1.1", "", SU_FLAG_OK|SU_FLAG_NEGINVALID, NULL }, - { "input.L2-L3.voltage.minimum", 0, 1, ".1.3.6.1.4.1.318.1.1.1.9.2.3.1.5.1.1.2", "", SU_FLAG_OK|SU_FLAG_NEGINVALID, NULL }, - { "input.L3-L1.voltage.minimum", 0, 1, ".1.3.6.1.4.1.318.1.1.1.9.2.3.1.5.1.1.3", "", SU_FLAG_OK|SU_FLAG_NEGINVALID, NULL }, - { "input.L1.current", 0, 0.1, ".1.3.6.1.4.1.318.1.1.1.9.2.3.1.6.1.1.1", "", SU_FLAG_OK|SU_FLAG_NEGINVALID, NULL }, - { "input.L2.current", 0, 0.1, ".1.3.6.1.4.1.318.1.1.1.9.2.3.1.6.1.1.2", "", SU_FLAG_OK|SU_FLAG_NEGINVALID, NULL }, - { "input.L3.current", 0, 0.1, ".1.3.6.1.4.1.318.1.1.1.9.2.3.1.6.1.1.3", "", SU_FLAG_OK|SU_FLAG_NEGINVALID, NULL }, - { "input.L1.current.maximum", 0, 0.1, ".1.3.6.1.4.1.318.1.1.1.9.2.3.1.7.1.1.1", "", SU_FLAG_OK|SU_FLAG_NEGINVALID, NULL }, - { "input.L2.current.maximum", 0, 0.1, ".1.3.6.1.4.1.318.1.1.1.9.2.3.1.7.1.1.2", "", SU_FLAG_OK|SU_FLAG_NEGINVALID, NULL }, - { "input.L3.current.maximum", 0, 0.1, ".1.3.6.1.4.1.318.1.1.1.9.2.3.1.7.1.1.3", "", SU_FLAG_OK|SU_FLAG_NEGINVALID, NULL }, - { "input.L1.current.minimum", 0, 0.1, ".1.3.6.1.4.1.318.1.1.1.9.2.3.1.8.1.1.1", "", SU_FLAG_OK|SU_FLAG_NEGINVALID, NULL }, - { "input.L2.current.minimum", 0, 0.1, ".1.3.6.1.4.1.318.1.1.1.9.2.3.1.8.1.1.2", "", SU_FLAG_OK|SU_FLAG_NEGINVALID, NULL }, - { "input.L3.current.minimum", 0, 0.1, ".1.3.6.1.4.1.318.1.1.1.9.2.3.1.8.1.1.3", "", SU_FLAG_OK|SU_FLAG_NEGINVALID, NULL }, - { "input.frequency", 0, 0.1, ".1.3.6.1.4.1.318.1.1.1.9.2.2.1.4.1", "", SU_FLAG_OK|SU_FLAG_NEGINVALID|SU_FLAG_UNIQUE, NULL }, - { "input.frequency", 0, 0.1, ".1.3.6.1.4.1.318.1.1.1.3.3.4.0", "", SU_FLAG_OK|SU_FLAG_NEGINVALID|SU_FLAG_UNIQUE, NULL }, - { "input.frequency", 0, 1, ".1.3.6.1.4.1.318.1.1.1.3.2.4.0", "", SU_FLAG_OK, NULL }, - { "input.transfer.low", ST_FLAG_STRING | ST_FLAG_RW, 3, ".1.3.6.1.4.1.318.1.1.1.5.2.3.0", "", SU_TYPE_INT | SU_FLAG_OK, NULL }, - { "input.transfer.high", ST_FLAG_STRING | ST_FLAG_RW, 3, ".1.3.6.1.4.1.318.1.1.1.5.2.2.0", "", SU_TYPE_INT | SU_FLAG_OK, NULL }, - { "input.transfer.reason", ST_FLAG_STRING, 1, APCC_OID_TRANSFERREASON, "", SU_TYPE_INT | SU_FLAG_OK, apcc_transfer_reasons }, - { "input.sensitivity", ST_FLAG_STRING | ST_FLAG_RW, 1, APCC_OID_SENSITIVITY, "", SU_TYPE_INT | SU_FLAG_OK, apcc_sensitivity_modes }, - { "ups.power", 0, 1, ".1.3.6.1.4.1.318.1.1.1.4.2.9.0", "", SU_FLAG_OK, NULL }, - { "ups.realpower", 0, 1, ".1.3.6.1.4.1.318.1.1.1.4.2.8.0", "", SU_FLAG_OK, NULL }, - { "ups.status", ST_FLAG_STRING, SU_INFOSIZE, APCC_OID_POWER_STATUS, "OFF", - SU_FLAG_OK | SU_STATUS_PWR, apcc_pwr_info }, - { "ups.status", ST_FLAG_STRING, SU_INFOSIZE, APCC_OID_BATT_STATUS, "", - SU_FLAG_OK | SU_STATUS_BATT, apcc_batt_info }, - { "ups.status", ST_FLAG_STRING, SU_INFOSIZE, APCC_OID_CAL_RESULTS, "", - SU_FLAG_OK | SU_STATUS_CAL, apcc_cal_info }, - { "ups.status", ST_FLAG_STRING, SU_INFOSIZE, APCC_OID_NEEDREPLBATT, "", - SU_FLAG_OK | SU_STATUS_RB, apcc_battrepl_info }, - { "ups.temperature", 0, 0.1, ".1.3.6.1.4.1.318.1.1.1.2.3.2.0", "", SU_FLAG_OK|SU_FLAG_UNIQUE, NULL }, - { "ups.temperature", 0, 1, ".1.3.6.1.4.1.318.1.1.1.2.2.2.0", "", SU_FLAG_OK, NULL }, - { "ups.load", 0, 0.1, ".1.3.6.1.4.1.318.1.1.1.4.3.3.0", "", SU_FLAG_OK|SU_FLAG_NEGINVALID|SU_FLAG_UNIQUE, NULL }, - { "ups.load", 0, 1, ".1.3.6.1.4.1.318.1.1.1.4.2.3.0", "", SU_FLAG_OK, NULL }, - { "ups.firmware", ST_FLAG_STRING, 16, ".1.3.6.1.4.1.318.1.1.1.1.2.1.0", "", SU_FLAG_STATIC | SU_FLAG_OK, NULL }, - { "ups.delay.shutdown", ST_FLAG_RW, 3, ".1.3.6.1.4.1.318.1.1.1.5.2.10.0", "", SU_TYPE_TIME | SU_FLAG_OK, NULL }, - { "ups.delay.start", ST_FLAG_RW, 3, ".1.3.6.1.4.1.318.1.1.1.5.2.9.0", "", SU_TYPE_TIME | SU_FLAG_OK, NULL }, - { "battery.charge", 0, 0.1, ".1.3.6.1.4.1.318.1.1.1.2.3.1.0", "", SU_FLAG_OK|SU_FLAG_NEGINVALID|SU_FLAG_UNIQUE, NULL }, - { "battery.charge", 0, 1, ".1.3.6.1.4.1.318.1.1.1.2.2.1.0", "", SU_FLAG_OK, NULL }, - { "battery.charge.restart", ST_FLAG_STRING | ST_FLAG_RW, 3, ".1.3.6.1.4.1.318.1.1.1.5.2.6.0", "", SU_TYPE_INT | SU_FLAG_OK, NULL }, - { "battery.runtime", 0, 1, ".1.3.6.1.4.1.318.1.1.1.2.2.3.0", "", SU_FLAG_OK, NULL }, - { "battery.runtime.low", ST_FLAG_STRING | ST_FLAG_RW, 3, ".1.3.6.1.4.1.318.1.1.1.5.2.8.0", "", SU_FLAG_OK, NULL }, - { "battery.voltage", 0, 0.1, ".1.3.6.1.4.1.318.1.1.1.2.3.4.0", "", SU_FLAG_OK|SU_FLAG_NEGINVALID|SU_FLAG_UNIQUE, NULL }, - { "battery.voltage", 0, 1, ".1.3.6.1.4.1.318.1.1.1.2.2.8.0", "", SU_FLAG_OK, NULL }, - { "battery.voltage.nominal", 0, 1, ".1.3.6.1.4.1.318.1.1.1.2.2.7.0", "", SU_FLAG_OK, NULL }, - { "battery.current", 0, 0.1, ".1.3.6.1.4.1.318.1.1.1.2.3.5.0", "", SU_FLAG_OK|SU_FLAG_UNIQUE, NULL }, - { "battery.current", 0, 1, ".1.3.6.1.4.1.318.1.1.1.2.2.9.0", "", SU_FLAG_OK, NULL }, - { "battery.current.total", 0, 0.1, ".1.3.6.1.4.1.318.1.1.1.2.3.6.0", "", SU_FLAG_OK, NULL }, - { "battery.packs", 0, 1, ".1.3.6.1.4.1.318.1.1.1.2.2.5.0", "", SU_FLAG_OK, NULL }, - { "battery.packs.bad", 0, 1, ".1.3.6.1.4.1.318.1.1.1.2.2.6.0", "", SU_FLAG_OK, NULL }, - { "battery.date", ST_FLAG_STRING | ST_FLAG_RW, 8, ".1.3.6.1.4.1.318.1.1.1.2.1.3.0", "", SU_FLAG_OK | SU_FLAG_STATIC, NULL }, - { "ups.id", ST_FLAG_STRING | ST_FLAG_RW, 8, ".1.3.6.1.4.1.318.1.1.1.1.1.2.0", "", SU_FLAG_OK | SU_FLAG_STATIC, NULL }, - { "ups.test.result", ST_FLAG_STRING, SU_INFOSIZE, APCC_OID_TESTDIAGRESULTS, "", SU_FLAG_OK, apcc_testdiag_results }, - { "ups.test.date", ST_FLAG_STRING | ST_FLAG_RW, 8, ".1.3.6.1.4.1.318.1.1.1.7.2.4.0", "", SU_FLAG_OK | SU_FLAG_STATIC, NULL }, - { "output.voltage", 0, 0.1, ".1.3.6.1.4.1.318.1.1.1.4.3.1.0", "", SU_FLAG_OK | SU_FLAG_UNIQUE, NULL }, - { "output.voltage", 0, 1, ".1.3.6.1.4.1.318.1.1.1.4.2.1.0", "", SU_FLAG_OK, NULL }, - { "output.phases", ST_FLAG_STRING, 2, ".1.3.6.1.4.1.318.1.1.1.9.3.2.1.2.1", "", SU_FLAG_STATIC | SU_FLAG_OK, NULL }, - { "output.frequency", 0, 0.1, ".1.3.6.1.4.1.318.1.1.1.9.3.2.1.4.1", "", SU_FLAG_OK|SU_FLAG_NEGINVALID|SU_FLAG_UNIQUE, NULL }, - { "output.frequency", 0, 0.1, ".1.3.6.1.4.1.318.1.1.1.4.3.2.0", "", SU_FLAG_OK|SU_FLAG_NEGINVALID|SU_FLAG_UNIQUE, NULL }, - { "output.frequency", 0, 1, ".1.3.6.1.4.1.318.1.1.1.4.2.2.0", "", SU_FLAG_OK, NULL }, - { "output.current", 0, 0.1, ".1.3.6.1.4.1.318.1.1.1.4.3.4.0", "", SU_FLAG_OK|SU_FLAG_NEGINVALID|SU_FLAG_UNIQUE, NULL }, - { "output.current", 0, 1, ".1.3.6.1.4.1.318.1.1.1.4.2.4.0", "", SU_FLAG_OK, NULL }, - { "output.L1-L2.voltage", 0, 1, ".1.3.6.1.4.1.318.1.1.1.9.3.3.1.3.1.1.1", "", SU_FLAG_OK|SU_FLAG_NEGINVALID, NULL }, - { "output.L2-L3.voltage", 0, 1, ".1.3.6.1.4.1.318.1.1.1.9.3.3.1.3.1.1.2", "", SU_FLAG_OK|SU_FLAG_NEGINVALID, NULL }, - { "output.L3-L1.voltage", 0, 1, ".1.3.6.1.4.1.318.1.1.1.9.3.3.1.3.1.1.3", "", SU_FLAG_OK|SU_FLAG_NEGINVALID, NULL }, - { "output.L1.current", 0, 0.1, ".1.3.6.1.4.1.318.1.1.1.9.3.3.1.4.1.1.1", "", SU_FLAG_OK|SU_FLAG_NEGINVALID, NULL }, - { "output.L2.current", 0, 0.1, ".1.3.6.1.4.1.318.1.1.1.9.3.3.1.4.1.1.2", "", SU_FLAG_OK|SU_FLAG_NEGINVALID, NULL }, - { "output.L3.current", 0, 0.1, ".1.3.6.1.4.1.318.1.1.1.9.3.3.1.4.1.1.3", "", SU_FLAG_OK|SU_FLAG_NEGINVALID, NULL }, - { "output.L1.current.maximum", 0, 0.1, ".1.3.6.1.4.1.318.1.1.1.9.3.3.1.5.1.1.1", "", SU_FLAG_OK|SU_FLAG_NEGINVALID, NULL }, - { "output.L2.current.maximum", 0, 0.1, ".1.3.6.1.4.1.318.1.1.1.9.3.3.1.5.1.1.2", "", SU_FLAG_OK|SU_FLAG_NEGINVALID, NULL }, - { "output.L3.current.maximum", 0, 0.1, ".1.3.6.1.4.1.318.1.1.1.9.3.3.1.5.1.1.3", "", SU_FLAG_OK|SU_FLAG_NEGINVALID, NULL }, - { "output.L1.current.minimum", 0, 0.1, ".1.3.6.1.4.1.318.1.1.1.9.3.3.1.6.1.1.1", "", SU_FLAG_OK|SU_FLAG_NEGINVALID, NULL }, - { "output.L2.current.minimum", 0, 0.1, ".1.3.6.1.4.1.318.1.1.1.9.3.3.1.6.1.1.2", "", SU_FLAG_OK|SU_FLAG_NEGINVALID, NULL }, - { "output.L3.current.minimum", 0, 0.1, ".1.3.6.1.4.1.318.1.1.1.9.3.3.1.6.1.1.3", "", SU_FLAG_OK|SU_FLAG_NEGINVALID, NULL }, - { "output.L1.power", 0, 1, ".1.3.6.1.4.1.318.1.1.1.9.3.3.1.7.1.1.1", "", SU_FLAG_OK|SU_FLAG_NEGINVALID, NULL }, - { "output.L2.power", 0, 1, ".1.3.6.1.4.1.318.1.1.1.9.3.3.1.7.1.1.2", "", SU_FLAG_OK|SU_FLAG_NEGINVALID, NULL }, - { "output.L3.power", 0, 1, ".1.3.6.1.4.1.318.1.1.1.9.3.3.1.7.1.1.3", "", SU_FLAG_OK|SU_FLAG_NEGINVALID, NULL }, - { "output.L1.power.maximum", 0, 1, ".1.3.6.1.4.1.318.1.1.1.9.3.3.1.8.1.1.1", "", SU_FLAG_OK|SU_FLAG_NEGINVALID, NULL }, - { "output.L2.power.maximum", 0, 1, ".1.3.6.1.4.1.318.1.1.1.9.3.3.1.8.1.1.2", "", SU_FLAG_OK|SU_FLAG_NEGINVALID, NULL }, - { "output.L3.power.maximum", 0, 1, ".1.3.6.1.4.1.318.1.1.1.9.3.3.1.8.1.1.3", "", SU_FLAG_OK|SU_FLAG_NEGINVALID, NULL }, - { "output.L1.power.minimum", 0, 1, ".1.3.6.1.4.1.318.1.1.1.9.3.3.1.9.1.1.1", "", SU_FLAG_OK|SU_FLAG_NEGINVALID, NULL }, - { "output.L2.power.minimum", 0, 1, ".1.3.6.1.4.1.318.1.1.1.9.3.3.1.9.1.1.2", "", SU_FLAG_OK|SU_FLAG_NEGINVALID, NULL }, - { "output.L3.power.minimum", 0, 1, ".1.3.6.1.4.1.318.1.1.1.9.3.3.1.9.1.1.3", "", SU_FLAG_OK|SU_FLAG_NEGINVALID, NULL }, - { "output.L1.power.percent", 0, 1, ".1.3.6.1.4.1.318.1.1.1.9.3.3.1.10.1.1.1", "", SU_FLAG_OK|SU_FLAG_NEGINVALID, NULL }, - { "output.L2.power.percent", 0, 1, ".1.3.6.1.4.1.318.1.1.1.9.3.3.1.10.1.1.2", "", SU_FLAG_OK|SU_FLAG_NEGINVALID, NULL }, - { "output.L3.power.percent", 0, 1, ".1.3.6.1.4.1.318.1.1.1.9.3.3.1.10.1.1.3", "", SU_FLAG_OK|SU_FLAG_NEGINVALID, NULL }, - { "output.L1.power.maximum.percent", 0, 1, ".1.3.6.1.4.1.318.1.1.1.9.3.3.1.11.1.1.1", "", SU_FLAG_OK|SU_FLAG_NEGINVALID, NULL }, - { "output.L2.power.maximum.percent", 0, 1, ".1.3.6.1.4.1.318.1.1.1.9.3.3.1.11.1.1.2", "", SU_FLAG_OK|SU_FLAG_NEGINVALID, NULL }, - { "output.L3.power.maximum.percent", 0, 1, ".1.3.6.1.4.1.318.1.1.1.9.3.3.1.11.1.1.3", "", SU_FLAG_OK|SU_FLAG_NEGINVALID, NULL }, - { "output.L1.power.minimum.percent", 0, 1, ".1.3.6.1.4.1.318.1.1.1.9.3.3.1.12.1.1.1", "", SU_FLAG_OK|SU_FLAG_NEGINVALID, NULL }, - { "output.L2.power.minimum.percent", 0, 1, ".1.3.6.1.4.1.318.1.1.1.9.3.3.1.12.1.1.2", "", SU_FLAG_OK|SU_FLAG_NEGINVALID, NULL }, - { "output.L3.power.minimum.percent", 0, 1, ".1.3.6.1.4.1.318.1.1.1.9.3.3.1.12.1.1.3", "", SU_FLAG_OK|SU_FLAG_NEGINVALID, NULL }, - { "output.voltage.nominal", ST_FLAG_STRING | ST_FLAG_RW, 3, ".1.3.6.1.4.1.318.1.1.1.5.2.1.0", "", SU_TYPE_INT | SU_FLAG_OK, NULL }, + snmp_info_default("ups.mfr", ST_FLAG_STRING, SU_INFOSIZE, NULL, "APC", + SU_FLAG_STATIC | SU_FLAG_ABSENT | SU_FLAG_OK, NULL), + snmp_info_default("ups.model", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.1.1.1.1.1.0", "Generic Powernet SNMP device", SU_FLAG_STATIC | SU_FLAG_OK, NULL), + snmp_info_default("ups.serial", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.1.1.1.2.3.0", "", SU_FLAG_STATIC | SU_FLAG_OK, NULL), + snmp_info_default("ups.mfr.date", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.1.1.1.2.2.0", "", SU_FLAG_OK | SU_FLAG_STATIC, NULL), + snmp_info_default("input.voltage", 0, 0.1, ".1.3.6.1.4.1.318.1.1.1.3.3.1.0", "", SU_FLAG_OK | SU_FLAG_NEGINVALID | SU_FLAG_UNIQUE, NULL), + snmp_info_default("input.voltage.maximum", 0, 0.1, ".1.3.6.1.4.1.318.1.1.1.3.3.2.0", "", SU_FLAG_OK | SU_FLAG_NEGINVALID | SU_FLAG_UNIQUE, NULL), + snmp_info_default("input.voltage.minimum", 0, 0.1, ".1.3.6.1.4.1.318.1.1.1.3.3.3.0", "", SU_FLAG_OK | SU_FLAG_NEGINVALID | SU_FLAG_UNIQUE, NULL), + snmp_info_default("input.voltage", 0, 1, ".1.3.6.1.4.1.318.1.1.1.3.2.1.0", "", SU_FLAG_OK, NULL), + snmp_info_default("input.voltage.maximum", 0, 1, ".1.3.6.1.4.1.318.1.1.1.3.2.2.0", "", SU_FLAG_OK, NULL), + snmp_info_default("input.voltage.minimum", 0, 1, ".1.3.6.1.4.1.318.1.1.1.3.2.3.0", "", SU_FLAG_OK, NULL), + snmp_info_default("input.phases", ST_FLAG_STRING, 2, ".1.3.6.1.4.1.318.1.1.1.9.2.2.1.2.1", "", SU_FLAG_STATIC | SU_FLAG_OK, NULL), + snmp_info_default("input.L1-L2.voltage", 0, 1, ".1.3.6.1.4.1.318.1.1.1.9.2.3.1.3.1.1.1", "", SU_FLAG_OK|SU_FLAG_NEGINVALID, NULL), + snmp_info_default("input.L2-L3.voltage", 0, 1, ".1.3.6.1.4.1.318.1.1.1.9.2.3.1.3.1.1.2", "", SU_FLAG_OK|SU_FLAG_NEGINVALID, NULL), + snmp_info_default("input.L3-L1.voltage", 0, 1, ".1.3.6.1.4.1.318.1.1.1.9.2.3.1.3.1.1.3", "", SU_FLAG_OK|SU_FLAG_NEGINVALID, NULL), + snmp_info_default("input.L1-L2.voltage.maximum", 0, 1, ".1.3.6.1.4.1.318.1.1.1.9.2.3.1.4.1.1.1", "", SU_FLAG_OK|SU_FLAG_NEGINVALID, NULL), + snmp_info_default("input.L2-L3.voltage.maximum", 0, 1, ".1.3.6.1.4.1.318.1.1.1.9.2.3.1.4.1.1.2", "", SU_FLAG_OK|SU_FLAG_NEGINVALID, NULL), + snmp_info_default("input.L3-L1.voltage.maximum", 0, 1, ".1.3.6.1.4.1.318.1.1.1.9.2.3.1.4.1.1.3", "", SU_FLAG_OK|SU_FLAG_NEGINVALID, NULL), + snmp_info_default("input.L1-L2.voltage.minimum", 0, 1, ".1.3.6.1.4.1.318.1.1.1.9.2.3.1.5.1.1.1", "", SU_FLAG_OK|SU_FLAG_NEGINVALID, NULL), + snmp_info_default("input.L2-L3.voltage.minimum", 0, 1, ".1.3.6.1.4.1.318.1.1.1.9.2.3.1.5.1.1.2", "", SU_FLAG_OK|SU_FLAG_NEGINVALID, NULL), + snmp_info_default("input.L3-L1.voltage.minimum", 0, 1, ".1.3.6.1.4.1.318.1.1.1.9.2.3.1.5.1.1.3", "", SU_FLAG_OK|SU_FLAG_NEGINVALID, NULL), + snmp_info_default("input.L1.current", 0, 0.1, ".1.3.6.1.4.1.318.1.1.1.9.2.3.1.6.1.1.1", "", SU_FLAG_OK|SU_FLAG_NEGINVALID, NULL), + snmp_info_default("input.L2.current", 0, 0.1, ".1.3.6.1.4.1.318.1.1.1.9.2.3.1.6.1.1.2", "", SU_FLAG_OK|SU_FLAG_NEGINVALID, NULL), + snmp_info_default("input.L3.current", 0, 0.1, ".1.3.6.1.4.1.318.1.1.1.9.2.3.1.6.1.1.3", "", SU_FLAG_OK|SU_FLAG_NEGINVALID, NULL), + snmp_info_default("input.L1.current.maximum", 0, 0.1, ".1.3.6.1.4.1.318.1.1.1.9.2.3.1.7.1.1.1", "", SU_FLAG_OK|SU_FLAG_NEGINVALID, NULL), + snmp_info_default("input.L2.current.maximum", 0, 0.1, ".1.3.6.1.4.1.318.1.1.1.9.2.3.1.7.1.1.2", "", SU_FLAG_OK|SU_FLAG_NEGINVALID, NULL), + snmp_info_default("input.L3.current.maximum", 0, 0.1, ".1.3.6.1.4.1.318.1.1.1.9.2.3.1.7.1.1.3", "", SU_FLAG_OK|SU_FLAG_NEGINVALID, NULL), + snmp_info_default("input.L1.current.minimum", 0, 0.1, ".1.3.6.1.4.1.318.1.1.1.9.2.3.1.8.1.1.1", "", SU_FLAG_OK|SU_FLAG_NEGINVALID, NULL), + snmp_info_default("input.L2.current.minimum", 0, 0.1, ".1.3.6.1.4.1.318.1.1.1.9.2.3.1.8.1.1.2", "", SU_FLAG_OK|SU_FLAG_NEGINVALID, NULL), + snmp_info_default("input.L3.current.minimum", 0, 0.1, ".1.3.6.1.4.1.318.1.1.1.9.2.3.1.8.1.1.3", "", SU_FLAG_OK|SU_FLAG_NEGINVALID, NULL), + snmp_info_default("input.frequency", 0, 0.1, ".1.3.6.1.4.1.318.1.1.1.9.2.2.1.4.1", "", SU_FLAG_OK|SU_FLAG_NEGINVALID|SU_FLAG_UNIQUE, NULL), + snmp_info_default("input.frequency", 0, 0.1, ".1.3.6.1.4.1.318.1.1.1.3.3.4.0", "", SU_FLAG_OK|SU_FLAG_NEGINVALID|SU_FLAG_UNIQUE, NULL), + snmp_info_default("input.frequency", 0, 1, ".1.3.6.1.4.1.318.1.1.1.3.2.4.0", "", SU_FLAG_OK, NULL), + snmp_info_default("input.transfer.low", ST_FLAG_STRING | ST_FLAG_RW, 3, ".1.3.6.1.4.1.318.1.1.1.5.2.3.0", "", SU_TYPE_INT | SU_FLAG_OK, NULL), + snmp_info_default("input.transfer.high", ST_FLAG_STRING | ST_FLAG_RW, 3, ".1.3.6.1.4.1.318.1.1.1.5.2.2.0", "", SU_TYPE_INT | SU_FLAG_OK, NULL), + snmp_info_default("input.transfer.reason", ST_FLAG_STRING, 1, APCC_OID_TRANSFERREASON, "", SU_TYPE_INT | SU_FLAG_OK, apcc_transfer_reasons), + snmp_info_default("input.sensitivity", ST_FLAG_STRING | ST_FLAG_RW, 1, APCC_OID_SENSITIVITY, "", SU_TYPE_INT | SU_FLAG_OK, apcc_sensitivity_modes), + snmp_info_default("ups.power", 0, 1, ".1.3.6.1.4.1.318.1.1.1.4.2.9.0", "", SU_FLAG_OK, NULL), + snmp_info_default("ups.realpower", 0, 1, ".1.3.6.1.4.1.318.1.1.1.4.2.8.0", "", SU_FLAG_OK, NULL), + snmp_info_default("ups.status", ST_FLAG_STRING, SU_INFOSIZE, APCC_OID_POWER_STATUS, "OFF", + SU_FLAG_OK | SU_STATUS_PWR, apcc_pwr_info), + snmp_info_default("ups.status", ST_FLAG_STRING, SU_INFOSIZE, APCC_OID_BATT_STATUS, "", + SU_FLAG_OK | SU_STATUS_BATT, apcc_batt_info), + snmp_info_default("ups.status", ST_FLAG_STRING, SU_INFOSIZE, APCC_OID_CAL_RESULTS, "", + SU_FLAG_OK | SU_STATUS_CAL, apcc_cal_info), + snmp_info_default("ups.status", ST_FLAG_STRING, SU_INFOSIZE, APCC_OID_NEEDREPLBATT, "", + SU_FLAG_OK | SU_STATUS_RB, apcc_battrepl_info), + snmp_info_default("ups.temperature", 0, 0.1, ".1.3.6.1.4.1.318.1.1.1.2.3.2.0", "", SU_FLAG_OK|SU_FLAG_UNIQUE, NULL), + snmp_info_default("ups.temperature", 0, 1, ".1.3.6.1.4.1.318.1.1.1.2.2.2.0", "", SU_FLAG_OK, NULL), + snmp_info_default("ups.load", 0, 0.1, ".1.3.6.1.4.1.318.1.1.1.4.3.3.0", "", SU_FLAG_OK|SU_FLAG_NEGINVALID|SU_FLAG_UNIQUE, NULL), + snmp_info_default("ups.load", 0, 1, ".1.3.6.1.4.1.318.1.1.1.4.2.3.0", "", SU_FLAG_OK, NULL), + snmp_info_default("ups.firmware", ST_FLAG_STRING, 16, ".1.3.6.1.4.1.318.1.1.1.1.2.1.0", "", SU_FLAG_STATIC | SU_FLAG_OK, NULL), + snmp_info_default("ups.delay.shutdown", ST_FLAG_RW, 3, ".1.3.6.1.4.1.318.1.1.1.5.2.10.0", "", SU_TYPE_TIME | SU_FLAG_OK, NULL), + snmp_info_default("ups.delay.start", ST_FLAG_RW, 3, ".1.3.6.1.4.1.318.1.1.1.5.2.9.0", "", SU_TYPE_TIME | SU_FLAG_OK, NULL), + snmp_info_default("battery.charge", 0, 0.1, ".1.3.6.1.4.1.318.1.1.1.2.3.1.0", "", SU_FLAG_OK|SU_FLAG_NEGINVALID|SU_FLAG_UNIQUE, NULL), + snmp_info_default("battery.charge", 0, 1, ".1.3.6.1.4.1.318.1.1.1.2.2.1.0", "", SU_FLAG_OK, NULL), + snmp_info_default("battery.charge.restart", ST_FLAG_STRING | ST_FLAG_RW, 3, ".1.3.6.1.4.1.318.1.1.1.5.2.6.0", "", SU_TYPE_INT | SU_FLAG_OK, NULL), + snmp_info_default("battery.runtime", 0, 1, ".1.3.6.1.4.1.318.1.1.1.2.2.3.0", "", SU_FLAG_OK, NULL), + snmp_info_default("battery.runtime.low", ST_FLAG_STRING | ST_FLAG_RW, 3, ".1.3.6.1.4.1.318.1.1.1.5.2.8.0", "", SU_FLAG_OK, NULL), + snmp_info_default("battery.voltage", 0, 0.1, ".1.3.6.1.4.1.318.1.1.1.2.3.4.0", "", SU_FLAG_OK|SU_FLAG_NEGINVALID|SU_FLAG_UNIQUE, NULL), + snmp_info_default("battery.voltage", 0, 1, ".1.3.6.1.4.1.318.1.1.1.2.2.8.0", "", SU_FLAG_OK, NULL), + snmp_info_default("battery.voltage.nominal", 0, 1, ".1.3.6.1.4.1.318.1.1.1.2.2.7.0", "", SU_FLAG_OK, NULL), + snmp_info_default("battery.current", 0, 0.1, ".1.3.6.1.4.1.318.1.1.1.2.3.5.0", "", SU_FLAG_OK|SU_FLAG_UNIQUE, NULL), + snmp_info_default("battery.current", 0, 1, ".1.3.6.1.4.1.318.1.1.1.2.2.9.0", "", SU_FLAG_OK, NULL), + snmp_info_default("battery.current.total", 0, 0.1, ".1.3.6.1.4.1.318.1.1.1.2.3.6.0", "", SU_FLAG_OK, NULL), + snmp_info_default("battery.packs", 0, 1, ".1.3.6.1.4.1.318.1.1.1.2.2.5.0", "", SU_FLAG_OK, NULL), + snmp_info_default("battery.packs.bad", 0, 1, ".1.3.6.1.4.1.318.1.1.1.2.2.6.0", "", SU_FLAG_OK, NULL), + snmp_info_default("battery.date", ST_FLAG_STRING | ST_FLAG_RW, 8, ".1.3.6.1.4.1.318.1.1.1.2.1.3.0", "", SU_FLAG_OK | SU_FLAG_STATIC, NULL), + snmp_info_default("ups.id", ST_FLAG_STRING | ST_FLAG_RW, 8, ".1.3.6.1.4.1.318.1.1.1.1.1.2.0", "", SU_FLAG_OK | SU_FLAG_STATIC, NULL), + snmp_info_default("ups.test.result", ST_FLAG_STRING, SU_INFOSIZE, APCC_OID_TESTDIAGRESULTS, "", SU_FLAG_OK, apcc_testdiag_results), + snmp_info_default("ups.test.date", ST_FLAG_STRING | ST_FLAG_RW, 8, ".1.3.6.1.4.1.318.1.1.1.7.2.4.0", "", SU_FLAG_OK | SU_FLAG_STATIC, NULL), + snmp_info_default("output.voltage", 0, 0.1, ".1.3.6.1.4.1.318.1.1.1.4.3.1.0", "", SU_FLAG_OK | SU_FLAG_UNIQUE, NULL), + snmp_info_default("output.voltage", 0, 1, ".1.3.6.1.4.1.318.1.1.1.4.2.1.0", "", SU_FLAG_OK, NULL), + snmp_info_default("output.phases", ST_FLAG_STRING, 2, ".1.3.6.1.4.1.318.1.1.1.9.3.2.1.2.1", "", SU_FLAG_STATIC | SU_FLAG_OK, NULL), + snmp_info_default("output.frequency", 0, 0.1, ".1.3.6.1.4.1.318.1.1.1.9.3.2.1.4.1", "", SU_FLAG_OK|SU_FLAG_NEGINVALID|SU_FLAG_UNIQUE, NULL), + snmp_info_default("output.frequency", 0, 0.1, ".1.3.6.1.4.1.318.1.1.1.4.3.2.0", "", SU_FLAG_OK|SU_FLAG_NEGINVALID|SU_FLAG_UNIQUE, NULL), + snmp_info_default("output.frequency", 0, 1, ".1.3.6.1.4.1.318.1.1.1.4.2.2.0", "", SU_FLAG_OK, NULL), + snmp_info_default("output.current", 0, 0.1, ".1.3.6.1.4.1.318.1.1.1.4.3.4.0", "", SU_FLAG_OK|SU_FLAG_NEGINVALID|SU_FLAG_UNIQUE, NULL), + snmp_info_default("output.current", 0, 1, ".1.3.6.1.4.1.318.1.1.1.4.2.4.0", "", SU_FLAG_OK, NULL), + snmp_info_default("output.L1-L2.voltage", 0, 1, ".1.3.6.1.4.1.318.1.1.1.9.3.3.1.3.1.1.1", "", SU_FLAG_OK|SU_FLAG_NEGINVALID, NULL), + snmp_info_default("output.L2-L3.voltage", 0, 1, ".1.3.6.1.4.1.318.1.1.1.9.3.3.1.3.1.1.2", "", SU_FLAG_OK|SU_FLAG_NEGINVALID, NULL), + snmp_info_default("output.L3-L1.voltage", 0, 1, ".1.3.6.1.4.1.318.1.1.1.9.3.3.1.3.1.1.3", "", SU_FLAG_OK|SU_FLAG_NEGINVALID, NULL), + snmp_info_default("output.L1.current", 0, 0.1, ".1.3.6.1.4.1.318.1.1.1.9.3.3.1.4.1.1.1", "", SU_FLAG_OK|SU_FLAG_NEGINVALID, NULL), + snmp_info_default("output.L2.current", 0, 0.1, ".1.3.6.1.4.1.318.1.1.1.9.3.3.1.4.1.1.2", "", SU_FLAG_OK|SU_FLAG_NEGINVALID, NULL), + snmp_info_default("output.L3.current", 0, 0.1, ".1.3.6.1.4.1.318.1.1.1.9.3.3.1.4.1.1.3", "", SU_FLAG_OK|SU_FLAG_NEGINVALID, NULL), + snmp_info_default("output.L1.current.maximum", 0, 0.1, ".1.3.6.1.4.1.318.1.1.1.9.3.3.1.5.1.1.1", "", SU_FLAG_OK|SU_FLAG_NEGINVALID, NULL), + snmp_info_default("output.L2.current.maximum", 0, 0.1, ".1.3.6.1.4.1.318.1.1.1.9.3.3.1.5.1.1.2", "", SU_FLAG_OK|SU_FLAG_NEGINVALID, NULL), + snmp_info_default("output.L3.current.maximum", 0, 0.1, ".1.3.6.1.4.1.318.1.1.1.9.3.3.1.5.1.1.3", "", SU_FLAG_OK|SU_FLAG_NEGINVALID, NULL), + snmp_info_default("output.L1.current.minimum", 0, 0.1, ".1.3.6.1.4.1.318.1.1.1.9.3.3.1.6.1.1.1", "", SU_FLAG_OK|SU_FLAG_NEGINVALID, NULL), + snmp_info_default("output.L2.current.minimum", 0, 0.1, ".1.3.6.1.4.1.318.1.1.1.9.3.3.1.6.1.1.2", "", SU_FLAG_OK|SU_FLAG_NEGINVALID, NULL), + snmp_info_default("output.L3.current.minimum", 0, 0.1, ".1.3.6.1.4.1.318.1.1.1.9.3.3.1.6.1.1.3", "", SU_FLAG_OK|SU_FLAG_NEGINVALID, NULL), + snmp_info_default("output.L1.power", 0, 1, ".1.3.6.1.4.1.318.1.1.1.9.3.3.1.7.1.1.1", "", SU_FLAG_OK|SU_FLAG_NEGINVALID, NULL), + snmp_info_default("output.L2.power", 0, 1, ".1.3.6.1.4.1.318.1.1.1.9.3.3.1.7.1.1.2", "", SU_FLAG_OK|SU_FLAG_NEGINVALID, NULL), + snmp_info_default("output.L3.power", 0, 1, ".1.3.6.1.4.1.318.1.1.1.9.3.3.1.7.1.1.3", "", SU_FLAG_OK|SU_FLAG_NEGINVALID, NULL), + snmp_info_default("output.L1.power.maximum", 0, 1, ".1.3.6.1.4.1.318.1.1.1.9.3.3.1.8.1.1.1", "", SU_FLAG_OK|SU_FLAG_NEGINVALID, NULL), + snmp_info_default("output.L2.power.maximum", 0, 1, ".1.3.6.1.4.1.318.1.1.1.9.3.3.1.8.1.1.2", "", SU_FLAG_OK|SU_FLAG_NEGINVALID, NULL), + snmp_info_default("output.L3.power.maximum", 0, 1, ".1.3.6.1.4.1.318.1.1.1.9.3.3.1.8.1.1.3", "", SU_FLAG_OK|SU_FLAG_NEGINVALID, NULL), + snmp_info_default("output.L1.power.minimum", 0, 1, ".1.3.6.1.4.1.318.1.1.1.9.3.3.1.9.1.1.1", "", SU_FLAG_OK|SU_FLAG_NEGINVALID, NULL), + snmp_info_default("output.L2.power.minimum", 0, 1, ".1.3.6.1.4.1.318.1.1.1.9.3.3.1.9.1.1.2", "", SU_FLAG_OK|SU_FLAG_NEGINVALID, NULL), + snmp_info_default("output.L3.power.minimum", 0, 1, ".1.3.6.1.4.1.318.1.1.1.9.3.3.1.9.1.1.3", "", SU_FLAG_OK|SU_FLAG_NEGINVALID, NULL), + snmp_info_default("output.L1.power.percent", 0, 1, ".1.3.6.1.4.1.318.1.1.1.9.3.3.1.10.1.1.1", "", SU_FLAG_OK|SU_FLAG_NEGINVALID, NULL), + snmp_info_default("output.L2.power.percent", 0, 1, ".1.3.6.1.4.1.318.1.1.1.9.3.3.1.10.1.1.2", "", SU_FLAG_OK|SU_FLAG_NEGINVALID, NULL), + snmp_info_default("output.L3.power.percent", 0, 1, ".1.3.6.1.4.1.318.1.1.1.9.3.3.1.10.1.1.3", "", SU_FLAG_OK|SU_FLAG_NEGINVALID, NULL), + snmp_info_default("output.L1.power.maximum.percent", 0, 1, ".1.3.6.1.4.1.318.1.1.1.9.3.3.1.11.1.1.1", "", SU_FLAG_OK|SU_FLAG_NEGINVALID, NULL), + snmp_info_default("output.L2.power.maximum.percent", 0, 1, ".1.3.6.1.4.1.318.1.1.1.9.3.3.1.11.1.1.2", "", SU_FLAG_OK|SU_FLAG_NEGINVALID, NULL), + snmp_info_default("output.L3.power.maximum.percent", 0, 1, ".1.3.6.1.4.1.318.1.1.1.9.3.3.1.11.1.1.3", "", SU_FLAG_OK|SU_FLAG_NEGINVALID, NULL), + snmp_info_default("output.L1.power.minimum.percent", 0, 1, ".1.3.6.1.4.1.318.1.1.1.9.3.3.1.12.1.1.1", "", SU_FLAG_OK|SU_FLAG_NEGINVALID, NULL), + snmp_info_default("output.L2.power.minimum.percent", 0, 1, ".1.3.6.1.4.1.318.1.1.1.9.3.3.1.12.1.1.2", "", SU_FLAG_OK|SU_FLAG_NEGINVALID, NULL), + snmp_info_default("output.L3.power.minimum.percent", 0, 1, ".1.3.6.1.4.1.318.1.1.1.9.3.3.1.12.1.1.3", "", SU_FLAG_OK|SU_FLAG_NEGINVALID, NULL), + snmp_info_default("output.voltage.nominal", ST_FLAG_STRING | ST_FLAG_RW, 3, ".1.3.6.1.4.1.318.1.1.1.5.2.1.0", "", SU_TYPE_INT | SU_FLAG_OK, NULL), /* Measure-UPS ambient variables */ /* Environmental sensors (AP9612TH and others) */ - { "ambient.temperature", 0, 1, ".1.3.6.1.4.1.318.1.1.2.1.1.0", "", SU_FLAG_OK, NULL }, - { "ambient.1.temperature.alarm.high", 0, 1, ".1.3.6.1.4.1.318.1.1.10.1.2.2.1.3.1", "", SU_FLAG_OK, NULL }, - { "ambient.1.temperature.alarm.low", 0, 1, ".1.3.6.1.4.1.318.1.1.10.1.2.2.1.4.1", "", SU_FLAG_OK, NULL }, - { "ambient.humidity", 0, 1, ".1.3.6.1.4.1.318.1.1.2.1.2.0", "", SU_FLAG_OK, NULL }, - { "ambient.1.humidity.alarm.high", 0, 1, ".1.3.6.1.4.1.318.1.1.10.1.2.2.1.6.1", "", SU_FLAG_OK, NULL }, - { "ambient.1.humidity.alarm.low", 0, 1, ".1.3.6.1.4.1.318.1.1.10.1.2.2.1.7.1", "", SU_FLAG_OK, NULL }, + snmp_info_default("ambient.temperature", 0, 1, ".1.3.6.1.4.1.318.1.1.2.1.1.0", "", SU_FLAG_OK, NULL), + snmp_info_default("ambient.1.temperature.alarm.high", 0, 1, ".1.3.6.1.4.1.318.1.1.10.1.2.2.1.3.1", "", SU_FLAG_OK, NULL), + snmp_info_default("ambient.1.temperature.alarm.low", 0, 1, ".1.3.6.1.4.1.318.1.1.10.1.2.2.1.4.1", "", SU_FLAG_OK, NULL), + snmp_info_default("ambient.humidity", 0, 1, ".1.3.6.1.4.1.318.1.1.2.1.2.0", "", SU_FLAG_OK, NULL), + snmp_info_default("ambient.1.humidity.alarm.high", 0, 1, ".1.3.6.1.4.1.318.1.1.10.1.2.2.1.6.1", "", SU_FLAG_OK, NULL), + snmp_info_default("ambient.1.humidity.alarm.low", 0, 1, ".1.3.6.1.4.1.318.1.1.10.1.2.2.1.7.1", "", SU_FLAG_OK, NULL), + + /* IEM ambient variables */ /* IEM: integrated environment monitor probe */ - { "ambient.temperature", 0, 1, APCC_OID_IEM_TEMP, "", SU_FLAG_OK, NULL }, - { "ambient.humidity", 0, 1, APCC_OID_IEM_HUMID, "", SU_FLAG_OK, NULL }, + snmp_info_default("ambient.temperature", 0, 1, APCC_OID_IEM_TEMP, "", SU_FLAG_OK, NULL), + snmp_info_default("ambient.humidity", 0, 1, APCC_OID_IEM_HUMID, "", SU_FLAG_OK, NULL), /* instant commands. */ - { "load.off", 0, 1, ".1.3.6.1.4.1.318.1.1.1.6.2.1.0", "2", SU_TYPE_CMD | SU_FLAG_OK, NULL }, - { "load.on", 0, 1, ".1.3.6.1.4.1.318.1.1.1.6.2.6.0", "2", SU_TYPE_CMD | SU_FLAG_OK, NULL }, - { "shutdown.stayoff", 0, 1, ".1.3.6.1.4.1.318.1.1.1.6.2.1.0", "3", SU_TYPE_CMD | SU_FLAG_OK, NULL }, + snmp_info_default("load.off", 0, 1, ".1.3.6.1.4.1.318.1.1.1.6.2.1.0", "2", SU_TYPE_CMD | SU_FLAG_OK, NULL), + snmp_info_default("load.on", 0, 1, ".1.3.6.1.4.1.318.1.1.1.6.2.6.0", "2", SU_TYPE_CMD | SU_FLAG_OK, NULL), + snmp_info_default("shutdown.stayoff", 0, 1, ".1.3.6.1.4.1.318.1.1.1.6.2.1.0", "3", SU_TYPE_CMD | SU_FLAG_OK, NULL), -/* { CMD_SDRET, 0, APCC_REBOOT_GRACEFUL, APCC_OID_REBOOT, "", SU_TYPE_CMD | SU_FLAG_OK, NULL }, */ +/* snmp_info_default(CMD_SDRET, 0, APCC_REBOOT_GRACEFUL, APCC_OID_REBOOT, "", SU_TYPE_CMD | SU_FLAG_OK, NULL), */ - { "shutdown.return", 0, 1, ".1.3.6.1.4.1.318.1.1.1.6.1.1.0", "2", SU_TYPE_CMD | SU_FLAG_OK, NULL }, - { "test.failure.start", 0, 1, ".1.3.6.1.4.1.318.1.1.1.6.2.4.0", "2", SU_TYPE_CMD | SU_FLAG_OK, NULL }, - { "test.panel.start", 0, 1, ".1.3.6.1.4.1.318.1.1.1.6.2.5.0", "2", SU_TYPE_CMD | SU_FLAG_OK, NULL }, - { "bypass.start", 0, 1, ".1.3.6.1.4.1.318.1.1.1.6.2.7.0", "2", SU_TYPE_CMD | SU_FLAG_OK, NULL }, - { "bypass.stop", 0, 1, ".1.3.6.1.4.1.318.1.1.1.6.2.7.0", "3", SU_TYPE_CMD | SU_FLAG_OK, NULL }, - { "test.battery.start", 0, 1, ".1.3.6.1.4.1.318.1.1.1.7.2.2.0", "2", SU_TYPE_CMD | SU_FLAG_OK, NULL }, - { "calibrate.start", 0, 1, ".1.3.6.1.4.1.318.1.1.1.7.2.5.0", "2", SU_TYPE_CMD | SU_FLAG_OK, NULL }, - { "calibrate.stop", 0, 1, ".1.3.6.1.4.1.318.1.1.1.7.2.5.0", "3", SU_TYPE_CMD | SU_FLAG_OK, NULL }, - { "reset.input.minmax", 0, 1, ".1.3.6.1.4.1.318.1.1.1.9.1.1.0", "2", SU_TYPE_CMD | SU_FLAG_OK, NULL }, + snmp_info_default("shutdown.return", 0, 1, ".1.3.6.1.4.1.318.1.1.1.6.1.1.0", "2", SU_TYPE_CMD | SU_FLAG_OK, NULL), + snmp_info_default("test.failure.start", 0, 1, ".1.3.6.1.4.1.318.1.1.1.6.2.4.0", "2", SU_TYPE_CMD | SU_FLAG_OK, NULL), + snmp_info_default("test.panel.start", 0, 1, ".1.3.6.1.4.1.318.1.1.1.6.2.5.0", "2", SU_TYPE_CMD | SU_FLAG_OK, NULL), + snmp_info_default("bypass.start", 0, 1, ".1.3.6.1.4.1.318.1.1.1.6.2.7.0", "2", SU_TYPE_CMD | SU_FLAG_OK, NULL), + snmp_info_default("bypass.stop", 0, 1, ".1.3.6.1.4.1.318.1.1.1.6.2.7.0", "3", SU_TYPE_CMD | SU_FLAG_OK, NULL), + snmp_info_default("test.battery.start", 0, 1, ".1.3.6.1.4.1.318.1.1.1.7.2.2.0", "2", SU_TYPE_CMD | SU_FLAG_OK, NULL), + snmp_info_default("calibrate.start", 0, 1, ".1.3.6.1.4.1.318.1.1.1.7.2.5.0", "2", SU_TYPE_CMD | SU_FLAG_OK, NULL), + snmp_info_default("calibrate.stop", 0, 1, ".1.3.6.1.4.1.318.1.1.1.7.2.5.0", "3", SU_TYPE_CMD | SU_FLAG_OK, NULL), + snmp_info_default("reset.input.minmax", 0, 1, ".1.3.6.1.4.1.318.1.1.1.9.1.1.0", "2", SU_TYPE_CMD | SU_FLAG_OK, NULL), /* end of structure. */ - { NULL, 0, 0, NULL, NULL, 0, NULL } + snmp_info_sentinel }; mib2nut_info_t apc = { "apcc", APCC_MIB_VERSION, APCC_OID_POWER_STATUS, APC_UPS_DEVICE_MODEL, apcc_mib, APC_UPS_SYSOID, NULL }; diff --git a/drivers/apc-pdu-mib.c b/drivers/apc-pdu-mib.c index 2ca28df12c..4252ffa640 100644 --- a/drivers/apc-pdu-mib.c +++ b/drivers/apc-pdu-mib.c @@ -23,7 +23,7 @@ #include "apc-pdu-mib.h" -#define APC_PDU_MIB_VERSION "0.4" +#define APC_PDU_MIB_VERSION "0.40" #define APC_PDU_MIB_SYSOID_RPDU ".1.3.6.1.4.1.318.1.3.4.4" #define APC_PDU_MIB_SYSOID_RPDU2 ".1.3.6.1.4.1.318.1.3.4.5" @@ -32,939 +32,936 @@ static info_lkp_t apc_pdu_sw_outlet_status_info[] = { - { 1, "on", NULL, NULL }, - { 2, "off", NULL, NULL }, - { 0, NULL, NULL, NULL } + info_lkp_default(1, "on"), + info_lkp_default(2, "off"), + info_lkp_sentinel }; static info_lkp_t apc_pdu_sw_outlet_switchability_info[] = { - { 1, "yes", NULL, NULL }, - { 2, "yes", NULL, NULL }, - { 0, NULL, NULL, NULL } + info_lkp_default(1, "yes"), + info_lkp_default(2, "yes"), + info_lkp_sentinel }; /* POWERNET-MIB Snmp2NUT lookup table */ static snmp_info_t apc_pdu_mib[] = { /* Device page */ - { "device.mfr", ST_FLAG_STRING, SU_INFOSIZE, NULL, "APC", - SU_FLAG_STATIC | SU_FLAG_ABSENT | SU_FLAG_OK, NULL }, + snmp_info_default("device.mfr", ST_FLAG_STRING, SU_INFOSIZE, NULL, "APC", + SU_FLAG_STATIC | SU_FLAG_ABSENT | SU_FLAG_OK, NULL), /* sPDUIdentModelNumber.0 = STRING: "AP7900" */ - { "device.model", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.1.4.1.4.0", - "Switched ePDU", SU_FLAG_STATIC | SU_FLAG_OK, NULL }, - { "device.type", ST_FLAG_STRING, SU_INFOSIZE, NULL, "pdu", - SU_FLAG_STATIC | SU_FLAG_ABSENT | SU_FLAG_OK, NULL }, - { "device.contact", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.2.1.1.4.0", NULL, - SU_FLAG_STALE | SU_FLAG_OK, NULL }, - { "device.description", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.2.1.1.5.0", NULL, - SU_FLAG_STALE | SU_FLAG_OK, NULL }, - { "device.location", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.2.1.1.6.0", NULL, - SU_FLAG_STALE | SU_FLAG_OK, NULL }, + snmp_info_default("device.model", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.1.4.1.4.0", + "Switched ePDU", SU_FLAG_STATIC | SU_FLAG_OK, NULL), + snmp_info_default("device.type", ST_FLAG_STRING, SU_INFOSIZE, NULL, "pdu", + SU_FLAG_STATIC | SU_FLAG_ABSENT | SU_FLAG_OK, NULL), + snmp_info_default("device.contact", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.2.1.1.4.0", NULL, + SU_FLAG_STALE | SU_FLAG_OK, NULL), + snmp_info_default("device.description", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.2.1.1.5.0", NULL, + SU_FLAG_STALE | SU_FLAG_OK, NULL), + snmp_info_default("device.location", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.2.1.1.6.0", NULL, + SU_FLAG_STALE | SU_FLAG_OK, NULL), /* FIXME: to be RFC'ed */ - { "device.uptime", 0, 1, ".1.3.6.1.2.1.1.3.0", NULL, SU_FLAG_OK | SU_FLAG_NEGINVALID, NULL }, + snmp_info_default("device.uptime", 0, 1, ".1.3.6.1.2.1.1.3.0", NULL, SU_FLAG_OK | SU_FLAG_NEGINVALID, NULL), /* sPDUIdentSerialNumber.0 = STRING: "5A1234E00874" */ - { "device.serial", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.1.4.1.5.0", NULL, SU_FLAG_STATIC | SU_FLAG_OK, NULL }, + snmp_info_default("device.serial", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.1.4.1.5.0", NULL, SU_FLAG_STATIC | SU_FLAG_OK, NULL), /* sPDUIdentModelNumber.0 = STRING: "AP7900" */ - { "device.part", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.1.4.1.4.0", NULL, SU_FLAG_STATIC | SU_FLAG_OK, NULL }, + snmp_info_default("device.part", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.1.4.1.4.0", NULL, SU_FLAG_STATIC | SU_FLAG_OK, NULL), /* sPDUIdentHardwareRev.0 = STRING: "B2" */ - { "device.version", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.1.4.1.1.0", NULL, SU_FLAG_STATIC | SU_FLAG_OK, NULL }, + snmp_info_default("device.version", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.1.4.1.1.0", NULL, SU_FLAG_STATIC | SU_FLAG_OK, NULL), /* sPDUIdentFirmwareRev.0 = STRING: "v3.7.3" */ /* FIXME: to be moved to device.firmware */ - { "ups.firmware", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.1.4.1.2.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("ups.firmware", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.1.4.1.2.0", NULL, SU_FLAG_OK, NULL), /* sPDUIdentDateOfManufacture.0 = STRING: "08/13/2012" */ /* FIXME: to be moved to the device collection! */ - { "ups.date", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.1.4.1.3.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("ups.date", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.1.4.1.3.0", NULL, SU_FLAG_OK, NULL), /* Input */ /* rPDUIdentDevicePowerWatts.0 = INTEGER: 0 */ - { "input.realpower", 0, 1, ".1.3.6.1.4.1.318.1.1.12.1.16.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("input.realpower", 0, 1, ".1.3.6.1.4.1.318.1.1.12.1.16.0", NULL, SU_FLAG_OK, NULL), /* rPDULoadStatusLoad.1 = Gauge32: 0 */ - { "input.current", 0, 0.1, ".1.3.6.1.4.1.318.1.1.12.2.3.1.1.2.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("input.current", 0, 0.1, ".1.3.6.1.4.1.318.1.1.12.2.3.1.1.2.1", NULL, SU_FLAG_OK, NULL), /* rPDUIdentDeviceLinetoLineVoltage.0 = INTEGER: 120 */ - { "input.voltage.nominal", 0, 1, ".1.3.6.1.4.1.318.1.1.12.1.15.0", NULL, SU_FLAG_OK | SU_FLAG_NEGINVALID, NULL }, + snmp_info_default("input.voltage.nominal", 0, 1, ".1.3.6.1.4.1.318.1.1.12.1.15.0", NULL, SU_FLAG_OK | SU_FLAG_NEGINVALID, NULL), /* Outlets */ - { "outlet.count", 0, 1, ".1.3.6.1.4.1.318.1.1.4.4.1.0", NULL, SU_FLAG_STATIC | SU_FLAG_OK, NULL }, - { "outlet.%i.id", 0, 1, ".1.3.6.1.4.1.318.1.1.4.4.2.1.1.%i", "%i", - SU_FLAG_STATIC | SU_FLAG_OK | SU_OUTLET, NULL }, + snmp_info_default("outlet.count", 0, 1, ".1.3.6.1.4.1.318.1.1.4.4.1.0", NULL, SU_FLAG_STATIC | SU_FLAG_OK, NULL), + snmp_info_default("outlet.%i.id", 0, 1, ".1.3.6.1.4.1.318.1.1.4.4.2.1.1.%i", "%i", + SU_FLAG_STATIC | SU_FLAG_OK | SU_OUTLET, NULL), /* sPDUOutletCtlName.%i = STRING: "Testing Name" */ - { "outlet.%i.desc", ST_FLAG_RW | ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.1.4.4.2.1.4.%i", NULL, - SU_FLAG_STALE | SU_FLAG_OK | SU_OUTLET, NULL }, + snmp_info_default("outlet.%i.desc", ST_FLAG_RW | ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.1.4.4.2.1.4.%i", NULL, + SU_FLAG_STALE | SU_FLAG_OK | SU_OUTLET, NULL), /* sPDUOutletCtl.1 = INTEGER: outletOn(1) */ - { "outlet.%i.status", ST_FLAG_RW | ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.1.4.4.2.1.3.%i", NULL, - SU_FLAG_OK | SU_OUTLET, &apc_pdu_sw_outlet_status_info[0] }, + snmp_info_default("outlet.%i.status", ST_FLAG_RW | ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.1.4.4.2.1.3.%i", NULL, + SU_FLAG_OK | SU_OUTLET, &apc_pdu_sw_outlet_status_info[0]), /* Also use this OID to determine switchability ; its presence means "yes" */ /* sPDUOutletCtl.1 = INTEGER: outletOn(1) */ - { "outlet.%i.switchable", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.1.4.4.2.1.3.%i", "yes", - SU_FLAG_STATIC | SU_FLAG_ABSENT | SU_FLAG_OK | SU_OUTLET, &apc_pdu_sw_outlet_switchability_info[0] }, - - + snmp_info_default("outlet.%i.switchable", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.1.4.4.2.1.3.%i", "yes", + SU_FLAG_STATIC | SU_FLAG_ABSENT | SU_FLAG_OK | SU_OUTLET, &apc_pdu_sw_outlet_switchability_info[0]), #if WITH_UNMAPPED_DATA_POINTS /* keep following scan for future development */ - /* sPDUMasterControlSwitch.0 = INTEGER: noCommand(6) */ - { "unmapped.sPDUMasterControlSwitch", 0, 1, ".1.3.6.1.4.1.318.1.1.4.2.1.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.sPDUMasterControlSwitch", 0, 1, ".1.3.6.1.4.1.318.1.1.4.2.1.0", NULL, SU_FLAG_OK, NULL), /* sPDUMasterState.0 = STRING: "On On On On On On On On " */ - { "unmapped.sPDUMasterState", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.1.4.2.2.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.sPDUMasterState", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.1.4.2.2.0", NULL, SU_FLAG_OK, NULL), /* sPDUMasterPending.0 = STRING: "No No No No No No No No " */ - { "unmapped.sPDUMasterPending", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.1.4.2.3.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.sPDUMasterPending", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.1.4.2.3.0", NULL, SU_FLAG_OK, NULL), /* sPDUMasterConfigPowerOn.0 = INTEGER: 0 */ - { "unmapped.sPDUMasterConfigPowerOn", 0, 1, ".1.3.6.1.4.1.318.1.1.4.3.1.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.sPDUMasterConfigPowerOn", 0, 1, ".1.3.6.1.4.1.318.1.1.4.3.1.0", NULL, SU_FLAG_OK, NULL), /* sPDUMasterConfigReboot.0 = INTEGER: 0 */ - { "unmapped.sPDUMasterConfigReboot", 0, 1, ".1.3.6.1.4.1.318.1.1.4.3.2.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.sPDUMasterConfigReboot", 0, 1, ".1.3.6.1.4.1.318.1.1.4.3.2.0", NULL, SU_FLAG_OK, NULL), /* sPDUMasterConfigPDUName.0 = STRING: "RackPDU" */ - { "unmapped.sPDUMasterConfigPDUName", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.1.4.3.3.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.sPDUMasterConfigPDUName", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.1.4.3.3.0", NULL, SU_FLAG_OK, NULL), /* sPDUOutletControlTableSize.0 = INTEGER: 8 */ /* sPDUOutletControlIndex.1 = INTEGER: 1 */ - { "unmapped.sPDUOutletControlIndex", 0, 1, ".1.3.6.1.4.1.318.1.1.4.4.2.1.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.sPDUOutletControlIndex", 0, 1, ".1.3.6.1.4.1.318.1.1.4.4.2.1.1.1", NULL, SU_FLAG_OK, NULL), /* sPDUOutletControlIndex.2 = INTEGER: 2 */ - { "unmapped.sPDUOutletControlIndex", 0, 1, ".1.3.6.1.4.1.318.1.1.4.4.2.1.1.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.sPDUOutletControlIndex", 0, 1, ".1.3.6.1.4.1.318.1.1.4.4.2.1.1.2", NULL, SU_FLAG_OK, NULL), /* sPDUOutletControlIndex.3 = INTEGER: 3 */ - { "unmapped.sPDUOutletControlIndex", 0, 1, ".1.3.6.1.4.1.318.1.1.4.4.2.1.1.3", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.sPDUOutletControlIndex", 0, 1, ".1.3.6.1.4.1.318.1.1.4.4.2.1.1.3", NULL, SU_FLAG_OK, NULL), /* sPDUOutletControlIndex.4 = INTEGER: 4 */ - { "unmapped.sPDUOutletControlIndex", 0, 1, ".1.3.6.1.4.1.318.1.1.4.4.2.1.1.4", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.sPDUOutletControlIndex", 0, 1, ".1.3.6.1.4.1.318.1.1.4.4.2.1.1.4", NULL, SU_FLAG_OK, NULL), /* sPDUOutletControlIndex.5 = INTEGER: 5 */ - { "unmapped.sPDUOutletControlIndex", 0, 1, ".1.3.6.1.4.1.318.1.1.4.4.2.1.1.5", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.sPDUOutletControlIndex", 0, 1, ".1.3.6.1.4.1.318.1.1.4.4.2.1.1.5", NULL, SU_FLAG_OK, NULL), /* sPDUOutletControlIndex.6 = INTEGER: 6 */ - { "unmapped.sPDUOutletControlIndex", 0, 1, ".1.3.6.1.4.1.318.1.1.4.4.2.1.1.6", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.sPDUOutletControlIndex", 0, 1, ".1.3.6.1.4.1.318.1.1.4.4.2.1.1.6", NULL, SU_FLAG_OK, NULL), /* sPDUOutletControlIndex.7 = INTEGER: 7 */ - { "unmapped.sPDUOutletControlIndex", 0, 1, ".1.3.6.1.4.1.318.1.1.4.4.2.1.1.7", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.sPDUOutletControlIndex", 0, 1, ".1.3.6.1.4.1.318.1.1.4.4.2.1.1.7", NULL, SU_FLAG_OK, NULL), /* sPDUOutletControlIndex.8 = INTEGER: 8 */ - { "unmapped.sPDUOutletControlIndex", 0, 1, ".1.3.6.1.4.1.318.1.1.4.4.2.1.1.8", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.sPDUOutletControlIndex", 0, 1, ".1.3.6.1.4.1.318.1.1.4.4.2.1.1.8", NULL, SU_FLAG_OK, NULL), /* sPDUOutletPending.1 = INTEGER: noCommandPending(2) */ - { "unmapped.sPDUOutletPending", 0, 1, ".1.3.6.1.4.1.318.1.1.4.4.2.1.2.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.sPDUOutletPending", 0, 1, ".1.3.6.1.4.1.318.1.1.4.4.2.1.2.1", NULL, SU_FLAG_OK, NULL), /* sPDUOutletPending.2 = INTEGER: noCommandPending(2) */ - { "unmapped.sPDUOutletPending", 0, 1, ".1.3.6.1.4.1.318.1.1.4.4.2.1.2.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.sPDUOutletPending", 0, 1, ".1.3.6.1.4.1.318.1.1.4.4.2.1.2.2", NULL, SU_FLAG_OK, NULL), /* sPDUOutletPending.3 = INTEGER: noCommandPending(2) */ - { "unmapped.sPDUOutletPending", 0, 1, ".1.3.6.1.4.1.318.1.1.4.4.2.1.2.3", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.sPDUOutletPending", 0, 1, ".1.3.6.1.4.1.318.1.1.4.4.2.1.2.3", NULL, SU_FLAG_OK, NULL), /* sPDUOutletPending.4 = INTEGER: noCommandPending(2) */ - { "unmapped.sPDUOutletPending", 0, 1, ".1.3.6.1.4.1.318.1.1.4.4.2.1.2.4", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.sPDUOutletPending", 0, 1, ".1.3.6.1.4.1.318.1.1.4.4.2.1.2.4", NULL, SU_FLAG_OK, NULL), /* sPDUOutletPending.5 = INTEGER: noCommandPending(2) */ - { "unmapped.sPDUOutletPending", 0, 1, ".1.3.6.1.4.1.318.1.1.4.4.2.1.2.5", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.sPDUOutletPending", 0, 1, ".1.3.6.1.4.1.318.1.1.4.4.2.1.2.5", NULL, SU_FLAG_OK, NULL), /* sPDUOutletPending.6 = INTEGER: noCommandPending(2) */ - { "unmapped.sPDUOutletPending", 0, 1, ".1.3.6.1.4.1.318.1.1.4.4.2.1.2.6", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.sPDUOutletPending", 0, 1, ".1.3.6.1.4.1.318.1.1.4.4.2.1.2.6", NULL, SU_FLAG_OK, NULL), /* sPDUOutletPending.7 = INTEGER: noCommandPending(2) */ - { "unmapped.sPDUOutletPending", 0, 1, ".1.3.6.1.4.1.318.1.1.4.4.2.1.2.7", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.sPDUOutletPending", 0, 1, ".1.3.6.1.4.1.318.1.1.4.4.2.1.2.7", NULL, SU_FLAG_OK, NULL), /* sPDUOutletPending.8 = INTEGER: noCommandPending(2) */ - { "unmapped.sPDUOutletPending", 0, 1, ".1.3.6.1.4.1.318.1.1.4.4.2.1.2.8", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.sPDUOutletPending", 0, 1, ".1.3.6.1.4.1.318.1.1.4.4.2.1.2.8", NULL, SU_FLAG_OK, NULL), /* sPDUOutletConfigTableSize.0 = INTEGER: 8 */ - { "unmapped.sPDUOutletConfigTableSize", 0, 1, ".1.3.6.1.4.1.318.1.1.4.5.1.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.sPDUOutletConfigTableSize", 0, 1, ".1.3.6.1.4.1.318.1.1.4.5.1.0", NULL, SU_FLAG_OK, NULL), /* sPDUOutletConfigIndex.1 = INTEGER: 1 */ - { "unmapped.sPDUOutletConfigIndex", 0, 1, ".1.3.6.1.4.1.318.1.1.4.5.2.1.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.sPDUOutletConfigIndex", 0, 1, ".1.3.6.1.4.1.318.1.1.4.5.2.1.1.1", NULL, SU_FLAG_OK, NULL), /* sPDUOutletConfigIndex.2 = INTEGER: 2 */ - { "unmapped.sPDUOutletConfigIndex", 0, 1, ".1.3.6.1.4.1.318.1.1.4.5.2.1.1.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.sPDUOutletConfigIndex", 0, 1, ".1.3.6.1.4.1.318.1.1.4.5.2.1.1.2", NULL, SU_FLAG_OK, NULL), /* sPDUOutletConfigIndex.3 = INTEGER: 3 */ - { "unmapped.sPDUOutletConfigIndex", 0, 1, ".1.3.6.1.4.1.318.1.1.4.5.2.1.1.3", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.sPDUOutletConfigIndex", 0, 1, ".1.3.6.1.4.1.318.1.1.4.5.2.1.1.3", NULL, SU_FLAG_OK, NULL), /* sPDUOutletConfigIndex.4 = INTEGER: 4 */ - { "unmapped.sPDUOutletConfigIndex", 0, 1, ".1.3.6.1.4.1.318.1.1.4.5.2.1.1.4", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.sPDUOutletConfigIndex", 0, 1, ".1.3.6.1.4.1.318.1.1.4.5.2.1.1.4", NULL, SU_FLAG_OK, NULL), /* sPDUOutletConfigIndex.5 = INTEGER: 5 */ - { "unmapped.sPDUOutletConfigIndex", 0, 1, ".1.3.6.1.4.1.318.1.1.4.5.2.1.1.5", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.sPDUOutletConfigIndex", 0, 1, ".1.3.6.1.4.1.318.1.1.4.5.2.1.1.5", NULL, SU_FLAG_OK, NULL), /* sPDUOutletConfigIndex.6 = INTEGER: 6 */ - { "unmapped.sPDUOutletConfigIndex", 0, 1, ".1.3.6.1.4.1.318.1.1.4.5.2.1.1.6", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.sPDUOutletConfigIndex", 0, 1, ".1.3.6.1.4.1.318.1.1.4.5.2.1.1.6", NULL, SU_FLAG_OK, NULL), /* sPDUOutletConfigIndex.7 = INTEGER: 7 */ - { "unmapped.sPDUOutletConfigIndex", 0, 1, ".1.3.6.1.4.1.318.1.1.4.5.2.1.1.7", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.sPDUOutletConfigIndex", 0, 1, ".1.3.6.1.4.1.318.1.1.4.5.2.1.1.7", NULL, SU_FLAG_OK, NULL), /* sPDUOutletConfigIndex.8 = INTEGER: 8 */ - { "unmapped.sPDUOutletConfigIndex", 0, 1, ".1.3.6.1.4.1.318.1.1.4.5.2.1.1.8", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.sPDUOutletConfigIndex", 0, 1, ".1.3.6.1.4.1.318.1.1.4.5.2.1.1.8", NULL, SU_FLAG_OK, NULL), /* sPDUOutletPowerOnTime.1 = INTEGER: 0 */ - { "unmapped.sPDUOutletPowerOnTime", 0, 1, ".1.3.6.1.4.1.318.1.1.4.5.2.1.2.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.sPDUOutletPowerOnTime", 0, 1, ".1.3.6.1.4.1.318.1.1.4.5.2.1.2.1", NULL, SU_FLAG_OK, NULL), /* sPDUOutletPowerOnTime.2 = INTEGER: 0 */ - { "unmapped.sPDUOutletPowerOnTime", 0, 1, ".1.3.6.1.4.1.318.1.1.4.5.2.1.2.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.sPDUOutletPowerOnTime", 0, 1, ".1.3.6.1.4.1.318.1.1.4.5.2.1.2.2", NULL, SU_FLAG_OK, NULL), /* sPDUOutletPowerOnTime.3 = INTEGER: 0 */ - { "unmapped.sPDUOutletPowerOnTime", 0, 1, ".1.3.6.1.4.1.318.1.1.4.5.2.1.2.3", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.sPDUOutletPowerOnTime", 0, 1, ".1.3.6.1.4.1.318.1.1.4.5.2.1.2.3", NULL, SU_FLAG_OK, NULL), /* sPDUOutletPowerOnTime.4 = INTEGER: 0 */ - { "unmapped.sPDUOutletPowerOnTime", 0, 1, ".1.3.6.1.4.1.318.1.1.4.5.2.1.2.4", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.sPDUOutletPowerOnTime", 0, 1, ".1.3.6.1.4.1.318.1.1.4.5.2.1.2.4", NULL, SU_FLAG_OK, NULL), /* sPDUOutletPowerOnTime.5 = INTEGER: 0 */ - { "unmapped.sPDUOutletPowerOnTime", 0, 1, ".1.3.6.1.4.1.318.1.1.4.5.2.1.2.5", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.sPDUOutletPowerOnTime", 0, 1, ".1.3.6.1.4.1.318.1.1.4.5.2.1.2.5", NULL, SU_FLAG_OK, NULL), /* sPDUOutletPowerOnTime.6 = INTEGER: 0 */ - { "unmapped.sPDUOutletPowerOnTime", 0, 1, ".1.3.6.1.4.1.318.1.1.4.5.2.1.2.6", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.sPDUOutletPowerOnTime", 0, 1, ".1.3.6.1.4.1.318.1.1.4.5.2.1.2.6", NULL, SU_FLAG_OK, NULL), /* sPDUOutletPowerOnTime.7 = INTEGER: 0 */ - { "unmapped.sPDUOutletPowerOnTime", 0, 1, ".1.3.6.1.4.1.318.1.1.4.5.2.1.2.7", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.sPDUOutletPowerOnTime", 0, 1, ".1.3.6.1.4.1.318.1.1.4.5.2.1.2.7", NULL, SU_FLAG_OK, NULL), /* sPDUOutletPowerOnTime.8 = INTEGER: 0 */ - { "unmapped.sPDUOutletPowerOnTime", 0, 1, ".1.3.6.1.4.1.318.1.1.4.5.2.1.2.8", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.sPDUOutletPowerOnTime", 0, 1, ".1.3.6.1.4.1.318.1.1.4.5.2.1.2.8", NULL, SU_FLAG_OK, NULL), /* sPDUOutletName.1 = STRING: "Testing Name" */ - { "unmapped.sPDUOutletName", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.1.4.5.2.1.3.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.sPDUOutletName", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.1.4.5.2.1.3.1", NULL, SU_FLAG_OK, NULL), /* sPDUOutletName.2 = STRING: "Testing 2" */ - { "unmapped.sPDUOutletName", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.1.4.5.2.1.3.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.sPDUOutletName", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.1.4.5.2.1.3.2", NULL, SU_FLAG_OK, NULL), /* sPDUOutletName.3 = STRING: "Outlet 3" */ - { "unmapped.sPDUOutletName", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.1.4.5.2.1.3.3", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.sPDUOutletName", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.1.4.5.2.1.3.3", NULL, SU_FLAG_OK, NULL), /* sPDUOutletName.4 = STRING: "Outlet 4" */ - { "unmapped.sPDUOutletName", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.1.4.5.2.1.3.4", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.sPDUOutletName", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.1.4.5.2.1.3.4", NULL, SU_FLAG_OK, NULL), /* sPDUOutletName.5 = STRING: "Outlet 5" */ - { "unmapped.sPDUOutletName", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.1.4.5.2.1.3.5", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.sPDUOutletName", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.1.4.5.2.1.3.5", NULL, SU_FLAG_OK, NULL), /* sPDUOutletName.6 = STRING: "Outlet 6" */ - { "unmapped.sPDUOutletName", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.1.4.5.2.1.3.6", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.sPDUOutletName", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.1.4.5.2.1.3.6", NULL, SU_FLAG_OK, NULL), /* sPDUOutletName.7 = STRING: "Outlet 7" */ - { "unmapped.sPDUOutletName", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.1.4.5.2.1.3.7", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.sPDUOutletName", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.1.4.5.2.1.3.7", NULL, SU_FLAG_OK, NULL), /* sPDUOutletName.8 = STRING: "Outlet 8" */ - { "unmapped.sPDUOutletName", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.1.4.5.2.1.3.8", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.sPDUOutletName", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.1.4.5.2.1.3.8", NULL, SU_FLAG_OK, NULL), /* sPDUOutletPowerOffTime.1 = INTEGER: 0 */ - { "unmapped.sPDUOutletPowerOffTime", 0, 1, ".1.3.6.1.4.1.318.1.1.4.5.2.1.4.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.sPDUOutletPowerOffTime", 0, 1, ".1.3.6.1.4.1.318.1.1.4.5.2.1.4.1", NULL, SU_FLAG_OK, NULL), /* sPDUOutletPowerOffTime.2 = INTEGER: 0 */ - { "unmapped.sPDUOutletPowerOffTime", 0, 1, ".1.3.6.1.4.1.318.1.1.4.5.2.1.4.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.sPDUOutletPowerOffTime", 0, 1, ".1.3.6.1.4.1.318.1.1.4.5.2.1.4.2", NULL, SU_FLAG_OK, NULL), /* sPDUOutletPowerOffTime.3 = INTEGER: 0 */ - { "unmapped.sPDUOutletPowerOffTime", 0, 1, ".1.3.6.1.4.1.318.1.1.4.5.2.1.4.3", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.sPDUOutletPowerOffTime", 0, 1, ".1.3.6.1.4.1.318.1.1.4.5.2.1.4.3", NULL, SU_FLAG_OK, NULL), /* sPDUOutletPowerOffTime.4 = INTEGER: 0 */ - { "unmapped.sPDUOutletPowerOffTime", 0, 1, ".1.3.6.1.4.1.318.1.1.4.5.2.1.4.4", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.sPDUOutletPowerOffTime", 0, 1, ".1.3.6.1.4.1.318.1.1.4.5.2.1.4.4", NULL, SU_FLAG_OK, NULL), /* sPDUOutletPowerOffTime.5 = INTEGER: 0 */ - { "unmapped.sPDUOutletPowerOffTime", 0, 1, ".1.3.6.1.4.1.318.1.1.4.5.2.1.4.5", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.sPDUOutletPowerOffTime", 0, 1, ".1.3.6.1.4.1.318.1.1.4.5.2.1.4.5", NULL, SU_FLAG_OK, NULL), /* sPDUOutletPowerOffTime.6 = INTEGER: 0 */ - { "unmapped.sPDUOutletPowerOffTime", 0, 1, ".1.3.6.1.4.1.318.1.1.4.5.2.1.4.6", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.sPDUOutletPowerOffTime", 0, 1, ".1.3.6.1.4.1.318.1.1.4.5.2.1.4.6", NULL, SU_FLAG_OK, NULL), /* sPDUOutletPowerOffTime.7 = INTEGER: 0 */ - { "unmapped.sPDUOutletPowerOffTime", 0, 1, ".1.3.6.1.4.1.318.1.1.4.5.2.1.4.7", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.sPDUOutletPowerOffTime", 0, 1, ".1.3.6.1.4.1.318.1.1.4.5.2.1.4.7", NULL, SU_FLAG_OK, NULL), /* sPDUOutletPowerOffTime.8 = INTEGER: 0 */ - { "unmapped.sPDUOutletPowerOffTime", 0, 1, ".1.3.6.1.4.1.318.1.1.4.5.2.1.4.8", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.sPDUOutletPowerOffTime", 0, 1, ".1.3.6.1.4.1.318.1.1.4.5.2.1.4.8", NULL, SU_FLAG_OK, NULL), /* sPDUOutletRebootDuration.1 = INTEGER: 5 */ - { "unmapped.sPDUOutletRebootDuration", 0, 1, ".1.3.6.1.4.1.318.1.1.4.5.2.1.5.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.sPDUOutletRebootDuration", 0, 1, ".1.3.6.1.4.1.318.1.1.4.5.2.1.5.1", NULL, SU_FLAG_OK, NULL), /* sPDUOutletRebootDuration.2 = INTEGER: 5 */ - { "unmapped.sPDUOutletRebootDuration", 0, 1, ".1.3.6.1.4.1.318.1.1.4.5.2.1.5.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.sPDUOutletRebootDuration", 0, 1, ".1.3.6.1.4.1.318.1.1.4.5.2.1.5.2", NULL, SU_FLAG_OK, NULL), /* sPDUOutletRebootDuration.3 = INTEGER: 5 */ - { "unmapped.sPDUOutletRebootDuration", 0, 1, ".1.3.6.1.4.1.318.1.1.4.5.2.1.5.3", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.sPDUOutletRebootDuration", 0, 1, ".1.3.6.1.4.1.318.1.1.4.5.2.1.5.3", NULL, SU_FLAG_OK, NULL), /* sPDUOutletRebootDuration.4 = INTEGER: 5 */ - { "unmapped.sPDUOutletRebootDuration", 0, 1, ".1.3.6.1.4.1.318.1.1.4.5.2.1.5.4", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.sPDUOutletRebootDuration", 0, 1, ".1.3.6.1.4.1.318.1.1.4.5.2.1.5.4", NULL, SU_FLAG_OK, NULL), /* sPDUOutletRebootDuration.5 = INTEGER: 5 */ - { "unmapped.sPDUOutletRebootDuration", 0, 1, ".1.3.6.1.4.1.318.1.1.4.5.2.1.5.5", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.sPDUOutletRebootDuration", 0, 1, ".1.3.6.1.4.1.318.1.1.4.5.2.1.5.5", NULL, SU_FLAG_OK, NULL), /* sPDUOutletRebootDuration.6 = INTEGER: 5 */ - { "unmapped.sPDUOutletRebootDuration", 0, 1, ".1.3.6.1.4.1.318.1.1.4.5.2.1.5.6", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.sPDUOutletRebootDuration", 0, 1, ".1.3.6.1.4.1.318.1.1.4.5.2.1.5.6", NULL, SU_FLAG_OK, NULL), /* sPDUOutletRebootDuration.7 = INTEGER: 5 */ - { "unmapped.sPDUOutletRebootDuration", 0, 1, ".1.3.6.1.4.1.318.1.1.4.5.2.1.5.7", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.sPDUOutletRebootDuration", 0, 1, ".1.3.6.1.4.1.318.1.1.4.5.2.1.5.7", NULL, SU_FLAG_OK, NULL), /* sPDUOutletRebootDuration.8 = INTEGER: 5 */ - { "unmapped.sPDUOutletRebootDuration", 0, 1, ".1.3.6.1.4.1.318.1.1.4.5.2.1.5.8", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.sPDUOutletRebootDuration", 0, 1, ".1.3.6.1.4.1.318.1.1.4.5.2.1.5.8", NULL, SU_FLAG_OK, NULL), /* rPDUIdentName.0 = STRING: "RackPDU" */ - { "unmapped.rPDUIdentName", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.1.12.1.1.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.rPDUIdentName", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.1.12.1.1.0", NULL, SU_FLAG_OK, NULL), /* rPDUIdentHardwareRev.0 = STRING: "B2" */ - { "unmapped.rPDUIdentHardwareRev", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.1.12.1.2.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.rPDUIdentHardwareRev", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.1.12.1.2.0", NULL, SU_FLAG_OK, NULL), /* rPDUIdentFirmwareRev.0 = STRING: "v3.7.3" */ - { "unmapped.rPDUIdentFirmwareRev", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.1.12.1.3.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.rPDUIdentFirmwareRev", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.1.12.1.3.0", NULL, SU_FLAG_OK, NULL), /* rPDUIdentDateOfManufacture.0 = STRING: "08/13/2012" */ - { "unmapped.rPDUIdentDateOfManufacture", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.1.12.1.4.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.rPDUIdentDateOfManufacture", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.1.12.1.4.0", NULL, SU_FLAG_OK, NULL), /* rPDUIdentModelNumber.0 = STRING: "AP7900" */ - { "unmapped.rPDUIdentModelNumber", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.1.12.1.5.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.rPDUIdentModelNumber", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.1.12.1.5.0", NULL, SU_FLAG_OK, NULL), /* rPDUIdentSerialNumber.0 = STRING: "5A1234E00874" */ - { "unmapped.rPDUIdentSerialNumber", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.1.12.1.6.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.rPDUIdentSerialNumber", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.1.12.1.6.0", NULL, SU_FLAG_OK, NULL), /* rPDUIdentDeviceRating.0 = INTEGER: 12 */ - { "unmapped.rPDUIdentDeviceRating", 0, 1, ".1.3.6.1.4.1.318.1.1.12.1.7.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.rPDUIdentDeviceRating", 0, 1, ".1.3.6.1.4.1.318.1.1.12.1.7.0", NULL, SU_FLAG_OK, NULL), /* rPDUIdentDeviceNumOutlets.0 = INTEGER: 8 */ - { "unmapped.rPDUIdentDeviceNumOutlets", 0, 1, ".1.3.6.1.4.1.318.1.1.12.1.8.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.rPDUIdentDeviceNumOutlets", 0, 1, ".1.3.6.1.4.1.318.1.1.12.1.8.0", NULL, SU_FLAG_OK, NULL), /* rPDUIdentDeviceNumPhases.0 = INTEGER: 1 */ - { "input.phases", 0, 1, ".1.3.6.1.4.1.318.1.1.12.1.9.0", NULL, SU_FLAG_STATIC | SU_FLAG_OK, NULL }, + snmp_info_default("input.phases", 0, 1, ".1.3.6.1.4.1.318.1.1.12.1.9.0", NULL, SU_FLAG_STATIC | SU_FLAG_OK, NULL), /* rPDUIdentDeviceNumBreakers.0 = INTEGER: 0 */ - { "unmapped.rPDUIdentDeviceNumBreakers", 0, 1, ".1.3.6.1.4.1.318.1.1.12.1.10.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.rPDUIdentDeviceNumBreakers", 0, 1, ".1.3.6.1.4.1.318.1.1.12.1.10.0", NULL, SU_FLAG_OK, NULL), /* rPDUIdentDeviceBreakerRating.0 = INTEGER: 0 */ - { "unmapped.rPDUIdentDeviceBreakerRating", 0, 1, ".1.3.6.1.4.1.318.1.1.12.1.11.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.rPDUIdentDeviceBreakerRating", 0, 1, ".1.3.6.1.4.1.318.1.1.12.1.11.0", NULL, SU_FLAG_OK, NULL), /* rPDUIdentDeviceOrientation.0 = INTEGER: orientHorizontal(1) */ - { "unmapped.rPDUIdentDeviceOrientation", 0, 1, ".1.3.6.1.4.1.318.1.1.12.1.12.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.rPDUIdentDeviceOrientation", 0, 1, ".1.3.6.1.4.1.318.1.1.12.1.12.0", NULL, SU_FLAG_OK, NULL), /* rPDUIdentDeviceOutletLayout.0 = INTEGER: seqPhaseToNeutral(1) */ - { "unmapped.rPDUIdentDeviceOutletLayout", 0, 1, ".1.3.6.1.4.1.318.1.1.12.1.13.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.rPDUIdentDeviceOutletLayout", 0, 1, ".1.3.6.1.4.1.318.1.1.12.1.13.0", NULL, SU_FLAG_OK, NULL), /* rPDUIdentDeviceDisplayOrientation.0 = INTEGER: displayNormal(1) */ - { "unmapped.rPDUIdentDeviceDisplayOrientation", 0, 1, ".1.3.6.1.4.1.318.1.1.12.1.14.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.rPDUIdentDeviceDisplayOrientation", 0, 1, ".1.3.6.1.4.1.318.1.1.12.1.14.0", NULL, SU_FLAG_OK, NULL), /* rPDUIdentDeviceLinetoLineVoltage.0 = INTEGER: 120 */ - { "unmapped.rPDUIdentDeviceLinetoLineVoltage", 0, 1, ".1.3.6.1.4.1.318.1.1.12.1.15.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.rPDUIdentDeviceLinetoLineVoltage", 0, 1, ".1.3.6.1.4.1.318.1.1.12.1.15.0", NULL, SU_FLAG_OK, NULL), /* rPDUIdentDevicePowerFactor.0 = INTEGER: 1000 */ - { "unmapped.rPDUIdentDevicePowerFactor", 0, 1, ".1.3.6.1.4.1.318.1.1.12.1.17.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.rPDUIdentDevicePowerFactor", 0, 1, ".1.3.6.1.4.1.318.1.1.12.1.17.0", NULL, SU_FLAG_OK, NULL), /* rPDUIdentDevicePowerVA.0 = INTEGER: 0 */ - { "unmapped.rPDUIdentDevicePowerVA", 0, 1, ".1.3.6.1.4.1.318.1.1.12.1.18.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.rPDUIdentDevicePowerVA", 0, 1, ".1.3.6.1.4.1.318.1.1.12.1.18.0", NULL, SU_FLAG_OK, NULL), /* rPDULoadDevMaxPhaseLoad.0 = INTEGER: 12 */ - { "unmapped.rPDULoadDevMaxPhaseLoad", 0, 1, ".1.3.6.1.4.1.318.1.1.12.2.1.1.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.rPDULoadDevMaxPhaseLoad", 0, 1, ".1.3.6.1.4.1.318.1.1.12.2.1.1.0", NULL, SU_FLAG_OK, NULL), /* rPDULoadDevNumPhases.0 = INTEGER: 1 */ - { "unmapped.rPDULoadDevNumPhases", 0, 1, ".1.3.6.1.4.1.318.1.1.12.2.1.2.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.rPDULoadDevNumPhases", 0, 1, ".1.3.6.1.4.1.318.1.1.12.2.1.2.0", NULL, SU_FLAG_OK, NULL), /* rPDULoadDevMaxBankLoad.0 = INTEGER: 0 */ - { "unmapped.rPDULoadDevMaxBankLoad", 0, 1, ".1.3.6.1.4.1.318.1.1.12.2.1.3.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.rPDULoadDevMaxBankLoad", 0, 1, ".1.3.6.1.4.1.318.1.1.12.2.1.3.0", NULL, SU_FLAG_OK, NULL), /* rPDULoadDevNumBanks.0 = INTEGER: 0 */ - { "unmapped.rPDULoadDevNumBanks", 0, 1, ".1.3.6.1.4.1.318.1.1.12.2.1.4.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.rPDULoadDevNumBanks", 0, 1, ".1.3.6.1.4.1.318.1.1.12.2.1.4.0", NULL, SU_FLAG_OK, NULL), /* rPDULoadDevBankTableSize.0 = INTEGER: 0 */ - { "unmapped.rPDULoadDevBankTableSize", 0, 1, ".1.3.6.1.4.1.318.1.1.12.2.1.5.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.rPDULoadDevBankTableSize", 0, 1, ".1.3.6.1.4.1.318.1.1.12.2.1.5.0", NULL, SU_FLAG_OK, NULL), /* rPDULoadDevMaxOutletTableSize.0 = INTEGER: 0 */ - { "unmapped.rPDULoadDevMaxOutletTableSize", 0, 1, ".1.3.6.1.4.1.318.1.1.12.2.1.7.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.rPDULoadDevMaxOutletTableSize", 0, 1, ".1.3.6.1.4.1.318.1.1.12.2.1.7.0", NULL, SU_FLAG_OK, NULL), /* rPDULoadPhaseConfigIndex.phase1 = INTEGER: phase1(1) */ - { "unmapped.rPDULoadPhaseConfigIndex", 0, 1, ".1.3.6.1.4.1.318.1.1.12.2.2.1.1.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.rPDULoadPhaseConfigIndex", 0, 1, ".1.3.6.1.4.1.318.1.1.12.2.2.1.1.1.1", NULL, SU_FLAG_OK, NULL), /* rPDULoadPhaseConfigLowLoadThreshold.phase1 = INTEGER: 0 */ - { "unmapped.rPDULoadPhaseConfigLowLoadThreshold", 0, 1, ".1.3.6.1.4.1.318.1.1.12.2.2.1.1.2.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.rPDULoadPhaseConfigLowLoadThreshold", 0, 1, ".1.3.6.1.4.1.318.1.1.12.2.2.1.1.2.1", NULL, SU_FLAG_OK, NULL), /* rPDULoadPhaseConfigNearOverloadThreshold.phase1 = INTEGER: 8 */ - { "unmapped.rPDULoadPhaseConfigNearOverloadThreshold", 0, 1, ".1.3.6.1.4.1.318.1.1.12.2.2.1.1.3.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.rPDULoadPhaseConfigNearOverloadThreshold", 0, 1, ".1.3.6.1.4.1.318.1.1.12.2.2.1.1.3.1", NULL, SU_FLAG_OK, NULL), /* rPDULoadPhaseConfigOverloadThreshold.phase1 = INTEGER: 12 */ - { "unmapped.rPDULoadPhaseConfigOverloadThreshold", 0, 1, ".1.3.6.1.4.1.318.1.1.12.2.2.1.1.4.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.rPDULoadPhaseConfigOverloadThreshold", 0, 1, ".1.3.6.1.4.1.318.1.1.12.2.2.1.1.4.1", NULL, SU_FLAG_OK, NULL), /* rPDULoadPhaseConfigAlarm.phase1 = INTEGER: noLoadAlarm(1) */ - { "unmapped.rPDULoadPhaseConfigAlarm", 0, 1, ".1.3.6.1.4.1.318.1.1.12.2.2.1.1.5.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.rPDULoadPhaseConfigAlarm", 0, 1, ".1.3.6.1.4.1.318.1.1.12.2.2.1.1.5.1", NULL, SU_FLAG_OK, NULL), /* rPDULoadStatusIndex.1 = INTEGER: 1 */ - { "unmapped.rPDULoadStatusIndex", 0, 1, ".1.3.6.1.4.1.318.1.1.12.2.3.1.1.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.rPDULoadStatusIndex", 0, 1, ".1.3.6.1.4.1.318.1.1.12.2.3.1.1.1.1", NULL, SU_FLAG_OK, NULL), /* rPDULoadStatusLoadState.1 = INTEGER: phaseLoadNormal(1) */ - { "unmapped.rPDULoadStatusLoadState", 0, 1, ".1.3.6.1.4.1.318.1.1.12.2.3.1.1.3.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.rPDULoadStatusLoadState", 0, 1, ".1.3.6.1.4.1.318.1.1.12.2.3.1.1.3.1", NULL, SU_FLAG_OK, NULL), /* rPDULoadStatusPhaseNumber.1 = INTEGER: 1 */ - { "unmapped.rPDULoadStatusPhaseNumber", 0, 1, ".1.3.6.1.4.1.318.1.1.12.2.3.1.1.4.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.rPDULoadStatusPhaseNumber", 0, 1, ".1.3.6.1.4.1.318.1.1.12.2.3.1.1.4.1", NULL, SU_FLAG_OK, NULL), /* rPDULoadStatusBankNumber.1 = INTEGER: 0 */ - { "unmapped.rPDULoadStatusBankNumber", 0, 1, ".1.3.6.1.4.1.318.1.1.12.2.3.1.1.5.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.rPDULoadStatusBankNumber", 0, 1, ".1.3.6.1.4.1.318.1.1.12.2.3.1.1.5.1", NULL, SU_FLAG_OK, NULL), /* rPDUOutletDevCommand.0 = INTEGER: noCommandAll(1) */ - { "unmapped.rPDUOutletDevCommand", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.1.1.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.rPDUOutletDevCommand", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.1.1.0", NULL, SU_FLAG_OK, NULL), /* rPDUOutletDevColdstartDelay.0 = INTEGER: 0 */ - { "unmapped.rPDUOutletDevColdstartDelay", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.1.2.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.rPDUOutletDevColdstartDelay", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.1.2.0", NULL, SU_FLAG_OK, NULL), /* rPDUOutletDevNumCntrlOutlets.0 = INTEGER: 8 */ - { "unmapped.rPDUOutletDevNumCntrlOutlets", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.1.3.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.rPDUOutletDevNumCntrlOutlets", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.1.3.0", NULL, SU_FLAG_OK, NULL), /* rPDUOutletDevNumTotalOutlets.0 = INTEGER: 8 */ - { "unmapped.rPDUOutletDevNumTotalOutlets", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.1.4.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.rPDUOutletDevNumTotalOutlets", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.1.4.0", NULL, SU_FLAG_OK, NULL), /* rPDUOutletDevMonitoredOutlets.0 = INTEGER: 0 */ - { "unmapped.rPDUOutletDevMonitoredOutlets", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.1.5.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.rPDUOutletDevMonitoredOutlets", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.1.5.0", NULL, SU_FLAG_OK, NULL), /* rPDUOutletPhaseIndex.phase1 = INTEGER: phase1(1) */ - { "unmapped.rPDUOutletPhaseIndex", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.2.1.1.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.rPDUOutletPhaseIndex", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.2.1.1.1.1", NULL, SU_FLAG_OK, NULL), /* rPDUOutletPhaseOverloadRestriction.phase1 = INTEGER: alwaysAllowTurnON(1) */ - { "unmapped.rPDUOutletPhaseOverloadRestriction", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.2.1.1.2.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.rPDUOutletPhaseOverloadRestriction", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.2.1.1.2.1", NULL, SU_FLAG_OK, NULL), /* rPDUOutletControlIndex.1 = INTEGER: 1 */ - { "unmapped.rPDUOutletControlIndex", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.3.1.1.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.rPDUOutletControlIndex", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.3.1.1.1.1", NULL, SU_FLAG_OK, NULL), /* rPDUOutletControlIndex.2 = INTEGER: 2 */ - { "unmapped.rPDUOutletControlIndex", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.3.1.1.1.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.rPDUOutletControlIndex", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.3.1.1.1.2", NULL, SU_FLAG_OK, NULL), /* rPDUOutletControlIndex.3 = INTEGER: 3 */ - { "unmapped.rPDUOutletControlIndex", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.3.1.1.1.3", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.rPDUOutletControlIndex", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.3.1.1.1.3", NULL, SU_FLAG_OK, NULL), /* rPDUOutletControlIndex.4 = INTEGER: 4 */ - { "unmapped.rPDUOutletControlIndex", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.3.1.1.1.4", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.rPDUOutletControlIndex", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.3.1.1.1.4", NULL, SU_FLAG_OK, NULL), /* rPDUOutletControlIndex.5 = INTEGER: 5 */ - { "unmapped.rPDUOutletControlIndex", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.3.1.1.1.5", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.rPDUOutletControlIndex", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.3.1.1.1.5", NULL, SU_FLAG_OK, NULL), /* rPDUOutletControlIndex.6 = INTEGER: 6 */ - { "unmapped.rPDUOutletControlIndex", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.3.1.1.1.6", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.rPDUOutletControlIndex", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.3.1.1.1.6", NULL, SU_FLAG_OK, NULL), /* rPDUOutletControlIndex.7 = INTEGER: 7 */ - { "unmapped.rPDUOutletControlIndex", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.3.1.1.1.7", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.rPDUOutletControlIndex", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.3.1.1.1.7", NULL, SU_FLAG_OK, NULL), /* rPDUOutletControlIndex.8 = INTEGER: 8 */ - { "unmapped.rPDUOutletControlIndex", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.3.1.1.1.8", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.rPDUOutletControlIndex", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.3.1.1.1.8", NULL, SU_FLAG_OK, NULL), /* rPDUOutletControlOutletName.1 = STRING: "Testing Name" */ - { "unmapped.rPDUOutletControlOutletName", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.1.12.3.3.1.1.2.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.rPDUOutletControlOutletName", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.1.12.3.3.1.1.2.1", NULL, SU_FLAG_OK, NULL), /* rPDUOutletControlOutletName.2 = STRING: "Testing 2" */ - { "unmapped.rPDUOutletControlOutletName", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.1.12.3.3.1.1.2.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.rPDUOutletControlOutletName", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.1.12.3.3.1.1.2.2", NULL, SU_FLAG_OK, NULL), /* rPDUOutletControlOutletName.3 = STRING: "Outlet 3" */ - { "unmapped.rPDUOutletControlOutletName", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.1.12.3.3.1.1.2.3", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.rPDUOutletControlOutletName", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.1.12.3.3.1.1.2.3", NULL, SU_FLAG_OK, NULL), /* rPDUOutletControlOutletName.4 = STRING: "Outlet 4" */ - { "unmapped.rPDUOutletControlOutletName", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.1.12.3.3.1.1.2.4", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.rPDUOutletControlOutletName", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.1.12.3.3.1.1.2.4", NULL, SU_FLAG_OK, NULL), /* rPDUOutletControlOutletName.5 = STRING: "Outlet 5" */ - { "unmapped.rPDUOutletControlOutletName", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.1.12.3.3.1.1.2.5", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.rPDUOutletControlOutletName", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.1.12.3.3.1.1.2.5", NULL, SU_FLAG_OK, NULL), /* rPDUOutletControlOutletName.6 = STRING: "Outlet 6" */ - { "unmapped.rPDUOutletControlOutletName", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.1.12.3.3.1.1.2.6", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.rPDUOutletControlOutletName", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.1.12.3.3.1.1.2.6", NULL, SU_FLAG_OK, NULL), /* rPDUOutletControlOutletName.7 = STRING: "Outlet 7" */ - { "unmapped.rPDUOutletControlOutletName", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.1.12.3.3.1.1.2.7", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.rPDUOutletControlOutletName", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.1.12.3.3.1.1.2.7", NULL, SU_FLAG_OK, NULL), /* rPDUOutletControlOutletName.8 = STRING: "Outlet 8" */ - { "unmapped.rPDUOutletControlOutletName", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.1.12.3.3.1.1.2.8", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.rPDUOutletControlOutletName", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.1.12.3.3.1.1.2.8", NULL, SU_FLAG_OK, NULL), /* rPDUOutletControlOutletPhase.1 = INTEGER: phase1(1) */ - { "unmapped.rPDUOutletControlOutletPhase", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.3.1.1.3.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.rPDUOutletControlOutletPhase", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.3.1.1.3.1", NULL, SU_FLAG_OK, NULL), /* rPDUOutletControlOutletPhase.2 = INTEGER: phase1(1) */ - { "unmapped.rPDUOutletControlOutletPhase", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.3.1.1.3.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.rPDUOutletControlOutletPhase", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.3.1.1.3.2", NULL, SU_FLAG_OK, NULL), /* rPDUOutletControlOutletPhase.3 = INTEGER: phase1(1) */ - { "unmapped.rPDUOutletControlOutletPhase", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.3.1.1.3.3", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.rPDUOutletControlOutletPhase", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.3.1.1.3.3", NULL, SU_FLAG_OK, NULL), /* rPDUOutletControlOutletPhase.4 = INTEGER: phase1(1) */ - { "unmapped.rPDUOutletControlOutletPhase", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.3.1.1.3.4", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.rPDUOutletControlOutletPhase", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.3.1.1.3.4", NULL, SU_FLAG_OK, NULL), /* rPDUOutletControlOutletPhase.5 = INTEGER: phase1(1) */ - { "unmapped.rPDUOutletControlOutletPhase", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.3.1.1.3.5", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.rPDUOutletControlOutletPhase", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.3.1.1.3.5", NULL, SU_FLAG_OK, NULL), /* rPDUOutletControlOutletPhase.6 = INTEGER: phase1(1) */ - { "unmapped.rPDUOutletControlOutletPhase", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.3.1.1.3.6", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.rPDUOutletControlOutletPhase", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.3.1.1.3.6", NULL, SU_FLAG_OK, NULL), /* rPDUOutletControlOutletPhase.7 = INTEGER: phase1(1) */ - { "unmapped.rPDUOutletControlOutletPhase", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.3.1.1.3.7", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.rPDUOutletControlOutletPhase", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.3.1.1.3.7", NULL, SU_FLAG_OK, NULL), /* rPDUOutletControlOutletPhase.8 = INTEGER: phase1(1) */ - { "unmapped.rPDUOutletControlOutletPhase", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.3.1.1.3.8", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.rPDUOutletControlOutletPhase", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.3.1.1.3.8", NULL, SU_FLAG_OK, NULL), /* rPDUOutletControlOutletCommand.1 = INTEGER: immediateOn(1) */ - { "unmapped.rPDUOutletControlOutletCommand", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.3.1.1.4.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.rPDUOutletControlOutletCommand", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.3.1.1.4.1", NULL, SU_FLAG_OK, NULL), /* rPDUOutletControlOutletCommand.2 = INTEGER: immediateOn(1) */ - { "unmapped.rPDUOutletControlOutletCommand", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.3.1.1.4.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.rPDUOutletControlOutletCommand", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.3.1.1.4.2", NULL, SU_FLAG_OK, NULL), /* rPDUOutletControlOutletCommand.3 = INTEGER: immediateOn(1) */ - { "unmapped.rPDUOutletControlOutletCommand", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.3.1.1.4.3", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.rPDUOutletControlOutletCommand", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.3.1.1.4.3", NULL, SU_FLAG_OK, NULL), /* rPDUOutletControlOutletCommand.4 = INTEGER: immediateOn(1) */ - { "unmapped.rPDUOutletControlOutletCommand", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.3.1.1.4.4", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.rPDUOutletControlOutletCommand", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.3.1.1.4.4", NULL, SU_FLAG_OK, NULL), /* rPDUOutletControlOutletCommand.5 = INTEGER: immediateOn(1) */ - { "unmapped.rPDUOutletControlOutletCommand", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.3.1.1.4.5", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.rPDUOutletControlOutletCommand", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.3.1.1.4.5", NULL, SU_FLAG_OK, NULL), /* rPDUOutletControlOutletCommand.6 = INTEGER: immediateOn(1) */ - { "unmapped.rPDUOutletControlOutletCommand", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.3.1.1.4.6", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.rPDUOutletControlOutletCommand", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.3.1.1.4.6", NULL, SU_FLAG_OK, NULL), /* rPDUOutletControlOutletCommand.7 = INTEGER: immediateOn(1) */ - { "unmapped.rPDUOutletControlOutletCommand", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.3.1.1.4.7", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.rPDUOutletControlOutletCommand", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.3.1.1.4.7", NULL, SU_FLAG_OK, NULL), /* rPDUOutletControlOutletCommand.8 = INTEGER: immediateOn(1) */ - { "unmapped.rPDUOutletControlOutletCommand", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.3.1.1.4.8", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.rPDUOutletControlOutletCommand", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.3.1.1.4.8", NULL, SU_FLAG_OK, NULL), /* rPDUOutletControlOutletBank.1 = INTEGER: 0 */ - { "unmapped.rPDUOutletControlOutletBank", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.3.1.1.5.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.rPDUOutletControlOutletBank", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.3.1.1.5.1", NULL, SU_FLAG_OK, NULL), /* rPDUOutletControlOutletBank.2 = INTEGER: 0 */ - { "unmapped.rPDUOutletControlOutletBank", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.3.1.1.5.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.rPDUOutletControlOutletBank", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.3.1.1.5.2", NULL, SU_FLAG_OK, NULL), /* rPDUOutletControlOutletBank.3 = INTEGER: 0 */ - { "unmapped.rPDUOutletControlOutletBank", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.3.1.1.5.3", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.rPDUOutletControlOutletBank", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.3.1.1.5.3", NULL, SU_FLAG_OK, NULL), /* rPDUOutletControlOutletBank.4 = INTEGER: 0 */ - { "unmapped.rPDUOutletControlOutletBank", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.3.1.1.5.4", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.rPDUOutletControlOutletBank", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.3.1.1.5.4", NULL, SU_FLAG_OK, NULL), /* rPDUOutletControlOutletBank.5 = INTEGER: 0 */ - { "unmapped.rPDUOutletControlOutletBank", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.3.1.1.5.5", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.rPDUOutletControlOutletBank", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.3.1.1.5.5", NULL, SU_FLAG_OK, NULL), /* rPDUOutletControlOutletBank.6 = INTEGER: 0 */ - { "unmapped.rPDUOutletControlOutletBank", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.3.1.1.5.6", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.rPDUOutletControlOutletBank", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.3.1.1.5.6", NULL, SU_FLAG_OK, NULL), /* rPDUOutletControlOutletBank.7 = INTEGER: 0 */ - { "unmapped.rPDUOutletControlOutletBank", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.3.1.1.5.7", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.rPDUOutletControlOutletBank", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.3.1.1.5.7", NULL, SU_FLAG_OK, NULL), /* rPDUOutletControlOutletBank.8 = INTEGER: 0 */ - { "unmapped.rPDUOutletControlOutletBank", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.3.1.1.5.8", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.rPDUOutletControlOutletBank", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.3.1.1.5.8", NULL, SU_FLAG_OK, NULL), /* rPDUOutletConfigIndex.1 = INTEGER: 1 */ - { "unmapped.rPDUOutletConfigIndex", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.4.1.1.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.rPDUOutletConfigIndex", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.4.1.1.1.1", NULL, SU_FLAG_OK, NULL), /* rPDUOutletConfigIndex.2 = INTEGER: 2 */ - { "unmapped.rPDUOutletConfigIndex", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.4.1.1.1.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.rPDUOutletConfigIndex", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.4.1.1.1.2", NULL, SU_FLAG_OK, NULL), /* rPDUOutletConfigIndex.3 = INTEGER: 3 */ - { "unmapped.rPDUOutletConfigIndex", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.4.1.1.1.3", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.rPDUOutletConfigIndex", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.4.1.1.1.3", NULL, SU_FLAG_OK, NULL), /* rPDUOutletConfigIndex.4 = INTEGER: 4 */ - { "unmapped.rPDUOutletConfigIndex", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.4.1.1.1.4", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.rPDUOutletConfigIndex", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.4.1.1.1.4", NULL, SU_FLAG_OK, NULL), /* rPDUOutletConfigIndex.5 = INTEGER: 5 */ - { "unmapped.rPDUOutletConfigIndex", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.4.1.1.1.5", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.rPDUOutletConfigIndex", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.4.1.1.1.5", NULL, SU_FLAG_OK, NULL), /* rPDUOutletConfigIndex.6 = INTEGER: 6 */ - { "unmapped.rPDUOutletConfigIndex", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.4.1.1.1.6", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.rPDUOutletConfigIndex", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.4.1.1.1.6", NULL, SU_FLAG_OK, NULL), /* rPDUOutletConfigIndex.7 = INTEGER: 7 */ - { "unmapped.rPDUOutletConfigIndex", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.4.1.1.1.7", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.rPDUOutletConfigIndex", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.4.1.1.1.7", NULL, SU_FLAG_OK, NULL), /* rPDUOutletConfigIndex.8 = INTEGER: 8 */ - { "unmapped.rPDUOutletConfigIndex", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.4.1.1.1.8", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.rPDUOutletConfigIndex", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.4.1.1.1.8", NULL, SU_FLAG_OK, NULL), /* rPDUOutletConfigOutletName.1 = STRING: "Testing Name" */ - { "unmapped.rPDUOutletConfigOutletName", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.1.12.3.4.1.1.2.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.rPDUOutletConfigOutletName", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.1.12.3.4.1.1.2.1", NULL, SU_FLAG_OK, NULL), /* rPDUOutletConfigOutletName.2 = STRING: "Testing 2" */ - { "unmapped.rPDUOutletConfigOutletName", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.1.12.3.4.1.1.2.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.rPDUOutletConfigOutletName", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.1.12.3.4.1.1.2.2", NULL, SU_FLAG_OK, NULL), /* rPDUOutletConfigOutletName.3 = STRING: "Outlet 3" */ - { "unmapped.rPDUOutletConfigOutletName", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.1.12.3.4.1.1.2.3", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.rPDUOutletConfigOutletName", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.1.12.3.4.1.1.2.3", NULL, SU_FLAG_OK, NULL), /* rPDUOutletConfigOutletName.4 = STRING: "Outlet 4" */ - { "unmapped.rPDUOutletConfigOutletName", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.1.12.3.4.1.1.2.4", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.rPDUOutletConfigOutletName", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.1.12.3.4.1.1.2.4", NULL, SU_FLAG_OK, NULL), /* rPDUOutletConfigOutletName.5 = STRING: "Outlet 5" */ - { "unmapped.rPDUOutletConfigOutletName", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.1.12.3.4.1.1.2.5", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.rPDUOutletConfigOutletName", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.1.12.3.4.1.1.2.5", NULL, SU_FLAG_OK, NULL), /* rPDUOutletConfigOutletName.6 = STRING: "Outlet 6" */ - { "unmapped.rPDUOutletConfigOutletName", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.1.12.3.4.1.1.2.6", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.rPDUOutletConfigOutletName", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.1.12.3.4.1.1.2.6", NULL, SU_FLAG_OK, NULL), /* rPDUOutletConfigOutletName.7 = STRING: "Outlet 7" */ - { "unmapped.rPDUOutletConfigOutletName", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.1.12.3.4.1.1.2.7", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.rPDUOutletConfigOutletName", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.1.12.3.4.1.1.2.7", NULL, SU_FLAG_OK, NULL), /* rPDUOutletConfigOutletName.8 = STRING: "Outlet 8" */ - { "unmapped.rPDUOutletConfigOutletName", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.1.12.3.4.1.1.2.8", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.rPDUOutletConfigOutletName", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.1.12.3.4.1.1.2.8", NULL, SU_FLAG_OK, NULL), /* rPDUOutletConfigOutletPhase.1 = INTEGER: phase1(1) */ - { "unmapped.rPDUOutletConfigOutletPhase", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.4.1.1.3.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.rPDUOutletConfigOutletPhase", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.4.1.1.3.1", NULL, SU_FLAG_OK, NULL), /* rPDUOutletConfigOutletPhase.2 = INTEGER: phase1(1) */ - { "unmapped.rPDUOutletConfigOutletPhase", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.4.1.1.3.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.rPDUOutletConfigOutletPhase", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.4.1.1.3.2", NULL, SU_FLAG_OK, NULL), /* rPDUOutletConfigOutletPhase.3 = INTEGER: phase1(1) */ - { "unmapped.rPDUOutletConfigOutletPhase", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.4.1.1.3.3", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.rPDUOutletConfigOutletPhase", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.4.1.1.3.3", NULL, SU_FLAG_OK, NULL), /* rPDUOutletConfigOutletPhase.4 = INTEGER: phase1(1) */ - { "unmapped.rPDUOutletConfigOutletPhase", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.4.1.1.3.4", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.rPDUOutletConfigOutletPhase", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.4.1.1.3.4", NULL, SU_FLAG_OK, NULL), /* rPDUOutletConfigOutletPhase.5 = INTEGER: phase1(1) */ - { "unmapped.rPDUOutletConfigOutletPhase", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.4.1.1.3.5", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.rPDUOutletConfigOutletPhase", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.4.1.1.3.5", NULL, SU_FLAG_OK, NULL), /* rPDUOutletConfigOutletPhase.6 = INTEGER: phase1(1) */ - { "unmapped.rPDUOutletConfigOutletPhase", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.4.1.1.3.6", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.rPDUOutletConfigOutletPhase", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.4.1.1.3.6", NULL, SU_FLAG_OK, NULL), /* rPDUOutletConfigOutletPhase.7 = INTEGER: phase1(1) */ - { "unmapped.rPDUOutletConfigOutletPhase", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.4.1.1.3.7", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.rPDUOutletConfigOutletPhase", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.4.1.1.3.7", NULL, SU_FLAG_OK, NULL), /* rPDUOutletConfigOutletPhase.8 = INTEGER: phase1(1) */ - { "unmapped.rPDUOutletConfigOutletPhase", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.4.1.1.3.8", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.rPDUOutletConfigOutletPhase", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.4.1.1.3.8", NULL, SU_FLAG_OK, NULL), /* rPDUOutletConfigPowerOnTime.1 = INTEGER: 0 */ - { "unmapped.rPDUOutletConfigPowerOnTime", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.4.1.1.4.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.rPDUOutletConfigPowerOnTime", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.4.1.1.4.1", NULL, SU_FLAG_OK, NULL), /* rPDUOutletConfigPowerOnTime.2 = INTEGER: 0 */ - { "unmapped.rPDUOutletConfigPowerOnTime", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.4.1.1.4.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.rPDUOutletConfigPowerOnTime", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.4.1.1.4.2", NULL, SU_FLAG_OK, NULL), /* rPDUOutletConfigPowerOnTime.3 = INTEGER: 0 */ - { "unmapped.rPDUOutletConfigPowerOnTime", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.4.1.1.4.3", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.rPDUOutletConfigPowerOnTime", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.4.1.1.4.3", NULL, SU_FLAG_OK, NULL), /* rPDUOutletConfigPowerOnTime.4 = INTEGER: 0 */ - { "unmapped.rPDUOutletConfigPowerOnTime", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.4.1.1.4.4", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.rPDUOutletConfigPowerOnTime", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.4.1.1.4.4", NULL, SU_FLAG_OK, NULL), /* rPDUOutletConfigPowerOnTime.5 = INTEGER: 0 */ - { "unmapped.rPDUOutletConfigPowerOnTime", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.4.1.1.4.5", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.rPDUOutletConfigPowerOnTime", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.4.1.1.4.5", NULL, SU_FLAG_OK, NULL), /* rPDUOutletConfigPowerOnTime.6 = INTEGER: 0 */ - { "unmapped.rPDUOutletConfigPowerOnTime", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.4.1.1.4.6", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.rPDUOutletConfigPowerOnTime", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.4.1.1.4.6", NULL, SU_FLAG_OK, NULL), /* rPDUOutletConfigPowerOnTime.7 = INTEGER: 0 */ - { "unmapped.rPDUOutletConfigPowerOnTime", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.4.1.1.4.7", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.rPDUOutletConfigPowerOnTime", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.4.1.1.4.7", NULL, SU_FLAG_OK, NULL), /* rPDUOutletConfigPowerOnTime.8 = INTEGER: 0 */ - { "unmapped.rPDUOutletConfigPowerOnTime", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.4.1.1.4.8", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.rPDUOutletConfigPowerOnTime", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.4.1.1.4.8", NULL, SU_FLAG_OK, NULL), /* rPDUOutletConfigPowerOffTime.1 = INTEGER: 0 */ - { "unmapped.rPDUOutletConfigPowerOffTime", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.4.1.1.5.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.rPDUOutletConfigPowerOffTime", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.4.1.1.5.1", NULL, SU_FLAG_OK, NULL), /* rPDUOutletConfigPowerOffTime.2 = INTEGER: 0 */ - { "unmapped.rPDUOutletConfigPowerOffTime", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.4.1.1.5.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.rPDUOutletConfigPowerOffTime", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.4.1.1.5.2", NULL, SU_FLAG_OK, NULL), /* rPDUOutletConfigPowerOffTime.3 = INTEGER: 0 */ - { "unmapped.rPDUOutletConfigPowerOffTime", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.4.1.1.5.3", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.rPDUOutletConfigPowerOffTime", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.4.1.1.5.3", NULL, SU_FLAG_OK, NULL), /* rPDUOutletConfigPowerOffTime.4 = INTEGER: 0 */ - { "unmapped.rPDUOutletConfigPowerOffTime", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.4.1.1.5.4", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.rPDUOutletConfigPowerOffTime", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.4.1.1.5.4", NULL, SU_FLAG_OK, NULL), /* rPDUOutletConfigPowerOffTime.5 = INTEGER: 0 */ - { "unmapped.rPDUOutletConfigPowerOffTime", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.4.1.1.5.5", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.rPDUOutletConfigPowerOffTime", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.4.1.1.5.5", NULL, SU_FLAG_OK, NULL), /* rPDUOutletConfigPowerOffTime.6 = INTEGER: 0 */ - { "unmapped.rPDUOutletConfigPowerOffTime", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.4.1.1.5.6", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.rPDUOutletConfigPowerOffTime", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.4.1.1.5.6", NULL, SU_FLAG_OK, NULL), /* rPDUOutletConfigPowerOffTime.7 = INTEGER: 0 */ - { "unmapped.rPDUOutletConfigPowerOffTime", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.4.1.1.5.7", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.rPDUOutletConfigPowerOffTime", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.4.1.1.5.7", NULL, SU_FLAG_OK, NULL), /* rPDUOutletConfigPowerOffTime.8 = INTEGER: 0 */ - { "unmapped.rPDUOutletConfigPowerOffTime", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.4.1.1.5.8", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.rPDUOutletConfigPowerOffTime", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.4.1.1.5.8", NULL, SU_FLAG_OK, NULL), /* rPDUOutletConfigRebootDuration.1 = INTEGER: 5 */ - { "unmapped.rPDUOutletConfigRebootDuration", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.4.1.1.6.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.rPDUOutletConfigRebootDuration", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.4.1.1.6.1", NULL, SU_FLAG_OK, NULL), /* rPDUOutletConfigRebootDuration.2 = INTEGER: 5 */ - { "unmapped.rPDUOutletConfigRebootDuration", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.4.1.1.6.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.rPDUOutletConfigRebootDuration", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.4.1.1.6.2", NULL, SU_FLAG_OK, NULL), /* rPDUOutletConfigRebootDuration.3 = INTEGER: 5 */ - { "unmapped.rPDUOutletConfigRebootDuration", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.4.1.1.6.3", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.rPDUOutletConfigRebootDuration", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.4.1.1.6.3", NULL, SU_FLAG_OK, NULL), /* rPDUOutletConfigRebootDuration.4 = INTEGER: 5 */ - { "unmapped.rPDUOutletConfigRebootDuration", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.4.1.1.6.4", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.rPDUOutletConfigRebootDuration", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.4.1.1.6.4", NULL, SU_FLAG_OK, NULL), /* rPDUOutletConfigRebootDuration.5 = INTEGER: 5 */ - { "unmapped.rPDUOutletConfigRebootDuration", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.4.1.1.6.5", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.rPDUOutletConfigRebootDuration", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.4.1.1.6.5", NULL, SU_FLAG_OK, NULL), /* rPDUOutletConfigRebootDuration.6 = INTEGER: 5 */ - { "unmapped.rPDUOutletConfigRebootDuration", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.4.1.1.6.6", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.rPDUOutletConfigRebootDuration", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.4.1.1.6.6", NULL, SU_FLAG_OK, NULL), /* rPDUOutletConfigRebootDuration.7 = INTEGER: 5 */ - { "unmapped.rPDUOutletConfigRebootDuration", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.4.1.1.6.7", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.rPDUOutletConfigRebootDuration", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.4.1.1.6.7", NULL, SU_FLAG_OK, NULL), /* rPDUOutletConfigRebootDuration.8 = INTEGER: 5 */ - { "unmapped.rPDUOutletConfigRebootDuration", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.4.1.1.6.8", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.rPDUOutletConfigRebootDuration", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.4.1.1.6.8", NULL, SU_FLAG_OK, NULL), /* rPDUOutletConfigOutletBank.1 = INTEGER: 0 */ - { "unmapped.rPDUOutletConfigOutletBank", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.4.1.1.7.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.rPDUOutletConfigOutletBank", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.4.1.1.7.1", NULL, SU_FLAG_OK, NULL), /* rPDUOutletConfigOutletBank.2 = INTEGER: 0 */ - { "unmapped.rPDUOutletConfigOutletBank", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.4.1.1.7.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.rPDUOutletConfigOutletBank", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.4.1.1.7.2", NULL, SU_FLAG_OK, NULL), /* rPDUOutletConfigOutletBank.3 = INTEGER: 0 */ - { "unmapped.rPDUOutletConfigOutletBank", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.4.1.1.7.3", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.rPDUOutletConfigOutletBank", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.4.1.1.7.3", NULL, SU_FLAG_OK, NULL), /* rPDUOutletConfigOutletBank.4 = INTEGER: 0 */ - { "unmapped.rPDUOutletConfigOutletBank", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.4.1.1.7.4", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.rPDUOutletConfigOutletBank", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.4.1.1.7.4", NULL, SU_FLAG_OK, NULL), /* rPDUOutletConfigOutletBank.5 = INTEGER: 0 */ - { "unmapped.rPDUOutletConfigOutletBank", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.4.1.1.7.5", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.rPDUOutletConfigOutletBank", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.4.1.1.7.5", NULL, SU_FLAG_OK, NULL), /* rPDUOutletConfigOutletBank.6 = INTEGER: 0 */ - { "unmapped.rPDUOutletConfigOutletBank", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.4.1.1.7.6", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.rPDUOutletConfigOutletBank", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.4.1.1.7.6", NULL, SU_FLAG_OK, NULL), /* rPDUOutletConfigOutletBank.7 = INTEGER: 0 */ - { "unmapped.rPDUOutletConfigOutletBank", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.4.1.1.7.7", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.rPDUOutletConfigOutletBank", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.4.1.1.7.7", NULL, SU_FLAG_OK, NULL), /* rPDUOutletConfigOutletBank.8 = INTEGER: 0 */ - { "unmapped.rPDUOutletConfigOutletBank", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.4.1.1.7.8", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.rPDUOutletConfigOutletBank", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.4.1.1.7.8", NULL, SU_FLAG_OK, NULL), /* rPDUOutletConfigMonitoredTableSize.0 = INTEGER: 0 */ - { "unmapped.rPDUOutletConfigMonitoredTableSize", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.4.2.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.rPDUOutletConfigMonitoredTableSize", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.4.2.0", NULL, SU_FLAG_OK, NULL), /* rPDUOutletStatusIndex.1 = INTEGER: 1 */ - { "unmapped.rPDUOutletStatusIndex", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.5.1.1.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.rPDUOutletStatusIndex", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.5.1.1.1.1", NULL, SU_FLAG_OK, NULL), /* rPDUOutletStatusIndex.2 = INTEGER: 2 */ - { "unmapped.rPDUOutletStatusIndex", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.5.1.1.1.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.rPDUOutletStatusIndex", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.5.1.1.1.2", NULL, SU_FLAG_OK, NULL), /* rPDUOutletStatusIndex.3 = INTEGER: 3 */ - { "unmapped.rPDUOutletStatusIndex", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.5.1.1.1.3", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.rPDUOutletStatusIndex", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.5.1.1.1.3", NULL, SU_FLAG_OK, NULL), /* rPDUOutletStatusIndex.4 = INTEGER: 4 */ - { "unmapped.rPDUOutletStatusIndex", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.5.1.1.1.4", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.rPDUOutletStatusIndex", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.5.1.1.1.4", NULL, SU_FLAG_OK, NULL), /* rPDUOutletStatusIndex.5 = INTEGER: 5 */ - { "unmapped.rPDUOutletStatusIndex", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.5.1.1.1.5", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.rPDUOutletStatusIndex", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.5.1.1.1.5", NULL, SU_FLAG_OK, NULL), /* rPDUOutletStatusIndex.6 = INTEGER: 6 */ - { "unmapped.rPDUOutletStatusIndex", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.5.1.1.1.6", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.rPDUOutletStatusIndex", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.5.1.1.1.6", NULL, SU_FLAG_OK, NULL), /* rPDUOutletStatusIndex.7 = INTEGER: 7 */ - { "unmapped.rPDUOutletStatusIndex", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.5.1.1.1.7", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.rPDUOutletStatusIndex", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.5.1.1.1.7", NULL, SU_FLAG_OK, NULL), /* rPDUOutletStatusIndex.8 = INTEGER: 8 */ - { "unmapped.rPDUOutletStatusIndex", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.5.1.1.1.8", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.rPDUOutletStatusIndex", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.5.1.1.1.8", NULL, SU_FLAG_OK, NULL), /* rPDUOutletStatusOutletName.1 = STRING: "Testing Name" */ - { "unmapped.rPDUOutletStatusOutletName", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.1.12.3.5.1.1.2.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.rPDUOutletStatusOutletName", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.1.12.3.5.1.1.2.1", NULL, SU_FLAG_OK, NULL), /* rPDUOutletStatusOutletName.2 = STRING: "Testing 2" */ - { "unmapped.rPDUOutletStatusOutletName", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.1.12.3.5.1.1.2.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.rPDUOutletStatusOutletName", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.1.12.3.5.1.1.2.2", NULL, SU_FLAG_OK, NULL), /* rPDUOutletStatusOutletName.3 = STRING: "Outlet 3" */ - { "unmapped.rPDUOutletStatusOutletName", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.1.12.3.5.1.1.2.3", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.rPDUOutletStatusOutletName", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.1.12.3.5.1.1.2.3", NULL, SU_FLAG_OK, NULL), /* rPDUOutletStatusOutletName.4 = STRING: "Outlet 4" */ - { "unmapped.rPDUOutletStatusOutletName", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.1.12.3.5.1.1.2.4", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.rPDUOutletStatusOutletName", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.1.12.3.5.1.1.2.4", NULL, SU_FLAG_OK, NULL), /* rPDUOutletStatusOutletName.5 = STRING: "Outlet 5" */ - { "unmapped.rPDUOutletStatusOutletName", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.1.12.3.5.1.1.2.5", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.rPDUOutletStatusOutletName", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.1.12.3.5.1.1.2.5", NULL, SU_FLAG_OK, NULL), /* rPDUOutletStatusOutletName.6 = STRING: "Outlet 6" */ - { "unmapped.rPDUOutletStatusOutletName", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.1.12.3.5.1.1.2.6", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.rPDUOutletStatusOutletName", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.1.12.3.5.1.1.2.6", NULL, SU_FLAG_OK, NULL), /* rPDUOutletStatusOutletName.7 = STRING: "Outlet 7" */ - { "unmapped.rPDUOutletStatusOutletName", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.1.12.3.5.1.1.2.7", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.rPDUOutletStatusOutletName", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.1.12.3.5.1.1.2.7", NULL, SU_FLAG_OK, NULL), /* rPDUOutletStatusOutletName.8 = STRING: "Outlet 8" */ - { "unmapped.rPDUOutletStatusOutletName", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.1.12.3.5.1.1.2.8", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.rPDUOutletStatusOutletName", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.1.12.3.5.1.1.2.8", NULL, SU_FLAG_OK, NULL), /* rPDUOutletStatusOutletPhase.1 = INTEGER: phase1(1) */ - { "unmapped.rPDUOutletStatusOutletPhase", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.5.1.1.3.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.rPDUOutletStatusOutletPhase", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.5.1.1.3.1", NULL, SU_FLAG_OK, NULL), /* rPDUOutletStatusOutletPhase.2 = INTEGER: phase1(1) */ - { "unmapped.rPDUOutletStatusOutletPhase", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.5.1.1.3.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.rPDUOutletStatusOutletPhase", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.5.1.1.3.2", NULL, SU_FLAG_OK, NULL), /* rPDUOutletStatusOutletPhase.3 = INTEGER: phase1(1) */ - { "unmapped.rPDUOutletStatusOutletPhase", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.5.1.1.3.3", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.rPDUOutletStatusOutletPhase", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.5.1.1.3.3", NULL, SU_FLAG_OK, NULL), /* rPDUOutletStatusOutletPhase.4 = INTEGER: phase1(1) */ - { "unmapped.rPDUOutletStatusOutletPhase", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.5.1.1.3.4", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.rPDUOutletStatusOutletPhase", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.5.1.1.3.4", NULL, SU_FLAG_OK, NULL), /* rPDUOutletStatusOutletPhase.5 = INTEGER: phase1(1) */ - { "unmapped.rPDUOutletStatusOutletPhase", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.5.1.1.3.5", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.rPDUOutletStatusOutletPhase", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.5.1.1.3.5", NULL, SU_FLAG_OK, NULL), /* rPDUOutletStatusOutletPhase.6 = INTEGER: phase1(1) */ - { "unmapped.rPDUOutletStatusOutletPhase", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.5.1.1.3.6", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.rPDUOutletStatusOutletPhase", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.5.1.1.3.6", NULL, SU_FLAG_OK, NULL), /* rPDUOutletStatusOutletPhase.7 = INTEGER: phase1(1) */ - { "unmapped.rPDUOutletStatusOutletPhase", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.5.1.1.3.7", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.rPDUOutletStatusOutletPhase", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.5.1.1.3.7", NULL, SU_FLAG_OK, NULL), /* rPDUOutletStatusOutletPhase.8 = INTEGER: phase1(1) */ - { "unmapped.rPDUOutletStatusOutletPhase", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.5.1.1.3.8", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.rPDUOutletStatusOutletPhase", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.5.1.1.3.8", NULL, SU_FLAG_OK, NULL), /* rPDUOutletStatusOutletState.1 = INTEGER: outletStatusOn(1) */ - { "unmapped.rPDUOutletStatusOutletState", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.5.1.1.4.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.rPDUOutletStatusOutletState", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.5.1.1.4.1", NULL, SU_FLAG_OK, NULL), /* rPDUOutletStatusOutletState.2 = INTEGER: outletStatusOn(1) */ - { "unmapped.rPDUOutletStatusOutletState", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.5.1.1.4.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.rPDUOutletStatusOutletState", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.5.1.1.4.2", NULL, SU_FLAG_OK, NULL), /* rPDUOutletStatusOutletState.3 = INTEGER: outletStatusOn(1) */ - { "unmapped.rPDUOutletStatusOutletState", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.5.1.1.4.3", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.rPDUOutletStatusOutletState", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.5.1.1.4.3", NULL, SU_FLAG_OK, NULL), /* rPDUOutletStatusOutletState.4 = INTEGER: outletStatusOn(1) */ - { "unmapped.rPDUOutletStatusOutletState", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.5.1.1.4.4", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.rPDUOutletStatusOutletState", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.5.1.1.4.4", NULL, SU_FLAG_OK, NULL), /* rPDUOutletStatusOutletState.5 = INTEGER: outletStatusOn(1) */ - { "unmapped.rPDUOutletStatusOutletState", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.5.1.1.4.5", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.rPDUOutletStatusOutletState", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.5.1.1.4.5", NULL, SU_FLAG_OK, NULL), /* rPDUOutletStatusOutletState.6 = INTEGER: outletStatusOn(1) */ - { "unmapped.rPDUOutletStatusOutletState", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.5.1.1.4.6", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.rPDUOutletStatusOutletState", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.5.1.1.4.6", NULL, SU_FLAG_OK, NULL), /* rPDUOutletStatusOutletState.7 = INTEGER: outletStatusOn(1) */ - { "unmapped.rPDUOutletStatusOutletState", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.5.1.1.4.7", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.rPDUOutletStatusOutletState", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.5.1.1.4.7", NULL, SU_FLAG_OK, NULL), /* rPDUOutletStatusOutletState.8 = INTEGER: outletStatusOn(1) */ - { "unmapped.rPDUOutletStatusOutletState", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.5.1.1.4.8", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.rPDUOutletStatusOutletState", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.5.1.1.4.8", NULL, SU_FLAG_OK, NULL), /* rPDUOutletStatusCommandPending.1 = INTEGER: outletStatusNoCommandPending(2) */ - { "unmapped.rPDUOutletStatusCommandPending", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.5.1.1.5.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.rPDUOutletStatusCommandPending", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.5.1.1.5.1", NULL, SU_FLAG_OK, NULL), /* rPDUOutletStatusCommandPending.2 = INTEGER: outletStatusNoCommandPending(2) */ - { "unmapped.rPDUOutletStatusCommandPending", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.5.1.1.5.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.rPDUOutletStatusCommandPending", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.5.1.1.5.2", NULL, SU_FLAG_OK, NULL), /* rPDUOutletStatusCommandPending.3 = INTEGER: outletStatusNoCommandPending(2) */ - { "unmapped.rPDUOutletStatusCommandPending", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.5.1.1.5.3", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.rPDUOutletStatusCommandPending", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.5.1.1.5.3", NULL, SU_FLAG_OK, NULL), /* rPDUOutletStatusCommandPending.4 = INTEGER: outletStatusNoCommandPending(2) */ - { "unmapped.rPDUOutletStatusCommandPending", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.5.1.1.5.4", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.rPDUOutletStatusCommandPending", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.5.1.1.5.4", NULL, SU_FLAG_OK, NULL), /* rPDUOutletStatusCommandPending.5 = INTEGER: outletStatusNoCommandPending(2) */ - { "unmapped.rPDUOutletStatusCommandPending", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.5.1.1.5.5", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.rPDUOutletStatusCommandPending", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.5.1.1.5.5", NULL, SU_FLAG_OK, NULL), /* rPDUOutletStatusCommandPending.6 = INTEGER: outletStatusNoCommandPending(2) */ - { "unmapped.rPDUOutletStatusCommandPending", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.5.1.1.5.6", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.rPDUOutletStatusCommandPending", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.5.1.1.5.6", NULL, SU_FLAG_OK, NULL), /* rPDUOutletStatusCommandPending.7 = INTEGER: outletStatusNoCommandPending(2) */ - { "unmapped.rPDUOutletStatusCommandPending", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.5.1.1.5.7", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.rPDUOutletStatusCommandPending", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.5.1.1.5.7", NULL, SU_FLAG_OK, NULL), /* rPDUOutletStatusCommandPending.8 = INTEGER: outletStatusNoCommandPending(2) */ - { "unmapped.rPDUOutletStatusCommandPending", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.5.1.1.5.8", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.rPDUOutletStatusCommandPending", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.5.1.1.5.8", NULL, SU_FLAG_OK, NULL), /* rPDUOutletStatusOutletBank.1 = INTEGER: 0 */ - { "unmapped.rPDUOutletStatusOutletBank", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.5.1.1.6.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.rPDUOutletStatusOutletBank", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.5.1.1.6.1", NULL, SU_FLAG_OK, NULL), /* rPDUOutletStatusOutletBank.2 = INTEGER: 0 */ - { "unmapped.rPDUOutletStatusOutletBank", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.5.1.1.6.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.rPDUOutletStatusOutletBank", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.5.1.1.6.2", NULL, SU_FLAG_OK, NULL), /* rPDUOutletStatusOutletBank.3 = INTEGER: 0 */ - { "unmapped.rPDUOutletStatusOutletBank", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.5.1.1.6.3", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.rPDUOutletStatusOutletBank", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.5.1.1.6.3", NULL, SU_FLAG_OK, NULL), /* rPDUOutletStatusOutletBank.4 = INTEGER: 0 */ - { "unmapped.rPDUOutletStatusOutletBank", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.5.1.1.6.4", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.rPDUOutletStatusOutletBank", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.5.1.1.6.4", NULL, SU_FLAG_OK, NULL), /* rPDUOutletStatusOutletBank.5 = INTEGER: 0 */ - { "unmapped.rPDUOutletStatusOutletBank", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.5.1.1.6.5", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.rPDUOutletStatusOutletBank", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.5.1.1.6.5", NULL, SU_FLAG_OK, NULL), /* rPDUOutletStatusOutletBank.6 = INTEGER: 0 */ - { "unmapped.rPDUOutletStatusOutletBank", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.5.1.1.6.6", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.rPDUOutletStatusOutletBank", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.5.1.1.6.6", NULL, SU_FLAG_OK, NULL), /* rPDUOutletStatusOutletBank.7 = INTEGER: 0 */ - { "unmapped.rPDUOutletStatusOutletBank", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.5.1.1.6.7", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.rPDUOutletStatusOutletBank", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.5.1.1.6.7", NULL, SU_FLAG_OK, NULL), /* rPDUOutletStatusOutletBank.8 = INTEGER: 0 */ - { "unmapped.rPDUOutletStatusOutletBank", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.5.1.1.6.8", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.rPDUOutletStatusOutletBank", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.5.1.1.6.8", NULL, SU_FLAG_OK, NULL), /* rPDUOutletStatusLoad.1 = Gauge32: 0 */ - { "unmapped.rPDUOutletStatusLoad", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.5.1.1.7.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.rPDUOutletStatusLoad", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.5.1.1.7.1", NULL, SU_FLAG_OK, NULL), /* rPDUOutletStatusLoad.2 = Gauge32: 0 */ - { "unmapped.rPDUOutletStatusLoad", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.5.1.1.7.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.rPDUOutletStatusLoad", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.5.1.1.7.2", NULL, SU_FLAG_OK, NULL), /* rPDUOutletStatusLoad.3 = Gauge32: 0 */ - { "unmapped.rPDUOutletStatusLoad", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.5.1.1.7.3", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.rPDUOutletStatusLoad", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.5.1.1.7.3", NULL, SU_FLAG_OK, NULL), /* rPDUOutletStatusLoad.4 = Gauge32: 0 */ - { "unmapped.rPDUOutletStatusLoad", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.5.1.1.7.4", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.rPDUOutletStatusLoad", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.5.1.1.7.4", NULL, SU_FLAG_OK, NULL), /* rPDUOutletStatusLoad.5 = Gauge32: 0 */ - { "unmapped.rPDUOutletStatusLoad", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.5.1.1.7.5", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.rPDUOutletStatusLoad", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.5.1.1.7.5", NULL, SU_FLAG_OK, NULL), /* rPDUOutletStatusLoad.6 = Gauge32: 0 */ - { "unmapped.rPDUOutletStatusLoad", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.5.1.1.7.6", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.rPDUOutletStatusLoad", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.5.1.1.7.6", NULL, SU_FLAG_OK, NULL), /* rPDUOutletStatusLoad.7 = Gauge32: 0 */ - { "unmapped.rPDUOutletStatusLoad", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.5.1.1.7.7", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.rPDUOutletStatusLoad", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.5.1.1.7.7", NULL, SU_FLAG_OK, NULL), /* rPDUOutletStatusLoad.8 = Gauge32: 0 */ - { "unmapped.rPDUOutletStatusLoad", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.5.1.1.7.8", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.rPDUOutletStatusLoad", 0, 1, ".1.3.6.1.4.1.318.1.1.12.3.5.1.1.7.8", NULL, SU_FLAG_OK, NULL), /* rPDUPowerSupply1Status.0 = INTEGER: powerSupplyOneOk(1) */ - { "unmapped.rPDUPowerSupply1Status", 0, 1, ".1.3.6.1.4.1.318.1.1.12.4.1.1.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.rPDUPowerSupply1Status", 0, 1, ".1.3.6.1.4.1.318.1.1.12.4.1.1.0", NULL, SU_FLAG_OK, NULL), /* rPDUPowerSupply2Status.0 = INTEGER: powerSupplyTwoOk(1) */ - { "unmapped.rPDUPowerSupply2Status", 0, 1, ".1.3.6.1.4.1.318.1.1.12.4.1.2.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.rPDUPowerSupply2Status", 0, 1, ".1.3.6.1.4.1.318.1.1.12.4.1.2.0", NULL, SU_FLAG_OK, NULL), /* rPDUPowerSupplyAlarm.0 = INTEGER: allAvailablePowerSuppliesOK(1) */ - { "unmapped.rPDUPowerSupplyAlarm", 0, 1, ".1.3.6.1.4.1.318.1.1.12.4.1.3.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.rPDUPowerSupplyAlarm", 0, 1, ".1.3.6.1.4.1.318.1.1.12.4.1.3.0", NULL, SU_FLAG_OK, NULL), /* rPDUStatusBankTableSize.0 = INTEGER: 0 */ - { "unmapped.rPDUStatusBankTableSize", 0, 1, ".1.3.6.1.4.1.318.1.1.12.5.1.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.rPDUStatusBankTableSize", 0, 1, ".1.3.6.1.4.1.318.1.1.12.5.1.0", NULL, SU_FLAG_OK, NULL), /* rPDUStatusPhaseTableSize.0 = INTEGER: 1 */ - { "unmapped.rPDUStatusPhaseTableSize", 0, 1, ".1.3.6.1.4.1.318.1.1.12.5.3.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.rPDUStatusPhaseTableSize", 0, 1, ".1.3.6.1.4.1.318.1.1.12.5.3.0", NULL, SU_FLAG_OK, NULL), /* rPDUStatusPhaseIndex.1 = INTEGER: 1 */ - { "unmapped.rPDUStatusPhaseIndex", 0, 1, ".1.3.6.1.4.1.318.1.1.12.5.4.1.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.rPDUStatusPhaseIndex", 0, 1, ".1.3.6.1.4.1.318.1.1.12.5.4.1.1.1", NULL, SU_FLAG_OK, NULL), /* rPDUStatusPhaseNumber.1 = INTEGER: 1 */ - { "unmapped.rPDUStatusPhaseNumber", 0, 1, ".1.3.6.1.4.1.318.1.1.12.5.4.1.2.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.rPDUStatusPhaseNumber", 0, 1, ".1.3.6.1.4.1.318.1.1.12.5.4.1.2.1", NULL, SU_FLAG_OK, NULL), /* rPDUStatusPhaseState.1 = INTEGER: phaseLoadNormal(1) */ - { "unmapped.rPDUStatusPhaseState", 0, 1, ".1.3.6.1.4.1.318.1.1.12.5.4.1.3.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.rPDUStatusPhaseState", 0, 1, ".1.3.6.1.4.1.318.1.1.12.5.4.1.3.1", NULL, SU_FLAG_OK, NULL), /* rPDUStatusOutletTableSize.0 = INTEGER: 0 */ - { "unmapped.rPDUStatusOutletTableSize", 0, 1, ".1.3.6.1.4.1.318.1.1.12.5.5.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.rPDUStatusOutletTableSize", 0, 1, ".1.3.6.1.4.1.318.1.1.12.5.5.0", NULL, SU_FLAG_OK, NULL), /* experimental.2.1.0 = INTEGER: 1 */ - { "unmapped.experimental", 0, 1, ".1.3.6.1.4.1.318.1.4.2.1.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.experimental", 0, 1, ".1.3.6.1.4.1.318.1.4.2.1.0", NULL, SU_FLAG_OK, NULL), /* experimental.2.2.1.1.1 = INTEGER: 1 */ - { "unmapped.experimental", 0, 1, ".1.3.6.1.4.1.318.1.4.2.2.1.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.experimental", 0, 1, ".1.3.6.1.4.1.318.1.4.2.2.1.1.1", NULL, SU_FLAG_OK, NULL), /* experimental.2.2.1.2.1 = STRING: "Rack PDU_ISX" */ - { "unmapped.experimental", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.4.2.2.1.2.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.experimental", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.4.2.2.1.2.1", NULL, SU_FLAG_OK, NULL), /* experimental.2.2.1.3.1 = STRING: "5A1234E00874" */ - { "unmapped.experimental", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.4.2.2.1.3.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.experimental", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.4.2.2.1.3.1", NULL, SU_FLAG_OK, NULL), /* experimental.2.2.1.4.1 = INTEGER: 2 */ - { "unmapped.experimental", 0, 1, ".1.3.6.1.4.1.318.1.4.2.2.1.4.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.experimental", 0, 1, ".1.3.6.1.4.1.318.1.4.2.2.1.4.1", NULL, SU_FLAG_OK, NULL), /* experimental.2.2.1.5.1 = STRING: "Rack PDU" */ - { "unmapped.experimental", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.4.2.2.1.5.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.experimental", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.4.2.2.1.5.1", NULL, SU_FLAG_OK, NULL), /* experimental.2.2.1.6.1 = STRING: "1" */ - { "unmapped.experimental", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.4.2.2.1.6.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.experimental", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.4.2.2.1.6.1", NULL, SU_FLAG_OK, NULL), /* experimental.2.2.1.7.1 = STRING: "Unknown" */ - { "unmapped.experimental", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.4.2.2.1.7.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.experimental", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.4.2.2.1.7.1", NULL, SU_FLAG_OK, NULL), /* experimental.2.2.1.8.1 = INTEGER: 255 */ - { "unmapped.experimental", 0, 1, ".1.3.6.1.4.1.318.1.4.2.2.1.8.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.experimental", 0, 1, ".1.3.6.1.4.1.318.1.4.2.2.1.8.1", NULL, SU_FLAG_OK, NULL), /* experimental.2.2.1.9.1 = STRING: "RackPDU" */ - { "unmapped.experimental", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.4.2.2.1.9.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.experimental", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.4.2.2.1.9.1", NULL, SU_FLAG_OK, NULL), /* experimental.2.2.1.10.1 = INTEGER: 255 */ - { "unmapped.experimental", 0, 1, ".1.3.6.1.4.1.318.1.4.2.2.1.10.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.experimental", 0, 1, ".1.3.6.1.4.1.318.1.4.2.2.1.10.1", NULL, SU_FLAG_OK, NULL), /* experimental.2.2.1.11.1 = INTEGER: 1 */ - { "unmapped.experimental", 0, 1, ".1.3.6.1.4.1.318.1.4.2.2.1.11.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.experimental", 0, 1, ".1.3.6.1.4.1.318.1.4.2.2.1.11.1", NULL, SU_FLAG_OK, NULL), /* experimental.2.2.1.12.1 = STRING: "0" */ - { "unmapped.experimental", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.4.2.2.1.12.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.experimental", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.4.2.2.1.12.1", NULL, SU_FLAG_OK, NULL), /* experimental.2.2.1.13.1 = INTEGER: 1 */ - { "unmapped.experimental", 0, 1, ".1.3.6.1.4.1.318.1.4.2.2.1.13.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.experimental", 0, 1, ".1.3.6.1.4.1.318.1.4.2.2.1.13.1", NULL, SU_FLAG_OK, NULL), /* experimental.2.2.1.14.1 = STRING: "SB-1" */ - { "unmapped.experimental", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.4.2.2.1.14.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.experimental", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.4.2.2.1.14.1", NULL, SU_FLAG_OK, NULL), /* experimental.2.3.0 = INTEGER: 2 */ - { "unmapped.experimental", 0, 1, ".1.3.6.1.4.1.318.1.4.2.3.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.experimental", 0, 1, ".1.3.6.1.4.1.318.1.4.2.3.0", NULL, SU_FLAG_OK, NULL), /* experimental.2.4.1.1.1 = INTEGER: 1 */ - { "unmapped.experimental", 0, 1, ".1.3.6.1.4.1.318.1.4.2.4.1.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.experimental", 0, 1, ".1.3.6.1.4.1.318.1.4.2.4.1.1.1", NULL, SU_FLAG_OK, NULL), /* experimental.2.4.1.1.2 = INTEGER: 2 */ - { "unmapped.experimental", 0, 1, ".1.3.6.1.4.1.318.1.4.2.4.1.1.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.experimental", 0, 1, ".1.3.6.1.4.1.318.1.4.2.4.1.1.2", NULL, SU_FLAG_OK, NULL), /* experimental.2.4.1.2.1 = STRING: "5A1234E00874" */ - { "unmapped.experimental", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.4.2.4.1.2.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.experimental", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.4.2.4.1.2.1", NULL, SU_FLAG_OK, NULL), /* experimental.2.4.1.2.2 = STRING: "5A1234E00874" */ - { "unmapped.experimental", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.4.2.4.1.2.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.experimental", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.4.2.4.1.2.2", NULL, SU_FLAG_OK, NULL), /* experimental.2.4.1.3.1 = STRING: "apc_hw02_aos_373.bin" */ - { "unmapped.experimental", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.4.2.4.1.3.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.experimental", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.4.2.4.1.3.1", NULL, SU_FLAG_OK, NULL), /* experimental.2.4.1.3.2 = STRING: "apc_hw02_rpdu_373.bin" */ - { "unmapped.experimental", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.4.2.4.1.3.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.experimental", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.4.2.4.1.3.2", NULL, SU_FLAG_OK, NULL), /* experimental.2.4.1.4.1 = STRING: "v3.7.3" */ - { "unmapped.experimental", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.4.2.4.1.4.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.experimental", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.4.2.4.1.4.1", NULL, SU_FLAG_OK, NULL), /* experimental.2.4.1.4.2 = STRING: "v3.7.3" */ - { "unmapped.experimental", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.4.2.4.1.4.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.experimental", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.4.2.4.1.4.2", NULL, SU_FLAG_OK, NULL), /* experimental.2.5.0 = INTEGER: 19 */ - { "unmapped.experimental", 0, 1, ".1.3.6.1.4.1.318.1.4.2.5.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.experimental", 0, 1, ".1.3.6.1.4.1.318.1.4.2.5.0", NULL, SU_FLAG_OK, NULL), /* experimental.2.6.1.1.1 = INTEGER: 1 */ - { "unmapped.experimental", 0, 1, ".1.3.6.1.4.1.318.1.4.2.6.1.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.experimental", 0, 1, ".1.3.6.1.4.1.318.1.4.2.6.1.1.1", NULL, SU_FLAG_OK, NULL), /* experimental.2.6.1.1.2 = INTEGER: 2 */ - { "unmapped.experimental", 0, 1, ".1.3.6.1.4.1.318.1.4.2.6.1.1.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.experimental", 0, 1, ".1.3.6.1.4.1.318.1.4.2.6.1.1.2", NULL, SU_FLAG_OK, NULL), /* experimental.2.6.1.1.3 = INTEGER: 3 */ - { "unmapped.experimental", 0, 1, ".1.3.6.1.4.1.318.1.4.2.6.1.1.3", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.experimental", 0, 1, ".1.3.6.1.4.1.318.1.4.2.6.1.1.3", NULL, SU_FLAG_OK, NULL), /* experimental.2.6.1.1.4 = INTEGER: 4 */ - { "unmapped.experimental", 0, 1, ".1.3.6.1.4.1.318.1.4.2.6.1.1.4", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.experimental", 0, 1, ".1.3.6.1.4.1.318.1.4.2.6.1.1.4", NULL, SU_FLAG_OK, NULL), /* experimental.2.6.1.1.5 = INTEGER: 5 */ - { "unmapped.experimental", 0, 1, ".1.3.6.1.4.1.318.1.4.2.6.1.1.5", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.experimental", 0, 1, ".1.3.6.1.4.1.318.1.4.2.6.1.1.5", NULL, SU_FLAG_OK, NULL), /* experimental.2.6.1.1.6 = INTEGER: 6 */ - { "unmapped.experimental", 0, 1, ".1.3.6.1.4.1.318.1.4.2.6.1.1.6", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.experimental", 0, 1, ".1.3.6.1.4.1.318.1.4.2.6.1.1.6", NULL, SU_FLAG_OK, NULL), /* experimental.2.6.1.1.7 = INTEGER: 7 */ - { "unmapped.experimental", 0, 1, ".1.3.6.1.4.1.318.1.4.2.6.1.1.7", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.experimental", 0, 1, ".1.3.6.1.4.1.318.1.4.2.6.1.1.7", NULL, SU_FLAG_OK, NULL), /* experimental.2.6.1.1.8 = INTEGER: 8 */ - { "unmapped.experimental", 0, 1, ".1.3.6.1.4.1.318.1.4.2.6.1.1.8", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.experimental", 0, 1, ".1.3.6.1.4.1.318.1.4.2.6.1.1.8", NULL, SU_FLAG_OK, NULL), /* experimental.2.6.1.1.9 = INTEGER: 9 */ - { "unmapped.experimental", 0, 1, ".1.3.6.1.4.1.318.1.4.2.6.1.1.9", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.experimental", 0, 1, ".1.3.6.1.4.1.318.1.4.2.6.1.1.9", NULL, SU_FLAG_OK, NULL), /* experimental.2.6.1.1.10 = INTEGER: 10 */ - { "unmapped.experimental", 0, 1, ".1.3.6.1.4.1.318.1.4.2.6.1.1.10", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.experimental", 0, 1, ".1.3.6.1.4.1.318.1.4.2.6.1.1.10", NULL, SU_FLAG_OK, NULL), /* experimental.2.6.1.1.11 = INTEGER: 11 */ - { "unmapped.experimental", 0, 1, ".1.3.6.1.4.1.318.1.4.2.6.1.1.11", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.experimental", 0, 1, ".1.3.6.1.4.1.318.1.4.2.6.1.1.11", NULL, SU_FLAG_OK, NULL), /* experimental.2.6.1.1.12 = INTEGER: 12 */ - { "unmapped.experimental", 0, 1, ".1.3.6.1.4.1.318.1.4.2.6.1.1.12", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.experimental", 0, 1, ".1.3.6.1.4.1.318.1.4.2.6.1.1.12", NULL, SU_FLAG_OK, NULL), /* experimental.2.6.1.1.13 = INTEGER: 13 */ - { "unmapped.experimental", 0, 1, ".1.3.6.1.4.1.318.1.4.2.6.1.1.13", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.experimental", 0, 1, ".1.3.6.1.4.1.318.1.4.2.6.1.1.13", NULL, SU_FLAG_OK, NULL), /* experimental.2.6.1.1.14 = INTEGER: 14 */ - { "unmapped.experimental", 0, 1, ".1.3.6.1.4.1.318.1.4.2.6.1.1.14", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.experimental", 0, 1, ".1.3.6.1.4.1.318.1.4.2.6.1.1.14", NULL, SU_FLAG_OK, NULL), /* experimental.2.6.1.1.15 = INTEGER: 15 */ - { "unmapped.experimental", 0, 1, ".1.3.6.1.4.1.318.1.4.2.6.1.1.15", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.experimental", 0, 1, ".1.3.6.1.4.1.318.1.4.2.6.1.1.15", NULL, SU_FLAG_OK, NULL), /* experimental.2.6.1.1.16 = INTEGER: 16 */ - { "unmapped.experimental", 0, 1, ".1.3.6.1.4.1.318.1.4.2.6.1.1.16", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.experimental", 0, 1, ".1.3.6.1.4.1.318.1.4.2.6.1.1.16", NULL, SU_FLAG_OK, NULL), /* experimental.2.6.1.1.17 = INTEGER: 17 */ - { "unmapped.experimental", 0, 1, ".1.3.6.1.4.1.318.1.4.2.6.1.1.17", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.experimental", 0, 1, ".1.3.6.1.4.1.318.1.4.2.6.1.1.17", NULL, SU_FLAG_OK, NULL), /* experimental.2.6.1.1.18 = INTEGER: 18 */ - { "unmapped.experimental", 0, 1, ".1.3.6.1.4.1.318.1.4.2.6.1.1.18", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.experimental", 0, 1, ".1.3.6.1.4.1.318.1.4.2.6.1.1.18", NULL, SU_FLAG_OK, NULL), /* experimental.2.6.1.1.19 = INTEGER: 19 */ - { "unmapped.experimental", 0, 1, ".1.3.6.1.4.1.318.1.4.2.6.1.1.19", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.experimental", 0, 1, ".1.3.6.1.4.1.318.1.4.2.6.1.1.19", NULL, SU_FLAG_OK, NULL), /* experimental.2.6.1.2.1 = INTEGER: 1 */ - { "unmapped.experimental", 0, 1, ".1.3.6.1.4.1.318.1.4.2.6.1.2.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.experimental", 0, 1, ".1.3.6.1.4.1.318.1.4.2.6.1.2.1", NULL, SU_FLAG_OK, NULL), /* experimental.2.6.1.2.2 = INTEGER: 2 */ - { "unmapped.experimental", 0, 1, ".1.3.6.1.4.1.318.1.4.2.6.1.2.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.experimental", 0, 1, ".1.3.6.1.4.1.318.1.4.2.6.1.2.2", NULL, SU_FLAG_OK, NULL), /* experimental.2.6.1.2.3 = INTEGER: 3 */ - { "unmapped.experimental", 0, 1, ".1.3.6.1.4.1.318.1.4.2.6.1.2.3", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.experimental", 0, 1, ".1.3.6.1.4.1.318.1.4.2.6.1.2.3", NULL, SU_FLAG_OK, NULL), /* experimental.2.6.1.2.4 = INTEGER: 4 */ - { "unmapped.experimental", 0, 1, ".1.3.6.1.4.1.318.1.4.2.6.1.2.4", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.experimental", 0, 1, ".1.3.6.1.4.1.318.1.4.2.6.1.2.4", NULL, SU_FLAG_OK, NULL), /* experimental.2.6.1.2.5 = INTEGER: 5 */ - { "unmapped.experimental", 0, 1, ".1.3.6.1.4.1.318.1.4.2.6.1.2.5", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.experimental", 0, 1, ".1.3.6.1.4.1.318.1.4.2.6.1.2.5", NULL, SU_FLAG_OK, NULL), /* experimental.2.6.1.2.6 = INTEGER: 6 */ - { "unmapped.experimental", 0, 1, ".1.3.6.1.4.1.318.1.4.2.6.1.2.6", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.experimental", 0, 1, ".1.3.6.1.4.1.318.1.4.2.6.1.2.6", NULL, SU_FLAG_OK, NULL), /* experimental.2.6.1.2.7 = INTEGER: 7 */ - { "unmapped.experimental", 0, 1, ".1.3.6.1.4.1.318.1.4.2.6.1.2.7", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.experimental", 0, 1, ".1.3.6.1.4.1.318.1.4.2.6.1.2.7", NULL, SU_FLAG_OK, NULL), /* experimental.2.6.1.2.8 = INTEGER: 8 */ - { "unmapped.experimental", 0, 1, ".1.3.6.1.4.1.318.1.4.2.6.1.2.8", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.experimental", 0, 1, ".1.3.6.1.4.1.318.1.4.2.6.1.2.8", NULL, SU_FLAG_OK, NULL), /* experimental.2.6.1.2.9 = INTEGER: 9 */ - { "unmapped.experimental", 0, 1, ".1.3.6.1.4.1.318.1.4.2.6.1.2.9", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.experimental", 0, 1, ".1.3.6.1.4.1.318.1.4.2.6.1.2.9", NULL, SU_FLAG_OK, NULL), /* experimental.2.6.1.2.10 = INTEGER: 10 */ - { "unmapped.experimental", 0, 1, ".1.3.6.1.4.1.318.1.4.2.6.1.2.10", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.experimental", 0, 1, ".1.3.6.1.4.1.318.1.4.2.6.1.2.10", NULL, SU_FLAG_OK, NULL), /* experimental.2.6.1.2.11 = INTEGER: 11 */ - { "unmapped.experimental", 0, 1, ".1.3.6.1.4.1.318.1.4.2.6.1.2.11", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.experimental", 0, 1, ".1.3.6.1.4.1.318.1.4.2.6.1.2.11", NULL, SU_FLAG_OK, NULL), /* experimental.2.6.1.2.12 = INTEGER: 12 */ - { "unmapped.experimental", 0, 1, ".1.3.6.1.4.1.318.1.4.2.6.1.2.12", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.experimental", 0, 1, ".1.3.6.1.4.1.318.1.4.2.6.1.2.12", NULL, SU_FLAG_OK, NULL), /* experimental.2.6.1.2.13 = INTEGER: 13 */ - { "unmapped.experimental", 0, 1, ".1.3.6.1.4.1.318.1.4.2.6.1.2.13", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.experimental", 0, 1, ".1.3.6.1.4.1.318.1.4.2.6.1.2.13", NULL, SU_FLAG_OK, NULL), /* experimental.2.6.1.2.14 = INTEGER: 14 */ - { "unmapped.experimental", 0, 1, ".1.3.6.1.4.1.318.1.4.2.6.1.2.14", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.experimental", 0, 1, ".1.3.6.1.4.1.318.1.4.2.6.1.2.14", NULL, SU_FLAG_OK, NULL), /* experimental.2.6.1.2.15 = INTEGER: 15 */ - { "unmapped.experimental", 0, 1, ".1.3.6.1.4.1.318.1.4.2.6.1.2.15", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.experimental", 0, 1, ".1.3.6.1.4.1.318.1.4.2.6.1.2.15", NULL, SU_FLAG_OK, NULL), /* experimental.2.6.1.2.16 = INTEGER: 16 */ - { "unmapped.experimental", 0, 1, ".1.3.6.1.4.1.318.1.4.2.6.1.2.16", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.experimental", 0, 1, ".1.3.6.1.4.1.318.1.4.2.6.1.2.16", NULL, SU_FLAG_OK, NULL), /* experimental.2.6.1.2.17 = INTEGER: 17 */ - { "unmapped.experimental", 0, 1, ".1.3.6.1.4.1.318.1.4.2.6.1.2.17", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.experimental", 0, 1, ".1.3.6.1.4.1.318.1.4.2.6.1.2.17", NULL, SU_FLAG_OK, NULL), /* experimental.2.6.1.2.18 = INTEGER: 18 */ - { "unmapped.experimental", 0, 1, ".1.3.6.1.4.1.318.1.4.2.6.1.2.18", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.experimental", 0, 1, ".1.3.6.1.4.1.318.1.4.2.6.1.2.18", NULL, SU_FLAG_OK, NULL), /* experimental.2.6.1.2.19 = INTEGER: 19 */ - { "unmapped.experimental", 0, 1, ".1.3.6.1.4.1.318.1.4.2.6.1.2.19", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.experimental", 0, 1, ".1.3.6.1.4.1.318.1.4.2.6.1.2.19", NULL, SU_FLAG_OK, NULL), /* experimental.2.6.1.3.1 = STRING: "0" */ - { "unmapped.experimental", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.4.2.6.1.3.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.experimental", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.4.2.6.1.3.1", NULL, SU_FLAG_OK, NULL), /* experimental.2.6.1.3.2 = STRING: "0" */ - { "unmapped.experimental", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.4.2.6.1.3.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.experimental", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.4.2.6.1.3.2", NULL, SU_FLAG_OK, NULL), /* experimental.2.6.1.3.3 = STRING: "0" */ - { "unmapped.experimental", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.4.2.6.1.3.3", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.experimental", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.4.2.6.1.3.3", NULL, SU_FLAG_OK, NULL), /* experimental.2.6.1.3.4 = STRING: "0" */ - { "unmapped.experimental", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.4.2.6.1.3.4", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.experimental", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.4.2.6.1.3.4", NULL, SU_FLAG_OK, NULL), /* experimental.2.6.1.3.5 = STRING: "0" */ - { "unmapped.experimental", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.4.2.6.1.3.5", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.experimental", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.4.2.6.1.3.5", NULL, SU_FLAG_OK, NULL), /* experimental.2.6.1.3.6 = STRING: "0" */ - { "unmapped.experimental", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.4.2.6.1.3.6", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.experimental", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.4.2.6.1.3.6", NULL, SU_FLAG_OK, NULL), /* experimental.2.6.1.3.7 = STRING: "0" */ - { "unmapped.experimental", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.4.2.6.1.3.7", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.experimental", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.4.2.6.1.3.7", NULL, SU_FLAG_OK, NULL), /* experimental.2.6.1.3.8 = STRING: "0" */ - { "unmapped.experimental", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.4.2.6.1.3.8", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.experimental", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.4.2.6.1.3.8", NULL, SU_FLAG_OK, NULL), /* experimental.2.6.1.3.9 = STRING: "0" */ - { "unmapped.experimental", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.4.2.6.1.3.9", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.experimental", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.4.2.6.1.3.9", NULL, SU_FLAG_OK, NULL), /* experimental.2.6.1.3.10 = STRING: "0" */ - { "unmapped.experimental", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.4.2.6.1.3.10", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.experimental", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.4.2.6.1.3.10", NULL, SU_FLAG_OK, NULL), /* experimental.2.6.1.3.11 = STRING: "0" */ - { "unmapped.experimental", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.4.2.6.1.3.11", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.experimental", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.4.2.6.1.3.11", NULL, SU_FLAG_OK, NULL), /* experimental.2.6.1.3.12 = STRING: "0" */ - { "unmapped.experimental", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.4.2.6.1.3.12", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.experimental", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.4.2.6.1.3.12", NULL, SU_FLAG_OK, NULL), /* experimental.2.6.1.3.13 = STRING: "0" */ - { "unmapped.experimental", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.4.2.6.1.3.13", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.experimental", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.4.2.6.1.3.13", NULL, SU_FLAG_OK, NULL), /* experimental.2.6.1.3.14 = STRING: "0" */ - { "unmapped.experimental", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.4.2.6.1.3.14", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.experimental", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.4.2.6.1.3.14", NULL, SU_FLAG_OK, NULL), /* experimental.2.6.1.3.15 = STRING: "0" */ - { "unmapped.experimental", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.4.2.6.1.3.15", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.experimental", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.4.2.6.1.3.15", NULL, SU_FLAG_OK, NULL), /* experimental.2.6.1.3.16 = STRING: "0" */ - { "unmapped.experimental", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.4.2.6.1.3.16", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.experimental", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.4.2.6.1.3.16", NULL, SU_FLAG_OK, NULL), /* experimental.2.6.1.3.17 = STRING: "0" */ - { "unmapped.experimental", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.4.2.6.1.3.17", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.experimental", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.4.2.6.1.3.17", NULL, SU_FLAG_OK, NULL), /* experimental.2.6.1.3.18 = STRING: "0" */ - { "unmapped.experimental", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.4.2.6.1.3.18", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.experimental", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.4.2.6.1.3.18", NULL, SU_FLAG_OK, NULL), /* experimental.2.6.1.3.19 = STRING: "0" */ - { "unmapped.experimental", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.4.2.6.1.3.19", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.experimental", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.4.2.6.1.3.19", NULL, SU_FLAG_OK, NULL), /* experimental.2.6.1.4.1 = STRING: "MTYx" */ - { "unmapped.experimental", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.4.2.6.1.4.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.experimental", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.4.2.6.1.4.1", NULL, SU_FLAG_OK, NULL), /* experimental.2.6.1.4.2 = STRING: "MjM=" */ - { "unmapped.experimental", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.4.2.6.1.4.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.experimental", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.4.2.6.1.4.2", NULL, SU_FLAG_OK, NULL), /* experimental.2.6.1.4.3 = STRING: "ODA=" */ - { "unmapped.experimental", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.4.2.6.1.4.3", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.experimental", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.4.2.6.1.4.3", NULL, SU_FLAG_OK, NULL), /* experimental.2.6.1.4.4 = STRING: "OTk1MA==" */ - { "unmapped.experimental", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.4.2.6.1.4.4", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.experimental", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.4.2.6.1.4.4", NULL, SU_FLAG_OK, NULL), /* experimental.2.6.1.4.5 = STRING: "OTk1MA==" */ - { "unmapped.experimental", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.4.2.6.1.4.5", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.experimental", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.4.2.6.1.4.5", NULL, SU_FLAG_OK, NULL), /* experimental.2.6.1.4.6 = STRING: "NDQz" */ - { "unmapped.experimental", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.4.2.6.1.4.6", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.experimental", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.4.2.6.1.4.6", NULL, SU_FLAG_OK, NULL), /* experimental.2.6.1.4.7 = STRING: "MjI=" */ - { "unmapped.experimental", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.4.2.6.1.4.7", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.experimental", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.4.2.6.1.4.7", NULL, SU_FLAG_OK, NULL), /* experimental.2.6.1.4.8 = STRING: "MjI=" */ - { "unmapped.experimental", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.4.2.6.1.4.8", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.experimental", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.4.2.6.1.4.8", NULL, SU_FLAG_OK, NULL), /* experimental.2.6.1.4.9 = STRING: "MTIz" */ - { "unmapped.experimental", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.4.2.6.1.4.9", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.experimental", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.4.2.6.1.4.9", NULL, SU_FLAG_OK, NULL), /* experimental.2.6.1.4.10 = STRING: "MjU=" */ - { "unmapped.experimental", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.4.2.6.1.4.10", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.experimental", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.4.2.6.1.4.10", NULL, SU_FLAG_OK, NULL), /* experimental.2.6.1.4.11 = STRING: "MjE=" */ - { "unmapped.experimental", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.4.2.6.1.4.11", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.experimental", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.4.2.6.1.4.11", NULL, SU_FLAG_OK, NULL), /* experimental.2.6.1.4.12 = STRING: "MjE=" */ - { "unmapped.experimental", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.4.2.6.1.4.12", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.experimental", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.4.2.6.1.4.12", NULL, SU_FLAG_OK, NULL), /* experimental.2.6.1.4.13 = STRING: "Njg=" */ - { "unmapped.experimental", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.4.2.6.1.4.13", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.experimental", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.4.2.6.1.4.13", NULL, SU_FLAG_OK, NULL), /* experimental.2.6.1.4.14 = STRING: "NTQ2" */ - { "unmapped.experimental", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.4.2.6.1.4.14", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.experimental", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.4.2.6.1.4.14", NULL, SU_FLAG_OK, NULL), /* experimental.2.6.1.4.15 = STRING: "MTgxMg==" */ - { "unmapped.experimental", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.4.2.6.1.4.15", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.experimental", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.4.2.6.1.4.15", NULL, SU_FLAG_OK, NULL), /* experimental.2.6.1.4.16 = STRING: "MTYx" */ - { "unmapped.experimental", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.4.2.6.1.4.16", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.experimental", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.4.2.6.1.4.16", NULL, SU_FLAG_OK, NULL), /* experimental.2.6.1.4.17 = STRING: "MjE=" */ - { "unmapped.experimental", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.4.2.6.1.4.17", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.experimental", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.4.2.6.1.4.17", NULL, SU_FLAG_OK, NULL), /* experimental.2.6.1.4.18 = STRING: "MjE=" */ - { "unmapped.experimental", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.4.2.6.1.4.18", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.experimental", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.4.2.6.1.4.18", NULL, SU_FLAG_OK, NULL), /* experimental.2.6.1.4.19 = STRING: "OTk1MQ==" */ - { "unmapped.experimental", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.4.2.6.1.4.19", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.experimental", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.4.2.6.1.4.19", NULL, SU_FLAG_OK, NULL), /* experimental.2.6.1.5.1 = INTEGER: 2 */ - { "unmapped.experimental", 0, 1, ".1.3.6.1.4.1.318.1.4.2.6.1.5.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.experimental", 0, 1, ".1.3.6.1.4.1.318.1.4.2.6.1.5.1", NULL, SU_FLAG_OK, NULL), /* experimental.2.6.1.5.2 = INTEGER: 2 */ - { "unmapped.experimental", 0, 1, ".1.3.6.1.4.1.318.1.4.2.6.1.5.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.experimental", 0, 1, ".1.3.6.1.4.1.318.1.4.2.6.1.5.2", NULL, SU_FLAG_OK, NULL), /* experimental.2.6.1.5.3 = INTEGER: 2 */ - { "unmapped.experimental", 0, 1, ".1.3.6.1.4.1.318.1.4.2.6.1.5.3", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.experimental", 0, 1, ".1.3.6.1.4.1.318.1.4.2.6.1.5.3", NULL, SU_FLAG_OK, NULL), /* experimental.2.6.1.5.4 = INTEGER: 2 */ - { "unmapped.experimental", 0, 1, ".1.3.6.1.4.1.318.1.4.2.6.1.5.4", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.experimental", 0, 1, ".1.3.6.1.4.1.318.1.4.2.6.1.5.4", NULL, SU_FLAG_OK, NULL), /* experimental.2.6.1.5.5 = INTEGER: 2 */ - { "unmapped.experimental", 0, 1, ".1.3.6.1.4.1.318.1.4.2.6.1.5.5", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.experimental", 0, 1, ".1.3.6.1.4.1.318.1.4.2.6.1.5.5", NULL, SU_FLAG_OK, NULL), /* experimental.2.6.1.5.6 = INTEGER: 1 */ - { "unmapped.experimental", 0, 1, ".1.3.6.1.4.1.318.1.4.2.6.1.5.6", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.experimental", 0, 1, ".1.3.6.1.4.1.318.1.4.2.6.1.5.6", NULL, SU_FLAG_OK, NULL), /* experimental.2.6.1.5.7 = INTEGER: 1 */ - { "unmapped.experimental", 0, 1, ".1.3.6.1.4.1.318.1.4.2.6.1.5.7", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.experimental", 0, 1, ".1.3.6.1.4.1.318.1.4.2.6.1.5.7", NULL, SU_FLAG_OK, NULL), /* experimental.2.6.1.5.8 = INTEGER: 1 */ - { "unmapped.experimental", 0, 1, ".1.3.6.1.4.1.318.1.4.2.6.1.5.8", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.experimental", 0, 1, ".1.3.6.1.4.1.318.1.4.2.6.1.5.8", NULL, SU_FLAG_OK, NULL), /* experimental.2.6.1.5.9 = INTEGER: 1 */ - { "unmapped.experimental", 0, 1, ".1.3.6.1.4.1.318.1.4.2.6.1.5.9", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.experimental", 0, 1, ".1.3.6.1.4.1.318.1.4.2.6.1.5.9", NULL, SU_FLAG_OK, NULL), /* experimental.2.6.1.5.10 = INTEGER: 2 */ - { "unmapped.experimental", 0, 1, ".1.3.6.1.4.1.318.1.4.2.6.1.5.10", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.experimental", 0, 1, ".1.3.6.1.4.1.318.1.4.2.6.1.5.10", NULL, SU_FLAG_OK, NULL), /* experimental.2.6.1.5.11 = INTEGER: 2 */ - { "unmapped.experimental", 0, 1, ".1.3.6.1.4.1.318.1.4.2.6.1.5.11", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.experimental", 0, 1, ".1.3.6.1.4.1.318.1.4.2.6.1.5.11", NULL, SU_FLAG_OK, NULL), /* experimental.2.6.1.5.12 = INTEGER: 2 */ - { "unmapped.experimental", 0, 1, ".1.3.6.1.4.1.318.1.4.2.6.1.5.12", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.experimental", 0, 1, ".1.3.6.1.4.1.318.1.4.2.6.1.5.12", NULL, SU_FLAG_OK, NULL), /* experimental.2.6.1.5.13 = INTEGER: 1 */ - { "unmapped.experimental", 0, 1, ".1.3.6.1.4.1.318.1.4.2.6.1.5.13", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.experimental", 0, 1, ".1.3.6.1.4.1.318.1.4.2.6.1.5.13", NULL, SU_FLAG_OK, NULL), /* experimental.2.6.1.5.14 = INTEGER: 1 */ - { "unmapped.experimental", 0, 1, ".1.3.6.1.4.1.318.1.4.2.6.1.5.14", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.experimental", 0, 1, ".1.3.6.1.4.1.318.1.4.2.6.1.5.14", NULL, SU_FLAG_OK, NULL), /* experimental.2.6.1.5.15 = INTEGER: 1 */ - { "unmapped.experimental", 0, 1, ".1.3.6.1.4.1.318.1.4.2.6.1.5.15", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.experimental", 0, 1, ".1.3.6.1.4.1.318.1.4.2.6.1.5.15", NULL, SU_FLAG_OK, NULL), /* experimental.2.6.1.5.16 = INTEGER: 1 */ - { "unmapped.experimental", 0, 1, ".1.3.6.1.4.1.318.1.4.2.6.1.5.16", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.experimental", 0, 1, ".1.3.6.1.4.1.318.1.4.2.6.1.5.16", NULL, SU_FLAG_OK, NULL), /* experimental.2.6.1.5.17 = INTEGER: 1 */ - { "unmapped.experimental", 0, 1, ".1.3.6.1.4.1.318.1.4.2.6.1.5.17", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.experimental", 0, 1, ".1.3.6.1.4.1.318.1.4.2.6.1.5.17", NULL, SU_FLAG_OK, NULL), /* experimental.2.6.1.5.18 = INTEGER: 1 */ - { "unmapped.experimental", 0, 1, ".1.3.6.1.4.1.318.1.4.2.6.1.5.18", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.experimental", 0, 1, ".1.3.6.1.4.1.318.1.4.2.6.1.5.18", NULL, SU_FLAG_OK, NULL), /* experimental.2.6.1.5.19 = INTEGER: 1 */ - { "unmapped.experimental", 0, 1, ".1.3.6.1.4.1.318.1.4.2.6.1.5.19", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.experimental", 0, 1, ".1.3.6.1.4.1.318.1.4.2.6.1.5.19", NULL, SU_FLAG_OK, NULL), /* experimental.2.7.0 = INTEGER: 1 */ - { "unmapped.experimental", 0, 1, ".1.3.6.1.4.1.318.1.4.2.7.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.experimental", 0, 1, ".1.3.6.1.4.1.318.1.4.2.7.0", NULL, SU_FLAG_OK, NULL), /* experimental.2.8.1.1.1 = INTEGER: 1 */ - { "unmapped.experimental", 0, 1, ".1.3.6.1.4.1.318.1.4.2.8.1.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.experimental", 0, 1, ".1.3.6.1.4.1.318.1.4.2.8.1.1.1", NULL, SU_FLAG_OK, NULL), /* experimental.2.8.1.2.1 = STRING: "power" */ - { "unmapped.experimental", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.4.2.8.1.2.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.experimental", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.4.2.8.1.2.1", NULL, SU_FLAG_OK, NULL), /* experimental.2.8.1.3.1 = STRING: "pdu" */ - { "unmapped.experimental", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.4.2.8.1.3.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.experimental", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.4.2.8.1.3.1", NULL, SU_FLAG_OK, NULL), /* experimental.2.8.1.4.1 = STRING: "rpdu" */ - { "unmapped.experimental", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.4.2.8.1.4.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.experimental", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.4.2.8.1.4.1", NULL, SU_FLAG_OK, NULL), /* experimental.2.8.1.5.1 = STRING: "version7" */ - { "unmapped.experimental", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.4.2.8.1.5.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.experimental", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.4.2.8.1.5.1", NULL, SU_FLAG_OK, NULL), /* experimental.2.8.1.6.1 = INTEGER: 1 */ - { "unmapped.experimental", 0, 1, ".1.3.6.1.4.1.318.1.4.2.8.1.6.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.experimental", 0, 1, ".1.3.6.1.4.1.318.1.4.2.8.1.6.1", NULL, SU_FLAG_OK, NULL), /* experimental.2.9.0 = INTEGER: 0 */ - { "unmapped.experimental", 0, 1, ".1.3.6.1.4.1.318.1.4.2.9.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.experimental", 0, 1, ".1.3.6.1.4.1.318.1.4.2.9.0", NULL, SU_FLAG_OK, NULL), /* experimental.2.10.0 = INTEGER: 0 */ - { "unmapped.experimental", 0, 1, ".1.3.6.1.4.1.318.1.4.2.10.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.experimental", 0, 1, ".1.3.6.1.4.1.318.1.4.2.10.0", NULL, SU_FLAG_OK, NULL), /* experimental.2.12.0 = INTEGER: 1 */ - { "unmapped.experimental", 0, 1, ".1.3.6.1.4.1.318.1.4.2.12.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.experimental", 0, 1, ".1.3.6.1.4.1.318.1.4.2.12.0", NULL, SU_FLAG_OK, NULL), /* experimental.4.1.0 = INTEGER: 0 */ - { "unmapped.experimental", 0, 1, ".1.3.6.1.4.1.318.1.4.4.1.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.experimental", 0, 1, ".1.3.6.1.4.1.318.1.4.4.1.0", NULL, SU_FLAG_OK, NULL), /* experimental.4.3.0 = STRING: ",<1 digit type identifier>" */ - { "unmapped.experimental", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.4.4.3.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.experimental", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.4.4.3.0", NULL, SU_FLAG_OK, NULL), /* experimental.4.4.0 = INTEGER: 0 */ - { "unmapped.experimental", 0, 1, ".1.3.6.1.4.1.318.1.4.4.4.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.experimental", 0, 1, ".1.3.6.1.4.1.318.1.4.4.4.0", NULL, SU_FLAG_OK, NULL), /* experimental.5.1.0 = INTEGER: 12 */ - { "unmapped.experimental", 0, 1, ".1.3.6.1.4.1.318.1.4.5.1.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.experimental", 0, 1, ".1.3.6.1.4.1.318.1.4.5.1.0", NULL, SU_FLAG_OK, NULL), /* experimental.5.2.1.1.1 = INTEGER: 1 */ - { "unmapped.experimental", 0, 1, ".1.3.6.1.4.1.318.1.4.5.2.1.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.experimental", 0, 1, ".1.3.6.1.4.1.318.1.4.5.2.1.1.1", NULL, SU_FLAG_OK, NULL), /* experimental.5.2.1.1.2 = INTEGER: 2 */ - { "unmapped.experimental", 0, 1, ".1.3.6.1.4.1.318.1.4.5.2.1.1.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.experimental", 0, 1, ".1.3.6.1.4.1.318.1.4.5.2.1.1.2", NULL, SU_FLAG_OK, NULL), /* experimental.5.2.1.1.3 = INTEGER: 3 */ - { "unmapped.experimental", 0, 1, ".1.3.6.1.4.1.318.1.4.5.2.1.1.3", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.experimental", 0, 1, ".1.3.6.1.4.1.318.1.4.5.2.1.1.3", NULL, SU_FLAG_OK, NULL), /* experimental.5.2.1.1.4 = INTEGER: 4 */ - { "unmapped.experimental", 0, 1, ".1.3.6.1.4.1.318.1.4.5.2.1.1.4", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.experimental", 0, 1, ".1.3.6.1.4.1.318.1.4.5.2.1.1.4", NULL, SU_FLAG_OK, NULL), /* experimental.5.2.1.1.5 = INTEGER: 5 */ - { "unmapped.experimental", 0, 1, ".1.3.6.1.4.1.318.1.4.5.2.1.1.5", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.experimental", 0, 1, ".1.3.6.1.4.1.318.1.4.5.2.1.1.5", NULL, SU_FLAG_OK, NULL), /* experimental.5.2.1.1.6 = INTEGER: 6 */ - { "unmapped.experimental", 0, 1, ".1.3.6.1.4.1.318.1.4.5.2.1.1.6", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.experimental", 0, 1, ".1.3.6.1.4.1.318.1.4.5.2.1.1.6", NULL, SU_FLAG_OK, NULL), /* experimental.5.2.1.1.7 = INTEGER: 7 */ - { "unmapped.experimental", 0, 1, ".1.3.6.1.4.1.318.1.4.5.2.1.1.7", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.experimental", 0, 1, ".1.3.6.1.4.1.318.1.4.5.2.1.1.7", NULL, SU_FLAG_OK, NULL), /* experimental.5.2.1.1.8 = INTEGER: 8 */ - { "unmapped.experimental", 0, 1, ".1.3.6.1.4.1.318.1.4.5.2.1.1.8", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.experimental", 0, 1, ".1.3.6.1.4.1.318.1.4.5.2.1.1.8", NULL, SU_FLAG_OK, NULL), /* experimental.5.2.1.1.9 = INTEGER: 9 */ - { "unmapped.experimental", 0, 1, ".1.3.6.1.4.1.318.1.4.5.2.1.1.9", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.experimental", 0, 1, ".1.3.6.1.4.1.318.1.4.5.2.1.1.9", NULL, SU_FLAG_OK, NULL), /* experimental.5.2.1.1.10 = INTEGER: 10 */ - { "unmapped.experimental", 0, 1, ".1.3.6.1.4.1.318.1.4.5.2.1.1.10", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.experimental", 0, 1, ".1.3.6.1.4.1.318.1.4.5.2.1.1.10", NULL, SU_FLAG_OK, NULL), /* experimental.5.2.1.1.11 = INTEGER: 11 */ - { "unmapped.experimental", 0, 1, ".1.3.6.1.4.1.318.1.4.5.2.1.1.11", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.experimental", 0, 1, ".1.3.6.1.4.1.318.1.4.5.2.1.1.11", NULL, SU_FLAG_OK, NULL), /* experimental.5.2.1.1.12 = INTEGER: 12 */ - { "unmapped.experimental", 0, 1, ".1.3.6.1.4.1.318.1.4.5.2.1.1.12", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.experimental", 0, 1, ".1.3.6.1.4.1.318.1.4.5.2.1.1.12", NULL, SU_FLAG_OK, NULL), /* experimental.5.2.1.2.1 = INTEGER: 3841 */ - { "unmapped.experimental", 0, 1, ".1.3.6.1.4.1.318.1.4.5.2.1.2.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.experimental", 0, 1, ".1.3.6.1.4.1.318.1.4.5.2.1.2.1", NULL, SU_FLAG_OK, NULL), /* experimental.5.2.1.2.2 = INTEGER: 3843 */ - { "unmapped.experimental", 0, 1, ".1.3.6.1.4.1.318.1.4.5.2.1.2.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.experimental", 0, 1, ".1.3.6.1.4.1.318.1.4.5.2.1.2.2", NULL, SU_FLAG_OK, NULL), /* experimental.5.2.1.2.3 = INTEGER: 3845 */ - { "unmapped.experimental", 0, 1, ".1.3.6.1.4.1.318.1.4.5.2.1.2.3", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.experimental", 0, 1, ".1.3.6.1.4.1.318.1.4.5.2.1.2.3", NULL, SU_FLAG_OK, NULL), /* experimental.5.2.1.2.4 = INTEGER: 3848 */ - { "unmapped.experimental", 0, 1, ".1.3.6.1.4.1.318.1.4.5.2.1.2.4", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.experimental", 0, 1, ".1.3.6.1.4.1.318.1.4.5.2.1.2.4", NULL, SU_FLAG_OK, NULL), /* experimental.5.2.1.2.5 = INTEGER: 3862 */ - { "unmapped.experimental", 0, 1, ".1.3.6.1.4.1.318.1.4.5.2.1.2.5", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.experimental", 0, 1, ".1.3.6.1.4.1.318.1.4.5.2.1.2.5", NULL, SU_FLAG_OK, NULL), /* experimental.5.2.1.2.6 = INTEGER: 3864 */ - { "unmapped.experimental", 0, 1, ".1.3.6.1.4.1.318.1.4.5.2.1.2.6", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.experimental", 0, 1, ".1.3.6.1.4.1.318.1.4.5.2.1.2.6", NULL, SU_FLAG_OK, NULL), /* experimental.5.2.1.2.7 = INTEGER: 3856 */ - { "unmapped.experimental", 0, 1, ".1.3.6.1.4.1.318.1.4.5.2.1.2.7", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.experimental", 0, 1, ".1.3.6.1.4.1.318.1.4.5.2.1.2.7", NULL, SU_FLAG_OK, NULL), /* experimental.5.2.1.2.8 = INTEGER: 3858 */ - { "unmapped.experimental", 0, 1, ".1.3.6.1.4.1.318.1.4.5.2.1.2.8", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.experimental", 0, 1, ".1.3.6.1.4.1.318.1.4.5.2.1.2.8", NULL, SU_FLAG_OK, NULL), /* experimental.5.2.1.2.9 = INTEGER: 3860 */ - { "unmapped.experimental", 0, 1, ".1.3.6.1.4.1.318.1.4.5.2.1.2.9", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.experimental", 0, 1, ".1.3.6.1.4.1.318.1.4.5.2.1.2.9", NULL, SU_FLAG_OK, NULL), /* experimental.5.2.1.2.10 = INTEGER: 3871 */ - { "unmapped.experimental", 0, 1, ".1.3.6.1.4.1.318.1.4.5.2.1.2.10", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.experimental", 0, 1, ".1.3.6.1.4.1.318.1.4.5.2.1.2.10", NULL, SU_FLAG_OK, NULL), /* experimental.5.2.1.2.11 = INTEGER: 3873 */ - { "unmapped.experimental", 0, 1, ".1.3.6.1.4.1.318.1.4.5.2.1.2.11", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.experimental", 0, 1, ".1.3.6.1.4.1.318.1.4.5.2.1.2.11", NULL, SU_FLAG_OK, NULL), /* experimental.5.2.1.2.12 = INTEGER: 3875 */ - { "unmapped.experimental", 0, 1, ".1.3.6.1.4.1.318.1.4.5.2.1.2.12", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.experimental", 0, 1, ".1.3.6.1.4.1.318.1.4.5.2.1.2.12", NULL, SU_FLAG_OK, NULL), /* experimental.6.1.1.0 = Hex-STRING: 07 00 00 00 */ - { "unmapped.experimental", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.4.6.1.1.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.experimental", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.318.1.4.6.1.1.0", NULL, SU_FLAG_OK, NULL), /* experimental.7.1.0 = INTEGER: 4 */ - { "unmapped.experimental", 0, 1, ".1.3.6.1.4.1.318.1.4.7.1.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.experimental", 0, 1, ".1.3.6.1.4.1.318.1.4.7.1.0", NULL, SU_FLAG_OK, NULL), /* experimental.7.3.0 = INTEGER: 4 */ - { "unmapped.experimental", 0, 1, ".1.3.6.1.4.1.318.1.4.7.3.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.experimental", 0, 1, ".1.3.6.1.4.1.318.1.4.7.3.0", NULL, SU_FLAG_OK, NULL), /* experimental.7.4.0 = INTEGER: 3 */ - { "unmapped.experimental", 0, 1, ".1.3.6.1.4.1.318.1.4.7.4.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.experimental", 0, 1, ".1.3.6.1.4.1.318.1.4.7.4.0", NULL, SU_FLAG_OK, NULL), /* experimental.7.5.0 = INTEGER: 3 */ - { "unmapped.experimental", 0, 1, ".1.3.6.1.4.1.318.1.4.7.5.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.experimental", 0, 1, ".1.3.6.1.4.1.318.1.4.7.5.0", NULL, SU_FLAG_OK, NULL), #endif /* if WITH_UNMAPPED_DATA_POINTS */ /* end of structure. */ - { NULL, 0, 0, NULL, NULL, 0, NULL } + snmp_info_sentinel }; mib2nut_info_t apc_pdu_rpdu = { "apc_pdu", APC_PDU_MIB_VERSION, NULL, APC_PDU_DEVICE_MODEL, apc_pdu_mib, APC_PDU_MIB_SYSOID_RPDU, NULL }; diff --git a/drivers/apc_modbus.c b/drivers/apc_modbus.c index dc401ca6c7..7e437e2fce 100644 --- a/drivers/apc_modbus.c +++ b/drivers/apc_modbus.c @@ -271,7 +271,7 @@ static int _apc_modbus_double_to_nut(const apc_modbus_value_t *value, char *outp #ifdef HAVE_PRAGMAS_FOR_GCC_DIAGNOSTIC_IGNORED_FORMAT_NONLITERAL #pragma GCC diagnostic pop #endif - if (res < 0 || (size_t)res > output_len) { + if (res < 0 || (size_t)res >= output_len) { return 0; } @@ -314,7 +314,7 @@ static int _apc_modbus_power_to_nut(const apc_modbus_value_t *value, char *outpu #ifdef HAVE_PRAGMAS_FOR_GCC_DIAGNOSTIC_IGNORED_FORMAT_NONLITERAL #pragma GCC diagnostic pop #endif - if (res < 0 || (size_t)res > output_len) { + if (res < 0 || (size_t)res >= output_len) { return 0; } @@ -325,6 +325,8 @@ static apc_modbus_converter_t _apc_modbus_power_conversion = { _apc_modbus_power static int _apc_modbus_voltage_to_nut(const apc_modbus_value_t *value, char *output, size_t output_len) { + int res; + if (value == NULL || output == NULL || output_len == 0) { /* Invalid parameters */ return 0; @@ -336,7 +338,10 @@ static int _apc_modbus_voltage_to_nut(const apc_modbus_value_t *value, char *out if (value->data.uint_value == 0xffff) { /* Not applicable */ - strncpy(output, "NA", output_len); + res = snprintf(output, output_len, "NA"); + if (res < 0 || (size_t)res >= output_len) { + return 0; + } return 1; } @@ -348,6 +353,7 @@ static apc_modbus_converter_t _apc_modbus_voltage_conversion = { _apc_modbus_vol static int _apc_modbus_efficiency_to_nut(const apc_modbus_value_t *value, char *output, size_t output_len) { char *cause; + int res; if (value == NULL || output == NULL || output_len == 0) { /* Invalid parameters */ @@ -387,7 +393,10 @@ static int _apc_modbus_efficiency_to_nut(const apc_modbus_value_t *value, char * return _apc_modbus_double_to_nut(value, output, output_len); } - strncpy(output, cause, output_len); + res = snprintf(output, output_len, "%s", cause); + if (res < 0 || (size_t)res >= output_len) { + return 0; + } return 1; } @@ -397,6 +406,7 @@ static apc_modbus_converter_t _apc_modbus_efficiency_conversion = { _apc_modbus_ static int _apc_modbus_status_change_cause_to_nut(const apc_modbus_value_t *value, char *output, size_t output_len) { char *cause; + int res; if (value == NULL || output == NULL || output_len == 0) { /* Invalid parameters */ @@ -506,7 +516,10 @@ static int _apc_modbus_status_change_cause_to_nut(const apc_modbus_value_t *valu break; } - strncpy(output, cause, output_len); + res = snprintf(output, output_len, "%s", cause); + if (res < 0 || (size_t)res >= output_len) { + return 0; + } return 1; } @@ -1014,6 +1027,7 @@ static void _apc_modbus_usb_lib_to_nut(const modbus_usb_device_t *device, USBDev /* This makes a USBDevice_t from modbus_usb_device_t so we can use our matchers */ static char bus_buf[4], device_buf[4], bus_port_buf[4]; + int res; assert(device != NULL); assert(out != NULL); @@ -1027,14 +1041,23 @@ static void _apc_modbus_usb_lib_to_nut(const modbus_usb_device_t *device, USBDev out->Serial = device->serial_str; out->bcdDevice = device->bcd_device; - snprintf(bus_buf, sizeof(bus_buf), "%03u", device->bus); + res = snprintf(bus_buf, sizeof(bus_buf), "%03u", device->bus); + if (res < 0 || (size_t)res >= sizeof(bus_buf)) { + fatalx(EXIT_FAILURE, "failed to convert USB bus to string"); + } out->Bus = bus_buf; - snprintf(device_buf, sizeof(device_buf), "%03u", device->device_address); + res = snprintf(device_buf, sizeof(device_buf), "%03u", device->device_address); + if (res < 0 || (size_t)res >= sizeof(device_buf)) { + fatalx(EXIT_FAILURE, "failed to convert USB device address to string"); + } out->Device = device_buf; #if (defined WITH_USB_BUSPORT) && (WITH_USB_BUSPORT) - snprintf(bus_port_buf, sizeof(bus_port_buf), "%03u", device->bus_port); + res = snprintf(bus_port_buf, sizeof(bus_port_buf), "%03u", device->bus_port); + if (res < 0 || (size_t)res >= sizeof(bus_port_buf)) { + fatalx(EXIT_FAILURE, "failed to convert USB bus port to string"); + } out->BusPort = bus_port_buf; #endif } @@ -1118,7 +1141,7 @@ static int _apc_modbus_usb_callback(const modbus_usb_device_t *device) static int _apc_modbus_parse_host_port(const char *input, char *host, size_t host_buf_size, char *port, size_t port_buf_size, const uint16_t default_port) { const char *start = input; const char *end = input; - int port_int; + int port_int, r; size_t host_size, port_size; if (*start == '[') { @@ -1134,21 +1157,30 @@ static int _apc_modbus_parse_host_port(const char *input, char *host, size_t hos if (!end) { /* Port is missing, use the default port */ - strncpy(host, start, host_buf_size); - snprintf(port, port_buf_size, "%u", default_port); - return 0; + r = snprintf(host, host_buf_size, "%s", start); + if (r < 0 || (size_t)r >= host_buf_size) { + upslogx(LOG_ERR, "%s: Buffer size too small or encoding error", __func__); + return 0; + } + r = snprintf(port, port_buf_size, "%u", default_port); + if (r < 0 || (size_t)r >= port_buf_size) { + upslogx(LOG_ERR, "%s: Buffer size too small or encoding error", __func__); + return 0; + } + return 1; } - host_size = (size_t)(end - start); - port_size = strlen(end + 1); + /* +1 for zero termination */ + host_size = (size_t)(end - start) + 1; + port_size = strlen(end + 1) + 1; - if (host_size >= host_buf_size || port_size >= port_buf_size) { + if (host_size > host_buf_size || port_size > port_buf_size) { upslogx(LOG_ERR, "%s: Buffer size too small", __func__); return 0; } - strncpy(host, start, host_size); - strncpy(port, end + 1, port_size); + snprintf(host, host_size, "%s", start); + snprintf(port, port_size, "%s", end + 1); port_int = atoi(port); if (port_int < 0 || port_int > 65535) { @@ -1218,9 +1250,10 @@ void upsdrv_initups(void) # endif has_nonzero_regex = 0; - for (i = 0; i < sizeof(regex_array) / sizeof(regex_array[0]); i++) { + for (i = 0; i < SIZEOF_ARRAY(regex_array); i++) { if (regex_array[i] != NULL) { has_nonzero_regex = 1; + break; } } diff --git a/drivers/apcsmart-old.c b/drivers/apcsmart-old.c index d577f73154..9771e0e52a 100644 --- a/drivers/apcsmart-old.c +++ b/drivers/apcsmart-old.c @@ -24,8 +24,8 @@ #include "apcsmart-old.h" #include "nut_stdint.h" -#define DRIVER_NAME "APC Smart protocol driver" -#define DRIVER_VERSION "2.31" +#define DRIVER_NAME "APC Smart protocol driver (old)" +#define DRIVER_VERSION "2.33" static upsdrv_info_t table_info = { "APC command table", @@ -395,15 +395,20 @@ static void do_capabilities(void) __func__, (ptr[2] - 48), (ptr[3] - 48), cmd, loc); - /* just ignore it as we did for ages (the - * rest of loop cycle would be no-op anyway) + /* just ignore it as we did for ages see e.g. v2.7.4 + * (note the next loop cycle was and still would be + * no-op anyway, if "nument <= 0"). */ - ptr = entptr; - continue; - } + nument = 0; + entlen = 0; - nument = (size_t)ptr[2] - 48; - entlen = (size_t)ptr[3] - 48; + /* NOT a full skip: Gotta handle "vt" to act like before */ + /*ptr = entptr;*/ + /*continue;*/ + } else { + nument = (size_t)ptr[2] - 48; + entlen = (size_t)ptr[3] - 48; + } vt = vartab_lookup_char(cmd); valid = vt && ((loc == upsloc) || (loc == '4')); @@ -1317,7 +1322,7 @@ static int setvar(const char *varname, const char *val) if ((vt->flags & APC_RW) == 0) { upslogx(LOG_WARNING, "setvar: [%s] is not writable", varname); - return STAT_SET_UNKNOWN; + return STAT_SET_INVALID; } if (vt->flags & APC_ENUM) diff --git a/drivers/apcsmart.c b/drivers/apcsmart.c index f38d2911e4..97b488bc46 100644 --- a/drivers/apcsmart.c +++ b/drivers/apcsmart.c @@ -36,7 +36,7 @@ #include "apcsmart_tabs.h" #define DRIVER_NAME "APC Smart protocol driver" -#define DRIVER_VERSION "3.31" +#define DRIVER_VERSION "3.32" #ifdef WIN32 # ifndef ECANCELED @@ -260,7 +260,7 @@ static void apc_ser_diff(struct termios *tioset, struct termios *tioget) /* clear status flags so that they don't affect our binary compare */ #if defined(PENDIN) || defined(FLUSHO) - for (i = 0; i < sizeof(tio)/sizeof(tio[0]); i++) { + for (i = 0; i < SIZEOF_ARRAY(tio); i++) { #ifdef PENDIN tio[i]->c_lflag &= ~(unsigned int)PENDIN; #endif @@ -283,7 +283,7 @@ static void apc_ser_diff(struct termios *tioset, struct termios *tioget) * rate of 2400. */ - for (i = 0; i < sizeof(tio)/sizeof(tio[0]); i++) { + for (i = 0; i < SIZEOF_ARRAY(tio); i++) { upsdebugx(1, "tc%cetattr(): gfmt1:cflag=%x:iflag=%x:lflag=%x:oflag=%x:", dir[i], (unsigned int) tio[i]->c_cflag, (unsigned int) tio[i]->c_iflag, (unsigned int) tio[i]->c_lflag, (unsigned int) tio[i]->c_oflag); @@ -1040,15 +1040,20 @@ static void apc_getcaps(int qco) __func__, (ptr[2] - 48), (ptr[3] - 48), cmd, loc); - /* just ignore it as we did for ages (the - * rest of loop cycle would be no-op anyway) + /* just ignore it as we did for ages see e.g. v2.7.4 + * (note the next loop cycle was and still would be + * no-op anyway, if "nument <= 0"). */ - ptr = entptr; - continue; - } + nument = 0; + entlen = 0; - nument = (size_t)ptr[2] - 48; - entlen = (size_t)ptr[3] - 48; + /* NOT a full skip: Gotta handle "vt" to act like before */ + /*ptr = entptr;*/ + /*continue;*/ + } else { + nument = (size_t)ptr[2] - 48; + entlen = (size_t)ptr[3] - 48; + } vt = vt_lookup_char(cmd); valid = vt && ((loc == upsloc) || (loc == '4')) && !(vt->flags & APC_PACK); diff --git a/drivers/arduino-hid.c b/drivers/arduino-hid.c index 5b74c12802..59206cbfd0 100644 --- a/drivers/arduino-hid.c +++ b/drivers/arduino-hid.c @@ -1,4 +1,7 @@ /* arduino-hid.c - subdriver to monitor Arduino USB/HID devices with NUT + * + * This was written assuming it would be used to communicate with code + * using this Arduino library: https://github.com/abratchik/HIDPowerDevice * * Copyright (C) * 2003 - 2012 Arnaud Quette @@ -6,6 +9,7 @@ * 2008 - 2009 Arjen de Korte * 2013 Charles Lepple * 2021 Alex Bratchik + * 2023 Kelly Byrd * * Note: this subdriver was initially generated as a "stub" by the * gen-usbhid-subdriver script. It must be customized. @@ -32,7 +36,7 @@ #include "main.h" /* for getval() */ #include "usb-common.h" -#define ARDUINO_HID_VERSION "Arduino HID 0.2" +#define ARDUINO_HID_VERSION "Arduino HID 0.21" /* FIXME: experimental flag to be put in upsdrv_info */ /* Arduino */ @@ -90,6 +94,37 @@ static hid_info_t arduino_hid2nut[] = { { "shutdown.stop", 0, 0, "UPS.PowerSummary.DelayBeforeShutdown", NULL, "-1", HU_TYPE_CMD, NULL }, { "shutdown.reboot", 0, 0, "UPS.PowerSummary.DelayBeforeReboot", NULL, "10", HU_TYPE_CMD, NULL }, + /* Battery */ + { "battery.type", 0, 0, "UPS.PowerSummary.iDeviceChemistry", NULL, "%s", HU_FLAG_STATIC, stringid_conversion}, + /* In the sample for the Arduino library, this isn't a date */ + /*{ "battery.mfr.date", 0, 0, "UPS.PowerSummary.iOEMInformation", NULL, "%s", HU_FLAG_STATIC, stringid_conversion},*/ + { "battery.voltage.nominal", 0, 0, "UPS.PowerSummary.ConfigVoltage", NULL, "%.2f", HU_FLAG_QUICK_POLL, NULL}, + { "battery.voltage", 0, 0, "UPS.PowerSummary.Voltage", NULL, "%.2f", HU_FLAG_QUICK_POLL, NULL}, + { "battery.runtime", 0, 0, "UPS.PowerSummary.RunTimeToEmpty", NULL, "%.0f", HU_FLAG_QUICK_POLL, NULL}, + { "battery.runtime.low", 0, 0, "UPS.PowerSummary.RemainingTimeLimit", NULL, "%.0f", HU_FLAG_SEMI_STATIC, NULL }, + /* Parse `*Capacity` values assuming `UPS.PowerSummary.CapacityMode` is set to 2, which means the `*Capacity` + units are percent. The Arduino HID Powerdevice library is capable of doing other modes, if the Sketch wants + to use them, but it appears most drivers just assume percent. + */ + { "battery.charge", 0, 0, "UPS.PowerSummary.RemainingCapacity", NULL, "%.0f", 0, NULL }, + { "battery.charge.low", 0, 0, "UPS.PowerSummary.RemainingCapacityLimit", NULL, "%.0f", HU_FLAG_SEMI_STATIC, NULL}, + { "battery.charge.warning", 0, 0, "UPS.PowerSummary.WarningCapacityLimit", NULL, "%.0f", HU_FLAG_SEMI_STATIC, NULL}, + + /* USB HID PresentStatus Flags + TODO: Parse these into battery.charger.status + */ + { "BOOL", 0, 0, "UPS.PowerSummary.PresentStatus.ACPresent", NULL, NULL, HU_FLAG_QUICK_POLL, online_info}, + { "BOOL", 0, 0, "UPS.PowerSummary.PresentStatus.Discharging", NULL, NULL, HU_FLAG_QUICK_POLL, discharging_info}, + { "BOOL", 0, 0, "UPS.PowerSummary.PresentStatus.Charging", NULL, NULL, HU_FLAG_QUICK_POLL, charging_info}, + { "BOOL", 0, 0, "UPS.PowerSummary.PresentStatus.NeedReplacement", NULL, NULL, 0, replacebatt_info}, + { "BOOL", 0, 0, "UPS.PowerSummary.PresentStatus.ShutdownImminent", NULL, NULL, 0, shutdownimm_info }, + { "BOOL", 0, 0, "UPS.PowerSummary.PresentStatus.BelowRemainingCapacityLimit", NULL, NULL, HU_FLAG_QUICK_POLL, lowbatt_info }, + { "BOOL", 0, 0, "UPS.PowerSummary.PresentStatus.Overload", NULL, NULL, 0, overload_info }, + { "BOOL", 0, 0, "UPS.PowerSummary.PresentStatus.RemainingTimeLimitExpired", NULL, NULL, 0, timelimitexpired_info }, + { "BOOL", 0, 0, "UPS.PowerSummary.PresentStatus.BatteryPresent", NULL, NULL, 0, nobattery_info }, + { "BOOL", 0, 0, "UPS.PowerSummary.PresentStatus.FullyCharged", NULL, NULL, HU_FLAG_QUICK_POLL, fullycharged_info }, + { "BOOL", 0, 0, "UPS.PowerSummary.PresentStatus.FullyDischarged", NULL, NULL, HU_FLAG_QUICK_POLL, depleted_info }, + /* end of structure. */ { NULL, 0, 0, NULL, NULL, NULL, 0, NULL } }; diff --git a/drivers/baytech-mib.c b/drivers/baytech-mib.c index 1ef69998d8..b9c56aba19 100644 --- a/drivers/baytech-mib.c +++ b/drivers/baytech-mib.c @@ -31,72 +31,72 @@ #define BAYTECH_OID_MODEL_NAME ".1.3.6.1.4.1.4779.1.3.5.2.1.24.1" static info_lkp_t baytech_outlet_status_info[] = { - { -1, "error", NULL, NULL }, - { 0, "off", NULL, NULL }, - { 1, "on", NULL, NULL }, - { 2, "cycling", NULL, NULL }, /* transitional status, "reboot" in MIB comments */ - { 3, "lockon", NULL, NULL }, - { 4, "lockoff", NULL, NULL }, - { 5, "unlock", NULL, NULL }, - { 6, "unknown", NULL, NULL }, - { 0, NULL, NULL, NULL } + info_lkp_default(-1, "error"), + info_lkp_default(0, "off"), + info_lkp_default(1, "on"), + info_lkp_default(2, "cycling"), /* transitional status, "reboot" in MIB comments */ + info_lkp_default(3, "lockon"), + info_lkp_default(4, "lockoff"), + info_lkp_default(5, "unlock"), + info_lkp_default(6, "unknown"), + info_lkp_sentinel }; /* Snmp2NUT lookup table for BayTech MIBs */ static snmp_info_t baytech_mib[] = { /* standard MIB items */ - { "device.description", ST_FLAG_STRING | ST_FLAG_RW, SU_INFOSIZE, ".1.3.6.1.2.1.1.1.0", NULL, SU_FLAG_OK, NULL }, - { "device.contact", ST_FLAG_STRING | ST_FLAG_RW, SU_INFOSIZE, ".1.3.6.1.2.1.1.4.0", NULL, SU_FLAG_OK, NULL }, - { "device.location", ST_FLAG_STRING | ST_FLAG_RW, SU_INFOSIZE, ".1.3.6.1.2.1.1.6.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("device.description", ST_FLAG_STRING | ST_FLAG_RW, SU_INFOSIZE, ".1.3.6.1.2.1.1.1.0", NULL, SU_FLAG_OK, NULL), + snmp_info_default("device.contact", ST_FLAG_STRING | ST_FLAG_RW, SU_INFOSIZE, ".1.3.6.1.2.1.1.4.0", NULL, SU_FLAG_OK, NULL), + snmp_info_default("device.location", ST_FLAG_STRING | ST_FLAG_RW, SU_INFOSIZE, ".1.3.6.1.2.1.1.6.0", NULL, SU_FLAG_OK, NULL), /* Device page */ - { "device.mfr", ST_FLAG_STRING, SU_INFOSIZE, NULL, "BayTech", - SU_FLAG_STATIC | SU_FLAG_ABSENT | SU_FLAG_OK, NULL }, - { "device.model", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.4779.1.3.5.2.1.24.1", - "Generic SNMP PDU", SU_FLAG_STATIC | SU_FLAG_OK, NULL }, - { "device.serial", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.4779.1.1.2.0", "", - SU_FLAG_STATIC | SU_FLAG_OK, NULL }, - { "device.type", ST_FLAG_STRING, SU_INFOSIZE, NULL, "pdu", - SU_FLAG_STATIC | SU_FLAG_ABSENT | SU_FLAG_OK, NULL }, - { "device.macaddr", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.2.1.2.2.1.6.2", - "", SU_FLAG_STATIC | SU_FLAG_OK, NULL }, + snmp_info_default("device.mfr", ST_FLAG_STRING, SU_INFOSIZE, NULL, "BayTech", + SU_FLAG_STATIC | SU_FLAG_ABSENT | SU_FLAG_OK, NULL), + snmp_info_default("device.model", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.4779.1.3.5.2.1.24.1", + "Generic SNMP PDU", SU_FLAG_STATIC | SU_FLAG_OK, NULL), + snmp_info_default("device.serial", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.4779.1.1.2.0", "", + SU_FLAG_STATIC | SU_FLAG_OK, NULL), + snmp_info_default("device.type", ST_FLAG_STRING, SU_INFOSIZE, NULL, "pdu", + SU_FLAG_STATIC | SU_FLAG_ABSENT | SU_FLAG_OK, NULL), + snmp_info_default("device.macaddr", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.2.1.2.2.1.6.2", + "", SU_FLAG_STATIC | SU_FLAG_OK, NULL), /* UPS page */ - { "ups.mfr", ST_FLAG_STRING, SU_INFOSIZE, NULL, "Baytech", - SU_FLAG_STATIC | SU_FLAG_ABSENT | SU_FLAG_OK, NULL }, - { "ups.model", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.4779.1.3.5.2.1.24.1", - "Generic SNMP PDU", SU_FLAG_STATIC | SU_FLAG_OK, NULL }, - { "ups.id", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.4779.1.1.3.0", - "unknown", SU_FLAG_STATIC | SU_FLAG_OK, NULL }, - { "ups.serial", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.4779.1.1.2.0", "", - SU_FLAG_STATIC | SU_FLAG_OK, NULL }, - { "ups.firmware", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.4779.1.1.1.0", "", - SU_FLAG_STATIC | SU_FLAG_OK, NULL }, - { "ups.type", ST_FLAG_STRING, SU_INFOSIZE, NULL, "pdu", - SU_FLAG_STATIC | SU_FLAG_ABSENT | SU_FLAG_OK, NULL }, - { "ups.temperature", 0, 0.1, ".1.3.6.1.4.1.4779.1.3.5.5.1.10.2.1", NULL, 0, NULL }, + snmp_info_default("ups.mfr", ST_FLAG_STRING, SU_INFOSIZE, NULL, "Baytech", + SU_FLAG_STATIC | SU_FLAG_ABSENT | SU_FLAG_OK, NULL), + snmp_info_default("ups.model", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.4779.1.3.5.2.1.24.1", + "Generic SNMP PDU", SU_FLAG_STATIC | SU_FLAG_OK, NULL), + snmp_info_default("ups.id", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.4779.1.1.3.0", + "unknown", SU_FLAG_STATIC | SU_FLAG_OK, NULL), + snmp_info_default("ups.serial", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.4779.1.1.2.0", "", + SU_FLAG_STATIC | SU_FLAG_OK, NULL), + snmp_info_default("ups.firmware", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.4779.1.1.1.0", "", + SU_FLAG_STATIC | SU_FLAG_OK, NULL), + snmp_info_default("ups.type", ST_FLAG_STRING, SU_INFOSIZE, NULL, "pdu", + SU_FLAG_STATIC | SU_FLAG_ABSENT | SU_FLAG_OK, NULL), + snmp_info_default("ups.temperature", 0, 0.1, ".1.3.6.1.4.1.4779.1.3.5.5.1.10.2.1", NULL, 0, NULL), /* Outlet page */ - { "outlet.id", 0, 1, NULL, "0", SU_FLAG_STATIC | SU_FLAG_ABSENT | SU_FLAG_OK, NULL }, - { "outlet.desc", ST_FLAG_RW | ST_FLAG_STRING, 20, NULL, "All outlets", - SU_FLAG_STATIC | SU_FLAG_ABSENT | SU_FLAG_OK, NULL }, - { "outlet.count", 0, 1, ".1.3.6.1.4.1.4779.1.3.5.2.1.15.1", "0", 0, NULL }, - { "outlet.current", 0, 0.1, ".1.3.6.1.4.1.4779.1.3.5.5.1.6.2.1", NULL, 0, NULL }, - { "outlet.voltage", 0, 0.1, ".1.3.6.1.4.1.4779.1.3.5.5.1.8.2.1", NULL, 0, NULL }, + snmp_info_default("outlet.id", 0, 1, NULL, "0", SU_FLAG_STATIC | SU_FLAG_ABSENT | SU_FLAG_OK, NULL), + snmp_info_default("outlet.desc", ST_FLAG_RW | ST_FLAG_STRING, 20, NULL, "All outlets", + SU_FLAG_STATIC | SU_FLAG_ABSENT | SU_FLAG_OK, NULL), + snmp_info_default("outlet.count", 0, 1, ".1.3.6.1.4.1.4779.1.3.5.2.1.15.1", "0", 0, NULL), + snmp_info_default("outlet.current", 0, 0.1, ".1.3.6.1.4.1.4779.1.3.5.5.1.6.2.1", NULL, 0, NULL), + snmp_info_default("outlet.voltage", 0, 0.1, ".1.3.6.1.4.1.4779.1.3.5.5.1.8.2.1", NULL, 0, NULL), /* outlet template definition */ - { "outlet.%i.status", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.4779.1.3.5.3.1.3.1.%i", NULL, SU_OUTLET, &baytech_outlet_status_info[0] }, - { "outlet.%i.desc", ST_FLAG_RW | ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.4779.1.3.5.3.1.4.1.%i", NULL, SU_OUTLET, NULL }, - { "outlet.%i.id", 0, 1, ".1.3.6.1.4.1.4779.1.3.5.6.1.3.2.1.%i", "%i", SU_FLAG_STATIC | SU_FLAG_ABSENT | SU_OUTLET | SU_FLAG_OK, NULL }, - { "outlet.%i.switchable", 0, 1, ".1.3.6.1.4.1.4779.1.3.5.3.1.1.1.%i", "yes", SU_FLAG_STATIC | SU_OUTLET, NULL }, + snmp_info_default("outlet.%i.status", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.4779.1.3.5.3.1.3.1.%i", NULL, SU_OUTLET, &baytech_outlet_status_info[0]), + snmp_info_default("outlet.%i.desc", ST_FLAG_RW | ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.4779.1.3.5.3.1.4.1.%i", NULL, SU_OUTLET, NULL), + snmp_info_default("outlet.%i.id", 0, 1, ".1.3.6.1.4.1.4779.1.3.5.6.1.3.2.1.%i", "%i", SU_FLAG_STATIC | SU_FLAG_ABSENT | SU_OUTLET | SU_FLAG_OK, NULL), + snmp_info_default("outlet.%i.switchable", 0, 1, ".1.3.6.1.4.1.4779.1.3.5.3.1.1.1.%i", "yes", SU_FLAG_STATIC | SU_OUTLET, NULL), /* instant commands. */ - { "outlet.%i.load.off", 0, 1, ".1.3.6.1.4.1.4779.1.3.5.3.1.3.1.%i", "0", SU_TYPE_CMD | SU_OUTLET, NULL }, - { "outlet.%i.load.on", 0, 1, ".1.3.6.1.4.1.4779.1.3.5.3.1.3.1.%i", "1", SU_TYPE_CMD | SU_OUTLET, NULL }, + snmp_info_default("outlet.%i.load.off", 0, 1, ".1.3.6.1.4.1.4779.1.3.5.3.1.3.1.%i", "0", SU_TYPE_CMD | SU_OUTLET, NULL), + snmp_info_default("outlet.%i.load.on", 0, 1, ".1.3.6.1.4.1.4779.1.3.5.3.1.3.1.%i", "1", SU_TYPE_CMD | SU_OUTLET, NULL), /* end of structure. */ - { NULL, 0, 0, NULL, NULL, 0, NULL } + snmp_info_sentinel }; mib2nut_info_t baytech = { "baytech", BAYTECH_MIB_VERSION, NULL, BAYTECH_OID_MODEL_NAME, baytech_mib, BAYTECH_OID_MIB, NULL }; diff --git a/drivers/belkinunv.c b/drivers/belkinunv.c index 131e1247eb..83826a8b7f 100644 --- a/drivers/belkinunv.c +++ b/drivers/belkinunv.c @@ -159,7 +159,7 @@ upsdrv_info_t upsdrv_info = { #define BS_REPLACE 0x80 /* size of an array */ -#define asize(x) ((int)(sizeof(x)/sizeof(x[0]))) +#define asize(x) ((int)(SIZEOF_ARRAY(x))) static const char *upstype[3] = { "ONLINE", diff --git a/drivers/bestpower-mib.c b/drivers/bestpower-mib.c index 51ba1a62c3..4ec21e7c8a 100644 --- a/drivers/bestpower-mib.c +++ b/drivers/bestpower-mib.c @@ -22,7 +22,7 @@ #include "bestpower-mib.h" -#define BESTPOWER_MIB_VERSION "0.4" +#define BESTPOWER_MIB_VERSION "0.40" #define BESTPOWER_OID_MODEL_NAME ".1.3.6.1.4.1.2947.1.1.2.0" /* @@ -35,56 +35,56 @@ #define BESTPOWER_SYSOID BESTPOWER_OID_MODEL_NAME static info_lkp_t bestpower_power_status[] = { - { 1, "OL", NULL, NULL }, - { 2, "OB", NULL, NULL }, - { 0, NULL, NULL, NULL } -} ; + info_lkp_default(1, "OL"), + info_lkp_default(2, "OB"), + info_lkp_sentinel +}; /* Snmp2NUT lookup table for Best Power MIB */ static snmp_info_t bestpower_mib[] = { /* standard MIB items */ - { "device.description", ST_FLAG_STRING | ST_FLAG_RW, SU_INFOSIZE, ".1.3.6.1.2.1.1.1.0", NULL, SU_FLAG_OK, NULL }, - { "device.contact", ST_FLAG_STRING | ST_FLAG_RW, SU_INFOSIZE, ".1.3.6.1.2.1.1.4.0", NULL, SU_FLAG_OK, NULL }, - { "device.location", ST_FLAG_STRING | ST_FLAG_RW, SU_INFOSIZE, ".1.3.6.1.2.1.1.6.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("device.description", ST_FLAG_STRING | ST_FLAG_RW, SU_INFOSIZE, ".1.3.6.1.2.1.1.1.0", NULL, SU_FLAG_OK, NULL), + snmp_info_default("device.contact", ST_FLAG_STRING | ST_FLAG_RW, SU_INFOSIZE, ".1.3.6.1.2.1.1.4.0", NULL, SU_FLAG_OK, NULL), + snmp_info_default("device.location", ST_FLAG_STRING | ST_FLAG_RW, SU_INFOSIZE, ".1.3.6.1.2.1.1.6.0", NULL, SU_FLAG_OK, NULL), /* Device page */ - { "device.type", ST_FLAG_STRING, SU_INFOSIZE, NULL, "ups", - SU_FLAG_STATIC | SU_FLAG_ABSENT | SU_FLAG_OK, NULL }, + snmp_info_default("device.type", ST_FLAG_STRING, SU_INFOSIZE, NULL, "ups", + SU_FLAG_STATIC | SU_FLAG_ABSENT | SU_FLAG_OK, NULL), - { "ups.mfr", ST_FLAG_STRING, SU_INFOSIZE, NULL, "EATON", - SU_FLAG_STATIC | SU_FLAG_ABSENT | SU_FLAG_OK, NULL }, + snmp_info_default("ups.mfr", ST_FLAG_STRING, SU_INFOSIZE, NULL, "EATON", + SU_FLAG_STATIC | SU_FLAG_ABSENT | SU_FLAG_OK, NULL), /*.1.3.6.1.4.1.2947.1.1.1.0 = STRING: "Ferrups" .1.3.6.1.4.1.2947.1.1.2.0 = STRING: "FE850VA"*/ - { "ups.model", ST_FLAG_STRING, SU_INFOSIZE, BESTPOWER_OID_MODEL_NAME, - "Best Ferrups", SU_FLAG_STATIC, NULL }, + snmp_info_default("ups.model", ST_FLAG_STRING, SU_INFOSIZE, BESTPOWER_OID_MODEL_NAME, + "Best Ferrups", SU_FLAG_STATIC, NULL), - { "ups.serial", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.2947.1.1.5.0", - "", SU_FLAG_STATIC, NULL }, - { "ups.firmware", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.2947.1.1.7.0", - "", SU_FLAG_STATIC, NULL }, - { "ups.power", 0, 1, ".1.3.6.1.4.1.2947.1.1.3.0", "", - 0, NULL }, - { "ups.mfr.date", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.2947.1.1.8.0", "", - 0, NULL }, + snmp_info_default("ups.serial", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.2947.1.1.5.0", + "", SU_FLAG_STATIC, NULL), + snmp_info_default("ups.firmware", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.2947.1.1.7.0", + "", SU_FLAG_STATIC, NULL), + snmp_info_default("ups.power", 0, 1, ".1.3.6.1.4.1.2947.1.1.3.0", "", + 0, NULL), + snmp_info_default("ups.mfr.date", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.2947.1.1.8.0", "", + 0, NULL), - { "ups.status", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.2947.1.2.1.0", "", - 0 /*SU_STATUS_PWR*/, &bestpower_power_status[0] }, + snmp_info_default("ups.status", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.2947.1.2.1.0", "", + 0 /*SU_STATUS_PWR*/, &bestpower_power_status[0]), /* Battery runtime is expressed in minutes */ - { "battery.runtime", 0, 60.0, ".1.3.6.1.4.1.2947.1.2.3.0", "", - 0, NULL }, + snmp_info_default("battery.runtime", 0, 60.0, ".1.3.6.1.4.1.2947.1.2.3.0", "", + 0, NULL), /* The elapsed time in seconds since the * UPS has switched to battery power */ - { "battery.runtime.elapsed", 0, 1.0, ".1.3.6.1.4.1.2947.1.2.2.0", "", - 0, NULL }, - { "battery.voltage", 0, 0.1, ".1.3.6.1.4.1.2947.1.2.4.0", "", - 0, NULL }, - { "battery.current", 0, 0.1, ".1.3.6.1.4.1.2947.1.2.5.0", "", - 0, NULL }, + snmp_info_default("battery.runtime.elapsed", 0, 1.0, ".1.3.6.1.4.1.2947.1.2.2.0", "", + 0, NULL), + snmp_info_default("battery.voltage", 0, 0.1, ".1.3.6.1.4.1.2947.1.2.4.0", "", + 0, NULL), + snmp_info_default("battery.current", 0, 0.1, ".1.3.6.1.4.1.2947.1.2.5.0", "", + 0, NULL), /* end of structure. */ - { NULL, 0, 0, NULL, NULL, 0, NULL } + snmp_info_sentinel } ; mib2nut_info_t bestpower = { "bestpower", BESTPOWER_MIB_VERSION, NULL, diff --git a/drivers/compaq-mib.c b/drivers/compaq-mib.c index 7120797998..5857873df8 100644 --- a/drivers/compaq-mib.c +++ b/drivers/compaq-mib.c @@ -84,87 +84,89 @@ /* Not used, as no longer supported by MIB ver. 1.76 (Github issue 118) static info_lkp_t cpqpower_alarm_ob[] = { - { 1, "OB", NULL, NULL }, - { 0, NULL, NULL, NULL } + info_lkp_default(1, "OB"), + info_lkp_sentinel }; */ /* Not used, as no longer supported by MIB ver. 1.76 (Github issue 118) static info_lkp_t cpqpower_alarm_lb[] = { - { 1, "LB", NULL, NULL }, - { 0, NULL, NULL, NULL } + info_lkp_default(1, "LB"), + info_lkp_sentinel }; */ /* Defines for CPQPOWER_OID_POWER_STATUS (1) */ static info_lkp_t cpqpower_pwr_info[] = { - { 1, "" /* other */, NULL, NULL }, - { 2, "OFF" /* none */, NULL, NULL }, - { 3, "OL" /* normal */, NULL, NULL }, - { 4, "OL BYPASS" /* bypass */, NULL, NULL }, - { 5, "OB" /* battery */, NULL, NULL }, - { 6, "OL BOOST" /* booster */, NULL, NULL }, - { 7, "OL TRIM" /* reducer */, NULL, NULL }, - { 8, "OL" /* parallelCapacity */, NULL, NULL }, - { 9, "OL" /* parallelRedundant */, NULL, NULL }, - { 10, "OL" /* HighEfficiencyMode */, NULL, NULL }, - { 0, NULL, NULL, NULL } -} ; + info_lkp_default(1, ""), /* other */ + info_lkp_default(2, "OFF"), /* none */ + info_lkp_default(3, "OL"), /* normal */ + info_lkp_default(4, "OL BYPASS"), /* bypass */ + info_lkp_default(5, "OB"), /* battery */ + info_lkp_default(6, "OL BOOST"), /* booster */ + info_lkp_default(7, "OL TRIM"), /* reducer */ + info_lkp_default(8, "OL"), /* parallelCapacity */ + info_lkp_default(9, "OL"), /* parallelRedundant */ + info_lkp_default(10, "OL"), /* HighEfficiencyMode */ + info_lkp_sentinel +}; static info_lkp_t cpqpower_mode_info[] = { - { 1, "", NULL, NULL }, - { 2, "", NULL, NULL }, - { 3, "normal", NULL, NULL }, - { 4, "", NULL, NULL }, - { 5, "", NULL, NULL }, - { 6, "", NULL, NULL }, - { 7, "", NULL, NULL }, - { 8, "parallel capacity", NULL, NULL }, - { 9, "parallel redundancy", NULL, NULL }, - {10, "high efficiency", NULL, NULL }, - { 0, NULL, NULL, NULL } + info_lkp_default(1, ""), + info_lkp_default(2, ""), + info_lkp_default(3, "normal"), + info_lkp_default(4, ""), + info_lkp_default(5, ""), + info_lkp_default(6, ""), + info_lkp_default(7, ""), + info_lkp_default(8, "parallel capacity"), + info_lkp_default(9, "parallel redundancy"), + info_lkp_default(10, "high efficiency"), + info_lkp_sentinel }; static info_lkp_t cpqpower_battery_abm_status[] = { - { 1, "CHRG", NULL, NULL }, - { 2, "DISCHRG", NULL, NULL }, -/* { 3, "Floating", NULL, NULL }, */ -/* { 4, "Resting", NULL, NULL }, */ -/* { 5, "Unknown", NULL, NULL }, */ - { 0, NULL, NULL, NULL } -} ; + info_lkp_default(1, "CHRG"), + info_lkp_default(2, "DISCHRG"), +/* + info_lkp_default(3, "Floating"), + info_lkp_default(4, "Resting"), + info_lkp_default(5, "Unknown"), +*/ + info_lkp_sentinel +}; /* Defines for CPQPOWER_OID_UPS_TEST_RES */ static info_lkp_t cpqpower_test_res_info[] = { - { 1, "Unknown", NULL, NULL }, - { 2, "Done and passed", NULL, NULL }, - { 3, "Done and error", NULL, NULL }, - { 4, "In progress", NULL, NULL }, - { 5, "Not supported", NULL, NULL }, - { 6, "Inhibited", NULL, NULL }, - { 7, "Scheduled", NULL, NULL }, - { 0, NULL, NULL, NULL } -} ; + info_lkp_default(1, "Unknown"), + info_lkp_default(2, "Done and passed"), + info_lkp_default(3, "Done and error"), + info_lkp_default(4, "In progress"), + info_lkp_default(5, "Not supported"), + info_lkp_default(6, "Inhibited"), + info_lkp_default(7, "Scheduled"), + info_lkp_sentinel +}; #define CPQPOWER_START_TEST "1" static info_lkp_t cpqpower_outlet_status_info[] = { - { 1, "on", NULL, NULL }, - { 2, "off", NULL, NULL }, - { 3, "pendingOff", NULL, NULL }, /* transitional status */ - { 4, "pendingOn", NULL, NULL }, /* transitional status */ - { 5, "unknown", NULL, NULL }, - { 0, NULL, NULL, NULL } + info_lkp_default(1, "on"), + info_lkp_default(2, "off"), + info_lkp_default(3, "pendingOff"), /* transitional status */ + info_lkp_default(4, "pendingOn"), /* transitional status */ + info_lkp_default(5, "unknown"), + info_lkp_sentinel }; /* Ugly hack: having the matching OID present means that the outlet is * switchable. So, it should not require this value lookup */ static info_lkp_t cpqpower_outlet_switchability_info[] = { - { 1, "yes", NULL, NULL }, - { 2, "yes", NULL, NULL }, - { 3, "yes", NULL, NULL }, - { 4, "yes", NULL, NULL }, - { 0, NULL, NULL, NULL } + info_lkp_default(1, "yes"), + info_lkp_default(2, "yes"), + info_lkp_default(3, "yes"), + info_lkp_default(4, "yes"), + info_lkp_sentinel }; #define CPQPOWER_OID_SD_AFTER_DELAY ".1.3.6.1.4.1.232.165.3.8.1.0" /* UPS-MIB::upsControlOutputOffDelay */ @@ -175,38 +177,38 @@ static info_lkp_t cpqpower_outlet_switchability_info[] = { static snmp_info_t cpqpower_mib[] = { /* standard MIB items */ - { "device.description", ST_FLAG_STRING | ST_FLAG_RW, SU_INFOSIZE, ".1.3.6.1.2.1.1.1.0", NULL, SU_FLAG_OK, NULL }, - { "device.contact", ST_FLAG_STRING | ST_FLAG_RW, SU_INFOSIZE, ".1.3.6.1.2.1.1.4.0", NULL, SU_FLAG_OK, NULL }, - { "device.location", ST_FLAG_STRING | ST_FLAG_RW, SU_INFOSIZE, ".1.3.6.1.2.1.1.6.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("device.description", ST_FLAG_STRING | ST_FLAG_RW, SU_INFOSIZE, ".1.3.6.1.2.1.1.1.0", NULL, SU_FLAG_OK, NULL), + snmp_info_default("device.contact", ST_FLAG_STRING | ST_FLAG_RW, SU_INFOSIZE, ".1.3.6.1.2.1.1.4.0", NULL, SU_FLAG_OK, NULL), + snmp_info_default("device.location", ST_FLAG_STRING | ST_FLAG_RW, SU_INFOSIZE, ".1.3.6.1.2.1.1.6.0", NULL, SU_FLAG_OK, NULL), /* UPS page */ /* info_type, info_flags, info_len, OID, dfl, flags, oid2info, setvar */ - { "ups.mfr", ST_FLAG_STRING, SU_INFOSIZE, CPQPOWER_OID_MFR_NAME, "HP/Compaq", SU_FLAG_STATIC, NULL }, - { "ups.model", ST_FLAG_STRING, SU_INFOSIZE, CPQPOWER_OID_MODEL_NAME, "SNMP UPS", SU_FLAG_STATIC, NULL }, + snmp_info_default("ups.mfr", ST_FLAG_STRING, SU_INFOSIZE, CPQPOWER_OID_MFR_NAME, "HP/Compaq", SU_FLAG_STATIC, NULL), + snmp_info_default("ups.model", ST_FLAG_STRING, SU_INFOSIZE, CPQPOWER_OID_MODEL_NAME, "SNMP UPS", SU_FLAG_STATIC, NULL), /* { "ups.model.aux", ST_FLAG_STRING, SU_INFOSIZE, CPQPOWER_OID_OEMCODE, "", SU_FLAG_STATIC, NULL },*/ - { "ups.serial", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.232.165.1.2.7.0", "", SU_FLAG_STATIC | SU_FLAG_OK, NULL }, + snmp_info_default("ups.serial", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.232.165.1.2.7.0", "", SU_FLAG_STATIC | SU_FLAG_OK, NULL), /* FIXME: split between firmware and firmware.aux ("00.01.0019;00.01.0004") * UPS Firmware Revision : 00.01.0004 * Communication Board Firmware Revision : 00.01.0019 */ /* FIXME: the 2 "firmware" entries below should be SU_FLAG_SEMI_STATIC */ - { "ups.firmware", ST_FLAG_STRING, SU_INFOSIZE, CPQPOWER_OID_FIRMREV, "", 0, NULL }, - { "ups.firmware.aux", ST_FLAG_STRING, SU_INFOSIZE, IETF_OID_AGENTREV, "", 0, NULL }, - { "ups.load", 0, 1.0, CPQPOWER_OID_LOAD_LEVEL, "", 0, NULL }, - { "ups.realpower.nominal", 0, 1.0, ".1.3.6.1.4.1.232.165.3.9.3.0", "", SU_OUTPUT_1, NULL }, - { "ups.realpower", 0, 1.0, CPQPOWER_OID_OUT_POWER ".1", "", SU_OUTPUT_1, NULL }, - { "ups.L1.realpower", 0, 1.0, CPQPOWER_OID_OUT_POWER ".1", "", SU_OUTPUT_3, NULL }, - { "ups.L2.realpower", 0, 1.0, CPQPOWER_OID_OUT_POWER ".2", "", SU_OUTPUT_3, NULL }, - { "ups.L3.realpower", 0, 1.0, CPQPOWER_OID_OUT_POWER ".3", "", SU_OUTPUT_3, NULL }, - { "ups.status", ST_FLAG_STRING, SU_INFOSIZE, CPQPOWER_OID_POWER_STATUS, "OFF", SU_STATUS_PWR, cpqpower_pwr_info }, - { "ups.status", ST_FLAG_STRING, SU_INFOSIZE, CPQPOWER_OID_BATT_STATUS, "", SU_STATUS_PWR, cpqpower_battery_abm_status }, + snmp_info_default("ups.firmware", ST_FLAG_STRING, SU_INFOSIZE, CPQPOWER_OID_FIRMREV, "", 0, NULL), + snmp_info_default("ups.firmware.aux", ST_FLAG_STRING, SU_INFOSIZE, IETF_OID_AGENTREV, "", 0, NULL), + snmp_info_default("ups.load", 0, 1.0, CPQPOWER_OID_LOAD_LEVEL, "", 0, NULL), + snmp_info_default("ups.realpower.nominal", 0, 1.0, ".1.3.6.1.4.1.232.165.3.9.3.0", "", SU_OUTPUT_1, NULL), + snmp_info_default("ups.realpower", 0, 1.0, CPQPOWER_OID_OUT_POWER ".1", "", SU_OUTPUT_1, NULL), + snmp_info_default("ups.L1.realpower", 0, 1.0, CPQPOWER_OID_OUT_POWER ".1", "", SU_OUTPUT_3, NULL), + snmp_info_default("ups.L2.realpower", 0, 1.0, CPQPOWER_OID_OUT_POWER ".2", "", SU_OUTPUT_3, NULL), + snmp_info_default("ups.L3.realpower", 0, 1.0, CPQPOWER_OID_OUT_POWER ".3", "", SU_OUTPUT_3, NULL), + snmp_info_default("ups.status", ST_FLAG_STRING, SU_INFOSIZE, CPQPOWER_OID_POWER_STATUS, "OFF", SU_STATUS_PWR, cpqpower_pwr_info), + snmp_info_default("ups.status", ST_FLAG_STRING, SU_INFOSIZE, CPQPOWER_OID_BATT_STATUS, "", SU_STATUS_PWR, cpqpower_battery_abm_status), /* The next two lines are no longer supported by MIB ver. 1.76 (Github issue 118) * { "ups.status", ST_FLAG_STRING, SU_INFOSIZE, CPQPOWER_OID_ALARM_OB, "", SU_STATUS_BATT, cpqpower_alarm_ob }, * { "ups.status", ST_FLAG_STRING, SU_INFOSIZE, CPQPOWER_OID_ALARM_LB, "", SU_STATUS_BATT, cpqpower_alarm_lb }, */ /* { "ups.status", ST_FLAG_STRING, SU_INFOSIZE, IETF_OID_BATT_STATUS, "", SU_STATUS_BATT, ietf_batt_info }, */ /* FIXME: this should use either .1.3.6.1.4.1.232.165.3.11.1.0 (upsTopologyType) * or .1.3.6.1.4.1.232.165.3.11.2.0 (upsTopoMachineCode) */ - { "ups.type", ST_FLAG_STRING, SU_INFOSIZE, CPQPOWER_OID_POWER_STATUS, "", SU_STATUS_PWR, cpqpower_mode_info }, - { "ups.test.result", ST_FLAG_STRING, SU_INFOSIZE, CPQPOWER_OID_UPS_TEST_RES, "", 0, cpqpower_test_res_info }, + snmp_info_default("ups.type", ST_FLAG_STRING, SU_INFOSIZE, CPQPOWER_OID_POWER_STATUS, "", SU_STATUS_PWR, cpqpower_mode_info), + snmp_info_default("ups.test.result", ST_FLAG_STRING, SU_INFOSIZE, CPQPOWER_OID_UPS_TEST_RES, "", 0, cpqpower_test_res_info), /* FIXME: handle ups.date and ups.time * - OID: .1.3.6.1.4.1.232.165.3.9.5.0 * - format MM/DD/YYYY HH:MM:SS */ @@ -220,55 +222,55 @@ static snmp_info_t cpqpower_mib[] = { * flywheel(7) * fuelcell(8) */ - { "ups.delay.shutdown", ST_FLAG_STRING | ST_FLAG_RW, 6, ".1.3.6.1.4.1.232.165.3.8.1.0", DEFAULT_OFFDELAY, SU_FLAG_ABSENT | SU_FLAG_OK, NULL }, - { "ups.delay.start", ST_FLAG_STRING | ST_FLAG_RW, 6, ".1.3.6.1.4.1.232.165.3.8.2.0", DEFAULT_ONDELAY, SU_FLAG_ABSENT | SU_FLAG_OK, NULL }, - { "ups.timer.shutdown", 0, 1, ".1.3.6.1.4.1.232.165.3.8.1.0", "", SU_FLAG_OK, NULL }, - { "ups.timer.start", 0, 1, ".1.3.6.1.4.1.232.165.3.8.2.0", "", SU_FLAG_OK, NULL }, + snmp_info_default("ups.delay.shutdown", ST_FLAG_STRING | ST_FLAG_RW, 6, ".1.3.6.1.4.1.232.165.3.8.1.0", DEFAULT_OFFDELAY, SU_FLAG_ABSENT | SU_FLAG_OK, NULL), + snmp_info_default("ups.delay.start", ST_FLAG_STRING | ST_FLAG_RW, 6, ".1.3.6.1.4.1.232.165.3.8.2.0", DEFAULT_ONDELAY, SU_FLAG_ABSENT | SU_FLAG_OK, NULL), + snmp_info_default("ups.timer.shutdown", 0, 1, ".1.3.6.1.4.1.232.165.3.8.1.0", "", SU_FLAG_OK, NULL), + snmp_info_default("ups.timer.start", 0, 1, ".1.3.6.1.4.1.232.165.3.8.2.0", "", SU_FLAG_OK, NULL), /* Ambient page */ - { "ambient.temperature", 0, 1.0, CPQPOWER_OID_AMBIENT_TEMP, "", 0, NULL }, - { "ambient.temperature.low", 0, 1.0, ".1.3.6.1.4.1.232.165.3.6.2.0", "", 0, NULL }, - { "ambient.temperature.high", 0, 1.0, ".1.3.6.1.4.1.232.165.3.6.3.0", "", 0, NULL }, + snmp_info_default("ambient.temperature", 0, 1.0, CPQPOWER_OID_AMBIENT_TEMP, "", 0, NULL), + snmp_info_default("ambient.temperature.low", 0, 1.0, ".1.3.6.1.4.1.232.165.3.6.2.0", "", 0, NULL), + snmp_info_default("ambient.temperature.high", 0, 1.0, ".1.3.6.1.4.1.232.165.3.6.3.0", "", 0, NULL), /* Battery page */ - { "battery.charge", 0, 1.0, CPQPOWER_OID_BATT_CHARGE, "", 0, NULL }, - { "battery.runtime", 0, 1.0, CPQPOWER_OID_BATT_RUNTIME, "", 0, NULL }, - { "battery.voltage", 0, 0.1, CPQPOWER_OID_BATT_VOLTAGE, "", 0, NULL }, - { "battery.current", 0, 0.1, CPQPOWER_OID_BATT_CURRENT, "", 0, NULL }, + snmp_info_default("battery.charge", 0, 1.0, CPQPOWER_OID_BATT_CHARGE, "", 0, NULL), + snmp_info_default("battery.runtime", 0, 1.0, CPQPOWER_OID_BATT_RUNTIME, "", 0, NULL), + snmp_info_default("battery.voltage", 0, 0.1, CPQPOWER_OID_BATT_VOLTAGE, "", 0, NULL), + snmp_info_default("battery.current", 0, 0.1, CPQPOWER_OID_BATT_CURRENT, "", 0, NULL), /* FIXME: need the new variable (for ABM) - { "battery.status", 0, 0.1, ".1.3.6.1.4.1.232.165.3.2.5.0", "", 0, NULL }, */ + snmp_info_default("battery.status", 0, 0.1, ".1.3.6.1.4.1.232.165.3.2.5.0", "", 0, NULL), */ /* Input page */ - { "input.phases", 0, 1.0, CPQPOWER_OID_IN_LINES, "", 0, NULL }, - { "input.frequency", 0, 0.1, CPQPOWER_OID_IN_FREQ , "", 0, NULL }, - { "input.voltage.nominal", 0, 1.0, ".1.3.6.1.4.1.232.165.3.9.2.0", "", 0, NULL }, - { "input.voltage", 0, 1.0, CPQPOWER_OID_IN_VOLTAGE ".1", "", SU_OUTPUT_1, NULL }, - { "input.L1-N.voltage", 0, 1.0, CPQPOWER_OID_IN_VOLTAGE ".1", "", SU_INPUT_3, NULL }, - { "input.L2-N.voltage", 0, 1.0, CPQPOWER_OID_IN_VOLTAGE ".2", "", SU_INPUT_3, NULL }, - { "input.L3-N.voltage", 0, 1.0, CPQPOWER_OID_IN_VOLTAGE ".3", "", SU_INPUT_3, NULL }, - { "input.current", 0, 1.0, CPQPOWER_OID_IN_CURRENT ".1", "", SU_OUTPUT_1, NULL }, - { "input.L1.current", 0, 1.0, CPQPOWER_OID_IN_CURRENT ".1", "", SU_INPUT_3, NULL }, - { "input.L2.current", 0, 1.0, CPQPOWER_OID_IN_CURRENT ".2", "", SU_INPUT_3, NULL }, - { "input.L3.current", 0, 1.0, CPQPOWER_OID_IN_CURRENT ".3", "", SU_INPUT_3, NULL }, - { "input.realpower", 0, 1.0, CPQPOWER_OID_IN_POWER ".1", "", SU_OUTPUT_1, NULL }, - { "input.L1.realpower", 0, 1.0, CPQPOWER_OID_IN_POWER ".1", "", SU_INPUT_3, NULL }, - { "input.L2.realpower", 0, 1.0, CPQPOWER_OID_IN_POWER ".2", "", SU_INPUT_3, NULL }, - { "input.L3.realpower", 0, 1.0, CPQPOWER_OID_IN_POWER ".3", "", SU_INPUT_3, NULL }, - { "input.quality", 0, 1.0, CPQPOWER_OID_IN_LINEBADS, "", 0, NULL }, + snmp_info_default("input.phases", 0, 1.0, CPQPOWER_OID_IN_LINES, "", 0, NULL), + snmp_info_default("input.frequency", 0, 0.1, CPQPOWER_OID_IN_FREQ , "", 0, NULL), + snmp_info_default("input.voltage.nominal", 0, 1.0, ".1.3.6.1.4.1.232.165.3.9.2.0", "", 0, NULL), + snmp_info_default("input.voltage", 0, 1.0, CPQPOWER_OID_IN_VOLTAGE ".1", "", SU_OUTPUT_1, NULL), + snmp_info_default("input.L1-N.voltage", 0, 1.0, CPQPOWER_OID_IN_VOLTAGE ".1", "", SU_INPUT_3, NULL), + snmp_info_default("input.L2-N.voltage", 0, 1.0, CPQPOWER_OID_IN_VOLTAGE ".2", "", SU_INPUT_3, NULL), + snmp_info_default("input.L3-N.voltage", 0, 1.0, CPQPOWER_OID_IN_VOLTAGE ".3", "", SU_INPUT_3, NULL), + snmp_info_default("input.current", 0, 1.0, CPQPOWER_OID_IN_CURRENT ".1", "", SU_OUTPUT_1, NULL), + snmp_info_default("input.L1.current", 0, 1.0, CPQPOWER_OID_IN_CURRENT ".1", "", SU_INPUT_3, NULL), + snmp_info_default("input.L2.current", 0, 1.0, CPQPOWER_OID_IN_CURRENT ".2", "", SU_INPUT_3, NULL), + snmp_info_default("input.L3.current", 0, 1.0, CPQPOWER_OID_IN_CURRENT ".3", "", SU_INPUT_3, NULL), + snmp_info_default("input.realpower", 0, 1.0, CPQPOWER_OID_IN_POWER ".1", "", SU_OUTPUT_1, NULL), + snmp_info_default("input.L1.realpower", 0, 1.0, CPQPOWER_OID_IN_POWER ".1", "", SU_INPUT_3, NULL), + snmp_info_default("input.L2.realpower", 0, 1.0, CPQPOWER_OID_IN_POWER ".2", "", SU_INPUT_3, NULL), + snmp_info_default("input.L3.realpower", 0, 1.0, CPQPOWER_OID_IN_POWER ".3", "", SU_INPUT_3, NULL), + snmp_info_default("input.quality", 0, 1.0, CPQPOWER_OID_IN_LINEBADS, "", 0, NULL), /* Output page */ - { "output.phases", 0, 1.0, CPQPOWER_OID_OUT_LINES, "", 0, NULL }, - { "output.frequency.nominal", 0, 0.1, ".1.3.6.1.4.1.232.165.3.9.4.0", "", 0, NULL }, - { "output.frequency", 0, 0.1, CPQPOWER_OID_OUT_FREQUENCY, "", 0, NULL }, - { "output.voltage.nominal", 0, 1.0, ".1.3.6.1.4.1.232.165.3.9.1.0", "", 0, NULL }, - { "output.voltage", 0, 1.0, CPQPOWER_OID_OUT_VOLTAGE ".1", "", SU_OUTPUT_1, NULL }, - { "output.L1-N.voltage", 0, 1.0, CPQPOWER_OID_OUT_VOLTAGE ".1", "", SU_OUTPUT_3, NULL }, - { "output.L2-N.voltage", 0, 1.0, CPQPOWER_OID_OUT_VOLTAGE ".2", "", SU_OUTPUT_3, NULL }, - { "output.L3-N.voltage", 0, 1.0, CPQPOWER_OID_OUT_VOLTAGE ".3", "", SU_OUTPUT_3, NULL }, - { "output.current", 0, 1.0, CPQPOWER_OID_OUT_CURRENT ".1", "", SU_OUTPUT_1, NULL }, - { "output.L1.current", 0, 1.0, CPQPOWER_OID_OUT_CURRENT ".1", "", SU_OUTPUT_3, NULL }, - { "output.L2.current", 0, 1.0, CPQPOWER_OID_OUT_CURRENT ".2", "", SU_OUTPUT_3, NULL }, - { "output.L3.current", 0, 1.0, CPQPOWER_OID_OUT_CURRENT ".3", "", SU_OUTPUT_3, NULL }, + snmp_info_default("output.phases", 0, 1.0, CPQPOWER_OID_OUT_LINES, "", 0, NULL), + snmp_info_default("output.frequency.nominal", 0, 0.1, ".1.3.6.1.4.1.232.165.3.9.4.0", "", 0, NULL), + snmp_info_default("output.frequency", 0, 0.1, CPQPOWER_OID_OUT_FREQUENCY, "", 0, NULL), + snmp_info_default("output.voltage.nominal", 0, 1.0, ".1.3.6.1.4.1.232.165.3.9.1.0", "", 0, NULL), + snmp_info_default("output.voltage", 0, 1.0, CPQPOWER_OID_OUT_VOLTAGE ".1", "", SU_OUTPUT_1, NULL), + snmp_info_default("output.L1-N.voltage", 0, 1.0, CPQPOWER_OID_OUT_VOLTAGE ".1", "", SU_OUTPUT_3, NULL), + snmp_info_default("output.L2-N.voltage", 0, 1.0, CPQPOWER_OID_OUT_VOLTAGE ".2", "", SU_OUTPUT_3, NULL), + snmp_info_default("output.L3-N.voltage", 0, 1.0, CPQPOWER_OID_OUT_VOLTAGE ".3", "", SU_OUTPUT_3, NULL), + snmp_info_default("output.current", 0, 1.0, CPQPOWER_OID_OUT_CURRENT ".1", "", SU_OUTPUT_1, NULL), + snmp_info_default("output.L1.current", 0, 1.0, CPQPOWER_OID_OUT_CURRENT ".1", "", SU_OUTPUT_3, NULL), + snmp_info_default("output.L2.current", 0, 1.0, CPQPOWER_OID_OUT_CURRENT ".2", "", SU_OUTPUT_3, NULL), + snmp_info_default("output.L3.current", 0, 1.0, CPQPOWER_OID_OUT_CURRENT ".3", "", SU_OUTPUT_3, NULL), /* FIXME: what to map with these? * Name/OID: upsConfigLowOutputVoltageLimit.0; Value (Integer): 160 @@ -277,24 +279,24 @@ static snmp_info_t cpqpower_mib[] = { * => input.transfer.high? */ /* Outlet page */ - { "outlet.id", 0, 1, NULL, "0", SU_FLAG_STATIC | SU_FLAG_ABSENT | SU_FLAG_OK, NULL }, - { "outlet.desc", ST_FLAG_RW | ST_FLAG_STRING, 20, NULL, "All outlets", - SU_FLAG_STATIC | SU_FLAG_ABSENT | SU_FLAG_OK, NULL }, - { "outlet.count", 0, 1, ".1.3.6.1.4.1.232.165.3.10.1.0", "0", 0, NULL }, /* upsNumReceptacles */ + snmp_info_default("outlet.id", 0, 1, NULL, "0", SU_FLAG_STATIC | SU_FLAG_ABSENT | SU_FLAG_OK, NULL), + snmp_info_default("outlet.desc", ST_FLAG_RW | ST_FLAG_STRING, 20, NULL, "All outlets", + SU_FLAG_STATIC | SU_FLAG_ABSENT | SU_FLAG_OK, NULL), + snmp_info_default("outlet.count", 0, 1, ".1.3.6.1.4.1.232.165.3.10.1.0", "0", 0, NULL), /* upsNumReceptacles */ /* - { "outlet.current", 0, 0.001, AR_OID_UNIT_CURRENT ".0", NULL, 0, NULL, NULL }, - { "outlet.voltage", 0, 0.001, AR_OID_UNIT_VOLTAGE ".0", NULL, 0, NULL, NULL }, - { "outlet.realpower", 0, 1.0, AR_OID_UNIT_ACTIVEPOWER ".0", NULL, 0, NULL, NULL }, - { "outlet.power", 0, 1.0, AR_OID_UNIT_APPARENTPOWER ".0", NULL, 0, NULL, NULL }, + snmp_info_default("outlet.current", 0, 0.001, AR_OID_UNIT_CURRENT ".0", NULL, 0, NULL, NULL), + snmp_info_default("outlet.voltage", 0, 0.001, AR_OID_UNIT_VOLTAGE ".0", NULL, 0, NULL, NULL), + snmp_info_default("outlet.realpower", 0, 1.0, AR_OID_UNIT_ACTIVEPOWER ".0", NULL, 0, NULL, NULL), + snmp_info_default("outlet.power", 0, 1.0, AR_OID_UNIT_APPARENTPOWER ".0", NULL, 0, NULL, NULL), */ /* outlet template definition */ /* FIXME always true? */ - { "outlet.%i.switchable", ST_FLAG_STRING, 3, ".1.3.6.1.4.1.232.165.3.10.2.1.1.%i", "yes", SU_FLAG_STATIC | SU_OUTLET, &cpqpower_outlet_switchability_info[0] }, - { "outlet.%i.id", 0, 1, ".1.3.6.1.4.1.232.165.3.10.2.1.1.%i", "%i", SU_FLAG_STATIC | SU_FLAG_ABSENT | SU_FLAG_OK | SU_OUTLET, NULL }, + snmp_info_default("outlet.%i.switchable", ST_FLAG_STRING, 3, ".1.3.6.1.4.1.232.165.3.10.2.1.1.%i", "yes", SU_FLAG_STATIC | SU_OUTLET, &cpqpower_outlet_switchability_info[0]), + snmp_info_default("outlet.%i.id", 0, 1, ".1.3.6.1.4.1.232.165.3.10.2.1.1.%i", "%i", SU_FLAG_STATIC | SU_FLAG_ABSENT | SU_FLAG_OK | SU_OUTLET, NULL), /* { "outlet.%i.desc", ST_FLAG_RW | ST_FLAG_STRING, SU_INFOSIZE, AR_OID_OUTLET_NAME ".%i", NULL, SU_OUTLET, NULL }, */ - { "outlet.%i.status", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.232.165.3.10.2.1.2.%i", NULL, SU_FLAG_OK | SU_OUTLET, &cpqpower_outlet_status_info[0] }, + snmp_info_default("outlet.%i.status", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.232.165.3.10.2.1.2.%i", NULL, SU_FLAG_OK | SU_OUTLET, &cpqpower_outlet_status_info[0]), /* FIXME: come up with a suitable varname! * - The delay after going On Battery until the Receptacle is automatically turned Off. * A value of -1 means that this Output should never be turned Off automatically, but must be turned Off only by command. @@ -305,27 +307,27 @@ static snmp_info_t cpqpower_mib[] = { */ /* FIXME: also define .stop (as for 'shutdown.reboot') * and .delay */ - { "outlet.%i.load.off", 0, 1, ".1.3.6.1.4.1.232.165.3.10.2.1.3.%i", "0", SU_TYPE_CMD | SU_OUTLET, NULL }, - { "outlet.%i.load.on", 0, 1, ".1.3.6.1.4.1.232.165.3.10.2.1.4.%i", "0", SU_TYPE_CMD | SU_OUTLET, NULL }, + snmp_info_default("outlet.%i.load.off", 0, 1, ".1.3.6.1.4.1.232.165.3.10.2.1.3.%i", "0", SU_TYPE_CMD | SU_OUTLET, NULL), + snmp_info_default("outlet.%i.load.on", 0, 1, ".1.3.6.1.4.1.232.165.3.10.2.1.4.%i", "0", SU_TYPE_CMD | SU_OUTLET, NULL), /* FIXME: also define a .delay or map to "outlet.%i.delay.shutdown" */ - { "outlet.%i.load.cycle", 0, 1, ".1.3.6.1.4.1.232.165.3.10.2.1.7.%i", "0", SU_TYPE_CMD | SU_OUTLET, NULL }, + snmp_info_default("outlet.%i.load.cycle", 0, 1, ".1.3.6.1.4.1.232.165.3.10.2.1.7.%i", "0", SU_TYPE_CMD | SU_OUTLET, NULL), /* instant commands. */ /* We need to duplicate load.{on,off} Vs load.{on,off}.delay, since * "0" cancels the shutdown, so we put "1" (second) for immediate off! */ - { "load.off", 0, 1, ".1.3.6.1.4.1.232.165.3.8.1.0", "1", SU_TYPE_CMD, NULL }, - { "load.on", 0, 1, ".1.3.6.1.4.1.232.165.3.8.2.0", "1", SU_TYPE_CMD, NULL }, - { "shutdown.stop", 0, 1, ".1.3.6.1.4.1.232.165.3.8.1.0", "0", SU_TYPE_CMD | SU_FLAG_OK, NULL }, + snmp_info_default("load.off", 0, 1, ".1.3.6.1.4.1.232.165.3.8.1.0", "1", SU_TYPE_CMD, NULL), + snmp_info_default("load.on", 0, 1, ".1.3.6.1.4.1.232.165.3.8.2.0", "1", SU_TYPE_CMD, NULL), + snmp_info_default("shutdown.stop", 0, 1, ".1.3.6.1.4.1.232.165.3.8.1.0", "0", SU_TYPE_CMD | SU_FLAG_OK, NULL), /* FIXME: need ups.{timer,delay}.{start,shutdown} param counterparts! */ - { "load.off.delay", 0, 1, ".1.3.6.1.4.1.232.165.3.8.1.0", DEFAULT_OFFDELAY, SU_TYPE_CMD, NULL }, - { "load.on.delay", 0, 1, ".1.3.6.1.4.1.232.165.3.8.2.0", DEFAULT_ONDELAY, SU_TYPE_CMD, NULL }, - /* { CMD_SHUTDOWN, 0, CPQPOWER_OFF_GRACEFUL, CPQPOWER_OID_OFF, "", 0, NULL }, */ - { "shutdown.reboot", 0, 1, ".1.3.6.1.4.1.232.165.3.8.6.0", "0", SU_TYPE_CMD | SU_FLAG_OK, NULL }, - { "test.battery.start", 0, 1, ".1.3.6.1.4.1.232.165.3.7.1.0", CPQPOWER_START_TEST, SU_TYPE_CMD | SU_FLAG_OK, NULL }, + snmp_info_default("load.off.delay", 0, 1, ".1.3.6.1.4.1.232.165.3.8.1.0", DEFAULT_OFFDELAY, SU_TYPE_CMD, NULL), + snmp_info_default("load.on.delay", 0, 1, ".1.3.6.1.4.1.232.165.3.8.2.0", DEFAULT_ONDELAY, SU_TYPE_CMD, NULL), + /* snmp_info_default(CMD_SHUTDOWN, 0, CPQPOWER_OFF_GRACEFUL, CPQPOWER_OID_OFF, "", 0, NULL), */ + snmp_info_default("shutdown.reboot", 0, 1, ".1.3.6.1.4.1.232.165.3.8.6.0", "0", SU_TYPE_CMD | SU_FLAG_OK, NULL), + snmp_info_default("test.battery.start", 0, 1, ".1.3.6.1.4.1.232.165.3.7.1.0", CPQPOWER_START_TEST, SU_TYPE_CMD | SU_FLAG_OK, NULL), /* end of structure. */ - { NULL, 0, 0, NULL, NULL, 0, NULL } + snmp_info_sentinel }; mib2nut_info_t compaq = { "cpqpower", CPQPOWER_MIB_VERSION, NULL, CPQPOWER_OID_MFR_NAME, cpqpower_mib, CPQPOWER_SYSOID, NULL }; diff --git a/drivers/cps-hid.c b/drivers/cps-hid.c index 9ae9b65862..cbe714e787 100644 --- a/drivers/cps-hid.c +++ b/drivers/cps-hid.c @@ -3,7 +3,7 @@ * Copyright (C) * 2003 - 2008 Arnaud Quette * 2005 - 2006 Peter Selinger - * 2020 - 2022 Jim Klimov + * 2020 - 2024 Jim Klimov * * Note: this subdriver was initially generated as a "stub" by the * gen-usbhid-subdriver script. It must be customized. @@ -31,11 +31,18 @@ #include "cps-hid.h" #include "usb-common.h" -#define CPS_HID_VERSION "CyberPower HID 0.8" +#define CPS_HID_VERSION "CyberPower HID 0.80" /* Cyber Power Systems */ #define CPS_VENDORID 0x0764 +/* ST Microelectronics */ +#define STMICRO_VENDORID 0x0483 +/* Please note that USB vendor ID 0x0483 is from ST Microelectronics - + * with actual product IDs delegated to different OEMs. + * Devices handled in this driver are marketed under Cyber Energy brand. + */ + /* Values for correcting the HID on some models * where LogMin and LogMax are set incorrectly in the HID. */ @@ -73,6 +80,9 @@ static usb_device_id_t cps_usb_device_table[] = { /* OR2200LCDRM2U, OR700LCDRM1U, PR6000LCDRTXL5U */ { USB_DEVICE(CPS_VENDORID, 0x0601), NULL }, + /* Cyber Energy branded devices by CPS */ + { USB_DEVICE(STMICRO_VENDORID, 0xa430), NULL }, + /* Terminating entry */ { 0, 0, NULL } }; diff --git a/drivers/cyberpower-mib.c b/drivers/cyberpower-mib.c index 8c73ac92f0..d7faf39b9f 100644 --- a/drivers/cyberpower-mib.c +++ b/drivers/cyberpower-mib.c @@ -38,196 +38,196 @@ /* https://www.cyberpowersystems.com/products/software/mib-files/ */ /* Per CPS MIB 2.9 upsBaseOutputStatus OBJECT-TYPE: */ static info_lkp_t cyberpower_power_status[] = { - { 2, "OL", NULL, NULL }, /* onLine */ - { 3, "OB", NULL, NULL }, /* onBattery */ - { 4, "OL BOOST", NULL, NULL }, /* onBoost */ - { 5, "OFF", NULL, NULL }, /* onSleep */ - { 6, "OFF", NULL, NULL }, /* off */ - { 7, "OL", NULL, NULL }, /* rebooting */ - { 8, "OL", NULL, NULL }, /* onECO */ - { 9, "OL BYPASS", NULL, NULL }, /* onBypass */ - { 10, "OL TRIM", NULL, NULL }, /* onBuck */ - { 11, "OL OVER", NULL, NULL }, /* onOverload */ + info_lkp_default(2, "OL"), /* onLine */ + info_lkp_default(3, "OB"), /* onBattery */ + info_lkp_default(4, "OL BOOST"), /* onBoost */ + info_lkp_default(5, "OFF"), /* onSleep */ + info_lkp_default(6, "OFF"), /* off */ + info_lkp_default(7, "OL"), /* rebooting */ + info_lkp_default(8, "OL"), /* onECO */ + info_lkp_default(9, "OL BYPASS"), /* onBypass */ + info_lkp_default(10, "OL TRIM"), /* onBuck */ + info_lkp_default(11, "OL OVER"), /* onOverload */ /* Note: a "NULL" string must be last due to snmp-ups.c parser logic */ - { 1, "NULL", NULL, NULL }, /* unknown */ + info_lkp_default(1, "NULL"), /* unknown */ - { 0, NULL, NULL, NULL } -} ; + info_lkp_sentinel +}; static info_lkp_t cyberpower_battery_status[] = { - { 1, "", NULL, NULL }, /* unknown */ - { 2, "", NULL, NULL }, /* batteryNormal */ - { 3, "LB", NULL, NULL }, /* batteryLow */ - { 0, NULL, NULL, NULL } -} ; + info_lkp_default(1, ""), /* unknown */ + info_lkp_default(2, ""), /* batteryNormal */ + info_lkp_default(3, "LB"), /* batteryLow */ + info_lkp_sentinel +}; static info_lkp_t cyberpower_cal_status[] = { - { 1, "", NULL, NULL }, /* Calibration Successful */ - { 2, "", NULL, NULL }, /* Calibration Invalid */ - { 3, "CAL", NULL, NULL }, /* Calibration in progress */ - { 0, NULL, NULL, NULL } + info_lkp_default(1, ""), /* Calibration Successful */ + info_lkp_default(2, ""), /* Calibration Invalid */ + info_lkp_default(3, "CAL"), /* Calibration in progress */ + info_lkp_sentinel }; static info_lkp_t cyberpower_battrepl_status[] = { - { 1, "", NULL, NULL }, /* No battery needs replacing */ - { 2, "RB", NULL, NULL }, /* Batteries need to be replaced */ - { 0, NULL, NULL, NULL } + info_lkp_default(1, ""), /* No battery needs replacing */ + info_lkp_default(2, "RB"), /* Batteries need to be replaced */ + info_lkp_sentinel }; static info_lkp_t cyberpower_ups_alarm_info[] = { - { 1, "", NULL, NULL }, /* Normal */ - { 2, "Temperature too high!", NULL, NULL }, /* Overheat */ - { 3, "Internal UPS fault!", NULL, NULL }, /* Hardware Fault */ - { 0, NULL, NULL, NULL } + info_lkp_default(1, ""), /* Normal */ + info_lkp_default(2, "Temperature too high!"), /* Overheat */ + info_lkp_default(3, "Internal UPS fault!"), /* Hardware Fault */ + info_lkp_sentinel }; static info_lkp_t cyberpower_transfer_reasons[] = { - { 1, "noTransfer", NULL, NULL }, - { 2, "highLineVoltage", NULL, NULL }, - { 3, "brownout", NULL, NULL }, - { 4, "selfTest", NULL, NULL }, - { 0, NULL, NULL, NULL } + info_lkp_default(1, "noTransfer"), + info_lkp_default(2, "highLineVoltage"), + info_lkp_default(3, "brownout"), + info_lkp_default(4, "selfTest"), + info_lkp_sentinel }; static info_lkp_t cyberpower_testdiag_results[] = { - { 1, "Ok", NULL, NULL }, - { 2, "Failed", NULL, NULL }, - { 3, "InvalidTest", NULL, NULL }, - { 4, "TestInProgress", NULL, NULL }, - { 0, NULL, NULL, NULL } + info_lkp_default(1, "Ok"), + info_lkp_default(2, "Failed"), + info_lkp_default(3, "InvalidTest"), + info_lkp_default(4, "TestInProgress"), + info_lkp_sentinel }; /* Snmp2NUT lookup table for CyberPower MIB */ static snmp_info_t cyberpower_mib[] = { /* standard MIB items */ - { "device.description", ST_FLAG_STRING | ST_FLAG_RW, SU_INFOSIZE, ".1.3.6.1.2.1.1.1.0", NULL, SU_FLAG_OK, NULL }, - { "device.contact", ST_FLAG_STRING | ST_FLAG_RW, SU_INFOSIZE, ".1.3.6.1.2.1.1.4.0", NULL, SU_FLAG_OK, NULL }, - { "device.location", ST_FLAG_STRING | ST_FLAG_RW, SU_INFOSIZE, ".1.3.6.1.2.1.1.6.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("device.description", ST_FLAG_STRING | ST_FLAG_RW, SU_INFOSIZE, ".1.3.6.1.2.1.1.1.0", NULL, SU_FLAG_OK, NULL), + snmp_info_default("device.contact", ST_FLAG_STRING | ST_FLAG_RW, SU_INFOSIZE, ".1.3.6.1.2.1.1.4.0", NULL, SU_FLAG_OK, NULL), + snmp_info_default("device.location", ST_FLAG_STRING | ST_FLAG_RW, SU_INFOSIZE, ".1.3.6.1.2.1.1.6.0", NULL, SU_FLAG_OK, NULL), /* Device page */ - { "device.type", ST_FLAG_STRING, SU_INFOSIZE, NULL, "ups", - SU_FLAG_STATIC | SU_FLAG_ABSENT | SU_FLAG_OK, NULL }, - - { "ups.mfr", ST_FLAG_STRING, SU_INFOSIZE, NULL, "CYBERPOWER", - SU_FLAG_STATIC | SU_FLAG_ABSENT | SU_FLAG_OK, NULL }, - { "ups.model", ST_FLAG_STRING, SU_INFOSIZE, CYBERPOWER_OID_MODEL_NAME, - "CyberPower", SU_FLAG_STATIC, NULL }, - { "ups.id", ST_FLAG_STRING | ST_FLAG_RW, 8, ".1.3.6.1.4.1.3808.1.1.1.1.1.2.0", - "", SU_FLAG_OK | SU_FLAG_STATIC, NULL }, - - { "ups.serial", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.3808.1.1.1.1.2.3.0", - "", SU_FLAG_STATIC, NULL }, - { "ups.firmware", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.3808.1.1.1.1.2.1.0", - "", SU_FLAG_STATIC, NULL }, - { "ups.mfr.date", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.3808.1.1.1.1.2.2.0", "", - 0, NULL }, - - { "ups.status", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.3808.1.1.1.4.1.1.0", "", - SU_FLAG_OK | SU_STATUS_PWR, &cyberpower_power_status[0] }, - { "ups.status", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.3808.1.1.1.2.1.1.0", "", - SU_FLAG_OK | SU_STATUS_BATT, &cyberpower_battery_status[0] }, - { "ups.status", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.3808.1.1.1.7.2.7.0", "", - SU_FLAG_OK | SU_STATUS_CAL, &cyberpower_cal_status[0] }, - { "ups.status", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.3808.1.1.1.2.2.5.0", "", - SU_FLAG_OK | SU_STATUS_RB, &cyberpower_battrepl_status[0] }, - { "ups.load", 0, 1.0, ".1.3.6.1.4.1.3808.1.1.1.4.2.3.0", "", - 0, NULL }, - - { "ups.temperature", 0, 1, ".1.3.6.1.4.1.3808.1.1.1.10.2.0", "", SU_FLAG_OK, NULL }, - - { "ups.alarm", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.3808.1.1.1.10.1.0", "", - SU_FLAG_OK, &cyberpower_ups_alarm_info[0] }, + snmp_info_default("device.type", ST_FLAG_STRING, SU_INFOSIZE, NULL, "ups", + SU_FLAG_STATIC | SU_FLAG_ABSENT | SU_FLAG_OK, NULL), + + snmp_info_default("ups.mfr", ST_FLAG_STRING, SU_INFOSIZE, NULL, "CYBERPOWER", + SU_FLAG_STATIC | SU_FLAG_ABSENT | SU_FLAG_OK, NULL), + snmp_info_default("ups.model", ST_FLAG_STRING, SU_INFOSIZE, CYBERPOWER_OID_MODEL_NAME, + "CyberPower", SU_FLAG_STATIC, NULL), + snmp_info_default("ups.id", ST_FLAG_STRING | ST_FLAG_RW, 8, ".1.3.6.1.4.1.3808.1.1.1.1.1.2.0", + "", SU_FLAG_OK | SU_FLAG_STATIC, NULL), + + snmp_info_default("ups.serial", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.3808.1.1.1.1.2.3.0", + "", SU_FLAG_STATIC, NULL), + snmp_info_default("ups.firmware", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.3808.1.1.1.1.2.1.0", + "", SU_FLAG_STATIC, NULL), + snmp_info_default("ups.mfr.date", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.3808.1.1.1.1.2.2.0", "", + 0, NULL), + + snmp_info_default("ups.status", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.3808.1.1.1.4.1.1.0", "", + SU_FLAG_OK | SU_STATUS_PWR, &cyberpower_power_status[0]), + snmp_info_default("ups.status", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.3808.1.1.1.2.1.1.0", "", + SU_FLAG_OK | SU_STATUS_BATT, &cyberpower_battery_status[0]), + snmp_info_default("ups.status", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.3808.1.1.1.7.2.7.0", "", + SU_FLAG_OK | SU_STATUS_CAL, &cyberpower_cal_status[0]), + snmp_info_default("ups.status", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.3808.1.1.1.2.2.5.0", "", + SU_FLAG_OK | SU_STATUS_RB, &cyberpower_battrepl_status[0]), + snmp_info_default("ups.load", 0, 1.0, ".1.3.6.1.4.1.3808.1.1.1.4.2.3.0", "", + 0, NULL), + + snmp_info_default("ups.temperature", 0, 1, ".1.3.6.1.4.1.3808.1.1.1.10.2.0", "", SU_FLAG_OK, NULL), + + snmp_info_default("ups.alarm", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.3808.1.1.1.10.1.0", "", + SU_FLAG_OK, &cyberpower_ups_alarm_info[0]), /* Battery runtime is expressed in seconds */ - { "battery.runtime", 0, 1.0, ".1.3.6.1.4.1.3808.1.1.1.2.2.4.0", "", - 0, NULL }, + snmp_info_default("battery.runtime", 0, 1.0, ".1.3.6.1.4.1.3808.1.1.1.2.2.4.0", "", + 0, NULL), /* The elapsed time in seconds since the * UPS has switched to battery power */ - { "battery.runtime.elapsed", 0, 1.0, ".1.3.6.1.4.1.3808.1.1.1.2.1.2.0", "", - 0, NULL }, + snmp_info_default("battery.runtime.elapsed", 0, 1.0, ".1.3.6.1.4.1.3808.1.1.1.2.1.2.0", "", + 0, NULL), /* Different generations/models reported "battery.voltage" by different OIDs: */ - { "battery.voltage", 0, 0.1, ".1.3.6.1.2.1.33.1.2.5.0", "", - 0, NULL }, - { "battery.voltage", 0, 0.1, ".1.3.6.1.4.1.3808.1.1.1.2.2.2.0", "", - 0, NULL }, - { "battery.voltage.nominal", 0, 1.0, ".1.3.6.1.4.1.3808.1.1.1.2.2.8.0", "", - 0, NULL }, + snmp_info_default("battery.voltage", 0, 0.1, ".1.3.6.1.2.1.33.1.2.5.0", "", + 0, NULL), + snmp_info_default("battery.voltage", 0, 0.1, ".1.3.6.1.4.1.3808.1.1.1.2.2.2.0", "", + 0, NULL), + snmp_info_default("battery.voltage.nominal", 0, 1.0, ".1.3.6.1.4.1.3808.1.1.1.2.2.8.0", "", + 0, NULL), /* Different generations/models reported "battery.current" by different OIDs: */ - { "battery.current", 0, 0.1, ".1.3.6.1.4.1.3808.1.1.1.4.2.4.0", "", - 0, NULL }, - { "battery.current", 0, 0.1, ".1.3.6.1.4.1.3808.1.1.1.2.2.7.0", "", - 0, NULL }, - { "battery.charge", 0, 1.0, ".1.3.6.1.4.1.3808.1.1.1.2.2.1.0", "", - 0, NULL }, - { "battery.temperature", 0, 1.0, ".1.3.6.1.4.1.3808.1.1.1.2.2.3.0", "", - 0, NULL }, + snmp_info_default("battery.current", 0, 0.1, ".1.3.6.1.4.1.3808.1.1.1.4.2.4.0", "", + 0, NULL), + snmp_info_default("battery.current", 0, 0.1, ".1.3.6.1.4.1.3808.1.1.1.2.2.7.0", "", + 0, NULL), + snmp_info_default("battery.charge", 0, 1.0, ".1.3.6.1.4.1.3808.1.1.1.2.2.1.0", "", + 0, NULL), + snmp_info_default("battery.temperature", 0, 1.0, ".1.3.6.1.4.1.3808.1.1.1.2.2.3.0", "", + 0, NULL), /* upsBaseBatteryLastReplaceDate */ - { "battery.date", ST_FLAG_STRING, 8, ".1.3.6.1.4.1.3808.1.1.1.2.1.3.0", "", - SU_FLAG_OK | SU_FLAG_SEMI_STATIC, NULL }, + snmp_info_default("battery.date", ST_FLAG_STRING, 8, ".1.3.6.1.4.1.3808.1.1.1.2.1.3.0", "", + SU_FLAG_OK | SU_FLAG_SEMI_STATIC, NULL), - { "input.voltage", 0, 0.1, ".1.3.6.1.4.1.3808.1.1.1.3.2.1.0", "", - 0, NULL }, - { "input.frequency", 0, 0.1, ".1.3.6.1.4.1.3808.1.1.1.3.2.4.0", "", - 0, NULL }, + snmp_info_default("input.voltage", 0, 0.1, ".1.3.6.1.4.1.3808.1.1.1.3.2.1.0", "", + 0, NULL), + snmp_info_default("input.frequency", 0, 0.1, ".1.3.6.1.4.1.3808.1.1.1.3.2.4.0", "", + 0, NULL), /* upsAdvanceInputLineFailCause */ - { "input.transfer.reason", ST_FLAG_STRING, 1, ".1.3.6.1.4.1.3808.1.1.1.3.2.5.0", "", - SU_TYPE_INT | SU_FLAG_OK, &cyberpower_transfer_reasons[0] }, + snmp_info_default("input.transfer.reason", ST_FLAG_STRING, 1, ".1.3.6.1.4.1.3808.1.1.1.3.2.5.0", "", + SU_TYPE_INT | SU_FLAG_OK, &cyberpower_transfer_reasons[0]), - { "output.voltage", 0, 0.1, ".1.3.6.1.4.1.3808.1.1.1.4.2.1.0", "", - 0, NULL }, - { "output.frequency", 0, 0.1, ".1.3.6.1.4.1.3808.1.1.1.4.2.2.0", "", - 0, NULL }, - { "output.current", 0, 0.1, ".1.3.6.1.4.1.3808.1.1.1.4.2.4.0", "", - 0, NULL }, + snmp_info_default("output.voltage", 0, 0.1, ".1.3.6.1.4.1.3808.1.1.1.4.2.1.0", "", + 0, NULL), + snmp_info_default("output.frequency", 0, 0.1, ".1.3.6.1.4.1.3808.1.1.1.4.2.2.0", "", + 0, NULL), + snmp_info_default("output.current", 0, 0.1, ".1.3.6.1.4.1.3808.1.1.1.4.2.4.0", "", + 0, NULL), /* Delays affecting instant commands */ /* upsAdvanceConfigReturnDelay */ - { "ups.delay.start", ST_FLAG_RW, 1.0, ".1.3.6.1.4.1.3808.1.1.1.5.2.9.0", "0", - SU_FLAG_OK | SU_TYPE_TIME, NULL }, + snmp_info_default("ups.delay.start", ST_FLAG_RW, 1.0, ".1.3.6.1.4.1.3808.1.1.1.5.2.9.0", "0", + SU_FLAG_OK | SU_TYPE_TIME, NULL), /* Not provided by CPS-MIB */ - { "ups.delay.reboot", 0, 1.0, NULL, "0", - SU_FLAG_OK | SU_FLAG_ABSENT, NULL }, + snmp_info_default("ups.delay.reboot", 0, 1.0, NULL, "0", + SU_FLAG_OK | SU_FLAG_ABSENT, NULL), /* upsAdvanceConfigSleepDelay */ - { "ups.delay.shutdown", ST_FLAG_RW, 1.0, ".1.3.6.1.4.1.3808.1.1.1.5.2.11.0", "60", - SU_FLAG_OK | SU_TYPE_TIME, NULL }, + snmp_info_default("ups.delay.shutdown", ST_FLAG_RW, 1.0, ".1.3.6.1.4.1.3808.1.1.1.5.2.11.0", "60", + SU_FLAG_OK | SU_TYPE_TIME, NULL), /* instant commands. */ /* upsAdvanceControlUpsOff */ - { "load.off", 0, 1, ".1.3.6.1.4.1.3808.1.1.1.6.2.1.0", "2", SU_TYPE_CMD | SU_FLAG_OK, NULL }, + snmp_info_default("load.off", 0, 1, ".1.3.6.1.4.1.3808.1.1.1.6.2.1.0", "2", SU_TYPE_CMD | SU_FLAG_OK, NULL), /* upsAdvanceControlTurnOnUPS */ - { "load.on", 0, 1, ".1.3.6.1.4.1.3808.1.1.1.6.2.6.0", "2", SU_TYPE_CMD | SU_FLAG_OK, NULL }, + snmp_info_default("load.on", 0, 1, ".1.3.6.1.4.1.3808.1.1.1.6.2.6.0", "2", SU_TYPE_CMD | SU_FLAG_OK, NULL), /* upsAdvanceControlUpsOff */ - { "shutdown.stayoff", 0, 1, ".1.3.6.1.4.1.3808.1.1.1.6.2.6.0", "3", SU_TYPE_CMD | SU_FLAG_OK, NULL }, + snmp_info_default("shutdown.stayoff", 0, 1, ".1.3.6.1.4.1.3808.1.1.1.6.2.6.0", "3", SU_TYPE_CMD | SU_FLAG_OK, NULL), #if 0 /* upsBaseControlConserveBattery - note that this command * is not suitable here because it puts ups to sleep only * in battery mode. If power is restored during the shutdown * process, the command is not executed by ups hardware. */ - { "shutdown.return", 0, 1, ".1.3.6.1.4.1.3808.1.1.1.6.1.1.0", "2", SU_TYPE_CMD | SU_FLAG_OK, NULL }, + snmp_info_default("shutdown.return", 0, 1, ".1.3.6.1.4.1.3808.1.1.1.6.1.1.0", "2", SU_TYPE_CMD | SU_FLAG_OK, NULL), #endif /* upsAdvanceControlUpsSleep */ - { "shutdown.return", 0, 1, ".1.3.6.1.4.1.3808.1.1.1.6.2.3.0", "3", SU_TYPE_CMD | SU_FLAG_OK, NULL }, + snmp_info_default("shutdown.return", 0, 1, ".1.3.6.1.4.1.3808.1.1.1.6.2.3.0", "3", SU_TYPE_CMD | SU_FLAG_OK, NULL), /* upsAdvanceControlSimulatePowerFail */ - { "test.failure.start", 0, 1, ".1.3.6.1.4.1.3808.1.1.1.6.2.4.0", "2", SU_TYPE_CMD | SU_FLAG_OK, NULL }, + snmp_info_default("test.failure.start", 0, 1, ".1.3.6.1.4.1.3808.1.1.1.6.2.4.0", "2", SU_TYPE_CMD | SU_FLAG_OK, NULL), /* upsAdvanceTestIndicators */ - { "test.panel.start", 0, 1, ".1.3.6.1.4.1.3808.1.1.1.7.2.5.0", "2", SU_TYPE_CMD | SU_FLAG_OK, NULL }, + snmp_info_default("test.panel.start", 0, 1, ".1.3.6.1.4.1.3808.1.1.1.7.2.5.0", "2", SU_TYPE_CMD | SU_FLAG_OK, NULL), /* upsAdvanceTestDiagnostics */ - { "test.battery.start", 0, 1, ".1.3.6.1.4.1.3808.1.1.1.7.2.2.0", "2", SU_TYPE_CMD | SU_FLAG_OK, NULL }, + snmp_info_default("test.battery.start", 0, 1, ".1.3.6.1.4.1.3808.1.1.1.7.2.2.0", "2", SU_TYPE_CMD | SU_FLAG_OK, NULL), /* upsAdvanceTestRuntimeCalibration */ - { "calibrate.start", 0, 1, ".1.3.6.1.4.1.3808.1.1.1.7.2.6.0", "2", SU_TYPE_CMD | SU_FLAG_OK, NULL }, - { "calibrate.stop", 0, 1, ".1.3.6.1.4.1.3808.1.1.1.7.2.6.0", "3", SU_TYPE_CMD | SU_FLAG_OK, NULL }, + snmp_info_default("calibrate.start", 0, 1, ".1.3.6.1.4.1.3808.1.1.1.7.2.6.0", "2", SU_TYPE_CMD | SU_FLAG_OK, NULL), + snmp_info_default("calibrate.stop", 0, 1, ".1.3.6.1.4.1.3808.1.1.1.7.2.6.0", "3", SU_TYPE_CMD | SU_FLAG_OK, NULL), /* upsAdvanceTestLastDiagnosticsDate */ - { "ups.test.date", ST_FLAG_STRING, 8, ".1.3.6.1.4.1.3808.1.1.1.7.2.4.0", "", - SU_FLAG_OK | SU_FLAG_SEMI_STATIC, NULL }, + snmp_info_default("ups.test.date", ST_FLAG_STRING, 8, ".1.3.6.1.4.1.3808.1.1.1.7.2.4.0", "", + SU_FLAG_OK | SU_FLAG_SEMI_STATIC, NULL), /* upsAdvanceTestDiagnosticsResults */ - { "ups.test.result", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.3808.1.1.1.7.2.3.0", "", - SU_FLAG_OK, &cyberpower_testdiag_results[0] }, + snmp_info_default("ups.test.result", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.3808.1.1.1.7.2.3.0", "", + SU_FLAG_OK, &cyberpower_testdiag_results[0]), /* end of structure. */ - { NULL, 0, 0, NULL, NULL, 0, NULL } + snmp_info_sentinel } ; mib2nut_info_t cyberpower = { "cyberpower", CYBERPOWER_MIB_VERSION, NULL, diff --git a/drivers/delta_ups-mib.c b/drivers/delta_ups-mib.c index 888542aef8..91e21492f9 100644 --- a/drivers/delta_ups-mib.c +++ b/drivers/delta_ups-mib.c @@ -25,45 +25,49 @@ #include "delta_ups-mib.h" -#define DELTA_UPS_MIB_VERSION "0.5" +#define DELTA_UPS_MIB_VERSION "0.51" #define DELTA_UPS_SYSOID ".1.3.6.1.4.1.2254.2.4" /* To create a value lookup structure (as needed on the 2nd line of the example * below), use the following kind of declaration, outside of the present snmp_info_t[]: - * static info_lkp_t delta_ups_onbatt_info[] = { - * { 1, "OB", NULL, NULL }, - * { 2, "OL", NULL, NULL }, - * { 0, NULL, NULL, NULL } + * static info_lkp_t delta_onbatt_info[] = { + * info_lkp_default(1, "OB"), + * info_lkp_default(2, "OL"), + * info_lkp_sentinel * }; */ static info_lkp_t delta_ups_upstype_info[] = { - { 1, "on-line", NULL, NULL }, - { 2, "off-line", NULL, NULL }, - { 3, "line-interactive", NULL, NULL }, - { 4, "3phase", NULL, NULL }, - { 5, "splite-phase", NULL, NULL }, - { 0, NULL, NULL, NULL } + info_lkp_default(1, "on-line"), + info_lkp_default(2, "off-line"), + info_lkp_default(3, "line-interactive"), + info_lkp_default(4, "3phase"), + info_lkp_default(5, "split-phase"), + info_lkp_sentinel }; static info_lkp_t delta_ups_pwr_info[] = { - { 0, "OL", NULL, NULL }, /* normal */ - { 1, "OB", NULL, NULL }, /* battery */ - { 2, "BYPASS", NULL, NULL }, /* bypass */ - { 3, "TRIM", NULL, NULL }, /* reducing */ - { 4, "BOOST", NULL, NULL }, /* boosting */ - { 5, "BYPASS", NULL, NULL }, /* manualBypass */ - /*{ 6, "NULL", NULL, NULL },*/ /* other */ - { 7, "OFF", NULL, NULL }, /* none */ - { 0, NULL, NULL, NULL } -} ; + info_lkp_default(0, "OL"), /* normal */ + info_lkp_default(1, "OB"), /* battery */ + info_lkp_default(2, "BYPASS"), /* bypass */ + info_lkp_default(3, "TRIM"), /* reducing */ + info_lkp_default(4, "BOOST"), /* boosting */ + info_lkp_default(5, "BYPASS"), /* manualBypass */ + +/* + info_lkp_default(6, "NULL"), +*/ /* other */ + + info_lkp_default(7, "OFF"), /* none */ + info_lkp_sentinel +}; /* DELTA_UPS Snmp2NUT lookup table */ static snmp_info_t delta_ups_mib[] = { /* Data format: - * { info_type, info_flags, info_len, OID, dfl, flags, oid2info, setvar }, + * snmp_info_default(info_type, info_flags, info_len, OID, dfl, flags, oid2info, setvar), * * info_type: NUT INFO_ or CMD_ element name * info_flags: flags to set in addinfo @@ -75,55 +79,55 @@ static snmp_info_t delta_ups_mib[] = { * oid2info: lookup table between OID and NUT values * * Example: - * { "input.voltage", 0, 0.1, ".1.3.6.1.4.1.705.1.6.2.1.2.1", "", SU_INPUT_1, NULL }, - * { "ups.status", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.705.1.7.3.0", "", SU_FLAG_OK | SU_STATUS_BATT, delta_ups_onbatt_info }, + * snmp_info_default("input.voltage", 0, 0.1, ".1.3.6.1.4.1.705.1.6.2.1.2.1", "", SU_INPUT_1, NULL), + * snmp_info_default("ups.status", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.705.1.7.3.0", "", SU_FLAG_OK | SU_STATUS_BATT, delta_ups_onbatt_info), * * To create a value lookup structure (as needed on the 2nd line), use the * following kind of declaration, outside of the present snmp_info_t[]: * static info_lkp_t delta_ups_onbatt_info[] = { - * { 1, "OB" }, - * { 2, "OL" }, - * { 0, NULL } + * info_lkp_default(1, "OB"), + * info_lkp_default(2, "OL"), + * info_lkp_sentinel * }; */ /* standard MIB items */ - { "device.description", ST_FLAG_STRING | ST_FLAG_RW, SU_INFOSIZE, ".1.3.6.1.2.1.1.1.0", NULL, SU_FLAG_OK, NULL }, - { "device.contact", ST_FLAG_STRING | ST_FLAG_RW, SU_INFOSIZE, ".1.3.6.1.2.1.1.4.0", NULL, SU_FLAG_OK, NULL }, - { "device.location", ST_FLAG_STRING | ST_FLAG_RW, SU_INFOSIZE, ".1.3.6.1.2.1.1.6.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("device.description", ST_FLAG_STRING | ST_FLAG_RW, SU_INFOSIZE, ".1.3.6.1.2.1.1.1.0", NULL, SU_FLAG_OK, NULL), + snmp_info_default("device.contact", ST_FLAG_STRING | ST_FLAG_RW, SU_INFOSIZE, ".1.3.6.1.2.1.1.4.0", NULL, SU_FLAG_OK, NULL), + snmp_info_default("device.location", ST_FLAG_STRING | ST_FLAG_RW, SU_INFOSIZE, ".1.3.6.1.2.1.1.6.0", NULL, SU_FLAG_OK, NULL), /* dupsIdentManufacturer.0 = STRING: "Socomec" */ - { "ups.mfr", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.2254.2.4.1.1.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("ups.mfr", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.2254.2.4.1.1.0", NULL, SU_FLAG_OK, NULL), /* dupsIdentModel.0 = STRING: "NETYS RT 1/1 UPS" */ - { "ups.model", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.2254.2.4.1.2.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("ups.model", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.2254.2.4.1.2.0", NULL, SU_FLAG_OK, NULL), /* dupsIdentAgentSoftwareVersion.0 = STRING: "2.0h " */ - { "ups.firmware", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.2254.2.4.1.4.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("ups.firmware", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.2254.2.4.1.4.0", NULL, SU_FLAG_OK, NULL), /* dupsIdentUPSSoftwareVersion.0 = STRING: "1.1" */ - { "ups.firmware.aux", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.2254.2.4.1.3.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("ups.firmware.aux", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.2254.2.4.1.3.0", NULL, SU_FLAG_OK, NULL), /* dupsType.0 = INTEGER: on-line(1) */ - { "ups.type", 0, 1, ".1.3.6.1.4.1.2254.2.4.1.19.0", NULL, SU_FLAG_OK, delta_ups_upstype_info }, + snmp_info_default("ups.type", 0, 1, ".1.3.6.1.4.1.2254.2.4.1.19.0", NULL, SU_FLAG_OK, delta_ups_upstype_info), /* dupsOutputLoad1.0 = INTEGER: 29 */ - { "ups.load", 0, 1, ".1.3.6.1.4.1.2254.2.4.5.7.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("ups.load", 0, 1, ".1.3.6.1.4.1.2254.2.4.5.7.0", NULL, SU_FLAG_OK, NULL), /* dupsRatingOutputVA.0 = INTEGER: 2200 */ - { "ups.power", 0, 1, ".1.3.6.1.4.1.2254.2.4.1.7.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("ups.power", 0, 1, ".1.3.6.1.4.1.2254.2.4.1.7.0", NULL, SU_FLAG_OK, NULL), /* dupsRatingOutputVoltage.0 = INTEGER: 230 */ - { "output.voltage.nominal", 0, 1, ".1.3.6.1.4.1.2254.2.4.1.8.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("output.voltage.nominal", 0, 1, ".1.3.6.1.4.1.2254.2.4.1.8.0", NULL, SU_FLAG_OK, NULL), /* dupsOutputVoltage1.0 = INTEGER: 2300 */ - { "output.voltage", 0, 0.1, ".1.3.6.1.4.1.2254.2.4.5.4.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("output.voltage", 0, 0.1, ".1.3.6.1.4.1.2254.2.4.5.4.0", NULL, SU_FLAG_OK, NULL), /* dupsRatingOutputFrequency.0 = INTEGER: 50 */ - { "output.frequency.nominal", 0, 1, ".1.3.6.1.4.1.2254.2.4.1.9.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("output.frequency.nominal", 0, 1, ".1.3.6.1.4.1.2254.2.4.1.9.0", NULL, SU_FLAG_OK, NULL), /* dupsOutputCurrent1.0 = INTEGER: 23 */ - { "output.current", 0, 0.1, ".1.3.6.1.4.1.2254.2.4.5.5.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("output.current", 0, 0.1, ".1.3.6.1.4.1.2254.2.4.5.5.0", NULL, SU_FLAG_OK, NULL), /* dupsRatingInputVoltage.0 = INTEGER: 230 */ - { "input.voltage.nominal", 0, 1, ".1.3.6.1.4.1.2254.2.4.1.10.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("input.voltage.nominal", 0, 1, ".1.3.6.1.4.1.2254.2.4.1.10.0", NULL, SU_FLAG_OK, NULL), /* dupsInputVoltage1.0 = INTEGER: 2280 */ - { "input.voltage", 0, 0.1, ".1.3.6.1.4.1.2254.2.4.4.3.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("input.voltage", 0, 0.1, ".1.3.6.1.4.1.2254.2.4.4.3.0", NULL, SU_FLAG_OK, NULL), /* dupsRatingInputFrequency.0 = INTEGER: 50 */ - { "input.frequency.nominal", 0, 1, ".1.3.6.1.4.1.2254.2.4.1.11.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("input.frequency.nominal", 0, 1, ".1.3.6.1.4.1.2254.2.4.1.11.0", NULL, SU_FLAG_OK, NULL), /* dupsInputFrequency1.0 = INTEGER: 499 */ - { "input.frequency", 0, 0.1, ".1.3.6.1.4.1.2254.2.4.4.2.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("input.frequency", 0, 0.1, ".1.3.6.1.4.1.2254.2.4.4.2.0", NULL, SU_FLAG_OK, NULL), /* dupsOutputSource.0 = INTEGER: normal(0) */ - { "ups.status", 0, 1, ".1.3.6.1.4.1.2254.2.4.5.1.0", NULL, SU_FLAG_OK, delta_ups_pwr_info }, + snmp_info_default("ups.status", 0, 1, ".1.3.6.1.4.1.2254.2.4.5.1.0", NULL, SU_FLAG_OK, delta_ups_pwr_info), /* Remaining unmapped variables. * Mostly the first field (string) is to be changed @@ -131,235 +135,235 @@ static snmp_info_t delta_ups_mib[] = { */ #if WITH_UNMAPPED_DATA_POINTS /* dupsIdentName.0 = "" */ - { "unmapped.dupsIdentName", 0, 1, ".1.3.6.1.4.1.2254.2.4.1.5.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.dupsIdentName", 0, 1, ".1.3.6.1.4.1.2254.2.4.1.5.0", NULL, SU_FLAG_OK, NULL), /* dupsAttachedDevices.0 = "" */ - { "unmapped.dupsAttachedDevices", 0, 1, ".1.3.6.1.4.1.2254.2.4.1.6.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.dupsAttachedDevices", 0, 1, ".1.3.6.1.4.1.2254.2.4.1.6.0", NULL, SU_FLAG_OK, NULL), /* dupsRatingBatteryVoltage.0 = INTEGER: 0 */ - { "unmapped.dupsRatingBatteryVoltage", 0, 1, ".1.3.6.1.4.1.2254.2.4.1.12.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.dupsRatingBatteryVoltage", 0, 1, ".1.3.6.1.4.1.2254.2.4.1.12.0", NULL, SU_FLAG_OK, NULL), /* dupsLowTransferVoltUpBound.0 = INTEGER: 0 Volt */ - { "unmapped.dupsLowTransferVoltUpBound", 0, 1, ".1.3.6.1.4.1.2254.2.4.1.13.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.dupsLowTransferVoltUpBound", 0, 1, ".1.3.6.1.4.1.2254.2.4.1.13.0", NULL, SU_FLAG_OK, NULL), /* dupsLowTransferVoltLowBound.0 = INTEGER: 0 Volt */ - { "unmapped.dupsLowTransferVoltLowBound", 0, 1, ".1.3.6.1.4.1.2254.2.4.1.14.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.dupsLowTransferVoltLowBound", 0, 1, ".1.3.6.1.4.1.2254.2.4.1.14.0", NULL, SU_FLAG_OK, NULL), /* dupsHighTransferVoltUpBound.0 = INTEGER: 0 Volt */ - { "unmapped.dupsHighTransferVoltUpBound", 0, 1, ".1.3.6.1.4.1.2254.2.4.1.15.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.dupsHighTransferVoltUpBound", 0, 1, ".1.3.6.1.4.1.2254.2.4.1.15.0", NULL, SU_FLAG_OK, NULL), /* dupsHighTransferVoltLowBound.0 = INTEGER: 0 Volt */ - { "unmapped.dupsHighTransferVoltLowBound", 0, 1, ".1.3.6.1.4.1.2254.2.4.1.16.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.dupsHighTransferVoltLowBound", 0, 1, ".1.3.6.1.4.1.2254.2.4.1.16.0", NULL, SU_FLAG_OK, NULL), /* dupsLowBattTime.0 = Wrong Type (should be INTEGER): NULL */ - { "unmapped.dupsLowBattTime", 0, 1, ".1.3.6.1.4.1.2254.2.4.1.17.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.dupsLowBattTime", 0, 1, ".1.3.6.1.4.1.2254.2.4.1.17.0", NULL, SU_FLAG_OK, NULL), /* dupsOutletRelays.0 = INTEGER: 2 */ - { "unmapped.dupsOutletRelays", 0, 1, ".1.3.6.1.4.1.2254.2.4.1.18.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.dupsOutletRelays", 0, 1, ".1.3.6.1.4.1.2254.2.4.1.18.0", NULL, SU_FLAG_OK, NULL), /* dupsShutdownType.0 = Wrong Type (should be INTEGER): NULL */ - { "unmapped.dupsShutdownType", 0, 1, ".1.3.6.1.4.1.2254.2.4.2.1.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.dupsShutdownType", 0, 1, ".1.3.6.1.4.1.2254.2.4.2.1.0", NULL, SU_FLAG_OK, NULL), /* dupsAutoReboot.0 = Wrong Type (should be INTEGER): NULL */ - { "unmapped.dupsAutoReboot", 0, 1, ".1.3.6.1.4.1.2254.2.4.2.2.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.dupsAutoReboot", 0, 1, ".1.3.6.1.4.1.2254.2.4.2.2.0", NULL, SU_FLAG_OK, NULL), /* dupsShutdownAction.0 = INTEGER: 0 */ - { "unmapped.dupsShutdownAction", 0, 1, ".1.3.6.1.4.1.2254.2.4.2.3.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.dupsShutdownAction", 0, 1, ".1.3.6.1.4.1.2254.2.4.2.3.0", NULL, SU_FLAG_OK, NULL), /* dupsRestartAction.0 = INTEGER: 0 */ - { "unmapped.dupsRestartAction", 0, 1, ".1.3.6.1.4.1.2254.2.4.2.4.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.dupsRestartAction", 0, 1, ".1.3.6.1.4.1.2254.2.4.2.4.0", NULL, SU_FLAG_OK, NULL), /* dupsSetOutletRelay.0 = INTEGER: 1 */ - { "unmapped.dupsSetOutletRelay", 0, 1, ".1.3.6.1.4.1.2254.2.4.2.5.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.dupsSetOutletRelay", 0, 1, ".1.3.6.1.4.1.2254.2.4.2.5.0", NULL, SU_FLAG_OK, NULL), /* dupsRelayOffDelay.0 = INTEGER: 0 */ - { "unmapped.dupsRelayOffDelay", 0, 1, ".1.3.6.1.4.1.2254.2.4.2.6.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.dupsRelayOffDelay", 0, 1, ".1.3.6.1.4.1.2254.2.4.2.6.0", NULL, SU_FLAG_OK, NULL), /* dupsRelayOnDelay.0 = INTEGER: 0 */ - { "unmapped.dupsRelayOnDelay", 0, 1, ".1.3.6.1.4.1.2254.2.4.2.7.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.dupsRelayOnDelay", 0, 1, ".1.3.6.1.4.1.2254.2.4.2.7.0", NULL, SU_FLAG_OK, NULL), /* dupsConfigBuzzerAlarm.0 = INTEGER: alarm(1) */ - { "unmapped.dupsConfigBuzzerAlarm", 0, 1, ".1.3.6.1.4.1.2254.2.4.3.1.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.dupsConfigBuzzerAlarm", 0, 1, ".1.3.6.1.4.1.2254.2.4.3.1.0", NULL, SU_FLAG_OK, NULL), /* dupsConfigBuzzerState.0 = INTEGER: disable(2) */ - { "unmapped.dupsConfigBuzzerState", 0, 1, ".1.3.6.1.4.1.2254.2.4.3.2.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.dupsConfigBuzzerState", 0, 1, ".1.3.6.1.4.1.2254.2.4.3.2.0", NULL, SU_FLAG_OK, NULL), /* dupsConfigSensitivity.0 = Wrong Type (should be INTEGER): NULL */ - { "unmapped.dupsConfigSensitivity", 0, 1, ".1.3.6.1.4.1.2254.2.4.3.3.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.dupsConfigSensitivity", 0, 1, ".1.3.6.1.4.1.2254.2.4.3.3.0", NULL, SU_FLAG_OK, NULL), /* dupsConfigLowVoltageTransferPoint.0 = Wrong Type (should be INTEGER): NULL */ - { "unmapped.dupsConfigLowVoltageTransferPoint", 0, 1, ".1.3.6.1.4.1.2254.2.4.3.4.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.dupsConfigLowVoltageTransferPoint", 0, 1, ".1.3.6.1.4.1.2254.2.4.3.4.0", NULL, SU_FLAG_OK, NULL), /* dupsConfigHighVoltageTransferPoint.0 = Wrong Type (should be INTEGER): NULL */ - { "unmapped.dupsConfigHighVoltageTransferPoint", 0, 1, ".1.3.6.1.4.1.2254.2.4.3.5.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.dupsConfigHighVoltageTransferPoint", 0, 1, ".1.3.6.1.4.1.2254.2.4.3.5.0", NULL, SU_FLAG_OK, NULL), /* dupsConfigShutdownOSDelay.0 = Wrong Type (should be INTEGER): NULL */ - { "unmapped.dupsConfigShutdownOSDelay", 0, 1, ".1.3.6.1.4.1.2254.2.4.3.6.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.dupsConfigShutdownOSDelay", 0, 1, ".1.3.6.1.4.1.2254.2.4.3.6.0", NULL, SU_FLAG_OK, NULL), /* dupsConfigUPSBootDelay.0 = Wrong Type (should be INTEGER): NULL */ - { "unmapped.dupsConfigUPSBootDelay", 0, 1, ".1.3.6.1.4.1.2254.2.4.3.7.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.dupsConfigUPSBootDelay", 0, 1, ".1.3.6.1.4.1.2254.2.4.3.7.0", NULL, SU_FLAG_OK, NULL), /* dupsConfigExternalBatteryPack.0 = INTEGER: 0 */ - { "unmapped.dupsConfigExternalBatteryPack", 0, 1, ".1.3.6.1.4.1.2254.2.4.3.8.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.dupsConfigExternalBatteryPack", 0, 1, ".1.3.6.1.4.1.2254.2.4.3.8.0", NULL, SU_FLAG_OK, NULL), /* dupsInputNumLines.0 = INTEGER: 1 */ - { "unmapped.dupsInputNumLines", 0, 1, ".1.3.6.1.4.1.2254.2.4.4.1.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.dupsInputNumLines", 0, 1, ".1.3.6.1.4.1.2254.2.4.4.1.0", NULL, SU_FLAG_OK, NULL), /* dupsInputCurrent1.0 = Wrong Type (should be INTEGER): NULL */ - { "unmapped.dupsInputCurrent1", 0, 1, ".1.3.6.1.4.1.2254.2.4.4.4.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.dupsInputCurrent1", 0, 1, ".1.3.6.1.4.1.2254.2.4.4.4.0", NULL, SU_FLAG_OK, NULL), /* dupsInputFrequency2.0 = Wrong Type (should be INTEGER): NULL */ - { "unmapped.dupsInputFrequency2", 0, 1, ".1.3.6.1.4.1.2254.2.4.4.5.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.dupsInputFrequency2", 0, 1, ".1.3.6.1.4.1.2254.2.4.4.5.0", NULL, SU_FLAG_OK, NULL), /* dupsInputVoltage2.0 = Wrong Type (should be INTEGER): NULL */ - { "unmapped.dupsInputVoltage2", 0, 1, ".1.3.6.1.4.1.2254.2.4.4.6.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.dupsInputVoltage2", 0, 1, ".1.3.6.1.4.1.2254.2.4.4.6.0", NULL, SU_FLAG_OK, NULL), /* dupsInputCurrent2.0 = Wrong Type (should be INTEGER): NULL */ - { "unmapped.dupsInputCurrent2", 0, 1, ".1.3.6.1.4.1.2254.2.4.4.7.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.dupsInputCurrent2", 0, 1, ".1.3.6.1.4.1.2254.2.4.4.7.0", NULL, SU_FLAG_OK, NULL), /* dupsInputFrequency3.0 = Wrong Type (should be INTEGER): NULL */ - { "unmapped.dupsInputFrequency3", 0, 1, ".1.3.6.1.4.1.2254.2.4.4.8.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.dupsInputFrequency3", 0, 1, ".1.3.6.1.4.1.2254.2.4.4.8.0", NULL, SU_FLAG_OK, NULL), /* dupsInputVoltage3.0 = Wrong Type (should be INTEGER): NULL */ - { "unmapped.dupsInputVoltage3", 0, 1, ".1.3.6.1.4.1.2254.2.4.4.9.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.dupsInputVoltage3", 0, 1, ".1.3.6.1.4.1.2254.2.4.4.9.0", NULL, SU_FLAG_OK, NULL), /* dupsInputCurrent3.0 = Wrong Type (should be INTEGER): NULL */ - { "unmapped.dupsInputCurrent3", 0, 1, ".1.3.6.1.4.1.2254.2.4.4.10.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.dupsInputCurrent3", 0, 1, ".1.3.6.1.4.1.2254.2.4.4.10.0", NULL, SU_FLAG_OK, NULL), /* dupsOutputFrequency.0 = INTEGER: 499 0.1 Hertz */ - { "unmapped.dupsOutputFrequency", 0, 1, ".1.3.6.1.4.1.2254.2.4.5.2.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.dupsOutputFrequency", 0, 1, ".1.3.6.1.4.1.2254.2.4.5.2.0", NULL, SU_FLAG_OK, NULL), /* dupsOutputNumLines.0 = INTEGER: 1 */ - { "unmapped.dupsOutputNumLines", 0, 1, ".1.3.6.1.4.1.2254.2.4.5.3.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.dupsOutputNumLines", 0, 1, ".1.3.6.1.4.1.2254.2.4.5.3.0", NULL, SU_FLAG_OK, NULL), /* dupsOutputPower1.0 = Wrong Type (should be INTEGER): NULL */ - { "unmapped.dupsOutputPower1", 0, 1, ".1.3.6.1.4.1.2254.2.4.5.6.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.dupsOutputPower1", 0, 1, ".1.3.6.1.4.1.2254.2.4.5.6.0", NULL, SU_FLAG_OK, NULL), /* dupsOutputVoltage2.0 = Wrong Type (should be INTEGER): NULL */ - { "unmapped.dupsOutputVoltage2", 0, 1, ".1.3.6.1.4.1.2254.2.4.5.8.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.dupsOutputVoltage2", 0, 1, ".1.3.6.1.4.1.2254.2.4.5.8.0", NULL, SU_FLAG_OK, NULL), /* dupsOutputCurrent2.0 = Wrong Type (should be INTEGER): NULL */ - { "unmapped.dupsOutputCurrent2", 0, 1, ".1.3.6.1.4.1.2254.2.4.5.9.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.dupsOutputCurrent2", 0, 1, ".1.3.6.1.4.1.2254.2.4.5.9.0", NULL, SU_FLAG_OK, NULL), /* dupsOutputPower2.0 = Wrong Type (should be INTEGER): NULL */ - { "unmapped.dupsOutputPower2", 0, 1, ".1.3.6.1.4.1.2254.2.4.5.10.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.dupsOutputPower2", 0, 1, ".1.3.6.1.4.1.2254.2.4.5.10.0", NULL, SU_FLAG_OK, NULL), /* dupsOutputLoad2.0 = Wrong Type (should be INTEGER): NULL */ - { "unmapped.dupsOutputLoad2", 0, 1, ".1.3.6.1.4.1.2254.2.4.5.11.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.dupsOutputLoad2", 0, 1, ".1.3.6.1.4.1.2254.2.4.5.11.0", NULL, SU_FLAG_OK, NULL), /* dupsOutputVoltage3.0 = Wrong Type (should be INTEGER): NULL */ - { "unmapped.dupsOutputVoltage3", 0, 1, ".1.3.6.1.4.1.2254.2.4.5.12.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.dupsOutputVoltage3", 0, 1, ".1.3.6.1.4.1.2254.2.4.5.12.0", NULL, SU_FLAG_OK, NULL), /* dupsOutputCurrent3.0 = Wrong Type (should be INTEGER): NULL */ - { "unmapped.dupsOutputCurrent3", 0, 1, ".1.3.6.1.4.1.2254.2.4.5.13.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.dupsOutputCurrent3", 0, 1, ".1.3.6.1.4.1.2254.2.4.5.13.0", NULL, SU_FLAG_OK, NULL), /* dupsOutputPower3.0 = Wrong Type (should be INTEGER): NULL */ - { "unmapped.dupsOutputPower3", 0, 1, ".1.3.6.1.4.1.2254.2.4.5.14.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.dupsOutputPower3", 0, 1, ".1.3.6.1.4.1.2254.2.4.5.14.0", NULL, SU_FLAG_OK, NULL), /* dupsOutputLoad3.0 = Wrong Type (should be INTEGER): NULL */ - { "unmapped.dupsOutputLoad3", 0, 1, ".1.3.6.1.4.1.2254.2.4.5.15.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.dupsOutputLoad3", 0, 1, ".1.3.6.1.4.1.2254.2.4.5.15.0", NULL, SU_FLAG_OK, NULL), /* dupsBypassFrequency.0 = INTEGER: 499 0.1 Hertz */ - { "unmapped.dupsBypassFrequency", 0, 1, ".1.3.6.1.4.1.2254.2.4.6.1.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.dupsBypassFrequency", 0, 1, ".1.3.6.1.4.1.2254.2.4.6.1.0", NULL, SU_FLAG_OK, NULL), /* dupsBypassNumLines.0 = INTEGER: 1 */ - { "unmapped.dupsBypassNumLines", 0, 1, ".1.3.6.1.4.1.2254.2.4.6.2.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.dupsBypassNumLines", 0, 1, ".1.3.6.1.4.1.2254.2.4.6.2.0", NULL, SU_FLAG_OK, NULL), /* dupsBypassVoltage1.0 = INTEGER: 2280 */ - { "unmapped.dupsBypassVoltage1", 0, 1, ".1.3.6.1.4.1.2254.2.4.6.3.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.dupsBypassVoltage1", 0, 1, ".1.3.6.1.4.1.2254.2.4.6.3.0", NULL, SU_FLAG_OK, NULL), /* dupsBypassCurrent1.0 = Wrong Type (should be INTEGER): NULL */ - { "unmapped.dupsBypassCurrent1", 0, 1, ".1.3.6.1.4.1.2254.2.4.6.4.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.dupsBypassCurrent1", 0, 1, ".1.3.6.1.4.1.2254.2.4.6.4.0", NULL, SU_FLAG_OK, NULL), /* dupsBypassPower1.0 = Wrong Type (should be INTEGER): NULL */ - { "unmapped.dupsBypassPower1", 0, 1, ".1.3.6.1.4.1.2254.2.4.6.5.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.dupsBypassPower1", 0, 1, ".1.3.6.1.4.1.2254.2.4.6.5.0", NULL, SU_FLAG_OK, NULL), /* dupsBypassVoltage2.0 = Wrong Type (should be INTEGER): NULL */ - { "unmapped.dupsBypassVoltage2", 0, 1, ".1.3.6.1.4.1.2254.2.4.6.6.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.dupsBypassVoltage2", 0, 1, ".1.3.6.1.4.1.2254.2.4.6.6.0", NULL, SU_FLAG_OK, NULL), /* dupsBypassCurrent2.0 = Wrong Type (should be INTEGER): NULL */ - { "unmapped.dupsBypassCurrent2", 0, 1, ".1.3.6.1.4.1.2254.2.4.6.7.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.dupsBypassCurrent2", 0, 1, ".1.3.6.1.4.1.2254.2.4.6.7.0", NULL, SU_FLAG_OK, NULL), /* dupsBypassPower2.0 = Wrong Type (should be INTEGER): NULL */ - { "unmapped.dupsBypassPower2", 0, 1, ".1.3.6.1.4.1.2254.2.4.6.8.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.dupsBypassPower2", 0, 1, ".1.3.6.1.4.1.2254.2.4.6.8.0", NULL, SU_FLAG_OK, NULL), /* dupsBypassVoltage3.0 = Wrong Type (should be INTEGER): NULL */ - { "unmapped.dupsBypassVoltage3", 0, 1, ".1.3.6.1.4.1.2254.2.4.6.9.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.dupsBypassVoltage3", 0, 1, ".1.3.6.1.4.1.2254.2.4.6.9.0", NULL, SU_FLAG_OK, NULL), /* dupsBypassCurrent3.0 = Wrong Type (should be INTEGER): NULL */ - { "unmapped.dupsBypassCurrent3", 0, 1, ".1.3.6.1.4.1.2254.2.4.6.10.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.dupsBypassCurrent3", 0, 1, ".1.3.6.1.4.1.2254.2.4.6.10.0", NULL, SU_FLAG_OK, NULL), /* dupsBypassPower3.0 = Wrong Type (should be INTEGER): NULL */ - { "unmapped.dupsBypassPower3", 0, 1, ".1.3.6.1.4.1.2254.2.4.6.11.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.dupsBypassPower3", 0, 1, ".1.3.6.1.4.1.2254.2.4.6.11.0", NULL, SU_FLAG_OK, NULL), /* dupsBypass.12.0 = NULL */ - { "unmapped.dupsBypass", 0, 1, ".1.3.6.1.4.1.2254.2.4.6.12.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.dupsBypass", 0, 1, ".1.3.6.1.4.1.2254.2.4.6.12.0", NULL, SU_FLAG_OK, NULL), /* dupsBypass.13.0 = NULL */ - { "unmapped.dupsBypass", 0, 1, ".1.3.6.1.4.1.2254.2.4.6.13.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.dupsBypass", 0, 1, ".1.3.6.1.4.1.2254.2.4.6.13.0", NULL, SU_FLAG_OK, NULL), /* dupsBypass.14.0 = NULL */ - { "unmapped.dupsBypass", 0, 1, ".1.3.6.1.4.1.2254.2.4.6.14.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.dupsBypass", 0, 1, ".1.3.6.1.4.1.2254.2.4.6.14.0", NULL, SU_FLAG_OK, NULL), /* dupsBatteryCondiction.0 = INTEGER: good(0) */ - { "unmapped.dupsBatteryCondiction", 0, 1, ".1.3.6.1.4.1.2254.2.4.7.1.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.dupsBatteryCondiction", 0, 1, ".1.3.6.1.4.1.2254.2.4.7.1.0", NULL, SU_FLAG_OK, NULL), /* dupsBatteryStatus.0 = INTEGER: ok(0) */ - { "unmapped.dupsBatteryStatus", 0, 1, ".1.3.6.1.4.1.2254.2.4.7.2.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.dupsBatteryStatus", 0, 1, ".1.3.6.1.4.1.2254.2.4.7.2.0", NULL, SU_FLAG_OK, NULL), /* dupsBatteryCharge.0 = INTEGER: charging(1) */ - { "unmapped.dupsBatteryCharge", 0, 1, ".1.3.6.1.4.1.2254.2.4.7.3.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.dupsBatteryCharge", 0, 1, ".1.3.6.1.4.1.2254.2.4.7.3.0", NULL, SU_FLAG_OK, NULL), /* dupsSecondsOnBattery.0 = INTEGER: 0 seconds */ - { "unmapped.dupsSecondsOnBattery", 0, 1, ".1.3.6.1.4.1.2254.2.4.7.4.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.dupsSecondsOnBattery", 0, 1, ".1.3.6.1.4.1.2254.2.4.7.4.0", NULL, SU_FLAG_OK, NULL), /* dupsBatteryEstimatedTime.0 = Wrong Type (should be INTEGER): NULL */ - { "unmapped.dupsBatteryEstimatedTime", 0, 1, ".1.3.6.1.4.1.2254.2.4.7.5.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.dupsBatteryEstimatedTime", 0, 1, ".1.3.6.1.4.1.2254.2.4.7.5.0", NULL, SU_FLAG_OK, NULL), /* dupsBatteryVoltage.0 = INTEGER: 550 0.1 Volt DC */ - { "unmapped.dupsBatteryVoltage", 0, 1, ".1.3.6.1.4.1.2254.2.4.7.6.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.dupsBatteryVoltage", 0, 1, ".1.3.6.1.4.1.2254.2.4.7.6.0", NULL, SU_FLAG_OK, NULL), /* dupsBatteryCurrent.0 = Wrong Type (should be INTEGER): NULL */ - { "unmapped.dupsBatteryCurrent", 0, 1, ".1.3.6.1.4.1.2254.2.4.7.7.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.dupsBatteryCurrent", 0, 1, ".1.3.6.1.4.1.2254.2.4.7.7.0", NULL, SU_FLAG_OK, NULL), /* dupsBatteryCapacity.0 = INTEGER: 100 percent */ - { "unmapped.dupsBatteryCapacity", 0, 1, ".1.3.6.1.4.1.2254.2.4.7.8.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.dupsBatteryCapacity", 0, 1, ".1.3.6.1.4.1.2254.2.4.7.8.0", NULL, SU_FLAG_OK, NULL), /* dupsTemperature.0 = INTEGER: 32 degrees Centigrade */ - { "unmapped.dupsTemperature", 0, 1, ".1.3.6.1.4.1.2254.2.4.7.9.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.dupsTemperature", 0, 1, ".1.3.6.1.4.1.2254.2.4.7.9.0", NULL, SU_FLAG_OK, NULL), /* dupsLastReplaceDate.0 = Wrong Type (should be OCTET STRING): NULL */ - { "unmapped.dupsLastReplaceDate", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.2254.2.4.7.10.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.dupsLastReplaceDate", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.2254.2.4.7.10.0", NULL, SU_FLAG_OK, NULL), /* dupsNextReplaceDate.0 = Wrong Type (should be OCTET STRING): NULL */ - { "unmapped.dupsNextReplaceDate", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.2254.2.4.7.11.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.dupsNextReplaceDate", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.2254.2.4.7.11.0", NULL, SU_FLAG_OK, NULL), /* dupsTestType.0 = INTEGER: abort(0) */ - { "unmapped.dupsTestType", 0, 1, ".1.3.6.1.4.1.2254.2.4.8.1.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.dupsTestType", 0, 1, ".1.3.6.1.4.1.2254.2.4.8.1.0", NULL, SU_FLAG_OK, NULL), /* dupsTestResultsSummary.0 = INTEGER: noTestsInitiated(0) */ - { "unmapped.dupsTestResultsSummary", 0, 1, ".1.3.6.1.4.1.2254.2.4.8.2.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.dupsTestResultsSummary", 0, 1, ".1.3.6.1.4.1.2254.2.4.8.2.0", NULL, SU_FLAG_OK, NULL), /* dupsTestResultsDetail.0 = Wrong Type (should be OCTET STRING): NULL */ - { "unmapped.dupsTestResultsDetail", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.2254.2.4.8.3.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.dupsTestResultsDetail", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.2254.2.4.8.3.0", NULL, SU_FLAG_OK, NULL), /* dupsAlarmDisconnect.0 = INTEGER: off(0) */ - { "unmapped.dupsAlarmDisconnect", 0, 1, ".1.3.6.1.4.1.2254.2.4.9.1.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.dupsAlarmDisconnect", 0, 1, ".1.3.6.1.4.1.2254.2.4.9.1.0", NULL, SU_FLAG_OK, NULL), /* dupsAlarmPowerFail.0 = INTEGER: off(0) */ - { "unmapped.dupsAlarmPowerFail", 0, 1, ".1.3.6.1.4.1.2254.2.4.9.2.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.dupsAlarmPowerFail", 0, 1, ".1.3.6.1.4.1.2254.2.4.9.2.0", NULL, SU_FLAG_OK, NULL), /* dupsAlarmBatteryLow.0 = INTEGER: off(0) */ - { "unmapped.dupsAlarmBatteryLow", 0, 1, ".1.3.6.1.4.1.2254.2.4.9.3.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.dupsAlarmBatteryLow", 0, 1, ".1.3.6.1.4.1.2254.2.4.9.3.0", NULL, SU_FLAG_OK, NULL), /* dupsAlarmLoadWarning.0 = Wrong Type (should be INTEGER): NULL */ - { "unmapped.dupsAlarmLoadWarning", 0, 1, ".1.3.6.1.4.1.2254.2.4.9.4.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.dupsAlarmLoadWarning", 0, 1, ".1.3.6.1.4.1.2254.2.4.9.4.0", NULL, SU_FLAG_OK, NULL), /* dupsAlarmLoadSeverity.0 = Wrong Type (should be INTEGER): NULL */ - { "unmapped.dupsAlarmLoadSeverity", 0, 1, ".1.3.6.1.4.1.2254.2.4.9.5.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.dupsAlarmLoadSeverity", 0, 1, ".1.3.6.1.4.1.2254.2.4.9.5.0", NULL, SU_FLAG_OK, NULL), /* dupsAlarmLoadOnBypass.0 = INTEGER: off(0) */ - { "unmapped.dupsAlarmLoadOnBypass", 0, 1, ".1.3.6.1.4.1.2254.2.4.9.6.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.dupsAlarmLoadOnBypass", 0, 1, ".1.3.6.1.4.1.2254.2.4.9.6.0", NULL, SU_FLAG_OK, NULL), /* dupsAlarmUPSFault.0 = INTEGER: off(0) */ - { "unmapped.dupsAlarmUPSFault", 0, 1, ".1.3.6.1.4.1.2254.2.4.9.7.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.dupsAlarmUPSFault", 0, 1, ".1.3.6.1.4.1.2254.2.4.9.7.0", NULL, SU_FLAG_OK, NULL), /* dupsAlarmBatteryGroundFault.0 = Wrong Type (should be INTEGER): NULL */ - { "unmapped.dupsAlarmBatteryGroundFault", 0, 1, ".1.3.6.1.4.1.2254.2.4.9.8.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.dupsAlarmBatteryGroundFault", 0, 1, ".1.3.6.1.4.1.2254.2.4.9.8.0", NULL, SU_FLAG_OK, NULL), /* dupsAlarmTestInProgress.0 = INTEGER: off(0) */ - { "unmapped.dupsAlarmTestInProgress", 0, 1, ".1.3.6.1.4.1.2254.2.4.9.9.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.dupsAlarmTestInProgress", 0, 1, ".1.3.6.1.4.1.2254.2.4.9.9.0", NULL, SU_FLAG_OK, NULL), /* dupsAlarmBatteryTestFail.0 = INTEGER: off(0) */ - { "unmapped.dupsAlarmBatteryTestFail", 0, 1, ".1.3.6.1.4.1.2254.2.4.9.10.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.dupsAlarmBatteryTestFail", 0, 1, ".1.3.6.1.4.1.2254.2.4.9.10.0", NULL, SU_FLAG_OK, NULL), /* dupsAlarmFuseFailure.0 = INTEGER: off(0) */ - { "unmapped.dupsAlarmFuseFailure", 0, 1, ".1.3.6.1.4.1.2254.2.4.9.11.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.dupsAlarmFuseFailure", 0, 1, ".1.3.6.1.4.1.2254.2.4.9.11.0", NULL, SU_FLAG_OK, NULL), /* dupsAlarmOutputOverload.0 = INTEGER: off(0) */ - { "unmapped.dupsAlarmOutputOverload", 0, 1, ".1.3.6.1.4.1.2254.2.4.9.12.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.dupsAlarmOutputOverload", 0, 1, ".1.3.6.1.4.1.2254.2.4.9.12.0", NULL, SU_FLAG_OK, NULL), /* dupsAlarmOutputOverCurrent.0 = Wrong Type (should be INTEGER): NULL */ - { "unmapped.dupsAlarmOutputOverCurrent", 0, 1, ".1.3.6.1.4.1.2254.2.4.9.13.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.dupsAlarmOutputOverCurrent", 0, 1, ".1.3.6.1.4.1.2254.2.4.9.13.0", NULL, SU_FLAG_OK, NULL), /* dupsAlarmInverterAbnormal.0 = INTEGER: off(0) */ - { "unmapped.dupsAlarmInverterAbnormal", 0, 1, ".1.3.6.1.4.1.2254.2.4.9.14.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.dupsAlarmInverterAbnormal", 0, 1, ".1.3.6.1.4.1.2254.2.4.9.14.0", NULL, SU_FLAG_OK, NULL), /* dupsAlarmRectifierAbnormal.0 = Wrong Type (should be INTEGER): NULL */ - { "unmapped.dupsAlarmRectifierAbnormal", 0, 1, ".1.3.6.1.4.1.2254.2.4.9.15.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.dupsAlarmRectifierAbnormal", 0, 1, ".1.3.6.1.4.1.2254.2.4.9.15.0", NULL, SU_FLAG_OK, NULL), /* dupsAlarmReserveAbnormal.0 = Wrong Type (should be INTEGER): NULL */ - { "unmapped.dupsAlarmReserveAbnormal", 0, 1, ".1.3.6.1.4.1.2254.2.4.9.16.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.dupsAlarmReserveAbnormal", 0, 1, ".1.3.6.1.4.1.2254.2.4.9.16.0", NULL, SU_FLAG_OK, NULL), /* dupsAlarmLoadOnReserve.0 = Wrong Type (should be INTEGER): NULL */ - { "unmapped.dupsAlarmLoadOnReserve", 0, 1, ".1.3.6.1.4.1.2254.2.4.9.17.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.dupsAlarmLoadOnReserve", 0, 1, ".1.3.6.1.4.1.2254.2.4.9.17.0", NULL, SU_FLAG_OK, NULL), /* dupsAlarmOverTemperature.0 = INTEGER: off(0) */ - { "unmapped.dupsAlarmOverTemperature", 0, 1, ".1.3.6.1.4.1.2254.2.4.9.18.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.dupsAlarmOverTemperature", 0, 1, ".1.3.6.1.4.1.2254.2.4.9.18.0", NULL, SU_FLAG_OK, NULL), /* dupsAlarmOutputBad.0 = INTEGER: off(0) */ - { "unmapped.dupsAlarmOutputBad", 0, 1, ".1.3.6.1.4.1.2254.2.4.9.19.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.dupsAlarmOutputBad", 0, 1, ".1.3.6.1.4.1.2254.2.4.9.19.0", NULL, SU_FLAG_OK, NULL), /* dupsAlarmBypassBad.0 = INTEGER: off(0) */ - { "unmapped.dupsAlarmBypassBad", 0, 1, ".1.3.6.1.4.1.2254.2.4.9.20.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.dupsAlarmBypassBad", 0, 1, ".1.3.6.1.4.1.2254.2.4.9.20.0", NULL, SU_FLAG_OK, NULL), /* dupsAlarmUPSOff.0 = INTEGER: off(0) */ - { "unmapped.dupsAlarmUPSOff", 0, 1, ".1.3.6.1.4.1.2254.2.4.9.21.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.dupsAlarmUPSOff", 0, 1, ".1.3.6.1.4.1.2254.2.4.9.21.0", NULL, SU_FLAG_OK, NULL), /* dupsAlarmChargerFail.0 = INTEGER: off(0) */ - { "unmapped.dupsAlarmChargerFail", 0, 1, ".1.3.6.1.4.1.2254.2.4.9.22.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.dupsAlarmChargerFail", 0, 1, ".1.3.6.1.4.1.2254.2.4.9.22.0", NULL, SU_FLAG_OK, NULL), /* dupsAlarmFanFail.0 = INTEGER: off(0) */ - { "unmapped.dupsAlarmFanFail", 0, 1, ".1.3.6.1.4.1.2254.2.4.9.23.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.dupsAlarmFanFail", 0, 1, ".1.3.6.1.4.1.2254.2.4.9.23.0", NULL, SU_FLAG_OK, NULL), /* dupsAlarmEconomicMode.0 = INTEGER: off(0) */ - { "unmapped.dupsAlarmEconomicMode", 0, 1, ".1.3.6.1.4.1.2254.2.4.9.24.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.dupsAlarmEconomicMode", 0, 1, ".1.3.6.1.4.1.2254.2.4.9.24.0", NULL, SU_FLAG_OK, NULL), /* dupsAlarmOutputOff.0 = INTEGER: off(0) */ - { "unmapped.dupsAlarmOutputOff", 0, 1, ".1.3.6.1.4.1.2254.2.4.9.25.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.dupsAlarmOutputOff", 0, 1, ".1.3.6.1.4.1.2254.2.4.9.25.0", NULL, SU_FLAG_OK, NULL), /* dupsAlarmSmartShutdown.0 = INTEGER: off(0) */ - { "unmapped.dupsAlarmSmartShutdown", 0, 1, ".1.3.6.1.4.1.2254.2.4.9.26.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.dupsAlarmSmartShutdown", 0, 1, ".1.3.6.1.4.1.2254.2.4.9.26.0", NULL, SU_FLAG_OK, NULL), /* dupsAlarmEmergencyPowerOff.0 = INTEGER: off(0) */ - { "unmapped.dupsAlarmEmergencyPowerOff", 0, 1, ".1.3.6.1.4.1.2254.2.4.9.27.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.dupsAlarmEmergencyPowerOff", 0, 1, ".1.3.6.1.4.1.2254.2.4.9.27.0", NULL, SU_FLAG_OK, NULL), /* dupsAlarmUPSShutdown.0 = INTEGER: off(0) */ - { "unmapped.dupsAlarmUPSShutdown", 0, 1, ".1.3.6.1.4.1.2254.2.4.9.28.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.dupsAlarmUPSShutdown", 0, 1, ".1.3.6.1.4.1.2254.2.4.9.28.0", NULL, SU_FLAG_OK, NULL), /* dupsEnvTemperature.0 = Wrong Type (should be INTEGER): NULL */ - { "unmapped.dupsEnvTemperature", 0, 1, ".1.3.6.1.4.1.2254.2.4.10.1.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.dupsEnvTemperature", 0, 1, ".1.3.6.1.4.1.2254.2.4.10.1.0", NULL, SU_FLAG_OK, NULL), /* dupsEnvHumidity.0 = Wrong Type (should be INTEGER): NULL */ - { "unmapped.dupsEnvHumidity", 0, 1, ".1.3.6.1.4.1.2254.2.4.10.2.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.dupsEnvHumidity", 0, 1, ".1.3.6.1.4.1.2254.2.4.10.2.0", NULL, SU_FLAG_OK, NULL), /* dupsEnvSetTemperatureLimit.0 = INTEGER: 40 degrees Centigrade */ - { "unmapped.dupsEnvSetTemperatureLimit", 0, 1, ".1.3.6.1.4.1.2254.2.4.10.3.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.dupsEnvSetTemperatureLimit", 0, 1, ".1.3.6.1.4.1.2254.2.4.10.3.0", NULL, SU_FLAG_OK, NULL), /* dupsEnvSetHumidityLimit.0 = INTEGER: 90 percentage */ - { "unmapped.dupsEnvSetHumidityLimit", 0, 1, ".1.3.6.1.4.1.2254.2.4.10.4.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.dupsEnvSetHumidityLimit", 0, 1, ".1.3.6.1.4.1.2254.2.4.10.4.0", NULL, SU_FLAG_OK, NULL), /* dupsEnvSetEnvRelay1.0 = INTEGER: normalOpen(0) */ - { "unmapped.dupsEnvSetEnvRelay1", 0, 1, ".1.3.6.1.4.1.2254.2.4.10.5.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.dupsEnvSetEnvRelay1", 0, 1, ".1.3.6.1.4.1.2254.2.4.10.5.0", NULL, SU_FLAG_OK, NULL), /* dupsEnvSetEnvRelay2.0 = INTEGER: normalOpen(0) */ - { "unmapped.dupsEnvSetEnvRelay2", 0, 1, ".1.3.6.1.4.1.2254.2.4.10.6.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.dupsEnvSetEnvRelay2", 0, 1, ".1.3.6.1.4.1.2254.2.4.10.6.0", NULL, SU_FLAG_OK, NULL), /* dupsEnvSetEnvRelay3.0 = INTEGER: normalOpen(0) */ - { "unmapped.dupsEnvSetEnvRelay3", 0, 1, ".1.3.6.1.4.1.2254.2.4.10.7.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.dupsEnvSetEnvRelay3", 0, 1, ".1.3.6.1.4.1.2254.2.4.10.7.0", NULL, SU_FLAG_OK, NULL), /* dupsEnvSetEnvRelay4.0 = INTEGER: normalOpen(0) */ - { "unmapped.dupsEnvSetEnvRelay4", 0, 1, ".1.3.6.1.4.1.2254.2.4.10.8.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.dupsEnvSetEnvRelay4", 0, 1, ".1.3.6.1.4.1.2254.2.4.10.8.0", NULL, SU_FLAG_OK, NULL), /* dupsAlarmOverEnvTemperature.0 = INTEGER: off(0) */ - { "unmapped.dupsAlarmOverEnvTemperature", 0, 1, ".1.3.6.1.4.1.2254.2.4.10.9.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.dupsAlarmOverEnvTemperature", 0, 1, ".1.3.6.1.4.1.2254.2.4.10.9.0", NULL, SU_FLAG_OK, NULL), /* dupsAlarmOverEnvHumidity.0 = INTEGER: off(0) */ - { "unmapped.dupsAlarmOverEnvHumidity", 0, 1, ".1.3.6.1.4.1.2254.2.4.10.10.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.dupsAlarmOverEnvHumidity", 0, 1, ".1.3.6.1.4.1.2254.2.4.10.10.0", NULL, SU_FLAG_OK, NULL), /* dupsAlarmEnvRelay1.0 = INTEGER: off(0) */ - { "unmapped.dupsAlarmEnvRelay1", 0, 1, ".1.3.6.1.4.1.2254.2.4.10.11.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.dupsAlarmEnvRelay1", 0, 1, ".1.3.6.1.4.1.2254.2.4.10.11.0", NULL, SU_FLAG_OK, NULL), /* dupsAlarmEnvRelay2.0 = INTEGER: off(0) */ - { "unmapped.dupsAlarmEnvRelay2", 0, 1, ".1.3.6.1.4.1.2254.2.4.10.12.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.dupsAlarmEnvRelay2", 0, 1, ".1.3.6.1.4.1.2254.2.4.10.12.0", NULL, SU_FLAG_OK, NULL), /* dupsAlarmEnvRelay3.0 = INTEGER: off(0) */ - { "unmapped.dupsAlarmEnvRelay3", 0, 1, ".1.3.6.1.4.1.2254.2.4.10.13.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.dupsAlarmEnvRelay3", 0, 1, ".1.3.6.1.4.1.2254.2.4.10.13.0", NULL, SU_FLAG_OK, NULL), /* dupsAlarmEnvRelay4.0 = INTEGER: off(0) */ - { "unmapped.dupsAlarmEnvRelay4", 0, 1, ".1.3.6.1.4.1.2254.2.4.10.14.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.dupsAlarmEnvRelay4", 0, 1, ".1.3.6.1.4.1.2254.2.4.10.14.0", NULL, SU_FLAG_OK, NULL), #endif /* #if WITH_UNMAPPED_DATA_POINTS */ /* end of structure. */ - { NULL, 0, 0, NULL, NULL, 0, NULL } + snmp_info_sentinel }; mib2nut_info_t delta_ups = { "delta_ups", DELTA_UPS_MIB_VERSION, NULL, NULL, delta_ups_mib, DELTA_UPS_SYSOID, NULL }; diff --git a/drivers/dstate.c b/drivers/dstate.c index 6f50a935db..43b48719d5 100644 --- a/drivers/dstate.c +++ b/drivers/dstate.c @@ -165,17 +165,17 @@ static TYPE_FD sock_open(const char *fn) #else /* WIN32 */ fd = CreateNamedPipe( - fn, // pipe name - PIPE_ACCESS_DUPLEX | // read/write access - FILE_FLAG_OVERLAPPED, // async IO + fn, /* pipe name */ + PIPE_ACCESS_DUPLEX | /* read/write access */ + FILE_FLAG_OVERLAPPED, /* async IO */ PIPE_TYPE_BYTE | PIPE_READMODE_BYTE | PIPE_WAIT, - PIPE_UNLIMITED_INSTANCES, // max. instances - ST_SOCK_BUF_LEN, // output buffer size - ST_SOCK_BUF_LEN, // input buffer size - 0, // client time-out - NULL); // FIXME: default security attribute + PIPE_UNLIMITED_INSTANCES, /* max. instances */ + ST_SOCK_BUF_LEN, /* output buffer size */ + ST_SOCK_BUF_LEN, /* input buffer size */ + 0, /* client time-out */ + NULL); /* FIXME: default security attribute */ if (INVALID_FD(fd)) { fatal_with_errno(EXIT_FAILURE, @@ -520,17 +520,17 @@ static void sock_connect(TYPE_FD sock) /* sockfd is the handle of the connection pending pipe */ sockfd = CreateNamedPipe( - pipename, // pipe name - PIPE_ACCESS_DUPLEX | // read/write access - FILE_FLAG_OVERLAPPED, // async IO + pipename, /* pipe name */ + PIPE_ACCESS_DUPLEX | /* read/write access */ + FILE_FLAG_OVERLAPPED, /* async IO */ PIPE_TYPE_BYTE | PIPE_READMODE_BYTE | PIPE_WAIT, - PIPE_UNLIMITED_INSTANCES, // max. instances - ST_SOCK_BUF_LEN, // output buffer size - ST_SOCK_BUF_LEN, // input buffer size - 0, // client time-out - NULL); // FIXME: default security attribute + PIPE_UNLIMITED_INSTANCES, /* max. instances */ + ST_SOCK_BUF_LEN, /* output buffer size */ + ST_SOCK_BUF_LEN, /* input buffer size */ + 0, /* client time-out */ + NULL); /* FIXME: default security attribute */ if (INVALID_FD(sockfd)) { fatal_with_errno(EXIT_FAILURE, @@ -780,7 +780,7 @@ static int sock_arg(conn_t *conn, size_t numarg, char **arg) upsdebugx(3, "%s: TRACKING = %s", __func__, cmdid); /* try the handler shared by all drivers first */ - ret = main_instcmd(arg[1], arg[2], conn); + ret = main_instcmd(cmdname, cmdparam, conn); if (ret != STAT_INSTCMD_UNKNOWN) { /* The command was acknowledged by shared handler, and * either handled successfully, or failed, or was not diff --git a/drivers/dummy-ups.c b/drivers/dummy-ups.c index e14149a4a7..7c3a435f38 100644 --- a/drivers/dummy-ups.c +++ b/drivers/dummy-ups.c @@ -48,7 +48,7 @@ #include "dummy-ups.h" #define DRIVER_NAME "Device simulation and repeater driver" -#define DRIVER_VERSION "0.17" +#define DRIVER_VERSION "0.18" /* driver description structure */ upsdrv_info_t upsdrv_info = @@ -111,6 +111,9 @@ static char *client_upsname = NULL, *hostname = NULL; static UPSCONN_t *ups = NULL; static uint16_t port; +/* repeater mode parameters */ +static int repeater_disable_strict_start = 0; + /* Driver functions */ void upsdrv_initinfo(void) @@ -156,7 +159,17 @@ void upsdrv_initinfo(void) ups = xmalloc(sizeof(*ups)); if (upscli_connect(ups, hostname, port, UPSCLI_CONN_TRYSSL) < 0) { - fatalx(EXIT_FAILURE, "Error: %s", upscli_strerror(ups)); + if(repeater_disable_strict_start == 1) + { + upslogx(LOG_WARNING, "Warning: %s", upscli_strerror(ups)); + } + else + { + fatalx(EXIT_FAILURE, "Error: %s. " + "Any errors encountered starting the repeater mode result in driver termination, " + "perhaps you want to set the 'repeater_disable_strict_start' option?" + , upscli_strerror(ups)); + } } else { @@ -169,7 +182,18 @@ void upsdrv_initinfo(void) { fatalx(EXIT_FAILURE, "Error: upsd is too old to support this query"); } - fatalx(EXIT_FAILURE, "Error: %s", upscli_strerror(ups)); + + if(repeater_disable_strict_start == 1) + { + upslogx(LOG_WARNING, "Warning: %s", upscli_strerror(ups)); + } + else + { + fatalx(EXIT_FAILURE, "Error: %s. " + "Any errors encountered starting the repeater mode result in driver termination, " + "perhaps you want to set the 'repeater_disable_strict_start' option?" + , upscli_strerror(ups)); + } } /* FIXME: commands and settable variable! */ break; @@ -387,6 +411,7 @@ void upsdrv_help(void) void upsdrv_makevartable(void) { addvar(VAR_VALUE, "mode", "Specify mode instead of guessing it from port value (dummy = dummy-loop, dummy-once, repeater)"); /* meta */ + addvar(VAR_FLAG, "repeater_disable_strict_start", "Do not terminate the driver encountering errors when starting the repeater mode"); } void upsdrv_initups(void) @@ -521,6 +546,10 @@ void upsdrv_initups(void) upsdebugx(2, "Located %s for device simulation data: %s", device_path, fn); } } + if (testvar("repeater_disable_strict_start")) + { + repeater_disable_strict_start = 1; + } } void upsdrv_cleanup(void) diff --git a/drivers/eaton-ats16-nm2-mib.c b/drivers/eaton-ats16-nm2-mib.c index ce4145b082..868ce3bfe4 100644 --- a/drivers/eaton-ats16-nm2-mib.c +++ b/drivers/eaton-ats16-nm2-mib.c @@ -4,6 +4,7 @@ * Copyright (C) * 2011-2012 Arnaud Quette * 2016-2020 Eaton (author: Arnaud Quette ) + * 2024 Jim Klimov * * Note: this subdriver was initially generated as a "stub" by the * gen-snmp-subdriver script. It must be customized! @@ -24,247 +25,427 @@ */ #include "eaton-ats16-nm2-mib.h" +#if WITH_SNMP_LKP_FUN +/* FIXME: shared helper code, need to be put in common */ +#include "eaton-pdu-marlin-helpers.h" +#endif -#define EATON_ATS16_NM2_MIB_VERSION "0.22" +#define EATON_ATS16_NM2_MIB_VERSION "0.23" #define EATON_ATS16_NM2_SYSOID ".1.3.6.1.4.1.534.10.2" /* newer Network-M2 */ #define EATON_ATS16_NM2_MODEL ".1.3.6.1.4.1.534.10.2.1.2.0" static info_lkp_t eaton_ats16_nm2_source_info[] = { - { 1, "init", NULL, NULL }, - { 2, "diagnosis", NULL, NULL }, - { 3, "off", NULL, NULL }, - { 4, "1", NULL, NULL }, - { 5, "2", NULL, NULL }, - { 6, "safe", NULL, NULL }, - { 7, "fault", NULL, NULL }, - { 0, NULL, NULL, NULL } + info_lkp_default(1, "init"), + info_lkp_default(2, "diagnosis"), + info_lkp_default(3, "off"), + info_lkp_default(4, "1"), + info_lkp_default(5, "2"), + info_lkp_default(6, "safe"), + info_lkp_default(7, "fault"), + info_lkp_sentinel }; static info_lkp_t eaton_ats16_nm2_sensitivity_info[] = { - { 1, "normal", NULL, NULL }, - { 2, "high", NULL, NULL }, - { 3, "low", NULL, NULL }, - { 0, NULL, NULL, NULL } + info_lkp_default(1, "normal"), + info_lkp_default(2, "high"), + info_lkp_default(3, "low"), + info_lkp_sentinel }; static info_lkp_t eaton_ats16_nm2_input_frequency_status_info[] = { - { 1, "good", NULL, NULL }, /* No threshold triggered */ - { 2, "out-of-range", NULL, NULL }, /* Frequency out of range triggered */ - { 0, NULL, NULL, NULL } + info_lkp_default(1, "good"), /* No threshold triggered */ + info_lkp_default(2, "out-of-range"), /* Frequency out of range triggered */ + info_lkp_sentinel }; static info_lkp_t eaton_ats16_nm2_input_voltage_status_info[] = { - { 1, "good", NULL, NULL }, /* No threshold triggered */ - { 2, "derated-range", NULL, NULL }, /* Voltage derated */ - { 3, "out-of-range", NULL, NULL }, /* Voltage out of range triggered */ - { 4, "unknown", NULL, NULL }, /* "missing" */ - { 0, NULL, NULL, NULL } + info_lkp_default(1, "good"), /* No threshold triggered */ + info_lkp_default(2, "derated-range"), /* Voltage derated */ + info_lkp_default(3, "out-of-range"), /* Voltage out of range triggered */ + info_lkp_default(4, "unknown"), /* "missing" */ + info_lkp_sentinel }; static info_lkp_t eaton_ats16_nm2_test_result_info[] = { - { 1, "done and passed", NULL, NULL }, - { 2, "done and warning", NULL, NULL }, - { 3, "done and error", NULL, NULL }, - { 4, "aborted", NULL, NULL }, - { 5, "in progress", NULL, NULL }, - { 6, "no test initiated", NULL, NULL }, - { 0, NULL, NULL, NULL } + info_lkp_default(1, "done and passed"), + info_lkp_default(2, "done and warning"), + info_lkp_default(3, "done and error"), + info_lkp_default(4, "aborted"), + info_lkp_default(5, "in progress"), + info_lkp_default(6, "no test initiated"), + info_lkp_sentinel }; static info_lkp_t eaton_ats16_nm2_output_status_info[] = { - { 1, "OFF", NULL, NULL }, /* Output not powered */ - { 2, "OL", NULL, NULL }, /* Output powered */ - { 0, NULL, NULL, NULL } + info_lkp_default(1, "OFF"), /* Output not powered */ + info_lkp_default(2, "OL"), /* Output powered */ + info_lkp_sentinel }; -static info_lkp_t eaton_ats16_ambient_drycontacts_info[] = { - { -1, "unknown", NULL, NULL }, - { 1, "opened", NULL, NULL }, - { 2, "closed", NULL, NULL }, - { 3, "opened", NULL, NULL }, /* openWithNotice */ - { 4, "closed", NULL, NULL }, /* closedWithNotice */ - { 0, NULL, NULL, NULL } +/* Note: all the below *emp002* info should be shared with marlin and powerware! */ + +#if WITH_SNMP_LKP_FUN +/* Note: eaton_sensor_temperature_unit_fun() is defined in eaton-pdu-marlin-helpers.c + * and su_temperature_read_fun() is in snmp-ups.c + * Future work for DMF might provide same-named routines via LUA-C gateway. + */ + +# if WITH_SNMP_LKP_FUN_DUMMY +/* Temperature unit consideration */ +const char *eaton_sensor_temperature_unit_fun(void *raw_snmp_value) { + /* snmp_value here would be a (long*) */ + NUT_UNUSED_VARIABLE(raw_snmp_value); + return "unknown"; +} +/* FIXME: please DMF, though this should be in snmp-ups.c or equiv. */ +const char *su_temperature_read_fun(void *raw_snmp_value) { + /* snmp_value here would be a (long*) */ + NUT_UNUSED_VARIABLE(raw_snmp_value); + return "dummy"; +}; +# endif /* WITH_SNMP_LKP_FUN_DUMMY */ + +static info_lkp_t eaton_ats16_nm2_sensor_temperature_unit_info[] = { + info_lkp_fun_vp2s(0, "dummy", eaton_sensor_temperature_unit_fun), + info_lkp_sentinel +}; + +static info_lkp_t eaton_ats16_nm2_sensor_temperature_read_info[] = { + info_lkp_fun_vp2s(0, "dummy", su_temperature_read_fun), + info_lkp_sentinel +}; + +#else /* if not WITH_SNMP_LKP_FUN: */ + +/* FIXME: For now, DMF codebase falls back to old implementation with static + * lookup/mapping tables for this, which can easily go into the DMF XML file. + */ +static info_lkp_t eaton_ats16_nm2_sensor_temperature_unit_info[] = { + info_lkp_default(0, "kelvin"), + info_lkp_default(1, "celsius"), + info_lkp_default(2, "fahrenheit"), + info_lkp_sentinel +}; + +#endif /* WITH_SNMP_LKP_FUN */ + +static info_lkp_t eaton_ats16_nm2_ambient_drycontacts_polarity_info[] = { + info_lkp_default(0, "normal-opened"), + info_lkp_default(1, "normal-closed"), + info_lkp_sentinel +}; + +static info_lkp_t eaton_ats16_nm2_ambient_drycontacts_state_info[] = { + info_lkp_default(0, "inactive"), + info_lkp_default(1, "active"), + info_lkp_sentinel +}; + +static info_lkp_t eaton_ats16_nm2_emp002_ambient_presence_info[] = { + info_lkp_default(0, "unknown"), + info_lkp_default(2, "yes"), /* communicationOK */ + info_lkp_default(3, "no"), /* communicationLost */ + info_lkp_sentinel +}; + +/* extracted from drivers/eaton-pdu-marlin-mib.c -> marlin_threshold_status_info */ +static info_lkp_t eaton_ats16_nm2_threshold_status_info[] = { + info_lkp_default(0, "good"), /* No threshold triggered */ + info_lkp_default(1, "warning-low"), /* Warning low threshold triggered */ + info_lkp_default(2, "critical-low"), /* Critical low threshold triggered */ + info_lkp_default(3, "warning-high"), /* Warning high threshold triggered */ + info_lkp_default(4, "critical-high"), /* Critical high threshold triggered */ + info_lkp_sentinel +}; + +/* extracted from drivers/eaton-pdu-marlin-mib.c -> marlin_threshold_xxx_alarms_info */ +static info_lkp_t eaton_ats16_nm2_threshold_temperature_alarms_info[] = { + info_lkp_default(0, ""), /* No threshold triggered */ + info_lkp_default(1, "low temperature warning!"), /* Warning low threshold triggered */ + info_lkp_default(2, "low temperature critical!"), /* Critical low threshold triggered */ + info_lkp_default(3, "high temperature warning!"), /* Warning high threshold triggered */ + info_lkp_default(4, "high temperature critical!"), /* Critical high threshold triggered */ + info_lkp_sentinel +}; + +static info_lkp_t eaton_ats16_nm2_threshold_humidity_alarms_info[] = { + info_lkp_default(0, ""), /* No threshold triggered */ + info_lkp_default(1, "low humidity warning!"), /* Warning low threshold triggered */ + info_lkp_default(2, "low humidity critical!"), /* Critical low threshold triggered */ + info_lkp_default(3, "high humidity warning!"), /* Warning high threshold triggered */ + info_lkp_default(4, "high humidity critical!"), /* Critical high threshold triggered */ + info_lkp_sentinel +}; + +static info_lkp_t eaton_ats16_nm2_ambient_drycontacts_info[] = { + info_lkp_default(-1, "unknown"), + info_lkp_default(1, "opened"), + info_lkp_default(2, "closed"), + info_lkp_default(3, "opened"), /* openWithNotice */ + info_lkp_default(4, "closed"), /* closedWithNotice */ + info_lkp_sentinel }; /* EATON_ATS Snmp2NUT lookup table */ static snmp_info_t eaton_ats16_nm2_mib[] = { /* standard MIB items */ - { "device.description", ST_FLAG_STRING | ST_FLAG_RW, SU_INFOSIZE, ".1.3.6.1.2.1.1.1.0", NULL, SU_FLAG_OK, NULL }, - { "device.contact", ST_FLAG_STRING | ST_FLAG_RW, SU_INFOSIZE, ".1.3.6.1.2.1.1.4.0", NULL, SU_FLAG_OK, NULL }, - { "device.location", ST_FLAG_STRING | ST_FLAG_RW, SU_INFOSIZE, ".1.3.6.1.2.1.1.6.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("device.description", ST_FLAG_STRING | ST_FLAG_RW, SU_INFOSIZE, ".1.3.6.1.2.1.1.1.0", NULL, SU_FLAG_OK, NULL), + snmp_info_default("device.contact", ST_FLAG_STRING | ST_FLAG_RW, SU_INFOSIZE, ".1.3.6.1.2.1.1.4.0", NULL, SU_FLAG_OK, NULL), + snmp_info_default("device.location", ST_FLAG_STRING | ST_FLAG_RW, SU_INFOSIZE, ".1.3.6.1.2.1.1.6.0", NULL, SU_FLAG_OK, NULL), /* Device collection */ - { "device.type", ST_FLAG_STRING, SU_INFOSIZE, NULL, "ats", SU_FLAG_STATIC | SU_FLAG_ABSENT | SU_FLAG_OK, NULL }, + snmp_info_default("device.type", ST_FLAG_STRING, SU_INFOSIZE, NULL, "ats", SU_FLAG_STATIC | SU_FLAG_ABSENT | SU_FLAG_OK, NULL), /* ats2IdentManufacturer.0 = STRING: EATON */ - { "device.mfr", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.10.2.1.1.0", "Eaton", SU_FLAG_STATIC | SU_FLAG_OK, NULL }, + snmp_info_default("device.mfr", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.10.2.1.1.0", "Eaton", SU_FLAG_STATIC | SU_FLAG_OK, NULL), /* ats2IdentModel.0 = STRING: Eaton ATS */ - { "device.model", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.10.2.1.2.0", "ATS", SU_FLAG_STATIC | SU_FLAG_OK, NULL }, + snmp_info_default("device.model", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.10.2.1.2.0", "ATS", SU_FLAG_STATIC | SU_FLAG_OK, NULL), /* FIXME: RFC for device.firmware! */ /* FIXME: the 2 "firmware" entries below should be SU_FLAG_SEMI_STATIC */ /* ats2IdentFWVersion.0 = STRING: 00.00.0009 */ - { "ups.firmware", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.10.2.1.3.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("ups.firmware", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.10.2.1.3.0", NULL, SU_FLAG_OK, NULL), /* FIXME: RFC for device.firmware.aux! */ /* ats2IdentRelease.0 = STRING: 1.7.5 */ - { "ups.firmware.aux", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.10.2.1.7.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("ups.firmware.aux", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.10.2.1.7.0", NULL, SU_FLAG_OK, NULL), /* ats2IdentSerialNumber.0 = STRING: GA04F23009 */ - { "device.serial", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.10.2.1.5.0", NULL, SU_FLAG_STATIC | SU_FLAG_OK, NULL }, + snmp_info_default("device.serial", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.10.2.1.5.0", NULL, SU_FLAG_STATIC | SU_FLAG_OK, NULL), /* ats2IdentPartNumber.0 = STRING: EATS16N */ - { "device.part", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.10.2.1.6.0", NULL, SU_FLAG_STATIC | SU_FLAG_OK, NULL }, + snmp_info_default("device.part", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.10.2.1.6.0", NULL, SU_FLAG_STATIC | SU_FLAG_OK, NULL), /* ats2IdentAgentVersion.0 = STRING: 301F23C28 */ - /* { "unmapped.ats2IdentAgentVersion", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.10.2.1.7.0", NULL, SU_FLAG_OK, NULL, NULL }, */ + /* snmp_info_default("unmapped.ats2IdentAgentVersion", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.10.2.1.7.0", NULL, SU_FLAG_OK, NULL, NULL), */ /* ats2InputDephasing.0 = INTEGER: 2 degrees */ - /* { "unmapped.ats2InputDephasing", 0, 1, ".1.3.6.1.4.1.534.10.2.2.1.1.0", NULL, SU_FLAG_OK, NULL, NULL }, */ + /* snmp_info_default("unmapped.ats2InputDephasing", 0, 1, ".1.3.6.1.4.1.534.10.2.2.1.1.0", NULL, SU_FLAG_OK, NULL, NULL), */ /* Input collection */ /* ats2InputIndex.source1 = INTEGER: source1(1) */ - { "input.1.id", 0, 1, ".1.3.6.1.4.1.534.10.2.2.2.1.1.1", NULL, SU_FLAG_STATIC | SU_FLAG_OK, NULL }, + snmp_info_default("input.1.id", 0, 1, ".1.3.6.1.4.1.534.10.2.2.2.1.1.1", NULL, SU_FLAG_STATIC | SU_FLAG_OK, NULL), /* ats2InputIndex.source2 = INTEGER: source2(2) */ - { "input.2.id", 0, 1, ".1.3.6.1.4.1.534.10.2.2.2.1.1.2", NULL, SU_FLAG_STATIC | SU_FLAG_OK, NULL }, + snmp_info_default("input.2.id", 0, 1, ".1.3.6.1.4.1.534.10.2.2.2.1.1.2", NULL, SU_FLAG_STATIC | SU_FLAG_OK, NULL), /* ats2InputVoltage.source1 = INTEGER: 2292 0.1 V */ - { "input.1.voltage", 0, 0.1, ".1.3.6.1.4.1.534.10.2.2.2.1.2.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("input.1.voltage", 0, 0.1, ".1.3.6.1.4.1.534.10.2.2.2.1.2.1", NULL, SU_FLAG_OK, NULL), /* ats2InputVoltage.source2 = INTEGER: 2432 0.1 V */ - { "input.2.voltage", 0, 0.1, ".1.3.6.1.4.1.534.10.2.2.2.1.2.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("input.2.voltage", 0, 0.1, ".1.3.6.1.4.1.534.10.2.2.2.1.2.2", NULL, SU_FLAG_OK, NULL), /* ats2InputStatusVoltage.source1 = INTEGER: normalRange(1) */ - { "input.1.voltage.status", ST_FLAG_STRING, 1, ".1.3.6.1.4.1.534.10.2.3.2.1.5.1", NULL, SU_FLAG_OK, eaton_ats16_nm2_input_voltage_status_info }, + snmp_info_default("input.1.voltage.status", ST_FLAG_STRING, 1, ".1.3.6.1.4.1.534.10.2.3.2.1.5.1", NULL, SU_FLAG_OK, eaton_ats16_nm2_input_voltage_status_info), /* ats2InputStatusVoltage.source2 = INTEGER: normalRange(1) */ - { "input.2.voltage.status", ST_FLAG_STRING, 1, ".1.3.6.1.4.1.534.10.2.3.2.1.5.2", NULL, SU_FLAG_OK, eaton_ats16_nm2_input_voltage_status_info }, + snmp_info_default("input.2.voltage.status", ST_FLAG_STRING, 1, ".1.3.6.1.4.1.534.10.2.3.2.1.5.2", NULL, SU_FLAG_OK, eaton_ats16_nm2_input_voltage_status_info), /* ats2InputFrequency.source1 = INTEGER: 500 0.1 Hz */ - { "input.1.frequency", 0, 0.1, ".1.3.6.1.4.1.534.10.2.2.2.1.3.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("input.1.frequency", 0, 0.1, ".1.3.6.1.4.1.534.10.2.2.2.1.3.1", NULL, SU_FLAG_OK, NULL), /* ats2InputFrequency.source2 = INTEGER: 500 0.1 Hz */ - { "input.2.frequency", 0, 0.1, ".1.3.6.1.4.1.534.10.2.2.2.1.3.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("input.2.frequency", 0, 0.1, ".1.3.6.1.4.1.534.10.2.2.2.1.3.2", NULL, SU_FLAG_OK, NULL), /* ats2InputStatusFrequency.source1 = INTEGER: good(1) */ - { "input.1.frequency.status", ST_FLAG_STRING, 1, ".1.3.6.1.4.1.534.10.2.3.2.1.2.1", NULL, SU_FLAG_OK, eaton_ats16_nm2_input_frequency_status_info }, + snmp_info_default("input.1.frequency.status", ST_FLAG_STRING, 1, ".1.3.6.1.4.1.534.10.2.3.2.1.2.1", NULL, SU_FLAG_OK, eaton_ats16_nm2_input_frequency_status_info), /* ats2InputStatusFrequency.source2 = INTEGER: good(1) */ - { "input.2.frequency.status", ST_FLAG_STRING, 1, ".1.3.6.1.4.1.534.10.2.3.2.1.2.2", NULL, SU_FLAG_OK, eaton_ats16_nm2_input_frequency_status_info }, + snmp_info_default("input.2.frequency.status", ST_FLAG_STRING, 1, ".1.3.6.1.4.1.534.10.2.3.2.1.2.2", NULL, SU_FLAG_OK, eaton_ats16_nm2_input_frequency_status_info), /* ats2ConfigSensitivity.0 = INTEGER: normal(1) */ - { "input.sensitivity", ST_FLAG_RW, SU_INFOSIZE, ".1.3.6.1.4.1.534.10.2.4.6.0", NULL, SU_FLAG_OK, &eaton_ats16_nm2_sensitivity_info[0] }, + snmp_info_default("input.sensitivity", ST_FLAG_RW, SU_INFOSIZE, ".1.3.6.1.4.1.534.10.2.4.6.0", NULL, SU_FLAG_OK, &eaton_ats16_nm2_sensitivity_info[0]), /* ats2OperationMode.0 = INTEGER: source1(4) */ - { "input.source", ST_FLAG_STRING, 1, ".1.3.6.1.4.1.534.10.2.2.4.0", NULL, SU_FLAG_OK, eaton_ats16_nm2_source_info }, + snmp_info_default("input.source", ST_FLAG_STRING, 1, ".1.3.6.1.4.1.534.10.2.2.4.0", NULL, SU_FLAG_OK, eaton_ats16_nm2_source_info), /* ats2ConfigPreferred.0 = INTEGER: source1(1) */ - { "input.source.preferred", ST_FLAG_RW, 1, ".1.3.6.1.4.1.534.10.2.4.5.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("input.source.preferred", ST_FLAG_RW, 1, ".1.3.6.1.4.1.534.10.2.4.5.0", NULL, SU_FLAG_OK, NULL), /* ats2InputDephasing = INTEGER: 181 */ - { "input.phase.shift", 0, 1, ".1.3.6.1.4.1.534.10.2.2.1.1.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("input.phase.shift", 0, 1, ".1.3.6.1.4.1.534.10.2.2.1.1.0", NULL, SU_FLAG_OK, NULL), /* Output collection */ /* ats2OutputVoltage.0 = INTEGER: 2304 0.1 V */ - { "output.voltage", 0, 0.1, ".1.3.6.1.4.1.534.10.2.2.3.1.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("output.voltage", 0, 0.1, ".1.3.6.1.4.1.534.10.2.2.3.1.0", NULL, SU_FLAG_OK, NULL), /* ats2ConfigOutputVoltage.0 = INTEGER: 230 1 V */ - { "output.voltage.nominal", ST_FLAG_RW, 1, ".1.3.6.1.4.1.534.10.2.4.4.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("output.voltage.nominal", ST_FLAG_RW, 1, ".1.3.6.1.4.1.534.10.2.4.4.0", NULL, SU_FLAG_OK, NULL), /* ats2OutputCurrent.0 = INTEGER: 5 0.1 A */ - { "output.current", 0, 0.1, ".1.3.6.1.4.1.534.10.2.2.3.2.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("output.current", 0, 0.1, ".1.3.6.1.4.1.534.10.2.2.3.2.0", NULL, SU_FLAG_OK, NULL), /* UPS collection */ /* FIXME: RFC for device.test.result! */ /* ats2ConfigTransferTest.0 = INTEGER: noTestInitiated(6) */ - { "ups.test.result", 0, 1, ".1.3.6.1.4.1.534.10.2.4.8.0", NULL, SU_FLAG_OK, eaton_ats16_nm2_test_result_info }, + snmp_info_default("ups.test.result", 0, 1, ".1.3.6.1.4.1.534.10.2.4.8.0", NULL, SU_FLAG_OK, eaton_ats16_nm2_test_result_info), /* FIXME: RFC for device.status! */ /* ats2StatusOutput.0 = INTEGER: outputPowered(2) */ - { "ups.status", 0, 1, ".1.3.6.1.4.1.534.10.2.3.3.2.0", NULL, SU_FLAG_OK, eaton_ats16_nm2_output_status_info }, + snmp_info_default("ups.status", 0, 1, ".1.3.6.1.4.1.534.10.2.3.3.2.0", NULL, SU_FLAG_OK, eaton_ats16_nm2_output_status_info), /* Ambient collection */ + /* EMP001 (legacy) mapping for EMP002 + * Note that NM2 should only be hooked with EMP002, but if any EMP001 was to be + * connected, the value may be off by a factor 10 (to be proven) */ /* ats2EnvRemoteTemp.0 = INTEGER: 0 degrees Centigrade */ - { "ambient.temperature", 0, 1, ".1.3.6.1.4.1.534.10.2.5.1.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("ambient.temperature", 0, 1, ".1.3.6.1.4.1.534.10.2.5.1.0", NULL, SU_FLAG_OK, NULL), /* ats2EnvRemoteTempLowerLimit.0 = INTEGER: 5 degrees Centigrade */ - { "ambient.temperature.low", ST_FLAG_RW, 1, ".1.3.6.1.4.1.534.10.2.5.5.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("ambient.temperature.low", ST_FLAG_RW, 1, ".1.3.6.1.4.1.534.10.2.5.5.0", NULL, SU_FLAG_OK, NULL), /* ats2EnvRemoteTempUpperLimit.0 = INTEGER: 40 degrees Centigrade */ - { "ambient.temperature.high", ST_FLAG_RW, 1, ".1.3.6.1.4.1.534.10.2.5.6.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("ambient.temperature.high", ST_FLAG_RW, 1, ".1.3.6.1.4.1.534.10.2.5.6.0", NULL, SU_FLAG_OK, NULL), /* ats2EnvRemoteHumidity.0 = INTEGER: 0 percent */ - { "ambient.humidity", 0, 1, ".1.3.6.1.4.1.534.10.2.5.2.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("ambient.humidity", 0, 1, ".1.3.6.1.4.1.534.10.2.5.2.0", NULL, SU_FLAG_OK, NULL), /* ats2EnvRemoteHumidityLowerLimit.0 = INTEGER: 5 percent */ - { "ambient.humidity.low", ST_FLAG_RW, 1, ".1.3.6.1.4.1.534.10.2.5.7.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("ambient.humidity.low", ST_FLAG_RW, 1, ".1.3.6.1.4.1.534.10.2.5.7.0", NULL, SU_FLAG_OK, NULL), /* ats2EnvRemoteHumidityUpperLimit.0 = INTEGER: 90 percent */ - { "ambient.humidity.high", ST_FLAG_RW, 1, ".1.3.6.1.4.1.534.10.2.5.8.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("ambient.humidity.high", ST_FLAG_RW, 1, ".1.3.6.1.4.1.534.10.2.5.8.0", NULL, SU_FLAG_OK, NULL), + /* Dry contacts on EMP001 TH module */ /* ats2ContactState.1 = INTEGER: open(1) */ - { "ambient.contacts.1.status", ST_FLAG_STRING, SU_INFOSIZE, + snmp_info_default("ambient.contacts.1.status", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.10.2.5.4.1.3.1", - NULL, SU_FLAG_OK, &eaton_ats16_ambient_drycontacts_info[0] }, + NULL, SU_FLAG_OK, &eaton_ats16_nm2_ambient_drycontacts_info[0]), /* ats2ContactState.2 = INTEGER: open(1) */ - { "ambient.contacts.2.status", ST_FLAG_STRING, SU_INFOSIZE, + snmp_info_default("ambient.contacts.2.status", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.10.2.5.4.1.3.2", - NULL, SU_FLAG_OK, &eaton_ats16_ambient_drycontacts_info[0] }, + NULL, SU_FLAG_OK, &eaton_ats16_nm2_ambient_drycontacts_info[0]), + + /* EMP002 (EATON EMP MIB) mapping, including daisychain support */ + /* Warning: indexes start at '1' not '0'! */ + /* sensorCount.0 */ + snmp_info_default("ambient.count", ST_FLAG_RW, 1.0, ".1.3.6.1.4.1.534.6.8.1.1.1.0", "", 0, NULL), + /* CommunicationStatus.n */ + snmp_info_default("ambient.%i.present", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.6.8.1.1.4.1.1.%i", + NULL, SU_AMBIENT_TEMPLATE, &eaton_ats16_nm2_emp002_ambient_presence_info[0]), + /* sensorName.n: OctetString EMPDT1H1C2 @1 */ + snmp_info_default("ambient.%i.name", ST_FLAG_STRING, 1.0, ".1.3.6.1.4.1.534.6.8.1.1.3.1.1.%i", "", SU_AMBIENT_TEMPLATE, NULL), + /* sensorManufacturer.n */ + snmp_info_default("ambient.%i.mfr", ST_FLAG_STRING, 1.0, ".1.3.6.1.4.1.534.6.8.1.1.2.1.6.%i", "", SU_AMBIENT_TEMPLATE, NULL), + /* sensorModel.n */ + snmp_info_default("ambient.%i.model", ST_FLAG_STRING, 1.0, ".1.3.6.1.4.1.534.6.8.1.1.2.1.7.%i", "", SU_AMBIENT_TEMPLATE, NULL), + /* sensorSerialNumber.n */ + snmp_info_default("ambient.%i.serial", ST_FLAG_STRING, 1.0, ".1.3.6.1.4.1.534.6.8.1.1.2.1.9.%i", "", SU_AMBIENT_TEMPLATE, NULL), + /* sensorUuid.n */ + snmp_info_default("ambient.%i.id", ST_FLAG_STRING, 1.0, ".1.3.6.1.4.1.534.6.8.1.1.2.1.2.%i", "", SU_AMBIENT_TEMPLATE, NULL), + /* sensorAddress.n */ + snmp_info_default("ambient.%i.address", 0, 1, ".1.3.6.1.4.1.534.6.8.1.1.2.1.4.%i", "", SU_AMBIENT_TEMPLATE, NULL), + /* sensorFirmwareVersion.n */ + snmp_info_default("ambient.%i.firmware", ST_FLAG_STRING, 1.0, ".1.3.6.1.4.1.534.6.8.1.1.2.1.10.%i", "", SU_AMBIENT_TEMPLATE, NULL), + /* temperatureUnit.1 + * MUST be before the temperature data reading! */ + snmp_info_default("ambient.%i.temperature.unit", 0, 1.0, ".1.3.6.1.4.1.534.6.8.1.2.5.0", "", SU_AMBIENT_TEMPLATE, &eaton_ats16_nm2_sensor_temperature_unit_info[0]), + + /* temperatureValue.n.1 */ +#if WITH_SNMP_LKP_FUN + snmp_info_default("ambient.%i.temperature", 0, 0.1, ".1.3.6.1.4.1.534.6.8.1.2.3.1.3.%i.1", "", SU_AMBIENT_TEMPLATE, + &eaton_ats16_nm2_sensor_temperature_read_info[0]), +#else + snmp_info_default("ambient.%i.temperature", 0, 0.1, ".1.3.6.1.4.1.534.6.8.1.2.3.1.3.%i.1", "", SU_AMBIENT_TEMPLATE, + NULL), +#endif + + snmp_info_default("ambient.%i.temperature.status", ST_FLAG_STRING, SU_INFOSIZE, + ".1.3.6.1.4.1.534.6.8.1.2.3.1.1.%i.1", + NULL, SU_AMBIENT_TEMPLATE, &eaton_ats16_nm2_threshold_status_info[0]), + snmp_info_default("ups.alarm", ST_FLAG_STRING, SU_INFOSIZE, + ".1.3.6.1.4.1.534.6.8.1.2.3.1.1.%i.1", + NULL, SU_AMBIENT_TEMPLATE, &eaton_ats16_nm2_threshold_temperature_alarms_info[0]), + /* FIXME: ambient.n.temperature.{minimum,maximum} */ + /* temperatureThresholdLowCritical.n.1 */ + snmp_info_default("ambient.%i.temperature.low.critical", ST_FLAG_RW, 0.1, ".1.3.6.1.4.1.534.6.8.1.2.2.1.6.%i.1", "", SU_AMBIENT_TEMPLATE, NULL), + /* temperatureThresholdLowWarning.n.1 */ + snmp_info_default("ambient.%i.temperature.low.warning", ST_FLAG_RW, 0.1, ".1.3.6.1.4.1.534.6.8.1.2.2.1.5.%i.1", "", SU_AMBIENT_TEMPLATE, NULL), + /* temperatureThresholdHighWarning.n.1 */ + snmp_info_default("ambient.%i.temperature.high.warning", ST_FLAG_RW, 0.1, ".1.3.6.1.4.1.534.6.8.1.2.2.1.7.%i.1", "", SU_AMBIENT_TEMPLATE, NULL), + /* temperatureThresholdHighCritical.n.1 */ + snmp_info_default("ambient.%i.temperature.high.critical", ST_FLAG_RW, 0.1, ".1.3.6.1.4.1.534.6.8.1.2.2.1.8.%i.1", "", SU_AMBIENT_TEMPLATE, NULL), + /* humidityValue.n.1 */ + snmp_info_default("ambient.%i.humidity", 0, 0.1, ".1.3.6.1.4.1.534.6.8.1.3.3.1.3.%i.1", "", SU_AMBIENT_TEMPLATE, NULL), + snmp_info_default("ambient.%i.humidity.status", ST_FLAG_STRING, SU_INFOSIZE, + ".1.3.6.1.4.1.534.6.8.1.3.3.1.1.%i.1", + NULL, SU_AMBIENT_TEMPLATE, &eaton_ats16_nm2_threshold_status_info[0]), + snmp_info_default("ups.alarm", ST_FLAG_STRING, SU_INFOSIZE, + ".1.3.6.1.4.1.534.6.8.1.3.3.1.1.%i.1", + NULL, SU_AMBIENT_TEMPLATE, &eaton_ats16_nm2_threshold_humidity_alarms_info[0]), + /* FIXME: consider ambient.n.humidity.{minimum,maximum} */ + /* humidityThresholdLowCritical.n.1 */ + snmp_info_default("ambient.%i.humidity.low.critical", ST_FLAG_RW, 0.1, ".1.3.6.1.4.1.534.6.8.1.3.2.1.6.%i.1", "", SU_AMBIENT_TEMPLATE, NULL), + /* humidityThresholdLowWarning.n.1 */ + snmp_info_default("ambient.%i.humidity.low.warning", ST_FLAG_RW, 0.1, ".1.3.6.1.4.1.534.6.8.1.3.2.1.5.%i.1", "", SU_AMBIENT_TEMPLATE, NULL), + /* humidityThresholdHighWarning.n.1 */ + snmp_info_default("ambient.%i.humidity.high.warning", ST_FLAG_RW, 0.1, ".1.3.6.1.4.1.534.6.8.1.3.2.1.7.%i.1", "", SU_AMBIENT_TEMPLATE, NULL), + /* humidityThresholdHighCritical.n.1 */ + snmp_info_default("ambient.%i.humidity.high.critical", ST_FLAG_RW, 0.1, ".1.3.6.1.4.1.534.6.8.1.3.2.1.8.%i.1", "", SU_AMBIENT_TEMPLATE, NULL), + /* digitalInputName.n.{1,2} */ + snmp_info_default("ambient.%i.contacts.1.name", ST_FLAG_STRING, 1.0, ".1.3.6.1.4.1.534.6.8.1.4.2.1.1.%i.1", "", SU_AMBIENT_TEMPLATE, NULL), + snmp_info_default("ambient.%i.contacts.2.name", ST_FLAG_STRING, 1.0, ".1.3.6.1.4.1.534.6.8.1.4.2.1.1.%i.2", "", SU_AMBIENT_TEMPLATE, NULL), + /* digitalInputPolarity.n */ + snmp_info_default("ambient.%i.contacts.1.config", ST_FLAG_RW | ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.6.8.1.4.2.1.3.%i.1", "", SU_AMBIENT_TEMPLATE, &eaton_ats16_nm2_ambient_drycontacts_polarity_info[0]), + snmp_info_default("ambient.%i.contacts.2.config", ST_FLAG_RW | ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.6.8.1.4.2.1.3.%i.2", "", SU_AMBIENT_TEMPLATE, &eaton_ats16_nm2_ambient_drycontacts_polarity_info[0]), + /* XUPS-MIB::xupsContactState.n */ + snmp_info_default("ambient.%i.contacts.1.status", ST_FLAG_STRING, 1.0, ".1.3.6.1.4.1.534.6.8.1.4.3.1.3.%i.1", "", SU_AMBIENT_TEMPLATE, &eaton_ats16_nm2_ambient_drycontacts_state_info[0]), + snmp_info_default("ambient.%i.contacts.2.status", ST_FLAG_STRING, 1.0, ".1.3.6.1.4.1.534.6.8.1.4.3.1.3.%i.2", "", SU_AMBIENT_TEMPLATE, &eaton_ats16_nm2_ambient_drycontacts_state_info[0]), #if WITH_UNMAPPED_DATA_POINTS /* FIXME: Remaining data to be processed */ /* ats2InputStatusDephasing.0 = INTEGER: normal(1) */ - { "unmapped.ats2InputStatusDephasing", 0, 1, ".1.3.6.1.4.1.534.10.2.3.1.1.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.ats2InputStatusDephasing", 0, 1, ".1.3.6.1.4.1.534.10.2.3.1.1.0", NULL, SU_FLAG_OK, NULL), /* ats2InputStatusIndex.source1 = INTEGER: source1(1) */ - { "unmapped.ats2InputStatusIndex", 0, 1, ".1.3.6.1.4.1.534.10.2.3.2.1.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.ats2InputStatusIndex", 0, 1, ".1.3.6.1.4.1.534.10.2.3.2.1.1.1", NULL, SU_FLAG_OK, NULL), /* ats2InputStatusIndex.source2 = INTEGER: source2(2) */ - { "unmapped.ats2InputStatusIndex", 0, 1, ".1.3.6.1.4.1.534.10.2.3.2.1.1.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.ats2InputStatusIndex", 0, 1, ".1.3.6.1.4.1.534.10.2.3.2.1.1.2", NULL, SU_FLAG_OK, NULL), /* ats2InputStatusGood.source1 = INTEGER: voltageAndFreqNormalRange(2) */ - { "unmapped.ats2InputStatusGood", 0, 1, ".1.3.6.1.4.1.534.10.2.3.2.1.3.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.ats2InputStatusGood", 0, 1, ".1.3.6.1.4.1.534.10.2.3.2.1.3.1", NULL, SU_FLAG_OK, NULL), /* ats2InputStatusGood.source2 = INTEGER: voltageAndFreqNormalRange(2) */ - { "unmapped.ats2InputStatusGood", 0, 1, ".1.3.6.1.4.1.534.10.2.3.2.1.3.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.ats2InputStatusGood", 0, 1, ".1.3.6.1.4.1.534.10.2.3.2.1.3.2", NULL, SU_FLAG_OK, NULL), /* ats2InputStatusInternalFailure.source1 = INTEGER: good(1) */ - { "unmapped.ats2InputStatusInternalFailure", 0, 1, ".1.3.6.1.4.1.534.10.2.3.2.1.4.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.ats2InputStatusInternalFailure", 0, 1, ".1.3.6.1.4.1.534.10.2.3.2.1.4.1", NULL, SU_FLAG_OK, NULL), /* ats2InputStatusInternalFailure.source2 = INTEGER: good(1) */ - { "unmapped.ats2InputStatusInternalFailure", 0, 1, ".1.3.6.1.4.1.534.10.2.3.2.1.4.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.ats2InputStatusInternalFailure", 0, 1, ".1.3.6.1.4.1.534.10.2.3.2.1.4.2", NULL, SU_FLAG_OK, NULL), /* ats2InputStatusUsed.source1 = INTEGER: poweringLoad(2) */ - { "unmapped.ats2InputStatusUsed", 0, 1, ".1.3.6.1.4.1.534.10.2.3.2.1.6.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.ats2InputStatusUsed", 0, 1, ".1.3.6.1.4.1.534.10.2.3.2.1.6.1", NULL, SU_FLAG_OK, NULL), /* ats2InputStatusUsed.source2 = INTEGER: notPoweringLoad(1) */ - { "unmapped.ats2InputStatusUsed", 0, 1, ".1.3.6.1.4.1.534.10.2.3.2.1.6.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.ats2InputStatusUsed", 0, 1, ".1.3.6.1.4.1.534.10.2.3.2.1.6.2", NULL, SU_FLAG_OK, NULL), /* ats2StatusInternalFailure.0 = INTEGER: good(1) */ - { "unmapped.ats2StatusInternalFailure", 0, 1, ".1.3.6.1.4.1.534.10.2.3.3.1.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.ats2StatusInternalFailure", 0, 1, ".1.3.6.1.4.1.534.10.2.3.3.1.0", NULL, SU_FLAG_OK, NULL), /* ats2StatusOverload.0 = INTEGER: noOverload(1) */ - { "unmapped.ats2StatusOverload", 0, 1, ".1.3.6.1.4.1.534.10.2.3.3.3.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.ats2StatusOverload", 0, 1, ".1.3.6.1.4.1.534.10.2.3.3.3.0", NULL, SU_FLAG_OK, NULL), /* ats2StatusOverTemperature.0 = INTEGER: noOverTemperature(1) */ - { "unmapped.ats2StatusOverTemperature", 0, 1, ".1.3.6.1.4.1.534.10.2.3.3.4.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.ats2StatusOverTemperature", 0, 1, ".1.3.6.1.4.1.534.10.2.3.3.4.0", NULL, SU_FLAG_OK, NULL), /* ats2StatusShortCircuit.0 = INTEGER: noShortCircuit(1) */ - { "unmapped.ats2StatusShortCircuit", 0, 1, ".1.3.6.1.4.1.534.10.2.3.3.5.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.ats2StatusShortCircuit", 0, 1, ".1.3.6.1.4.1.534.10.2.3.3.5.0", NULL, SU_FLAG_OK, NULL), /* ats2StatusCommunicationLost.0 = INTEGER: good(1) */ - { "unmapped.ats2StatusCommunicationLost", 0, 1, ".1.3.6.1.4.1.534.10.2.3.3.6.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.ats2StatusCommunicationLost", 0, 1, ".1.3.6.1.4.1.534.10.2.3.3.6.0", NULL, SU_FLAG_OK, NULL), /* ats2StatusConfigurationFailure.0 = INTEGER: good(1) */ - { "unmapped.ats2StatusConfigurationFailure", 0, 1, ".1.3.6.1.4.1.534.10.2.3.3.7.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.ats2StatusConfigurationFailure", 0, 1, ".1.3.6.1.4.1.534.10.2.3.3.7.0", NULL, SU_FLAG_OK, NULL), /* ats2ConfigTimeRTC.0 = Wrong Type (should be Counter32): Gauge32: 19191036 */ - { "unmapped.ats2ConfigTimeRTC", 0, 1, ".1.3.6.1.4.1.534.10.2.4.1.1.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.ats2ConfigTimeRTC", 0, 1, ".1.3.6.1.4.1.534.10.2.4.1.1.0", NULL, SU_FLAG_OK, NULL), /* ats2ConfigTimeTextDate.0 = STRING: 08/11/1970 */ - { "unmapped.ats2ConfigTimeTextDate", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.10.2.4.1.2.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.ats2ConfigTimeTextDate", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.10.2.4.1.2.0", NULL, SU_FLAG_OK, NULL), /* ats2ConfigTimeTextTime.0 = STRING: 02/50/36 */ - { "unmapped.ats2ConfigTimeTextTime", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.10.2.4.1.3.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.ats2ConfigTimeTextTime", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.10.2.4.1.3.0", NULL, SU_FLAG_OK, NULL), /* ats2ConfigInputVoltageRating.0 = INTEGER: 1 1 V */ - { "unmapped.ats2ConfigInputVoltageRating", 0, 1, ".1.3.6.1.4.1.534.10.2.4.2.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.ats2ConfigInputVoltageRating", 0, 1, ".1.3.6.1.4.1.534.10.2.4.2.0", NULL, SU_FLAG_OK, NULL), /* ats2ConfigInputFrequencyRating.0 = INTEGER: 50 Hz */ - { "unmapped.ats2ConfigInputFrequencyRating", 0, 1, ".1.3.6.1.4.1.534.10.2.4.3.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.ats2ConfigInputFrequencyRating", 0, 1, ".1.3.6.1.4.1.534.10.2.4.3.0", NULL, SU_FLAG_OK, NULL), /* ats2ConfigTransferMode.0 = INTEGER: standard(1) */ - { "unmapped.ats2ConfigTransferMode", 0, 1, ".1.3.6.1.4.1.534.10.2.4.7.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.ats2ConfigTransferMode", 0, 1, ".1.3.6.1.4.1.534.10.2.4.7.0", NULL, SU_FLAG_OK, NULL), /* ats2ConfigBrownoutLow.0 = INTEGER: 202 1 V */ - { "unmapped.ats2ConfigBrownoutLow", 0, 1, ".1.3.6.1.4.1.534.10.2.4.9.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.ats2ConfigBrownoutLow", 0, 1, ".1.3.6.1.4.1.534.10.2.4.9.0", NULL, SU_FLAG_OK, NULL), /* ats2ConfigBrownoutLowDerated.0 = INTEGER: 189 1 V */ - { "unmapped.ats2ConfigBrownoutLowDerated", 0, 1, ".1.3.6.1.4.1.534.10.2.4.10.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.ats2ConfigBrownoutLowDerated", 0, 1, ".1.3.6.1.4.1.534.10.2.4.10.0", NULL, SU_FLAG_OK, NULL), /* ats2ConfigBrownoutHigh.0 = INTEGER: 258 1 V */ - { "unmapped.ats2ConfigBrownoutHigh", 0, 1, ".1.3.6.1.4.1.534.10.2.4.11.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.ats2ConfigBrownoutHigh", 0, 1, ".1.3.6.1.4.1.534.10.2.4.11.0", NULL, SU_FLAG_OK, NULL), /* ats2ConfigHysteresisVoltage.0 = INTEGER: 5 1 V */ - { "unmapped.ats2ConfigHysteresisVoltage", 0, 1, ".1.3.6.1.4.1.534.10.2.4.12.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.ats2ConfigHysteresisVoltage", 0, 1, ".1.3.6.1.4.1.534.10.2.4.12.0", NULL, SU_FLAG_OK, NULL), /* Ambient collection */ /* ats2EnvNumContacts.0 = INTEGER: 2 */ - { "unmapped.ats2EnvNumContacts", 0, 1, ".1.3.6.1.4.1.534.10.2.5.3.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.ats2EnvNumContacts", 0, 1, ".1.3.6.1.4.1.534.10.2.5.3.0", NULL, SU_FLAG_OK, NULL), /* ats2ContactIndex.1 = INTEGER: 1 */ - { "unmapped.ats2ContactIndex", 0, 1, ".1.3.6.1.4.1.534.10.2.5.4.1.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.ats2ContactIndex", 0, 1, ".1.3.6.1.4.1.534.10.2.5.4.1.1.1", NULL, SU_FLAG_OK, NULL), /* ats2ContactIndex.2 = INTEGER: 2 */ - { "unmapped.ats2ContactIndex", 0, 1, ".1.3.6.1.4.1.534.10.2.5.4.1.1.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.ats2ContactIndex", 0, 1, ".1.3.6.1.4.1.534.10.2.5.4.1.1.2", NULL, SU_FLAG_OK, NULL), /* ats2ContactType.1 = INTEGER: notUsed(4) */ - { "unmapped.ats2ContactType", 0, 1, ".1.3.6.1.4.1.534.10.2.5.4.1.2.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.ats2ContactType", 0, 1, ".1.3.6.1.4.1.534.10.2.5.4.1.2.1", NULL, SU_FLAG_OK, NULL), /* ats2ContactType.2 = INTEGER: notUsed(4) */ - { "unmapped.ats2ContactType", 0, 1, ".1.3.6.1.4.1.534.10.2.5.4.1.2.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.ats2ContactType", 0, 1, ".1.3.6.1.4.1.534.10.2.5.4.1.2.2", NULL, SU_FLAG_OK, NULL), /* ats2ContactState.1 = INTEGER: open(1) */ - { "unmapped.ats2ContactState", 0, 1, ".1.3.6.1.4.1.534.10.2.5.4.1.3.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.ats2ContactState", 0, 1, ".1.3.6.1.4.1.534.10.2.5.4.1.3.1", NULL, SU_FLAG_OK, NULL), /* ats2ContactState.2 = INTEGER: open(1) */ - { "unmapped.ats2ContactState", 0, 1, ".1.3.6.1.4.1.534.10.2.5.4.1.3.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.ats2ContactState", 0, 1, ".1.3.6.1.4.1.534.10.2.5.4.1.3.2", NULL, SU_FLAG_OK, NULL), /* ats2ContactDescr.1 = STRING: Input #1 */ - { "unmapped.ats2ContactDescr", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.10.2.5.4.1.4.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.ats2ContactDescr", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.10.2.5.4.1.4.1", NULL, SU_FLAG_OK, NULL), /* ats2ContactDescr.2 = STRING: Input #2 */ - { "unmapped.ats2ContactDescr", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.10.2.5.4.1.4.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.ats2ContactDescr", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.10.2.5.4.1.4.2", NULL, SU_FLAG_OK, NULL), #endif /* if WITH_UNMAPPED_DATA_POINTS */ + /* end of structure. */ - { NULL, 0, 0, NULL, NULL, 0, NULL } + snmp_info_sentinel }; /* Note: keep the legacy definition intact, to avoid breaking compatibility */ diff --git a/drivers/eaton-ats16-nmc-mib.c b/drivers/eaton-ats16-nmc-mib.c index be53725fef..f4a083ad58 100644 --- a/drivers/eaton-ats16-nmc-mib.c +++ b/drivers/eaton-ats16-nmc-mib.c @@ -31,86 +31,86 @@ #define EATON_ATS16_NMC_MODEL ".1.3.6.1.4.1.534.10.2.1.2.0" static info_lkp_t eaton_ats16_nmc_source_info[] = { - { 1, "init", NULL, NULL }, - { 2, "diagnosis", NULL, NULL }, - { 3, "off", NULL, NULL }, - { 4, "1", NULL, NULL }, - { 5, "2", NULL, NULL }, - { 6, "safe", NULL, NULL }, - { 7, "fault", NULL, NULL }, - { 0, NULL, NULL, NULL } + info_lkp_default(1, "init"), + info_lkp_default(2, "diagnosis"), + info_lkp_default(3, "off"), + info_lkp_default(4, "1"), + info_lkp_default(5, "2"), + info_lkp_default(6, "safe"), + info_lkp_default(7, "fault"), + info_lkp_sentinel }; static info_lkp_t eaton_ats16_nmc_sensitivity_info[] = { - { 1, "normal", NULL, NULL }, - { 2, "high", NULL, NULL }, - { 3, "low", NULL, NULL }, - { 0, NULL, NULL, NULL } + info_lkp_default(1, "normal"), + info_lkp_default(2, "high"), + info_lkp_default(3, "low"), + info_lkp_sentinel }; static info_lkp_t eaton_ats16_nmc_input_frequency_status_info[] = { - { 1, "good", NULL, NULL }, /* No threshold triggered */ - { 2, "out-of-range", NULL, NULL }, /* Frequency out of range triggered */ - { 0, NULL, NULL, NULL } + info_lkp_default(1, "good"), /* No threshold triggered */ + info_lkp_default(2, "out-of-range"), /* Frequency out of range triggered */ + info_lkp_sentinel }; static info_lkp_t eaton_ats16_nmc_input_voltage_status_info[] = { - { 1, "good", NULL, NULL }, /* No threshold triggered */ - { 2, "derated-range", NULL, NULL }, /* Voltage derated */ - { 3, "out-of-range", NULL, NULL }, /* Voltage out of range triggered */ - { 4, "unknown", NULL, NULL }, /* "missing" */ - { 0, NULL, NULL, NULL } + info_lkp_default(1, "good"), /* No threshold triggered */ + info_lkp_default(2, "derated-range"), /* Voltage derated */ + info_lkp_default(3, "out-of-range"), /* Voltage out of range triggered */ + info_lkp_default(4, "unknown"), /* "missing" */ + info_lkp_sentinel }; static info_lkp_t eaton_ats16_nmc_test_result_info[] = { - { 1, "done and passed", NULL, NULL }, - { 2, "done and warning", NULL, NULL }, - { 3, "done and error", NULL, NULL }, - { 4, "aborted", NULL, NULL }, - { 5, "in progress", NULL, NULL }, - { 6, "no test initiated", NULL, NULL }, - { 0, NULL, NULL, NULL } + info_lkp_default(1, "done and passed"), + info_lkp_default(2, "done and warning"), + info_lkp_default(3, "done and error"), + info_lkp_default(4, "aborted"), + info_lkp_default(5, "in progress"), + info_lkp_default(6, "no test initiated"), + info_lkp_sentinel }; static info_lkp_t eaton_ats16_nmc_output_status_info[] = { - { 1, "OFF", NULL, NULL }, /* Output not powered */ - { 2, "OL", NULL, NULL }, /* Output powered */ - { 0, NULL, NULL, NULL } + info_lkp_default(1, "OFF"), /* Output not powered */ + info_lkp_default(2, "OL"), /* Output powered */ + info_lkp_sentinel }; -static info_lkp_t eaton_ats16_ambient_drycontacts_info[] = { - { -1, "unknown", NULL, NULL }, - { 1, "opened", NULL, NULL }, - { 2, "closed", NULL, NULL }, - { 3, "opened", NULL, NULL }, /* openWithNotice */ - { 4, "closed", NULL, NULL }, /* closedWithNotice */ - { 0, NULL, NULL, NULL } +static info_lkp_t eaton_ats16_nmc_ambient_drycontacts_info[] = { + info_lkp_default(-1, "unknown"), + info_lkp_default(1, "opened"), + info_lkp_default(2, "closed"), + info_lkp_default(3, "opened"), /* openWithNotice */ + info_lkp_default(4, "closed"), /* closedWithNotice */ + info_lkp_sentinel }; /* EATON_ATS_NMC Snmp2NUT lookup table */ static snmp_info_t eaton_ats16_nmc_mib[] = { /* standard MIB items */ - { "device.description", ST_FLAG_STRING | ST_FLAG_RW, SU_INFOSIZE, ".1.3.6.1.2.1.1.1.0", NULL, SU_FLAG_OK, NULL }, - { "device.contact", ST_FLAG_STRING | ST_FLAG_RW, SU_INFOSIZE, ".1.3.6.1.2.1.1.4.0", NULL, SU_FLAG_OK, NULL }, - { "device.location", ST_FLAG_STRING | ST_FLAG_RW, SU_INFOSIZE, ".1.3.6.1.2.1.1.6.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("device.description", ST_FLAG_STRING | ST_FLAG_RW, SU_INFOSIZE, ".1.3.6.1.2.1.1.1.0", NULL, SU_FLAG_OK, NULL), + snmp_info_default("device.contact", ST_FLAG_STRING | ST_FLAG_RW, SU_INFOSIZE, ".1.3.6.1.2.1.1.4.0", NULL, SU_FLAG_OK, NULL), + snmp_info_default("device.location", ST_FLAG_STRING | ST_FLAG_RW, SU_INFOSIZE, ".1.3.6.1.2.1.1.6.0", NULL, SU_FLAG_OK, NULL), /* Device collection */ - { "device.type", ST_FLAG_STRING, SU_INFOSIZE, NULL, "ats", SU_FLAG_STATIC | SU_FLAG_ABSENT | SU_FLAG_OK, NULL }, + snmp_info_default("device.type", ST_FLAG_STRING, SU_INFOSIZE, NULL, "ats", SU_FLAG_STATIC | SU_FLAG_ABSENT | SU_FLAG_OK, NULL), /* ats2IdentManufacturer.0 = STRING: EATON */ - { "device.mfr", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.10.2.1.1.0", "Eaton", SU_FLAG_STATIC | SU_FLAG_OK, NULL }, + snmp_info_default("device.mfr", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.10.2.1.1.0", "Eaton", SU_FLAG_STATIC | SU_FLAG_OK, NULL), /* ats2IdentModel.0 = STRING: Eaton ATS */ - { "device.model", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.10.2.1.2.0", "ATS", SU_FLAG_STATIC | SU_FLAG_OK, NULL }, + snmp_info_default("device.model", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.10.2.1.2.0", "ATS", SU_FLAG_STATIC | SU_FLAG_OK, NULL), /* FIXME: RFC for device.firmware! */ /* FIXME: the 2 "firmware" entries below should be SU_FLAG_SEMI_STATIC */ /* ats2IdentFWVersion.0 = STRING: 00.00.0009 */ - { "ups.firmware", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.10.2.1.3.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("ups.firmware", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.10.2.1.3.0", NULL, SU_FLAG_OK, NULL), /* FIXME: RFC for device.firmware.aux! */ /* ats2IdentRelease.0 = STRING: JF */ - { "ups.firmware.aux", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.10.2.1.4.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("ups.firmware.aux", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.10.2.1.4.0", NULL, SU_FLAG_OK, NULL), /* ats2IdentSerialNumber.0 = STRING: GA04F23009 */ - { "device.serial", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.10.2.1.5.0", NULL, SU_FLAG_STATIC | SU_FLAG_OK, NULL }, + snmp_info_default("device.serial", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.10.2.1.5.0", NULL, SU_FLAG_STATIC | SU_FLAG_OK, NULL), /* ats2IdentPartNumber.0 = STRING: EATS16N */ - { "device.part", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.10.2.1.6.0", NULL, SU_FLAG_STATIC | SU_FLAG_OK, NULL }, + snmp_info_default("device.part", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.10.2.1.6.0", NULL, SU_FLAG_STATIC | SU_FLAG_OK, NULL), /* ats2IdentAgentVersion.0 = STRING: 301F23C28 */ /* { "unmapped.ats2IdentAgentVersion", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.10.2.1.7.0", NULL, SU_FLAG_OK, NULL, NULL }, */ /* ats2InputDephasing.0 = INTEGER: 2 degrees */ @@ -118,148 +118,150 @@ static snmp_info_t eaton_ats16_nmc_mib[] = { /* Input collection */ /* ats2InputIndex.source1 = INTEGER: source1(1) */ - { "input.1.id", 0, 1, ".1.3.6.1.4.1.534.10.2.2.2.1.1.1", NULL, SU_FLAG_STATIC | SU_FLAG_OK, NULL }, + snmp_info_default("input.1.id", 0, 1, ".1.3.6.1.4.1.534.10.2.2.2.1.1.1", NULL, SU_FLAG_STATIC | SU_FLAG_OK, NULL), /* ats2InputIndex.source2 = INTEGER: source2(2) */ - { "input.2.id", 0, 1, ".1.3.6.1.4.1.534.10.2.2.2.1.1.2", NULL, SU_FLAG_STATIC | SU_FLAG_OK, NULL }, + snmp_info_default("input.2.id", 0, 1, ".1.3.6.1.4.1.534.10.2.2.2.1.1.2", NULL, SU_FLAG_STATIC | SU_FLAG_OK, NULL), /* ats2InputVoltage.source1 = INTEGER: 2292 0.1 V */ - { "input.1.voltage", 0, 0.1, ".1.3.6.1.4.1.534.10.2.2.2.1.2.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("input.1.voltage", 0, 0.1, ".1.3.6.1.4.1.534.10.2.2.2.1.2.1", NULL, SU_FLAG_OK, NULL), /* ats2InputVoltage.source2 = INTEGER: 2432 0.1 V */ - { "input.2.voltage", 0, 0.1, ".1.3.6.1.4.1.534.10.2.2.2.1.2.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("input.2.voltage", 0, 0.1, ".1.3.6.1.4.1.534.10.2.2.2.1.2.2", NULL, SU_FLAG_OK, NULL), /* ats2InputStatusVoltage.source1 = INTEGER: normalRange(1) */ - { "input.1.voltage.status", ST_FLAG_STRING, 1, ".1.3.6.1.4.1.534.10.2.3.2.1.5.1", NULL, SU_FLAG_OK, eaton_ats16_nmc_input_voltage_status_info }, + snmp_info_default("input.1.voltage.status", ST_FLAG_STRING, 1, ".1.3.6.1.4.1.534.10.2.3.2.1.5.1", NULL, SU_FLAG_OK, eaton_ats16_nmc_input_voltage_status_info), /* ats2InputStatusVoltage.source2 = INTEGER: normalRange(1) */ - { "input.2.voltage.status", ST_FLAG_STRING, 1, ".1.3.6.1.4.1.534.10.2.3.2.1.5.2", NULL, SU_FLAG_OK, eaton_ats16_nmc_input_voltage_status_info }, + snmp_info_default("input.2.voltage.status", ST_FLAG_STRING, 1, ".1.3.6.1.4.1.534.10.2.3.2.1.5.2", NULL, SU_FLAG_OK, eaton_ats16_nmc_input_voltage_status_info), /* ats2InputFrequency.source1 = INTEGER: 500 0.1 Hz */ - { "input.1.frequency", 0, 0.1, ".1.3.6.1.4.1.534.10.2.2.2.1.3.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("input.1.frequency", 0, 0.1, ".1.3.6.1.4.1.534.10.2.2.2.1.3.1", NULL, SU_FLAG_OK, NULL), /* ats2InputFrequency.source2 = INTEGER: 500 0.1 Hz */ - { "input.2.frequency", 0, 0.1, ".1.3.6.1.4.1.534.10.2.2.2.1.3.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("input.2.frequency", 0, 0.1, ".1.3.6.1.4.1.534.10.2.2.2.1.3.2", NULL, SU_FLAG_OK, NULL), /* ats2InputStatusFrequency.source1 = INTEGER: good(1) */ - { "input.1.frequency.status", ST_FLAG_STRING, 1, ".1.3.6.1.4.1.534.10.2.3.2.1.2.1", NULL, SU_FLAG_OK, eaton_ats16_nmc_input_frequency_status_info }, + snmp_info_default("input.1.frequency.status", ST_FLAG_STRING, 1, ".1.3.6.1.4.1.534.10.2.3.2.1.2.1", NULL, SU_FLAG_OK, eaton_ats16_nmc_input_frequency_status_info), /* ats2InputStatusFrequency.source2 = INTEGER: good(1) */ - { "input.2.frequency.status", ST_FLAG_STRING, 1, ".1.3.6.1.4.1.534.10.2.3.2.1.2.2", NULL, SU_FLAG_OK, eaton_ats16_nmc_input_frequency_status_info }, + snmp_info_default("input.2.frequency.status", ST_FLAG_STRING, 1, ".1.3.6.1.4.1.534.10.2.3.2.1.2.2", NULL, SU_FLAG_OK, eaton_ats16_nmc_input_frequency_status_info), /* ats2ConfigSensitivity.0 = INTEGER: normal(1) */ - { "input.sensitivity", ST_FLAG_RW, SU_INFOSIZE, ".1.3.6.1.4.1.534.10.2.4.6.0", NULL, SU_FLAG_OK, &eaton_ats16_nmc_sensitivity_info[0] }, + snmp_info_default("input.sensitivity", ST_FLAG_RW, SU_INFOSIZE, ".1.3.6.1.4.1.534.10.2.4.6.0", NULL, SU_FLAG_OK, &eaton_ats16_nmc_sensitivity_info[0]), /* ats2OperationMode.0 = INTEGER: source1(4) */ - { "input.source", ST_FLAG_STRING, 1, ".1.3.6.1.4.1.534.10.2.2.4.0", NULL, SU_FLAG_OK, eaton_ats16_nmc_source_info }, + snmp_info_default("input.source", ST_FLAG_STRING, 1, ".1.3.6.1.4.1.534.10.2.2.4.0", NULL, SU_FLAG_OK, eaton_ats16_nmc_source_info), /* ats2ConfigPreferred.0 = INTEGER: source1(1) */ - { "input.source.preferred", ST_FLAG_RW, 1, ".1.3.6.1.4.1.534.10.2.4.5.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("input.source.preferred", ST_FLAG_RW, 1, ".1.3.6.1.4.1.534.10.2.4.5.0", NULL, SU_FLAG_OK, NULL), /* ats2InputDephasing = INTEGER: 181 */ - { "input.phase.shift", 0, 1, ".1.3.6.1.4.1.534.10.2.2.1.1.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("input.phase.shift", 0, 1, ".1.3.6.1.4.1.534.10.2.2.1.1.0", NULL, SU_FLAG_OK, NULL), /* Output collection */ /* ats2OutputVoltage.0 = INTEGER: 2304 0.1 V */ - { "output.voltage", 0, 0.1, ".1.3.6.1.4.1.534.10.2.2.3.1.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("output.voltage", 0, 0.1, ".1.3.6.1.4.1.534.10.2.2.3.1.0", NULL, SU_FLAG_OK, NULL), /* ats2ConfigOutputVoltage.0 = INTEGER: 230 1 V */ - { "output.voltage.nominal", ST_FLAG_RW, 1, ".1.3.6.1.4.1.534.10.2.4.4.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("output.voltage.nominal", ST_FLAG_RW, 1, ".1.3.6.1.4.1.534.10.2.4.4.0", NULL, SU_FLAG_OK, NULL), /* ats2OutputCurrent.0 = INTEGER: 5 0.1 A */ - { "output.current", 0, 0.1, ".1.3.6.1.4.1.534.10.2.2.3.2.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("output.current", 0, 0.1, ".1.3.6.1.4.1.534.10.2.2.3.2.0", NULL, SU_FLAG_OK, NULL), /* UPS collection */ /* FIXME: RFC for device.test.result! */ /* ats2ConfigTransferTest.0 = INTEGER: noTestInitiated(6) */ - { "ups.test.result", 0, 1, ".1.3.6.1.4.1.534.10.2.4.8.0", NULL, SU_FLAG_OK, eaton_ats16_nmc_test_result_info }, + snmp_info_default("ups.test.result", 0, 1, ".1.3.6.1.4.1.534.10.2.4.8.0", NULL, SU_FLAG_OK, eaton_ats16_nmc_test_result_info), /* FIXME: RFC for device.status! */ /* ats2StatusOutput.0 = INTEGER: outputPowered(2) */ - { "ups.status", 0, 1, ".1.3.6.1.4.1.534.10.2.3.3.2.0", NULL, SU_FLAG_OK, eaton_ats16_nmc_output_status_info }, + snmp_info_default("ups.status", 0, 1, ".1.3.6.1.4.1.534.10.2.3.3.2.0", NULL, SU_FLAG_OK, eaton_ats16_nmc_output_status_info), /* Ambient collection */ /* ats2EnvRemoteTemp.0 = INTEGER: 0 degrees Centigrade */ - { "ambient.temperature", 0, 0.1, ".1.3.6.1.4.1.534.10.2.5.1.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("ambient.temperature", 0, 0.1, ".1.3.6.1.4.1.534.10.2.5.1.0", NULL, SU_FLAG_OK, NULL), /* ats2EnvRemoteTempLowerLimit.0 = INTEGER: 5 degrees Centigrade */ - { "ambient.temperature.low", ST_FLAG_RW, 1, ".1.3.6.1.4.1.534.10.2.5.5.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("ambient.temperature.low", ST_FLAG_RW, 1, ".1.3.6.1.4.1.534.10.2.5.5.0", NULL, SU_FLAG_OK, NULL), /* ats2EnvRemoteTempUpperLimit.0 = INTEGER: 40 degrees Centigrade */ - { "ambient.temperature.high", ST_FLAG_RW, 1, ".1.3.6.1.4.1.534.10.2.5.6.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("ambient.temperature.high", ST_FLAG_RW, 1, ".1.3.6.1.4.1.534.10.2.5.6.0", NULL, SU_FLAG_OK, NULL), /* ats2EnvRemoteHumidity.0 = INTEGER: 0 percent */ - { "ambient.humidity", 0, 0.1, ".1.3.6.1.4.1.534.10.2.5.2.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("ambient.humidity", 0, 0.1, ".1.3.6.1.4.1.534.10.2.5.2.0", NULL, SU_FLAG_OK, NULL), /* ats2EnvRemoteHumidityLowerLimit.0 = INTEGER: 5 percent */ - { "ambient.humidity.low", ST_FLAG_RW, 1, ".1.3.6.1.4.1.534.10.2.5.7.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("ambient.humidity.low", ST_FLAG_RW, 1, ".1.3.6.1.4.1.534.10.2.5.7.0", NULL, SU_FLAG_OK, NULL), /* ats2EnvRemoteHumidityUpperLimit.0 = INTEGER: 90 percent */ - { "ambient.humidity.high", ST_FLAG_RW, 1, ".1.3.6.1.4.1.534.10.2.5.8.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("ambient.humidity.high", ST_FLAG_RW, 1, ".1.3.6.1.4.1.534.10.2.5.8.0", NULL, SU_FLAG_OK, NULL), + /* Dry contacts on EMP001 TH module */ /* ats2ContactState.1 = INTEGER: open(1) */ - { "ambient.contacts.1.status", ST_FLAG_STRING, SU_INFOSIZE, + snmp_info_default("ambient.contacts.1.status", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.10.2.5.4.1.3.1", - NULL, SU_FLAG_OK, &eaton_ats16_ambient_drycontacts_info[0] }, + NULL, SU_FLAG_OK, &eaton_ats16_nmc_ambient_drycontacts_info[0]), /* ats2ContactState.2 = INTEGER: open(1) */ - { "ambient.contacts.2.status", ST_FLAG_STRING, SU_INFOSIZE, + snmp_info_default("ambient.contacts.2.status", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.10.2.5.4.1.3.2", - NULL, SU_FLAG_OK, &eaton_ats16_ambient_drycontacts_info[0]}, + NULL, SU_FLAG_OK, &eaton_ats16_nmc_ambient_drycontacts_info[0]), #if WITH_UNMAPPED_DATA_POINTS /* FIXME: Remaining data to be processed */ /* ats2InputStatusDephasing.0 = INTEGER: normal(1) */ - { "unmapped.ats2InputStatusDephasing", 0, 1, ".1.3.6.1.4.1.534.10.2.3.1.1.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.ats2InputStatusDephasing", 0, 1, ".1.3.6.1.4.1.534.10.2.3.1.1.0", NULL, SU_FLAG_OK, NULL), /* ats2InputStatusIndex.source1 = INTEGER: source1(1) */ - { "unmapped.ats2InputStatusIndex", 0, 1, ".1.3.6.1.4.1.534.10.2.3.2.1.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.ats2InputStatusIndex", 0, 1, ".1.3.6.1.4.1.534.10.2.3.2.1.1.1", NULL, SU_FLAG_OK, NULL), /* ats2InputStatusIndex.source2 = INTEGER: source2(2) */ - { "unmapped.ats2InputStatusIndex", 0, 1, ".1.3.6.1.4.1.534.10.2.3.2.1.1.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.ats2InputStatusIndex", 0, 1, ".1.3.6.1.4.1.534.10.2.3.2.1.1.2", NULL, SU_FLAG_OK, NULL), /* ats2InputStatusGood.source1 = INTEGER: voltageAndFreqNormalRange(2) */ - { "unmapped.ats2InputStatusGood", 0, 1, ".1.3.6.1.4.1.534.10.2.3.2.1.3.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.ats2InputStatusGood", 0, 1, ".1.3.6.1.4.1.534.10.2.3.2.1.3.1", NULL, SU_FLAG_OK, NULL), /* ats2InputStatusGood.source2 = INTEGER: voltageAndFreqNormalRange(2) */ - { "unmapped.ats2InputStatusGood", 0, 1, ".1.3.6.1.4.1.534.10.2.3.2.1.3.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.ats2InputStatusGood", 0, 1, ".1.3.6.1.4.1.534.10.2.3.2.1.3.2", NULL, SU_FLAG_OK, NULL), /* ats2InputStatusInternalFailure.source1 = INTEGER: good(1) */ - { "unmapped.ats2InputStatusInternalFailure", 0, 1, ".1.3.6.1.4.1.534.10.2.3.2.1.4.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.ats2InputStatusInternalFailure", 0, 1, ".1.3.6.1.4.1.534.10.2.3.2.1.4.1", NULL, SU_FLAG_OK, NULL), /* ats2InputStatusInternalFailure.source2 = INTEGER: good(1) */ - { "unmapped.ats2InputStatusInternalFailure", 0, 1, ".1.3.6.1.4.1.534.10.2.3.2.1.4.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.ats2InputStatusInternalFailure", 0, 1, ".1.3.6.1.4.1.534.10.2.3.2.1.4.2", NULL, SU_FLAG_OK, NULL), /* ats2InputStatusUsed.source1 = INTEGER: poweringLoad(2) */ - { "unmapped.ats2InputStatusUsed", 0, 1, ".1.3.6.1.4.1.534.10.2.3.2.1.6.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.ats2InputStatusUsed", 0, 1, ".1.3.6.1.4.1.534.10.2.3.2.1.6.1", NULL, SU_FLAG_OK, NULL), /* ats2InputStatusUsed.source2 = INTEGER: notPoweringLoad(1) */ - { "unmapped.ats2InputStatusUsed", 0, 1, ".1.3.6.1.4.1.534.10.2.3.2.1.6.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.ats2InputStatusUsed", 0, 1, ".1.3.6.1.4.1.534.10.2.3.2.1.6.2", NULL, SU_FLAG_OK, NULL), /* ats2StatusInternalFailure.0 = INTEGER: good(1) */ - { "unmapped.ats2StatusInternalFailure", 0, 1, ".1.3.6.1.4.1.534.10.2.3.3.1.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.ats2StatusInternalFailure", 0, 1, ".1.3.6.1.4.1.534.10.2.3.3.1.0", NULL, SU_FLAG_OK, NULL), /* ats2StatusOverload.0 = INTEGER: noOverload(1) */ - { "unmapped.ats2StatusOverload", 0, 1, ".1.3.6.1.4.1.534.10.2.3.3.3.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.ats2StatusOverload", 0, 1, ".1.3.6.1.4.1.534.10.2.3.3.3.0", NULL, SU_FLAG_OK, NULL), /* ats2StatusOverTemperature.0 = INTEGER: noOverTemperature(1) */ - { "unmapped.ats2StatusOverTemperature", 0, 1, ".1.3.6.1.4.1.534.10.2.3.3.4.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.ats2StatusOverTemperature", 0, 1, ".1.3.6.1.4.1.534.10.2.3.3.4.0", NULL, SU_FLAG_OK, NULL), /* ats2StatusShortCircuit.0 = INTEGER: noShortCircuit(1) */ - { "unmapped.ats2StatusShortCircuit", 0, 1, ".1.3.6.1.4.1.534.10.2.3.3.5.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.ats2StatusShortCircuit", 0, 1, ".1.3.6.1.4.1.534.10.2.3.3.5.0", NULL, SU_FLAG_OK, NULL), /* ats2StatusCommunicationLost.0 = INTEGER: good(1) */ - { "unmapped.ats2StatusCommunicationLost", 0, 1, ".1.3.6.1.4.1.534.10.2.3.3.6.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.ats2StatusCommunicationLost", 0, 1, ".1.3.6.1.4.1.534.10.2.3.3.6.0", NULL, SU_FLAG_OK, NULL), /* ats2StatusConfigurationFailure.0 = INTEGER: good(1) */ - { "unmapped.ats2StatusConfigurationFailure", 0, 1, ".1.3.6.1.4.1.534.10.2.3.3.7.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.ats2StatusConfigurationFailure", 0, 1, ".1.3.6.1.4.1.534.10.2.3.3.7.0", NULL, SU_FLAG_OK, NULL), /* ats2ConfigTimeRTC.0 = Wrong Type (should be Counter32): Gauge32: 19191036 */ - { "unmapped.ats2ConfigTimeRTC", 0, 1, ".1.3.6.1.4.1.534.10.2.4.1.1.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.ats2ConfigTimeRTC", 0, 1, ".1.3.6.1.4.1.534.10.2.4.1.1.0", NULL, SU_FLAG_OK, NULL), /* ats2ConfigTimeTextDate.0 = STRING: 08/11/1970 */ - { "unmapped.ats2ConfigTimeTextDate", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.10.2.4.1.2.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.ats2ConfigTimeTextDate", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.10.2.4.1.2.0", NULL, SU_FLAG_OK, NULL), /* ats2ConfigTimeTextTime.0 = STRING: 02/50/36 */ - { "unmapped.ats2ConfigTimeTextTime", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.10.2.4.1.3.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.ats2ConfigTimeTextTime", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.10.2.4.1.3.0", NULL, SU_FLAG_OK, NULL), /* ats2ConfigInputVoltageRating.0 = INTEGER: 1 1 V */ - { "unmapped.ats2ConfigInputVoltageRating", 0, 1, ".1.3.6.1.4.1.534.10.2.4.2.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.ats2ConfigInputVoltageRating", 0, 1, ".1.3.6.1.4.1.534.10.2.4.2.0", NULL, SU_FLAG_OK, NULL), /* ats2ConfigInputFrequencyRating.0 = INTEGER: 50 Hz */ - { "unmapped.ats2ConfigInputFrequencyRating", 0, 1, ".1.3.6.1.4.1.534.10.2.4.3.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.ats2ConfigInputFrequencyRating", 0, 1, ".1.3.6.1.4.1.534.10.2.4.3.0", NULL, SU_FLAG_OK, NULL), /* ats2ConfigTransferMode.0 = INTEGER: standard(1) */ - { "unmapped.ats2ConfigTransferMode", 0, 1, ".1.3.6.1.4.1.534.10.2.4.7.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.ats2ConfigTransferMode", 0, 1, ".1.3.6.1.4.1.534.10.2.4.7.0", NULL, SU_FLAG_OK, NULL), /* ats2ConfigBrownoutLow.0 = INTEGER: 202 1 V */ - { "unmapped.ats2ConfigBrownoutLow", 0, 1, ".1.3.6.1.4.1.534.10.2.4.9.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.ats2ConfigBrownoutLow", 0, 1, ".1.3.6.1.4.1.534.10.2.4.9.0", NULL, SU_FLAG_OK, NULL), /* ats2ConfigBrownoutLowDerated.0 = INTEGER: 189 1 V */ - { "unmapped.ats2ConfigBrownoutLowDerated", 0, 1, ".1.3.6.1.4.1.534.10.2.4.10.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.ats2ConfigBrownoutLowDerated", 0, 1, ".1.3.6.1.4.1.534.10.2.4.10.0", NULL, SU_FLAG_OK, NULL), /* ats2ConfigBrownoutHigh.0 = INTEGER: 258 1 V */ - { "unmapped.ats2ConfigBrownoutHigh", 0, 1, ".1.3.6.1.4.1.534.10.2.4.11.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.ats2ConfigBrownoutHigh", 0, 1, ".1.3.6.1.4.1.534.10.2.4.11.0", NULL, SU_FLAG_OK, NULL), /* ats2ConfigHysteresisVoltage.0 = INTEGER: 5 1 V */ - { "unmapped.ats2ConfigHysteresisVoltage", 0, 1, ".1.3.6.1.4.1.534.10.2.4.12.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.ats2ConfigHysteresisVoltage", 0, 1, ".1.3.6.1.4.1.534.10.2.4.12.0", NULL, SU_FLAG_OK, NULL), /* Ambient collection */ /* ats2EnvNumContacts.0 = INTEGER: 2 */ - { "unmapped.ats2EnvNumContacts", 0, 1, ".1.3.6.1.4.1.534.10.2.5.3.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.ats2EnvNumContacts", 0, 1, ".1.3.6.1.4.1.534.10.2.5.3.0", NULL, SU_FLAG_OK, NULL), /* ats2ContactIndex.1 = INTEGER: 1 */ - { "unmapped.ats2ContactIndex", 0, 1, ".1.3.6.1.4.1.534.10.2.5.4.1.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.ats2ContactIndex", 0, 1, ".1.3.6.1.4.1.534.10.2.5.4.1.1.1", NULL, SU_FLAG_OK, NULL), /* ats2ContactIndex.2 = INTEGER: 2 */ - { "unmapped.ats2ContactIndex", 0, 1, ".1.3.6.1.4.1.534.10.2.5.4.1.1.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.ats2ContactIndex", 0, 1, ".1.3.6.1.4.1.534.10.2.5.4.1.1.2", NULL, SU_FLAG_OK, NULL), /* ats2ContactType.1 = INTEGER: notUsed(4) */ - { "unmapped.ats2ContactType", 0, 1, ".1.3.6.1.4.1.534.10.2.5.4.1.2.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.ats2ContactType", 0, 1, ".1.3.6.1.4.1.534.10.2.5.4.1.2.1", NULL, SU_FLAG_OK, NULL), /* ats2ContactType.2 = INTEGER: notUsed(4) */ - { "unmapped.ats2ContactType", 0, 1, ".1.3.6.1.4.1.534.10.2.5.4.1.2.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.ats2ContactType", 0, 1, ".1.3.6.1.4.1.534.10.2.5.4.1.2.2", NULL, SU_FLAG_OK, NULL), /* ats2ContactDescr.1 = STRING: Input #1 */ - { "unmapped.ats2ContactDescr", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.10.2.5.4.1.4.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.ats2ContactDescr", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.10.2.5.4.1.4.1", NULL, SU_FLAG_OK, NULL), /* ats2ContactDescr.2 = STRING: Input #2 */ - { "unmapped.ats2ContactDescr", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.10.2.5.4.1.4.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.ats2ContactDescr", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.10.2.5.4.1.4.2", NULL, SU_FLAG_OK, NULL), #endif /* if WITH_UNMAPPED_DATA_POINTS */ + /* end of structure. */ - { NULL, 0, 0, NULL, NULL, 0, NULL } + snmp_info_sentinel }; /* Note: keep the legacy definition intact, to avoid breaking compatibility */ @@ -271,5 +273,5 @@ static snmp_info_t eaton_ats16_nmc_mib[] = { * done for all entries in the file. Hence the above comment line being * after its belonging declaration! */ -/*mib2nut_info_t eaton_ats16_nmc = { "eaton_ats16_nmc", EATON_ATS16_NMC_MIB_VERSION, NULL, EATON_ATS16_NMC_MODEL, EATON_ATS16_NMC_mib, EATON_ATS16_NMC_SYSOID, NULL }; */ +/*mib2nut_info_t eaton_ats16_nmc = { "eaton_ats16_nmc", EATON_ATS16_NMC_MIB_VERSION, NULL, EATON_ATS16_NMC_MODEL, eaton_ats16_nmc_mib, EATON_ATS16_NMC_SYSOID, NULL }; */ mib2nut_info_t eaton_ats16_nmc = { "eaton_ats16_nmc", EATON_ATS16_NMC_MIB_VERSION, NULL, EATON_ATS16_NMC_MODEL, eaton_ats16_nmc_mib, EATON_ATS16_NMC_SYSOID, NULL }; diff --git a/drivers/eaton-ats30-mib.c b/drivers/eaton-ats30-mib.c index 0b2032fb1f..14dec194a0 100644 --- a/drivers/eaton-ats30-mib.c +++ b/drivers/eaton-ats30-mib.c @@ -30,20 +30,20 @@ #define EATON_ATS30_MODEL ".1.3.6.1.4.1.534.10.1.2.1.0" static info_lkp_t eaton_ats30_source_info[] = { - { 1, "init", NULL, NULL }, - { 2, "diagnosis", NULL, NULL }, - { 3, "off", NULL, NULL }, - { 4, "1", NULL, NULL }, - { 5, "2", NULL, NULL }, - { 6, "safe", NULL, NULL }, - { 7, "fault", NULL, NULL }, - { 0, NULL, NULL, NULL } + info_lkp_default(1, "init"), + info_lkp_default(2, "diagnosis"), + info_lkp_default(3, "off"), + info_lkp_default(4, "1"), + info_lkp_default(5, "2"), + info_lkp_default(6, "safe"), + info_lkp_default(7, "fault"), + info_lkp_sentinel }; static info_lkp_t eaton_ats30_input_sensitivity[] = { - { 1, "high", NULL, NULL }, - { 2, "low", NULL, NULL }, - { 0, NULL, NULL, NULL } + info_lkp_default(1, "high"), + info_lkp_default(2, "low"), + info_lkp_sentinel }; /* @@ -55,163 +55,163 @@ static info_lkp_t eaton_ats30_input_sensitivity[] = { * 4 atsFailureOverTemperature N/A */ static info_lkp_t eaton_ats30_status_info[] = { - { 0, "OL", NULL, NULL }, - { 1, "OL", NULL, NULL }, /* SwitchFault */ - { 2, "OFF", NULL, NULL }, /* NoOutput */ - { 3, "OFF", NULL, NULL }, /* SwitchFault + NoOutput */ - { 4, "OL OVER", NULL, NULL }, /* OutputOC */ - { 5, "OL OVER", NULL, NULL }, /* OutputOC + SwitchFault */ - { 6, "OFF OVER", NULL, NULL }, /* OutputOC + NoOutput */ - { 7, "OFF OVER", NULL, NULL }, /* OutputOC + SwitchFault + NoOutput */ - { 8, "OL", NULL, NULL }, /* OverTemperature */ - { 9, "OL", NULL, NULL }, /* OverTemperature + SwitchFault */ - { 10, "OFF", NULL, NULL }, /* OverTemperature + NoOutput */ - { 11, "OFF", NULL, NULL }, /* OverTemperature + SwitchFault + NoOutput */ - { 12, "OL OVER", NULL, NULL }, /* OverTemperature + OutputOC */ - { 13, "OL OVER", NULL, NULL }, /* OverTemperature + OutputOC + SwitchFault */ - { 14, "OFF OVER", NULL, NULL }, /* OverTemperature + OutputOC + NoOutput */ - { 15, "OFF OVER", NULL, NULL }, /* OverTemperature + OutputOC + SwitchFault + NoOutput */ - { 0, NULL, NULL, NULL } + info_lkp_default(0, "OL"), + info_lkp_default(1, "OL"), /* SwitchFault */ + info_lkp_default(2, "OFF"), /* NoOutput */ + info_lkp_default(3, "OFF"), /* SwitchFault + NoOutput */ + info_lkp_default(4, "OL OVER"), /* OutputOC */ + info_lkp_default(5, "OL OVER"), /* OutputOC + SwitchFault */ + info_lkp_default(6, "OFF OVER"), /* OutputOC + NoOutput */ + info_lkp_default(7, "OFF OVER"), /* OutputOC + SwitchFault + NoOutput */ + info_lkp_default(8, "OL"), /* OverTemperature */ + info_lkp_default(9, "OL"), /* OverTemperature + SwitchFault */ + info_lkp_default(10, "OFF"), /* OverTemperature + NoOutput */ + info_lkp_default(11, "OFF"), /* OverTemperature + SwitchFault + NoOutput */ + info_lkp_default(12, "OL OVER"), /* OverTemperature + OutputOC */ + info_lkp_default(13, "OL OVER"), /* OverTemperature + OutputOC + SwitchFault */ + info_lkp_default(14, "OFF OVER"), /* OverTemperature + OutputOC + NoOutput */ + info_lkp_default(15, "OFF OVER"), /* OverTemperature + OutputOC + SwitchFault + NoOutput */ + info_lkp_sentinel }; /* EATON_ATS30 Snmp2NUT lookup table */ static snmp_info_t eaton_ats30_mib[] = { /* device type: ats */ - { "device.type", ST_FLAG_STRING, SU_INFOSIZE, NULL, "ats", SU_FLAG_STATIC | SU_FLAG_ABSENT | SU_FLAG_OK, NULL }, + snmp_info_default("device.type", ST_FLAG_STRING, SU_INFOSIZE, NULL, "ats", SU_FLAG_STATIC | SU_FLAG_ABSENT | SU_FLAG_OK, NULL), /* standard MIB items */ - { "device.description", ST_FLAG_STRING | ST_FLAG_RW, SU_INFOSIZE, ".1.3.6.1.2.1.1.1.0", NULL, SU_FLAG_OK, NULL }, - { "device.contact", ST_FLAG_STRING | ST_FLAG_RW, SU_INFOSIZE, ".1.3.6.1.2.1.1.4.0", NULL, SU_FLAG_OK, NULL }, - { "device.location", ST_FLAG_STRING | ST_FLAG_RW, SU_INFOSIZE, ".1.3.6.1.2.1.1.6.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("device.description", ST_FLAG_STRING | ST_FLAG_RW, SU_INFOSIZE, ".1.3.6.1.2.1.1.1.0", NULL, SU_FLAG_OK, NULL), + snmp_info_default("device.contact", ST_FLAG_STRING | ST_FLAG_RW, SU_INFOSIZE, ".1.3.6.1.2.1.1.4.0", NULL, SU_FLAG_OK, NULL), + snmp_info_default("device.location", ST_FLAG_STRING | ST_FLAG_RW, SU_INFOSIZE, ".1.3.6.1.2.1.1.6.0", NULL, SU_FLAG_OK, NULL), /* enterprises.534.10.1.1.1.0 = STRING: "Eaton" */ - { "device.mfr", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.10.1.1.1.0", NULL, SU_FLAG_STATIC | SU_FLAG_OK, NULL }, + snmp_info_default("device.mfr", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.10.1.1.1.0", NULL, SU_FLAG_STATIC | SU_FLAG_OK, NULL), /* enterprises.534.10.1.1.2.0 = STRING: "01.12.13b" -- SNMP agent version */ - /* { "device.firmware", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.10.1.1.2.0", NULL, SU_FLAG_OK, NULL }, */ + /* snmp_info_default("device.firmware", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.10.1.1.2.0", NULL, SU_FLAG_OK, NULL), */ /* enterprises.534.10.1.1.3.1.0 = INTEGER: 1 */ - /* { "unmapped.enterprise", 0, 1, ".1.3.6.1.4.1.534.10.1.1.3.1.0", NULL, SU_FLAG_OK, NULL }, */ + /* snmp_info_default("unmapped.enterprise", 0, 1, ".1.3.6.1.4.1.534.10.1.1.3.1.0", NULL, SU_FLAG_OK, NULL), */ /* enterprises.534.10.1.2.1.0 = STRING: "STS30002SR10019 " */ - { "device.model", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.10.1.2.1.0", NULL, SU_FLAG_STATIC | SU_FLAG_OK, NULL }, + snmp_info_default("device.model", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.10.1.2.1.0", NULL, SU_FLAG_STATIC | SU_FLAG_OK, NULL), /* enterprises.534.10.1.2.2.0 = STRING: "1A0003AR00.00.00" -- Firmware */ - { "ups.firmware", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.10.1.2.2.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("ups.firmware", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.10.1.2.2.0", NULL, SU_FLAG_OK, NULL), /* enterprises.534.10.1.2.3.0 = STRING: "2014-09-17 " -- Release date */ - /* { "unmapped.enterprises", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.10.1.2.3.0", NULL, SU_FLAG_OK, NULL }, */ + /* snmp_info_default("unmapped.enterprises", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.10.1.2.3.0", NULL, SU_FLAG_OK, NULL), */ /* enterprises.534.10.1.2.4.0 = STRING: "JA00E52021 " */ - { "device.serial", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.10.1.2.4.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("device.serial", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.10.1.2.4.0", NULL, SU_FLAG_OK, NULL), /* enterprises.534.10.1.2.5.0 = STRING: " " -- Device ID codes */ - /* { "unmapped.enterprises", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.10.1.2.5.0", NULL, SU_FLAG_OK, NULL }, */ + /* snmp_info_default("unmapped.enterprises", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.10.1.2.5.0", NULL, SU_FLAG_OK, NULL), */ /* ats measure */ /* =========== */ /* enterprises.534.10.1.3.1.1.1.1 = INTEGER: 1 */ - { "input.1.id", 0, 1, ".1.3.6.1.4.1.534.10.1.3.1.1.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("input.1.id", 0, 1, ".1.3.6.1.4.1.534.10.1.3.1.1.1.1", NULL, SU_FLAG_OK, NULL), /* enterprises.534.10.1.3.1.1.1.2 = INTEGER: 2 */ - { "input.2.id", 0, 1, ".1.3.6.1.4.1.534.10.1.3.1.1.1.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("input.2.id", 0, 1, ".1.3.6.1.4.1.534.10.1.3.1.1.1.2", NULL, SU_FLAG_OK, NULL), /* enterprises.534.10.1.3.1.1.2.1 = INTEGER: 2379 */ - { "input.1.voltage", 0, 0.1, ".1.3.6.1.4.1.534.10.1.3.1.1.2.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("input.1.voltage", 0, 0.1, ".1.3.6.1.4.1.534.10.1.3.1.1.2.1", NULL, SU_FLAG_OK, NULL), /* enterprises.534.10.1.3.1.1.2.2 = INTEGER: 0 */ - { "input.2.voltage", 0, 0.1, ".1.3.6.1.4.1.534.10.1.3.1.1.2.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("input.2.voltage", 0, 0.1, ".1.3.6.1.4.1.534.10.1.3.1.1.2.2", NULL, SU_FLAG_OK, NULL), /* enterprises.534.10.1.3.1.1.3.1 = INTEGER: 500 */ - { "input.1.frequency", 0, 0.1, ".1.3.6.1.4.1.534.10.1.3.1.1.3.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("input.1.frequency", 0, 0.1, ".1.3.6.1.4.1.534.10.1.3.1.1.3.1", NULL, SU_FLAG_OK, NULL), /* enterprises.534.10.1.3.1.1.3.2 = INTEGER: 0 */ - { "input.2.frequency", 0, 0.1, ".1.3.6.1.4.1.534.10.1.3.1.1.3.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("input.2.frequency", 0, 0.1, ".1.3.6.1.4.1.534.10.1.3.1.1.3.2", NULL, SU_FLAG_OK, NULL), /* enterprises.534.10.1.3.2.1.0 = INTEGER: 2375 */ - { "output.voltage", 0, 0.1, ".1.3.6.1.4.1.534.10.1.3.2.1.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("output.voltage", 0, 0.1, ".1.3.6.1.4.1.534.10.1.3.2.1.0", NULL, SU_FLAG_OK, NULL), /* enterprises.534.10.1.3.2.2.0 = INTEGER: 0 */ - { "output.current", 0, 0.1, ".1.3.6.1.4.1.534.10.1.3.2.2.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("output.current", 0, 0.1, ".1.3.6.1.4.1.534.10.1.3.2.2.0", NULL, SU_FLAG_OK, NULL), /* enterprises.534.10.1.3.3.0 = INTEGER: 25 -- internal temperature in celsius */ - { "ups.temperature", 0, 1, ".1.3.6.1.4.1.534.10.1.3.3.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("ups.temperature", 0, 1, ".1.3.6.1.4.1.534.10.1.3.3.0", NULL, SU_FLAG_OK, NULL), /* enterprises.534.10.1.3.4.0 = INTEGER: 77 -- internal temperature in fahrenheit */ - /* { "ups.temperatureF", 0, 1, ".1.3.6.1.4.1.534.10.1.3.4.0", NULL, SU_FLAG_OK, NULL }, */ + /* snmp_info_default("ups.temperatureF", 0, 1, ".1.3.6.1.4.1.534.10.1.3.4.0", NULL, SU_FLAG_OK, NULL), */ /* enterprises.534.10.1.3.5.0 = INTEGER: 37937541 */ - { "device.uptime", 0, 1, ".1.3.6.1.4.1.534.10.1.3.5.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("device.uptime", 0, 1, ".1.3.6.1.4.1.534.10.1.3.5.0", NULL, SU_FLAG_OK, NULL), /* enterprises.534.10.1.3.6.0 = INTEGER: 284 */ - /* { "unmapped.atsMessureTransferedTimes", 0, 1, ".1.3.6.1.4.1.534.10.1.3.6.0", NULL, SU_FLAG_OK, NULL }, */ + /* snmp_info_default("unmapped.atsMessureTransferedTimes", 0, 1, ".1.3.6.1.4.1.534.10.1.3.6.0", NULL, SU_FLAG_OK, NULL), */ /* enterprises.534.10.1.3.7.0 = INTEGER: 4 */ - { "input.source", 0, 1, ".1.3.6.1.4.1.534.10.1.3.7.0", NULL, SU_FLAG_OK, eaton_ats30_source_info }, + snmp_info_default("input.source", 0, 1, ".1.3.6.1.4.1.534.10.1.3.7.0", NULL, SU_FLAG_OK, eaton_ats30_source_info), /* atsStatus */ /* ========= */ #if WITH_UNMAPPED_DATA_POINTS /* NOTE: Unused OIDs are left as comments for potential future improvements */ /* enterprises.534.10.1.4.1.0 = INTEGER: 7 */ - { "unmapped.atsInputFlowIndicator", 0, 1, ".1.3.6.1.4.1.534.10.1.4.1.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.atsInputFlowIndicator", 0, 1, ".1.3.6.1.4.1.534.10.1.4.1.0", NULL, SU_FLAG_OK, NULL), /* enterprises.534.10.1.4.2.1.1.1 = INTEGER: 1 -- atsInputFlowTable start */ - { "unmapped.atsInputFlowIndex.1", 0, 1, ".1.3.6.1.4.1.534.10.1.4.2.1.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.atsInputFlowIndex.1", 0, 1, ".1.3.6.1.4.1.534.10.1.4.2.1.1.1", NULL, SU_FLAG_OK, NULL), /* enterprises.534.10.1.4.2.1.1.2 = INTEGER: 2 */ - { "unmapped.atsInputFlowIndex.2", 0, 1, ".1.3.6.1.4.1.534.10.1.4.2.1.1.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.atsInputFlowIndex.2", 0, 1, ".1.3.6.1.4.1.534.10.1.4.2.1.1.2", NULL, SU_FLAG_OK, NULL), /* enterprises.534.10.1.4.2.1.2.1 = INTEGER: 1 */ - { "unmapped.atsInputFlowRelay.1", 0, 1, ".1.3.6.1.4.1.534.10.1.4.2.1.2.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.atsInputFlowRelay.1", 0, 1, ".1.3.6.1.4.1.534.10.1.4.2.1.2.1", NULL, SU_FLAG_OK, NULL), /* enterprises.534.10.1.4.2.1.2.2 = INTEGER: 2 */ - { "unmapped.atsInputFlowRelay.2", 0, 1, ".1.3.6.1.4.1.534.10.1.4.2.1.2.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.atsInputFlowRelay.2", 0, 1, ".1.3.6.1.4.1.534.10.1.4.2.1.2.2", NULL, SU_FLAG_OK, NULL), /* enterprises.534.10.1.4.2.1.3.1 = INTEGER: 1 */ - { "unmapped.atsInputFlowSCR.1", 0, 1, ".1.3.6.1.4.1.534.10.1.4.2.1.3.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.atsInputFlowSCR.1", 0, 1, ".1.3.6.1.4.1.534.10.1.4.2.1.3.1", NULL, SU_FLAG_OK, NULL), /* enterprises.534.10.1.4.2.1.3.2 = INTEGER: 2 */ - { "unmapped.atsInputFlowSCR.2", 0, 1, ".1.3.6.1.4.1.534.10.1.4.2.1.3.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.atsInputFlowSCR.2", 0, 1, ".1.3.6.1.4.1.534.10.1.4.2.1.3.2", NULL, SU_FLAG_OK, NULL), /* enterprises.534.10.1.4.2.1.4.1 = INTEGER: 1 */ - { "unmapped.atsInputFlowParallelRelay.1", 0, 1, ".1.3.6.1.4.1.534.10.1.4.2.1.4.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.atsInputFlowParallelRelay.1", 0, 1, ".1.3.6.1.4.1.534.10.1.4.2.1.4.1", NULL, SU_FLAG_OK, NULL), /* enterprises.534.10.1.4.2.1.4.2 = INTEGER: 2 */ - { "unmapped.atsInputFlowParallelRelay.2", 0, 1, ".1.3.6.1.4.1.534.10.1.4.2.1.4.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.atsInputFlowParallelRelay.2", 0, 1, ".1.3.6.1.4.1.534.10.1.4.2.1.4.2", NULL, SU_FLAG_OK, NULL), /* enterprises.534.10.1.4.3.0 = INTEGER: 58720256 */ - { "unmapped.atsInputFailureIndicator", 0, 1, ".1.3.6.1.4.1.534.10.1.4.3.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.atsInputFailureIndicator", 0, 1, ".1.3.6.1.4.1.534.10.1.4.3.0", NULL, SU_FLAG_OK, NULL), /* enterprises.534.10.1.4.4.1.1.1 = INTEGER: 1 */ - { "unmapped.enterprises", 0, 1, ".1.3.6.1.4.1.534.10.1.4.4.1.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.enterprises", 0, 1, ".1.3.6.1.4.1.534.10.1.4.4.1.1.1", NULL, SU_FLAG_OK, NULL), /* enterprises.534.10.1.4.4.1.1.2 = INTEGER: 2 */ - { "unmapped.enterprises", 0, 1, ".1.3.6.1.4.1.534.10.1.4.4.1.1.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.enterprises", 0, 1, ".1.3.6.1.4.1.534.10.1.4.4.1.1.2", NULL, SU_FLAG_OK, NULL), /* enterprises.534.10.1.4.4.1.2.1 = INTEGER: 2 */ - { "unmapped.enterprises", 0, 1, ".1.3.6.1.4.1.534.10.1.4.4.1.2.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.enterprises", 0, 1, ".1.3.6.1.4.1.534.10.1.4.4.1.2.1", NULL, SU_FLAG_OK, NULL), /* enterprises.534.10.1.4.4.1.2.2 = INTEGER: 2 */ - { "unmapped.enterprises", 0, 1, ".1.3.6.1.4.1.534.10.1.4.4.1.2.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.enterprises", 0, 1, ".1.3.6.1.4.1.534.10.1.4.4.1.2.2", NULL, SU_FLAG_OK, NULL), /* enterprises.534.10.1.4.4.1.3.1 = INTEGER: 2 */ - { "unmapped.enterprises", 0, 1, ".1.3.6.1.4.1.534.10.1.4.4.1.3.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.enterprises", 0, 1, ".1.3.6.1.4.1.534.10.1.4.4.1.3.1", NULL, SU_FLAG_OK, NULL), /* enterprises.534.10.1.4.4.1.3.2 = INTEGER: 2 */ - { "unmapped.enterprises", 0, 1, ".1.3.6.1.4.1.534.10.1.4.4.1.3.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.enterprises", 0, 1, ".1.3.6.1.4.1.534.10.1.4.4.1.3.2", NULL, SU_FLAG_OK, NULL), /* enterprises.534.10.1.4.4.1.4.1 = INTEGER: 2 */ - { "unmapped.enterprises", 0, 1, ".1.3.6.1.4.1.534.10.1.4.4.1.4.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.enterprises", 0, 1, ".1.3.6.1.4.1.534.10.1.4.4.1.4.1", NULL, SU_FLAG_OK, NULL), /* enterprises.534.10.1.4.4.1.4.2 = INTEGER: 2 */ - { "unmapped.enterprises", 0, 1, ".1.3.6.1.4.1.534.10.1.4.4.1.4.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.enterprises", 0, 1, ".1.3.6.1.4.1.534.10.1.4.4.1.4.2", NULL, SU_FLAG_OK, NULL), /* enterprises.534.10.1.4.4.1.5.1 = INTEGER: 2 */ - { "unmapped.enterprises", 0, 1, ".1.3.6.1.4.1.534.10.1.4.4.1.5.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.enterprises", 0, 1, ".1.3.6.1.4.1.534.10.1.4.4.1.5.1", NULL, SU_FLAG_OK, NULL), /* enterprises.534.10.1.4.4.1.5.2 = INTEGER: 2 */ - { "unmapped.enterprises", 0, 1, ".1.3.6.1.4.1.534.10.1.4.4.1.5.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.enterprises", 0, 1, ".1.3.6.1.4.1.534.10.1.4.4.1.5.2", NULL, SU_FLAG_OK, NULL), /* enterprises.534.10.1.4.4.1.6.1 = INTEGER: 2 */ - { "unmapped.enterprises", 0, 1, ".1.3.6.1.4.1.534.10.1.4.4.1.6.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.enterprises", 0, 1, ".1.3.6.1.4.1.534.10.1.4.4.1.6.1", NULL, SU_FLAG_OK, NULL), /* enterprises.534.10.1.4.4.1.6.2 = INTEGER: 2 */ - { "unmapped.enterprises", 0, 1, ".1.3.6.1.4.1.534.10.1.4.4.1.6.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.enterprises", 0, 1, ".1.3.6.1.4.1.534.10.1.4.4.1.6.2", NULL, SU_FLAG_OK, NULL), /* enterprises.534.10.1.4.4.1.7.1 = INTEGER: 2 */ - { "unmapped.enterprises", 0, 1, ".1.3.6.1.4.1.534.10.1.4.4.1.7.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.enterprises", 0, 1, ".1.3.6.1.4.1.534.10.1.4.4.1.7.1", NULL, SU_FLAG_OK, NULL), /* enterprises.534.10.1.4.4.1.7.2 = INTEGER: 2 */ - { "unmapped.enterprises", 0, 1, ".1.3.6.1.4.1.534.10.1.4.4.1.7.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.enterprises", 0, 1, ".1.3.6.1.4.1.534.10.1.4.4.1.7.2", NULL, SU_FLAG_OK, NULL), /* enterprises.534.10.1.4.4.1.8.1 = INTEGER: 2 */ - { "unmapped.enterprises", 0, 1, ".1.3.6.1.4.1.534.10.1.4.4.1.8.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.enterprises", 0, 1, ".1.3.6.1.4.1.534.10.1.4.4.1.8.1", NULL, SU_FLAG_OK, NULL), /* enterprises.534.10.1.4.4.1.8.2 = INTEGER: 2 */ - { "unmapped.enterprises", 0, 1, ".1.3.6.1.4.1.534.10.1.4.4.1.8.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.enterprises", 0, 1, ".1.3.6.1.4.1.534.10.1.4.4.1.8.2", NULL, SU_FLAG_OK, NULL), /* enterprises.534.10.1.4.4.1.9.1 = INTEGER: 2 */ - { "unmapped.enterprises", 0, 1, ".1.3.6.1.4.1.534.10.1.4.4.1.9.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.enterprises", 0, 1, ".1.3.6.1.4.1.534.10.1.4.4.1.9.1", NULL, SU_FLAG_OK, NULL), /* enterprises.534.10.1.4.4.1.9.2 = INTEGER: 1 */ - { "unmapped.enterprises", 0, 1, ".1.3.6.1.4.1.534.10.1.4.4.1.9.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.enterprises", 0, 1, ".1.3.6.1.4.1.534.10.1.4.4.1.9.2", NULL, SU_FLAG_OK, NULL), /* enterprises.534.10.1.4.4.1.10.1 = INTEGER: 2 */ - { "unmapped.enterprises", 0, 1, ".1.3.6.1.4.1.534.10.1.4.4.1.10.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.enterprises", 0, 1, ".1.3.6.1.4.1.534.10.1.4.4.1.10.1", NULL, SU_FLAG_OK, NULL), /* enterprises.534.10.1.4.4.1.10.2 = INTEGER: 1 */ - { "unmapped.enterprises", 0, 1, ".1.3.6.1.4.1.534.10.1.4.4.1.10.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.enterprises", 0, 1, ".1.3.6.1.4.1.534.10.1.4.4.1.10.2", NULL, SU_FLAG_OK, NULL), /* enterprises.534.10.1.4.4.1.11.1 = INTEGER: 2 */ - { "unmapped.enterprises", 0, 1, ".1.3.6.1.4.1.534.10.1.4.4.1.11.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.enterprises", 0, 1, ".1.3.6.1.4.1.534.10.1.4.4.1.11.1", NULL, SU_FLAG_OK, NULL), /* enterprises.534.10.1.4.4.1.11.2 = INTEGER: 1 */ - { "unmapped.enterprises", 0, 1, ".1.3.6.1.4.1.534.10.1.4.4.1.11.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.enterprises", 0, 1, ".1.3.6.1.4.1.534.10.1.4.4.1.11.2", NULL, SU_FLAG_OK, NULL), #endif /* if WITH_UNMAPPED_DATA_POINTS */ /* enterprises.atsFailureIndicator = INTEGER: 0 */ - { "ups.status", 0, 1, ".1.3.6.1.4.1.534.10.1.4.5.0", NULL, SU_FLAG_OK, eaton_ats30_status_info }, + snmp_info_default("ups.status", 0, 1, ".1.3.6.1.4.1.534.10.1.4.5.0", NULL, SU_FLAG_OK, eaton_ats30_status_info), #if WITH_UNMAPPED_DATA_POINTS /* enterprises.534.10.1.4.6.1.0 = INTEGER: 2 -- atsFailure start */ - { "unmapped.enterprises", 0, 1, ".1.3.6.1.4.1.534.10.1.4.6.1.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.enterprises", 0, 1, ".1.3.6.1.4.1.534.10.1.4.6.1.0", NULL, SU_FLAG_OK, NULL), /* enterprises.534.10.1.4.6.2.0 = INTEGER: 2 */ - { "unmapped.enterprises", 0, 1, ".1.3.6.1.4.1.534.10.1.4.6.2.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.enterprises", 0, 1, ".1.3.6.1.4.1.534.10.1.4.6.2.0", NULL, SU_FLAG_OK, NULL), /* enterprises.534.10.1.4.6.3.0 = INTEGER: 2 */ - { "unmapped.enterprises", 0, 1, ".1.3.6.1.4.1.534.10.1.4.6.3.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.enterprises", 0, 1, ".1.3.6.1.4.1.534.10.1.4.6.3.0", NULL, SU_FLAG_OK, NULL), /* enterprises.534.10.1.4.6.4.0 = INTEGER: 2 */ - { "unmapped.enterprises", 0, 1, ".1.3.6.1.4.1.534.10.1.4.6.4.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.enterprises", 0, 1, ".1.3.6.1.4.1.534.10.1.4.6.4.0", NULL, SU_FLAG_OK, NULL), #endif /* if WITH_UNMAPPED_DATA_POINTS */ /* atsLog */ @@ -219,154 +219,154 @@ static snmp_info_t eaton_ats30_mib[] = { #if WITH_UNMAPPED_DATA_POINTS /* We are not interested in log */ /* enterprises.534.10.1.5.1.0 = INTEGER: 272 */ - { "unmapped.enterprises", 0, 1, ".1.3.6.1.4.1.534.10.1.5.1.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.enterprises", 0, 1, ".1.3.6.1.4.1.534.10.1.5.1.0", NULL, SU_FLAG_OK, NULL), /* enterprises.534.10.1.5.2.1.1.1 = INTEGER: 1 */ - { "unmapped.enterprises", 0, 1, ".1.3.6.1.4.1.534.10.1.5.2.1.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.enterprises", 0, 1, ".1.3.6.1.4.1.534.10.1.5.2.1.1.1", NULL, SU_FLAG_OK, NULL), /* enterprises.534.10.1.5.2.1.1.2 = INTEGER: 2 */ - { "unmapped.enterprises", 0, 1, ".1.3.6.1.4.1.534.10.1.5.2.1.1.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.enterprises", 0, 1, ".1.3.6.1.4.1.534.10.1.5.2.1.1.2", NULL, SU_FLAG_OK, NULL), /* enterprises.534.10.1.5.2.1.1.3 = INTEGER: 3 */ - { "unmapped.enterprises", 0, 1, ".1.3.6.1.4.1.534.10.1.5.2.1.1.3", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.enterprises", 0, 1, ".1.3.6.1.4.1.534.10.1.5.2.1.1.3", NULL, SU_FLAG_OK, NULL), /* enterprises.534.10.1.5.2.1.1.4 = INTEGER: 4 */ - { "unmapped.enterprises", 0, 1, ".1.3.6.1.4.1.534.10.1.5.2.1.1.4", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.enterprises", 0, 1, ".1.3.6.1.4.1.534.10.1.5.2.1.1.4", NULL, SU_FLAG_OK, NULL), /* enterprises.534.10.1.5.2.1.1.5 = INTEGER: 5 */ - { "unmapped.enterprises", 0, 1, ".1.3.6.1.4.1.534.10.1.5.2.1.1.5", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.enterprises", 0, 1, ".1.3.6.1.4.1.534.10.1.5.2.1.1.5", NULL, SU_FLAG_OK, NULL), /* enterprises.534.10.1.5.2.1.1.6 = INTEGER: 6 */ - { "unmapped.enterprises", 0, 1, ".1.3.6.1.4.1.534.10.1.5.2.1.1.6", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.enterprises", 0, 1, ".1.3.6.1.4.1.534.10.1.5.2.1.1.6", NULL, SU_FLAG_OK, NULL), /* enterprises.534.10.1.5.2.1.1.7 = INTEGER: 7 */ - { "unmapped.enterprises", 0, 1, ".1.3.6.1.4.1.534.10.1.5.2.1.1.7", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.enterprises", 0, 1, ".1.3.6.1.4.1.534.10.1.5.2.1.1.7", NULL, SU_FLAG_OK, NULL), /* enterprises.534.10.1.5.2.1.1.8 = INTEGER: 8 */ - { "unmapped.enterprises", 0, 1, ".1.3.6.1.4.1.534.10.1.5.2.1.1.8", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.enterprises", 0, 1, ".1.3.6.1.4.1.534.10.1.5.2.1.1.8", NULL, SU_FLAG_OK, NULL), /* enterprises.534.10.1.5.2.1.1.9 = INTEGER: 9 */ - { "unmapped.enterprises", 0, 1, ".1.3.6.1.4.1.534.10.1.5.2.1.1.9", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.enterprises", 0, 1, ".1.3.6.1.4.1.534.10.1.5.2.1.1.9", NULL, SU_FLAG_OK, NULL), /* enterprises.534.10.1.5.2.1.1.10 = INTEGER: 10 */ - { "unmapped.enterprises", 0, 1, ".1.3.6.1.4.1.534.10.1.5.2.1.1.10", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.enterprises", 0, 1, ".1.3.6.1.4.1.534.10.1.5.2.1.1.10", NULL, SU_FLAG_OK, NULL), /* enterprises.534.10.1.5.2.1.2.1 = INTEGER: 1482323677 */ - { "unmapped.enterprises", 0, 1, ".1.3.6.1.4.1.534.10.1.5.2.1.2.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.enterprises", 0, 1, ".1.3.6.1.4.1.534.10.1.5.2.1.2.1", NULL, SU_FLAG_OK, NULL), /* enterprises.534.10.1.5.2.1.2.2 = INTEGER: 1480076955 */ - { "unmapped.enterprises", 0, 1, ".1.3.6.1.4.1.534.10.1.5.2.1.2.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.enterprises", 0, 1, ".1.3.6.1.4.1.534.10.1.5.2.1.2.2", NULL, SU_FLAG_OK, NULL), /* enterprises.534.10.1.5.2.1.2.3 = INTEGER: 1480069128 */ - { "unmapped.enterprises", 0, 1, ".1.3.6.1.4.1.534.10.1.5.2.1.2.3", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.enterprises", 0, 1, ".1.3.6.1.4.1.534.10.1.5.2.1.2.3", NULL, SU_FLAG_OK, NULL), /* enterprises.534.10.1.5.2.1.2.4 = INTEGER: 1480069093 */ - { "unmapped.enterprises", 0, 1, ".1.3.6.1.4.1.534.10.1.5.2.1.2.4", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.enterprises", 0, 1, ".1.3.6.1.4.1.534.10.1.5.2.1.2.4", NULL, SU_FLAG_OK, NULL), /* enterprises.534.10.1.5.2.1.2.5 = INTEGER: 1478693745 */ - { "unmapped.enterprises", 0, 1, ".1.3.6.1.4.1.534.10.1.5.2.1.2.5", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.enterprises", 0, 1, ".1.3.6.1.4.1.534.10.1.5.2.1.2.5", NULL, SU_FLAG_OK, NULL), /* enterprises.534.10.1.5.2.1.2.6 = INTEGER: 1478693741 */ - { "unmapped.enterprises", 0, 1, ".1.3.6.1.4.1.534.10.1.5.2.1.2.6", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.enterprises", 0, 1, ".1.3.6.1.4.1.534.10.1.5.2.1.2.6", NULL, SU_FLAG_OK, NULL), /* enterprises.534.10.1.5.2.1.2.7 = INTEGER: 1466604406 */ - { "unmapped.enterprises", 0, 1, ".1.3.6.1.4.1.534.10.1.5.2.1.2.7", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.enterprises", 0, 1, ".1.3.6.1.4.1.534.10.1.5.2.1.2.7", NULL, SU_FLAG_OK, NULL), /* enterprises.534.10.1.5.2.1.2.8 = INTEGER: 1466604386 */ - { "unmapped.enterprises", 0, 1, ".1.3.6.1.4.1.534.10.1.5.2.1.2.8", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.enterprises", 0, 1, ".1.3.6.1.4.1.534.10.1.5.2.1.2.8", NULL, SU_FLAG_OK, NULL), /* enterprises.534.10.1.5.2.1.2.9 = INTEGER: 1466604386 */ - { "unmapped.enterprises", 0, 1, ".1.3.6.1.4.1.534.10.1.5.2.1.2.9", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.enterprises", 0, 1, ".1.3.6.1.4.1.534.10.1.5.2.1.2.9", NULL, SU_FLAG_OK, NULL), /* enterprises.534.10.1.5.2.1.2.10 = INTEGER: 1463038288 */ - { "unmapped.enterprises", 0, 1, ".1.3.6.1.4.1.534.10.1.5.2.1.2.10", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.enterprises", 0, 1, ".1.3.6.1.4.1.534.10.1.5.2.1.2.10", NULL, SU_FLAG_OK, NULL), /* enterprises.534.10.1.5.2.1.3.1 = INTEGER: 41 */ - { "unmapped.enterprises", 0, 1, ".1.3.6.1.4.1.534.10.1.5.2.1.3.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.enterprises", 0, 1, ".1.3.6.1.4.1.534.10.1.5.2.1.3.1", NULL, SU_FLAG_OK, NULL), /* enterprises.534.10.1.5.2.1.3.2 = INTEGER: 41 */ - { "unmapped.enterprises", 0, 1, ".1.3.6.1.4.1.534.10.1.5.2.1.3.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.enterprises", 0, 1, ".1.3.6.1.4.1.534.10.1.5.2.1.3.2", NULL, SU_FLAG_OK, NULL), /* enterprises.534.10.1.5.2.1.3.3 = INTEGER: 44 */ - { "unmapped.enterprises", 0, 1, ".1.3.6.1.4.1.534.10.1.5.2.1.3.3", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.enterprises", 0, 1, ".1.3.6.1.4.1.534.10.1.5.2.1.3.3", NULL, SU_FLAG_OK, NULL), /* enterprises.534.10.1.5.2.1.3.4 = INTEGER: 44 */ - { "unmapped.enterprises", 0, 1, ".1.3.6.1.4.1.534.10.1.5.2.1.3.4", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.enterprises", 0, 1, ".1.3.6.1.4.1.534.10.1.5.2.1.3.4", NULL, SU_FLAG_OK, NULL), /* enterprises.534.10.1.5.2.1.3.5 = INTEGER: 44 */ - { "unmapped.enterprises", 0, 1, ".1.3.6.1.4.1.534.10.1.5.2.1.3.5", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.enterprises", 0, 1, ".1.3.6.1.4.1.534.10.1.5.2.1.3.5", NULL, SU_FLAG_OK, NULL), /* enterprises.534.10.1.5.2.1.3.6 = INTEGER: 41 */ - { "unmapped.enterprises", 0, 1, ".1.3.6.1.4.1.534.10.1.5.2.1.3.6", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.enterprises", 0, 1, ".1.3.6.1.4.1.534.10.1.5.2.1.3.6", NULL, SU_FLAG_OK, NULL), /* enterprises.534.10.1.5.2.1.3.7 = INTEGER: 41 */ - { "unmapped.enterprises", 0, 1, ".1.3.6.1.4.1.534.10.1.5.2.1.3.7", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.enterprises", 0, 1, ".1.3.6.1.4.1.534.10.1.5.2.1.3.7", NULL, SU_FLAG_OK, NULL), /* enterprises.534.10.1.5.2.1.3.8 = INTEGER: 46 */ - { "unmapped.enterprises", 0, 1, ".1.3.6.1.4.1.534.10.1.5.2.1.3.8", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.enterprises", 0, 1, ".1.3.6.1.4.1.534.10.1.5.2.1.3.8", NULL, SU_FLAG_OK, NULL), /* enterprises.534.10.1.5.2.1.3.9 = INTEGER: 45 */ - { "unmapped.enterprises", 0, 1, ".1.3.6.1.4.1.534.10.1.5.2.1.3.9", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.enterprises", 0, 1, ".1.3.6.1.4.1.534.10.1.5.2.1.3.9", NULL, SU_FLAG_OK, NULL), /* enterprises.534.10.1.5.2.1.3.10 = INTEGER: 41 */ - { "unmapped.enterprises", 0, 1, ".1.3.6.1.4.1.534.10.1.5.2.1.3.10", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.enterprises", 0, 1, ".1.3.6.1.4.1.534.10.1.5.2.1.3.10", NULL, SU_FLAG_OK, NULL), /* enterprises.534.10.1.5.2.1.4.1 = STRING: "12:34:37 12/21/2016" */ - { "unmapped.enterprises", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.10.1.5.2.1.4.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.enterprises", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.10.1.5.2.1.4.1", NULL, SU_FLAG_OK, NULL), /* enterprises.534.10.1.5.2.1.4.2 = STRING: "12:29:15 11/25/2016" */ - { "unmapped.enterprises", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.10.1.5.2.1.4.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.enterprises", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.10.1.5.2.1.4.2", NULL, SU_FLAG_OK, NULL), /* enterprises.534.10.1.5.2.1.4.3 = STRING: "10:18:48 11/25/2016" */ - { "unmapped.enterprises", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.10.1.5.2.1.4.3", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.enterprises", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.10.1.5.2.1.4.3", NULL, SU_FLAG_OK, NULL), /* enterprises.534.10.1.5.2.1.4.4 = STRING: "10:18:13 11/25/2016" */ - { "unmapped.enterprises", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.10.1.5.2.1.4.4", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.enterprises", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.10.1.5.2.1.4.4", NULL, SU_FLAG_OK, NULL), /* enterprises.534.10.1.5.2.1.4.5 = STRING: "12:15:45 11/09/2016" */ - { "unmapped.enterprises", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.10.1.5.2.1.4.5", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.enterprises", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.10.1.5.2.1.4.5", NULL, SU_FLAG_OK, NULL), /* enterprises.534.10.1.5.2.1.4.6 = STRING: "12:15:41 11/09/2016" */ - { "unmapped.enterprises", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.10.1.5.2.1.4.6", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.enterprises", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.10.1.5.2.1.4.6", NULL, SU_FLAG_OK, NULL), /* enterprises.534.10.1.5.2.1.4.7 = STRING: "14:06:46 06/22/2016" */ - { "unmapped.enterprises", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.10.1.5.2.1.4.7", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.enterprises", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.10.1.5.2.1.4.7", NULL, SU_FLAG_OK, NULL), /* enterprises.534.10.1.5.2.1.4.8 = STRING: "14:06:26 06/22/2016" */ - { "unmapped.enterprises", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.10.1.5.2.1.4.8", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.enterprises", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.10.1.5.2.1.4.8", NULL, SU_FLAG_OK, NULL), /* enterprises.534.10.1.5.2.1.4.9 = STRING: "14:06:26 06/22/2016" */ - { "unmapped.enterprises", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.10.1.5.2.1.4.9", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.enterprises", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.10.1.5.2.1.4.9", NULL, SU_FLAG_OK, NULL), /* enterprises.534.10.1.5.2.1.4.10 = STRING: "07:31:28 05/12/2016" */ - { "unmapped.enterprises", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.10.1.5.2.1.4.10", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.enterprises", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.10.1.5.2.1.4.10", NULL, SU_FLAG_OK, NULL), #endif /* WITH_UNMAPPED_DATA_POINTS */ /* atsConfig */ /* ========= */ #if WITH_UNMAPPED_DATA_POINTS /* enterprises.534.10.1.6.1.1.0 = INTEGER: 538562409 */ - { "unmapped.enterprises", 0, 1, ".1.3.6.1.4.1.534.10.1.6.1.1.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.enterprises", 0, 1, ".1.3.6.1.4.1.534.10.1.6.1.1.0", NULL, SU_FLAG_OK, NULL), /* enterprises.534.10.1.6.1.2.0 = STRING: "01/24/2017" */ - { "unmapped.enterprises", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.10.1.6.1.2.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.enterprises", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.10.1.6.1.2.0", NULL, SU_FLAG_OK, NULL), /* enterprises.534.10.1.6.1.3.0 = STRING: "08:40:09" */ - { "unmapped.enterprises", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.10.1.6.1.3.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.enterprises", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.10.1.6.1.3.0", NULL, SU_FLAG_OK, NULL), /* enterprises.534.10.1.6.2.1.1.1 = INTEGER: 1 */ - { "unmapped.enterprises", 0, 1, ".1.3.6.1.4.1.534.10.1.6.2.1.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.enterprises", 0, 1, ".1.3.6.1.4.1.534.10.1.6.2.1.1.1", NULL, SU_FLAG_OK, NULL), /* enterprises.534.10.1.6.2.1.1.2 = INTEGER: 2 */ - { "unmapped.enterprises", 0, 1, ".1.3.6.1.4.1.534.10.1.6.2.1.1.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.enterprises", 0, 1, ".1.3.6.1.4.1.534.10.1.6.2.1.1.2", NULL, SU_FLAG_OK, NULL), /* enterprises.534.10.1.6.2.1.2.1 = INTEGER: 1700 */ - { "unmapped.enterprises", 0, 1, ".1.3.6.1.4.1.534.10.1.6.2.1.2.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.enterprises", 0, 1, ".1.3.6.1.4.1.534.10.1.6.2.1.2.1", NULL, SU_FLAG_OK, NULL), /* enterprises.534.10.1.6.2.1.2.2 = INTEGER: 1700 */ - { "unmapped.enterprises", 0, 1, ".1.3.6.1.4.1.534.10.1.6.2.1.2.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.enterprises", 0, 1, ".1.3.6.1.4.1.534.10.1.6.2.1.2.2", NULL, SU_FLAG_OK, NULL), /* enterprises.534.10.1.6.2.1.3.1 = INTEGER: 1800 */ - { "unmapped.enterprises", 0, 1, ".1.3.6.1.4.1.534.10.1.6.2.1.3.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.enterprises", 0, 1, ".1.3.6.1.4.1.534.10.1.6.2.1.3.1", NULL, SU_FLAG_OK, NULL), /* enterprises.534.10.1.6.2.1.3.2 = INTEGER: 1800 */ - { "unmapped.enterprises", 0, 1, ".1.3.6.1.4.1.534.10.1.6.2.1.3.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.enterprises", 0, 1, ".1.3.6.1.4.1.534.10.1.6.2.1.3.2", NULL, SU_FLAG_OK, NULL), /* enterprises.534.10.1.6.2.1.4.1 = INTEGER: 2640 */ - { "unmapped.enterprises", 0, 1, ".1.3.6.1.4.1.534.10.1.6.2.1.4.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.enterprises", 0, 1, ".1.3.6.1.4.1.534.10.1.6.2.1.4.1", NULL, SU_FLAG_OK, NULL), /* enterprises.534.10.1.6.2.1.4.2 = INTEGER: 2640 */ - { "unmapped.enterprises", 0, 1, ".1.3.6.1.4.1.534.10.1.6.2.1.4.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.enterprises", 0, 1, ".1.3.6.1.4.1.534.10.1.6.2.1.4.2", NULL, SU_FLAG_OK, NULL), /* enterprises.534.10.1.6.2.1.5.1 = INTEGER: 3000 */ - { "unmapped.enterprises", 0, 1, ".1.3.6.1.4.1.534.10.1.6.2.1.5.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.enterprises", 0, 1, ".1.3.6.1.4.1.534.10.1.6.2.1.5.1", NULL, SU_FLAG_OK, NULL), /* enterprises.534.10.1.6.2.1.5.2 = INTEGER: 3000 */ - { "unmapped.enterprises", 0, 1, ".1.3.6.1.4.1.534.10.1.6.2.1.5.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.enterprises", 0, 1, ".1.3.6.1.4.1.534.10.1.6.2.1.5.2", NULL, SU_FLAG_OK, NULL), /* enterprises.534.10.1.6.2.1.6.1 = INTEGER: 50 */ - { "unmapped.enterprises", 0, 1, ".1.3.6.1.4.1.534.10.1.6.2.1.6.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.enterprises", 0, 1, ".1.3.6.1.4.1.534.10.1.6.2.1.6.1", NULL, SU_FLAG_OK, NULL), /* enterprises.534.10.1.6.2.1.6.2 = INTEGER: 50 */ - { "unmapped.enterprises", 0, 1, ".1.3.6.1.4.1.534.10.1.6.2.1.6.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.enterprises", 0, 1, ".1.3.6.1.4.1.534.10.1.6.2.1.6.2", NULL, SU_FLAG_OK, NULL), /* enterprises.534.10.1.6.2.1.7.1 = INTEGER: 40 */ - { "unmapped.enterprises", 0, 1, ".1.3.6.1.4.1.534.10.1.6.2.1.7.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.enterprises", 0, 1, ".1.3.6.1.4.1.534.10.1.6.2.1.7.1", NULL, SU_FLAG_OK, NULL), /* enterprises.534.10.1.6.2.1.7.2 = INTEGER: 40 */ - { "unmapped.enterprises", 0, 1, ".1.3.6.1.4.1.534.10.1.6.2.1.7.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.enterprises", 0, 1, ".1.3.6.1.4.1.534.10.1.6.2.1.7.2", NULL, SU_FLAG_OK, NULL), /* enterprises.534.10.1.6.3.0 = INTEGER: 2640 */ - { "unmapped.atsConfigInputVoltageRating", 0, 1, ".1.3.6.1.4.1.534.10.1.6.3.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.atsConfigInputVoltageRating", 0, 1, ".1.3.6.1.4.1.534.10.1.6.3.0", NULL, SU_FLAG_OK, NULL), /* enterprises.534.10.1.6.4.0 = INTEGER: 26 */ - { "unmapped.atsConfigRandomTime", 0, 1, ".1.3.6.1.4.1.534.10.1.6.4.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.atsConfigRandomTime", 0, 1, ".1.3.6.1.4.1.534.10.1.6.4.0", NULL, SU_FLAG_OK, NULL), #endif /* if WITH_UNMAPPED_DATA_POINTS */ /* enterprises.534.10.1.6.5.0 = INTEGER: 1 */ - { "input.source.preferred", ST_FLAG_RW, 1, ".1.3.6.1.4.1.534.10.1.6.5.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("input.source.preferred", ST_FLAG_RW, 1, ".1.3.6.1.4.1.534.10.1.6.5.0", NULL, SU_FLAG_OK, NULL), /* enterprises.534.10.1.6.6.0 = INTEGER: 2 */ - { "input.sensitivity", ST_FLAG_RW, 1, ".1.3.6.1.4.1.534.10.1.6.6.0", NULL, SU_FLAG_OK, eaton_ats30_input_sensitivity }, + snmp_info_default("input.sensitivity", ST_FLAG_RW, 1, ".1.3.6.1.4.1.534.10.1.6.6.0", NULL, SU_FLAG_OK, eaton_ats30_input_sensitivity), /* enterprises.534.10.1.6.7.0 = INTEGER: 2 */ - /* { "unmapped.atsConfigTest", 0, 1, ".1.3.6.1.4.1.534.10.1.6.7.0", NULL, SU_FLAG_OK, NULL }, */ + /* snmp_info_default("unmapped.atsConfigTest", 0, 1, ".1.3.6.1.4.1.534.10.1.6.7.0", NULL, SU_FLAG_OK, NULL), */ /* atsUpgrade */ /* ========== */ #if WITH_UNMAPPED_DATA_POINTS /* We are not interested in atsUpgrade */ /* enterprises.534.10.1.7.1.0 = INTEGER: 1 */ - /* { "unmapped.enterprises", 0, 1, ".1.3.6.1.4.1.534.10.1.7.1.0", NULL, SU_FLAG_OK, NULL }, */ + /* snmp_info_default("unmapped.enterprises", 0, 1, ".1.3.6.1.4.1.534.10.1.7.1.0", NULL, SU_FLAG_OK, NULL), */ /* enterprises.534.10.1.7.2.0 = INTEGER: 1 */ - /* { "unmapped.enterprises", 0, 1, ".1.3.6.1.4.1.534.10.1.7.2.0", NULL, SU_FLAG_OK, NULL }, */ + /* snmp_info_default("unmapped.enterprises", 0, 1, ".1.3.6.1.4.1.534.10.1.7.2.0", NULL, SU_FLAG_OK, NULL), */ /* enterprises.534.10.1.7.3.0 = INTEGER: 0 */ - /* { "unmapped.enterprises", 0, 1, ".1.3.6.1.4.1.534.10.1.7.3.0", NULL, SU_FLAG_OK, NULL }, */ + /* snmp_info_default("unmapped.enterprises", 0, 1, ".1.3.6.1.4.1.534.10.1.7.3.0", NULL, SU_FLAG_OK, NULL), */ #endif /* if WITH_UNMAPPED_DATA_POINTS */ /* end of structure. */ - { NULL, 0, 0, NULL, NULL, 0, NULL } + snmp_info_sentinel }; mib2nut_info_t eaton_ats30 = { "eaton_ats30", EATON_ATS30_MIB_VERSION, NULL, EATON_ATS30_MODEL, eaton_ats30_mib, EATON_ATS30_SYSOID, NULL }; diff --git a/drivers/eaton-pdu-genesis2-mib.c b/drivers/eaton-pdu-genesis2-mib.c index 22ff01e1fe..2030792671 100644 --- a/drivers/eaton-pdu-genesis2-mib.c +++ b/drivers/eaton-pdu-genesis2-mib.c @@ -50,45 +50,45 @@ static snmp_info_t eaton_aphel_genesisII_mib[] = { /* standard MIB items */ - { "device.description", ST_FLAG_STRING | ST_FLAG_RW, SU_INFOSIZE, ".1.3.6.1.2.1.1.1.0", NULL, SU_FLAG_OK, NULL }, - { "device.contact", ST_FLAG_STRING | ST_FLAG_RW, SU_INFOSIZE, ".1.3.6.1.2.1.1.4.0", NULL, SU_FLAG_OK, NULL }, - { "device.location", ST_FLAG_STRING | ST_FLAG_RW, SU_INFOSIZE, ".1.3.6.1.2.1.1.6.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("device.description", ST_FLAG_STRING | ST_FLAG_RW, SU_INFOSIZE, ".1.3.6.1.2.1.1.1.0", NULL, SU_FLAG_OK, NULL), + snmp_info_default("device.contact", ST_FLAG_STRING | ST_FLAG_RW, SU_INFOSIZE, ".1.3.6.1.2.1.1.4.0", NULL, SU_FLAG_OK, NULL), + snmp_info_default("device.location", ST_FLAG_STRING | ST_FLAG_RW, SU_INFOSIZE, ".1.3.6.1.2.1.1.6.0", NULL, SU_FLAG_OK, NULL), /* Device page */ - { "device.mfr", ST_FLAG_STRING, SU_INFOSIZE, NULL, "EATON | Powerware", - SU_FLAG_STATIC | SU_FLAG_ABSENT | SU_FLAG_OK, NULL }, - { "device.model", ST_FLAG_STRING, SU_INFOSIZE, APHEL1_OID_MODEL_NAME, - "Eaton Powerware ePDU Monitored", SU_FLAG_STATIC | SU_FLAG_OK, NULL }, - { "device.type", ST_FLAG_STRING, SU_INFOSIZE, NULL, "pdu", - SU_FLAG_STATIC | SU_FLAG_ABSENT | SU_FLAG_OK, NULL }, - { "device.macaddr", ST_FLAG_STRING, SU_INFOSIZE, APHEL1_OID_UNIT_MACADDR, "unknown", - 0, NULL }, + snmp_info_default("device.mfr", ST_FLAG_STRING, SU_INFOSIZE, NULL, "EATON | Powerware", + SU_FLAG_STATIC | SU_FLAG_ABSENT | SU_FLAG_OK, NULL), + snmp_info_default("device.model", ST_FLAG_STRING, SU_INFOSIZE, APHEL1_OID_MODEL_NAME, + "Eaton Powerware ePDU Monitored", SU_FLAG_STATIC | SU_FLAG_OK, NULL), + snmp_info_default("device.type", ST_FLAG_STRING, SU_INFOSIZE, NULL, "pdu", + SU_FLAG_STATIC | SU_FLAG_ABSENT | SU_FLAG_OK, NULL), + snmp_info_default("device.macaddr", ST_FLAG_STRING, SU_INFOSIZE, APHEL1_OID_UNIT_MACADDR, "unknown", + 0, NULL), /* UPS page */ - { "ups.mfr", ST_FLAG_STRING, SU_INFOSIZE, NULL, "EATON | Powerware", - SU_FLAG_STATIC | SU_FLAG_ABSENT | SU_FLAG_OK, NULL }, - { "ups.model", ST_FLAG_STRING, SU_INFOSIZE, APHEL1_OID_MODEL_NAME, - "Generic SNMP PDU", SU_FLAG_STATIC | SU_FLAG_OK, NULL }, - { "ups.id", ST_FLAG_STRING, SU_INFOSIZE, APHEL1_OID_DEVICE_NAME, - "unknown", SU_FLAG_STATIC | SU_FLAG_OK, NULL }, - { "ups.firmware", ST_FLAG_STRING, SU_INFOSIZE, APHEL1_OID_FIRMREV, "", - SU_FLAG_STATIC | SU_FLAG_OK, NULL }, - { "ups.type", ST_FLAG_STRING, SU_INFOSIZE, NULL, "pdu", - SU_FLAG_STATIC | SU_FLAG_ABSENT | SU_FLAG_OK, NULL }, + snmp_info_default("ups.mfr", ST_FLAG_STRING, SU_INFOSIZE, NULL, "EATON | Powerware", + SU_FLAG_STATIC | SU_FLAG_ABSENT | SU_FLAG_OK, NULL), + snmp_info_default("ups.model", ST_FLAG_STRING, SU_INFOSIZE, APHEL1_OID_MODEL_NAME, + "Generic SNMP PDU", SU_FLAG_STATIC | SU_FLAG_OK, NULL), + snmp_info_default("ups.id", ST_FLAG_STRING, SU_INFOSIZE, APHEL1_OID_DEVICE_NAME, + "unknown", SU_FLAG_STATIC | SU_FLAG_OK, NULL), + snmp_info_default("ups.firmware", ST_FLAG_STRING, SU_INFOSIZE, APHEL1_OID_FIRMREV, "", + SU_FLAG_STATIC | SU_FLAG_OK, NULL), + snmp_info_default("ups.type", ST_FLAG_STRING, SU_INFOSIZE, NULL, "pdu", + SU_FLAG_STATIC | SU_FLAG_ABSENT | SU_FLAG_OK, NULL), /* Outlet page */ /* we can't use template since there is no counterpart to outlet.count */ - { "outlet.1.current", 0, 0.1, APHEL1_OID_OUTLET_CURRENT ".1.0", NULL, SU_FLAG_NEGINVALID, NULL }, - { "outlet.2.current", 0, 0.1, APHEL1_OID_OUTLET_CURRENT ".2.0", NULL, SU_FLAG_NEGINVALID, NULL }, - { "outlet.3.current", 0, 0.1, APHEL1_OID_OUTLET_CURRENT ".3.0", NULL, SU_FLAG_NEGINVALID, NULL }, - { "outlet.4.current", 0, 0.1, APHEL1_OID_OUTLET_CURRENT ".4.0", NULL, SU_FLAG_NEGINVALID, NULL }, - { "outlet.5.current", 0, 0.1, APHEL1_OID_OUTLET_CURRENT ".5.0", NULL, SU_FLAG_NEGINVALID, NULL }, - { "outlet.6.current", 0, 0.1, APHEL1_OID_OUTLET_CURRENT ".6.0", NULL, SU_FLAG_NEGINVALID, NULL }, - { "outlet.7.current", 0, 0.1, APHEL1_OID_OUTLET_CURRENT ".7.0", NULL, SU_FLAG_NEGINVALID, NULL }, - { "outlet.8.current", 0, 0.1, APHEL1_OID_OUTLET_CURRENT ".8.0", NULL, SU_FLAG_NEGINVALID, NULL }, + snmp_info_default("outlet.1.current", 0, 0.1, APHEL1_OID_OUTLET_CURRENT ".1.0", NULL, SU_FLAG_NEGINVALID, NULL), + snmp_info_default("outlet.2.current", 0, 0.1, APHEL1_OID_OUTLET_CURRENT ".2.0", NULL, SU_FLAG_NEGINVALID, NULL), + snmp_info_default("outlet.3.current", 0, 0.1, APHEL1_OID_OUTLET_CURRENT ".3.0", NULL, SU_FLAG_NEGINVALID, NULL), + snmp_info_default("outlet.4.current", 0, 0.1, APHEL1_OID_OUTLET_CURRENT ".4.0", NULL, SU_FLAG_NEGINVALID, NULL), + snmp_info_default("outlet.5.current", 0, 0.1, APHEL1_OID_OUTLET_CURRENT ".5.0", NULL, SU_FLAG_NEGINVALID, NULL), + snmp_info_default("outlet.6.current", 0, 0.1, APHEL1_OID_OUTLET_CURRENT ".6.0", NULL, SU_FLAG_NEGINVALID, NULL), + snmp_info_default("outlet.7.current", 0, 0.1, APHEL1_OID_OUTLET_CURRENT ".7.0", NULL, SU_FLAG_NEGINVALID, NULL), + snmp_info_default("outlet.8.current", 0, 0.1, APHEL1_OID_OUTLET_CURRENT ".8.0", NULL, SU_FLAG_NEGINVALID, NULL), /* end of structure. */ - { NULL, 0, 0, NULL, NULL, 0, NULL } + snmp_info_sentinel }; diff --git a/drivers/eaton-pdu-marlin-mib.c b/drivers/eaton-pdu-marlin-mib.c index a49cf5beb2..a8fca038cb 100644 --- a/drivers/eaton-pdu-marlin-mib.c +++ b/drivers/eaton-pdu-marlin-mib.c @@ -41,176 +41,176 @@ #define EATON_MARLIN_OID_MODEL_NAME ".1.3.6.1.4.1.534.6.6.7.1.2.1.2.0" static info_lkp_t marlin_outlet_status_info[] = { - { 0, "off", NULL, NULL }, - { 1, "on", NULL, NULL }, - { 2, "pendingOff", NULL, NULL }, /* transitional status */ - { 3, "pendingOn", NULL, NULL }, /* transitional status */ - { 0, NULL, NULL, NULL } + info_lkp_default(0, "off"), + info_lkp_default(1, "on"), + info_lkp_default(2, "pendingOff"), /* transitional status */ + info_lkp_default(3, "pendingOn"), /* transitional status */ + info_lkp_sentinel }; static info_lkp_t marlin_outletgroups_status_info[] = { - { 0, "off", NULL, NULL }, - { 1, "on", NULL, NULL }, - { 2, "rebooting", NULL, NULL }, /* transitional status */ - { 3, "mixed", NULL, NULL }, /* transitional status, not sure what it means! */ - { 0, NULL, NULL, NULL } + info_lkp_default(0, "off"), + info_lkp_default(1, "on"), + info_lkp_default(2, "rebooting"), /* transitional status */ + info_lkp_default(3, "mixed"), /* transitional status, not sure what it means! */ + info_lkp_sentinel }; /* Ugly hack for older G2 ePDU: * having the matching OID present means that the outlet/unit is * switchable. So, it should not require this value lookup */ static info_lkp_t g2_unit_outlet_switchability_info[] = { - { -1, "yes", NULL, NULL }, - { 0, "yes", NULL, NULL }, - { 0, NULL, NULL, NULL } + info_lkp_default(-1, "yes"), + info_lkp_default(0, "yes"), + info_lkp_sentinel }; static info_lkp_t marlin_outlet_switchability_info[] = { - { 1, "yes", NULL, NULL }, /* switchable */ - { 2, "no", NULL, NULL }, /* notSwitchable */ - { 0, NULL, NULL, NULL } + info_lkp_default(1, "yes"), /* switchable */ + info_lkp_default(2, "no"), /* notSwitchable */ + info_lkp_sentinel }; /* Overall outlets switchability info for the unit. * This is refined per-outlet, depending on user configuration, * possibly disabling switchability of some outlets */ static info_lkp_t marlin_unit_switchability_info[] = { - { 0, "no", NULL, NULL }, /* unknown */ - { 1, "yes", NULL, NULL }, /* switched */ - { 2, "no", NULL, NULL }, /* advancedMonitored */ - { 3, "yes", NULL, NULL }, /* managed */ - { 4, "no", NULL, NULL }, /* monitored */ - { 0, NULL, NULL, NULL } + info_lkp_default(0, "no"), /* unknown */ + info_lkp_default(1, "yes"), /* switched */ + info_lkp_default(2, "no"), /* advancedMonitored */ + info_lkp_default(3, "yes"), /* managed */ + info_lkp_default(4, "no"), /* monitored */ + info_lkp_sentinel }; /* The physical type of outlet */ static info_lkp_t marlin_outlet_type_info[] = { - { 0, "unknown", NULL, NULL }, - { 1, "iecC13", NULL, NULL }, - { 2, "iecC19", NULL, NULL }, - { 10, "uk", NULL, NULL }, - { 11, "french", NULL, NULL }, - { 12, "schuko", NULL, NULL }, - { 20, "nema515", NULL, NULL }, - { 21, "nema51520", NULL, NULL }, - { 22, "nema520", NULL, NULL }, - { 23, "nemaL520", NULL, NULL }, - { 24, "nemaL530", NULL, NULL }, - { 25, "nema615", NULL, NULL }, - { 26, "nema620", NULL, NULL }, - { 27, "nemaL620", NULL, NULL }, - { 28, "nemaL630", NULL, NULL }, - { 29, "nemaL715", NULL, NULL }, - { 30, "rf203p277", NULL, NULL }, - { 0, NULL, NULL, NULL } + info_lkp_default(0, "unknown"), + info_lkp_default(1, "iecC13"), + info_lkp_default(2, "iecC19"), + info_lkp_default(10, "uk"), + info_lkp_default(11, "french"), + info_lkp_default(12, "schuko"), + info_lkp_default(20, "nema515"), + info_lkp_default(21, "nema51520"), + info_lkp_default(22, "nema520"), + info_lkp_default(23, "nemaL520"), + info_lkp_default(24, "nemaL530"), + info_lkp_default(25, "nema615"), + info_lkp_default(26, "nema620"), + info_lkp_default(27, "nemaL620"), + info_lkp_default(28, "nemaL630"), + info_lkp_default(29, "nemaL715"), + info_lkp_default(30, "rf203p277"), + info_lkp_sentinel }; static info_lkp_t marlin_ambient_presence_info[] = { - { -1, "unknown", NULL, NULL }, - { 0, "no", NULL, NULL }, /* disconnected */ - { 1, "yes", NULL, NULL }, /* connected */ - { 0, NULL, NULL, NULL } + info_lkp_default(-1, "unknown"), + info_lkp_default(0, "no"), /* disconnected */ + info_lkp_default(1, "yes"), /* connected */ + info_lkp_sentinel }; static info_lkp_t marlin_emp002_ambient_presence_info[] = { - { 0, "unknown", NULL, NULL }, - { 2, "yes", NULL, NULL }, /* communicationOK */ - { 3, "no", NULL, NULL }, /* communicationLost */ - { 0, NULL, NULL, NULL } + info_lkp_default(0, "unknown"), + info_lkp_default(2, "yes"), /* communicationOK */ + info_lkp_default(3, "no"), /* communicationLost */ + info_lkp_sentinel }; static info_lkp_t marlin_threshold_status_info[] = { - { 0, "good", NULL, NULL }, /* No threshold triggered */ - { 1, "warning-low", NULL, NULL }, /* Warning low threshold triggered */ - { 2, "critical-low", NULL, NULL }, /* Critical low threshold triggered */ - { 3, "warning-high", NULL, NULL }, /* Warning high threshold triggered */ - { 4, "critical-high", NULL, NULL }, /* Critical high threshold triggered */ - { 0, NULL, NULL, NULL } + info_lkp_default(0, "good"), /* No threshold triggered */ + info_lkp_default(1, "warning-low"), /* Warning low threshold triggered */ + info_lkp_default(2, "critical-low"), /* Critical low threshold triggered */ + info_lkp_default(3, "warning-high"), /* Warning high threshold triggered */ + info_lkp_default(4, "critical-high"), /* Critical high threshold triggered */ + info_lkp_sentinel }; static info_lkp_t marlin_threshold_frequency_status_info[] = { - { 0, "good", NULL, NULL }, /* No threshold triggered */ - { 1, "out-of-range", NULL, NULL }, /* Frequency out of range triggered */ - { 0, NULL, NULL, NULL } + info_lkp_default(0, "good"), /* No threshold triggered */ + info_lkp_default(1, "out-of-range"), /* Frequency out of range triggered */ + info_lkp_sentinel }; static info_lkp_t marlin_ambient_drycontacts_info[] = { - { -1, "unknown", NULL, NULL }, - { 0, "opened", NULL, NULL }, - { 1, "closed", NULL, NULL }, - { 0, NULL, NULL, NULL } + info_lkp_default(-1, "unknown"), + info_lkp_default(0, "opened"), + info_lkp_default(1, "closed"), + info_lkp_sentinel }; static info_lkp_t marlin_threshold_voltage_alarms_info[] = { - { 0, "", NULL, NULL }, /* No threshold triggered */ - { 1, "low voltage warning!", NULL, NULL }, /* Warning low threshold triggered */ - { 2, "low voltage critical!", NULL, NULL }, /* Critical low threshold triggered */ - { 3, "high voltage warning!", NULL, NULL }, /* Warning high threshold triggered */ - { 4, "high voltage critical!", NULL, NULL }, /* Critical high threshold triggered */ - { 0, NULL, NULL, NULL } + info_lkp_default(0, ""), /* No threshold triggered */ + info_lkp_default(1, "low voltage warning!"), /* Warning low threshold triggered */ + info_lkp_default(2, "low voltage critical!"), /* Critical low threshold triggered */ + info_lkp_default(3, "high voltage warning!"), /* Warning high threshold triggered */ + info_lkp_default(4, "high voltage critical!"), /* Critical high threshold triggered */ + info_lkp_sentinel }; static info_lkp_t marlin_threshold_current_alarms_info[] = { - { 0, "", NULL, NULL }, /* No threshold triggered */ - { 1, "low current warning!", NULL, NULL }, /* Warning low threshold triggered */ - { 2, "low current critical!", NULL, NULL }, /* Critical low threshold triggered */ - { 3, "high current warning!", NULL, NULL }, /* Warning high threshold triggered */ - { 4, "high current critical!", NULL, NULL }, /* Critical high threshold triggered */ - { 0, NULL, NULL, NULL } + info_lkp_default(0, ""), /* No threshold triggered */ + info_lkp_default(1, "low current warning!"), /* Warning low threshold triggered */ + info_lkp_default(2, "low current critical!"), /* Critical low threshold triggered */ + info_lkp_default(3, "high current warning!"), /* Warning high threshold triggered */ + info_lkp_default(4, "high current critical!"), /* Critical high threshold triggered */ + info_lkp_sentinel }; static info_lkp_t marlin_threshold_frequency_alarm_info[] = { - { 0, "", NULL, NULL }, /* No threshold triggered */ - { 1, "frequency out of range!", NULL, NULL }, /* Frequency out of range triggered */ - { 0, NULL, NULL, NULL } + info_lkp_default(0, ""), /* No threshold triggered */ + info_lkp_default(1, "frequency out of range!"), /* Frequency out of range triggered */ + info_lkp_sentinel }; static info_lkp_t marlin_threshold_temperature_alarms_info[] = { - { 0, "", NULL, NULL }, /* No threshold triggered */ - { 1, "low temperature warning!", NULL, NULL }, /* Warning low threshold triggered */ - { 2, "low temperature critical!", NULL, NULL }, /* Critical low threshold triggered */ - { 3, "high temperature warning!", NULL, NULL }, /* Warning high threshold triggered */ - { 4, "high temperature critical!", NULL, NULL }, /* Critical high threshold triggered */ - { 0, NULL, NULL, NULL } + info_lkp_default(0, ""), /* No threshold triggered */ + info_lkp_default(1, "low temperature warning!"), /* Warning low threshold triggered */ + info_lkp_default(2, "low temperature critical!"), /* Critical low threshold triggered */ + info_lkp_default(3, "high temperature warning!"), /* Warning high threshold triggered */ + info_lkp_default(4, "high temperature critical!"), /* Critical high threshold triggered */ + info_lkp_sentinel }; static info_lkp_t marlin_threshold_humidity_alarms_info[] = { - { 0, "", NULL, NULL }, /* No threshold triggered */ - { 1, "low humidity warning!", NULL, NULL }, /* Warning low threshold triggered */ - { 2, "low humidity critical!", NULL, NULL }, /* Critical low threshold triggered */ - { 3, "high humidity warning!", NULL, NULL }, /* Warning high threshold triggered */ - { 4, "high humidity critical!", NULL, NULL }, /* Critical high threshold triggered */ - { 0, NULL, NULL, NULL } + info_lkp_default(0, ""), /* No threshold triggered */ + info_lkp_default(1, "low humidity warning!"), /* Warning low threshold triggered */ + info_lkp_default(2, "low humidity critical!"), /* Critical low threshold triggered */ + info_lkp_default(3, "high humidity warning!"), /* Warning high threshold triggered */ + info_lkp_default(4, "high humidity critical!"), /* Critical high threshold triggered */ + info_lkp_sentinel }; static info_lkp_t marlin_outlet_group_type_info[] = { - { 0, "unknown", NULL, NULL }, - { 1, "breaker1pole", NULL, NULL }, - { 2, "breaker2pole", NULL, NULL }, - { 3, "breaker3pole", NULL, NULL }, - { 4, "outlet-section", NULL, NULL }, - { 5, "user-defined", NULL, NULL }, - { 0, NULL, NULL, NULL } + info_lkp_default(0, "unknown"), + info_lkp_default(1, "breaker1pole"), + info_lkp_default(2, "breaker2pole"), + info_lkp_default(3, "breaker3pole"), + info_lkp_default(4, "outlet-section"), + info_lkp_default(5, "user-defined"), + info_lkp_sentinel }; static info_lkp_t marlin_input_type_info[] = { - { 1, "1", NULL, NULL }, /* singlePhase */ - { 2, "2", NULL, NULL }, /* splitPhase */ - { 3, "3", NULL, NULL }, /* threePhaseDelta */ - { 4, "3", NULL, NULL }, /* threePhaseWye */ - { 0, NULL, NULL, NULL } + info_lkp_default(1, "1"), /* singlePhase */ + info_lkp_default(2, "2"), /* splitPhase */ + info_lkp_default(3, "3"), /* threePhaseDelta */ + info_lkp_default(4, "3"), /* threePhaseWye */ + info_lkp_sentinel }; static info_lkp_t marlin_outlet_group_phase_info[] = { - { 0, "unknown", NULL, NULL }, /* unknown */ - { 1, "1", NULL, NULL }, /* singlePhase */ - { 2, "1-N", NULL, NULL }, /* phase1toN */ - { 3, "2-N", NULL, NULL }, /* phase2toN */ - { 4, "3-N", NULL, NULL }, /* phase3toN */ - { 5, "1-2", NULL, NULL }, /* phase1to2 */ - { 6, "2-3", NULL, NULL }, /* phase2to3 */ - { 7, "3-1", NULL, NULL }, /* phase3to1 */ - { 0, NULL, NULL, NULL } + info_lkp_default(0, "unknown"), /* unknown */ + info_lkp_default(1, "1"), /* singlePhase */ + info_lkp_default(2, "1-N"), /* phase1toN */ + info_lkp_default(3, "2-N"), /* phase2toN */ + info_lkp_default(4, "3-N"), /* phase3toN */ + info_lkp_default(5, "1-2"), /* phase1to2 */ + info_lkp_default(6, "2-3"), /* phase2to3 */ + info_lkp_default(7, "3-1"), /* phase3to1 */ + info_lkp_sentinel }; #if WITH_SNMP_LKP_FUN @@ -219,7 +219,7 @@ static info_lkp_t marlin_outlet_group_phase_info[] = { * Future work for DMF might provide same-named routines via LUA-C gateway. */ -#if WITH_SNMP_LKP_FUN_DUMMY +# if WITH_SNMP_LKP_FUN_DUMMY /* Temperature unit consideration */ const char *eaton_sensor_temperature_unit_fun(void *raw_snmp_value) { /* snmp_value here would be a (long*) */ @@ -232,43 +232,43 @@ const char *su_temperature_read_fun(void *raw_snmp_value) { NUT_UNUSED_VARIABLE(raw_snmp_value); return "dummy"; } -#endif // WITH_SNMP_LKP_FUN_DUMMY +# endif /* WITH_SNMP_LKP_FUN_DUMMY */ static info_lkp_t eaton_sensor_temperature_unit_info[] = { - { 0, "dummy", eaton_sensor_temperature_unit_fun, NULL }, - { 0, NULL, NULL, NULL } + info_lkp_fun_vp2s(0, "dummy", eaton_sensor_temperature_unit_fun), + info_lkp_sentinel }; static info_lkp_t eaton_sensor_temperature_read_info[] = { - { 0, "dummy", su_temperature_read_fun, NULL }, - { 0, NULL, NULL, NULL } + info_lkp_fun_vp2s(0, "dummy", su_temperature_read_fun), + info_lkp_sentinel }; -#else // if not WITH_SNMP_LKP_FUN: +#else /* if not WITH_SNMP_LKP_FUN: */ /* FIXME: For now, DMF codebase falls back to old implementation with static * lookup/mapping tables for this, which can easily go into the DMF XML file. */ static info_lkp_t eaton_sensor_temperature_unit_info[] = { - { 0, "kelvin", NULL, NULL }, - { 1, "celsius", NULL, NULL }, - { 2, "fahrenheit", NULL, NULL }, - { 0, NULL, NULL, NULL } + info_lkp_default(0, "kelvin"), + info_lkp_default(1, "celsius"), + info_lkp_default(2, "fahrenheit"), + info_lkp_sentinel }; -#endif // WITH_SNMP_LKP_FUN +#endif /* WITH_SNMP_LKP_FUN */ /* Extracted from powerware-mib.c ; try to commonalize */ static info_lkp_t marlin_ambient_drycontacts_polarity_info[] = { - { 0, "normal-opened", NULL, NULL }, - { 1, "normal-closed", NULL, NULL }, - { 0, NULL, NULL, NULL } + info_lkp_default(0, "normal-opened"), + info_lkp_default(1, "normal-closed"), + info_lkp_sentinel }; static info_lkp_t marlin_ambient_drycontacts_state_info[] = { - { 0, "inactive", NULL, NULL }, - { 1, "active", NULL, NULL }, - { 0, NULL, NULL, NULL } + info_lkp_default(0, "inactive"), + info_lkp_default(1, "active"), + info_lkp_sentinel }; #if WITH_SNMP_LKP_FUN @@ -277,13 +277,16 @@ static info_lkp_t marlin_ambient_drycontacts_state_info[] = { */ # if WITH_SNMP_LKP_FUN_DUMMY -long marlin_device_count_fun(const char *daisy_dev_list) - { return 1; } +long marlin_device_count_fun(const char *daisy_dev_list) { + NUT_UNUSED_VARIABLE(daisy_dev_list); + return 1; +} # endif /* WITH_SNMP_LKP_FUN_DUMMY */ static info_lkp_t marlin_device_count_info[] = { - { 1, "dummy", NULL, marlin_device_count_fun }, - { 0, NULL, NULL, NULL } + /* TOTHINK: DMF branch used info_lkp_fun_s2l()? */ + info_lkp_nuf_s2l(1, "dummy", marlin_device_count_fun), + info_lkp_sentinel }; #else /* if not WITH_SNMP_LKP_FUN: */ @@ -299,36 +302,36 @@ static info_lkp_t marlin_device_count_info[] = { static snmp_info_t eaton_marlin_mib[] = { /* standard MIB items */ - { "device.description", ST_FLAG_STRING | ST_FLAG_RW, SU_INFOSIZE, + snmp_info_default("device.description", ST_FLAG_STRING | ST_FLAG_RW, SU_INFOSIZE, ".1.3.6.1.2.1.1.1.0", - NULL, SU_FLAG_OK, NULL }, - { "device.contact", ST_FLAG_STRING | ST_FLAG_RW, SU_INFOSIZE, + NULL, SU_FLAG_OK, NULL), + snmp_info_default("device.contact", ST_FLAG_STRING | ST_FLAG_RW, SU_INFOSIZE, ".1.3.6.1.2.1.1.4.0", - NULL, SU_FLAG_OK, NULL }, - { "device.location", ST_FLAG_STRING | ST_FLAG_RW, SU_INFOSIZE, + NULL, SU_FLAG_OK, NULL), + snmp_info_default("device.location", ST_FLAG_STRING | ST_FLAG_RW, SU_INFOSIZE, ".1.3.6.1.2.1.1.6.0", - NULL, SU_FLAG_OK, NULL }, + NULL, SU_FLAG_OK, NULL), /* Device collection */ - { "device.mfr", ST_FLAG_STRING, SU_INFOSIZE, + snmp_info_default("device.mfr", ST_FLAG_STRING, SU_INFOSIZE, NULL, - "EATON", SU_FLAG_STATIC | SU_FLAG_ABSENT | SU_FLAG_OK, NULL }, - { "device.model", ST_FLAG_STRING, SU_INFOSIZE, + "EATON", SU_FLAG_STATIC | SU_FLAG_ABSENT | SU_FLAG_OK, NULL), + snmp_info_default("device.model", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.6.6.7.1.2.1.2.%i", - "Eaton Powerware ePDU", SU_FLAG_STATIC | SU_FLAG_OK, NULL }, - { "device.serial", ST_FLAG_STRING, SU_INFOSIZE, + "Eaton Powerware ePDU", SU_FLAG_STATIC | SU_FLAG_OK, NULL), + snmp_info_default("device.serial", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.6.6.7.1.2.1.4.%i", - "", SU_FLAG_STATIC | SU_FLAG_OK, NULL }, - { "device.type", ST_FLAG_STRING, SU_INFOSIZE, + "", SU_FLAG_STATIC | SU_FLAG_OK, NULL), + snmp_info_default("device.type", ST_FLAG_STRING, SU_INFOSIZE, NULL, - "pdu", SU_FLAG_STATIC | SU_FLAG_ABSENT | SU_FLAG_OK, NULL }, - { "device.part", ST_FLAG_STRING, SU_INFOSIZE, + "pdu", SU_FLAG_STATIC | SU_FLAG_ABSENT | SU_FLAG_OK, NULL), + snmp_info_default("device.part", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.6.6.7.1.2.1.3.%i", - "", SU_FLAG_STATIC | SU_FLAG_OK, NULL }, + "", SU_FLAG_STATIC | SU_FLAG_OK, NULL), /* For daisychain, there is only 1 physical interface! */ - { "device.macaddr", ST_FLAG_STRING, SU_INFOSIZE, + snmp_info_default("device.macaddr", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.2.1.2.2.1.6.2", - "", SU_FLAG_STATIC | SU_FLAG_OK, NULL }, + "", SU_FLAG_STATIC | SU_FLAG_OK, NULL), /* Daisychained devices support */ /* FIXME : Should this be a static value, or can we expect the amount of @@ -343,52 +346,57 @@ static snmp_info_t eaton_marlin_mib[] = { * Take string "unitsPresent" (ex: "0,3,4,5"), and count the amount * of "," separators+1 using an inline function */ /* FIXME: inline func */ - { "device.count", 0, 1, + snmp_info_default("device.count", 0, 1, ".1.3.6.1.4.1.534.6.6.7.1.1.0", "0", SU_FLAG_STATIC | SU_FLAG_UNIQUE, - &marlin_device_count_info[0] /* devices_count */ }, + &marlin_device_count_info[0] /* devices_count */), #endif + /* Notes: this older/fallback definition is used to: * - estimate the number of devices, based on the below OID iteration capabilities * - determine the base index of the SNMP OID (ie 0 or 1) */ - { "device.count", 0, 1, - ".1.3.6.1.4.1.534.6.6.7.1.2.1.2.%i", - "1", SU_FLAG_STATIC #if WITH_SNMP_LKP_FUN - | SU_FLAG_UNIQUE + snmp_info_default("device.count", 0, 1, + ".1.3.6.1.4.1.534.6.6.7.1.2.1.2.%i", + "1", SU_FLAG_STATIC, + NULL /* devices_count */), +#else + snmp_info_default("device.count", 0, 1, + ".1.3.6.1.4.1.534.6.6.7.1.2.1.2.%i", + "1", SU_FLAG_STATIC | SU_FLAG_UNIQUE, + NULL /* devices_count */), #endif - , NULL /* devices_count */ }, /* UPS collection */ - { "ups.mfr", ST_FLAG_STRING, SU_INFOSIZE, + snmp_info_default("ups.mfr", ST_FLAG_STRING, SU_INFOSIZE, NULL, - "EATON", SU_FLAG_STATIC | SU_FLAG_ABSENT | SU_FLAG_OK, NULL }, - { "ups.model", ST_FLAG_STRING, SU_INFOSIZE, + "EATON", SU_FLAG_STATIC | SU_FLAG_ABSENT | SU_FLAG_OK, NULL), + snmp_info_default("ups.model", ST_FLAG_STRING, SU_INFOSIZE, "1.3.6.1.4.1.534.6.6.7.1.2.1.2.%i", - "Eaton Powerware ePDU", SU_FLAG_STATIC | SU_FLAG_OK, NULL }, + "Eaton Powerware ePDU", SU_FLAG_STATIC | SU_FLAG_OK, NULL), /* FIXME: use unitName.0 (ePDU)? - * { "ups.id", ST_FLAG_STRING, SU_INFOSIZE, AR_OID_DEVICE_NAME, - "unknown", SU_FLAG_STATIC | SU_FLAG_OK, NULL }, */ - { "ups.serial", ST_FLAG_STRING, SU_INFOSIZE, + * snmp_info_default("ups.id", ST_FLAG_STRING, SU_INFOSIZE, AR_OID_DEVICE_NAME, + "unknown", SU_FLAG_STATIC | SU_FLAG_OK, NULL), */ + snmp_info_default("ups.serial", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.6.6.7.1.2.1.4.%i", - "", SU_FLAG_STATIC | SU_FLAG_OK, NULL }, + "", SU_FLAG_STATIC | SU_FLAG_OK, NULL), /* FIXME: this entry should be SU_FLAG_SEMI_STATIC */ - { "ups.firmware", ST_FLAG_STRING, SU_INFOSIZE, + snmp_info_default("ups.firmware", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.6.6.7.1.2.1.5.%i", - "", SU_FLAG_OK, NULL }, - { "ups.type", ST_FLAG_STRING, SU_INFOSIZE, + "", SU_FLAG_OK, NULL), + snmp_info_default("ups.type", ST_FLAG_STRING, SU_INFOSIZE, NULL, - "pdu", SU_FLAG_STATIC | SU_FLAG_ABSENT | SU_FLAG_OK, NULL }, + "pdu", SU_FLAG_STATIC | SU_FLAG_ABSENT | SU_FLAG_OK, NULL), /* FIXME: needs a date reformatting callback * 2011-8-29,16:27:25.0,+1:0 * Hex-STRING: 07 DB 08 1D 10 0C 36 00 2B 01 00 00 - * { "ups.date", ST_FLAG_STRING, SU_INFOSIZE, + * snmp_info_default("ups.date", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.6.6.7.1.2.1.8.0", - "", SU_FLAG_STATIC | SU_FLAG_OK, NULL }, - * { "ups.time", ST_FLAG_STRING, SU_INFOSIZE, + "", SU_FLAG_STATIC | SU_FLAG_OK, NULL), + * snmp_info_default("ups.time", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.6.6.7.1.2.1.8.0", - "", SU_FLAG_STATIC | SU_FLAG_OK, NULL }, + "", SU_FLAG_STATIC | SU_FLAG_OK, NULL), */ /* Input collection */ @@ -405,48 +413,48 @@ static snmp_info_t eaton_marlin_mib[] = { */ /* Note: the below gives the number of input, not the number of phase(s)! */ /* inputCount.0; Value (Integer): 1 - { "input.count", 0, 1, + snmp_info_default("input.count", 0, 1, ".1.3.6.1.4.1.534.6.6.7.1.2.1.20.0", - NULL, SU_FLAG_STATIC, NULL }, */ + NULL, SU_FLAG_STATIC, NULL), */ /* Note: for daisychain mode, we must handle phase(s) per device, * not as a whole. In case of daisychain, support of the UNIQUE * field is not yet implemented (FIXME) so the last resolved OID * value wins. If a more-preferable OID is not implemented by device, * this is ok - the previous available value remains in place. */ /* inputType.%i.1 = INTEGER: singlePhase (1) */ - { "input.phases", 0, 1, + snmp_info_default("input.phases", 0, 1, ".1.3.6.1.4.1.534.6.6.7.3.1.1.2.%i.1", NULL, SU_FLAG_STATIC, - &marlin_input_type_info[0] }, + &marlin_input_type_info[0]), /* Frequency is measured globally */ - { "input.frequency", 0, 0.1, + snmp_info_default("input.frequency", 0, 0.1, ".1.3.6.1.4.1.534.6.6.7.3.1.1.3.%i.1", - NULL, 0, NULL }, - { "input.frequency.status", ST_FLAG_STRING, SU_INFOSIZE, + NULL, 0, NULL), + snmp_info_default("input.frequency.status", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.6.6.7.3.1.1.4.%i.1", NULL, SU_FLAG_OK, - &marlin_threshold_frequency_status_info[0] }, - { "ups.alarm", ST_FLAG_STRING, SU_INFOSIZE, + &marlin_threshold_frequency_status_info[0]), + snmp_info_default("ups.alarm", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.6.6.7.3.1.1.4.%i.1", NULL, SU_FLAG_OK, - &marlin_threshold_frequency_alarm_info[0] }, + &marlin_threshold_frequency_alarm_info[0]), /* inputCurrentPercentLoad (measured globally) * Current percent load, based on the rated current capacity */ /* FIXME: input.load is mapped on input.L1.load for both single and 3phase !!! */ - { "input.load", 0, 1.0, + snmp_info_default("input.load", 0, 1.0, ".1.3.6.1.4.1.534.6.6.7.3.3.1.11.%i.1.1", - NULL, SU_FLAG_NEGINVALID | SU_FLAG_OK, NULL }, - { "input.L1.load", 0, 1.0, + NULL, SU_FLAG_NEGINVALID | SU_FLAG_OK, NULL), + snmp_info_default("input.L1.load", 0, 1.0, ".1.3.6.1.4.1.534.6.6.7.3.3.1.11.%i.1.1", - NULL, SU_FLAG_NEGINVALID | SU_FLAG_OK, NULL }, - { "input.L2.load", 0, 1.0, + NULL, SU_FLAG_NEGINVALID | SU_FLAG_OK, NULL), + snmp_info_default("input.L2.load", 0, 1.0, ".1.3.6.1.4.1.534.6.6.7.3.3.1.11.%i.1.2", - NULL, SU_FLAG_NEGINVALID | SU_FLAG_OK, NULL }, - { "input.L3.load", 0, 1.0, + NULL, SU_FLAG_NEGINVALID | SU_FLAG_OK, NULL), + snmp_info_default("input.L3.load", 0, 1.0, ".1.3.6.1.4.1.534.6.6.7.3.3.1.11.%i.1.3", - NULL, SU_FLAG_NEGINVALID | SU_FLAG_OK, NULL }, + NULL, SU_FLAG_NEGINVALID | SU_FLAG_OK, NULL), /* FIXME: * - Voltage is only measured per phase, as mV! @@ -456,538 +464,542 @@ static snmp_info_t eaton_marlin_mib[] = { * This is depending on OID inputVoltageMeasType * INTEGER {singlePhase (1),phase1toN (2),phase2toN (3),phase3toN (4),phase1to2 (5),phase2to3 (6),phase3to1 (7) * => RFC input.Lx.voltage.context */ - { "input.voltage", 0, 0.001, + snmp_info_default("input.voltage", 0, 0.001, ".1.3.6.1.4.1.534.6.6.7.3.2.1.3.%i.1.1", - NULL, 0, NULL }, - { "input.voltage.status", ST_FLAG_STRING, SU_INFOSIZE, + NULL, 0, NULL), + snmp_info_default("input.voltage.status", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.6.6.7.3.2.1.4.%i.1.1", NULL, SU_FLAG_OK, - &marlin_threshold_status_info[0] }, - { "ups.alarm", ST_FLAG_STRING, SU_INFOSIZE, + &marlin_threshold_status_info[0]), + snmp_info_default("ups.alarm", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.6.6.7.3.2.1.4.%i.1.1", NULL, SU_FLAG_OK, - &marlin_threshold_voltage_alarms_info[0] }, - { "input.voltage.low.warning", ST_FLAG_RW, 0.001, + &marlin_threshold_voltage_alarms_info[0]), + snmp_info_default("input.voltage.low.warning", ST_FLAG_RW, 0.001, ".1.3.6.1.4.1.534.6.6.7.3.2.1.5.%i.1.1", - NULL, SU_FLAG_NEGINVALID, NULL }, - { "input.voltage.low.critical", ST_FLAG_RW, 0.001, + NULL, SU_FLAG_NEGINVALID, NULL), + snmp_info_default("input.voltage.low.critical", ST_FLAG_RW, 0.001, ".1.3.6.1.4.1.534.6.6.7.3.2.1.6.%i.1.1", - NULL, SU_FLAG_NEGINVALID, NULL }, - { "input.voltage.high.warning", ST_FLAG_RW, 0.001, + NULL, SU_FLAG_NEGINVALID, NULL), + snmp_info_default("input.voltage.high.warning", ST_FLAG_RW, 0.001, ".1.3.6.1.4.1.534.6.6.7.3.2.1.7.%i.1.1", - NULL, SU_FLAG_NEGINVALID, NULL }, - { "input.voltage.high.critical", ST_FLAG_RW, 0.001, + NULL, SU_FLAG_NEGINVALID, NULL), + snmp_info_default("input.voltage.high.critical", ST_FLAG_RW, 0.001, ".1.3.6.1.4.1.534.6.6.7.3.2.1.8.%i.1.1", - NULL, SU_FLAG_NEGINVALID, NULL }, - { "input.L1.voltage", 0, 0.001, + NULL, SU_FLAG_NEGINVALID, NULL), + snmp_info_default("input.L1.voltage", 0, 0.001, ".1.3.6.1.4.1.534.6.6.7.3.2.1.3.%i.1.1", - NULL, 0, NULL }, - { "input.L1.voltage.status", ST_FLAG_STRING, SU_INFOSIZE, + NULL, 0, NULL), + snmp_info_default("input.L1.voltage.status", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.6.6.7.3.2.1.4.%i.1.1", NULL, SU_FLAG_OK, - &marlin_threshold_status_info[0] }, - { "L1.alarm", ST_FLAG_STRING, SU_INFOSIZE, + &marlin_threshold_status_info[0]), + snmp_info_default("L1.alarm", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.6.6.7.3.2.1.4.%i.1.1", NULL, SU_FLAG_OK, - &marlin_threshold_voltage_alarms_info[0] }, - { "input.L1.voltage.low.warning", ST_FLAG_RW, 0.001, + &marlin_threshold_voltage_alarms_info[0]), + snmp_info_default("input.L1.voltage.low.warning", ST_FLAG_RW, 0.001, ".1.3.6.1.4.1.534.6.6.7.3.2.1.5.%i.1.1", - NULL, SU_FLAG_NEGINVALID, NULL }, - { "input.L1.voltage.low.critical", ST_FLAG_RW, 0.001, + NULL, SU_FLAG_NEGINVALID, NULL), + snmp_info_default("input.L1.voltage.low.critical", ST_FLAG_RW, 0.001, ".1.3.6.1.4.1.534.6.6.7.3.2.1.6.%i.1.1", - NULL, SU_FLAG_NEGINVALID, NULL }, - { "input.L1.voltage.high.warning", ST_FLAG_RW, 0.001, + NULL, SU_FLAG_NEGINVALID, NULL), + snmp_info_default("input.L1.voltage.high.warning", ST_FLAG_RW, 0.001, ".1.3.6.1.4.1.534.6.6.7.3.2.1.7.%i.1.1", - NULL, SU_FLAG_NEGINVALID, NULL }, - { "input.L1.voltage.high.critical", ST_FLAG_RW, 0.001, + NULL, SU_FLAG_NEGINVALID, NULL), + snmp_info_default("input.L1.voltage.high.critical", ST_FLAG_RW, 0.001, ".1.3.6.1.4.1.534.6.6.7.3.2.1.8.%i.1.1", - NULL, SU_FLAG_NEGINVALID, NULL }, - { "input.L2.voltage", 0, 0.001, + NULL, SU_FLAG_NEGINVALID, NULL), + snmp_info_default("input.L2.voltage", 0, 0.001, ".1.3.6.1.4.1.534.6.6.7.3.2.1.3.%i.1.2", - NULL, 0, NULL }, - { "input.L2.voltage.status", ST_FLAG_STRING, SU_INFOSIZE, + NULL, 0, NULL), + snmp_info_default("input.L2.voltage.status", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.6.6.7.3.2.1.4.%i.1.2", NULL, SU_FLAG_OK, - &marlin_threshold_status_info[0] }, - { "L2.alarm", ST_FLAG_STRING, SU_INFOSIZE, + &marlin_threshold_status_info[0]), + snmp_info_default("L2.alarm", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.6.6.7.3.2.1.4.%i.1.2", NULL, SU_FLAG_OK, - &marlin_threshold_voltage_alarms_info[0] }, - { "input.L2.voltage.low.warning", ST_FLAG_RW, 0.001, + &marlin_threshold_voltage_alarms_info[0]), + snmp_info_default("input.L2.voltage.low.warning", ST_FLAG_RW, 0.001, ".1.3.6.1.4.1.534.6.6.7.3.2.1.5.%i.1.2", - NULL, SU_FLAG_NEGINVALID, NULL }, - { "input.L2.voltage.low.critical", ST_FLAG_RW, 0.001, + NULL, SU_FLAG_NEGINVALID, NULL), + snmp_info_default("input.L2.voltage.low.critical", ST_FLAG_RW, 0.001, ".1.3.6.1.4.1.534.6.6.7.3.2.1.6.%i.1.2", - NULL, SU_FLAG_NEGINVALID, NULL }, - { "input.L2.voltage.high.warning", ST_FLAG_RW, 0.001, + NULL, SU_FLAG_NEGINVALID, NULL), + snmp_info_default("input.L2.voltage.high.warning", ST_FLAG_RW, 0.001, ".1.3.6.1.4.1.534.6.6.7.3.2.1.7.%i.1.2", - NULL, SU_FLAG_NEGINVALID, NULL }, - { "input.L2.voltage.high.critical", ST_FLAG_RW, 0.001, + NULL, SU_FLAG_NEGINVALID, NULL), + snmp_info_default("input.L2.voltage.high.critical", ST_FLAG_RW, 0.001, ".1.3.6.1.4.1.534.6.6.7.3.2.1.8.%i.1.2", - NULL, SU_FLAG_NEGINVALID, NULL }, - { "input.L3.voltage", 0, 0.001, + NULL, SU_FLAG_NEGINVALID, NULL), + snmp_info_default("input.L3.voltage", 0, 0.001, ".1.3.6.1.4.1.534.6.6.7.3.2.1.3.%i.1.3", - NULL, 0, NULL }, - { "input.L3.voltage.status", ST_FLAG_STRING, SU_INFOSIZE, + NULL, 0, NULL), + snmp_info_default("input.L3.voltage.status", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.6.6.7.3.2.1.4.%i.1.3", NULL, SU_FLAG_OK, - &marlin_threshold_status_info[0] }, - { "L3.alarm", ST_FLAG_STRING, SU_INFOSIZE, + &marlin_threshold_status_info[0]), + snmp_info_default("L3.alarm", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.6.6.7.3.2.1.4.%i.1.3", NULL, SU_FLAG_OK, - &marlin_threshold_voltage_alarms_info[0] }, - { "input.L3.voltage.low.warning", ST_FLAG_RW, 0.001, + &marlin_threshold_voltage_alarms_info[0]), + snmp_info_default("input.L3.voltage.low.warning", ST_FLAG_RW, 0.001, ".1.3.6.1.4.1.534.6.6.7.3.2.1.5.%i.1.3", - NULL, SU_FLAG_NEGINVALID, NULL }, - { "input.L3.voltage.low.critical", ST_FLAG_RW, 0.001, + NULL, SU_FLAG_NEGINVALID, NULL), + snmp_info_default("input.L3.voltage.low.critical", ST_FLAG_RW, 0.001, ".1.3.6.1.4.1.534.6.6.7.3.2.1.6.%i.1.3", - NULL, SU_FLAG_NEGINVALID, NULL }, - { "input.L3.voltage.high.warning", ST_FLAG_RW, 0.001, + NULL, SU_FLAG_NEGINVALID, NULL), + snmp_info_default("input.L3.voltage.high.warning", ST_FLAG_RW, 0.001, ".1.3.6.1.4.1.534.6.6.7.3.2.1.7.%i.1.3", - NULL, SU_FLAG_NEGINVALID, NULL }, - { "input.L3.voltage.high.critical", ST_FLAG_RW, 0.001, + NULL, SU_FLAG_NEGINVALID, NULL), + snmp_info_default("input.L3.voltage.high.critical", ST_FLAG_RW, 0.001, ".1.3.6.1.4.1.534.6.6.7.3.2.1.8.%i.1.3", - NULL, SU_FLAG_NEGINVALID, NULL }, + NULL, SU_FLAG_NEGINVALID, NULL), /* FIXME: * - input.current is mapped on input.L1.current for both single and 3phase !!! */ - { "input.current", 0, 0.001, + snmp_info_default("input.current", 0, 0.001, ".1.3.6.1.4.1.534.6.6.7.3.3.1.4.%i.1.1", - NULL, 0, NULL }, - { "input.current.nominal", 0, 0.001, + NULL, 0, NULL), + snmp_info_default("input.current.nominal", 0, 0.001, ".1.3.6.1.4.1.534.6.6.7.3.3.1.3.%i.1.1", - NULL, 0, NULL }, - { "input.current.status", ST_FLAG_STRING, SU_INFOSIZE, + NULL, 0, NULL), + snmp_info_default("input.current.status", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.6.6.7.3.3.1.5.%i.1.1", NULL, SU_FLAG_OK, - &marlin_threshold_status_info[0] }, - { "ups.alarm", ST_FLAG_STRING, SU_INFOSIZE, + &marlin_threshold_status_info[0]), + snmp_info_default("ups.alarm", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.6.6.7.3.3.1.5.%i.1.1", NULL, SU_FLAG_OK, - &marlin_threshold_current_alarms_info[0] }, - { "input.current.low.warning", ST_FLAG_RW, 0.001, + &marlin_threshold_current_alarms_info[0]), + snmp_info_default("input.current.low.warning", ST_FLAG_RW, 0.001, ".1.3.6.1.4.1.534.6.6.7.3.3.1.6.%i.1.1", - NULL, SU_FLAG_NEGINVALID, NULL }, - { "input.current.low.critical", ST_FLAG_RW, 0.001, + NULL, SU_FLAG_NEGINVALID, NULL), + snmp_info_default("input.current.low.critical", ST_FLAG_RW, 0.001, ".1.3.6.1.4.1.534.6.6.7.3.3.1.7.%i.1.1", - NULL, SU_FLAG_NEGINVALID, NULL }, - { "input.current.high.warning", ST_FLAG_RW, 0.001, + NULL, SU_FLAG_NEGINVALID, NULL), + snmp_info_default("input.current.high.warning", ST_FLAG_RW, 0.001, ".1.3.6.1.4.1.534.6.6.7.3.3.1.8.%i.1.1", - NULL, SU_FLAG_NEGINVALID, NULL }, - { "input.current.high.critical", ST_FLAG_RW, 0.001, + NULL, SU_FLAG_NEGINVALID, NULL), + snmp_info_default("input.current.high.critical", ST_FLAG_RW, 0.001, ".1.3.6.1.4.1.534.6.6.7.3.3.1.9.%i.1.1", - NULL, SU_FLAG_NEGINVALID, NULL }, - { "input.L1.current", 0, 0.001, + NULL, SU_FLAG_NEGINVALID, NULL), + snmp_info_default("input.L1.current", 0, 0.001, ".1.3.6.1.4.1.534.6.6.7.3.3.1.4.0.1.1", - NULL, 0, NULL }, - { "input.L1.current.nominal", 0, 0.001, + NULL, 0, NULL), + snmp_info_default("input.L1.current.nominal", 0, 0.001, ".1.3.6.1.4.1.534.6.6.7.3.3.1.3.%i.1.1", - NULL, 0, NULL }, - { "input.L1.current.status", ST_FLAG_STRING, SU_INFOSIZE, + NULL, 0, NULL), + snmp_info_default("input.L1.current.status", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.6.6.7.3.3.1.5.%i.1.1", NULL, SU_FLAG_OK, - &marlin_threshold_status_info[0] }, - { "L1.alarm", ST_FLAG_STRING, SU_INFOSIZE, + &marlin_threshold_status_info[0]), + snmp_info_default("L1.alarm", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.6.6.7.3.3.1.5.%i.1.1", NULL, SU_FLAG_OK, - &marlin_threshold_current_alarms_info[0] }, - { "input.L1.current.low.warning", ST_FLAG_RW, 0.001, + &marlin_threshold_current_alarms_info[0]), + snmp_info_default("input.L1.current.low.warning", ST_FLAG_RW, 0.001, ".1.3.6.1.4.1.534.6.6.7.3.3.1.6.%i.1.1", - NULL, SU_FLAG_NEGINVALID, NULL }, - { "input.L1.current.low.critical", ST_FLAG_RW, 0.001, + NULL, SU_FLAG_NEGINVALID, NULL), + snmp_info_default("input.L1.current.low.critical", ST_FLAG_RW, 0.001, ".1.3.6.1.4.1.534.6.6.7.3.3.1.7.%i.1.1", - NULL, SU_FLAG_NEGINVALID, NULL }, - { "input.L1.current.high.warning", ST_FLAG_RW, 0.001, + NULL, SU_FLAG_NEGINVALID, NULL), + snmp_info_default("input.L1.current.high.warning", ST_FLAG_RW, 0.001, ".1.3.6.1.4.1.534.6.6.7.3.3.1.8.%i.1.1", - NULL, SU_FLAG_NEGINVALID, NULL }, - { "input.L1.current.high.critical", ST_FLAG_RW, 0.001, + NULL, SU_FLAG_NEGINVALID, NULL), + snmp_info_default("input.L1.current.high.critical", ST_FLAG_RW, 0.001, ".1.3.6.1.4.1.534.6.6.7.3.3.1.9.%i.1.1", - NULL, SU_FLAG_NEGINVALID, NULL }, - { "input.L2.current", 0, 0.001, + NULL, SU_FLAG_NEGINVALID, NULL), + snmp_info_default("input.L2.current", 0, 0.001, ".1.3.6.1.4.1.534.6.6.7.3.3.1.4.%i.1.2", - NULL, 0, NULL }, - { "input.L2.current.nominal", 0, 0.001, + NULL, 0, NULL), + snmp_info_default("input.L2.current.nominal", 0, 0.001, ".1.3.6.1.4.1.534.6.6.7.3.3.1.3.%i.1.2", - NULL, 0, NULL }, - { "input.L2.current.status", ST_FLAG_STRING, SU_INFOSIZE, + NULL, 0, NULL), + snmp_info_default("input.L2.current.status", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.6.6.7.3.3.1.5.%i.1.2", NULL, SU_FLAG_OK, - &marlin_threshold_status_info[0] }, - { "L2.alarm", ST_FLAG_STRING, SU_INFOSIZE, + &marlin_threshold_status_info[0]), + snmp_info_default("L2.alarm", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.6.6.7.3.3.1.5.%i.1.2", NULL, SU_FLAG_OK, - &marlin_threshold_current_alarms_info[0] }, - { "input.L2.current.low.warning", ST_FLAG_RW, 0.001, + &marlin_threshold_current_alarms_info[0]), + snmp_info_default("input.L2.current.low.warning", ST_FLAG_RW, 0.001, ".1.3.6.1.4.1.534.6.6.7.3.3.1.6.%i.1.2", - NULL, SU_FLAG_NEGINVALID, NULL }, - { "input.L2.current.low.critical", ST_FLAG_RW, 0.001, + NULL, SU_FLAG_NEGINVALID, NULL), + snmp_info_default("input.L2.current.low.critical", ST_FLAG_RW, 0.001, ".1.3.6.1.4.1.534.6.6.7.3.3.1.7.%i.1.2", - NULL, SU_FLAG_NEGINVALID, NULL }, - { "input.L2.current.high.warning", ST_FLAG_RW, 0.001, + NULL, SU_FLAG_NEGINVALID, NULL), + snmp_info_default("input.L2.current.high.warning", ST_FLAG_RW, 0.001, ".1.3.6.1.4.1.534.6.6.7.3.3.1.8.%i.1.2", - NULL, SU_FLAG_NEGINVALID, NULL }, - { "input.L2.current.high.critical", ST_FLAG_RW, 0.001, + NULL, SU_FLAG_NEGINVALID, NULL), + snmp_info_default("input.L2.current.high.critical", ST_FLAG_RW, 0.001, ".1.3.6.1.4.1.534.6.6.7.3.3.1.9.%i.1.2", - NULL, SU_FLAG_NEGINVALID, NULL }, - { "input.L3.current", 0, 0.001, + NULL, SU_FLAG_NEGINVALID, NULL), + snmp_info_default("input.L3.current", 0, 0.001, ".1.3.6.1.4.1.534.6.6.7.3.3.1.4.%i.1.3", - NULL, 0, NULL }, - { "input.L3.current.nominal", 0, 0.001, + NULL, 0, NULL), + snmp_info_default("input.L3.current.nominal", 0, 0.001, ".1.3.6.1.4.1.534.6.6.7.3.3.1.3.%i.1.3", - NULL, 0, NULL }, - { "input.L3.current.status", ST_FLAG_STRING, SU_INFOSIZE, + NULL, 0, NULL), + snmp_info_default("input.L3.current.status", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.6.6.7.3.3.1.5.%i.1.3", NULL, SU_FLAG_OK, - &marlin_threshold_status_info[0] }, - { "L3.alarm", ST_FLAG_STRING, SU_INFOSIZE, + &marlin_threshold_status_info[0]), + snmp_info_default("L3.alarm", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.6.6.7.3.3.1.5.%i.1.3", NULL, SU_FLAG_OK, - &marlin_threshold_current_alarms_info[0] }, - { "input.L3.current.low.warning", ST_FLAG_RW, 0.001, + &marlin_threshold_current_alarms_info[0]), + snmp_info_default("input.L3.current.low.warning", ST_FLAG_RW, 0.001, ".1.3.6.1.4.1.534.6.6.7.3.3.1.6.%i.1.3", - NULL, SU_FLAG_NEGINVALID, NULL }, - { "input.L3.current.low.critical", ST_FLAG_RW, 0.001, + NULL, SU_FLAG_NEGINVALID, NULL), + snmp_info_default("input.L3.current.low.critical", ST_FLAG_RW, 0.001, ".1.3.6.1.4.1.534.6.6.7.3.3.1.7.%i.1.3", - NULL, SU_FLAG_NEGINVALID, NULL }, - { "input.L3.current.high.warning", ST_FLAG_RW, 0.001, + NULL, SU_FLAG_NEGINVALID, NULL), + snmp_info_default("input.L3.current.high.warning", ST_FLAG_RW, 0.001, ".1.3.6.1.4.1.534.6.6.7.3.3.1.8.%i.1.3", - NULL, SU_FLAG_NEGINVALID, NULL }, - { "input.L3.current.high.critical", ST_FLAG_RW, 0.001, + NULL, SU_FLAG_NEGINVALID, NULL), + snmp_info_default("input.L3.current.high.critical", ST_FLAG_RW, 0.001, ".1.3.6.1.4.1.534.6.6.7.3.3.1.9.%i.1.3", - NULL, SU_FLAG_NEGINVALID, NULL }, + NULL, SU_FLAG_NEGINVALID, NULL), /* Sum of all phases realpower, valid for Shark 1ph/3ph only */ - { "input.realpower", 0, 1.0, + snmp_info_default("input.realpower", 0, 1.0, ".1.3.6.1.4.1.534.6.6.7.3.5.1.4.%i.1", - NULL, SU_FLAG_NEGINVALID | SU_FLAG_UNIQUE | SU_FLAG_OK, NULL }, + NULL, SU_FLAG_NEGINVALID | SU_FLAG_UNIQUE | SU_FLAG_OK, NULL), /* Fallback 1: Sum of all phases realpower, valid for Marlin 3ph only */ - { "input.realpower", 0, 1.0, + snmp_info_default("input.realpower", 0, 1.0, ".1.3.6.1.4.1.534.6.6.7.3.4.1.4.%i.1.4", - NULL, SU_FLAG_NEGINVALID | SU_FLAG_UNIQUE | SU_FLAG_OK, NULL }, + NULL, SU_FLAG_NEGINVALID | SU_FLAG_UNIQUE | SU_FLAG_OK, NULL), /* Fallback 2: Sum of the phase realpower, valid for Marlin 1ph only */ - { "input.realpower", 0, 1.0, + snmp_info_default("input.realpower", 0, 1.0, ".1.3.6.1.4.1.534.6.6.7.3.4.1.4.%i.1.2", - NULL, SU_FLAG_NEGINVALID | SU_FLAG_OK, NULL }, - { "input.L1.realpower", 0, 1.0, + NULL, SU_FLAG_NEGINVALID | SU_FLAG_OK, NULL), + snmp_info_default("input.L1.realpower", 0, 1.0, ".1.3.6.1.4.1.534.6.6.7.3.4.1.4.%i.1.1", - NULL, SU_FLAG_NEGINVALID | SU_FLAG_OK, NULL }, - { "input.L2.realpower", 0, 1.0, + NULL, SU_FLAG_NEGINVALID | SU_FLAG_OK, NULL), + snmp_info_default("input.L2.realpower", 0, 1.0, ".1.3.6.1.4.1.534.6.6.7.3.4.1.4.%i.1.2", - NULL, SU_FLAG_NEGINVALID | SU_FLAG_OK, NULL }, - { "input.L3.realpower", 0, 1.0, + NULL, SU_FLAG_NEGINVALID | SU_FLAG_OK, NULL), + snmp_info_default("input.L3.realpower", 0, 1.0, ".1.3.6.1.4.1.534.6.6.7.3.4.1.4.%i.1.3", - NULL, SU_FLAG_NEGINVALID | SU_FLAG_OK, NULL }, + NULL, SU_FLAG_NEGINVALID | SU_FLAG_OK, NULL), /* Sum of all phases apparent power, valid for Shark 1ph/3ph only */ - { "input.power", 0, 1.0, + snmp_info_default("input.power", 0, 1.0, ".1.3.6.1.4.1.534.6.6.7.3.5.1.3.%i.1", - NULL, SU_FLAG_NEGINVALID | SU_FLAG_UNIQUE | SU_FLAG_OK, NULL }, + NULL, SU_FLAG_NEGINVALID | SU_FLAG_UNIQUE | SU_FLAG_OK, NULL), /* Fallback 1: Sum of all phases realpower, valid for Marlin 3ph only */ - { "input.power", 0, 1.0, + snmp_info_default("input.power", 0, 1.0, ".1.3.6.1.4.1.534.6.6.7.3.4.1.3.%i.1.4", - NULL, SU_FLAG_NEGINVALID | SU_FLAG_UNIQUE | SU_FLAG_OK, NULL }, + NULL, SU_FLAG_NEGINVALID | SU_FLAG_UNIQUE | SU_FLAG_OK, NULL), /* Fallback 2: Sum of the phase realpower, valid for Marlin 1ph only */ - { "input.power", 0, 1.0, + snmp_info_default("input.power", 0, 1.0, ".1.3.6.1.4.1.534.6.6.7.3.4.1.3.%i.1.2", - NULL, SU_FLAG_NEGINVALID | SU_FLAG_OK, NULL }, - { "input.L1.power", 0, 1.0, + NULL, SU_FLAG_NEGINVALID | SU_FLAG_OK, NULL), + snmp_info_default("input.L1.power", 0, 1.0, ".1.3.6.1.4.1.534.6.6.7.3.4.1.3.%i.1.1", - NULL, SU_FLAG_NEGINVALID | SU_FLAG_OK, NULL }, - { "input.L2.power", 0, 1.0, + NULL, SU_FLAG_NEGINVALID | SU_FLAG_OK, NULL), + snmp_info_default("input.L2.power", 0, 1.0, ".1.3.6.1.4.1.534.6.6.7.3.4.1.3.%i.1.2", - NULL, SU_FLAG_NEGINVALID | SU_FLAG_OK, NULL }, - { "input.L3.power", 0, 1.0, + NULL, SU_FLAG_NEGINVALID | SU_FLAG_OK, NULL), + snmp_info_default("input.L3.power", 0, 1.0, ".1.3.6.1.4.1.534.6.6.7.3.4.1.3.%i.1.3", - NULL, SU_FLAG_NEGINVALID | SU_FLAG_OK, NULL }, + NULL, SU_FLAG_NEGINVALID | SU_FLAG_OK, NULL), /* Input feed: a feed (A or B) is tied to an input, and this * sub-collection describes the properties of an actual cable. */ /* FIXME: RFC on key name is needed when backporting to NUT upstream ; check type (number? string?) and flags */ - /* { "input.feed.%i.id", 0, 1, "???.%i.%i", NULL, SU_FLAG_NEGINVALID, NULL }, */ + /* snmp_info_default("input.feed.%i.id", 0, 1, "???.%i.%i", NULL, SU_FLAG_NEGINVALID, NULL), */ /* Feed name(s) of the ePDU power input(s), can be set by user (FIXME: rename to .desc?) * inputFeedName.0.1 = Value (OctetString): Feed A */ /* FIXME: SU_FLAG_SEMI_STATIC or SU_FLAG_SETTING => refreshed from time to time or upon call to setvar */ /* - { "input.%i.feed.desc", ST_FLAG_RW | ST_FLAG_STRING, SU_INFOSIZE, + snmp_info_default("input.%i.feed.desc", ST_FLAG_RW | ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.6.6.7.3.1.1.10.%i.%i", - NULL, SU_FLAG_SEMI_STATIC | SU_FLAG_OK | SU_TYPE_DAISY_1, NULL }, + NULL, SU_FLAG_SEMI_STATIC | SU_FLAG_OK | SU_TYPE_DAISY_1, NULL), */ - { "input.feed.desc", ST_FLAG_RW | ST_FLAG_STRING, SU_INFOSIZE, + snmp_info_default("input.feed.desc", ST_FLAG_RW | ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.6.6.7.3.1.1.10.%i.1", - NULL, SU_FLAG_SEMI_STATIC | SU_FLAG_OK | SU_TYPE_DAISY_1, NULL }, + NULL, SU_FLAG_SEMI_STATIC | SU_FLAG_OK | SU_TYPE_DAISY_1, NULL), /* Feed color (integer RGB) * inputFeedColor.0.1 = Gauge32: 0 (black) */ /* FIXME: RFC on key name is needed when backporting to NUT upstream */ /* - { "input.%i.feed.color", 0, 1, + snmp_info_default("input.%i.feed.color", 0, 1, ".1.3.6.1.4.1.534.6.6.7.3.1.1.9.%i.%i", - NULL, SU_FLAG_STATIC | SU_FLAG_OK | SU_TYPE_DAISY_1, NULL }, + NULL, SU_FLAG_STATIC | SU_FLAG_OK | SU_TYPE_DAISY_1, NULL), */ - { "input.feed.color", 0, 1, + snmp_info_default("input.feed.color", 0, 1, ".1.3.6.1.4.1.534.6.6.7.3.1.1.9.%i.1", - NULL, SU_FLAG_SEMI_STATIC | SU_FLAG_OK | SU_TYPE_DAISY_1, NULL }, + NULL, SU_FLAG_SEMI_STATIC | SU_FLAG_OK | SU_TYPE_DAISY_1, NULL), /* inputPowerCapacity.0.1 = INTEGER: 2300 */ /* FIXME: RFC on key name is needed when backporting to NUT upstream */ - { "input.realpower.nominal", 0, 1.0, + snmp_info_default("input.realpower.nominal", 0, 1.0, ".1.3.6.1.4.1.534.6.6.7.3.5.1.9.%i.1", - NULL, SU_FLAG_NEGINVALID | SU_FLAG_OK, NULL }, + NULL, SU_FLAG_NEGINVALID | SU_FLAG_OK, NULL), /* Ambient collection */ /* EMP001 (legacy) mapping */ /* Note: this is still published, beside from the new daisychained version! */ - { "ambient.present", ST_FLAG_STRING, SU_INFOSIZE, + snmp_info_default("ambient.present", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.6.6.7.7.1.1.3.%i.1", NULL, SU_FLAG_OK, - &marlin_ambient_presence_info[0] }, - { "ambient.temperature.status", ST_FLAG_STRING, SU_INFOSIZE, + &marlin_ambient_presence_info[0]), + snmp_info_default("ambient.temperature.status", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.6.6.7.7.1.1.5.%i.1", NULL, SU_FLAG_OK, - &marlin_threshold_status_info[0] }, - { "ups.alarm", ST_FLAG_STRING, SU_INFOSIZE, + &marlin_threshold_status_info[0]), + snmp_info_default("ups.alarm", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.6.6.7.7.1.1.5.%i.1", NULL, SU_FLAG_OK, - &marlin_threshold_temperature_alarms_info[0] }, - { "ambient.temperature", 0, 0.1, + &marlin_threshold_temperature_alarms_info[0]), + snmp_info_default("ambient.temperature", 0, 0.1, ".1.3.6.1.4.1.534.6.6.7.7.1.1.4.%i.1", - NULL, SU_FLAG_OK, NULL }, + NULL, SU_FLAG_OK, NULL), /* Low and high threshold use the respective critical levels */ - { "ambient.temperature.low", ST_FLAG_RW, 0.1, + snmp_info_default("ambient.temperature.low", ST_FLAG_RW, 0.1, ".1.3.6.1.4.1.534.6.6.7.7.1.1.7.%i.1", - NULL, SU_FLAG_NEGINVALID | SU_FLAG_OK, NULL }, - { "ambient.temperature.low.critical", ST_FLAG_RW, 0.1, + NULL, SU_FLAG_NEGINVALID | SU_FLAG_OK, NULL), + snmp_info_default("ambient.temperature.low.critical", ST_FLAG_RW, 0.1, ".1.3.6.1.4.1.534.6.6.7.7.1.1.7.%i.1", - NULL, SU_FLAG_NEGINVALID | SU_FLAG_OK, NULL }, - { "ambient.temperature.low.warning", ST_FLAG_RW, 0.1, + NULL, SU_FLAG_NEGINVALID | SU_FLAG_OK, NULL), + snmp_info_default("ambient.temperature.low.warning", ST_FLAG_RW, 0.1, ".1.3.6.1.4.1.534.6.6.7.7.1.1.6.%i.1", - NULL, SU_FLAG_NEGINVALID | SU_FLAG_OK, NULL }, - { "ambient.temperature.high", ST_FLAG_RW, 0.1, + NULL, SU_FLAG_NEGINVALID | SU_FLAG_OK, NULL), + snmp_info_default("ambient.temperature.high", ST_FLAG_RW, 0.1, ".1.3.6.1.4.1.534.6.6.7.7.1.1.9.%i.1", - NULL, SU_FLAG_NEGINVALID | SU_FLAG_OK, NULL }, - { "ambient.temperature.high.warning", ST_FLAG_RW, 0.1, + NULL, SU_FLAG_NEGINVALID | SU_FLAG_OK, NULL), + snmp_info_default("ambient.temperature.high.warning", ST_FLAG_RW, 0.1, ".1.3.6.1.4.1.534.6.6.7.7.1.1.8.%i.1", - NULL, SU_FLAG_NEGINVALID | SU_FLAG_OK, NULL }, - { "ambient.temperature.high.critical", ST_FLAG_RW, 0.1, + NULL, SU_FLAG_NEGINVALID | SU_FLAG_OK, NULL), + snmp_info_default("ambient.temperature.high.critical", ST_FLAG_RW, 0.1, ".1.3.6.1.4.1.534.6.6.7.7.1.1.9.%i.1", - NULL, SU_FLAG_NEGINVALID | SU_FLAG_OK, NULL }, - { "ambient.humidity.status", ST_FLAG_STRING, SU_INFOSIZE, + NULL, SU_FLAG_NEGINVALID | SU_FLAG_OK, NULL), + snmp_info_default("ambient.humidity.status", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.6.6.7.7.2.1.5.%i.1", NULL, SU_FLAG_OK, - &marlin_threshold_status_info[0] }, - { "ups.alarm", ST_FLAG_STRING, SU_INFOSIZE, + &marlin_threshold_status_info[0]), + snmp_info_default("ups.alarm", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.6.6.7.7.2.1.5.%i.1", NULL, SU_FLAG_OK, - &marlin_threshold_humidity_alarms_info[0] }, - { "ambient.humidity", 0, 0.1, + &marlin_threshold_humidity_alarms_info[0]), + snmp_info_default("ambient.humidity", 0, 0.1, ".1.3.6.1.4.1.534.6.6.7.7.2.1.4.%i.1", - NULL, SU_FLAG_OK, NULL }, + NULL, SU_FLAG_OK, NULL), /* Low and high threshold use the respective critical levels */ - { "ambient.humidity.low", ST_FLAG_RW, 0.1, + snmp_info_default("ambient.humidity.low", ST_FLAG_RW, 0.1, ".1.3.6.1.4.1.534.6.6.7.7.2.1.7.%i.1", - NULL, SU_FLAG_NEGINVALID | SU_FLAG_OK, NULL }, - { "ambient.humidity.low.warning", ST_FLAG_RW, 0.1, + NULL, SU_FLAG_NEGINVALID | SU_FLAG_OK, NULL), + snmp_info_default("ambient.humidity.low.warning", ST_FLAG_RW, 0.1, ".1.3.6.1.4.1.534.6.6.7.7.2.1.6.%i.1", - NULL, SU_FLAG_NEGINVALID | SU_FLAG_OK, NULL }, - { "ambient.humidity.low.critical", ST_FLAG_RW, 0.1, + NULL, SU_FLAG_NEGINVALID | SU_FLAG_OK, NULL), + snmp_info_default("ambient.humidity.low.critical", ST_FLAG_RW, 0.1, ".1.3.6.1.4.1.534.6.6.7.7.2.1.7.%i.1", - NULL, SU_FLAG_NEGINVALID | SU_FLAG_OK, NULL }, - { "ambient.humidity.high", ST_FLAG_RW, 0.1, + NULL, SU_FLAG_NEGINVALID | SU_FLAG_OK, NULL), + snmp_info_default("ambient.humidity.high", ST_FLAG_RW, 0.1, ".1.3.6.1.4.1.534.6.6.7.7.2.1.9.%i.1", NULL, - SU_FLAG_NEGINVALID | SU_FLAG_OK, NULL }, - { "ambient.humidity.high.warning", ST_FLAG_RW, 0.1, + SU_FLAG_NEGINVALID | SU_FLAG_OK, NULL), + snmp_info_default("ambient.humidity.high.warning", ST_FLAG_RW, 0.1, ".1.3.6.1.4.1.534.6.6.7.7.2.1.8.%i.1", - NULL, SU_FLAG_NEGINVALID | SU_FLAG_OK, NULL }, - { "ambient.humidity.high.critical", ST_FLAG_RW, 0.1, + NULL, SU_FLAG_NEGINVALID | SU_FLAG_OK, NULL), + snmp_info_default("ambient.humidity.high.critical", ST_FLAG_RW, 0.1, ".1.3.6.1.4.1.534.6.6.7.7.2.1.9.%i.1", - NULL, SU_FLAG_NEGINVALID | SU_FLAG_OK, NULL }, + NULL, SU_FLAG_NEGINVALID | SU_FLAG_OK, NULL), + /* Dry contacts on TH module */ - { "ambient.contacts.1.status", ST_FLAG_STRING, SU_INFOSIZE, + snmp_info_default("ambient.contacts.1.status", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.6.6.7.7.3.1.4.%i.1", NULL, SU_FLAG_OK, - &marlin_ambient_drycontacts_info[0] }, - { "ambient.contacts.2.status", ST_FLAG_STRING, SU_INFOSIZE, + &marlin_ambient_drycontacts_info[0]), + snmp_info_default("ambient.contacts.2.status", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.6.6.7.7.3.1.4.%i.2", NULL, SU_FLAG_OK, - &marlin_ambient_drycontacts_info[0] }, + &marlin_ambient_drycontacts_info[0]), /* EMP002 (EATON EMP MIB) mapping, including daisychain support */ /* Warning: indexes start at '1' not '0'! */ /* sensorCount.0 */ - { "ambient.count", ST_FLAG_RW, 1.0, + snmp_info_default("ambient.count", ST_FLAG_RW, 1.0, ".1.3.6.1.4.1.534.6.8.1.1.1.0", - "0", SU_TYPE_DAISY_MASTER_ONLY, NULL }, + "0", SU_TYPE_DAISY_MASTER_ONLY, NULL), /* CommunicationStatus.n */ - { "ambient.%i.present", ST_FLAG_STRING, SU_INFOSIZE, + snmp_info_default("ambient.%i.present", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.6.8.1.1.4.1.1.%i", NULL, SU_AMBIENT_TEMPLATE | SU_TYPE_DAISY_MASTER_ONLY, - &marlin_emp002_ambient_presence_info[0] }, + &marlin_emp002_ambient_presence_info[0]), /* sensorName.n: OctetString EMPDT1H1C2 @1 */ - { "ambient.%i.name", ST_FLAG_STRING, 1.0, + snmp_info_default("ambient.%i.name", ST_FLAG_STRING, 1.0, ".1.3.6.1.4.1.534.6.8.1.1.3.1.1.%i", - "", SU_AMBIENT_TEMPLATE | SU_TYPE_DAISY_MASTER_ONLY, NULL }, + "", SU_AMBIENT_TEMPLATE | SU_TYPE_DAISY_MASTER_ONLY, NULL), /* sensorManufacturer.n */ - { "ambient.%i.mfr", ST_FLAG_STRING, 1.0, + snmp_info_default("ambient.%i.mfr", ST_FLAG_STRING, 1.0, ".1.3.6.1.4.1.534.6.8.1.1.2.1.6.%i", - "", SU_AMBIENT_TEMPLATE | SU_TYPE_DAISY_MASTER_ONLY, NULL }, + "", SU_AMBIENT_TEMPLATE | SU_TYPE_DAISY_MASTER_ONLY, NULL), /* sensorModel.n */ - { "ambient.%i.model", ST_FLAG_STRING, 1.0, + snmp_info_default("ambient.%i.model", ST_FLAG_STRING, 1.0, ".1.3.6.1.4.1.534.6.8.1.1.2.1.7.%i", - "", SU_AMBIENT_TEMPLATE | SU_TYPE_DAISY_MASTER_ONLY, NULL }, + "", SU_AMBIENT_TEMPLATE | SU_TYPE_DAISY_MASTER_ONLY, NULL), /* sensorSerialNumber.n */ - { "ambient.%i.serial", ST_FLAG_STRING, 1.0, + snmp_info_default("ambient.%i.serial", ST_FLAG_STRING, 1.0, ".1.3.6.1.4.1.534.6.8.1.1.2.1.9.%i", - "", SU_AMBIENT_TEMPLATE | SU_TYPE_DAISY_MASTER_ONLY, NULL }, + "", SU_AMBIENT_TEMPLATE | SU_TYPE_DAISY_MASTER_ONLY, NULL), /* sensorUuid.n */ - { "ambient.%i.id", ST_FLAG_STRING, 1.0, + snmp_info_default("ambient.%i.id", ST_FLAG_STRING, 1.0, ".1.3.6.1.4.1.534.6.8.1.1.2.1.2.%i", - "", SU_AMBIENT_TEMPLATE | SU_TYPE_DAISY_MASTER_ONLY, NULL }, + "", SU_AMBIENT_TEMPLATE | SU_TYPE_DAISY_MASTER_ONLY, NULL), /* sensorAddress.n */ - { "ambient.%i.address", 0, 1, + snmp_info_default("ambient.%i.address", 0, 1, ".1.3.6.1.4.1.534.6.8.1.1.2.1.4.%i", - "", SU_AMBIENT_TEMPLATE | SU_TYPE_DAISY_MASTER_ONLY, NULL }, + "", SU_AMBIENT_TEMPLATE | SU_TYPE_DAISY_MASTER_ONLY, NULL), /* sensorMonitoredBy.n */ - { "ambient.%i.parent.serial", ST_FLAG_STRING, 1.0, + snmp_info_default("ambient.%i.parent.serial", ST_FLAG_STRING, 1.0, ".1.3.6.1.4.1.534.6.8.1.1.2.1.5.%i", - "", SU_AMBIENT_TEMPLATE | SU_TYPE_DAISY_MASTER_ONLY, NULL }, + "", SU_AMBIENT_TEMPLATE | SU_TYPE_DAISY_MASTER_ONLY, NULL), /* sensorFirmwareVersion.n */ - { "ambient.%i.firmware", ST_FLAG_STRING, 1.0, + snmp_info_default("ambient.%i.firmware", ST_FLAG_STRING, 1.0, ".1.3.6.1.4.1.534.6.8.1.1.2.1.10.%i", - "", SU_AMBIENT_TEMPLATE | SU_TYPE_DAISY_MASTER_ONLY, NULL }, + "", SU_AMBIENT_TEMPLATE | SU_TYPE_DAISY_MASTER_ONLY, NULL), /* temperatureUnit.1 * MUST be before the temperature data reading! */ - { "ambient.%i.temperature.unit", 0, 1.0, + snmp_info_default("ambient.%i.temperature.unit", 0, 1.0, ".1.3.6.1.4.1.534.6.8.1.2.5.0", "", SU_AMBIENT_TEMPLATE | SU_TYPE_DAISY_MASTER_ONLY, - &eaton_sensor_temperature_unit_info[0] }, + &eaton_sensor_temperature_unit_info[0]), /* temperatureValue.n.1 */ - { "ambient.%i.temperature", 0, 0.1, +#if WITH_SNMP_LKP_FUN + snmp_info_default("ambient.%i.temperature", 0, 0.1, ".1.3.6.1.4.1.534.6.8.1.2.3.1.3.%i.1", "", SU_AMBIENT_TEMPLATE | SU_TYPE_DAISY_MASTER_ONLY, -#if WITH_SNMP_LKP_FUN - &eaton_sensor_temperature_read_info[0] + &eaton_sensor_temperature_read_info[0]), #else - NULL + snmp_info_default("ambient.%i.temperature", 0, 0.1, + ".1.3.6.1.4.1.534.6.8.1.2.3.1.3.%i.1", + "", SU_AMBIENT_TEMPLATE | SU_TYPE_DAISY_MASTER_ONLY, + NULL), #endif - }, - { "ambient.%i.temperature.status", ST_FLAG_STRING, SU_INFOSIZE, + snmp_info_default("ambient.%i.temperature.status", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.6.8.1.2.3.1.1.%i.1", NULL, SU_AMBIENT_TEMPLATE | SU_TYPE_DAISY_MASTER_ONLY, - &marlin_threshold_status_info[0] }, - { "ups.alarm", ST_FLAG_STRING, SU_INFOSIZE, + &marlin_threshold_status_info[0]), + snmp_info_default("ups.alarm", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.6.8.1.2.3.1.1.%i.1", NULL, SU_AMBIENT_TEMPLATE | SU_TYPE_DAISY_MASTER_ONLY, - &marlin_threshold_temperature_alarms_info[0] }, + &marlin_threshold_temperature_alarms_info[0]), /* FIXME: ambient.n.temperature.{minimum,maximum} */ /* temperatureThresholdLowCritical.n.1 */ - { "ambient.%i.temperature.low.critical", ST_FLAG_RW, 0.1, + snmp_info_default("ambient.%i.temperature.low.critical", ST_FLAG_RW, 0.1, ".1.3.6.1.4.1.534.6.8.1.2.2.1.6.%i.1", - "", SU_AMBIENT_TEMPLATE | SU_TYPE_DAISY_MASTER_ONLY, NULL }, + "", SU_AMBIENT_TEMPLATE | SU_TYPE_DAISY_MASTER_ONLY, NULL), /* temperatureThresholdLowWarning.n.1 */ - { "ambient.%i.temperature.low.warning", ST_FLAG_RW, 0.1, + snmp_info_default("ambient.%i.temperature.low.warning", ST_FLAG_RW, 0.1, ".1.3.6.1.4.1.534.6.8.1.2.2.1.5.%i.1", - "", SU_AMBIENT_TEMPLATE | SU_TYPE_DAISY_MASTER_ONLY, NULL }, + "", SU_AMBIENT_TEMPLATE | SU_TYPE_DAISY_MASTER_ONLY, NULL), /* temperatureThresholdHighWarning.n.1 */ - { "ambient.%i.temperature.high.warning", ST_FLAG_RW, 0.1, + snmp_info_default("ambient.%i.temperature.high.warning", ST_FLAG_RW, 0.1, ".1.3.6.1.4.1.534.6.8.1.2.2.1.7.%i.1", - "", SU_AMBIENT_TEMPLATE | SU_TYPE_DAISY_MASTER_ONLY, NULL }, + "", SU_AMBIENT_TEMPLATE | SU_TYPE_DAISY_MASTER_ONLY, NULL), /* temperatureThresholdHighCritical.n.1 */ - { "ambient.%i.temperature.high.critical", ST_FLAG_RW, 0.1, + snmp_info_default("ambient.%i.temperature.high.critical", ST_FLAG_RW, 0.1, ".1.3.6.1.4.1.534.6.8.1.2.2.1.8.%i.1", - "", SU_AMBIENT_TEMPLATE | SU_TYPE_DAISY_MASTER_ONLY, NULL }, + "", SU_AMBIENT_TEMPLATE | SU_TYPE_DAISY_MASTER_ONLY, NULL), /* humidityValue.n.1 */ - { "ambient.%i.humidity", 0, 0.1, + snmp_info_default("ambient.%i.humidity", 0, 0.1, ".1.3.6.1.4.1.534.6.8.1.3.3.1.3.%i.1", - "", SU_AMBIENT_TEMPLATE | SU_TYPE_DAISY_MASTER_ONLY, NULL }, - { "ambient.%i.humidity.status", ST_FLAG_STRING, SU_INFOSIZE, + "", SU_AMBIENT_TEMPLATE | SU_TYPE_DAISY_MASTER_ONLY, NULL), + snmp_info_default("ambient.%i.humidity.status", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.6.8.1.3.3.1.1.%i.1", NULL, SU_AMBIENT_TEMPLATE | SU_TYPE_DAISY_MASTER_ONLY, - &marlin_threshold_status_info[0] }, - { "ups.alarm", ST_FLAG_STRING, SU_INFOSIZE, + &marlin_threshold_status_info[0]), + snmp_info_default("ups.alarm", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.6.8.1.3.3.1.1.%i.1", NULL, SU_AMBIENT_TEMPLATE | SU_TYPE_DAISY_MASTER_ONLY, - &marlin_threshold_humidity_alarms_info[0] }, + &marlin_threshold_humidity_alarms_info[0]), /* FIXME: consider ambient.n.humidity.{minimum,maximum} */ /* humidityThresholdLowCritical.n.1 */ - { "ambient.%i.humidity.low.critical", ST_FLAG_RW, 0.1, + snmp_info_default("ambient.%i.humidity.low.critical", ST_FLAG_RW, 0.1, ".1.3.6.1.4.1.534.6.8.1.3.2.1.6.%i.1", - "", SU_AMBIENT_TEMPLATE | SU_TYPE_DAISY_MASTER_ONLY, NULL }, + "", SU_AMBIENT_TEMPLATE | SU_TYPE_DAISY_MASTER_ONLY, NULL), /* humidityThresholdLowWarning.n.1 */ - { "ambient.%i.humidity.low.warning", ST_FLAG_RW, 0.1, + snmp_info_default("ambient.%i.humidity.low.warning", ST_FLAG_RW, 0.1, ".1.3.6.1.4.1.534.6.8.1.3.2.1.5.%i.1", - "", SU_AMBIENT_TEMPLATE | SU_TYPE_DAISY_MASTER_ONLY, NULL }, + "", SU_AMBIENT_TEMPLATE | SU_TYPE_DAISY_MASTER_ONLY, NULL), /* humidityThresholdHighWarning.n.1 */ - { "ambient.%i.humidity.high.warning", ST_FLAG_RW, 0.1, + snmp_info_default("ambient.%i.humidity.high.warning", ST_FLAG_RW, 0.1, ".1.3.6.1.4.1.534.6.8.1.3.2.1.7.%i.1", - "", SU_AMBIENT_TEMPLATE | SU_TYPE_DAISY_MASTER_ONLY, NULL }, + "", SU_AMBIENT_TEMPLATE | SU_TYPE_DAISY_MASTER_ONLY, NULL), /* humidityThresholdHighCritical.n.1 */ - { "ambient.%i.humidity.high.critical", ST_FLAG_RW, 0.1, + snmp_info_default("ambient.%i.humidity.high.critical", ST_FLAG_RW, 0.1, ".1.3.6.1.4.1.534.6.8.1.3.2.1.8.%i.1", - "", SU_AMBIENT_TEMPLATE | SU_TYPE_DAISY_MASTER_ONLY, NULL }, + "", SU_AMBIENT_TEMPLATE | SU_TYPE_DAISY_MASTER_ONLY, NULL), /* digitalInputName.n.{1,2} */ - { "ambient.%i.contacts.1.name", ST_FLAG_STRING, 1.0, + snmp_info_default("ambient.%i.contacts.1.name", ST_FLAG_STRING, 1.0, ".1.3.6.1.4.1.534.6.8.1.4.2.1.1.%i.1", - "", SU_AMBIENT_TEMPLATE | SU_TYPE_DAISY_MASTER_ONLY, NULL }, - { "ambient.%i.contacts.2.name", ST_FLAG_STRING, 1.0, + "", SU_AMBIENT_TEMPLATE | SU_TYPE_DAISY_MASTER_ONLY, NULL), + snmp_info_default("ambient.%i.contacts.2.name", ST_FLAG_STRING, 1.0, ".1.3.6.1.4.1.534.6.8.1.4.2.1.1.%i.2", - "", SU_AMBIENT_TEMPLATE | SU_TYPE_DAISY_MASTER_ONLY, NULL }, + "", SU_AMBIENT_TEMPLATE | SU_TYPE_DAISY_MASTER_ONLY, NULL), /* digitalInputPolarity.n */ - { "ambient.%i.contacts.1.config", ST_FLAG_RW | ST_FLAG_STRING, SU_INFOSIZE, + snmp_info_default("ambient.%i.contacts.1.config", ST_FLAG_RW | ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.6.8.1.4.2.1.3.%i.1", "", SU_AMBIENT_TEMPLATE | SU_TYPE_DAISY_MASTER_ONLY, - &marlin_ambient_drycontacts_polarity_info[0] }, - { "ambient.%i.contacts.2.config", ST_FLAG_RW | ST_FLAG_STRING, SU_INFOSIZE, + &marlin_ambient_drycontacts_polarity_info[0]), + snmp_info_default("ambient.%i.contacts.2.config", ST_FLAG_RW | ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.6.8.1.4.2.1.3.%i.2", "", SU_AMBIENT_TEMPLATE | SU_TYPE_DAISY_MASTER_ONLY, - &marlin_ambient_drycontacts_polarity_info[0] }, + &marlin_ambient_drycontacts_polarity_info[0]), /* XUPS-MIB::xupsContactState.n */ - { "ambient.%i.contacts.1.status", ST_FLAG_STRING, 1.0, + snmp_info_default("ambient.%i.contacts.1.status", ST_FLAG_STRING, 1.0, ".1.3.6.1.4.1.534.6.8.1.4.3.1.3.%i.1", "", SU_AMBIENT_TEMPLATE | SU_TYPE_DAISY_MASTER_ONLY, - &marlin_ambient_drycontacts_state_info[0] }, - { "ambient.%i.contacts.2.status", ST_FLAG_STRING, 1.0, + &marlin_ambient_drycontacts_state_info[0]), + snmp_info_default("ambient.%i.contacts.2.status", ST_FLAG_STRING, 1.0, ".1.3.6.1.4.1.534.6.8.1.4.3.1.3.%i.2", "", SU_AMBIENT_TEMPLATE | SU_TYPE_DAISY_MASTER_ONLY, - &marlin_ambient_drycontacts_state_info[0] }, + &marlin_ambient_drycontacts_state_info[0]), + /* Outlet collection */ - { "outlet.count", 0, 1, + snmp_info_default("outlet.count", 0, 1, ".1.3.6.1.4.1.534.6.6.7.1.2.1.22.%i", - "0", SU_FLAG_STATIC | SU_FLAG_OK, NULL }, - { "outlet.id", 0, 1, + "0", SU_FLAG_STATIC | SU_FLAG_OK, NULL), + snmp_info_default("outlet.id", 0, 1, NULL, - "0", SU_FLAG_STATIC | SU_FLAG_ABSENT | SU_FLAG_OK, NULL }, - { "outlet.desc", ST_FLAG_RW | ST_FLAG_STRING, 20, + "0", SU_FLAG_STATIC | SU_FLAG_ABSENT | SU_FLAG_OK, NULL), + snmp_info_default("outlet.desc", ST_FLAG_RW | ST_FLAG_STRING, 20, NULL, "All outlets", - SU_FLAG_STATIC | SU_FLAG_ABSENT | SU_FLAG_OK, NULL }, + SU_FLAG_STATIC | SU_FLAG_ABSENT | SU_FLAG_OK, NULL), /* UnitType * used to depict the overall outlets switchability of the unit on G3 and newer ePDU*/ - { "outlet.switchable", ST_FLAG_STRING, SU_INFOSIZE, + snmp_info_default("outlet.switchable", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.6.6.7.1.2.1.10.%i", "no", SU_FLAG_STATIC | SU_FLAG_UNIQUE, - &marlin_unit_switchability_info[0] }, + &marlin_unit_switchability_info[0]), /* Ugly hack for older G2 ePDU: check the first outlet to determine unit switchability */ - { "outlet.switchable", ST_FLAG_STRING, SU_INFOSIZE, + snmp_info_default("outlet.switchable", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.6.6.7.6.6.1.3.%i.1", "no", SU_FLAG_STATIC | SU_FLAG_UNIQUE | SU_FLAG_OK | SU_TYPE_DAISY_1, - &g2_unit_outlet_switchability_info[0] }, + &g2_unit_outlet_switchability_info[0]), /* The below ones are the same as the input.* equivalent */ /* FIXME: transition period, TO BE REMOVED, moved to input.* */ - { "outlet.frequency", 0, 0.1, + snmp_info_default("outlet.frequency", 0, 0.1, ".1.3.6.1.4.1.534.6.6.7.3.1.1.3.%i.1", - NULL, 0, NULL }, - { "outlet.voltage", 0, 0.001, + NULL, 0, NULL), + snmp_info_default("outlet.voltage", 0, 0.001, ".1.3.6.1.4.1.534.6.6.7.3.2.1.3.%i.1.1", - NULL, 0, NULL }, - { "outlet.current", 0, 0.01, + NULL, 0, NULL), + snmp_info_default("outlet.current", 0, 0.01, ".1.3.6.1.4.1.534.6.6.7.3.3.1.4.%i.1.1", - NULL, 0, NULL }, - { "outlet.realpower", 0, 1.0, + NULL, 0, NULL), + snmp_info_default("outlet.realpower", 0, 1.0, ".1.3.6.1.4.1.534.6.6.7.3.4.1.4.%i.1.4", - NULL, 0, NULL }, - { "outlet.power", 0, 1.0, + NULL, 0, NULL), + snmp_info_default("outlet.power", 0, 1.0, ".1.3.6.1.4.1.534.6.6.7.3.4.1.3.%i.1.4", - NULL, 0, NULL }, + NULL, 0, NULL), /* outlet template definition * Indexes start from 1, ie outlet.1 => .1 */ @@ -997,14 +1009,14 @@ static snmp_info_t eaton_marlin_mib[] = { */ /* FIXME: SU_FLAG_SEMI_STATIC or SU_FLAG_SETTING => * refreshed from time to time or upon call to setvar */ - { "outlet.%i.desc", ST_FLAG_RW | ST_FLAG_STRING, SU_INFOSIZE, + snmp_info_default("outlet.%i.desc", ST_FLAG_RW | ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.6.6.7.6.1.1.3.%i.%i", NULL, SU_FLAG_SEMI_STATIC | SU_FLAG_OK | SU_OUTLET | SU_TYPE_DAISY_1, - NULL }, - { "outlet.%i.status", ST_FLAG_STRING, SU_INFOSIZE, + NULL), + snmp_info_default("outlet.%i.status", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.6.6.7.6.6.1.2.%i.%i", NULL, SU_FLAG_OK | SU_OUTLET | SU_TYPE_DAISY_1, - &marlin_outlet_status_info[0] }, + &marlin_outlet_status_info[0]), /* Numeric identifier of the outlet, tied to the whole unit */ /* NOTE: For daisychain devices ATM the last listed value presented by @@ -1016,113 +1028,113 @@ static snmp_info_t eaton_marlin_mib[] = { * the outlet number (represented as string) and is a read-only string * outletID.0.8 = Value (OctetString): "8" */ - { "outlet.%i.id", 0, 1, + snmp_info_default("outlet.%i.id", 0, 1, ".1.3.6.1.4.1.534.6.6.7.6.6.1.7.%i.%i", NULL, SU_FLAG_STATIC | SU_OUTLET | SU_TYPE_DAISY_1, - NULL }, + NULL), - /* Fallback in firmwares issued before Sep 2017 (outletID): */ - { "outlet.%i.name", ST_FLAG_STRING, SU_INFOSIZE, + /* The fallback in firmwares issued before Sep 2017 (outletID), see details above: */ + snmp_info_default("outlet.%i.name", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.6.6.7.6.1.1.2.%i.%i", NULL, SU_FLAG_STATIC | SU_FLAG_UNIQUE | SU_FLAG_OK | SU_OUTLET | SU_TYPE_DAISY_1, - NULL }, + NULL), /* Preferred: Outlet physical name OID in new G3 firmware (02.00.0051) * is named outletDesignator (other MIBs outletPhysicalName) * and is a read-only string provided by firmware * outletDesignator.0.1 = Value (OctetString): "A1" * outletPhysicalName.0.16 = Value (OctetString): "A16" */ - { "outlet.%i.name", ST_FLAG_STRING, SU_INFOSIZE, + snmp_info_default("outlet.%i.name", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.6.6.7.6.1.1.6.%i.%i", NULL, SU_FLAG_STATIC | SU_FLAG_UNIQUE | SU_FLAG_OK | SU_OUTLET | SU_TYPE_DAISY_1, - NULL }, + NULL), /* FIXME: the last part of the OID gives the group number (i.e. %i.1 means "group 1") * Need to address that, without multiple declaration (%i.%i, SU_OUTLET | SU_OUTLET_GROUP)? */ - { "outlet.%i.groupid", ST_FLAG_STRING, SU_INFOSIZE, + snmp_info_default("outlet.%i.groupid", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.6.6.7.6.2.1.3.%i.%i.1", - NULL, SU_FLAG_STATIC | SU_FLAG_UNIQUE | SU_OUTLET | SU_TYPE_DAISY_1, NULL }, - { "outlet.%i.groupid", ST_FLAG_STRING, SU_INFOSIZE, + NULL, SU_FLAG_STATIC | SU_FLAG_UNIQUE | SU_OUTLET | SU_TYPE_DAISY_1, NULL), + snmp_info_default("outlet.%i.groupid", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.6.6.7.6.2.1.3.%i.%i.2", - NULL, SU_FLAG_STATIC | SU_FLAG_UNIQUE | SU_OUTLET | SU_TYPE_DAISY_1, NULL }, - { "outlet.%i.groupid", ST_FLAG_STRING, SU_INFOSIZE, + NULL, SU_FLAG_STATIC | SU_FLAG_UNIQUE | SU_OUTLET | SU_TYPE_DAISY_1, NULL), + snmp_info_default("outlet.%i.groupid", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.6.6.7.6.2.1.3.%i.%i.3", - NULL, SU_FLAG_STATIC | SU_FLAG_UNIQUE | SU_OUTLET | SU_TYPE_DAISY_1, NULL }, - { "outlet.%i.groupid", ST_FLAG_STRING, SU_INFOSIZE, + NULL, SU_FLAG_STATIC | SU_FLAG_UNIQUE | SU_OUTLET | SU_TYPE_DAISY_1, NULL), + snmp_info_default("outlet.%i.groupid", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.6.6.7.6.2.1.3.%i.%i.4", - NULL, SU_FLAG_STATIC | SU_FLAG_UNIQUE | SU_OUTLET | SU_TYPE_DAISY_1, NULL }, - { "outlet.%i.groupid", ST_FLAG_STRING, SU_INFOSIZE, + NULL, SU_FLAG_STATIC | SU_FLAG_UNIQUE | SU_OUTLET | SU_TYPE_DAISY_1, NULL), + snmp_info_default("outlet.%i.groupid", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.6.6.7.6.2.1.3.%i.%i.5", - NULL, SU_FLAG_STATIC | SU_FLAG_UNIQUE | SU_OUTLET | SU_TYPE_DAISY_1, NULL }, - { "outlet.%i.groupid", ST_FLAG_STRING, SU_INFOSIZE, + NULL, SU_FLAG_STATIC | SU_FLAG_UNIQUE | SU_OUTLET | SU_TYPE_DAISY_1, NULL), + snmp_info_default("outlet.%i.groupid", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.6.6.7.6.2.1.3.%i.%i.6", - NULL, SU_FLAG_STATIC | SU_FLAG_UNIQUE | SU_OUTLET | SU_TYPE_DAISY_1, NULL }, - { "outlet.%i.current", 0, 0.001, + NULL, SU_FLAG_STATIC | SU_FLAG_UNIQUE | SU_OUTLET | SU_TYPE_DAISY_1, NULL), + snmp_info_default("outlet.%i.current", 0, 0.001, ".1.3.6.1.4.1.534.6.6.7.6.4.1.3.%i.%i", - NULL, SU_OUTLET | SU_TYPE_DAISY_1, NULL }, - { "outlet.%i.current.status", ST_FLAG_STRING, SU_INFOSIZE, + NULL, SU_OUTLET | SU_TYPE_DAISY_1, NULL), + snmp_info_default("outlet.%i.current.status", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.6.6.7.6.4.1.4.%i.%i", NULL, SU_OUTLET | SU_TYPE_DAISY_1, - &marlin_threshold_status_info[0] }, - { "outlet.%i.alarm", ST_FLAG_STRING, SU_INFOSIZE, + &marlin_threshold_status_info[0]), + snmp_info_default("outlet.%i.alarm", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.6.6.7.6.4.1.4.%i.%i", NULL, SU_OUTLET | SU_TYPE_DAISY_1, - &marlin_threshold_current_alarms_info[0] }, - { "outlet.%i.current.low.warning", ST_FLAG_RW, 0.001, + &marlin_threshold_current_alarms_info[0]), + snmp_info_default("outlet.%i.current.low.warning", ST_FLAG_RW, 0.001, ".1.3.6.1.4.1.534.6.6.7.6.4.1.5.%i.%i", - NULL, SU_FLAG_NEGINVALID | SU_OUTLET | SU_TYPE_DAISY_1, NULL }, - { "outlet.%i.current.low.critical", ST_FLAG_RW, 0.001, + NULL, SU_FLAG_NEGINVALID | SU_OUTLET | SU_TYPE_DAISY_1, NULL), + snmp_info_default("outlet.%i.current.low.critical", ST_FLAG_RW, 0.001, ".1.3.6.1.4.1.534.6.6.7.6.4.1.6.%i.%i", - NULL, SU_FLAG_NEGINVALID | SU_OUTLET | SU_TYPE_DAISY_1, NULL }, - { "outlet.%i.current.high.warning", ST_FLAG_RW, 0.001, + NULL, SU_FLAG_NEGINVALID | SU_OUTLET | SU_TYPE_DAISY_1, NULL), + snmp_info_default("outlet.%i.current.high.warning", ST_FLAG_RW, 0.001, ".1.3.6.1.4.1.534.6.6.7.6.4.1.7.%i.%i", - NULL, SU_FLAG_NEGINVALID | SU_OUTLET | SU_TYPE_DAISY_1, NULL }, - { "outlet.%i.current.high.critical", ST_FLAG_RW, 0.001, + NULL, SU_FLAG_NEGINVALID | SU_OUTLET | SU_TYPE_DAISY_1, NULL), + snmp_info_default("outlet.%i.current.high.critical", ST_FLAG_RW, 0.001, ".1.3.6.1.4.1.534.6.6.7.6.4.1.8.%i.%i", - NULL, SU_FLAG_NEGINVALID | SU_OUTLET | SU_TYPE_DAISY_1, NULL }, - { "outlet.%i.realpower", 0, 1.0, + NULL, SU_FLAG_NEGINVALID | SU_OUTLET | SU_TYPE_DAISY_1, NULL), + snmp_info_default("outlet.%i.realpower", 0, 1.0, ".1.3.6.1.4.1.534.6.6.7.6.5.1.3.%i.%i", - NULL, SU_OUTLET | SU_TYPE_DAISY_1, NULL }, - { "outlet.%i.voltage", 0, 0.001, + NULL, SU_OUTLET | SU_TYPE_DAISY_1, NULL), + snmp_info_default("outlet.%i.voltage", 0, 0.001, ".1.3.6.1.4.1.534.6.6.7.6.3.1.2.%i.%i", - NULL, SU_OUTLET | SU_TYPE_DAISY_1, NULL }, - { "outlet.%i.voltage.status", ST_FLAG_STRING, SU_INFOSIZE, + NULL, SU_OUTLET | SU_TYPE_DAISY_1, NULL), + snmp_info_default("outlet.%i.voltage.status", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.6.6.7.6.3.1.3.%i.%i", NULL, SU_OUTLET | SU_TYPE_DAISY_1, - &marlin_threshold_status_info[0] }, - { "outlet.%i.alarm", ST_FLAG_STRING, SU_INFOSIZE, + &marlin_threshold_status_info[0]), + snmp_info_default("outlet.%i.alarm", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.6.6.7.6.3.1.3.%i.%i", NULL, SU_OUTLET | SU_TYPE_DAISY_1, - &marlin_threshold_voltage_alarms_info[0] }, - { "outlet.%i.voltage.low.warning", ST_FLAG_RW, 0.001, + &marlin_threshold_voltage_alarms_info[0]), + snmp_info_default("outlet.%i.voltage.low.warning", ST_FLAG_RW, 0.001, ".1.3.6.1.4.1.534.6.6.7.6.3.1.4.%i.%i", - NULL, SU_FLAG_NEGINVALID | SU_OUTLET | SU_TYPE_DAISY_1, NULL }, - { "outlet.%i.voltage.low.critical", ST_FLAG_RW, 0.001, + NULL, SU_FLAG_NEGINVALID | SU_OUTLET | SU_TYPE_DAISY_1, NULL), + snmp_info_default("outlet.%i.voltage.low.critical", ST_FLAG_RW, 0.001, ".1.3.6.1.4.1.534.6.6.7.6.3.1.5.%i.%i", - NULL, SU_FLAG_NEGINVALID | SU_OUTLET | SU_TYPE_DAISY_1, NULL }, - { "outlet.%i.voltage.high.warning", ST_FLAG_RW, 0.001, + NULL, SU_FLAG_NEGINVALID | SU_OUTLET | SU_TYPE_DAISY_1, NULL), + snmp_info_default("outlet.%i.voltage.high.warning", ST_FLAG_RW, 0.001, ".1.3.6.1.4.1.534.6.6.7.6.3.1.6.%i.%i", - NULL, SU_FLAG_NEGINVALID | SU_OUTLET | SU_TYPE_DAISY_1, NULL }, - { "outlet.%i.voltage.high.critical", ST_FLAG_RW, 0.001, + NULL, SU_FLAG_NEGINVALID | SU_OUTLET | SU_TYPE_DAISY_1, NULL), + snmp_info_default("outlet.%i.voltage.high.critical", ST_FLAG_RW, 0.001, ".1.3.6.1.4.1.534.6.6.7.6.3.1.7.%i.%i", - NULL, SU_FLAG_NEGINVALID | SU_OUTLET | SU_TYPE_DAISY_1, NULL }, - { "outlet.%i.power", 0, 1.0, + NULL, SU_FLAG_NEGINVALID | SU_OUTLET | SU_TYPE_DAISY_1, NULL), + snmp_info_default("outlet.%i.power", 0, 1.0, ".1.3.6.1.4.1.534.6.6.7.6.5.1.2.%i.%i", - NULL, SU_OUTLET | SU_TYPE_DAISY_1, NULL }, + NULL, SU_OUTLET | SU_TYPE_DAISY_1, NULL), /* outletControlSwitchable */ - { "outlet.%i.switchable", ST_FLAG_STRING, SU_INFOSIZE, + snmp_info_default("outlet.%i.switchable", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.6.6.7.6.6.1.9.%i.%i", "no", SU_OUTLET | SU_FLAG_UNIQUE | SU_TYPE_DAISY_1, - &marlin_outlet_switchability_info[0] }, + &marlin_outlet_switchability_info[0]), /* FIXME: handle non switchable units (only measurements), which do not expose this OID */ - { "outlet.%i.switchable", ST_FLAG_STRING, SU_INFOSIZE, + snmp_info_default("outlet.%i.switchable", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.6.6.7.6.6.1.3.%i.%i", "no", SU_FLAG_STATIC | SU_FLAG_UNIQUE | SU_OUTLET | SU_FLAG_OK | SU_TYPE_DAISY_1, - &g2_unit_outlet_switchability_info[0] }, - { "outlet.%i.type", ST_FLAG_STRING, SU_INFOSIZE, + &g2_unit_outlet_switchability_info[0]), + snmp_info_default("outlet.%i.type", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.6.6.7.6.1.1.5.%i.%i", "unknown", SU_FLAG_STATIC | SU_OUTLET | SU_TYPE_DAISY_1, - &marlin_outlet_type_info[0] }, + &marlin_outlet_type_info[0]), /* TODO: handle statistics * outletWh.0.1 @@ -1130,145 +1142,145 @@ static snmp_info_t eaton_marlin_mib[] = { */ /* Outlet groups collection */ - { "outlet.group.count", 0, 1, + snmp_info_default("outlet.group.count", 0, 1, ".1.3.6.1.4.1.534.6.6.7.1.2.1.21.%i", - "0", SU_FLAG_STATIC | SU_TYPE_DAISY_1, NULL }, + "0", SU_FLAG_STATIC | SU_TYPE_DAISY_1, NULL), /* outlet groups template definition * Indexes start from 1, ie outlet.group.1 => .1 */ /* Note: the first definition is used to determine the base index (ie 0 or 1) */ /* groupID.0.1 = OctetString: A */ - { "outlet.group.%i.id", ST_FLAG_STRING, SU_INFOSIZE, + snmp_info_default("outlet.group.%i.id", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.6.6.7.5.1.1.2.%i.%i", - NULL, SU_FLAG_STATIC | SU_OUTLET_GROUP | SU_TYPE_DAISY_1, NULL }, + NULL, SU_FLAG_STATIC | SU_OUTLET_GROUP | SU_TYPE_DAISY_1, NULL), /* User-friendly (writeable) description of the outlet group: * groupName.0.1 = OctetString: Factory Group 1 * groupName.0.2 = OctetString: Branch Circuit B */ /* FIXME: SU_FLAG_SEMI_STATIC or SU_FLAG_SETTING => * refreshed from time to time or upon call to setvar */ - { "outlet.group.%i.desc", ST_FLAG_RW | ST_FLAG_STRING, SU_INFOSIZE, + snmp_info_default("outlet.group.%i.desc", ST_FLAG_RW | ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.6.6.7.5.1.1.3.%i.%i", NULL, SU_FLAG_SEMI_STATIC | SU_OUTLET_GROUP | SU_TYPE_DAISY_1, - NULL }, + NULL), /* Outlet-group physical name, a read-only string, * is named groupDesignator (other MIBs groupPhysicalName) * groupPhysicalName.0.1 = Value (OctetString): A * groupDesignator.0.2 = Value (OctetString): B */ - { "outlet.group.%i.name", ST_FLAG_STRING, SU_INFOSIZE, + snmp_info_default("outlet.group.%i.name", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.6.6.7.5.1.1.8.%i.%i", NULL, SU_FLAG_STATIC | SU_OUTLET_GROUP | SU_TYPE_DAISY_1, - NULL }, + NULL), /* Outlet-group color: groupColor (other MIBs groupBkgColor) * groupColor.0.1 = Value (Gauge32): 16051527 (0xF4ED47) */ /* FIXME: RFC on key name is needed when backporting to NUT upstream */ - { "outlet.group.%i.color", ST_FLAG_STRING, SU_INFOSIZE, + snmp_info_default("outlet.group.%i.color", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.6.6.7.5.1.1.7.%i.%i", NULL, SU_FLAG_STATIC | SU_OUTLET_GROUP | SU_TYPE_DAISY_1, - NULL }, + NULL), /* groupType.0.1 = Integer: outletSection (4) */ - { "outlet.group.%i.type", ST_FLAG_STRING, SU_INFOSIZE, + snmp_info_default("outlet.group.%i.type", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.6.6.7.5.1.1.4.%i.%i", NULL, SU_FLAG_STATIC | SU_OUTLET_GROUP | SU_TYPE_DAISY_1, - &marlin_outlet_group_type_info[0] }, + &marlin_outlet_group_type_info[0]), /* Phase to which an outlet-group is connected: * We use the following OID, which gives the voltage measurement type * groupVoltageMeasType.0.1; Value (Integer): singlePhase (1) */ /* FIXME: RFC on key name is needed when backporting to NUT upstream ; check type (number? string?) and flags (daisy?) */ - { "outlet.group.%i.phase", 0, SU_INFOSIZE, - ".1.3.6.1.4.1.534.6.6.7.5.3.1.2.%i.%i", + snmp_info_default("outlet.group.%i.phase", 0, SU_INFOSIZE, + ".1.3.6.1.4.1.534.6.6.7.5.1.1.2.%i.%i", NULL, SU_FLAG_STATIC | SU_OUTLET_GROUP | SU_TYPE_DAISY_1, - &marlin_outlet_group_phase_info[0] }, + &marlin_outlet_group_phase_info[0]), /* groupControlStatus.0.1 = Integer: on (1) */ - { "outlet.group.%i.status", ST_FLAG_STRING, SU_INFOSIZE, + snmp_info_default("outlet.group.%i.status", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.6.6.7.5.6.1.2.%i.%i", NULL, SU_FLAG_OK | SU_OUTLET_GROUP | SU_TYPE_DAISY_1, - &marlin_outletgroups_status_info[0] }, + &marlin_outletgroups_status_info[0]), /* groupChildCount.0.1 = Integer: 12 */ - { "outlet.group.%i.count", 0, 1, + snmp_info_default("outlet.group.%i.count", 0, 1, ".1.3.6.1.4.1.534.6.6.7.5.1.1.6.%i.%i", - NULL, SU_OUTLET_GROUP | SU_TYPE_DAISY_1, NULL }, + NULL, SU_OUTLET_GROUP | SU_TYPE_DAISY_1, NULL), /* groupVoltage.0.1 = Integer: 243080 */ - { "outlet.group.%i.voltage", 0, 0.001, + snmp_info_default("outlet.group.%i.voltage", 0, 0.001, ".1.3.6.1.4.1.534.6.6.7.5.3.1.3.%i.%i", - NULL, SU_OUTLET_GROUP | SU_TYPE_DAISY_1, NULL }, + NULL, SU_OUTLET_GROUP | SU_TYPE_DAISY_1, NULL), /* groupVoltageThStatus.0.1 = Integer: good (0) */ - { "outlet.group.%i.voltage.status", ST_FLAG_STRING, SU_INFOSIZE, + snmp_info_default("outlet.group.%i.voltage.status", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.6.6.7.5.3.1.4.%i.%i", NULL, SU_OUTLET_GROUP | SU_TYPE_DAISY_1, - &marlin_threshold_status_info[0] }, - { "outlet.group.%i.alarm", ST_FLAG_STRING, SU_INFOSIZE, + &marlin_threshold_status_info[0]), + snmp_info_default("outlet.group.%i.alarm", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.6.6.7.5.3.1.4.%i.%i", NULL, SU_OUTLET_GROUP | SU_TYPE_DAISY_1, - &marlin_threshold_voltage_alarms_info[0] }, - { "outlet.group.%i.voltage.low.warning", ST_FLAG_RW, 0.001, + &marlin_threshold_voltage_alarms_info[0]), + snmp_info_default("outlet.group.%i.voltage.low.warning", ST_FLAG_RW, 0.001, ".1.3.6.1.4.1.534.6.6.7.5.3.1.5.%i.%i", - NULL, SU_FLAG_NEGINVALID | SU_OUTLET_GROUP | SU_TYPE_DAISY_1, NULL }, - { "outlet.group.%i.voltage.low.critical", ST_FLAG_RW, 0.001, + NULL, SU_FLAG_NEGINVALID | SU_OUTLET_GROUP | SU_TYPE_DAISY_1, NULL), + snmp_info_default("outlet.group.%i.voltage.low.critical", ST_FLAG_RW, 0.001, ".1.3.6.1.4.1.534.6.6.7.5.3.1.6.%i.%i", - NULL, SU_FLAG_NEGINVALID | SU_OUTLET_GROUP | SU_TYPE_DAISY_1, NULL }, - { "outlet.group.%i.voltage.high.warning", ST_FLAG_RW, 0.001, + NULL, SU_FLAG_NEGINVALID | SU_OUTLET_GROUP | SU_TYPE_DAISY_1, NULL), + snmp_info_default("outlet.group.%i.voltage.high.warning", ST_FLAG_RW, 0.001, ".1.3.6.1.4.1.534.6.6.7.5.3.1.7.%i.%i", - NULL, SU_FLAG_NEGINVALID | SU_OUTLET_GROUP | SU_TYPE_DAISY_1, NULL }, - { "outlet.group.%i.voltage.high.critical", ST_FLAG_RW, 0.001, + NULL, SU_FLAG_NEGINVALID | SU_OUTLET_GROUP | SU_TYPE_DAISY_1, NULL), + snmp_info_default("outlet.group.%i.voltage.high.critical", ST_FLAG_RW, 0.001, ".1.3.6.1.4.1.534.6.6.7.5.3.1.8.%i.%i", - NULL, SU_FLAG_NEGINVALID | SU_OUTLET_GROUP | SU_TYPE_DAISY_1, NULL }, + NULL, SU_FLAG_NEGINVALID | SU_OUTLET_GROUP | SU_TYPE_DAISY_1, NULL), /* groupCurrent.0.1 = Integer: 0 */ - { "outlet.group.%i.current", 0, 0.001, + snmp_info_default("outlet.group.%i.current", 0, 0.001, ".1.3.6.1.4.1.534.6.6.7.5.4.1.3.%i.%i", - NULL, SU_OUTLET_GROUP | SU_TYPE_DAISY_1, NULL }, + NULL, SU_OUTLET_GROUP | SU_TYPE_DAISY_1, NULL), /* groupCurrentCapacity.0.1 = Integer: 16000 */ - { "outlet.group.%i.current.nominal", 0, 0.001, + snmp_info_default("outlet.group.%i.current.nominal", 0, 0.001, ".1.3.6.1.4.1.534.6.6.7.5.4.1.2.%i.%i", - NULL, SU_OUTLET_GROUP | SU_TYPE_DAISY_1, NULL }, + NULL, SU_OUTLET_GROUP | SU_TYPE_DAISY_1, NULL), /* groupCurrentThStatus.0.1 = Integer: good (0) */ - { "outlet.group.%i.current.status", ST_FLAG_STRING, SU_INFOSIZE, + snmp_info_default("outlet.group.%i.current.status", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.6.6.7.5.4.1.4.%i.%i", NULL, SU_OUTLET_GROUP | SU_TYPE_DAISY_1, - &marlin_threshold_status_info[0] }, - { "outlet.group.%i.alarm", ST_FLAG_STRING, SU_INFOSIZE, + &marlin_threshold_status_info[0]), + snmp_info_default("outlet.group.%i.alarm", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.6.6.7.5.4.1.4.%i.%i", NULL, SU_OUTLET_GROUP | SU_TYPE_DAISY_1, - &marlin_threshold_current_alarms_info[0] }, + &marlin_threshold_current_alarms_info[0]), /* groupCurrentPercentLoad.0.1 = Integer: 0 */ - { "outlet.group.%i.load", 0, 1.0, + snmp_info_default("outlet.group.%i.load", 0, 1.0, ".1.3.6.1.4.1.534.6.6.7.5.4.1.10.%i.%i", - NULL, SU_FLAG_NEGINVALID | SU_OUTLET_GROUP | SU_TYPE_DAISY_1, NULL }, + NULL, SU_FLAG_NEGINVALID | SU_OUTLET_GROUP | SU_TYPE_DAISY_1, NULL), /* groupCurrentThLowerWarning.0.1 = Integer: 0 */ - { "outlet.group.%i.current.low.warning", ST_FLAG_RW, 0.001, + snmp_info_default("outlet.group.%i.current.low.warning", ST_FLAG_RW, 0.001, ".1.3.6.1.4.1.534.6.6.7.5.4.1.5.%i.%i", - NULL, SU_FLAG_NEGINVALID | SU_OUTLET_GROUP | SU_TYPE_DAISY_1, NULL }, + NULL, SU_FLAG_NEGINVALID | SU_OUTLET_GROUP | SU_TYPE_DAISY_1, NULL), /* groupCurrentThLowerCritical.0.1 = Integer: -1 */ - { "outlet.group.%i.current.low.critical", ST_FLAG_RW, 0.001, + snmp_info_default("outlet.group.%i.current.low.critical", ST_FLAG_RW, 0.001, ".1.3.6.1.4.1.534.6.6.7.5.4.1.6.%i.%i", - NULL, SU_FLAG_NEGINVALID | SU_OUTLET_GROUP | SU_TYPE_DAISY_1, NULL }, + NULL, SU_FLAG_NEGINVALID | SU_OUTLET_GROUP | SU_TYPE_DAISY_1, NULL), /* groupCurrentThUpperWarning.0.1 = Integer: 12800 */ - { "outlet.group.%i.current.high.warning", ST_FLAG_RW, 0.001, + snmp_info_default("outlet.group.%i.current.high.warning", ST_FLAG_RW, 0.001, ".1.3.6.1.4.1.534.6.6.7.5.4.1.7.%i.%i", - NULL, SU_FLAG_NEGINVALID | SU_OUTLET_GROUP | SU_TYPE_DAISY_1, NULL }, + NULL, SU_FLAG_NEGINVALID | SU_OUTLET_GROUP | SU_TYPE_DAISY_1, NULL), /* groupCurrentThUpperCritical.0.1 = Integer: 16000 */ - { "outlet.group.%i.current.high.critical", ST_FLAG_RW, 0.001, + snmp_info_default("outlet.group.%i.current.high.critical", ST_FLAG_RW, 0.001, ".1.3.6.1.4.1.534.6.6.7.5.4.1.8.%i.%i", - NULL, SU_FLAG_NEGINVALID | SU_OUTLET_GROUP | SU_TYPE_DAISY_1, NULL }, + NULL, SU_FLAG_NEGINVALID | SU_OUTLET_GROUP | SU_TYPE_DAISY_1, NULL), /* groupWatts.0.1 = Integer: 2670 */ - { "outlet.group.%i.realpower", 0, 1.0, + snmp_info_default("outlet.group.%i.realpower", 0, 1.0, ".1.3.6.1.4.1.534.6.6.7.5.5.1.3.%i.%i", - NULL, SU_FLAG_NEGINVALID | SU_OUTLET_GROUP | SU_TYPE_DAISY_1, NULL }, + NULL, SU_FLAG_NEGINVALID | SU_OUTLET_GROUP | SU_TYPE_DAISY_1, NULL), /* groupVA.0.1 = Integer: 3132 */ - { "outlet.group.%i.power", 0, 1.0, + snmp_info_default("outlet.group.%i.power", 0, 1.0, ".1.3.6.1.4.1.534.6.6.7.5.5.1.2.%i.%i", NULL, SU_FLAG_NEGINVALID | SU_OUTLET_GROUP | SU_TYPE_DAISY_1, - NULL }, + NULL), /* Input to which an outlet-group is connected * groupInputIndex.0.1 = Integer: 1 */ /* FIXME: RFC on key name is needed when backporting to NUT upstream */ - { "outlet.group.%i.input", 0, 1, + snmp_info_default("outlet.group.%i.input", 0, 1, ".1.3.6.1.4.1.534.6.6.7.5.1.1.9.%i.%i", NULL, SU_FLAG_NEGINVALID | SU_OUTLET_GROUP | SU_TYPE_DAISY_1, - NULL }, + NULL), /* instant commands. */ /* Notes: @@ -1278,90 +1290,90 @@ static snmp_info_t eaton_marlin_mib[] = { * -1 : Cancel * we currently use "0", so instant On | Off | Reboot... */ /* no counterpart found! - { "outlet.load.off", 0, DO_OFF, AR_OID_OUTLET_STATUS ".0", - NULL, SU_TYPE_CMD, NULL }, - { "outlet.load.on", 0, DO_ON, AR_OID_OUTLET_STATUS ".0", - NULL, SU_TYPE_CMD, NULL }, - { "outlet.load.cycle", 0, DO_CYCLE, AR_OID_OUTLET_STATUS ".0", - NULL, SU_TYPE_CMD, NULL }, */ + snmp_info_default("outlet.load.off", 0, DO_OFF, AR_OID_OUTLET_STATUS ".0", + NULL, SU_TYPE_CMD, NULL), + snmp_info_default("outlet.load.on", 0, DO_ON, AR_OID_OUTLET_STATUS ".0", + NULL, SU_TYPE_CMD, NULL), + snmp_info_default("outlet.load.cycle", 0, DO_CYCLE, AR_OID_OUTLET_STATUS ".0", + NULL, SU_TYPE_CMD, NULL), */ /* Delays handling: * 0-n :Time in seconds until the group command is issued * -1:Cancel a pending group-level Off/On/Reboot command */ - { "outlet.%i.load.off", 0, 1, + snmp_info_default("outlet.%i.load.off", 0, 1, ".1.3.6.1.4.1.534.6.6.7.6.6.1.3.%i.%i", - "0", SU_TYPE_CMD | SU_OUTLET | SU_TYPE_DAISY_1, NULL }, - { "outlet.%i.load.on", 0, 1, + "0", SU_TYPE_CMD | SU_OUTLET | SU_TYPE_DAISY_1, NULL), + snmp_info_default("outlet.%i.load.on", 0, 1, ".1.3.6.1.4.1.534.6.6.7.6.6.1.4.%i.%i", - "0", SU_TYPE_CMD | SU_OUTLET | SU_TYPE_DAISY_1, NULL }, - { "outlet.%i.load.cycle", 0, 1, + "0", SU_TYPE_CMD | SU_OUTLET | SU_TYPE_DAISY_1, NULL), + snmp_info_default("outlet.%i.load.cycle", 0, 1, ".1.3.6.1.4.1.534.6.6.7.6.6.1.5.%i.%i", - "0", SU_TYPE_CMD | SU_OUTLET | SU_TYPE_DAISY_1, NULL }, + "0", SU_TYPE_CMD | SU_OUTLET | SU_TYPE_DAISY_1, NULL), /* Per-outlet shutdown / startup delay (configuration point, not the timers) * outletControlShutoffDelay.0.3 = INTEGER: 120 * outletControlSequenceDelay.0.8 = INTEGER: 8 * (by default each output socket startup is delayed by its number in seconds) */ - { "outlet.%i.delay.shutdown", ST_FLAG_RW, 1, + snmp_info_default("outlet.%i.delay.shutdown", ST_FLAG_RW, 1, ".1.3.6.1.4.1.534.6.6.7.6.6.1.10.%i.%i", - NULL, SU_FLAG_NEGINVALID | SU_OUTLET | SU_TYPE_DAISY_1, NULL }, - { "outlet.%i.delay.start", ST_FLAG_RW, 1, + NULL, SU_FLAG_NEGINVALID | SU_OUTLET | SU_TYPE_DAISY_1, NULL), + snmp_info_default("outlet.%i.delay.start", ST_FLAG_RW, 1, ".1.3.6.1.4.1.534.6.6.7.6.6.1.7.%i.%i", - NULL, SU_FLAG_NEGINVALID | SU_OUTLET | SU_TYPE_DAISY_1, NULL }, + NULL, SU_FLAG_NEGINVALID | SU_OUTLET | SU_TYPE_DAISY_1, NULL), /* Delayed version, parameter is mandatory (so dfl is NULL)! */ - { "outlet.%i.load.off.delay", 0, 1, + snmp_info_default("outlet.%i.load.off.delay", 0, 1, ".1.3.6.1.4.1.534.6.6.7.6.6.1.3.%i.%i", - NULL, SU_TYPE_CMD | SU_OUTLET | SU_TYPE_DAISY_1, NULL }, - { "outlet.%i.load.on.delay", 0, 1, + NULL, SU_TYPE_CMD | SU_OUTLET | SU_TYPE_DAISY_1, NULL), + snmp_info_default("outlet.%i.load.on.delay", 0, 1, ".1.3.6.1.4.1.534.6.6.7.6.6.1.4.%i.%i", - NULL, SU_TYPE_CMD | SU_OUTLET | SU_TYPE_DAISY_1, NULL }, - { "outlet.%i.load.cycle.delay", 0, 1, + NULL, SU_TYPE_CMD | SU_OUTLET | SU_TYPE_DAISY_1, NULL), + snmp_info_default("outlet.%i.load.cycle.delay", 0, 1, ".1.3.6.1.4.1.534.6.6.7.6.6.1.5.%i.%i", - NULL, SU_TYPE_CMD | SU_OUTLET | SU_TYPE_DAISY_1, NULL }, + NULL, SU_TYPE_CMD | SU_OUTLET | SU_TYPE_DAISY_1, NULL), /* Per-outlet shutdown / startup timers * outletControlOffCmd.0.1 = INTEGER: -1 * outletControlOnCmd.0.1 = INTEGER: -1 */ - { "outlet.%i.timer.shutdown", 0, 1, + snmp_info_default("outlet.%i.timer.shutdown", 0, 1, ".1.3.6.1.4.1.534.6.6.7.6.6.1.3.%i.%i", - NULL, SU_OUTLET | SU_TYPE_DAISY_1, NULL }, - { "outlet.%i.timer.start", 0, 1, + NULL, SU_OUTLET | SU_TYPE_DAISY_1, NULL), + snmp_info_default("outlet.%i.timer.start", 0, 1, ".1.3.6.1.4.1.534.6.6.7.6.6.1.4.%i.%i", - NULL, SU_OUTLET | SU_TYPE_DAISY_1, NULL }, + NULL, SU_OUTLET | SU_TYPE_DAISY_1, NULL), /* Delays handling: * 0-n :Time in seconds until the group command is issued * -1:Cancel a pending group-level Off/On/Reboot command */ /* groupControlOffCmd.0.1 = Integer: -1 */ - { "outlet.group.%i.load.off", 0, 1, + snmp_info_default("outlet.group.%i.load.off", 0, 1, ".1.3.6.1.4.1.534.6.6.7.5.6.1.3.%i.%i", - "0", SU_TYPE_CMD | SU_OUTLET_GROUP | SU_TYPE_DAISY_1, NULL }, + "0", SU_TYPE_CMD | SU_OUTLET_GROUP | SU_TYPE_DAISY_1, NULL), /* groupControl0nCmd.0.1 = Integer: -1 */ - { "outlet.group.%i.load.on", 0, 1, + snmp_info_default("outlet.group.%i.load.on", 0, 1, ".1.3.6.1.4.1.534.6.6.7.5.6.1.4.%i.%i", - "0", SU_TYPE_CMD | SU_OUTLET_GROUP | SU_TYPE_DAISY_1, NULL }, + "0", SU_TYPE_CMD | SU_OUTLET_GROUP | SU_TYPE_DAISY_1, NULL), /* groupControlRebootCmd.0.1 = Integer: -1 */ - { "outlet.group.%i.load.cycle", 0, 1, + snmp_info_default("outlet.group.%i.load.cycle", 0, 1, ".1.3.6.1.4.1.534.6.6.7.5.6.1.5.%i.%i", - "0", SU_TYPE_CMD | SU_OUTLET_GROUP | SU_TYPE_DAISY_1, NULL }, + "0", SU_TYPE_CMD | SU_OUTLET_GROUP | SU_TYPE_DAISY_1, NULL), /* Delayed version, parameter is mandatory (so dfl is NULL)! */ - { "outlet.group.%i.load.off.delay", 0, 1, + snmp_info_default("outlet.group.%i.load.off.delay", 0, 1, ".1.3.6.1.4.1.534.6.6.7.5.6.1.3.%i.%i", - NULL, SU_TYPE_CMD | SU_OUTLET_GROUP | SU_TYPE_DAISY_1, NULL }, + NULL, SU_TYPE_CMD | SU_OUTLET_GROUP | SU_TYPE_DAISY_1, NULL), /* groupControl0nCmd.0.1 = Integer: -1 */ - { "outlet.group.%i.load.on.delay", 0, 1, + snmp_info_default("outlet.group.%i.load.on.delay", 0, 1, ".1.3.6.1.4.1.534.6.6.7.5.6.1.4.%i.%i", - NULL, SU_TYPE_CMD | SU_OUTLET_GROUP | SU_TYPE_DAISY_1, NULL }, + NULL, SU_TYPE_CMD | SU_OUTLET_GROUP | SU_TYPE_DAISY_1, NULL), /* groupControlRebootCmd.0.1 = Integer: -1 */ - { "outlet.group.%i.load.cycle.delay", 0, 1, + snmp_info_default("outlet.group.%i.load.cycle.delay", 0, 1, ".1.3.6.1.4.1.534.6.6.7.5.6.1.5.%i.%i", - NULL, SU_TYPE_CMD | SU_OUTLET_GROUP | SU_TYPE_DAISY_1, NULL }, + NULL, SU_TYPE_CMD | SU_OUTLET_GROUP | SU_TYPE_DAISY_1, NULL), /* end of structure. */ - { NULL, 0, 0, NULL, NULL, 0, NULL } + snmp_info_sentinel }; diff --git a/drivers/eaton-pdu-nlogic-mib.c b/drivers/eaton-pdu-nlogic-mib.c index 5a97fadd26..10d88a4e37 100644 --- a/drivers/eaton-pdu-nlogic-mib.c +++ b/drivers/eaton-pdu-nlogic-mib.c @@ -24,45 +24,45 @@ #include "eaton-pdu-nlogic-mib.h" -#define EATON_PDU_NLOGIC_MIB_VERSION "0.1" +#define EATON_PDU_NLOGIC_MIB_VERSION "0.10" #define EATON_PDU_NLOGIC_SYSOID ".1.3.6.1.4.1.534.7.1" static info_lkp_t eaton_nlogic_unit_switchability_info[] = { - { 1, "yes", NULL, NULL }, - { 2, "no", NULL, NULL }, - { 0, NULL, NULL, NULL } + info_lkp_default(1, "yes"), + info_lkp_default(2, "no"), + info_lkp_sentinel }; static info_lkp_t eaton_nlogic_outlet_status_info[] = { - { 1, "off", NULL, NULL }, - { 2, "on", NULL, NULL }, - { 3, "pendingOff", NULL, NULL }, /* transitional status */ - { 4, "pendingOn", NULL, NULL }, /* transitional status */ - { 0, NULL, NULL, NULL } + info_lkp_default(1, "off"), + info_lkp_default(2, "on"), + info_lkp_default(3, "pendingOff"), /* transitional status */ + info_lkp_default(4, "pendingOn"), /* transitional status */ + info_lkp_sentinel }; /* Note: same as marlin_outlet_type_info + i5-20R */ static info_lkp_t eaton_nlogic_outlet_type_info[] = { - { 0, "unknown", NULL, NULL }, - { 1, "iecC13", NULL, NULL }, - { 2, "iecC19", NULL, NULL }, - { 3, "i5-20R", NULL, NULL }, - { 10, "uk", NULL, NULL }, - { 11, "french", NULL, NULL }, - { 12, "schuko", NULL, NULL }, - { 20, "nema515", NULL, NULL }, - { 21, "nema51520", NULL, NULL }, - { 22, "nema520", NULL, NULL }, - { 23, "nemaL520", NULL, NULL }, - { 24, "nemaL530", NULL, NULL }, - { 25, "nema615", NULL, NULL }, - { 26, "nema620", NULL, NULL }, - { 27, "nemaL620", NULL, NULL }, - { 28, "nemaL630", NULL, NULL }, - { 29, "nemaL715", NULL, NULL }, - { 30, "rf203p277", NULL, NULL }, - { 0, NULL, NULL, NULL } + info_lkp_default(0, "unknown"), + info_lkp_default(1, "iecC13"), + info_lkp_default(2, "iecC19"), + info_lkp_default(3, "i5-20R"), + info_lkp_default(10, "uk"), + info_lkp_default(11, "french"), + info_lkp_default(12, "schuko"), + info_lkp_default(20, "nema515"), + info_lkp_default(21, "nema51520"), + info_lkp_default(22, "nema520"), + info_lkp_default(23, "nemaL520"), + info_lkp_default(24, "nemaL530"), + info_lkp_default(25, "nema615"), + info_lkp_default(26, "nema620"), + info_lkp_default(27, "nemaL620"), + info_lkp_default(28, "nemaL630"), + info_lkp_default(29, "nemaL715"), + info_lkp_default(30, "rf203p277"), + info_lkp_sentinel }; @@ -85,41 +85,41 @@ static snmp_info_t eaton_pdu_nlogic_mib[] = { /* standard MIB items; if the vendor MIB contains better OIDs for * this (e.g. with daisy-chain support), consider adding those here */ - { "device.description", ST_FLAG_STRING | ST_FLAG_RW, SU_INFOSIZE, + snmp_info_default("device.description", ST_FLAG_STRING | ST_FLAG_RW, SU_INFOSIZE, ".1.3.6.1.2.1.1.1.0", - NULL, SU_FLAG_OK, NULL }, - { "device.contact", ST_FLAG_STRING | ST_FLAG_RW, SU_INFOSIZE, + NULL, SU_FLAG_OK, NULL), + snmp_info_default("device.contact", ST_FLAG_STRING | ST_FLAG_RW, SU_INFOSIZE, ".1.3.6.1.2.1.1.4.0", - NULL, SU_FLAG_OK, NULL }, - { "device.location", ST_FLAG_STRING | ST_FLAG_RW, SU_INFOSIZE, + NULL, SU_FLAG_OK, NULL), + snmp_info_default("device.location", ST_FLAG_STRING | ST_FLAG_RW, SU_INFOSIZE, ".1.3.6.1.2.1.1.6.0", - NULL, SU_FLAG_OK, NULL }, + NULL, SU_FLAG_OK, NULL), /* Device collection */ /* pduManufacturer.1 = STRING: "EATON" */ - { "device.mfr", ST_FLAG_STRING, SU_INFOSIZE, + snmp_info_default("device.mfr", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.7.1.1.2.1.4.1", - "EATON", SU_FLAG_STATIC, NULL }, + "EATON", SU_FLAG_STATIC, NULL), /* pduModel.1 = STRING: "200-240V, 24A, 5.0kVA, 50/60Hz" */ - { "device.model", ST_FLAG_STRING, SU_INFOSIZE, + snmp_info_default("device.model", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.7.1.1.2.1.3.1", - "Eaton ePDU", SU_FLAG_STATIC, NULL }, + "Eaton ePDU", SU_FLAG_STATIC, NULL), /* pduSerialNumber.1 = STRING: "WMEL0046" */ - { "device.serial", ST_FLAG_STRING, SU_INFOSIZE, + snmp_info_default("device.serial", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.7.1.1.2.1.8.1", - NULL, SU_FLAG_STATIC, NULL }, - { "device.type", ST_FLAG_STRING, SU_INFOSIZE, + NULL, SU_FLAG_STATIC, NULL), + snmp_info_default("device.type", ST_FLAG_STRING, SU_INFOSIZE, NULL, - "pdu", SU_FLAG_STATIC | SU_FLAG_ABSENT | SU_FLAG_OK, NULL }, + "pdu", SU_FLAG_STATIC | SU_FLAG_ABSENT | SU_FLAG_OK, NULL), /* pduPartNumber.1 = STRING: "EMSV0001" */ - { "device.part", ST_FLAG_STRING, SU_INFOSIZE, + snmp_info_default("device.part", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.7.1.1.2.1.7.1", - NULL, SU_FLAG_STATIC | SU_FLAG_OK, NULL }, + NULL, SU_FLAG_STATIC | SU_FLAG_OK, NULL), /* For daisychain, there is only 1 physical interface! */ /* pduMACAddress.1 = Hex-STRING: 43 38 2D 34 35 2D 34 34 2D 33 30 2D 39 34 2D 31 */ - { "device.macaddr", ST_FLAG_STRING, SU_INFOSIZE, + snmp_info_default("device.macaddr", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.7.1.1.2.1.14.1", - "", SU_FLAG_STATIC, NULL }, + "", SU_FLAG_STATIC, NULL), /* Number of daisychained units is processed according to present units * in the chain with new G3 firmware (02.00.0051, since autumn 2017): @@ -127,138 +127,138 @@ static snmp_info_t eaton_pdu_nlogic_mib[] = { * of "," separators+1 using an inline function */ /* FIXME: inline func */ /* pduNumberPDU.0 = INTEGER: 1 */ - { "device.count", 0, 1, + snmp_info_default("device.count", 0, 1, ".1.3.6.1.4.1.534.7.1.1.1.0", "0", SU_FLAG_STATIC, - NULL /* &marlin_device_count_info[0] */ /* devices_count */ }, + NULL /* &marlin_device_count_info[0] */ /* devices_count */), /* FIXME: this entry should be SU_FLAG_SEMI_STATIC */ /* pduFirmwareVersion.1 = STRING: "1.0.6" */ - { "device.firmware", ST_FLAG_STRING, SU_INFOSIZE, + snmp_info_default("device.firmware", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.7.1.1.2.1.5.1", - "", SU_FLAG_OK, NULL }, + "", SU_FLAG_OK, NULL), /* pduFirmwareVersionTimeStamp.1 = Hex-STRING: 32 30 32 31 2F 30 35 2F 32 39 20 30 39 3A 30 36 */ - /* { "unmapped.pduFirmwareVersionTimeStamp", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.7.1.1.2.1.6.1", NULL, SU_FLAG_OK, NULL }, */ + /* snmp_info_default("unmapped.pduFirmwareVersionTimeStamp", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.7.1.1.2.1.6.1", NULL, SU_FLAG_OK, NULL), */ /* pduIdentIndex.1 = INTEGER: 1 */ - /* { "unmapped.pduIdentIndex", 0, 1, ".1.3.6.1.4.1.534.7.1.1.2.1.1.1", NULL, SU_FLAG_OK, NULL }, */ + /* snmp_info_default("unmapped.pduIdentIndex", 0, 1, ".1.3.6.1.4.1.534.7.1.1.2.1.1.1", NULL, SU_FLAG_OK, NULL), */ /* pduName.1 = "" */ /* FIXME: RFC device.name? */ - { "device.name", ST_FLAG_STRING | ST_FLAG_RW, 63, + snmp_info_default("device.name", ST_FLAG_STRING | ST_FLAG_RW, 63, ".1.3.6.1.4.1.534.7.1.1.2.1.2.1", - NULL, SU_FLAG_OK, NULL }, + NULL, SU_FLAG_OK, NULL), /* pduStatus.1 = INTEGER: 4 */ - /* { "unmapped.pduStatus", 0, 1, ".1.3.6.1.4.1.534.7.1.1.2.1.9.1", NULL, SU_FLAG_OK, NULL }, */ + /* snmp_info_default("unmapped.pduStatus", 0, 1, ".1.3.6.1.4.1.534.7.1.1.2.1.9.1", NULL, SU_FLAG_OK, NULL), */ /* Input collection */ /* pduInputPhaseCount.1 = INTEGER: 1 */ - { "input.phases", 0, 1, + snmp_info_default("input.phases", 0, 1, ".1.3.6.1.4.1.534.7.1.1.2.1.11.1", - NULL, SU_FLAG_OK, NULL }, + NULL, SU_FLAG_OK, NULL), /* pduInputType.1 = INTEGER: 1 */ - /* { "unmapped.pduInputType", 0, 1, ".1.3.6.1.4.1.534.7.1.2.1.1.1.1", NULL, SU_FLAG_OK, NULL }, */ + /* snmp_info_default("unmapped.pduInputType", 0, 1, ".1.3.6.1.4.1.534.7.1.2.1.1.1.1", NULL, SU_FLAG_OK, NULL), */ /* pduInputFrequency.1 = INTEGER: 499 */ - { "input.frequency", 0, 0.1, + snmp_info_default("input.frequency", 0, 0.1, ".1.3.6.1.4.1.534.7.1.2.1.1.2.1", - NULL, 0, NULL }, + NULL, 0, NULL), /* pduInputTotalCurrent.1 = INTEGER: 0 */ - { "input.current", 0, 0.01, ".1.3.6.1.4.1.534.7.1.2.1.1.11.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("input.current", 0, 0.01, ".1.3.6.1.4.1.534.7.1.2.1.1.11.1", NULL, SU_FLAG_OK, NULL), /* pduInputPhaseVoltage.1.1 = INTEGER: 2418 */ - { "input.voltage", 0, 0.1, + snmp_info_default("input.voltage", 0, 0.1, ".1.3.6.1.4.1.534.7.1.2.2.1.3.1.1", - NULL, SU_FLAG_OK, NULL }, + NULL, SU_FLAG_OK, NULL), /* Outlet groups collection */ /* pduGroupCount.1 = INTEGER: 1 */ - { "outlet.group.count", 0, 1, + snmp_info_default("outlet.group.count", 0, 1, ".1.3.6.1.4.1.534.7.1.1.2.1.12.1", - NULL, SU_FLAG_STATIC, NULL }, + NULL, SU_FLAG_STATIC, NULL), /* pduGroupVoltage.1.1 = INTEGER: 2418 */ - { "outlet.group.%i.voltage", 0, 0.1, + snmp_info_default("outlet.group.%i.voltage", 0, 0.1, ".1.3.6.1.4.1.534.7.1.3.1.1.5.1.%i", - NULL, SU_OUTLET_GROUP, NULL }, + NULL, SU_OUTLET_GROUP, NULL), /* pduGroupCurrent.1.1 = INTEGER: 0 */ - { "outlet.group.%i.current", 0, 1, + snmp_info_default("outlet.group.%i.current", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.12.1.%i", - NULL, SU_OUTLET_GROUP, NULL }, + NULL, SU_OUTLET_GROUP, NULL), /* Outlet collection */ /* pduOutletCount.1 = INTEGER: 6 */ - { "outlet.count", 0, 1, + snmp_info_default("outlet.count", 0, 1, ".1.3.6.1.4.1.534.7.1.1.2.1.13.1", - NULL, SU_FLAG_OK, NULL }, + NULL, SU_FLAG_OK, NULL), /* pduControllable.1 = INTEGER: 1 */ - { "outlet.switchable", ST_FLAG_STRING, SU_INFOSIZE, + snmp_info_default("outlet.switchable", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.7.1.1.2.1.10.1", "no", SU_FLAG_STATIC, - &eaton_nlogic_unit_switchability_info[0] }, + &eaton_nlogic_unit_switchability_info[0]), /* pduOutletControlSwitchable.1.1 = INTEGER: 2 */ - { "outlet.%i.switchable", ST_FLAG_RW |ST_FLAG_STRING, SU_INFOSIZE, + snmp_info_default("outlet.%i.switchable", ST_FLAG_RW |ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.7.1.5.2.1.8.1.%i", "no", SU_OUTLET, - &eaton_nlogic_unit_switchability_info[0] }, + &eaton_nlogic_unit_switchability_info[0]), /* pduOutletControlStatus.1.1 = INTEGER: 2 */ - { "outlet.%i.status", ST_FLAG_STRING, SU_INFOSIZE, + snmp_info_default("outlet.%i.status", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.7.1.5.2.1.1.1.%i", NULL, SU_OUTLET, - &eaton_nlogic_outlet_status_info[0] }, + &eaton_nlogic_outlet_status_info[0]), /* pduOutletName.1.1 = STRING: "OUTLET 1" */ - { "outlet.%i.name", ST_FLAG_RW |ST_FLAG_STRING, SU_INFOSIZE, + snmp_info_default("outlet.%i.name", ST_FLAG_RW |ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.7.1.5.1.1.2.1.%i", - NULL, SU_OUTLET, NULL }, + NULL, SU_OUTLET, NULL), /* pduOutletType.1.1 = INTEGER: 2 */ - { "outlet.%i.type", ST_FLAG_STRING, SU_INFOSIZE, + snmp_info_default("outlet.%i.type", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.7.1.5.1.1.3.1.%i", "unknown", SU_FLAG_STATIC | SU_OUTLET, - &eaton_nlogic_outlet_type_info[0] }, + &eaton_nlogic_outlet_type_info[0]), /* pduOutletCurrentRating.1.1 = INTEGER: 1600 */ - { "outlet.%i.current.nominal", 0, 0.01, + snmp_info_default("outlet.%i.current.nominal", 0, 0.01, ".1.3.6.1.4.1.534.7.1.5.1.1.4.1.%i", - NULL, SU_OUTLET | SU_FLAG_NEGINVALID, NULL }, + NULL, SU_OUTLET | SU_FLAG_NEGINVALID, NULL), /* pduOutletCurrent.1.1 = INTEGER: 0 */ - { "outlet.%i.current", 0, 0.01, + snmp_info_default("outlet.%i.current", 0, 0.01, ".1.3.6.1.4.1.534.7.1.5.1.1.5.1.%i", - NULL, SU_OUTLET | SU_FLAG_NEGINVALID, NULL }, + NULL, SU_OUTLET | SU_FLAG_NEGINVALID, NULL), /* pduOutletCurrentPercentLoad.1.1 = INTEGER: 0 */ - { "outlet.%i.load", 0, 1, + snmp_info_default("outlet.%i.load", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.11.1.%i", - NULL, SU_OUTLET | SU_FLAG_NEGINVALID, NULL }, + NULL, SU_OUTLET | SU_FLAG_NEGINVALID, NULL), /* pduOutletVA.1.1 = INTEGER: 0 */ - { "outlet.%i.power", 0, 1, + snmp_info_default("outlet.%i.power", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.12.1.%i", - NULL, SU_OUTLET | SU_FLAG_NEGINVALID, NULL }, + NULL, SU_OUTLET | SU_FLAG_NEGINVALID, NULL), /* pduOutletWatts.1.1 = INTEGER: 0 */ - { "outlet.%i.realpower", 0, 1, + snmp_info_default("outlet.%i.realpower", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.13.1.%i", - NULL, SU_OUTLET | SU_FLAG_NEGINVALID, NULL }, + NULL, SU_OUTLET | SU_FLAG_NEGINVALID, NULL), /* instant commands. */ /* pduOutletControlCommand.1.1 = INTEGER: 2 */ - { "outlet.%i.load.off", 0, 1, + snmp_info_default("outlet.%i.load.off", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.10.1.%i", - "1", SU_TYPE_CMD | SU_OUTLET, NULL }, - { "outlet.%i.load.on", 0, 1, + "1", SU_TYPE_CMD | SU_OUTLET, NULL), + snmp_info_default("outlet.%i.load.on", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.10.1.%i", - "2", SU_TYPE_CMD | SU_OUTLET, NULL }, - { "outlet.%i.load.cycle", 0, 1, + "2", SU_TYPE_CMD | SU_OUTLET, NULL), + snmp_info_default("outlet.%i.load.cycle", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.10.1.%i", - "5", SU_TYPE_CMD | SU_OUTLET, NULL }, + "5", SU_TYPE_CMD | SU_OUTLET, NULL), /* Per-outlet shutdown / startup delay (configuration point, not the timers) * (by default each output socket startup is delayed by its number in seconds) */ /* pduOutletControlShutoffDelay.1.1 = INTEGER: 0 */ - { "outlet.%i.delay.shutdown", ST_FLAG_RW, 1, + snmp_info_default("outlet.%i.delay.shutdown", ST_FLAG_RW, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.9.1.%i", - NULL, SU_FLAG_NEGINVALID | SU_OUTLET, NULL }, + NULL, SU_FLAG_NEGINVALID | SU_OUTLET, NULL), /* pduOutletControlSequenceDelay.1.1 = INTEGER: 0 */ - { "outlet.%i.delay.start", ST_FLAG_RW, 1, + snmp_info_default("outlet.%i.delay.start", ST_FLAG_RW, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.6.1.%i", - NULL, SU_FLAG_NEGINVALID | SU_OUTLET, NULL }, + NULL, SU_FLAG_NEGINVALID | SU_OUTLET, NULL), /* FIXME: need RFC! */ /* pduOutletControlRebootOffTime.1.1 = INTEGER: 5 */ - { "outlet.%i.delay.reboot", ST_FLAG_RW, 1, + snmp_info_default("outlet.%i.delay.reboot", ST_FLAG_RW, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.7.1.%i", - NULL, SU_FLAG_NEGINVALID | SU_OUTLET, NULL }, + NULL, SU_FLAG_NEGINVALID | SU_OUTLET, NULL), #if 0 @@ -266,3128 +266,3128 @@ static snmp_info_t eaton_pdu_nlogic_mib[] = { Delays are in 1 OID and command in another. These versions should take the delay, set the related OID (need the outlet index, so miss context!) and then call the command */ /* Delayed version, parameter is mandatory (so dfl is NULL)! */ - { "outlet.%i.load.off.delay", 0, 1, + snmp_info_default("outlet.%i.load.off.delay", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.10.1.%i", - NULL, SU_TYPE_CMD | SU_OUTLET, NULL }, + set "outlet.%i.delay.shutdown" + set itself to delayedOff (3) + NULL, SU_TYPE_CMD | SU_OUTLET, NULL), // + set "outlet.%i.delay.shutdown" + set itself to delayedOff (3) // &eaton_nlogic_outlet_delayed_off_info[0] - { "outlet.%i.load.on.delay", 0, 1, + snmp_info_default("outlet.%i.load.on.delay", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.10.1.%i", - NULL, SU_TYPE_CMD | SU_OUTLET, NULL }, + set "outlet.%i.delay.start" + set itself to delayedOn (4), + NULL, SU_TYPE_CMD | SU_OUTLET, NULL), // + set "outlet.%i.delay.start" + set itself to delayedOn (4), // &eaton_nlogic_outlet_delayed_on_info[0] - { "outlet.%i.load.cycle.delay", 0, 1, + snmp_info_default("outlet.%i.load.cycle.delay", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.10.1.%i", - NULL, SU_TYPE_CMD | SU_OUTLET, NULL }, + set "outlet.%i.delay.start" + set itself to delayedReboot (6), + NULL, SU_TYPE_CMD | SU_OUTLET, NULL), // + set "outlet.%i.delay.start" + set itself to delayedReboot (6), // &eaton_nlogic_outlet_delayed_reboot_info[0] #endif #if WITH_UNMAPPED_DATA_POINTS /* pduIPv4Address.1 = IpAddress: 192.168.1.55 */ - { "unmapped.pduIPv4Address", 0, 1, ".1.3.6.1.4.1.534.7.1.1.2.1.15.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduIPv4Address", 0, 1, ".1.3.6.1.4.1.534.7.1.1.2.1.15.1", NULL, SU_FLAG_OK, NULL), /* pduIPv6Address.1 = STRING: "FE80::CA45:44FF:FE30:9414" */ - { "unmapped.pduIPv6Address", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.7.1.1.2.1.16.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduIPv6Address", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.7.1.1.2.1.16.1", NULL, SU_FLAG_OK, NULL), /* pduConfigSsh.1 = INTEGER: 1 */ - { "unmapped.pduConfigSsh", 0, 1, ".1.3.6.1.4.1.534.7.1.1.3.1.2.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduConfigSsh", 0, 1, ".1.3.6.1.4.1.534.7.1.1.3.1.2.1", NULL, SU_FLAG_OK, NULL), /* pduConfigFtps.1 = INTEGER: 1 */ - { "unmapped.pduConfigFtps", 0, 1, ".1.3.6.1.4.1.534.7.1.1.3.1.3.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduConfigFtps", 0, 1, ".1.3.6.1.4.1.534.7.1.1.3.1.3.1", NULL, SU_FLAG_OK, NULL), /* pduConfigHttp.1 = INTEGER: 0 */ - { "unmapped.pduConfigHttp", 0, 1, ".1.3.6.1.4.1.534.7.1.1.3.1.4.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduConfigHttp", 0, 1, ".1.3.6.1.4.1.534.7.1.1.3.1.4.1", NULL, SU_FLAG_OK, NULL), /* pduConfigHttps.1 = INTEGER: 1 */ - { "unmapped.pduConfigHttps", 0, 1, ".1.3.6.1.4.1.534.7.1.1.3.1.5.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduConfigHttps", 0, 1, ".1.3.6.1.4.1.534.7.1.1.3.1.5.1", NULL, SU_FLAG_OK, NULL), /* pduConfigIPv4IPv6Switch.1 = INTEGER: 3 */ - { "unmapped.pduConfigIPv4IPv6Switch", 0, 1, ".1.3.6.1.4.1.534.7.1.1.3.1.6.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduConfigIPv4IPv6Switch", 0, 1, ".1.3.6.1.4.1.534.7.1.1.3.1.6.1", NULL, SU_FLAG_OK, NULL), /* pduConfigRedfishAPI.1 = INTEGER: 0 */ - { "unmapped.pduConfigRedfishAPI", 0, 1, ".1.3.6.1.4.1.534.7.1.1.3.1.7.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduConfigRedfishAPI", 0, 1, ".1.3.6.1.4.1.534.7.1.1.3.1.7.1", NULL, SU_FLAG_OK, NULL), /* pduConfigOledDispalyOrientation.1 = INTEGER: 1 */ - { "unmapped.pduConfigOledDispalyOrientation", 0, 1, ".1.3.6.1.4.1.534.7.1.1.3.1.8.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduConfigOledDispalyOrientation", 0, 1, ".1.3.6.1.4.1.534.7.1.1.3.1.8.1", NULL, SU_FLAG_OK, NULL), /* pduConfigEnergyReset.1 = INTEGER: 1 */ - { "unmapped.pduConfigEnergyReset", 0, 1, ".1.3.6.1.4.1.534.7.1.1.3.1.9.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduConfigEnergyReset", 0, 1, ".1.3.6.1.4.1.534.7.1.1.3.1.9.1", NULL, SU_FLAG_OK, NULL), /* pduConfigNetworkManagementCardReset.1 = INTEGER: 0 */ - { "unmapped.pduConfigNetworkManagementCardReset", 0, 1, ".1.3.6.1.4.1.534.7.1.1.3.1.10.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduConfigNetworkManagementCardReset", 0, 1, ".1.3.6.1.4.1.534.7.1.1.3.1.10.1", NULL, SU_FLAG_OK, NULL), /* pduConfigDaisyChainStatus.1 = INTEGER: 0 */ - { "unmapped.pduConfigDaisyChainStatus", 0, 1, ".1.3.6.1.4.1.534.7.1.1.3.1.11.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduConfigDaisyChainStatus", 0, 1, ".1.3.6.1.4.1.534.7.1.1.3.1.11.1", NULL, SU_FLAG_OK, NULL), /* pduInputFrequencyStatus.1 = INTEGER: 1 */ - { "unmapped.pduInputFrequencyStatus", 0, 1, ".1.3.6.1.4.1.534.7.1.2.1.1.3.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduInputFrequencyStatus", 0, 1, ".1.3.6.1.4.1.534.7.1.2.1.1.3.1", NULL, SU_FLAG_OK, NULL), /* pduInputPowerVA.1 = INTEGER: 0 */ - { "unmapped.pduInputPowerVA", 0, 1, ".1.3.6.1.4.1.534.7.1.2.1.1.4.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduInputPowerVA", 0, 1, ".1.3.6.1.4.1.534.7.1.2.1.1.4.1", NULL, SU_FLAG_OK, NULL), /* pduInputPowerWatts.1 = INTEGER: 0 */ - { "unmapped.pduInputPowerWatts", 0, 1, ".1.3.6.1.4.1.534.7.1.2.1.1.5.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduInputPowerWatts", 0, 1, ".1.3.6.1.4.1.534.7.1.2.1.1.5.1", NULL, SU_FLAG_OK, NULL), /* pduInputTotalEnergy.1 = INTEGER: 0 */ - { "unmapped.pduInputTotalEnergy", 0, 1, ".1.3.6.1.4.1.534.7.1.2.1.1.6.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduInputTotalEnergy", 0, 1, ".1.3.6.1.4.1.534.7.1.2.1.1.6.1", NULL, SU_FLAG_OK, NULL), /* pduInputPowerWattHourTimer.1 = Hex-STRING: 32 30 32 31 2F 30 35 2F 32 39 20 30 39 3A 30 36 */ - { "unmapped.pduInputPowerWattHourTimer", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.7.1.2.1.1.7.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduInputPowerWattHourTimer", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.7.1.2.1.1.7.1", NULL, SU_FLAG_OK, NULL), /* pduInputResettableEnergy.1 = INTEGER: 0 */ - { "unmapped.pduInputResettableEnergy", 0, 1, ".1.3.6.1.4.1.534.7.1.2.1.1.8.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduInputResettableEnergy", 0, 1, ".1.3.6.1.4.1.534.7.1.2.1.1.8.1", NULL, SU_FLAG_OK, NULL), /* pduInputPowerFactor.1 = INTEGER: 0 */ - { "unmapped.pduInputPowerFactor", 0, 1, ".1.3.6.1.4.1.534.7.1.2.1.1.9.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduInputPowerFactor", 0, 1, ".1.3.6.1.4.1.534.7.1.2.1.1.9.1", NULL, SU_FLAG_OK, NULL), /* pduInputPowerVAR.1 = INTEGER: 0 */ - { "unmapped.pduInputPowerVAR", 0, 1, ".1.3.6.1.4.1.534.7.1.2.1.1.10.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduInputPowerVAR", 0, 1, ".1.3.6.1.4.1.534.7.1.2.1.1.10.1", NULL, SU_FLAG_OK, NULL), /* pduInputPhaseIndex.1.1 = INTEGER: 1 */ - { "unmapped.pduInputPhaseIndex", 0, 1, ".1.3.6.1.4.1.534.7.1.2.2.1.1.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduInputPhaseIndex", 0, 1, ".1.3.6.1.4.1.534.7.1.2.2.1.1.1.1", NULL, SU_FLAG_OK, NULL), /* pduInputPhaseIndex.1.2 = INTEGER: 0 */ - { "unmapped.pduInputPhaseIndex", 0, 1, ".1.3.6.1.4.1.534.7.1.2.2.1.1.1.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduInputPhaseIndex", 0, 1, ".1.3.6.1.4.1.534.7.1.2.2.1.1.1.2", NULL, SU_FLAG_OK, NULL), /* pduInputPhaseIndex.1.3 = INTEGER: 0 */ - { "unmapped.pduInputPhaseIndex", 0, 1, ".1.3.6.1.4.1.534.7.1.2.2.1.1.1.3", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduInputPhaseIndex", 0, 1, ".1.3.6.1.4.1.534.7.1.2.2.1.1.1.3", NULL, SU_FLAG_OK, NULL), /* pduInputPhaseVoltageMeasType.1.1 = INTEGER: 1 */ - { "unmapped.pduInputPhaseVoltageMeasType", 0, 1, ".1.3.6.1.4.1.534.7.1.2.2.1.2.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduInputPhaseVoltageMeasType", 0, 1, ".1.3.6.1.4.1.534.7.1.2.2.1.2.1.1", NULL, SU_FLAG_OK, NULL), /* pduInputPhaseVoltageMeasType.1.2 = INTEGER: 0 */ - { "unmapped.pduInputPhaseVoltageMeasType", 0, 1, ".1.3.6.1.4.1.534.7.1.2.2.1.2.1.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduInputPhaseVoltageMeasType", 0, 1, ".1.3.6.1.4.1.534.7.1.2.2.1.2.1.2", NULL, SU_FLAG_OK, NULL), /* pduInputPhaseVoltageMeasType.1.3 = INTEGER: 0 */ - { "unmapped.pduInputPhaseVoltageMeasType", 0, 1, ".1.3.6.1.4.1.534.7.1.2.2.1.2.1.3", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduInputPhaseVoltageMeasType", 0, 1, ".1.3.6.1.4.1.534.7.1.2.2.1.2.1.3", NULL, SU_FLAG_OK, NULL), /* pduInputPhaseVoltage.1.2 = INTEGER: 0 */ - { "unmapped.pduInputPhaseVoltage", 0, 1, ".1.3.6.1.4.1.534.7.1.2.2.1.3.1.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduInputPhaseVoltage", 0, 1, ".1.3.6.1.4.1.534.7.1.2.2.1.3.1.2", NULL, SU_FLAG_OK, NULL), /* pduInputPhaseVoltage.1.3 = INTEGER: 0 */ - { "unmapped.pduInputPhaseVoltage", 0, 1, ".1.3.6.1.4.1.534.7.1.2.2.1.3.1.3", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduInputPhaseVoltage", 0, 1, ".1.3.6.1.4.1.534.7.1.2.2.1.3.1.3", NULL, SU_FLAG_OK, NULL), /* pduInputPhaseVoltageThStatus.1.1 = INTEGER: 5 */ - { "unmapped.pduInputPhaseVoltageThStatus", 0, 1, ".1.3.6.1.4.1.534.7.1.2.2.1.4.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduInputPhaseVoltageThStatus", 0, 1, ".1.3.6.1.4.1.534.7.1.2.2.1.4.1.1", NULL, SU_FLAG_OK, NULL), /* pduInputPhaseVoltageThStatus.1.2 = INTEGER: 0 */ - { "unmapped.pduInputPhaseVoltageThStatus", 0, 1, ".1.3.6.1.4.1.534.7.1.2.2.1.4.1.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduInputPhaseVoltageThStatus", 0, 1, ".1.3.6.1.4.1.534.7.1.2.2.1.4.1.2", NULL, SU_FLAG_OK, NULL), /* pduInputPhaseVoltageThStatus.1.3 = INTEGER: 0 */ - { "unmapped.pduInputPhaseVoltageThStatus", 0, 1, ".1.3.6.1.4.1.534.7.1.2.2.1.4.1.3", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduInputPhaseVoltageThStatus", 0, 1, ".1.3.6.1.4.1.534.7.1.2.2.1.4.1.3", NULL, SU_FLAG_OK, NULL), /* pduInputPhaseVoltageThLowerWarning.1.1 = INTEGER: 1900 */ - { "unmapped.pduInputPhaseVoltageThLowerWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.2.2.1.5.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduInputPhaseVoltageThLowerWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.2.2.1.5.1.1", NULL, SU_FLAG_OK, NULL), /* pduInputPhaseVoltageThLowerWarning.1.2 = INTEGER: 0 */ - { "unmapped.pduInputPhaseVoltageThLowerWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.2.2.1.5.1.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduInputPhaseVoltageThLowerWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.2.2.1.5.1.2", NULL, SU_FLAG_OK, NULL), /* pduInputPhaseVoltageThLowerWarning.1.3 = INTEGER: 0 */ - { "unmapped.pduInputPhaseVoltageThLowerWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.2.2.1.5.1.3", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduInputPhaseVoltageThLowerWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.2.2.1.5.1.3", NULL, SU_FLAG_OK, NULL), /* pduInputPhaseVoltageThLowerCritical.1.1 = INTEGER: 1800 */ - { "unmapped.pduInputPhaseVoltageThLowerCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.2.2.1.6.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduInputPhaseVoltageThLowerCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.2.2.1.6.1.1", NULL, SU_FLAG_OK, NULL), /* pduInputPhaseVoltageThLowerCritical.1.2 = INTEGER: 0 */ - { "unmapped.pduInputPhaseVoltageThLowerCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.2.2.1.6.1.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduInputPhaseVoltageThLowerCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.2.2.1.6.1.2", NULL, SU_FLAG_OK, NULL), /* pduInputPhaseVoltageThLowerCritical.1.3 = INTEGER: 0 */ - { "unmapped.pduInputPhaseVoltageThLowerCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.2.2.1.6.1.3", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduInputPhaseVoltageThLowerCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.2.2.1.6.1.3", NULL, SU_FLAG_OK, NULL), /* pduInputPhaseVoltageThUpperWarning.1.1 = INTEGER: 2150 */ - { "unmapped.pduInputPhaseVoltageThUpperWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.2.2.1.7.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduInputPhaseVoltageThUpperWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.2.2.1.7.1.1", NULL, SU_FLAG_OK, NULL), /* pduInputPhaseVoltageThUpperWarning.1.2 = INTEGER: 0 */ - { "unmapped.pduInputPhaseVoltageThUpperWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.2.2.1.7.1.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduInputPhaseVoltageThUpperWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.2.2.1.7.1.2", NULL, SU_FLAG_OK, NULL), /* pduInputPhaseVoltageThUpperWarning.1.3 = INTEGER: 0 */ - { "unmapped.pduInputPhaseVoltageThUpperWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.2.2.1.7.1.3", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduInputPhaseVoltageThUpperWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.2.2.1.7.1.3", NULL, SU_FLAG_OK, NULL), /* pduInputPhaseVoltageThUpperCritical.1.1 = INTEGER: 2250 */ - { "unmapped.pduInputPhaseVoltageThUpperCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.2.2.1.8.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduInputPhaseVoltageThUpperCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.2.2.1.8.1.1", NULL, SU_FLAG_OK, NULL), /* pduInputPhaseVoltageThUpperCritical.1.2 = INTEGER: 0 */ - { "unmapped.pduInputPhaseVoltageThUpperCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.2.2.1.8.1.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduInputPhaseVoltageThUpperCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.2.2.1.8.1.2", NULL, SU_FLAG_OK, NULL), /* pduInputPhaseVoltageThUpperCritical.1.3 = INTEGER: 0 */ - { "unmapped.pduInputPhaseVoltageThUpperCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.2.2.1.8.1.3", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduInputPhaseVoltageThUpperCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.2.2.1.8.1.3", NULL, SU_FLAG_OK, NULL), /* pduInputPhaseCurrentMeasType.1.1 = INTEGER: 1 */ - { "unmapped.pduInputPhaseCurrentMeasType", 0, 1, ".1.3.6.1.4.1.534.7.1.2.2.1.9.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduInputPhaseCurrentMeasType", 0, 1, ".1.3.6.1.4.1.534.7.1.2.2.1.9.1.1", NULL, SU_FLAG_OK, NULL), /* pduInputPhaseCurrentMeasType.1.2 = INTEGER: 0 */ - { "unmapped.pduInputPhaseCurrentMeasType", 0, 1, ".1.3.6.1.4.1.534.7.1.2.2.1.9.1.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduInputPhaseCurrentMeasType", 0, 1, ".1.3.6.1.4.1.534.7.1.2.2.1.9.1.2", NULL, SU_FLAG_OK, NULL), /* pduInputPhaseCurrentMeasType.1.3 = INTEGER: 0 */ - { "unmapped.pduInputPhaseCurrentMeasType", 0, 1, ".1.3.6.1.4.1.534.7.1.2.2.1.9.1.3", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduInputPhaseCurrentMeasType", 0, 1, ".1.3.6.1.4.1.534.7.1.2.2.1.9.1.3", NULL, SU_FLAG_OK, NULL), /* pduInputPhaseCurrentRating.1.1 = INTEGER: 2400 */ - { "unmapped.pduInputPhaseCurrentRating", 0, 1, ".1.3.6.1.4.1.534.7.1.2.2.1.10.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduInputPhaseCurrentRating", 0, 1, ".1.3.6.1.4.1.534.7.1.2.2.1.10.1.1", NULL, SU_FLAG_OK, NULL), /* pduInputPhaseCurrentRating.1.2 = INTEGER: 2400 */ - { "unmapped.pduInputPhaseCurrentRating", 0, 1, ".1.3.6.1.4.1.534.7.1.2.2.1.10.1.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduInputPhaseCurrentRating", 0, 1, ".1.3.6.1.4.1.534.7.1.2.2.1.10.1.2", NULL, SU_FLAG_OK, NULL), /* pduInputPhaseCurrentRating.1.3 = INTEGER: 2400 */ - { "unmapped.pduInputPhaseCurrentRating", 0, 1, ".1.3.6.1.4.1.534.7.1.2.2.1.10.1.3", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduInputPhaseCurrentRating", 0, 1, ".1.3.6.1.4.1.534.7.1.2.2.1.10.1.3", NULL, SU_FLAG_OK, NULL), /* pduInputPhaseCurrent.1.1 = INTEGER: 0 */ - { "unmapped.pduInputPhaseCurrent", 0, 1, ".1.3.6.1.4.1.534.7.1.2.2.1.11.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduInputPhaseCurrent", 0, 1, ".1.3.6.1.4.1.534.7.1.2.2.1.11.1.1", NULL, SU_FLAG_OK, NULL), /* pduInputPhaseCurrent.1.2 = INTEGER: 0 */ - { "unmapped.pduInputPhaseCurrent", 0, 1, ".1.3.6.1.4.1.534.7.1.2.2.1.11.1.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduInputPhaseCurrent", 0, 1, ".1.3.6.1.4.1.534.7.1.2.2.1.11.1.2", NULL, SU_FLAG_OK, NULL), /* pduInputPhaseCurrent.1.3 = INTEGER: 0 */ - { "unmapped.pduInputPhaseCurrent", 0, 1, ".1.3.6.1.4.1.534.7.1.2.2.1.11.1.3", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduInputPhaseCurrent", 0, 1, ".1.3.6.1.4.1.534.7.1.2.2.1.11.1.3", NULL, SU_FLAG_OK, NULL), /* pduInputPhaseCurrentThStatus.1.1 = INTEGER: 1 */ - { "unmapped.pduInputPhaseCurrentThStatus", 0, 1, ".1.3.6.1.4.1.534.7.1.2.2.1.12.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduInputPhaseCurrentThStatus", 0, 1, ".1.3.6.1.4.1.534.7.1.2.2.1.12.1.1", NULL, SU_FLAG_OK, NULL), /* pduInputPhaseCurrentThStatus.1.2 = INTEGER: 0 */ - { "unmapped.pduInputPhaseCurrentThStatus", 0, 1, ".1.3.6.1.4.1.534.7.1.2.2.1.12.1.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduInputPhaseCurrentThStatus", 0, 1, ".1.3.6.1.4.1.534.7.1.2.2.1.12.1.2", NULL, SU_FLAG_OK, NULL), /* pduInputPhaseCurrentThStatus.1.3 = INTEGER: 0 */ - { "unmapped.pduInputPhaseCurrentThStatus", 0, 1, ".1.3.6.1.4.1.534.7.1.2.2.1.12.1.3", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduInputPhaseCurrentThStatus", 0, 1, ".1.3.6.1.4.1.534.7.1.2.2.1.12.1.3", NULL, SU_FLAG_OK, NULL), /* pduInputPhaseCurrentThLowerWarning.1.1 = INTEGER: 0 */ - { "unmapped.pduInputPhaseCurrentThLowerWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.2.2.1.13.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduInputPhaseCurrentThLowerWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.2.2.1.13.1.1", NULL, SU_FLAG_OK, NULL), /* pduInputPhaseCurrentThLowerWarning.1.2 = INTEGER: 0 */ - { "unmapped.pduInputPhaseCurrentThLowerWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.2.2.1.13.1.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduInputPhaseCurrentThLowerWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.2.2.1.13.1.2", NULL, SU_FLAG_OK, NULL), /* pduInputPhaseCurrentThLowerWarning.1.3 = INTEGER: 0 */ - { "unmapped.pduInputPhaseCurrentThLowerWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.2.2.1.13.1.3", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduInputPhaseCurrentThLowerWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.2.2.1.13.1.3", NULL, SU_FLAG_OK, NULL), /* pduInputPhaseCurrentThLowerCritical.1.1 = INTEGER: 0 */ - { "unmapped.pduInputPhaseCurrentThLowerCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.2.2.1.14.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduInputPhaseCurrentThLowerCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.2.2.1.14.1.1", NULL, SU_FLAG_OK, NULL), /* pduInputPhaseCurrentThLowerCritical.1.2 = INTEGER: 0 */ - { "unmapped.pduInputPhaseCurrentThLowerCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.2.2.1.14.1.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduInputPhaseCurrentThLowerCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.2.2.1.14.1.2", NULL, SU_FLAG_OK, NULL), /* pduInputPhaseCurrentThLowerCritical.1.3 = INTEGER: 0 */ - { "unmapped.pduInputPhaseCurrentThLowerCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.2.2.1.14.1.3", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduInputPhaseCurrentThLowerCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.2.2.1.14.1.3", NULL, SU_FLAG_OK, NULL), /* pduInputPhaseCurrentThUpperWarning.1.1 = INTEGER: 2100 */ - { "unmapped.pduInputPhaseCurrentThUpperWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.2.2.1.15.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduInputPhaseCurrentThUpperWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.2.2.1.15.1.1", NULL, SU_FLAG_OK, NULL), /* pduInputPhaseCurrentThUpperWarning.1.2 = INTEGER: 0 */ - { "unmapped.pduInputPhaseCurrentThUpperWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.2.2.1.15.1.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduInputPhaseCurrentThUpperWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.2.2.1.15.1.2", NULL, SU_FLAG_OK, NULL), /* pduInputPhaseCurrentThUpperWarning.1.3 = INTEGER: 0 */ - { "unmapped.pduInputPhaseCurrentThUpperWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.2.2.1.15.1.3", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduInputPhaseCurrentThUpperWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.2.2.1.15.1.3", NULL, SU_FLAG_OK, NULL), /* pduInputPhaseCurrentThUpperCritical.1.1 = INTEGER: 2400 */ - { "unmapped.pduInputPhaseCurrentThUpperCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.2.2.1.16.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduInputPhaseCurrentThUpperCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.2.2.1.16.1.1", NULL, SU_FLAG_OK, NULL), /* pduInputPhaseCurrentThUpperCritical.1.2 = INTEGER: 0 */ - { "unmapped.pduInputPhaseCurrentThUpperCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.2.2.1.16.1.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduInputPhaseCurrentThUpperCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.2.2.1.16.1.2", NULL, SU_FLAG_OK, NULL), /* pduInputPhaseCurrentThUpperCritical.1.3 = INTEGER: 0 */ - { "unmapped.pduInputPhaseCurrentThUpperCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.2.2.1.16.1.3", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduInputPhaseCurrentThUpperCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.2.2.1.16.1.3", NULL, SU_FLAG_OK, NULL), /* pduInputPhaseCurrentPercentLoad.1.1 = INTEGER: 0 */ - { "unmapped.pduInputPhaseCurrentPercentLoad", 0, 1, ".1.3.6.1.4.1.534.7.1.2.2.1.17.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduInputPhaseCurrentPercentLoad", 0, 1, ".1.3.6.1.4.1.534.7.1.2.2.1.17.1.1", NULL, SU_FLAG_OK, NULL), /* pduInputPhaseCurrentPercentLoad.1.2 = INTEGER: 0 */ - { "unmapped.pduInputPhaseCurrentPercentLoad", 0, 1, ".1.3.6.1.4.1.534.7.1.2.2.1.17.1.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduInputPhaseCurrentPercentLoad", 0, 1, ".1.3.6.1.4.1.534.7.1.2.2.1.17.1.2", NULL, SU_FLAG_OK, NULL), /* pduInputPhaseCurrentPercentLoad.1.3 = INTEGER: 0 */ - { "unmapped.pduInputPhaseCurrentPercentLoad", 0, 1, ".1.3.6.1.4.1.534.7.1.2.2.1.17.1.3", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduInputPhaseCurrentPercentLoad", 0, 1, ".1.3.6.1.4.1.534.7.1.2.2.1.17.1.3", NULL, SU_FLAG_OK, NULL), /* pduInputPhasePowerMeasType.1.1 = INTEGER: 1 */ - { "unmapped.pduInputPhasePowerMeasType", 0, 1, ".1.3.6.1.4.1.534.7.1.2.2.1.18.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduInputPhasePowerMeasType", 0, 1, ".1.3.6.1.4.1.534.7.1.2.2.1.18.1.1", NULL, SU_FLAG_OK, NULL), /* pduInputPhasePowerMeasType.1.2 = INTEGER: 0 */ - { "unmapped.pduInputPhasePowerMeasType", 0, 1, ".1.3.6.1.4.1.534.7.1.2.2.1.18.1.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduInputPhasePowerMeasType", 0, 1, ".1.3.6.1.4.1.534.7.1.2.2.1.18.1.2", NULL, SU_FLAG_OK, NULL), /* pduInputPhasePowerMeasType.1.3 = INTEGER: 0 */ - { "unmapped.pduInputPhasePowerMeasType", 0, 1, ".1.3.6.1.4.1.534.7.1.2.2.1.18.1.3", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduInputPhasePowerMeasType", 0, 1, ".1.3.6.1.4.1.534.7.1.2.2.1.18.1.3", NULL, SU_FLAG_OK, NULL), /* pduInputPhasePowerVA.1.1 = INTEGER: 0 */ - { "unmapped.pduInputPhasePowerVA", 0, 1, ".1.3.6.1.4.1.534.7.1.2.2.1.19.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduInputPhasePowerVA", 0, 1, ".1.3.6.1.4.1.534.7.1.2.2.1.19.1.1", NULL, SU_FLAG_OK, NULL), /* pduInputPhasePowerVA.1.2 = INTEGER: 0 */ - { "unmapped.pduInputPhasePowerVA", 0, 1, ".1.3.6.1.4.1.534.7.1.2.2.1.19.1.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduInputPhasePowerVA", 0, 1, ".1.3.6.1.4.1.534.7.1.2.2.1.19.1.2", NULL, SU_FLAG_OK, NULL), /* pduInputPhasePowerVA.1.3 = INTEGER: 0 */ - { "unmapped.pduInputPhasePowerVA", 0, 1, ".1.3.6.1.4.1.534.7.1.2.2.1.19.1.3", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduInputPhasePowerVA", 0, 1, ".1.3.6.1.4.1.534.7.1.2.2.1.19.1.3", NULL, SU_FLAG_OK, NULL), /* pduInputPhasePowerWatts.1.1 = INTEGER: 0 */ - { "unmapped.pduInputPhasePowerWatts", 0, 1, ".1.3.6.1.4.1.534.7.1.2.2.1.20.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduInputPhasePowerWatts", 0, 1, ".1.3.6.1.4.1.534.7.1.2.2.1.20.1.1", NULL, SU_FLAG_OK, NULL), /* pduInputPhasePowerWatts.1.2 = INTEGER: 0 */ - { "unmapped.pduInputPhasePowerWatts", 0, 1, ".1.3.6.1.4.1.534.7.1.2.2.1.20.1.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduInputPhasePowerWatts", 0, 1, ".1.3.6.1.4.1.534.7.1.2.2.1.20.1.2", NULL, SU_FLAG_OK, NULL), /* pduInputPhasePowerWatts.1.3 = INTEGER: 0 */ - { "unmapped.pduInputPhasePowerWatts", 0, 1, ".1.3.6.1.4.1.534.7.1.2.2.1.20.1.3", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduInputPhasePowerWatts", 0, 1, ".1.3.6.1.4.1.534.7.1.2.2.1.20.1.3", NULL, SU_FLAG_OK, NULL), /* pduInputPhasePowerWattHour.1.1 = INTEGER: 30 */ - { "unmapped.pduInputPhasePowerWattHour", 0, 1, ".1.3.6.1.4.1.534.7.1.2.2.1.21.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduInputPhasePowerWattHour", 0, 1, ".1.3.6.1.4.1.534.7.1.2.2.1.21.1.1", NULL, SU_FLAG_OK, NULL), /* pduInputPhasePowerWattHour.1.2 = INTEGER: 0 */ - { "unmapped.pduInputPhasePowerWattHour", 0, 1, ".1.3.6.1.4.1.534.7.1.2.2.1.21.1.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduInputPhasePowerWattHour", 0, 1, ".1.3.6.1.4.1.534.7.1.2.2.1.21.1.2", NULL, SU_FLAG_OK, NULL), /* pduInputPhasePowerWattHour.1.3 = INTEGER: 0 */ - { "unmapped.pduInputPhasePowerWattHour", 0, 1, ".1.3.6.1.4.1.534.7.1.2.2.1.21.1.3", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduInputPhasePowerWattHour", 0, 1, ".1.3.6.1.4.1.534.7.1.2.2.1.21.1.3", NULL, SU_FLAG_OK, NULL), /* pduInputPhasePowerWattHourTimer.1.1 = Hex-STRING: 32 30 32 31 2F 30 35 2F 32 39 20 30 39 3A 30 36 */ - { "unmapped.pduInputPhasePowerWattHourTimer", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.7.1.2.2.1.22.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduInputPhasePowerWattHourTimer", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.7.1.2.2.1.22.1.1", NULL, SU_FLAG_OK, NULL), /* pduInputPhasePowerWattHourTimer.1.2 = Hex-STRING: 32 30 32 31 2F 30 35 2F 32 39 20 30 39 3A 30 36 */ - { "unmapped.pduInputPhasePowerWattHourTimer", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.7.1.2.2.1.22.1.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduInputPhasePowerWattHourTimer", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.7.1.2.2.1.22.1.2", NULL, SU_FLAG_OK, NULL), /* pduInputPhasePowerWattHourTimer.1.3 = Hex-STRING: 32 30 32 31 2F 30 35 2F 32 39 20 30 39 3A 30 36 */ - { "unmapped.pduInputPhasePowerWattHourTimer", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.7.1.2.2.1.22.1.3", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduInputPhasePowerWattHourTimer", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.7.1.2.2.1.22.1.3", NULL, SU_FLAG_OK, NULL), /* pduInputPhasePowerFactor.1.1 = INTEGER: 0 */ - { "unmapped.pduInputPhasePowerFactor", 0, 1, ".1.3.6.1.4.1.534.7.1.2.2.1.23.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduInputPhasePowerFactor", 0, 1, ".1.3.6.1.4.1.534.7.1.2.2.1.23.1.1", NULL, SU_FLAG_OK, NULL), /* pduInputPhasePowerFactor.1.2 = INTEGER: 0 */ - { "unmapped.pduInputPhasePowerFactor", 0, 1, ".1.3.6.1.4.1.534.7.1.2.2.1.23.1.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduInputPhasePowerFactor", 0, 1, ".1.3.6.1.4.1.534.7.1.2.2.1.23.1.2", NULL, SU_FLAG_OK, NULL), /* pduInputPhasePowerFactor.1.3 = INTEGER: 0 */ - { "unmapped.pduInputPhasePowerFactor", 0, 1, ".1.3.6.1.4.1.534.7.1.2.2.1.23.1.3", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduInputPhasePowerFactor", 0, 1, ".1.3.6.1.4.1.534.7.1.2.2.1.23.1.3", NULL, SU_FLAG_OK, NULL), /* pduInputPhasePowerVAR.1.1 = INTEGER: 0 */ - { "unmapped.pduInputPhasePowerVAR", 0, 1, ".1.3.6.1.4.1.534.7.1.2.2.1.24.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduInputPhasePowerVAR", 0, 1, ".1.3.6.1.4.1.534.7.1.2.2.1.24.1.1", NULL, SU_FLAG_OK, NULL), /* pduInputPhasePowerVAR.1.2 = INTEGER: 0 */ - { "unmapped.pduInputPhasePowerVAR", 0, 1, ".1.3.6.1.4.1.534.7.1.2.2.1.24.1.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduInputPhasePowerVAR", 0, 1, ".1.3.6.1.4.1.534.7.1.2.2.1.24.1.2", NULL, SU_FLAG_OK, NULL), /* pduInputPhasePowerVAR.1.3 = INTEGER: 0 */ - { "unmapped.pduInputPhasePowerVAR", 0, 1, ".1.3.6.1.4.1.534.7.1.2.2.1.24.1.3", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduInputPhasePowerVAR", 0, 1, ".1.3.6.1.4.1.534.7.1.2.2.1.24.1.3", NULL, SU_FLAG_OK, NULL), /* pduInputPhaseVoltageThResetThld.1.1 = INTEGER: 20 */ - { "unmapped.pduInputPhaseVoltageThResetThld", 0, 1, ".1.3.6.1.4.1.534.7.1.2.2.1.25.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduInputPhaseVoltageThResetThld", 0, 1, ".1.3.6.1.4.1.534.7.1.2.2.1.25.1.1", NULL, SU_FLAG_OK, NULL), /* pduInputPhaseVoltageThResetThld.1.2 = INTEGER: 0 */ - { "unmapped.pduInputPhaseVoltageThResetThld", 0, 1, ".1.3.6.1.4.1.534.7.1.2.2.1.25.1.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduInputPhaseVoltageThResetThld", 0, 1, ".1.3.6.1.4.1.534.7.1.2.2.1.25.1.2", NULL, SU_FLAG_OK, NULL), /* pduInputPhaseVoltageThResetThld.1.3 = INTEGER: 0 */ - { "unmapped.pduInputPhaseVoltageThResetThld", 0, 1, ".1.3.6.1.4.1.534.7.1.2.2.1.25.1.3", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduInputPhaseVoltageThResetThld", 0, 1, ".1.3.6.1.4.1.534.7.1.2.2.1.25.1.3", NULL, SU_FLAG_OK, NULL), /* pduInputPhaseVoltageThChangeDelay.1.1 = INTEGER: 0 */ - { "unmapped.pduInputPhaseVoltageThChangeDelay", 0, 1, ".1.3.6.1.4.1.534.7.1.2.2.1.26.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduInputPhaseVoltageThChangeDelay", 0, 1, ".1.3.6.1.4.1.534.7.1.2.2.1.26.1.1", NULL, SU_FLAG_OK, NULL), /* pduInputPhaseVoltageThChangeDelay.1.2 = INTEGER: 0 */ - { "unmapped.pduInputPhaseVoltageThChangeDelay", 0, 1, ".1.3.6.1.4.1.534.7.1.2.2.1.26.1.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduInputPhaseVoltageThChangeDelay", 0, 1, ".1.3.6.1.4.1.534.7.1.2.2.1.26.1.2", NULL, SU_FLAG_OK, NULL), /* pduInputPhaseVoltageThChangeDelay.1.3 = INTEGER: 0 */ - { "unmapped.pduInputPhaseVoltageThChangeDelay", 0, 1, ".1.3.6.1.4.1.534.7.1.2.2.1.26.1.3", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduInputPhaseVoltageThChangeDelay", 0, 1, ".1.3.6.1.4.1.534.7.1.2.2.1.26.1.3", NULL, SU_FLAG_OK, NULL), /* pduInputPhaseVoltageThCtrl.1.1 = INTEGER: 0 */ - { "unmapped.pduInputPhaseVoltageThCtrl", 0, 1, ".1.3.6.1.4.1.534.7.1.2.2.1.27.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduInputPhaseVoltageThCtrl", 0, 1, ".1.3.6.1.4.1.534.7.1.2.2.1.27.1.1", NULL, SU_FLAG_OK, NULL), /* pduInputPhaseVoltageThCtrl.1.2 = INTEGER: 0 */ - { "unmapped.pduInputPhaseVoltageThCtrl", 0, 1, ".1.3.6.1.4.1.534.7.1.2.2.1.27.1.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduInputPhaseVoltageThCtrl", 0, 1, ".1.3.6.1.4.1.534.7.1.2.2.1.27.1.2", NULL, SU_FLAG_OK, NULL), /* pduInputPhaseVoltageThCtrl.1.3 = INTEGER: 0 */ - { "unmapped.pduInputPhaseVoltageThCtrl", 0, 1, ".1.3.6.1.4.1.534.7.1.2.2.1.27.1.3", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduInputPhaseVoltageThCtrl", 0, 1, ".1.3.6.1.4.1.534.7.1.2.2.1.27.1.3", NULL, SU_FLAG_OK, NULL), /* pduInputPhaseCurrentThResetThld.1.1 = INTEGER: 100 */ - { "unmapped.pduInputPhaseCurrentThResetThld", 0, 1, ".1.3.6.1.4.1.534.7.1.2.2.1.28.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduInputPhaseCurrentThResetThld", 0, 1, ".1.3.6.1.4.1.534.7.1.2.2.1.28.1.1", NULL, SU_FLAG_OK, NULL), /* pduInputPhaseCurrentThResetThld.1.2 = INTEGER: 0 */ - { "unmapped.pduInputPhaseCurrentThResetThld", 0, 1, ".1.3.6.1.4.1.534.7.1.2.2.1.28.1.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduInputPhaseCurrentThResetThld", 0, 1, ".1.3.6.1.4.1.534.7.1.2.2.1.28.1.2", NULL, SU_FLAG_OK, NULL), /* pduInputPhaseCurrentThResetThld.1.3 = INTEGER: 0 */ - { "unmapped.pduInputPhaseCurrentThResetThld", 0, 1, ".1.3.6.1.4.1.534.7.1.2.2.1.28.1.3", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduInputPhaseCurrentThResetThld", 0, 1, ".1.3.6.1.4.1.534.7.1.2.2.1.28.1.3", NULL, SU_FLAG_OK, NULL), /* pduInputPhaseCurrentThChangeDelay.1.1 = INTEGER: 0 */ - { "unmapped.pduInputPhaseCurrentThChangeDelay", 0, 1, ".1.3.6.1.4.1.534.7.1.2.2.1.29.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduInputPhaseCurrentThChangeDelay", 0, 1, ".1.3.6.1.4.1.534.7.1.2.2.1.29.1.1", NULL, SU_FLAG_OK, NULL), /* pduInputPhaseCurrentThChangeDelay.1.2 = INTEGER: 0 */ - { "unmapped.pduInputPhaseCurrentThChangeDelay", 0, 1, ".1.3.6.1.4.1.534.7.1.2.2.1.29.1.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduInputPhaseCurrentThChangeDelay", 0, 1, ".1.3.6.1.4.1.534.7.1.2.2.1.29.1.2", NULL, SU_FLAG_OK, NULL), /* pduInputPhaseCurrentThChangeDelay.1.3 = INTEGER: 0 */ - { "unmapped.pduInputPhaseCurrentThChangeDelay", 0, 1, ".1.3.6.1.4.1.534.7.1.2.2.1.29.1.3", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduInputPhaseCurrentThChangeDelay", 0, 1, ".1.3.6.1.4.1.534.7.1.2.2.1.29.1.3", NULL, SU_FLAG_OK, NULL), /* pduInputPhaseCurrentThCtrl.1.1 = INTEGER: 12 */ - { "unmapped.pduInputPhaseCurrentThCtrl", 0, 1, ".1.3.6.1.4.1.534.7.1.2.2.1.30.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduInputPhaseCurrentThCtrl", 0, 1, ".1.3.6.1.4.1.534.7.1.2.2.1.30.1.1", NULL, SU_FLAG_OK, NULL), /* pduInputPhaseCurrentThCtrl.1.2 = INTEGER: 0 */ - { "unmapped.pduInputPhaseCurrentThCtrl", 0, 1, ".1.3.6.1.4.1.534.7.1.2.2.1.30.1.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduInputPhaseCurrentThCtrl", 0, 1, ".1.3.6.1.4.1.534.7.1.2.2.1.30.1.2", NULL, SU_FLAG_OK, NULL), /* pduInputPhaseCurrentThCtrl.1.3 = INTEGER: 0 */ - { "unmapped.pduInputPhaseCurrentThCtrl", 0, 1, ".1.3.6.1.4.1.534.7.1.2.2.1.30.1.3", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduInputPhaseCurrentThCtrl", 0, 1, ".1.3.6.1.4.1.534.7.1.2.2.1.30.1.3", NULL, SU_FLAG_OK, NULL), /* pduInputPowerThresholdThLowerWarning.1 = INTEGER: 0 */ - { "unmapped.pduInputPowerThresholdThLowerWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.2.2.1.31.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduInputPowerThresholdThLowerWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.2.2.1.31.1", NULL, SU_FLAG_OK, NULL), /* pduInputPowerThresholdThLowerCritical.1 = INTEGER: 0 */ - { "unmapped.pduInputPowerThresholdThLowerCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.2.2.1.32.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduInputPowerThresholdThLowerCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.2.2.1.32.1", NULL, SU_FLAG_OK, NULL), /* pduInputPowerThresholdThUpperWarning.1 = INTEGER: 0 */ - { "unmapped.pduInputPowerThresholdThUpperWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.2.2.1.33.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduInputPowerThresholdThUpperWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.2.2.1.33.1", NULL, SU_FLAG_OK, NULL), /* pduInputPowerThresholdThUpperCritical.1 = INTEGER: 0 */ - { "unmapped.pduInputPowerThresholdThUpperCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.2.2.1.34.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduInputPowerThresholdThUpperCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.2.2.1.34.1", NULL, SU_FLAG_OK, NULL), /* pduInputPowerThresholdThResetThld.1 = INTEGER: 0 */ - { "unmapped.pduInputPowerThresholdThResetThld", 0, 1, ".1.3.6.1.4.1.534.7.1.2.2.1.35.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduInputPowerThresholdThResetThld", 0, 1, ".1.3.6.1.4.1.534.7.1.2.2.1.35.1", NULL, SU_FLAG_OK, NULL), /* pduInputPowerThresholdThChangeDelay.1 = INTEGER: 0 */ - { "unmapped.pduInputPowerThresholdThChangeDelay", 0, 1, ".1.3.6.1.4.1.534.7.1.2.2.1.36.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduInputPowerThresholdThChangeDelay", 0, 1, ".1.3.6.1.4.1.534.7.1.2.2.1.36.1", NULL, SU_FLAG_OK, NULL), /* pduInputPowerThresholdThCtrl.1 = INTEGER: 15 */ - { "unmapped.pduInputPowerThresholdThCtrl", 0, 1, ".1.3.6.1.4.1.534.7.1.2.2.1.37.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduInputPowerThresholdThCtrl", 0, 1, ".1.3.6.1.4.1.534.7.1.2.2.1.37.1", NULL, SU_FLAG_OK, NULL), /* pduInputEnergyThresholdThUpperWarning.1 = INTEGER: 2147483 */ - { "unmapped.pduInputEnergyThresholdThUpperWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.2.2.1.38.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduInputEnergyThresholdThUpperWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.2.2.1.38.1", NULL, SU_FLAG_OK, NULL), /* pduInputEnergyThresholdThUpperCritical.1 = INTEGER: 2147483 */ - { "unmapped.pduInputEnergyThresholdThUpperCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.2.2.1.39.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduInputEnergyThresholdThUpperCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.2.2.1.39.1", NULL, SU_FLAG_OK, NULL), /* pduInputEnergyThresholdThResetThld.1 = INTEGER: 0 */ - { "unmapped.pduInputEnergyThresholdThResetThld", 0, 1, ".1.3.6.1.4.1.534.7.1.2.2.1.40.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduInputEnergyThresholdThResetThld", 0, 1, ".1.3.6.1.4.1.534.7.1.2.2.1.40.1", NULL, SU_FLAG_OK, NULL), /* pduInputEnergyThresholdThChangeDelay.1 = INTEGER: 0 */ - { "unmapped.pduInputEnergyThresholdThChangeDelay", 0, 1, ".1.3.6.1.4.1.534.7.1.2.2.1.41.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduInputEnergyThresholdThChangeDelay", 0, 1, ".1.3.6.1.4.1.534.7.1.2.2.1.41.1", NULL, SU_FLAG_OK, NULL), /* pduInputEnergyThresholdThCtrl.1 = INTEGER: 3 */ - { "unmapped.pduInputEnergyThresholdThCtrl", 0, 1, ".1.3.6.1.4.1.534.7.1.2.2.1.42.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduInputEnergyThresholdThCtrl", 0, 1, ".1.3.6.1.4.1.534.7.1.2.2.1.42.1", NULL, SU_FLAG_OK, NULL), /* pduGroupIndex.1.1 = INTEGER: 1 */ - { "unmapped.pduGroupIndex", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.1.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupIndex", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.1.1.1", NULL, SU_FLAG_OK, NULL), /* pduGroupIndex.1.2 = INTEGER: 2 */ - { "unmapped.pduGroupIndex", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.1.1.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupIndex", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.1.1.2", NULL, SU_FLAG_OK, NULL), /* pduGroupIndex.1.3 = INTEGER: 3 */ - { "unmapped.pduGroupIndex", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.1.1.3", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupIndex", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.1.1.3", NULL, SU_FLAG_OK, NULL), /* pduGroupIndex.1.4 = INTEGER: 4 */ - { "unmapped.pduGroupIndex", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.1.1.4", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupIndex", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.1.1.4", NULL, SU_FLAG_OK, NULL), /* pduGroupIndex.1.5 = INTEGER: 5 */ - { "unmapped.pduGroupIndex", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.1.1.5", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupIndex", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.1.1.5", NULL, SU_FLAG_OK, NULL), /* pduGroupIndex.1.6 = INTEGER: 6 */ - { "unmapped.pduGroupIndex", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.1.1.6", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupIndex", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.1.1.6", NULL, SU_FLAG_OK, NULL), /* pduGroupIndex.1.7 = INTEGER: 7 */ - { "unmapped.pduGroupIndex", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.1.1.7", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupIndex", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.1.1.7", NULL, SU_FLAG_OK, NULL), /* pduGroupIndex.1.8 = INTEGER: 8 */ - { "unmapped.pduGroupIndex", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.1.1.8", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupIndex", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.1.1.8", NULL, SU_FLAG_OK, NULL), /* pduGroupIndex.1.9 = INTEGER: 9 */ - { "unmapped.pduGroupIndex", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.1.1.9", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupIndex", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.1.1.9", NULL, SU_FLAG_OK, NULL), /* pduGroupIndex.1.10 = INTEGER: 10 */ - { "unmapped.pduGroupIndex", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.1.1.10", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupIndex", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.1.1.10", NULL, SU_FLAG_OK, NULL), /* pduGroupIndex.1.11 = INTEGER: 11 */ - { "unmapped.pduGroupIndex", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.1.1.11", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupIndex", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.1.1.11", NULL, SU_FLAG_OK, NULL), /* pduGroupIndex.1.12 = INTEGER: 12 */ - { "unmapped.pduGroupIndex", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.1.1.12", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupIndex", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.1.1.12", NULL, SU_FLAG_OK, NULL), /* pduGroupName.1.1 = Hex-STRING: 42 31 00 */ - { "unmapped.pduGroupName", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.7.1.3.1.1.2.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupName", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.7.1.3.1.1.2.1.1", NULL, SU_FLAG_OK, NULL), /* pduGroupName.1.2 = Hex-STRING: 00 */ - { "unmapped.pduGroupName", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.7.1.3.1.1.2.1.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupName", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.7.1.3.1.1.2.1.2", NULL, SU_FLAG_OK, NULL), /* pduGroupName.1.3 = Hex-STRING: 00 */ - { "unmapped.pduGroupName", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.7.1.3.1.1.2.1.3", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupName", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.7.1.3.1.1.2.1.3", NULL, SU_FLAG_OK, NULL), /* pduGroupName.1.4 = Hex-STRING: 00 */ - { "unmapped.pduGroupName", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.7.1.3.1.1.2.1.4", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupName", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.7.1.3.1.1.2.1.4", NULL, SU_FLAG_OK, NULL), /* pduGroupName.1.5 = Hex-STRING: 00 */ - { "unmapped.pduGroupName", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.7.1.3.1.1.2.1.5", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupName", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.7.1.3.1.1.2.1.5", NULL, SU_FLAG_OK, NULL), /* pduGroupName.1.6 = Hex-STRING: 00 */ - { "unmapped.pduGroupName", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.7.1.3.1.1.2.1.6", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupName", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.7.1.3.1.1.2.1.6", NULL, SU_FLAG_OK, NULL), /* pduGroupName.1.7 = Hex-STRING: 00 */ - { "unmapped.pduGroupName", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.7.1.3.1.1.2.1.7", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupName", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.7.1.3.1.1.2.1.7", NULL, SU_FLAG_OK, NULL), /* pduGroupName.1.8 = Hex-STRING: 00 */ - { "unmapped.pduGroupName", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.7.1.3.1.1.2.1.8", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupName", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.7.1.3.1.1.2.1.8", NULL, SU_FLAG_OK, NULL), /* pduGroupName.1.9 = Hex-STRING: 00 */ - { "unmapped.pduGroupName", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.7.1.3.1.1.2.1.9", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupName", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.7.1.3.1.1.2.1.9", NULL, SU_FLAG_OK, NULL), /* pduGroupName.1.10 = Hex-STRING: 00 */ - { "unmapped.pduGroupName", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.7.1.3.1.1.2.1.10", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupName", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.7.1.3.1.1.2.1.10", NULL, SU_FLAG_OK, NULL), /* pduGroupName.1.11 = Hex-STRING: 00 */ - { "unmapped.pduGroupName", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.7.1.3.1.1.2.1.11", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupName", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.7.1.3.1.1.2.1.11", NULL, SU_FLAG_OK, NULL), /* pduGroupName.1.12 = Hex-STRING: 00 */ - { "unmapped.pduGroupName", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.7.1.3.1.1.2.1.12", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupName", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.7.1.3.1.1.2.1.12", NULL, SU_FLAG_OK, NULL), /* pduGroupType.1.1 = INTEGER: 5 */ - { "unmapped.pduGroupType", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.3.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupType", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.3.1.1", NULL, SU_FLAG_OK, NULL), /* pduGroupType.1.2 = INTEGER: 0 */ - { "unmapped.pduGroupType", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.3.1.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupType", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.3.1.2", NULL, SU_FLAG_OK, NULL), /* pduGroupType.1.3 = INTEGER: 0 */ - { "unmapped.pduGroupType", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.3.1.3", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupType", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.3.1.3", NULL, SU_FLAG_OK, NULL), /* pduGroupType.1.4 = INTEGER: 0 */ - { "unmapped.pduGroupType", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.3.1.4", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupType", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.3.1.4", NULL, SU_FLAG_OK, NULL), /* pduGroupType.1.5 = INTEGER: 0 */ - { "unmapped.pduGroupType", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.3.1.5", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupType", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.3.1.5", NULL, SU_FLAG_OK, NULL), /* pduGroupType.1.6 = INTEGER: 0 */ - { "unmapped.pduGroupType", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.3.1.6", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupType", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.3.1.6", NULL, SU_FLAG_OK, NULL), /* pduGroupType.1.7 = INTEGER: 0 */ - { "unmapped.pduGroupType", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.3.1.7", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupType", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.3.1.7", NULL, SU_FLAG_OK, NULL), /* pduGroupType.1.8 = INTEGER: 0 */ - { "unmapped.pduGroupType", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.3.1.8", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupType", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.3.1.8", NULL, SU_FLAG_OK, NULL), /* pduGroupType.1.9 = INTEGER: 0 */ - { "unmapped.pduGroupType", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.3.1.9", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupType", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.3.1.9", NULL, SU_FLAG_OK, NULL), /* pduGroupType.1.10 = INTEGER: 0 */ - { "unmapped.pduGroupType", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.3.1.10", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupType", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.3.1.10", NULL, SU_FLAG_OK, NULL), /* pduGroupType.1.11 = INTEGER: 0 */ - { "unmapped.pduGroupType", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.3.1.11", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupType", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.3.1.11", NULL, SU_FLAG_OK, NULL), /* pduGroupType.1.12 = INTEGER: 0 */ - { "unmapped.pduGroupType", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.3.1.12", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupType", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.3.1.12", NULL, SU_FLAG_OK, NULL), /* pduGroupVoltageMeasType.1.1 = INTEGER: 1 */ - { "unmapped.pduGroupVoltageMeasType", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.4.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupVoltageMeasType", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.4.1.1", NULL, SU_FLAG_OK, NULL), /* pduGroupVoltageMeasType.1.2 = INTEGER: 0 */ - { "unmapped.pduGroupVoltageMeasType", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.4.1.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupVoltageMeasType", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.4.1.2", NULL, SU_FLAG_OK, NULL), /* pduGroupVoltageMeasType.1.3 = INTEGER: 0 */ - { "unmapped.pduGroupVoltageMeasType", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.4.1.3", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupVoltageMeasType", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.4.1.3", NULL, SU_FLAG_OK, NULL), /* pduGroupVoltageMeasType.1.4 = INTEGER: 0 */ - { "unmapped.pduGroupVoltageMeasType", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.4.1.4", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupVoltageMeasType", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.4.1.4", NULL, SU_FLAG_OK, NULL), /* pduGroupVoltageMeasType.1.5 = INTEGER: 0 */ - { "unmapped.pduGroupVoltageMeasType", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.4.1.5", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupVoltageMeasType", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.4.1.5", NULL, SU_FLAG_OK, NULL), /* pduGroupVoltageMeasType.1.6 = INTEGER: 0 */ - { "unmapped.pduGroupVoltageMeasType", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.4.1.6", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupVoltageMeasType", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.4.1.6", NULL, SU_FLAG_OK, NULL), /* pduGroupVoltageMeasType.1.7 = INTEGER: 0 */ - { "unmapped.pduGroupVoltageMeasType", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.4.1.7", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupVoltageMeasType", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.4.1.7", NULL, SU_FLAG_OK, NULL), /* pduGroupVoltageMeasType.1.8 = INTEGER: 0 */ - { "unmapped.pduGroupVoltageMeasType", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.4.1.8", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupVoltageMeasType", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.4.1.8", NULL, SU_FLAG_OK, NULL), /* pduGroupVoltageMeasType.1.9 = INTEGER: 0 */ - { "unmapped.pduGroupVoltageMeasType", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.4.1.9", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupVoltageMeasType", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.4.1.9", NULL, SU_FLAG_OK, NULL), /* pduGroupVoltageMeasType.1.10 = INTEGER: 0 */ - { "unmapped.pduGroupVoltageMeasType", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.4.1.10", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupVoltageMeasType", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.4.1.10", NULL, SU_FLAG_OK, NULL), /* pduGroupVoltageMeasType.1.11 = INTEGER: 0 */ - { "unmapped.pduGroupVoltageMeasType", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.4.1.11", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupVoltageMeasType", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.4.1.11", NULL, SU_FLAG_OK, NULL), /* pduGroupVoltageMeasType.1.12 = INTEGER: 0 */ - { "unmapped.pduGroupVoltageMeasType", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.4.1.12", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupVoltageMeasType", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.4.1.12", NULL, SU_FLAG_OK, NULL), /* pduGroupVoltageThStatus.1.1 = INTEGER: 1 */ - { "unmapped.pduGroupVoltageThStatus", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.6.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupVoltageThStatus", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.6.1.1", NULL, SU_FLAG_OK, NULL), /* pduGroupVoltageThStatus.1.2 = INTEGER: 0 */ - { "unmapped.pduGroupVoltageThStatus", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.6.1.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupVoltageThStatus", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.6.1.2", NULL, SU_FLAG_OK, NULL), /* pduGroupVoltageThStatus.1.3 = INTEGER: 0 */ - { "unmapped.pduGroupVoltageThStatus", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.6.1.3", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupVoltageThStatus", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.6.1.3", NULL, SU_FLAG_OK, NULL), /* pduGroupVoltageThStatus.1.4 = INTEGER: 0 */ - { "unmapped.pduGroupVoltageThStatus", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.6.1.4", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupVoltageThStatus", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.6.1.4", NULL, SU_FLAG_OK, NULL), /* pduGroupVoltageThStatus.1.5 = INTEGER: 0 */ - { "unmapped.pduGroupVoltageThStatus", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.6.1.5", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupVoltageThStatus", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.6.1.5", NULL, SU_FLAG_OK, NULL), /* pduGroupVoltageThStatus.1.6 = INTEGER: 0 */ - { "unmapped.pduGroupVoltageThStatus", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.6.1.6", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupVoltageThStatus", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.6.1.6", NULL, SU_FLAG_OK, NULL), /* pduGroupVoltageThStatus.1.7 = INTEGER: 0 */ - { "unmapped.pduGroupVoltageThStatus", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.6.1.7", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupVoltageThStatus", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.6.1.7", NULL, SU_FLAG_OK, NULL), /* pduGroupVoltageThStatus.1.8 = INTEGER: 0 */ - { "unmapped.pduGroupVoltageThStatus", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.6.1.8", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupVoltageThStatus", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.6.1.8", NULL, SU_FLAG_OK, NULL), /* pduGroupVoltageThStatus.1.9 = INTEGER: 0 */ - { "unmapped.pduGroupVoltageThStatus", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.6.1.9", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupVoltageThStatus", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.6.1.9", NULL, SU_FLAG_OK, NULL), /* pduGroupVoltageThStatus.1.10 = INTEGER: 0 */ - { "unmapped.pduGroupVoltageThStatus", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.6.1.10", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupVoltageThStatus", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.6.1.10", NULL, SU_FLAG_OK, NULL), /* pduGroupVoltageThStatus.1.11 = INTEGER: 0 */ - { "unmapped.pduGroupVoltageThStatus", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.6.1.11", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupVoltageThStatus", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.6.1.11", NULL, SU_FLAG_OK, NULL), /* pduGroupVoltageThStatus.1.12 = INTEGER: 0 */ - { "unmapped.pduGroupVoltageThStatus", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.6.1.12", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupVoltageThStatus", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.6.1.12", NULL, SU_FLAG_OK, NULL), /* pduGroupVoltageThLowerWarning.1.1 = INTEGER: 0 */ - { "unmapped.pduGroupVoltageThLowerWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.7.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupVoltageThLowerWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.7.1.1", NULL, SU_FLAG_OK, NULL), /* pduGroupVoltageThLowerWarning.1.2 = INTEGER: 0 */ - { "unmapped.pduGroupVoltageThLowerWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.7.1.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupVoltageThLowerWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.7.1.2", NULL, SU_FLAG_OK, NULL), /* pduGroupVoltageThLowerWarning.1.3 = INTEGER: 0 */ - { "unmapped.pduGroupVoltageThLowerWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.7.1.3", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupVoltageThLowerWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.7.1.3", NULL, SU_FLAG_OK, NULL), /* pduGroupVoltageThLowerWarning.1.4 = INTEGER: 0 */ - { "unmapped.pduGroupVoltageThLowerWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.7.1.4", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupVoltageThLowerWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.7.1.4", NULL, SU_FLAG_OK, NULL), /* pduGroupVoltageThLowerWarning.1.5 = INTEGER: 0 */ - { "unmapped.pduGroupVoltageThLowerWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.7.1.5", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupVoltageThLowerWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.7.1.5", NULL, SU_FLAG_OK, NULL), /* pduGroupVoltageThLowerWarning.1.6 = INTEGER: 0 */ - { "unmapped.pduGroupVoltageThLowerWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.7.1.6", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupVoltageThLowerWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.7.1.6", NULL, SU_FLAG_OK, NULL), /* pduGroupVoltageThLowerWarning.1.7 = INTEGER: 0 */ - { "unmapped.pduGroupVoltageThLowerWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.7.1.7", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupVoltageThLowerWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.7.1.7", NULL, SU_FLAG_OK, NULL), /* pduGroupVoltageThLowerWarning.1.8 = INTEGER: 0 */ - { "unmapped.pduGroupVoltageThLowerWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.7.1.8", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupVoltageThLowerWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.7.1.8", NULL, SU_FLAG_OK, NULL), /* pduGroupVoltageThLowerWarning.1.9 = INTEGER: 0 */ - { "unmapped.pduGroupVoltageThLowerWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.7.1.9", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupVoltageThLowerWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.7.1.9", NULL, SU_FLAG_OK, NULL), /* pduGroupVoltageThLowerWarning.1.10 = INTEGER: 0 */ - { "unmapped.pduGroupVoltageThLowerWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.7.1.10", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupVoltageThLowerWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.7.1.10", NULL, SU_FLAG_OK, NULL), /* pduGroupVoltageThLowerWarning.1.11 = INTEGER: 0 */ - { "unmapped.pduGroupVoltageThLowerWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.7.1.11", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupVoltageThLowerWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.7.1.11", NULL, SU_FLAG_OK, NULL), /* pduGroupVoltageThLowerWarning.1.12 = INTEGER: 0 */ - { "unmapped.pduGroupVoltageThLowerWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.7.1.12", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupVoltageThLowerWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.7.1.12", NULL, SU_FLAG_OK, NULL), /* pduGroupVoltageThLowerCritical.1.1 = INTEGER: 0 */ - { "unmapped.pduGroupVoltageThLowerCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.8.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupVoltageThLowerCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.8.1.1", NULL, SU_FLAG_OK, NULL), /* pduGroupVoltageThLowerCritical.1.2 = INTEGER: 0 */ - { "unmapped.pduGroupVoltageThLowerCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.8.1.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupVoltageThLowerCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.8.1.2", NULL, SU_FLAG_OK, NULL), /* pduGroupVoltageThLowerCritical.1.3 = INTEGER: 0 */ - { "unmapped.pduGroupVoltageThLowerCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.8.1.3", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupVoltageThLowerCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.8.1.3", NULL, SU_FLAG_OK, NULL), /* pduGroupVoltageThLowerCritical.1.4 = INTEGER: 0 */ - { "unmapped.pduGroupVoltageThLowerCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.8.1.4", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupVoltageThLowerCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.8.1.4", NULL, SU_FLAG_OK, NULL), /* pduGroupVoltageThLowerCritical.1.5 = INTEGER: 0 */ - { "unmapped.pduGroupVoltageThLowerCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.8.1.5", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupVoltageThLowerCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.8.1.5", NULL, SU_FLAG_OK, NULL), /* pduGroupVoltageThLowerCritical.1.6 = INTEGER: 0 */ - { "unmapped.pduGroupVoltageThLowerCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.8.1.6", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupVoltageThLowerCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.8.1.6", NULL, SU_FLAG_OK, NULL), /* pduGroupVoltageThLowerCritical.1.7 = INTEGER: 0 */ - { "unmapped.pduGroupVoltageThLowerCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.8.1.7", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupVoltageThLowerCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.8.1.7", NULL, SU_FLAG_OK, NULL), /* pduGroupVoltageThLowerCritical.1.8 = INTEGER: 0 */ - { "unmapped.pduGroupVoltageThLowerCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.8.1.8", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupVoltageThLowerCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.8.1.8", NULL, SU_FLAG_OK, NULL), /* pduGroupVoltageThLowerCritical.1.9 = INTEGER: 0 */ - { "unmapped.pduGroupVoltageThLowerCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.8.1.9", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupVoltageThLowerCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.8.1.9", NULL, SU_FLAG_OK, NULL), /* pduGroupVoltageThLowerCritical.1.10 = INTEGER: 0 */ - { "unmapped.pduGroupVoltageThLowerCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.8.1.10", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupVoltageThLowerCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.8.1.10", NULL, SU_FLAG_OK, NULL), /* pduGroupVoltageThLowerCritical.1.11 = INTEGER: 0 */ - { "unmapped.pduGroupVoltageThLowerCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.8.1.11", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupVoltageThLowerCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.8.1.11", NULL, SU_FLAG_OK, NULL), /* pduGroupVoltageThLowerCritical.1.12 = INTEGER: 0 */ - { "unmapped.pduGroupVoltageThLowerCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.8.1.12", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupVoltageThLowerCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.8.1.12", NULL, SU_FLAG_OK, NULL), /* pduGroupVoltageThUpperWarning.1.1 = INTEGER: 0 */ - { "unmapped.pduGroupVoltageThUpperWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.9.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupVoltageThUpperWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.9.1.1", NULL, SU_FLAG_OK, NULL), /* pduGroupVoltageThUpperWarning.1.2 = INTEGER: 0 */ - { "unmapped.pduGroupVoltageThUpperWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.9.1.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupVoltageThUpperWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.9.1.2", NULL, SU_FLAG_OK, NULL), /* pduGroupVoltageThUpperWarning.1.3 = INTEGER: 0 */ - { "unmapped.pduGroupVoltageThUpperWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.9.1.3", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupVoltageThUpperWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.9.1.3", NULL, SU_FLAG_OK, NULL), /* pduGroupVoltageThUpperWarning.1.4 = INTEGER: 0 */ - { "unmapped.pduGroupVoltageThUpperWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.9.1.4", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupVoltageThUpperWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.9.1.4", NULL, SU_FLAG_OK, NULL), /* pduGroupVoltageThUpperWarning.1.5 = INTEGER: 0 */ - { "unmapped.pduGroupVoltageThUpperWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.9.1.5", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupVoltageThUpperWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.9.1.5", NULL, SU_FLAG_OK, NULL), /* pduGroupVoltageThUpperWarning.1.6 = INTEGER: 0 */ - { "unmapped.pduGroupVoltageThUpperWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.9.1.6", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupVoltageThUpperWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.9.1.6", NULL, SU_FLAG_OK, NULL), /* pduGroupVoltageThUpperWarning.1.7 = INTEGER: 0 */ - { "unmapped.pduGroupVoltageThUpperWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.9.1.7", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupVoltageThUpperWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.9.1.7", NULL, SU_FLAG_OK, NULL), /* pduGroupVoltageThUpperWarning.1.8 = INTEGER: 0 */ - { "unmapped.pduGroupVoltageThUpperWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.9.1.8", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupVoltageThUpperWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.9.1.8", NULL, SU_FLAG_OK, NULL), /* pduGroupVoltageThUpperWarning.1.9 = INTEGER: 0 */ - { "unmapped.pduGroupVoltageThUpperWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.9.1.9", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupVoltageThUpperWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.9.1.9", NULL, SU_FLAG_OK, NULL), /* pduGroupVoltageThUpperWarning.1.10 = INTEGER: 0 */ - { "unmapped.pduGroupVoltageThUpperWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.9.1.10", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupVoltageThUpperWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.9.1.10", NULL, SU_FLAG_OK, NULL), /* pduGroupVoltageThUpperWarning.1.11 = INTEGER: 0 */ - { "unmapped.pduGroupVoltageThUpperWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.9.1.11", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupVoltageThUpperWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.9.1.11", NULL, SU_FLAG_OK, NULL), /* pduGroupVoltageThUpperWarning.1.12 = INTEGER: 0 */ - { "unmapped.pduGroupVoltageThUpperWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.9.1.12", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupVoltageThUpperWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.9.1.12", NULL, SU_FLAG_OK, NULL), /* pduGroupVoltageThUpperCritical.1.1 = INTEGER: 0 */ - { "unmapped.pduGroupVoltageThUpperCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.10.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupVoltageThUpperCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.10.1.1", NULL, SU_FLAG_OK, NULL), /* pduGroupVoltageThUpperCritical.1.2 = INTEGER: 0 */ - { "unmapped.pduGroupVoltageThUpperCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.10.1.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupVoltageThUpperCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.10.1.2", NULL, SU_FLAG_OK, NULL), /* pduGroupVoltageThUpperCritical.1.3 = INTEGER: 0 */ - { "unmapped.pduGroupVoltageThUpperCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.10.1.3", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupVoltageThUpperCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.10.1.3", NULL, SU_FLAG_OK, NULL), /* pduGroupVoltageThUpperCritical.1.4 = INTEGER: 0 */ - { "unmapped.pduGroupVoltageThUpperCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.10.1.4", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupVoltageThUpperCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.10.1.4", NULL, SU_FLAG_OK, NULL), /* pduGroupVoltageThUpperCritical.1.5 = INTEGER: 0 */ - { "unmapped.pduGroupVoltageThUpperCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.10.1.5", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupVoltageThUpperCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.10.1.5", NULL, SU_FLAG_OK, NULL), /* pduGroupVoltageThUpperCritical.1.6 = INTEGER: 0 */ - { "unmapped.pduGroupVoltageThUpperCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.10.1.6", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupVoltageThUpperCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.10.1.6", NULL, SU_FLAG_OK, NULL), /* pduGroupVoltageThUpperCritical.1.7 = INTEGER: 0 */ - { "unmapped.pduGroupVoltageThUpperCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.10.1.7", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupVoltageThUpperCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.10.1.7", NULL, SU_FLAG_OK, NULL), /* pduGroupVoltageThUpperCritical.1.8 = INTEGER: 0 */ - { "unmapped.pduGroupVoltageThUpperCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.10.1.8", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupVoltageThUpperCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.10.1.8", NULL, SU_FLAG_OK, NULL), /* pduGroupVoltageThUpperCritical.1.9 = INTEGER: 0 */ - { "unmapped.pduGroupVoltageThUpperCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.10.1.9", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupVoltageThUpperCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.10.1.9", NULL, SU_FLAG_OK, NULL), /* pduGroupVoltageThUpperCritical.1.10 = INTEGER: 0 */ - { "unmapped.pduGroupVoltageThUpperCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.10.1.10", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupVoltageThUpperCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.10.1.10", NULL, SU_FLAG_OK, NULL), /* pduGroupVoltageThUpperCritical.1.11 = INTEGER: 0 */ - { "unmapped.pduGroupVoltageThUpperCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.10.1.11", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupVoltageThUpperCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.10.1.11", NULL, SU_FLAG_OK, NULL), /* pduGroupVoltageThUpperCritical.1.12 = INTEGER: 0 */ - { "unmapped.pduGroupVoltageThUpperCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.10.1.12", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupVoltageThUpperCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.10.1.12", NULL, SU_FLAG_OK, NULL), /* pdugroupCurrentRating.1.1 = INTEGER: 0 */ - { "unmapped.pdugroupCurrentRating", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.11.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdugroupCurrentRating", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.11.1.1", NULL, SU_FLAG_OK, NULL), /* pdugroupCurrentRating.1.2 = INTEGER: 0 */ - { "unmapped.pdugroupCurrentRating", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.11.1.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdugroupCurrentRating", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.11.1.2", NULL, SU_FLAG_OK, NULL), /* pdugroupCurrentRating.1.3 = INTEGER: 0 */ - { "unmapped.pdugroupCurrentRating", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.11.1.3", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdugroupCurrentRating", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.11.1.3", NULL, SU_FLAG_OK, NULL), /* pdugroupCurrentRating.1.4 = INTEGER: 0 */ - { "unmapped.pdugroupCurrentRating", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.11.1.4", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdugroupCurrentRating", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.11.1.4", NULL, SU_FLAG_OK, NULL), /* pdugroupCurrentRating.1.5 = INTEGER: 0 */ - { "unmapped.pdugroupCurrentRating", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.11.1.5", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdugroupCurrentRating", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.11.1.5", NULL, SU_FLAG_OK, NULL), /* pdugroupCurrentRating.1.6 = INTEGER: 0 */ - { "unmapped.pdugroupCurrentRating", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.11.1.6", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdugroupCurrentRating", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.11.1.6", NULL, SU_FLAG_OK, NULL), /* pdugroupCurrentRating.1.7 = INTEGER: 0 */ - { "unmapped.pdugroupCurrentRating", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.11.1.7", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdugroupCurrentRating", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.11.1.7", NULL, SU_FLAG_OK, NULL), /* pdugroupCurrentRating.1.8 = INTEGER: 0 */ - { "unmapped.pdugroupCurrentRating", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.11.1.8", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdugroupCurrentRating", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.11.1.8", NULL, SU_FLAG_OK, NULL), /* pdugroupCurrentRating.1.9 = INTEGER: 0 */ - { "unmapped.pdugroupCurrentRating", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.11.1.9", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdugroupCurrentRating", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.11.1.9", NULL, SU_FLAG_OK, NULL), /* pdugroupCurrentRating.1.10 = INTEGER: 0 */ - { "unmapped.pdugroupCurrentRating", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.11.1.10", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdugroupCurrentRating", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.11.1.10", NULL, SU_FLAG_OK, NULL), /* pdugroupCurrentRating.1.11 = INTEGER: 0 */ - { "unmapped.pdugroupCurrentRating", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.11.1.11", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdugroupCurrentRating", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.11.1.11", NULL, SU_FLAG_OK, NULL), /* pdugroupCurrentRating.1.12 = INTEGER: 0 */ - { "unmapped.pdugroupCurrentRating", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.11.1.12", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdugroupCurrentRating", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.11.1.12", NULL, SU_FLAG_OK, NULL), /* pduGroupCurrentThStatus.1.1 = INTEGER: 1 */ - { "unmapped.pduGroupCurrentThStatus", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.13.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupCurrentThStatus", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.13.1.1", NULL, SU_FLAG_OK, NULL), /* pduGroupCurrentThStatus.1.2 = INTEGER: 0 */ - { "unmapped.pduGroupCurrentThStatus", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.13.1.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupCurrentThStatus", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.13.1.2", NULL, SU_FLAG_OK, NULL), /* pduGroupCurrentThStatus.1.3 = INTEGER: 0 */ - { "unmapped.pduGroupCurrentThStatus", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.13.1.3", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupCurrentThStatus", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.13.1.3", NULL, SU_FLAG_OK, NULL), /* pduGroupCurrentThStatus.1.4 = INTEGER: 0 */ - { "unmapped.pduGroupCurrentThStatus", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.13.1.4", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupCurrentThStatus", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.13.1.4", NULL, SU_FLAG_OK, NULL), /* pduGroupCurrentThStatus.1.5 = INTEGER: 0 */ - { "unmapped.pduGroupCurrentThStatus", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.13.1.5", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupCurrentThStatus", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.13.1.5", NULL, SU_FLAG_OK, NULL), /* pduGroupCurrentThStatus.1.6 = INTEGER: 0 */ - { "unmapped.pduGroupCurrentThStatus", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.13.1.6", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupCurrentThStatus", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.13.1.6", NULL, SU_FLAG_OK, NULL), /* pduGroupCurrentThStatus.1.7 = INTEGER: 0 */ - { "unmapped.pduGroupCurrentThStatus", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.13.1.7", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupCurrentThStatus", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.13.1.7", NULL, SU_FLAG_OK, NULL), /* pduGroupCurrentThStatus.1.8 = INTEGER: 0 */ - { "unmapped.pduGroupCurrentThStatus", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.13.1.8", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupCurrentThStatus", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.13.1.8", NULL, SU_FLAG_OK, NULL), /* pduGroupCurrentThStatus.1.9 = INTEGER: 0 */ - { "unmapped.pduGroupCurrentThStatus", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.13.1.9", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupCurrentThStatus", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.13.1.9", NULL, SU_FLAG_OK, NULL), /* pduGroupCurrentThStatus.1.10 = INTEGER: 0 */ - { "unmapped.pduGroupCurrentThStatus", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.13.1.10", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupCurrentThStatus", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.13.1.10", NULL, SU_FLAG_OK, NULL), /* pduGroupCurrentThStatus.1.11 = INTEGER: 0 */ - { "unmapped.pduGroupCurrentThStatus", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.13.1.11", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupCurrentThStatus", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.13.1.11", NULL, SU_FLAG_OK, NULL), /* pduGroupCurrentThStatus.1.12 = INTEGER: 0 */ - { "unmapped.pduGroupCurrentThStatus", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.13.1.12", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupCurrentThStatus", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.13.1.12", NULL, SU_FLAG_OK, NULL), /* pduGroupCurrentThLowerWarning.1.1 = INTEGER: 0 */ - { "unmapped.pduGroupCurrentThLowerWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.14.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupCurrentThLowerWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.14.1.1", NULL, SU_FLAG_OK, NULL), /* pduGroupCurrentThLowerWarning.1.2 = INTEGER: 0 */ - { "unmapped.pduGroupCurrentThLowerWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.14.1.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupCurrentThLowerWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.14.1.2", NULL, SU_FLAG_OK, NULL), /* pduGroupCurrentThLowerWarning.1.3 = INTEGER: 0 */ - { "unmapped.pduGroupCurrentThLowerWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.14.1.3", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupCurrentThLowerWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.14.1.3", NULL, SU_FLAG_OK, NULL), /* pduGroupCurrentThLowerWarning.1.4 = INTEGER: 0 */ - { "unmapped.pduGroupCurrentThLowerWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.14.1.4", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupCurrentThLowerWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.14.1.4", NULL, SU_FLAG_OK, NULL), /* pduGroupCurrentThLowerWarning.1.5 = INTEGER: 0 */ - { "unmapped.pduGroupCurrentThLowerWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.14.1.5", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupCurrentThLowerWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.14.1.5", NULL, SU_FLAG_OK, NULL), /* pduGroupCurrentThLowerWarning.1.6 = INTEGER: 0 */ - { "unmapped.pduGroupCurrentThLowerWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.14.1.6", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupCurrentThLowerWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.14.1.6", NULL, SU_FLAG_OK, NULL), /* pduGroupCurrentThLowerWarning.1.7 = INTEGER: 0 */ - { "unmapped.pduGroupCurrentThLowerWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.14.1.7", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupCurrentThLowerWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.14.1.7", NULL, SU_FLAG_OK, NULL), /* pduGroupCurrentThLowerWarning.1.8 = INTEGER: 0 */ - { "unmapped.pduGroupCurrentThLowerWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.14.1.8", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupCurrentThLowerWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.14.1.8", NULL, SU_FLAG_OK, NULL), /* pduGroupCurrentThLowerWarning.1.9 = INTEGER: 0 */ - { "unmapped.pduGroupCurrentThLowerWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.14.1.9", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupCurrentThLowerWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.14.1.9", NULL, SU_FLAG_OK, NULL), /* pduGroupCurrentThLowerWarning.1.10 = INTEGER: 0 */ - { "unmapped.pduGroupCurrentThLowerWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.14.1.10", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupCurrentThLowerWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.14.1.10", NULL, SU_FLAG_OK, NULL), /* pduGroupCurrentThLowerWarning.1.11 = INTEGER: 0 */ - { "unmapped.pduGroupCurrentThLowerWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.14.1.11", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupCurrentThLowerWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.14.1.11", NULL, SU_FLAG_OK, NULL), /* pduGroupCurrentThLowerWarning.1.12 = INTEGER: 0 */ - { "unmapped.pduGroupCurrentThLowerWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.14.1.12", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupCurrentThLowerWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.14.1.12", NULL, SU_FLAG_OK, NULL), /* pduGroupCurrentThLowerCritical.1.1 = INTEGER: 0 */ - { "unmapped.pduGroupCurrentThLowerCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.15.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupCurrentThLowerCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.15.1.1", NULL, SU_FLAG_OK, NULL), /* pduGroupCurrentThLowerCritical.1.2 = INTEGER: 0 */ - { "unmapped.pduGroupCurrentThLowerCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.15.1.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupCurrentThLowerCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.15.1.2", NULL, SU_FLAG_OK, NULL), /* pduGroupCurrentThLowerCritical.1.3 = INTEGER: 0 */ - { "unmapped.pduGroupCurrentThLowerCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.15.1.3", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupCurrentThLowerCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.15.1.3", NULL, SU_FLAG_OK, NULL), /* pduGroupCurrentThLowerCritical.1.4 = INTEGER: 0 */ - { "unmapped.pduGroupCurrentThLowerCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.15.1.4", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupCurrentThLowerCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.15.1.4", NULL, SU_FLAG_OK, NULL), /* pduGroupCurrentThLowerCritical.1.5 = INTEGER: 0 */ - { "unmapped.pduGroupCurrentThLowerCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.15.1.5", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupCurrentThLowerCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.15.1.5", NULL, SU_FLAG_OK, NULL), /* pduGroupCurrentThLowerCritical.1.6 = INTEGER: 0 */ - { "unmapped.pduGroupCurrentThLowerCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.15.1.6", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupCurrentThLowerCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.15.1.6", NULL, SU_FLAG_OK, NULL), /* pduGroupCurrentThLowerCritical.1.7 = INTEGER: 0 */ - { "unmapped.pduGroupCurrentThLowerCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.15.1.7", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupCurrentThLowerCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.15.1.7", NULL, SU_FLAG_OK, NULL), /* pduGroupCurrentThLowerCritical.1.8 = INTEGER: 0 */ - { "unmapped.pduGroupCurrentThLowerCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.15.1.8", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupCurrentThLowerCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.15.1.8", NULL, SU_FLAG_OK, NULL), /* pduGroupCurrentThLowerCritical.1.9 = INTEGER: 0 */ - { "unmapped.pduGroupCurrentThLowerCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.15.1.9", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupCurrentThLowerCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.15.1.9", NULL, SU_FLAG_OK, NULL), /* pduGroupCurrentThLowerCritical.1.10 = INTEGER: 0 */ - { "unmapped.pduGroupCurrentThLowerCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.15.1.10", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupCurrentThLowerCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.15.1.10", NULL, SU_FLAG_OK, NULL), /* pduGroupCurrentThLowerCritical.1.11 = INTEGER: 0 */ - { "unmapped.pduGroupCurrentThLowerCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.15.1.11", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupCurrentThLowerCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.15.1.11", NULL, SU_FLAG_OK, NULL), /* pduGroupCurrentThLowerCritical.1.12 = INTEGER: 0 */ - { "unmapped.pduGroupCurrentThLowerCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.15.1.12", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupCurrentThLowerCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.15.1.12", NULL, SU_FLAG_OK, NULL), /* pduGroupCurrentThUpperWarning.1.1 = INTEGER: 0 */ - { "unmapped.pduGroupCurrentThUpperWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.16.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupCurrentThUpperWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.16.1.1", NULL, SU_FLAG_OK, NULL), /* pduGroupCurrentThUpperWarning.1.2 = INTEGER: 0 */ - { "unmapped.pduGroupCurrentThUpperWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.16.1.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupCurrentThUpperWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.16.1.2", NULL, SU_FLAG_OK, NULL), /* pduGroupCurrentThUpperWarning.1.3 = INTEGER: 0 */ - { "unmapped.pduGroupCurrentThUpperWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.16.1.3", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupCurrentThUpperWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.16.1.3", NULL, SU_FLAG_OK, NULL), /* pduGroupCurrentThUpperWarning.1.4 = INTEGER: 0 */ - { "unmapped.pduGroupCurrentThUpperWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.16.1.4", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupCurrentThUpperWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.16.1.4", NULL, SU_FLAG_OK, NULL), /* pduGroupCurrentThUpperWarning.1.5 = INTEGER: 0 */ - { "unmapped.pduGroupCurrentThUpperWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.16.1.5", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupCurrentThUpperWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.16.1.5", NULL, SU_FLAG_OK, NULL), /* pduGroupCurrentThUpperWarning.1.6 = INTEGER: 0 */ - { "unmapped.pduGroupCurrentThUpperWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.16.1.6", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupCurrentThUpperWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.16.1.6", NULL, SU_FLAG_OK, NULL), /* pduGroupCurrentThUpperWarning.1.7 = INTEGER: 0 */ - { "unmapped.pduGroupCurrentThUpperWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.16.1.7", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupCurrentThUpperWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.16.1.7", NULL, SU_FLAG_OK, NULL), /* pduGroupCurrentThUpperWarning.1.8 = INTEGER: 0 */ - { "unmapped.pduGroupCurrentThUpperWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.16.1.8", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupCurrentThUpperWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.16.1.8", NULL, SU_FLAG_OK, NULL), /* pduGroupCurrentThUpperWarning.1.9 = INTEGER: 0 */ - { "unmapped.pduGroupCurrentThUpperWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.16.1.9", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupCurrentThUpperWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.16.1.9", NULL, SU_FLAG_OK, NULL), /* pduGroupCurrentThUpperWarning.1.10 = INTEGER: 0 */ - { "unmapped.pduGroupCurrentThUpperWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.16.1.10", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupCurrentThUpperWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.16.1.10", NULL, SU_FLAG_OK, NULL), /* pduGroupCurrentThUpperWarning.1.11 = INTEGER: 0 */ - { "unmapped.pduGroupCurrentThUpperWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.16.1.11", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupCurrentThUpperWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.16.1.11", NULL, SU_FLAG_OK, NULL), /* pduGroupCurrentThUpperWarning.1.12 = INTEGER: 0 */ - { "unmapped.pduGroupCurrentThUpperWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.16.1.12", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupCurrentThUpperWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.16.1.12", NULL, SU_FLAG_OK, NULL), /* pduGroupCurrentThUpperCritical.1.1 = INTEGER: 0 */ - { "unmapped.pduGroupCurrentThUpperCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.17.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupCurrentThUpperCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.17.1.1", NULL, SU_FLAG_OK, NULL), /* pduGroupCurrentThUpperCritical.1.2 = INTEGER: 0 */ - { "unmapped.pduGroupCurrentThUpperCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.17.1.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupCurrentThUpperCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.17.1.2", NULL, SU_FLAG_OK, NULL), /* pduGroupCurrentThUpperCritical.1.3 = INTEGER: 0 */ - { "unmapped.pduGroupCurrentThUpperCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.17.1.3", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupCurrentThUpperCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.17.1.3", NULL, SU_FLAG_OK, NULL), /* pduGroupCurrentThUpperCritical.1.4 = INTEGER: 0 */ - { "unmapped.pduGroupCurrentThUpperCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.17.1.4", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupCurrentThUpperCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.17.1.4", NULL, SU_FLAG_OK, NULL), /* pduGroupCurrentThUpperCritical.1.5 = INTEGER: 0 */ - { "unmapped.pduGroupCurrentThUpperCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.17.1.5", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupCurrentThUpperCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.17.1.5", NULL, SU_FLAG_OK, NULL), /* pduGroupCurrentThUpperCritical.1.6 = INTEGER: 0 */ - { "unmapped.pduGroupCurrentThUpperCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.17.1.6", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupCurrentThUpperCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.17.1.6", NULL, SU_FLAG_OK, NULL), /* pduGroupCurrentThUpperCritical.1.7 = INTEGER: 0 */ - { "unmapped.pduGroupCurrentThUpperCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.17.1.7", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupCurrentThUpperCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.17.1.7", NULL, SU_FLAG_OK, NULL), /* pduGroupCurrentThUpperCritical.1.8 = INTEGER: 0 */ - { "unmapped.pduGroupCurrentThUpperCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.17.1.8", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupCurrentThUpperCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.17.1.8", NULL, SU_FLAG_OK, NULL), /* pduGroupCurrentThUpperCritical.1.9 = INTEGER: 0 */ - { "unmapped.pduGroupCurrentThUpperCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.17.1.9", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupCurrentThUpperCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.17.1.9", NULL, SU_FLAG_OK, NULL), /* pduGroupCurrentThUpperCritical.1.10 = INTEGER: 0 */ - { "unmapped.pduGroupCurrentThUpperCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.17.1.10", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupCurrentThUpperCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.17.1.10", NULL, SU_FLAG_OK, NULL), /* pduGroupCurrentThUpperCritical.1.11 = INTEGER: 0 */ - { "unmapped.pduGroupCurrentThUpperCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.17.1.11", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupCurrentThUpperCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.17.1.11", NULL, SU_FLAG_OK, NULL), /* pduGroupCurrentThUpperCritical.1.12 = INTEGER: 0 */ - { "unmapped.pduGroupCurrentThUpperCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.17.1.12", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupCurrentThUpperCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.17.1.12", NULL, SU_FLAG_OK, NULL), /* pduGroupCurrentPercentLoad.1.1 = INTEGER: 0 */ - { "unmapped.pduGroupCurrentPercentLoad", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.18.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupCurrentPercentLoad", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.18.1.1", NULL, SU_FLAG_OK, NULL), /* pduGroupCurrentPercentLoad.1.2 = INTEGER: 0 */ - { "unmapped.pduGroupCurrentPercentLoad", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.18.1.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupCurrentPercentLoad", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.18.1.2", NULL, SU_FLAG_OK, NULL), /* pduGroupCurrentPercentLoad.1.3 = INTEGER: 0 */ - { "unmapped.pduGroupCurrentPercentLoad", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.18.1.3", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupCurrentPercentLoad", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.18.1.3", NULL, SU_FLAG_OK, NULL), /* pduGroupCurrentPercentLoad.1.4 = INTEGER: 0 */ - { "unmapped.pduGroupCurrentPercentLoad", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.18.1.4", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupCurrentPercentLoad", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.18.1.4", NULL, SU_FLAG_OK, NULL), /* pduGroupCurrentPercentLoad.1.5 = INTEGER: 0 */ - { "unmapped.pduGroupCurrentPercentLoad", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.18.1.5", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupCurrentPercentLoad", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.18.1.5", NULL, SU_FLAG_OK, NULL), /* pduGroupCurrentPercentLoad.1.6 = INTEGER: 0 */ - { "unmapped.pduGroupCurrentPercentLoad", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.18.1.6", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupCurrentPercentLoad", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.18.1.6", NULL, SU_FLAG_OK, NULL), /* pduGroupCurrentPercentLoad.1.7 = INTEGER: 0 */ - { "unmapped.pduGroupCurrentPercentLoad", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.18.1.7", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupCurrentPercentLoad", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.18.1.7", NULL, SU_FLAG_OK, NULL), /* pduGroupCurrentPercentLoad.1.8 = INTEGER: 0 */ - { "unmapped.pduGroupCurrentPercentLoad", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.18.1.8", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupCurrentPercentLoad", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.18.1.8", NULL, SU_FLAG_OK, NULL), /* pduGroupCurrentPercentLoad.1.9 = INTEGER: 0 */ - { "unmapped.pduGroupCurrentPercentLoad", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.18.1.9", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupCurrentPercentLoad", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.18.1.9", NULL, SU_FLAG_OK, NULL), /* pduGroupCurrentPercentLoad.1.10 = INTEGER: 0 */ - { "unmapped.pduGroupCurrentPercentLoad", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.18.1.10", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupCurrentPercentLoad", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.18.1.10", NULL, SU_FLAG_OK, NULL), /* pduGroupCurrentPercentLoad.1.11 = INTEGER: 0 */ - { "unmapped.pduGroupCurrentPercentLoad", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.18.1.11", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupCurrentPercentLoad", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.18.1.11", NULL, SU_FLAG_OK, NULL), /* pduGroupCurrentPercentLoad.1.12 = INTEGER: 0 */ - { "unmapped.pduGroupCurrentPercentLoad", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.18.1.12", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupCurrentPercentLoad", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.18.1.12", NULL, SU_FLAG_OK, NULL), /* pduGroupPowerVA.1.1 = INTEGER: 0 */ - { "unmapped.pduGroupPowerVA", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.19.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupPowerVA", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.19.1.1", NULL, SU_FLAG_OK, NULL), /* pduGroupPowerVA.1.2 = INTEGER: 0 */ - { "unmapped.pduGroupPowerVA", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.19.1.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupPowerVA", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.19.1.2", NULL, SU_FLAG_OK, NULL), /* pduGroupPowerVA.1.3 = INTEGER: 0 */ - { "unmapped.pduGroupPowerVA", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.19.1.3", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupPowerVA", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.19.1.3", NULL, SU_FLAG_OK, NULL), /* pduGroupPowerVA.1.4 = INTEGER: 0 */ - { "unmapped.pduGroupPowerVA", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.19.1.4", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupPowerVA", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.19.1.4", NULL, SU_FLAG_OK, NULL), /* pduGroupPowerVA.1.5 = INTEGER: 0 */ - { "unmapped.pduGroupPowerVA", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.19.1.5", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupPowerVA", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.19.1.5", NULL, SU_FLAG_OK, NULL), /* pduGroupPowerVA.1.6 = INTEGER: 0 */ - { "unmapped.pduGroupPowerVA", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.19.1.6", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupPowerVA", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.19.1.6", NULL, SU_FLAG_OK, NULL), /* pduGroupPowerVA.1.7 = INTEGER: 0 */ - { "unmapped.pduGroupPowerVA", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.19.1.7", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupPowerVA", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.19.1.7", NULL, SU_FLAG_OK, NULL), /* pduGroupPowerVA.1.8 = INTEGER: 0 */ - { "unmapped.pduGroupPowerVA", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.19.1.8", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupPowerVA", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.19.1.8", NULL, SU_FLAG_OK, NULL), /* pduGroupPowerVA.1.9 = INTEGER: 0 */ - { "unmapped.pduGroupPowerVA", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.19.1.9", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupPowerVA", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.19.1.9", NULL, SU_FLAG_OK, NULL), /* pduGroupPowerVA.1.10 = INTEGER: 0 */ - { "unmapped.pduGroupPowerVA", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.19.1.10", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupPowerVA", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.19.1.10", NULL, SU_FLAG_OK, NULL), /* pduGroupPowerVA.1.11 = INTEGER: 0 */ - { "unmapped.pduGroupPowerVA", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.19.1.11", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupPowerVA", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.19.1.11", NULL, SU_FLAG_OK, NULL), /* pduGroupPowerVA.1.12 = INTEGER: 0 */ - { "unmapped.pduGroupPowerVA", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.19.1.12", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupPowerVA", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.19.1.12", NULL, SU_FLAG_OK, NULL), /* pduGroupPowerWatts.1.1 = INTEGER: 0 */ - { "unmapped.pduGroupPowerWatts", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.20.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupPowerWatts", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.20.1.1", NULL, SU_FLAG_OK, NULL), /* pduGroupPowerWatts.1.2 = INTEGER: 0 */ - { "unmapped.pduGroupPowerWatts", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.20.1.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupPowerWatts", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.20.1.2", NULL, SU_FLAG_OK, NULL), /* pduGroupPowerWatts.1.3 = INTEGER: 0 */ - { "unmapped.pduGroupPowerWatts", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.20.1.3", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupPowerWatts", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.20.1.3", NULL, SU_FLAG_OK, NULL), /* pduGroupPowerWatts.1.4 = INTEGER: 0 */ - { "unmapped.pduGroupPowerWatts", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.20.1.4", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupPowerWatts", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.20.1.4", NULL, SU_FLAG_OK, NULL), /* pduGroupPowerWatts.1.5 = INTEGER: 0 */ - { "unmapped.pduGroupPowerWatts", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.20.1.5", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupPowerWatts", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.20.1.5", NULL, SU_FLAG_OK, NULL), /* pduGroupPowerWatts.1.6 = INTEGER: 0 */ - { "unmapped.pduGroupPowerWatts", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.20.1.6", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupPowerWatts", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.20.1.6", NULL, SU_FLAG_OK, NULL), /* pduGroupPowerWatts.1.7 = INTEGER: 0 */ - { "unmapped.pduGroupPowerWatts", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.20.1.7", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupPowerWatts", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.20.1.7", NULL, SU_FLAG_OK, NULL), /* pduGroupPowerWatts.1.8 = INTEGER: 0 */ - { "unmapped.pduGroupPowerWatts", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.20.1.8", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupPowerWatts", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.20.1.8", NULL, SU_FLAG_OK, NULL), /* pduGroupPowerWatts.1.9 = INTEGER: 0 */ - { "unmapped.pduGroupPowerWatts", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.20.1.9", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupPowerWatts", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.20.1.9", NULL, SU_FLAG_OK, NULL), /* pduGroupPowerWatts.1.10 = INTEGER: 0 */ - { "unmapped.pduGroupPowerWatts", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.20.1.10", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupPowerWatts", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.20.1.10", NULL, SU_FLAG_OK, NULL), /* pduGroupPowerWatts.1.11 = INTEGER: 0 */ - { "unmapped.pduGroupPowerWatts", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.20.1.11", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupPowerWatts", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.20.1.11", NULL, SU_FLAG_OK, NULL), /* pduGroupPowerWatts.1.12 = INTEGER: 0 */ - { "unmapped.pduGroupPowerWatts", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.20.1.12", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupPowerWatts", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.20.1.12", NULL, SU_FLAG_OK, NULL), /* pduGroupPowerWattHour.1.1 = INTEGER: 0 */ - { "unmapped.pduGroupPowerWattHour", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.21.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupPowerWattHour", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.21.1.1", NULL, SU_FLAG_OK, NULL), /* pduGroupPowerWattHour.1.2 = INTEGER: 0 */ - { "unmapped.pduGroupPowerWattHour", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.21.1.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupPowerWattHour", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.21.1.2", NULL, SU_FLAG_OK, NULL), /* pduGroupPowerWattHour.1.3 = INTEGER: 0 */ - { "unmapped.pduGroupPowerWattHour", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.21.1.3", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupPowerWattHour", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.21.1.3", NULL, SU_FLAG_OK, NULL), /* pduGroupPowerWattHour.1.4 = INTEGER: 0 */ - { "unmapped.pduGroupPowerWattHour", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.21.1.4", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupPowerWattHour", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.21.1.4", NULL, SU_FLAG_OK, NULL), /* pduGroupPowerWattHour.1.5 = INTEGER: 0 */ - { "unmapped.pduGroupPowerWattHour", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.21.1.5", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupPowerWattHour", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.21.1.5", NULL, SU_FLAG_OK, NULL), /* pduGroupPowerWattHour.1.6 = INTEGER: 0 */ - { "unmapped.pduGroupPowerWattHour", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.21.1.6", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupPowerWattHour", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.21.1.6", NULL, SU_FLAG_OK, NULL), /* pduGroupPowerWattHour.1.7 = INTEGER: 0 */ - { "unmapped.pduGroupPowerWattHour", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.21.1.7", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupPowerWattHour", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.21.1.7", NULL, SU_FLAG_OK, NULL), /* pduGroupPowerWattHour.1.8 = INTEGER: 0 */ - { "unmapped.pduGroupPowerWattHour", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.21.1.8", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupPowerWattHour", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.21.1.8", NULL, SU_FLAG_OK, NULL), /* pduGroupPowerWattHour.1.9 = INTEGER: 0 */ - { "unmapped.pduGroupPowerWattHour", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.21.1.9", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupPowerWattHour", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.21.1.9", NULL, SU_FLAG_OK, NULL), /* pduGroupPowerWattHour.1.10 = INTEGER: 0 */ - { "unmapped.pduGroupPowerWattHour", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.21.1.10", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupPowerWattHour", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.21.1.10", NULL, SU_FLAG_OK, NULL), /* pduGroupPowerWattHour.1.11 = INTEGER: 0 */ - { "unmapped.pduGroupPowerWattHour", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.21.1.11", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupPowerWattHour", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.21.1.11", NULL, SU_FLAG_OK, NULL), /* pduGroupPowerWattHour.1.12 = INTEGER: 0 */ - { "unmapped.pduGroupPowerWattHour", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.21.1.12", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupPowerWattHour", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.21.1.12", NULL, SU_FLAG_OK, NULL), /* pduGroupPowerWattHourTimer.1.1 = Hex-STRING: 32 30 32 31 2F 30 35 2F 32 39 20 30 39 3A 30 36 */ - { "unmapped.pduGroupPowerWattHourTimer", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.7.1.3.1.1.22.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupPowerWattHourTimer", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.7.1.3.1.1.22.1.1", NULL, SU_FLAG_OK, NULL), /* pduGroupPowerWattHourTimer.1.2 = Hex-STRING: 32 30 32 31 2F 30 35 2F 32 39 20 30 39 3A 30 36 */ - { "unmapped.pduGroupPowerWattHourTimer", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.7.1.3.1.1.22.1.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupPowerWattHourTimer", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.7.1.3.1.1.22.1.2", NULL, SU_FLAG_OK, NULL), /* pduGroupPowerWattHourTimer.1.3 = Hex-STRING: 32 30 32 31 2F 30 35 2F 32 39 20 30 39 3A 30 36 */ - { "unmapped.pduGroupPowerWattHourTimer", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.7.1.3.1.1.22.1.3", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupPowerWattHourTimer", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.7.1.3.1.1.22.1.3", NULL, SU_FLAG_OK, NULL), /* pduGroupPowerWattHourTimer.1.4 = Hex-STRING: 32 30 32 31 2F 30 35 2F 32 39 20 30 39 3A 30 36 */ - { "unmapped.pduGroupPowerWattHourTimer", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.7.1.3.1.1.22.1.4", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupPowerWattHourTimer", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.7.1.3.1.1.22.1.4", NULL, SU_FLAG_OK, NULL), /* pduGroupPowerWattHourTimer.1.5 = Hex-STRING: 32 30 32 31 2F 30 35 2F 32 39 20 30 39 3A 30 36 */ - { "unmapped.pduGroupPowerWattHourTimer", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.7.1.3.1.1.22.1.5", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupPowerWattHourTimer", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.7.1.3.1.1.22.1.5", NULL, SU_FLAG_OK, NULL), /* pduGroupPowerWattHourTimer.1.6 = Hex-STRING: 32 30 32 31 2F 30 35 2F 32 39 20 30 39 3A 30 36 */ - { "unmapped.pduGroupPowerWattHourTimer", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.7.1.3.1.1.22.1.6", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupPowerWattHourTimer", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.7.1.3.1.1.22.1.6", NULL, SU_FLAG_OK, NULL), /* pduGroupPowerWattHourTimer.1.7 = Hex-STRING: 32 30 32 31 2F 30 35 2F 32 39 20 30 39 3A 30 36 */ - { "unmapped.pduGroupPowerWattHourTimer", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.7.1.3.1.1.22.1.7", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupPowerWattHourTimer", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.7.1.3.1.1.22.1.7", NULL, SU_FLAG_OK, NULL), /* pduGroupPowerWattHourTimer.1.8 = Hex-STRING: 32 30 32 31 2F 30 35 2F 32 39 20 30 39 3A 30 36 */ - { "unmapped.pduGroupPowerWattHourTimer", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.7.1.3.1.1.22.1.8", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupPowerWattHourTimer", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.7.1.3.1.1.22.1.8", NULL, SU_FLAG_OK, NULL), /* pduGroupPowerWattHourTimer.1.9 = Hex-STRING: 32 30 32 31 2F 30 35 2F 32 39 20 30 39 3A 30 36 */ - { "unmapped.pduGroupPowerWattHourTimer", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.7.1.3.1.1.22.1.9", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupPowerWattHourTimer", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.7.1.3.1.1.22.1.9", NULL, SU_FLAG_OK, NULL), /* pduGroupPowerWattHourTimer.1.10 = Hex-STRING: 32 30 32 31 2F 30 35 2F 32 39 20 30 39 3A 30 36 */ - { "unmapped.pduGroupPowerWattHourTimer", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.7.1.3.1.1.22.1.10", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupPowerWattHourTimer", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.7.1.3.1.1.22.1.10", NULL, SU_FLAG_OK, NULL), /* pduGroupPowerWattHourTimer.1.11 = Hex-STRING: 32 30 32 31 2F 30 35 2F 32 39 20 30 39 3A 30 36 */ - { "unmapped.pduGroupPowerWattHourTimer", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.7.1.3.1.1.22.1.11", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupPowerWattHourTimer", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.7.1.3.1.1.22.1.11", NULL, SU_FLAG_OK, NULL), /* pduGroupPowerWattHourTimer.1.12 = Hex-STRING: 32 30 32 31 2F 30 35 2F 32 39 20 30 39 3A 30 36 */ - { "unmapped.pduGroupPowerWattHourTimer", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.7.1.3.1.1.22.1.12", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupPowerWattHourTimer", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.7.1.3.1.1.22.1.12", NULL, SU_FLAG_OK, NULL), /* pduGroupPowerFactor.1.1 = INTEGER: 100 */ - { "unmapped.pduGroupPowerFactor", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.23.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupPowerFactor", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.23.1.1", NULL, SU_FLAG_OK, NULL), /* pduGroupPowerFactor.1.2 = INTEGER: 0 */ - { "unmapped.pduGroupPowerFactor", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.23.1.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupPowerFactor", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.23.1.2", NULL, SU_FLAG_OK, NULL), /* pduGroupPowerFactor.1.3 = INTEGER: 0 */ - { "unmapped.pduGroupPowerFactor", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.23.1.3", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupPowerFactor", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.23.1.3", NULL, SU_FLAG_OK, NULL), /* pduGroupPowerFactor.1.4 = INTEGER: 0 */ - { "unmapped.pduGroupPowerFactor", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.23.1.4", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupPowerFactor", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.23.1.4", NULL, SU_FLAG_OK, NULL), /* pduGroupPowerFactor.1.5 = INTEGER: 0 */ - { "unmapped.pduGroupPowerFactor", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.23.1.5", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupPowerFactor", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.23.1.5", NULL, SU_FLAG_OK, NULL), /* pduGroupPowerFactor.1.6 = INTEGER: 0 */ - { "unmapped.pduGroupPowerFactor", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.23.1.6", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupPowerFactor", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.23.1.6", NULL, SU_FLAG_OK, NULL), /* pduGroupPowerFactor.1.7 = INTEGER: 0 */ - { "unmapped.pduGroupPowerFactor", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.23.1.7", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupPowerFactor", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.23.1.7", NULL, SU_FLAG_OK, NULL), /* pduGroupPowerFactor.1.8 = INTEGER: 0 */ - { "unmapped.pduGroupPowerFactor", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.23.1.8", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupPowerFactor", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.23.1.8", NULL, SU_FLAG_OK, NULL), /* pduGroupPowerFactor.1.9 = INTEGER: 0 */ - { "unmapped.pduGroupPowerFactor", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.23.1.9", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupPowerFactor", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.23.1.9", NULL, SU_FLAG_OK, NULL), /* pduGroupPowerFactor.1.10 = INTEGER: 0 */ - { "unmapped.pduGroupPowerFactor", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.23.1.10", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupPowerFactor", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.23.1.10", NULL, SU_FLAG_OK, NULL), /* pduGroupPowerFactor.1.11 = INTEGER: 0 */ - { "unmapped.pduGroupPowerFactor", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.23.1.11", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupPowerFactor", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.23.1.11", NULL, SU_FLAG_OK, NULL), /* pduGroupPowerFactor.1.12 = INTEGER: 0 */ - { "unmapped.pduGroupPowerFactor", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.23.1.12", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupPowerFactor", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.23.1.12", NULL, SU_FLAG_OK, NULL), /* pduGroupPowerVAR.1.1 = INTEGER: 0 */ - { "unmapped.pduGroupPowerVAR", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.24.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupPowerVAR", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.24.1.1", NULL, SU_FLAG_OK, NULL), /* pduGroupPowerVAR.1.2 = INTEGER: 0 */ - { "unmapped.pduGroupPowerVAR", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.24.1.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupPowerVAR", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.24.1.2", NULL, SU_FLAG_OK, NULL), /* pduGroupPowerVAR.1.3 = INTEGER: 0 */ - { "unmapped.pduGroupPowerVAR", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.24.1.3", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupPowerVAR", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.24.1.3", NULL, SU_FLAG_OK, NULL), /* pduGroupPowerVAR.1.4 = INTEGER: 0 */ - { "unmapped.pduGroupPowerVAR", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.24.1.4", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupPowerVAR", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.24.1.4", NULL, SU_FLAG_OK, NULL), /* pduGroupPowerVAR.1.5 = INTEGER: 0 */ - { "unmapped.pduGroupPowerVAR", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.24.1.5", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupPowerVAR", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.24.1.5", NULL, SU_FLAG_OK, NULL), /* pduGroupPowerVAR.1.6 = INTEGER: 0 */ - { "unmapped.pduGroupPowerVAR", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.24.1.6", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupPowerVAR", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.24.1.6", NULL, SU_FLAG_OK, NULL), /* pduGroupPowerVAR.1.7 = INTEGER: 0 */ - { "unmapped.pduGroupPowerVAR", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.24.1.7", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupPowerVAR", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.24.1.7", NULL, SU_FLAG_OK, NULL), /* pduGroupPowerVAR.1.8 = INTEGER: 0 */ - { "unmapped.pduGroupPowerVAR", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.24.1.8", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupPowerVAR", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.24.1.8", NULL, SU_FLAG_OK, NULL), /* pduGroupPowerVAR.1.9 = INTEGER: 0 */ - { "unmapped.pduGroupPowerVAR", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.24.1.9", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupPowerVAR", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.24.1.9", NULL, SU_FLAG_OK, NULL), /* pduGroupPowerVAR.1.10 = INTEGER: 0 */ - { "unmapped.pduGroupPowerVAR", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.24.1.10", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupPowerVAR", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.24.1.10", NULL, SU_FLAG_OK, NULL), /* pduGroupPowerVAR.1.11 = INTEGER: 0 */ - { "unmapped.pduGroupPowerVAR", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.24.1.11", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupPowerVAR", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.24.1.11", NULL, SU_FLAG_OK, NULL), /* pduGroupPowerVAR.1.12 = INTEGER: 0 */ - { "unmapped.pduGroupPowerVAR", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.24.1.12", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupPowerVAR", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.24.1.12", NULL, SU_FLAG_OK, NULL), /* pduGroupOutletCount.1.1 = INTEGER: 6 */ - { "unmapped.pduGroupOutletCount", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.25.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupOutletCount", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.25.1.1", NULL, SU_FLAG_OK, NULL), /* pduGroupOutletCount.1.2 = INTEGER: 0 */ - { "unmapped.pduGroupOutletCount", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.25.1.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupOutletCount", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.25.1.2", NULL, SU_FLAG_OK, NULL), /* pduGroupOutletCount.1.3 = INTEGER: 0 */ - { "unmapped.pduGroupOutletCount", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.25.1.3", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupOutletCount", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.25.1.3", NULL, SU_FLAG_OK, NULL), /* pduGroupOutletCount.1.4 = INTEGER: 0 */ - { "unmapped.pduGroupOutletCount", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.25.1.4", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupOutletCount", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.25.1.4", NULL, SU_FLAG_OK, NULL), /* pduGroupOutletCount.1.5 = INTEGER: 0 */ - { "unmapped.pduGroupOutletCount", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.25.1.5", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupOutletCount", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.25.1.5", NULL, SU_FLAG_OK, NULL), /* pduGroupOutletCount.1.6 = INTEGER: 0 */ - { "unmapped.pduGroupOutletCount", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.25.1.6", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupOutletCount", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.25.1.6", NULL, SU_FLAG_OK, NULL), /* pduGroupOutletCount.1.7 = INTEGER: 0 */ - { "unmapped.pduGroupOutletCount", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.25.1.7", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupOutletCount", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.25.1.7", NULL, SU_FLAG_OK, NULL), /* pduGroupOutletCount.1.8 = INTEGER: 0 */ - { "unmapped.pduGroupOutletCount", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.25.1.8", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupOutletCount", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.25.1.8", NULL, SU_FLAG_OK, NULL), /* pduGroupOutletCount.1.9 = INTEGER: 0 */ - { "unmapped.pduGroupOutletCount", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.25.1.9", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupOutletCount", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.25.1.9", NULL, SU_FLAG_OK, NULL), /* pduGroupOutletCount.1.10 = INTEGER: 0 */ - { "unmapped.pduGroupOutletCount", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.25.1.10", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupOutletCount", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.25.1.10", NULL, SU_FLAG_OK, NULL), /* pduGroupOutletCount.1.11 = INTEGER: 0 */ - { "unmapped.pduGroupOutletCount", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.25.1.11", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupOutletCount", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.25.1.11", NULL, SU_FLAG_OK, NULL), /* pduGroupOutletCount.1.12 = INTEGER: 0 */ - { "unmapped.pduGroupOutletCount", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.25.1.12", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupOutletCount", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.25.1.12", NULL, SU_FLAG_OK, NULL), /* pduGroupBreakerStatus.1.1 = INTEGER: 0 */ - { "unmapped.pduGroupBreakerStatus", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.26.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupBreakerStatus", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.26.1.1", NULL, SU_FLAG_OK, NULL), /* pduGroupBreakerStatus.1.2 = INTEGER: 0 */ - { "unmapped.pduGroupBreakerStatus", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.26.1.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupBreakerStatus", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.26.1.2", NULL, SU_FLAG_OK, NULL), /* pduGroupBreakerStatus.1.3 = INTEGER: 0 */ - { "unmapped.pduGroupBreakerStatus", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.26.1.3", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupBreakerStatus", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.26.1.3", NULL, SU_FLAG_OK, NULL), /* pduGroupBreakerStatus.1.4 = INTEGER: 0 */ - { "unmapped.pduGroupBreakerStatus", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.26.1.4", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupBreakerStatus", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.26.1.4", NULL, SU_FLAG_OK, NULL), /* pduGroupBreakerStatus.1.5 = INTEGER: 0 */ - { "unmapped.pduGroupBreakerStatus", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.26.1.5", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupBreakerStatus", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.26.1.5", NULL, SU_FLAG_OK, NULL), /* pduGroupBreakerStatus.1.6 = INTEGER: 0 */ - { "unmapped.pduGroupBreakerStatus", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.26.1.6", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupBreakerStatus", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.26.1.6", NULL, SU_FLAG_OK, NULL), /* pduGroupBreakerStatus.1.7 = INTEGER: 0 */ - { "unmapped.pduGroupBreakerStatus", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.26.1.7", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupBreakerStatus", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.26.1.7", NULL, SU_FLAG_OK, NULL), /* pduGroupBreakerStatus.1.8 = INTEGER: 0 */ - { "unmapped.pduGroupBreakerStatus", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.26.1.8", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupBreakerStatus", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.26.1.8", NULL, SU_FLAG_OK, NULL), /* pduGroupBreakerStatus.1.9 = INTEGER: 0 */ - { "unmapped.pduGroupBreakerStatus", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.26.1.9", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupBreakerStatus", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.26.1.9", NULL, SU_FLAG_OK, NULL), /* pduGroupBreakerStatus.1.10 = INTEGER: 0 */ - { "unmapped.pduGroupBreakerStatus", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.26.1.10", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupBreakerStatus", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.26.1.10", NULL, SU_FLAG_OK, NULL), /* pduGroupBreakerStatus.1.11 = INTEGER: 0 */ - { "unmapped.pduGroupBreakerStatus", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.26.1.11", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupBreakerStatus", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.26.1.11", NULL, SU_FLAG_OK, NULL), /* pduGroupBreakerStatus.1.12 = INTEGER: 0 */ - { "unmapped.pduGroupBreakerStatus", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.26.1.12", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupBreakerStatus", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.26.1.12", NULL, SU_FLAG_OK, NULL), /* pduGroupVoltageThCtrl.1.1 = INTEGER: 0 */ - { "unmapped.pduGroupVoltageThCtrl", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.27.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupVoltageThCtrl", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.27.1.1", NULL, SU_FLAG_OK, NULL), /* pduGroupVoltageThCtrl.1.2 = INTEGER: 0 */ - { "unmapped.pduGroupVoltageThCtrl", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.27.1.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupVoltageThCtrl", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.27.1.2", NULL, SU_FLAG_OK, NULL), /* pduGroupVoltageThCtrl.1.3 = INTEGER: 0 */ - { "unmapped.pduGroupVoltageThCtrl", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.27.1.3", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupVoltageThCtrl", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.27.1.3", NULL, SU_FLAG_OK, NULL), /* pduGroupVoltageThCtrl.1.4 = INTEGER: 0 */ - { "unmapped.pduGroupVoltageThCtrl", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.27.1.4", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupVoltageThCtrl", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.27.1.4", NULL, SU_FLAG_OK, NULL), /* pduGroupVoltageThCtrl.1.5 = INTEGER: 0 */ - { "unmapped.pduGroupVoltageThCtrl", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.27.1.5", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupVoltageThCtrl", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.27.1.5", NULL, SU_FLAG_OK, NULL), /* pduGroupVoltageThCtrl.1.6 = INTEGER: 0 */ - { "unmapped.pduGroupVoltageThCtrl", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.27.1.6", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupVoltageThCtrl", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.27.1.6", NULL, SU_FLAG_OK, NULL), /* pduGroupVoltageThCtrl.1.7 = INTEGER: 0 */ - { "unmapped.pduGroupVoltageThCtrl", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.27.1.7", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupVoltageThCtrl", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.27.1.7", NULL, SU_FLAG_OK, NULL), /* pduGroupVoltageThCtrl.1.8 = INTEGER: 0 */ - { "unmapped.pduGroupVoltageThCtrl", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.27.1.8", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupVoltageThCtrl", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.27.1.8", NULL, SU_FLAG_OK, NULL), /* pduGroupVoltageThCtrl.1.9 = INTEGER: 0 */ - { "unmapped.pduGroupVoltageThCtrl", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.27.1.9", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupVoltageThCtrl", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.27.1.9", NULL, SU_FLAG_OK, NULL), /* pduGroupVoltageThCtrl.1.10 = INTEGER: 0 */ - { "unmapped.pduGroupVoltageThCtrl", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.27.1.10", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupVoltageThCtrl", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.27.1.10", NULL, SU_FLAG_OK, NULL), /* pduGroupVoltageThCtrl.1.11 = INTEGER: 0 */ - { "unmapped.pduGroupVoltageThCtrl", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.27.1.11", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupVoltageThCtrl", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.27.1.11", NULL, SU_FLAG_OK, NULL), /* pduGroupVoltageThCtrl.1.12 = INTEGER: 0 */ - { "unmapped.pduGroupVoltageThCtrl", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.27.1.12", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupVoltageThCtrl", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.27.1.12", NULL, SU_FLAG_OK, NULL), /* pduGroupCurrentThCtrl.1.1 = INTEGER: 0 */ - { "unmapped.pduGroupCurrentThCtrl", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.28.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupCurrentThCtrl", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.28.1.1", NULL, SU_FLAG_OK, NULL), /* pduGroupCurrentThCtrl.1.2 = INTEGER: 0 */ - { "unmapped.pduGroupCurrentThCtrl", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.28.1.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupCurrentThCtrl", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.28.1.2", NULL, SU_FLAG_OK, NULL), /* pduGroupCurrentThCtrl.1.3 = INTEGER: 0 */ - { "unmapped.pduGroupCurrentThCtrl", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.28.1.3", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupCurrentThCtrl", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.28.1.3", NULL, SU_FLAG_OK, NULL), /* pduGroupCurrentThCtrl.1.4 = INTEGER: 0 */ - { "unmapped.pduGroupCurrentThCtrl", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.28.1.4", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupCurrentThCtrl", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.28.1.4", NULL, SU_FLAG_OK, NULL), /* pduGroupCurrentThCtrl.1.5 = INTEGER: 0 */ - { "unmapped.pduGroupCurrentThCtrl", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.28.1.5", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupCurrentThCtrl", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.28.1.5", NULL, SU_FLAG_OK, NULL), /* pduGroupCurrentThCtrl.1.6 = INTEGER: 0 */ - { "unmapped.pduGroupCurrentThCtrl", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.28.1.6", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupCurrentThCtrl", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.28.1.6", NULL, SU_FLAG_OK, NULL), /* pduGroupCurrentThCtrl.1.7 = INTEGER: 0 */ - { "unmapped.pduGroupCurrentThCtrl", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.28.1.7", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupCurrentThCtrl", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.28.1.7", NULL, SU_FLAG_OK, NULL), /* pduGroupCurrentThCtrl.1.8 = INTEGER: 0 */ - { "unmapped.pduGroupCurrentThCtrl", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.28.1.8", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupCurrentThCtrl", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.28.1.8", NULL, SU_FLAG_OK, NULL), /* pduGroupCurrentThCtrl.1.9 = INTEGER: 0 */ - { "unmapped.pduGroupCurrentThCtrl", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.28.1.9", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupCurrentThCtrl", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.28.1.9", NULL, SU_FLAG_OK, NULL), /* pduGroupCurrentThCtrl.1.10 = INTEGER: 0 */ - { "unmapped.pduGroupCurrentThCtrl", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.28.1.10", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupCurrentThCtrl", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.28.1.10", NULL, SU_FLAG_OK, NULL), /* pduGroupCurrentThCtrl.1.11 = INTEGER: 0 */ - { "unmapped.pduGroupCurrentThCtrl", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.28.1.11", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupCurrentThCtrl", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.28.1.11", NULL, SU_FLAG_OK, NULL), /* pduGroupCurrentThCtrl.1.12 = INTEGER: 0 */ - { "unmapped.pduGroupCurrentThCtrl", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.28.1.12", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduGroupCurrentThCtrl", 0, 1, ".1.3.6.1.4.1.534.7.1.3.1.1.28.1.12", NULL, SU_FLAG_OK, NULL), /* pduTemperatureScale.1 = INTEGER: 1 */ - { "unmapped.pduTemperatureScale", 0, 1, ".1.3.6.1.4.1.534.7.1.4.1.1.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduTemperatureScale", 0, 1, ".1.3.6.1.4.1.534.7.1.4.1.1.1.1", NULL, SU_FLAG_OK, NULL), /* pduTemperatureCount.1 = INTEGER: 0 */ - { "unmapped.pduTemperatureCount", 0, 1, ".1.3.6.1.4.1.534.7.1.4.1.1.2.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduTemperatureCount", 0, 1, ".1.3.6.1.4.1.534.7.1.4.1.1.2.1", NULL, SU_FLAG_OK, NULL), /* pduHumidityCount.1 = INTEGER: 0 */ - { "unmapped.pduHumidityCount", 0, 1, ".1.3.6.1.4.1.534.7.1.4.1.1.3.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduHumidityCount", 0, 1, ".1.3.6.1.4.1.534.7.1.4.1.1.3.1", NULL, SU_FLAG_OK, NULL), /* pduDoorCount.1 = INTEGER: 0 */ - { "unmapped.pduDoorCount", 0, 1, ".1.3.6.1.4.1.534.7.1.4.1.1.4.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduDoorCount", 0, 1, ".1.3.6.1.4.1.534.7.1.4.1.1.4.1", NULL, SU_FLAG_OK, NULL), /* pduDryCount.1 = INTEGER: 0 */ - { "unmapped.pduDryCount", 0, 1, ".1.3.6.1.4.1.534.7.1.4.1.1.5.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduDryCount", 0, 1, ".1.3.6.1.4.1.534.7.1.4.1.1.5.1", NULL, SU_FLAG_OK, NULL), /* pduSpotCount.1 = INTEGER: 0 */ - { "unmapped.pduSpotCount", 0, 1, ".1.3.6.1.4.1.534.7.1.4.1.1.6.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduSpotCount", 0, 1, ".1.3.6.1.4.1.534.7.1.4.1.1.6.1", NULL, SU_FLAG_OK, NULL), /* pduRopeCount.1 = INTEGER: 0 */ - { "unmapped.pduRopeCount", 0, 1, ".1.3.6.1.4.1.534.7.1.4.1.1.7.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduRopeCount", 0, 1, ".1.3.6.1.4.1.534.7.1.4.1.1.7.1", NULL, SU_FLAG_OK, NULL), /* pduHidCount.1 = INTEGER: 0 */ - { "unmapped.pduHidCount", 0, 1, ".1.3.6.1.4.1.534.7.1.4.1.1.10.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduHidCount", 0, 1, ".1.3.6.1.4.1.534.7.1.4.1.1.10.1", NULL, SU_FLAG_OK, NULL), /* pduTemperatureIndex.1.1 = INTEGER: 0 */ - { "unmapped.pduTemperatureIndex", 0, 1, ".1.3.6.1.4.1.534.7.1.4.2.1.1.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduTemperatureIndex", 0, 1, ".1.3.6.1.4.1.534.7.1.4.2.1.1.1.1", NULL, SU_FLAG_OK, NULL), /* pduTemperatureIndex.1.2 = INTEGER: 0 */ - { "unmapped.pduTemperatureIndex", 0, 1, ".1.3.6.1.4.1.534.7.1.4.2.1.1.1.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduTemperatureIndex", 0, 1, ".1.3.6.1.4.1.534.7.1.4.2.1.1.1.2", NULL, SU_FLAG_OK, NULL), /* pduTemperatureIndex.1.3 = INTEGER: 0 */ - { "unmapped.pduTemperatureIndex", 0, 1, ".1.3.6.1.4.1.534.7.1.4.2.1.1.1.3", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduTemperatureIndex", 0, 1, ".1.3.6.1.4.1.534.7.1.4.2.1.1.1.3", NULL, SU_FLAG_OK, NULL), /* pduTemperatureIndex.1.4 = INTEGER: 0 */ - { "unmapped.pduTemperatureIndex", 0, 1, ".1.3.6.1.4.1.534.7.1.4.2.1.1.1.4", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduTemperatureIndex", 0, 1, ".1.3.6.1.4.1.534.7.1.4.2.1.1.1.4", NULL, SU_FLAG_OK, NULL), /* pduTemperatureIndex.1.5 = INTEGER: 0 */ - { "unmapped.pduTemperatureIndex", 0, 1, ".1.3.6.1.4.1.534.7.1.4.2.1.1.1.5", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduTemperatureIndex", 0, 1, ".1.3.6.1.4.1.534.7.1.4.2.1.1.1.5", NULL, SU_FLAG_OK, NULL), /* pduTemperatureIndex.1.6 = INTEGER: 0 */ - { "unmapped.pduTemperatureIndex", 0, 1, ".1.3.6.1.4.1.534.7.1.4.2.1.1.1.6", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduTemperatureIndex", 0, 1, ".1.3.6.1.4.1.534.7.1.4.2.1.1.1.6", NULL, SU_FLAG_OK, NULL), /* pduTemperatureName.1.1 = STRING: " " */ - { "unmapped.pduTemperatureName", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.7.1.4.2.1.2.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduTemperatureName", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.7.1.4.2.1.2.1.1", NULL, SU_FLAG_OK, NULL), /* pduTemperatureName.1.2 = STRING: " " */ - { "unmapped.pduTemperatureName", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.7.1.4.2.1.2.1.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduTemperatureName", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.7.1.4.2.1.2.1.2", NULL, SU_FLAG_OK, NULL), /* pduTemperatureName.1.3 = STRING: " " */ - { "unmapped.pduTemperatureName", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.7.1.4.2.1.2.1.3", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduTemperatureName", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.7.1.4.2.1.2.1.3", NULL, SU_FLAG_OK, NULL), /* pduTemperatureName.1.4 = STRING: " " */ - { "unmapped.pduTemperatureName", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.7.1.4.2.1.2.1.4", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduTemperatureName", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.7.1.4.2.1.2.1.4", NULL, SU_FLAG_OK, NULL), /* pduTemperatureName.1.5 = STRING: " " */ - { "unmapped.pduTemperatureName", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.7.1.4.2.1.2.1.5", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduTemperatureName", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.7.1.4.2.1.2.1.5", NULL, SU_FLAG_OK, NULL), /* pduTemperatureName.1.6 = STRING: " " */ - { "unmapped.pduTemperatureName", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.7.1.4.2.1.2.1.6", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduTemperatureName", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.7.1.4.2.1.2.1.6", NULL, SU_FLAG_OK, NULL), /* pduTemperatureProbeStatus.1.1 = INTEGER: 1 */ - { "unmapped.pduTemperatureProbeStatus", 0, 1, ".1.3.6.1.4.1.534.7.1.4.2.1.3.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduTemperatureProbeStatus", 0, 1, ".1.3.6.1.4.1.534.7.1.4.2.1.3.1.1", NULL, SU_FLAG_OK, NULL), /* pduTemperatureProbeStatus.1.2 = INTEGER: 1 */ - { "unmapped.pduTemperatureProbeStatus", 0, 1, ".1.3.6.1.4.1.534.7.1.4.2.1.3.1.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduTemperatureProbeStatus", 0, 1, ".1.3.6.1.4.1.534.7.1.4.2.1.3.1.2", NULL, SU_FLAG_OK, NULL), /* pduTemperatureProbeStatus.1.3 = INTEGER: 1 */ - { "unmapped.pduTemperatureProbeStatus", 0, 1, ".1.3.6.1.4.1.534.7.1.4.2.1.3.1.3", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduTemperatureProbeStatus", 0, 1, ".1.3.6.1.4.1.534.7.1.4.2.1.3.1.3", NULL, SU_FLAG_OK, NULL), /* pduTemperatureProbeStatus.1.4 = INTEGER: 1 */ - { "unmapped.pduTemperatureProbeStatus", 0, 1, ".1.3.6.1.4.1.534.7.1.4.2.1.3.1.4", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduTemperatureProbeStatus", 0, 1, ".1.3.6.1.4.1.534.7.1.4.2.1.3.1.4", NULL, SU_FLAG_OK, NULL), /* pduTemperatureProbeStatus.1.5 = INTEGER: 1 */ - { "unmapped.pduTemperatureProbeStatus", 0, 1, ".1.3.6.1.4.1.534.7.1.4.2.1.3.1.5", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduTemperatureProbeStatus", 0, 1, ".1.3.6.1.4.1.534.7.1.4.2.1.3.1.5", NULL, SU_FLAG_OK, NULL), /* pduTemperatureProbeStatus.1.6 = INTEGER: 1 */ - { "unmapped.pduTemperatureProbeStatus", 0, 1, ".1.3.6.1.4.1.534.7.1.4.2.1.3.1.6", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduTemperatureProbeStatus", 0, 1, ".1.3.6.1.4.1.534.7.1.4.2.1.3.1.6", NULL, SU_FLAG_OK, NULL), /* pduTemperatureValue.1.1 = INTEGER: 0 */ - { "unmapped.pduTemperatureValue", 0, 1, ".1.3.6.1.4.1.534.7.1.4.2.1.4.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduTemperatureValue", 0, 1, ".1.3.6.1.4.1.534.7.1.4.2.1.4.1.1", NULL, SU_FLAG_OK, NULL), /* pduTemperatureValue.1.2 = INTEGER: 0 */ - { "unmapped.pduTemperatureValue", 0, 1, ".1.3.6.1.4.1.534.7.1.4.2.1.4.1.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduTemperatureValue", 0, 1, ".1.3.6.1.4.1.534.7.1.4.2.1.4.1.2", NULL, SU_FLAG_OK, NULL), /* pduTemperatureValue.1.3 = INTEGER: 0 */ - { "unmapped.pduTemperatureValue", 0, 1, ".1.3.6.1.4.1.534.7.1.4.2.1.4.1.3", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduTemperatureValue", 0, 1, ".1.3.6.1.4.1.534.7.1.4.2.1.4.1.3", NULL, SU_FLAG_OK, NULL), /* pduTemperatureValue.1.4 = INTEGER: 0 */ - { "unmapped.pduTemperatureValue", 0, 1, ".1.3.6.1.4.1.534.7.1.4.2.1.4.1.4", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduTemperatureValue", 0, 1, ".1.3.6.1.4.1.534.7.1.4.2.1.4.1.4", NULL, SU_FLAG_OK, NULL), /* pduTemperatureValue.1.5 = INTEGER: 0 */ - { "unmapped.pduTemperatureValue", 0, 1, ".1.3.6.1.4.1.534.7.1.4.2.1.4.1.5", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduTemperatureValue", 0, 1, ".1.3.6.1.4.1.534.7.1.4.2.1.4.1.5", NULL, SU_FLAG_OK, NULL), /* pduTemperatureValue.1.6 = INTEGER: 0 */ - { "unmapped.pduTemperatureValue", 0, 1, ".1.3.6.1.4.1.534.7.1.4.2.1.4.1.6", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduTemperatureValue", 0, 1, ".1.3.6.1.4.1.534.7.1.4.2.1.4.1.6", NULL, SU_FLAG_OK, NULL), /* pduTemperatureThStatus.1.1 = INTEGER: 0 */ - { "unmapped.pduTemperatureThStatus", 0, 1, ".1.3.6.1.4.1.534.7.1.4.2.1.5.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduTemperatureThStatus", 0, 1, ".1.3.6.1.4.1.534.7.1.4.2.1.5.1.1", NULL, SU_FLAG_OK, NULL), /* pduTemperatureThStatus.1.2 = INTEGER: 0 */ - { "unmapped.pduTemperatureThStatus", 0, 1, ".1.3.6.1.4.1.534.7.1.4.2.1.5.1.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduTemperatureThStatus", 0, 1, ".1.3.6.1.4.1.534.7.1.4.2.1.5.1.2", NULL, SU_FLAG_OK, NULL), /* pduTemperatureThStatus.1.3 = INTEGER: 0 */ - { "unmapped.pduTemperatureThStatus", 0, 1, ".1.3.6.1.4.1.534.7.1.4.2.1.5.1.3", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduTemperatureThStatus", 0, 1, ".1.3.6.1.4.1.534.7.1.4.2.1.5.1.3", NULL, SU_FLAG_OK, NULL), /* pduTemperatureThStatus.1.4 = INTEGER: 0 */ - { "unmapped.pduTemperatureThStatus", 0, 1, ".1.3.6.1.4.1.534.7.1.4.2.1.5.1.4", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduTemperatureThStatus", 0, 1, ".1.3.6.1.4.1.534.7.1.4.2.1.5.1.4", NULL, SU_FLAG_OK, NULL), /* pduTemperatureThStatus.1.5 = INTEGER: 0 */ - { "unmapped.pduTemperatureThStatus", 0, 1, ".1.3.6.1.4.1.534.7.1.4.2.1.5.1.5", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduTemperatureThStatus", 0, 1, ".1.3.6.1.4.1.534.7.1.4.2.1.5.1.5", NULL, SU_FLAG_OK, NULL), /* pduTemperatureThStatus.1.6 = INTEGER: 0 */ - { "unmapped.pduTemperatureThStatus", 0, 1, ".1.3.6.1.4.1.534.7.1.4.2.1.5.1.6", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduTemperatureThStatus", 0, 1, ".1.3.6.1.4.1.534.7.1.4.2.1.5.1.6", NULL, SU_FLAG_OK, NULL), /* pduTemperatureThLowerWarning.1.1 = INTEGER: 0 */ - { "unmapped.pduTemperatureThLowerWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.4.2.1.6.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduTemperatureThLowerWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.4.2.1.6.1.1", NULL, SU_FLAG_OK, NULL), /* pduTemperatureThLowerWarning.1.2 = INTEGER: 0 */ - { "unmapped.pduTemperatureThLowerWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.4.2.1.6.1.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduTemperatureThLowerWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.4.2.1.6.1.2", NULL, SU_FLAG_OK, NULL), /* pduTemperatureThLowerWarning.1.3 = INTEGER: 0 */ - { "unmapped.pduTemperatureThLowerWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.4.2.1.6.1.3", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduTemperatureThLowerWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.4.2.1.6.1.3", NULL, SU_FLAG_OK, NULL), /* pduTemperatureThLowerWarning.1.4 = INTEGER: 0 */ - { "unmapped.pduTemperatureThLowerWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.4.2.1.6.1.4", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduTemperatureThLowerWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.4.2.1.6.1.4", NULL, SU_FLAG_OK, NULL), /* pduTemperatureThLowerWarning.1.5 = INTEGER: 0 */ - { "unmapped.pduTemperatureThLowerWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.4.2.1.6.1.5", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduTemperatureThLowerWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.4.2.1.6.1.5", NULL, SU_FLAG_OK, NULL), /* pduTemperatureThLowerWarning.1.6 = INTEGER: 0 */ - { "unmapped.pduTemperatureThLowerWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.4.2.1.6.1.6", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduTemperatureThLowerWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.4.2.1.6.1.6", NULL, SU_FLAG_OK, NULL), /* pduTemperatureThLowerCritical.1.1 = INTEGER: 0 */ - { "unmapped.pduTemperatureThLowerCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.4.2.1.7.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduTemperatureThLowerCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.4.2.1.7.1.1", NULL, SU_FLAG_OK, NULL), /* pduTemperatureThLowerCritical.1.2 = INTEGER: 0 */ - { "unmapped.pduTemperatureThLowerCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.4.2.1.7.1.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduTemperatureThLowerCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.4.2.1.7.1.2", NULL, SU_FLAG_OK, NULL), /* pduTemperatureThLowerCritical.1.3 = INTEGER: 0 */ - { "unmapped.pduTemperatureThLowerCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.4.2.1.7.1.3", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduTemperatureThLowerCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.4.2.1.7.1.3", NULL, SU_FLAG_OK, NULL), /* pduTemperatureThLowerCritical.1.4 = INTEGER: 0 */ - { "unmapped.pduTemperatureThLowerCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.4.2.1.7.1.4", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduTemperatureThLowerCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.4.2.1.7.1.4", NULL, SU_FLAG_OK, NULL), /* pduTemperatureThLowerCritical.1.5 = INTEGER: 0 */ - { "unmapped.pduTemperatureThLowerCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.4.2.1.7.1.5", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduTemperatureThLowerCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.4.2.1.7.1.5", NULL, SU_FLAG_OK, NULL), /* pduTemperatureThLowerCritical.1.6 = INTEGER: 0 */ - { "unmapped.pduTemperatureThLowerCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.4.2.1.7.1.6", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduTemperatureThLowerCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.4.2.1.7.1.6", NULL, SU_FLAG_OK, NULL), /* pduTemperatureThUpperWarning.1.1 = INTEGER: 0 */ - { "unmapped.pduTemperatureThUpperWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.4.2.1.8.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduTemperatureThUpperWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.4.2.1.8.1.1", NULL, SU_FLAG_OK, NULL), /* pduTemperatureThUpperWarning.1.2 = INTEGER: 0 */ - { "unmapped.pduTemperatureThUpperWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.4.2.1.8.1.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduTemperatureThUpperWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.4.2.1.8.1.2", NULL, SU_FLAG_OK, NULL), /* pduTemperatureThUpperWarning.1.3 = INTEGER: 0 */ - { "unmapped.pduTemperatureThUpperWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.4.2.1.8.1.3", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduTemperatureThUpperWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.4.2.1.8.1.3", NULL, SU_FLAG_OK, NULL), /* pduTemperatureThUpperWarning.1.4 = INTEGER: 0 */ - { "unmapped.pduTemperatureThUpperWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.4.2.1.8.1.4", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduTemperatureThUpperWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.4.2.1.8.1.4", NULL, SU_FLAG_OK, NULL), /* pduTemperatureThUpperWarning.1.5 = INTEGER: 0 */ - { "unmapped.pduTemperatureThUpperWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.4.2.1.8.1.5", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduTemperatureThUpperWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.4.2.1.8.1.5", NULL, SU_FLAG_OK, NULL), /* pduTemperatureThUpperWarning.1.6 = INTEGER: 0 */ - { "unmapped.pduTemperatureThUpperWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.4.2.1.8.1.6", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduTemperatureThUpperWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.4.2.1.8.1.6", NULL, SU_FLAG_OK, NULL), /* pduTemperatureThUpperCritical.1.1 = INTEGER: 0 */ - { "unmapped.pduTemperatureThUpperCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.4.2.1.9.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduTemperatureThUpperCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.4.2.1.9.1.1", NULL, SU_FLAG_OK, NULL), /* pduTemperatureThUpperCritical.1.2 = INTEGER: 0 */ - { "unmapped.pduTemperatureThUpperCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.4.2.1.9.1.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduTemperatureThUpperCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.4.2.1.9.1.2", NULL, SU_FLAG_OK, NULL), /* pduTemperatureThUpperCritical.1.3 = INTEGER: 0 */ - { "unmapped.pduTemperatureThUpperCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.4.2.1.9.1.3", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduTemperatureThUpperCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.4.2.1.9.1.3", NULL, SU_FLAG_OK, NULL), /* pduTemperatureThUpperCritical.1.4 = INTEGER: 0 */ - { "unmapped.pduTemperatureThUpperCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.4.2.1.9.1.4", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduTemperatureThUpperCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.4.2.1.9.1.4", NULL, SU_FLAG_OK, NULL), /* pduTemperatureThUpperCritical.1.5 = INTEGER: 0 */ - { "unmapped.pduTemperatureThUpperCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.4.2.1.9.1.5", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduTemperatureThUpperCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.4.2.1.9.1.5", NULL, SU_FLAG_OK, NULL), /* pduTemperatureThUpperCritical.1.6 = INTEGER: 0 */ - { "unmapped.pduTemperatureThUpperCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.4.2.1.9.1.6", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduTemperatureThUpperCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.4.2.1.9.1.6", NULL, SU_FLAG_OK, NULL), /* pduTemperatureThCtrl.1.1 = INTEGER: 0 */ - { "unmapped.pduTemperatureThCtrl", 0, 1, ".1.3.6.1.4.1.534.7.1.4.2.1.10.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduTemperatureThCtrl", 0, 1, ".1.3.6.1.4.1.534.7.1.4.2.1.10.1.1", NULL, SU_FLAG_OK, NULL), /* pduTemperatureThCtrl.1.2 = INTEGER: 0 */ - { "unmapped.pduTemperatureThCtrl", 0, 1, ".1.3.6.1.4.1.534.7.1.4.2.1.10.1.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduTemperatureThCtrl", 0, 1, ".1.3.6.1.4.1.534.7.1.4.2.1.10.1.2", NULL, SU_FLAG_OK, NULL), /* pduTemperatureThCtrl.1.3 = INTEGER: 0 */ - { "unmapped.pduTemperatureThCtrl", 0, 1, ".1.3.6.1.4.1.534.7.1.4.2.1.10.1.3", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduTemperatureThCtrl", 0, 1, ".1.3.6.1.4.1.534.7.1.4.2.1.10.1.3", NULL, SU_FLAG_OK, NULL), /* pduTemperatureThCtrl.1.4 = INTEGER: 0 */ - { "unmapped.pduTemperatureThCtrl", 0, 1, ".1.3.6.1.4.1.534.7.1.4.2.1.10.1.4", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduTemperatureThCtrl", 0, 1, ".1.3.6.1.4.1.534.7.1.4.2.1.10.1.4", NULL, SU_FLAG_OK, NULL), /* pduTemperatureThCtrl.1.5 = INTEGER: 0 */ - { "unmapped.pduTemperatureThCtrl", 0, 1, ".1.3.6.1.4.1.534.7.1.4.2.1.10.1.5", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduTemperatureThCtrl", 0, 1, ".1.3.6.1.4.1.534.7.1.4.2.1.10.1.5", NULL, SU_FLAG_OK, NULL), /* pduTemperatureThCtrl.1.6 = INTEGER: 0 */ - { "unmapped.pduTemperatureThCtrl", 0, 1, ".1.3.6.1.4.1.534.7.1.4.2.1.10.1.6", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduTemperatureThCtrl", 0, 1, ".1.3.6.1.4.1.534.7.1.4.2.1.10.1.6", NULL, SU_FLAG_OK, NULL), /* pduHumidityIndex.1.1 = INTEGER: 0 */ - { "unmapped.pduHumidityIndex", 0, 1, ".1.3.6.1.4.1.534.7.1.4.3.1.1.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduHumidityIndex", 0, 1, ".1.3.6.1.4.1.534.7.1.4.3.1.1.1.1", NULL, SU_FLAG_OK, NULL), /* pduHumidityIndex.1.2 = INTEGER: 0 */ - { "unmapped.pduHumidityIndex", 0, 1, ".1.3.6.1.4.1.534.7.1.4.3.1.1.1.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduHumidityIndex", 0, 1, ".1.3.6.1.4.1.534.7.1.4.3.1.1.1.2", NULL, SU_FLAG_OK, NULL), /* pduHumidityIndex.1.3 = INTEGER: 0 */ - { "unmapped.pduHumidityIndex", 0, 1, ".1.3.6.1.4.1.534.7.1.4.3.1.1.1.3", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduHumidityIndex", 0, 1, ".1.3.6.1.4.1.534.7.1.4.3.1.1.1.3", NULL, SU_FLAG_OK, NULL), /* pduHumidityIndex.1.4 = INTEGER: 0 */ - { "unmapped.pduHumidityIndex", 0, 1, ".1.3.6.1.4.1.534.7.1.4.3.1.1.1.4", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduHumidityIndex", 0, 1, ".1.3.6.1.4.1.534.7.1.4.3.1.1.1.4", NULL, SU_FLAG_OK, NULL), /* pduHumidityIndex.1.5 = INTEGER: 0 */ - { "unmapped.pduHumidityIndex", 0, 1, ".1.3.6.1.4.1.534.7.1.4.3.1.1.1.5", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduHumidityIndex", 0, 1, ".1.3.6.1.4.1.534.7.1.4.3.1.1.1.5", NULL, SU_FLAG_OK, NULL), /* pduHumidityIndex.1.6 = INTEGER: 0 */ - { "unmapped.pduHumidityIndex", 0, 1, ".1.3.6.1.4.1.534.7.1.4.3.1.1.1.6", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduHumidityIndex", 0, 1, ".1.3.6.1.4.1.534.7.1.4.3.1.1.1.6", NULL, SU_FLAG_OK, NULL), /* pduHumidityName.1.1 = STRING: " " */ - { "unmapped.pduHumidityName", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.7.1.4.3.1.2.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduHumidityName", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.7.1.4.3.1.2.1.1", NULL, SU_FLAG_OK, NULL), /* pduHumidityName.1.2 = STRING: " " */ - { "unmapped.pduHumidityName", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.7.1.4.3.1.2.1.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduHumidityName", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.7.1.4.3.1.2.1.2", NULL, SU_FLAG_OK, NULL), /* pduHumidityName.1.3 = STRING: " " */ - { "unmapped.pduHumidityName", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.7.1.4.3.1.2.1.3", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduHumidityName", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.7.1.4.3.1.2.1.3", NULL, SU_FLAG_OK, NULL), /* pduHumidityName.1.4 = STRING: " " */ - { "unmapped.pduHumidityName", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.7.1.4.3.1.2.1.4", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduHumidityName", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.7.1.4.3.1.2.1.4", NULL, SU_FLAG_OK, NULL), /* pduHumidityName.1.5 = STRING: " " */ - { "unmapped.pduHumidityName", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.7.1.4.3.1.2.1.5", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduHumidityName", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.7.1.4.3.1.2.1.5", NULL, SU_FLAG_OK, NULL), /* pduHumidityName.1.6 = STRING: " " */ - { "unmapped.pduHumidityName", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.7.1.4.3.1.2.1.6", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduHumidityName", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.7.1.4.3.1.2.1.6", NULL, SU_FLAG_OK, NULL), /* pduHumidityProbeStatus.1.1 = INTEGER: 1 */ - { "unmapped.pduHumidityProbeStatus", 0, 1, ".1.3.6.1.4.1.534.7.1.4.3.1.3.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduHumidityProbeStatus", 0, 1, ".1.3.6.1.4.1.534.7.1.4.3.1.3.1.1", NULL, SU_FLAG_OK, NULL), /* pduHumidityProbeStatus.1.2 = INTEGER: 1 */ - { "unmapped.pduHumidityProbeStatus", 0, 1, ".1.3.6.1.4.1.534.7.1.4.3.1.3.1.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduHumidityProbeStatus", 0, 1, ".1.3.6.1.4.1.534.7.1.4.3.1.3.1.2", NULL, SU_FLAG_OK, NULL), /* pduHumidityProbeStatus.1.3 = INTEGER: 1 */ - { "unmapped.pduHumidityProbeStatus", 0, 1, ".1.3.6.1.4.1.534.7.1.4.3.1.3.1.3", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduHumidityProbeStatus", 0, 1, ".1.3.6.1.4.1.534.7.1.4.3.1.3.1.3", NULL, SU_FLAG_OK, NULL), /* pduHumidityProbeStatus.1.4 = INTEGER: 1 */ - { "unmapped.pduHumidityProbeStatus", 0, 1, ".1.3.6.1.4.1.534.7.1.4.3.1.3.1.4", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduHumidityProbeStatus", 0, 1, ".1.3.6.1.4.1.534.7.1.4.3.1.3.1.4", NULL, SU_FLAG_OK, NULL), /* pduHumidityProbeStatus.1.5 = INTEGER: 1 */ - { "unmapped.pduHumidityProbeStatus", 0, 1, ".1.3.6.1.4.1.534.7.1.4.3.1.3.1.5", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduHumidityProbeStatus", 0, 1, ".1.3.6.1.4.1.534.7.1.4.3.1.3.1.5", NULL, SU_FLAG_OK, NULL), /* pduHumidityProbeStatus.1.6 = INTEGER: 1 */ - { "unmapped.pduHumidityProbeStatus", 0, 1, ".1.3.6.1.4.1.534.7.1.4.3.1.3.1.6", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduHumidityProbeStatus", 0, 1, ".1.3.6.1.4.1.534.7.1.4.3.1.3.1.6", NULL, SU_FLAG_OK, NULL), /* pduHumidityValue.1.1 = INTEGER: 0 */ - { "unmapped.pduHumidityValue", 0, 1, ".1.3.6.1.4.1.534.7.1.4.3.1.4.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduHumidityValue", 0, 1, ".1.3.6.1.4.1.534.7.1.4.3.1.4.1.1", NULL, SU_FLAG_OK, NULL), /* pduHumidityValue.1.2 = INTEGER: 0 */ - { "unmapped.pduHumidityValue", 0, 1, ".1.3.6.1.4.1.534.7.1.4.3.1.4.1.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduHumidityValue", 0, 1, ".1.3.6.1.4.1.534.7.1.4.3.1.4.1.2", NULL, SU_FLAG_OK, NULL), /* pduHumidityValue.1.3 = INTEGER: 0 */ - { "unmapped.pduHumidityValue", 0, 1, ".1.3.6.1.4.1.534.7.1.4.3.1.4.1.3", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduHumidityValue", 0, 1, ".1.3.6.1.4.1.534.7.1.4.3.1.4.1.3", NULL, SU_FLAG_OK, NULL), /* pduHumidityValue.1.4 = INTEGER: 0 */ - { "unmapped.pduHumidityValue", 0, 1, ".1.3.6.1.4.1.534.7.1.4.3.1.4.1.4", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduHumidityValue", 0, 1, ".1.3.6.1.4.1.534.7.1.4.3.1.4.1.4", NULL, SU_FLAG_OK, NULL), /* pduHumidityValue.1.5 = INTEGER: 0 */ - { "unmapped.pduHumidityValue", 0, 1, ".1.3.6.1.4.1.534.7.1.4.3.1.4.1.5", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduHumidityValue", 0, 1, ".1.3.6.1.4.1.534.7.1.4.3.1.4.1.5", NULL, SU_FLAG_OK, NULL), /* pduHumidityValue.1.6 = INTEGER: 0 */ - { "unmapped.pduHumidityValue", 0, 1, ".1.3.6.1.4.1.534.7.1.4.3.1.4.1.6", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduHumidityValue", 0, 1, ".1.3.6.1.4.1.534.7.1.4.3.1.4.1.6", NULL, SU_FLAG_OK, NULL), /* pduHumidityThStatus.1.1 = INTEGER: 0 */ - { "unmapped.pduHumidityThStatus", 0, 1, ".1.3.6.1.4.1.534.7.1.4.3.1.5.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduHumidityThStatus", 0, 1, ".1.3.6.1.4.1.534.7.1.4.3.1.5.1.1", NULL, SU_FLAG_OK, NULL), /* pduHumidityThStatus.1.2 = INTEGER: 0 */ - { "unmapped.pduHumidityThStatus", 0, 1, ".1.3.6.1.4.1.534.7.1.4.3.1.5.1.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduHumidityThStatus", 0, 1, ".1.3.6.1.4.1.534.7.1.4.3.1.5.1.2", NULL, SU_FLAG_OK, NULL), /* pduHumidityThStatus.1.3 = INTEGER: 0 */ - { "unmapped.pduHumidityThStatus", 0, 1, ".1.3.6.1.4.1.534.7.1.4.3.1.5.1.3", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduHumidityThStatus", 0, 1, ".1.3.6.1.4.1.534.7.1.4.3.1.5.1.3", NULL, SU_FLAG_OK, NULL), /* pduHumidityThStatus.1.4 = INTEGER: 0 */ - { "unmapped.pduHumidityThStatus", 0, 1, ".1.3.6.1.4.1.534.7.1.4.3.1.5.1.4", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduHumidityThStatus", 0, 1, ".1.3.6.1.4.1.534.7.1.4.3.1.5.1.4", NULL, SU_FLAG_OK, NULL), /* pduHumidityThStatus.1.5 = INTEGER: 0 */ - { "unmapped.pduHumidityThStatus", 0, 1, ".1.3.6.1.4.1.534.7.1.4.3.1.5.1.5", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduHumidityThStatus", 0, 1, ".1.3.6.1.4.1.534.7.1.4.3.1.5.1.5", NULL, SU_FLAG_OK, NULL), /* pduHumidityThStatus.1.6 = INTEGER: 0 */ - { "unmapped.pduHumidityThStatus", 0, 1, ".1.3.6.1.4.1.534.7.1.4.3.1.5.1.6", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduHumidityThStatus", 0, 1, ".1.3.6.1.4.1.534.7.1.4.3.1.5.1.6", NULL, SU_FLAG_OK, NULL), /* pduHumidityThLowerWarning.1.1 = INTEGER: 0 */ - { "unmapped.pduHumidityThLowerWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.4.3.1.6.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduHumidityThLowerWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.4.3.1.6.1.1", NULL, SU_FLAG_OK, NULL), /* pduHumidityThLowerWarning.1.2 = INTEGER: 0 */ - { "unmapped.pduHumidityThLowerWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.4.3.1.6.1.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduHumidityThLowerWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.4.3.1.6.1.2", NULL, SU_FLAG_OK, NULL), /* pduHumidityThLowerWarning.1.3 = INTEGER: 0 */ - { "unmapped.pduHumidityThLowerWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.4.3.1.6.1.3", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduHumidityThLowerWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.4.3.1.6.1.3", NULL, SU_FLAG_OK, NULL), /* pduHumidityThLowerWarning.1.4 = INTEGER: 0 */ - { "unmapped.pduHumidityThLowerWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.4.3.1.6.1.4", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduHumidityThLowerWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.4.3.1.6.1.4", NULL, SU_FLAG_OK, NULL), /* pduHumidityThLowerWarning.1.5 = INTEGER: 0 */ - { "unmapped.pduHumidityThLowerWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.4.3.1.6.1.5", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduHumidityThLowerWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.4.3.1.6.1.5", NULL, SU_FLAG_OK, NULL), /* pduHumidityThLowerWarning.1.6 = INTEGER: 0 */ - { "unmapped.pduHumidityThLowerWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.4.3.1.6.1.6", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduHumidityThLowerWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.4.3.1.6.1.6", NULL, SU_FLAG_OK, NULL), /* pduHumidityThLowerCritical.1.1 = INTEGER: 0 */ - { "unmapped.pduHumidityThLowerCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.4.3.1.7.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduHumidityThLowerCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.4.3.1.7.1.1", NULL, SU_FLAG_OK, NULL), /* pduHumidityThLowerCritical.1.2 = INTEGER: 0 */ - { "unmapped.pduHumidityThLowerCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.4.3.1.7.1.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduHumidityThLowerCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.4.3.1.7.1.2", NULL, SU_FLAG_OK, NULL), /* pduHumidityThLowerCritical.1.3 = INTEGER: 0 */ - { "unmapped.pduHumidityThLowerCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.4.3.1.7.1.3", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduHumidityThLowerCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.4.3.1.7.1.3", NULL, SU_FLAG_OK, NULL), /* pduHumidityThLowerCritical.1.4 = INTEGER: 0 */ - { "unmapped.pduHumidityThLowerCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.4.3.1.7.1.4", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduHumidityThLowerCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.4.3.1.7.1.4", NULL, SU_FLAG_OK, NULL), /* pduHumidityThLowerCritical.1.5 = INTEGER: 0 */ - { "unmapped.pduHumidityThLowerCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.4.3.1.7.1.5", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduHumidityThLowerCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.4.3.1.7.1.5", NULL, SU_FLAG_OK, NULL), /* pduHumidityThLowerCritical.1.6 = INTEGER: 0 */ - { "unmapped.pduHumidityThLowerCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.4.3.1.7.1.6", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduHumidityThLowerCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.4.3.1.7.1.6", NULL, SU_FLAG_OK, NULL), /* pduHumidityThUpperWarning.1.1 = INTEGER: 0 */ - { "unmapped.pduHumidityThUpperWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.4.3.1.8.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduHumidityThUpperWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.4.3.1.8.1.1", NULL, SU_FLAG_OK, NULL), /* pduHumidityThUpperWarning.1.2 = INTEGER: 0 */ - { "unmapped.pduHumidityThUpperWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.4.3.1.8.1.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduHumidityThUpperWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.4.3.1.8.1.2", NULL, SU_FLAG_OK, NULL), /* pduHumidityThUpperWarning.1.3 = INTEGER: 0 */ - { "unmapped.pduHumidityThUpperWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.4.3.1.8.1.3", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduHumidityThUpperWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.4.3.1.8.1.3", NULL, SU_FLAG_OK, NULL), /* pduHumidityThUpperWarning.1.4 = INTEGER: 0 */ - { "unmapped.pduHumidityThUpperWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.4.3.1.8.1.4", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduHumidityThUpperWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.4.3.1.8.1.4", NULL, SU_FLAG_OK, NULL), /* pduHumidityThUpperWarning.1.5 = INTEGER: 0 */ - { "unmapped.pduHumidityThUpperWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.4.3.1.8.1.5", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduHumidityThUpperWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.4.3.1.8.1.5", NULL, SU_FLAG_OK, NULL), /* pduHumidityThUpperWarning.1.6 = INTEGER: 0 */ - { "unmapped.pduHumidityThUpperWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.4.3.1.8.1.6", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduHumidityThUpperWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.4.3.1.8.1.6", NULL, SU_FLAG_OK, NULL), /* pduHumidityThUpperCritical.1.1 = INTEGER: 0 */ - { "unmapped.pduHumidityThUpperCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.4.3.1.9.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduHumidityThUpperCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.4.3.1.9.1.1", NULL, SU_FLAG_OK, NULL), /* pduHumidityThUpperCritical.1.2 = INTEGER: 0 */ - { "unmapped.pduHumidityThUpperCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.4.3.1.9.1.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduHumidityThUpperCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.4.3.1.9.1.2", NULL, SU_FLAG_OK, NULL), /* pduHumidityThUpperCritical.1.3 = INTEGER: 0 */ - { "unmapped.pduHumidityThUpperCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.4.3.1.9.1.3", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduHumidityThUpperCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.4.3.1.9.1.3", NULL, SU_FLAG_OK, NULL), /* pduHumidityThUpperCritical.1.4 = INTEGER: 0 */ - { "unmapped.pduHumidityThUpperCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.4.3.1.9.1.4", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduHumidityThUpperCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.4.3.1.9.1.4", NULL, SU_FLAG_OK, NULL), /* pduHumidityThUpperCritical.1.5 = INTEGER: 0 */ - { "unmapped.pduHumidityThUpperCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.4.3.1.9.1.5", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduHumidityThUpperCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.4.3.1.9.1.5", NULL, SU_FLAG_OK, NULL), /* pduHumidityThUpperCritical.1.6 = INTEGER: 0 */ - { "unmapped.pduHumidityThUpperCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.4.3.1.9.1.6", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduHumidityThUpperCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.4.3.1.9.1.6", NULL, SU_FLAG_OK, NULL), /* pduHumidityThCtrl.1.1 = INTEGER: 0 */ - { "unmapped.pduHumidityThCtrl", 0, 1, ".1.3.6.1.4.1.534.7.1.4.3.1.10.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduHumidityThCtrl", 0, 1, ".1.3.6.1.4.1.534.7.1.4.3.1.10.1.1", NULL, SU_FLAG_OK, NULL), /* pduHumidityThCtrl.1.2 = INTEGER: 0 */ - { "unmapped.pduHumidityThCtrl", 0, 1, ".1.3.6.1.4.1.534.7.1.4.3.1.10.1.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduHumidityThCtrl", 0, 1, ".1.3.6.1.4.1.534.7.1.4.3.1.10.1.2", NULL, SU_FLAG_OK, NULL), /* pduHumidityThCtrl.1.3 = INTEGER: 0 */ - { "unmapped.pduHumidityThCtrl", 0, 1, ".1.3.6.1.4.1.534.7.1.4.3.1.10.1.3", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduHumidityThCtrl", 0, 1, ".1.3.6.1.4.1.534.7.1.4.3.1.10.1.3", NULL, SU_FLAG_OK, NULL), /* pduHumidityThCtrl.1.4 = INTEGER: 0 */ - { "unmapped.pduHumidityThCtrl", 0, 1, ".1.3.6.1.4.1.534.7.1.4.3.1.10.1.4", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduHumidityThCtrl", 0, 1, ".1.3.6.1.4.1.534.7.1.4.3.1.10.1.4", NULL, SU_FLAG_OK, NULL), /* pduHumidityThCtrl.1.5 = INTEGER: 0 */ - { "unmapped.pduHumidityThCtrl", 0, 1, ".1.3.6.1.4.1.534.7.1.4.3.1.10.1.5", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduHumidityThCtrl", 0, 1, ".1.3.6.1.4.1.534.7.1.4.3.1.10.1.5", NULL, SU_FLAG_OK, NULL), /* pduHumidityThCtrl.1.6 = INTEGER: 0 */ - { "unmapped.pduHumidityThCtrl", 0, 1, ".1.3.6.1.4.1.534.7.1.4.3.1.10.1.6", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduHumidityThCtrl", 0, 1, ".1.3.6.1.4.1.534.7.1.4.3.1.10.1.6", NULL, SU_FLAG_OK, NULL), /* pduDoorIndex.1.1 = INTEGER: 0 */ - { "unmapped.pduDoorIndex", 0, 1, ".1.3.6.1.4.1.534.7.1.4.4.1.1.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduDoorIndex", 0, 1, ".1.3.6.1.4.1.534.7.1.4.4.1.1.1.1", NULL, SU_FLAG_OK, NULL), /* pduDoorIndex.1.2 = INTEGER: 0 */ - { "unmapped.pduDoorIndex", 0, 1, ".1.3.6.1.4.1.534.7.1.4.4.1.1.1.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduDoorIndex", 0, 1, ".1.3.6.1.4.1.534.7.1.4.4.1.1.1.2", NULL, SU_FLAG_OK, NULL), /* pduDoorName.1.1 = STRING: " " */ - { "unmapped.pduDoorName", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.7.1.4.4.1.2.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduDoorName", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.7.1.4.4.1.2.1.1", NULL, SU_FLAG_OK, NULL), /* pduDoorName.1.2 = STRING: " " */ - { "unmapped.pduDoorName", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.7.1.4.4.1.2.1.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduDoorName", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.7.1.4.4.1.2.1.2", NULL, SU_FLAG_OK, NULL), /* pduDoorProbeStatus.1.1 = INTEGER: 1 */ - { "unmapped.pduDoorProbeStatus", 0, 1, ".1.3.6.1.4.1.534.7.1.4.4.1.3.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduDoorProbeStatus", 0, 1, ".1.3.6.1.4.1.534.7.1.4.4.1.3.1.1", NULL, SU_FLAG_OK, NULL), /* pduDoorProbeStatus.1.2 = INTEGER: 1 */ - { "unmapped.pduDoorProbeStatus", 0, 1, ".1.3.6.1.4.1.534.7.1.4.4.1.3.1.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduDoorProbeStatus", 0, 1, ".1.3.6.1.4.1.534.7.1.4.4.1.3.1.2", NULL, SU_FLAG_OK, NULL), /* pduDoorState.1.1 = INTEGER: 0 */ - { "unmapped.pduDoorState", 0, 1, ".1.3.6.1.4.1.534.7.1.4.4.1.4.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduDoorState", 0, 1, ".1.3.6.1.4.1.534.7.1.4.4.1.4.1.1", NULL, SU_FLAG_OK, NULL), /* pduDoorState.1.2 = INTEGER: 0 */ - { "unmapped.pduDoorState", 0, 1, ".1.3.6.1.4.1.534.7.1.4.4.1.4.1.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduDoorState", 0, 1, ".1.3.6.1.4.1.534.7.1.4.4.1.4.1.2", NULL, SU_FLAG_OK, NULL), /* pduDryIndex.1.1 = INTEGER: 0 */ - { "unmapped.pduDryIndex", 0, 1, ".1.3.6.1.4.1.534.7.1.4.5.1.1.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduDryIndex", 0, 1, ".1.3.6.1.4.1.534.7.1.4.5.1.1.1.1", NULL, SU_FLAG_OK, NULL), /* pduDryIndex.1.2 = INTEGER: 0 */ - { "unmapped.pduDryIndex", 0, 1, ".1.3.6.1.4.1.534.7.1.4.5.1.1.1.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduDryIndex", 0, 1, ".1.3.6.1.4.1.534.7.1.4.5.1.1.1.2", NULL, SU_FLAG_OK, NULL), /* pduDryName.1.1 = STRING: " " */ - { "unmapped.pduDryName", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.7.1.4.5.1.2.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduDryName", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.7.1.4.5.1.2.1.1", NULL, SU_FLAG_OK, NULL), /* pduDryName.1.2 = STRING: " " */ - { "unmapped.pduDryName", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.7.1.4.5.1.2.1.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduDryName", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.7.1.4.5.1.2.1.2", NULL, SU_FLAG_OK, NULL), /* pduDryProbeStatus.1.1 = INTEGER: 1 */ - { "unmapped.pduDryProbeStatus", 0, 1, ".1.3.6.1.4.1.534.7.1.4.5.1.3.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduDryProbeStatus", 0, 1, ".1.3.6.1.4.1.534.7.1.4.5.1.3.1.1", NULL, SU_FLAG_OK, NULL), /* pduDryProbeStatus.1.2 = INTEGER: 1 */ - { "unmapped.pduDryProbeStatus", 0, 1, ".1.3.6.1.4.1.534.7.1.4.5.1.3.1.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduDryProbeStatus", 0, 1, ".1.3.6.1.4.1.534.7.1.4.5.1.3.1.2", NULL, SU_FLAG_OK, NULL), /* pduDryState.1.1 = INTEGER: 0 */ - { "unmapped.pduDryState", 0, 1, ".1.3.6.1.4.1.534.7.1.4.5.1.4.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduDryState", 0, 1, ".1.3.6.1.4.1.534.7.1.4.5.1.4.1.1", NULL, SU_FLAG_OK, NULL), /* pduDryState.1.2 = INTEGER: 0 */ - { "unmapped.pduDryState", 0, 1, ".1.3.6.1.4.1.534.7.1.4.5.1.4.1.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduDryState", 0, 1, ".1.3.6.1.4.1.534.7.1.4.5.1.4.1.2", NULL, SU_FLAG_OK, NULL), /* pduSpotIndex.1.1 = INTEGER: 0 */ - { "unmapped.pduSpotIndex", 0, 1, ".1.3.6.1.4.1.534.7.1.4.6.1.1.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduSpotIndex", 0, 1, ".1.3.6.1.4.1.534.7.1.4.6.1.1.1.1", NULL, SU_FLAG_OK, NULL), /* pduSpotIndex.1.2 = INTEGER: 0 */ - { "unmapped.pduSpotIndex", 0, 1, ".1.3.6.1.4.1.534.7.1.4.6.1.1.1.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduSpotIndex", 0, 1, ".1.3.6.1.4.1.534.7.1.4.6.1.1.1.2", NULL, SU_FLAG_OK, NULL), /* pduSpotName.1.1 = STRING: " " */ - { "unmapped.pduSpotName", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.7.1.4.6.1.2.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduSpotName", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.7.1.4.6.1.2.1.1", NULL, SU_FLAG_OK, NULL), /* pduSpotName.1.2 = STRING: " " */ - { "unmapped.pduSpotName", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.7.1.4.6.1.2.1.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduSpotName", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.7.1.4.6.1.2.1.2", NULL, SU_FLAG_OK, NULL), /* pduSpotProbeStatus.1.1 = INTEGER: 1 */ - { "unmapped.pduSpotProbeStatus", 0, 1, ".1.3.6.1.4.1.534.7.1.4.6.1.3.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduSpotProbeStatus", 0, 1, ".1.3.6.1.4.1.534.7.1.4.6.1.3.1.1", NULL, SU_FLAG_OK, NULL), /* pduSpotProbeStatus.1.2 = INTEGER: 1 */ - { "unmapped.pduSpotProbeStatus", 0, 1, ".1.3.6.1.4.1.534.7.1.4.6.1.3.1.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduSpotProbeStatus", 0, 1, ".1.3.6.1.4.1.534.7.1.4.6.1.3.1.2", NULL, SU_FLAG_OK, NULL), /* pduSpotState.1.1 = INTEGER: 0 */ - { "unmapped.pduSpotState", 0, 1, ".1.3.6.1.4.1.534.7.1.4.6.1.4.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduSpotState", 0, 1, ".1.3.6.1.4.1.534.7.1.4.6.1.4.1.1", NULL, SU_FLAG_OK, NULL), /* pduSpotState.1.2 = INTEGER: 0 */ - { "unmapped.pduSpotState", 0, 1, ".1.3.6.1.4.1.534.7.1.4.6.1.4.1.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduSpotState", 0, 1, ".1.3.6.1.4.1.534.7.1.4.6.1.4.1.2", NULL, SU_FLAG_OK, NULL), /* pduRopeIndex.1.1 = INTEGER: 0 */ - { "unmapped.pduRopeIndex", 0, 1, ".1.3.6.1.4.1.534.7.1.4.7.1.1.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduRopeIndex", 0, 1, ".1.3.6.1.4.1.534.7.1.4.7.1.1.1.1", NULL, SU_FLAG_OK, NULL), /* pduRopeIndex.1.2 = INTEGER: 0 */ - { "unmapped.pduRopeIndex", 0, 1, ".1.3.6.1.4.1.534.7.1.4.7.1.1.1.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduRopeIndex", 0, 1, ".1.3.6.1.4.1.534.7.1.4.7.1.1.1.2", NULL, SU_FLAG_OK, NULL), /* pduRopeName.1.1 = STRING: " " */ - { "unmapped.pduRopeName", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.7.1.4.7.1.2.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduRopeName", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.7.1.4.7.1.2.1.1", NULL, SU_FLAG_OK, NULL), /* pduRopeName.1.2 = STRING: " " */ - { "unmapped.pduRopeName", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.7.1.4.7.1.2.1.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduRopeName", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.7.1.4.7.1.2.1.2", NULL, SU_FLAG_OK, NULL), /* pduRopeProbeStatus.1.1 = INTEGER: 1 */ - { "unmapped.pduRopeProbeStatus", 0, 1, ".1.3.6.1.4.1.534.7.1.4.7.1.3.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduRopeProbeStatus", 0, 1, ".1.3.6.1.4.1.534.7.1.4.7.1.3.1.1", NULL, SU_FLAG_OK, NULL), /* pduRopeProbeStatus.1.2 = INTEGER: 1 */ - { "unmapped.pduRopeProbeStatus", 0, 1, ".1.3.6.1.4.1.534.7.1.4.7.1.3.1.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduRopeProbeStatus", 0, 1, ".1.3.6.1.4.1.534.7.1.4.7.1.3.1.2", NULL, SU_FLAG_OK, NULL), /* pduRopeState.1.1 = INTEGER: 0 */ - { "unmapped.pduRopeState", 0, 1, ".1.3.6.1.4.1.534.7.1.4.7.1.4.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduRopeState", 0, 1, ".1.3.6.1.4.1.534.7.1.4.7.1.4.1.1", NULL, SU_FLAG_OK, NULL), /* pduRopeState.1.2 = INTEGER: 0 */ - { "unmapped.pduRopeState", 0, 1, ".1.3.6.1.4.1.534.7.1.4.7.1.4.1.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduRopeState", 0, 1, ".1.3.6.1.4.1.534.7.1.4.7.1.4.1.2", NULL, SU_FLAG_OK, NULL), /* pduHIDIndex.1.1 = INTEGER: 0 */ - { "unmapped.pduHIDIndex", 0, 1, ".1.3.6.1.4.1.534.7.1.4.10.1.1.1.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduHIDIndex", 0, 1, ".1.3.6.1.4.1.534.7.1.4.10.1.1.1.1.1", NULL, SU_FLAG_OK, NULL), /* pduHIDIndex.1.2 = INTEGER: 0 */ - { "unmapped.pduHIDIndex", 0, 1, ".1.3.6.1.4.1.534.7.1.4.10.1.1.1.1.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduHIDIndex", 0, 1, ".1.3.6.1.4.1.534.7.1.4.10.1.1.1.1.2", NULL, SU_FLAG_OK, NULL), /* pduHidAisle.1.1 = INTEGER: 0 */ - { "unmapped.pduHidAisle", 0, 1, ".1.3.6.1.4.1.534.7.1.4.10.1.1.2.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduHidAisle", 0, 1, ".1.3.6.1.4.1.534.7.1.4.10.1.1.2.1.1", NULL, SU_FLAG_OK, NULL), /* pduHidAisle.1.2 = INTEGER: 0 */ - { "unmapped.pduHidAisle", 0, 1, ".1.3.6.1.4.1.534.7.1.4.10.1.1.2.1.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduHidAisle", 0, 1, ".1.3.6.1.4.1.534.7.1.4.10.1.1.2.1.2", NULL, SU_FLAG_OK, NULL), /* pduHidHandleOperation.1.1 = INTEGER: 2 */ - { "unmapped.pduHidHandleOperation", 0, 1, ".1.3.6.1.4.1.534.7.1.4.10.1.1.3.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduHidHandleOperation", 0, 1, ".1.3.6.1.4.1.534.7.1.4.10.1.1.3.1.1", NULL, SU_FLAG_OK, NULL), /* pduHidHandleOperation.1.2 = INTEGER: 2 */ - { "unmapped.pduHidHandleOperation", 0, 1, ".1.3.6.1.4.1.534.7.1.4.10.1.1.3.1.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduHidHandleOperation", 0, 1, ".1.3.6.1.4.1.534.7.1.4.10.1.1.3.1.2", NULL, SU_FLAG_OK, NULL), /* pduHIDVer.1.1 = Hex-STRING: 02 00 00 00 00 */ - { "unmapped.pduHIDVer", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.7.1.4.10.1.1.4.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduHIDVer", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.7.1.4.10.1.1.4.1.1", NULL, SU_FLAG_OK, NULL), /* pduHIDVer.1.2 = Hex-STRING: 02 00 00 00 00 */ - { "unmapped.pduHIDVer", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.7.1.4.10.1.1.4.1.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduHIDVer", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.7.1.4.10.1.1.4.1.2", NULL, SU_FLAG_OK, NULL), /* pduMechanicalLock.1.1 = INTEGER: 2 */ - { "unmapped.pduMechanicalLock", 0, 1, ".1.3.6.1.4.1.534.7.1.4.10.1.1.5.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduMechanicalLock", 0, 1, ".1.3.6.1.4.1.534.7.1.4.10.1.1.5.1.1", NULL, SU_FLAG_OK, NULL), /* pduMechanicalLock.1.2 = INTEGER: 2 */ - { "unmapped.pduMechanicalLock", 0, 1, ".1.3.6.1.4.1.534.7.1.4.10.1.1.5.1.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduMechanicalLock", 0, 1, ".1.3.6.1.4.1.534.7.1.4.10.1.1.5.1.2", NULL, SU_FLAG_OK, NULL), /* pduHidControlIndex.1.1 = INTEGER: 0 */ - { "unmapped.pduHidControlIndex", 0, 1, ".1.3.6.1.4.1.534.7.1.4.10.2.1.1.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduHidControlIndex", 0, 1, ".1.3.6.1.4.1.534.7.1.4.10.2.1.1.1.1", NULL, SU_FLAG_OK, NULL), /* pduHidControlIndex.1.2 = INTEGER: 0 */ - { "unmapped.pduHidControlIndex", 0, 1, ".1.3.6.1.4.1.534.7.1.4.10.2.1.1.1.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduHidControlIndex", 0, 1, ".1.3.6.1.4.1.534.7.1.4.10.2.1.1.1.2", NULL, SU_FLAG_OK, NULL), /* pduHidControlIndex.1.3 = INTEGER: 0 */ - { "unmapped.pduHidControlIndex", 0, 1, ".1.3.6.1.4.1.534.7.1.4.10.2.1.1.1.3", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduHidControlIndex", 0, 1, ".1.3.6.1.4.1.534.7.1.4.10.2.1.1.1.3", NULL, SU_FLAG_OK, NULL), /* pduHidControlIndex.1.4 = INTEGER: 0 */ - { "unmapped.pduHidControlIndex", 0, 1, ".1.3.6.1.4.1.534.7.1.4.10.2.1.1.1.4", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduHidControlIndex", 0, 1, ".1.3.6.1.4.1.534.7.1.4.10.2.1.1.1.4", NULL, SU_FLAG_OK, NULL), /* pduHidControlIndex.1.5 = INTEGER: 0 */ - { "unmapped.pduHidControlIndex", 0, 1, ".1.3.6.1.4.1.534.7.1.4.10.2.1.1.1.5", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduHidControlIndex", 0, 1, ".1.3.6.1.4.1.534.7.1.4.10.2.1.1.1.5", NULL, SU_FLAG_OK, NULL), /* pduHidControlIndex.1.6 = INTEGER: 0 */ - { "unmapped.pduHidControlIndex", 0, 1, ".1.3.6.1.4.1.534.7.1.4.10.2.1.1.1.6", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduHidControlIndex", 0, 1, ".1.3.6.1.4.1.534.7.1.4.10.2.1.1.1.6", NULL, SU_FLAG_OK, NULL), /* pduHidControlIndex.1.7 = INTEGER: 0 */ - { "unmapped.pduHidControlIndex", 0, 1, ".1.3.6.1.4.1.534.7.1.4.10.2.1.1.1.7", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduHidControlIndex", 0, 1, ".1.3.6.1.4.1.534.7.1.4.10.2.1.1.1.7", NULL, SU_FLAG_OK, NULL), /* pduHidControlIndex.1.8 = INTEGER: 0 */ - { "unmapped.pduHidControlIndex", 0, 1, ".1.3.6.1.4.1.534.7.1.4.10.2.1.1.1.8", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduHidControlIndex", 0, 1, ".1.3.6.1.4.1.534.7.1.4.10.2.1.1.1.8", NULL, SU_FLAG_OK, NULL), /* pduHidControlIndex.1.9 = INTEGER: 0 */ - { "unmapped.pduHidControlIndex", 0, 1, ".1.3.6.1.4.1.534.7.1.4.10.2.1.1.1.9", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduHidControlIndex", 0, 1, ".1.3.6.1.4.1.534.7.1.4.10.2.1.1.1.9", NULL, SU_FLAG_OK, NULL), /* pduHidControlIndex.1.10 = INTEGER: 0 */ - { "unmapped.pduHidControlIndex", 0, 1, ".1.3.6.1.4.1.534.7.1.4.10.2.1.1.1.10", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduHidControlIndex", 0, 1, ".1.3.6.1.4.1.534.7.1.4.10.2.1.1.1.10", NULL, SU_FLAG_OK, NULL), /* pduHidControlIndex.1.11 = INTEGER: 0 */ - { "unmapped.pduHidControlIndex", 0, 1, ".1.3.6.1.4.1.534.7.1.4.10.2.1.1.1.11", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduHidControlIndex", 0, 1, ".1.3.6.1.4.1.534.7.1.4.10.2.1.1.1.11", NULL, SU_FLAG_OK, NULL), /* pduHidControlIndex.1.12 = INTEGER: 0 */ - { "unmapped.pduHidControlIndex", 0, 1, ".1.3.6.1.4.1.534.7.1.4.10.2.1.1.1.12", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduHidControlIndex", 0, 1, ".1.3.6.1.4.1.534.7.1.4.10.2.1.1.1.12", NULL, SU_FLAG_OK, NULL), /* pduHidControlIndex.1.13 = INTEGER: 0 */ - { "unmapped.pduHidControlIndex", 0, 1, ".1.3.6.1.4.1.534.7.1.4.10.2.1.1.1.13", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduHidControlIndex", 0, 1, ".1.3.6.1.4.1.534.7.1.4.10.2.1.1.1.13", NULL, SU_FLAG_OK, NULL), /* pduHidControlIndex.1.14 = INTEGER: 0 */ - { "unmapped.pduHidControlIndex", 0, 1, ".1.3.6.1.4.1.534.7.1.4.10.2.1.1.1.14", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduHidControlIndex", 0, 1, ".1.3.6.1.4.1.534.7.1.4.10.2.1.1.1.14", NULL, SU_FLAG_OK, NULL), /* pduHidControlIndex.1.15 = INTEGER: 0 */ - { "unmapped.pduHidControlIndex", 0, 1, ".1.3.6.1.4.1.534.7.1.4.10.2.1.1.1.15", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduHidControlIndex", 0, 1, ".1.3.6.1.4.1.534.7.1.4.10.2.1.1.1.15", NULL, SU_FLAG_OK, NULL), /* pduHidControlIndex.1.16 = INTEGER: 0 */ - { "unmapped.pduHidControlIndex", 0, 1, ".1.3.6.1.4.1.534.7.1.4.10.2.1.1.1.16", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduHidControlIndex", 0, 1, ".1.3.6.1.4.1.534.7.1.4.10.2.1.1.1.16", NULL, SU_FLAG_OK, NULL), /* pduHidControlUserName.1.1 = "" */ - { "unmapped.pduHidControlUserName", 0, 1, ".1.3.6.1.4.1.534.7.1.4.10.2.1.2.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduHidControlUserName", 0, 1, ".1.3.6.1.4.1.534.7.1.4.10.2.1.2.1.1", NULL, SU_FLAG_OK, NULL), /* pduHidControlUserName.1.2 = "" */ - { "unmapped.pduHidControlUserName", 0, 1, ".1.3.6.1.4.1.534.7.1.4.10.2.1.2.1.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduHidControlUserName", 0, 1, ".1.3.6.1.4.1.534.7.1.4.10.2.1.2.1.2", NULL, SU_FLAG_OK, NULL), /* pduHidControlUserName.1.3 = "" */ - { "unmapped.pduHidControlUserName", 0, 1, ".1.3.6.1.4.1.534.7.1.4.10.2.1.2.1.3", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduHidControlUserName", 0, 1, ".1.3.6.1.4.1.534.7.1.4.10.2.1.2.1.3", NULL, SU_FLAG_OK, NULL), /* pduHidControlUserName.1.4 = "" */ - { "unmapped.pduHidControlUserName", 0, 1, ".1.3.6.1.4.1.534.7.1.4.10.2.1.2.1.4", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduHidControlUserName", 0, 1, ".1.3.6.1.4.1.534.7.1.4.10.2.1.2.1.4", NULL, SU_FLAG_OK, NULL), /* pduHidControlUserName.1.5 = "" */ - { "unmapped.pduHidControlUserName", 0, 1, ".1.3.6.1.4.1.534.7.1.4.10.2.1.2.1.5", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduHidControlUserName", 0, 1, ".1.3.6.1.4.1.534.7.1.4.10.2.1.2.1.5", NULL, SU_FLAG_OK, NULL), /* pduHidControlUserName.1.6 = "" */ - { "unmapped.pduHidControlUserName", 0, 1, ".1.3.6.1.4.1.534.7.1.4.10.2.1.2.1.6", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduHidControlUserName", 0, 1, ".1.3.6.1.4.1.534.7.1.4.10.2.1.2.1.6", NULL, SU_FLAG_OK, NULL), /* pduHidControlUserName.1.7 = "" */ - { "unmapped.pduHidControlUserName", 0, 1, ".1.3.6.1.4.1.534.7.1.4.10.2.1.2.1.7", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduHidControlUserName", 0, 1, ".1.3.6.1.4.1.534.7.1.4.10.2.1.2.1.7", NULL, SU_FLAG_OK, NULL), /* pduHidControlUserName.1.8 = "" */ - { "unmapped.pduHidControlUserName", 0, 1, ".1.3.6.1.4.1.534.7.1.4.10.2.1.2.1.8", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduHidControlUserName", 0, 1, ".1.3.6.1.4.1.534.7.1.4.10.2.1.2.1.8", NULL, SU_FLAG_OK, NULL), /* pduHidControlUserName.1.9 = "" */ - { "unmapped.pduHidControlUserName", 0, 1, ".1.3.6.1.4.1.534.7.1.4.10.2.1.2.1.9", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduHidControlUserName", 0, 1, ".1.3.6.1.4.1.534.7.1.4.10.2.1.2.1.9", NULL, SU_FLAG_OK, NULL), /* pduHidControlUserName.1.10 = "" */ - { "unmapped.pduHidControlUserName", 0, 1, ".1.3.6.1.4.1.534.7.1.4.10.2.1.2.1.10", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduHidControlUserName", 0, 1, ".1.3.6.1.4.1.534.7.1.4.10.2.1.2.1.10", NULL, SU_FLAG_OK, NULL), /* pduHidControlUserName.1.11 = "" */ - { "unmapped.pduHidControlUserName", 0, 1, ".1.3.6.1.4.1.534.7.1.4.10.2.1.2.1.11", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduHidControlUserName", 0, 1, ".1.3.6.1.4.1.534.7.1.4.10.2.1.2.1.11", NULL, SU_FLAG_OK, NULL), /* pduHidControlUserName.1.12 = "" */ - { "unmapped.pduHidControlUserName", 0, 1, ".1.3.6.1.4.1.534.7.1.4.10.2.1.2.1.12", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduHidControlUserName", 0, 1, ".1.3.6.1.4.1.534.7.1.4.10.2.1.2.1.12", NULL, SU_FLAG_OK, NULL), /* pduHidControlUserName.1.13 = "" */ - { "unmapped.pduHidControlUserName", 0, 1, ".1.3.6.1.4.1.534.7.1.4.10.2.1.2.1.13", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduHidControlUserName", 0, 1, ".1.3.6.1.4.1.534.7.1.4.10.2.1.2.1.13", NULL, SU_FLAG_OK, NULL), /* pduHidControlUserName.1.14 = "" */ - { "unmapped.pduHidControlUserName", 0, 1, ".1.3.6.1.4.1.534.7.1.4.10.2.1.2.1.14", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduHidControlUserName", 0, 1, ".1.3.6.1.4.1.534.7.1.4.10.2.1.2.1.14", NULL, SU_FLAG_OK, NULL), /* pduHidControlUserName.1.15 = "" */ - { "unmapped.pduHidControlUserName", 0, 1, ".1.3.6.1.4.1.534.7.1.4.10.2.1.2.1.15", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduHidControlUserName", 0, 1, ".1.3.6.1.4.1.534.7.1.4.10.2.1.2.1.15", NULL, SU_FLAG_OK, NULL), /* pduHidControlUserName.1.16 = "" */ - { "unmapped.pduHidControlUserName", 0, 1, ".1.3.6.1.4.1.534.7.1.4.10.2.1.2.1.16", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduHidControlUserName", 0, 1, ".1.3.6.1.4.1.534.7.1.4.10.2.1.2.1.16", NULL, SU_FLAG_OK, NULL), /* pduHidControlCardID.1.1 = INTEGER: 0 */ - { "unmapped.pduHidControlCardID", 0, 1, ".1.3.6.1.4.1.534.7.1.4.10.2.1.3.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduHidControlCardID", 0, 1, ".1.3.6.1.4.1.534.7.1.4.10.2.1.3.1.1", NULL, SU_FLAG_OK, NULL), /* pduHidControlCardID.1.2 = INTEGER: 0 */ - { "unmapped.pduHidControlCardID", 0, 1, ".1.3.6.1.4.1.534.7.1.4.10.2.1.3.1.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduHidControlCardID", 0, 1, ".1.3.6.1.4.1.534.7.1.4.10.2.1.3.1.2", NULL, SU_FLAG_OK, NULL), /* pduHidControlCardID.1.3 = INTEGER: 0 */ - { "unmapped.pduHidControlCardID", 0, 1, ".1.3.6.1.4.1.534.7.1.4.10.2.1.3.1.3", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduHidControlCardID", 0, 1, ".1.3.6.1.4.1.534.7.1.4.10.2.1.3.1.3", NULL, SU_FLAG_OK, NULL), /* pduHidControlCardID.1.4 = INTEGER: 0 */ - { "unmapped.pduHidControlCardID", 0, 1, ".1.3.6.1.4.1.534.7.1.4.10.2.1.3.1.4", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduHidControlCardID", 0, 1, ".1.3.6.1.4.1.534.7.1.4.10.2.1.3.1.4", NULL, SU_FLAG_OK, NULL), /* pduHidControlCardID.1.5 = INTEGER: 0 */ - { "unmapped.pduHidControlCardID", 0, 1, ".1.3.6.1.4.1.534.7.1.4.10.2.1.3.1.5", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduHidControlCardID", 0, 1, ".1.3.6.1.4.1.534.7.1.4.10.2.1.3.1.5", NULL, SU_FLAG_OK, NULL), /* pduHidControlCardID.1.6 = INTEGER: 0 */ - { "unmapped.pduHidControlCardID", 0, 1, ".1.3.6.1.4.1.534.7.1.4.10.2.1.3.1.6", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduHidControlCardID", 0, 1, ".1.3.6.1.4.1.534.7.1.4.10.2.1.3.1.6", NULL, SU_FLAG_OK, NULL), /* pduHidControlCardID.1.7 = INTEGER: 0 */ - { "unmapped.pduHidControlCardID", 0, 1, ".1.3.6.1.4.1.534.7.1.4.10.2.1.3.1.7", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduHidControlCardID", 0, 1, ".1.3.6.1.4.1.534.7.1.4.10.2.1.3.1.7", NULL, SU_FLAG_OK, NULL), /* pduHidControlCardID.1.8 = INTEGER: 0 */ - { "unmapped.pduHidControlCardID", 0, 1, ".1.3.6.1.4.1.534.7.1.4.10.2.1.3.1.8", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduHidControlCardID", 0, 1, ".1.3.6.1.4.1.534.7.1.4.10.2.1.3.1.8", NULL, SU_FLAG_OK, NULL), /* pduHidControlCardID.1.9 = INTEGER: 0 */ - { "unmapped.pduHidControlCardID", 0, 1, ".1.3.6.1.4.1.534.7.1.4.10.2.1.3.1.9", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduHidControlCardID", 0, 1, ".1.3.6.1.4.1.534.7.1.4.10.2.1.3.1.9", NULL, SU_FLAG_OK, NULL), /* pduHidControlCardID.1.10 = INTEGER: 0 */ - { "unmapped.pduHidControlCardID", 0, 1, ".1.3.6.1.4.1.534.7.1.4.10.2.1.3.1.10", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduHidControlCardID", 0, 1, ".1.3.6.1.4.1.534.7.1.4.10.2.1.3.1.10", NULL, SU_FLAG_OK, NULL), /* pduHidControlCardID.1.11 = INTEGER: 0 */ - { "unmapped.pduHidControlCardID", 0, 1, ".1.3.6.1.4.1.534.7.1.4.10.2.1.3.1.11", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduHidControlCardID", 0, 1, ".1.3.6.1.4.1.534.7.1.4.10.2.1.3.1.11", NULL, SU_FLAG_OK, NULL), /* pduHidControlCardID.1.12 = INTEGER: 0 */ - { "unmapped.pduHidControlCardID", 0, 1, ".1.3.6.1.4.1.534.7.1.4.10.2.1.3.1.12", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduHidControlCardID", 0, 1, ".1.3.6.1.4.1.534.7.1.4.10.2.1.3.1.12", NULL, SU_FLAG_OK, NULL), /* pduHidControlCardID.1.13 = INTEGER: 0 */ - { "unmapped.pduHidControlCardID", 0, 1, ".1.3.6.1.4.1.534.7.1.4.10.2.1.3.1.13", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduHidControlCardID", 0, 1, ".1.3.6.1.4.1.534.7.1.4.10.2.1.3.1.13", NULL, SU_FLAG_OK, NULL), /* pduHidControlCardID.1.14 = INTEGER: 0 */ - { "unmapped.pduHidControlCardID", 0, 1, ".1.3.6.1.4.1.534.7.1.4.10.2.1.3.1.14", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduHidControlCardID", 0, 1, ".1.3.6.1.4.1.534.7.1.4.10.2.1.3.1.14", NULL, SU_FLAG_OK, NULL), /* pduHidControlCardID.1.15 = INTEGER: 0 */ - { "unmapped.pduHidControlCardID", 0, 1, ".1.3.6.1.4.1.534.7.1.4.10.2.1.3.1.15", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduHidControlCardID", 0, 1, ".1.3.6.1.4.1.534.7.1.4.10.2.1.3.1.15", NULL, SU_FLAG_OK, NULL), /* pduHidControlCardID.1.16 = INTEGER: 0 */ - { "unmapped.pduHidControlCardID", 0, 1, ".1.3.6.1.4.1.534.7.1.4.10.2.1.3.1.16", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduHidControlCardID", 0, 1, ".1.3.6.1.4.1.534.7.1.4.10.2.1.3.1.16", NULL, SU_FLAG_OK, NULL), /* pduHidControlTimestamp.1.1 = STRING: "2000/00/00 00:00:00" */ - { "unmapped.pduHidControlTimestamp", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.7.1.4.10.2.1.4.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduHidControlTimestamp", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.7.1.4.10.2.1.4.1.1", NULL, SU_FLAG_OK, NULL), /* pduHidControlTimestamp.1.2 = STRING: "2000/00/00 00:00:00" */ - { "unmapped.pduHidControlTimestamp", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.7.1.4.10.2.1.4.1.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduHidControlTimestamp", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.7.1.4.10.2.1.4.1.2", NULL, SU_FLAG_OK, NULL), /* pduHidControlTimestamp.1.3 = STRING: "2000/00/00 00:00:00" */ - { "unmapped.pduHidControlTimestamp", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.7.1.4.10.2.1.4.1.3", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduHidControlTimestamp", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.7.1.4.10.2.1.4.1.3", NULL, SU_FLAG_OK, NULL), /* pduHidControlTimestamp.1.4 = STRING: "2000/00/00 00:00:00" */ - { "unmapped.pduHidControlTimestamp", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.7.1.4.10.2.1.4.1.4", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduHidControlTimestamp", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.7.1.4.10.2.1.4.1.4", NULL, SU_FLAG_OK, NULL), /* pduHidControlTimestamp.1.5 = STRING: "2000/00/00 00:00:00" */ - { "unmapped.pduHidControlTimestamp", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.7.1.4.10.2.1.4.1.5", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduHidControlTimestamp", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.7.1.4.10.2.1.4.1.5", NULL, SU_FLAG_OK, NULL), /* pduHidControlTimestamp.1.6 = STRING: "2000/00/00 00:00:00" */ - { "unmapped.pduHidControlTimestamp", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.7.1.4.10.2.1.4.1.6", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduHidControlTimestamp", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.7.1.4.10.2.1.4.1.6", NULL, SU_FLAG_OK, NULL), /* pduHidControlTimestamp.1.7 = STRING: "2000/00/00 00:00:00" */ - { "unmapped.pduHidControlTimestamp", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.7.1.4.10.2.1.4.1.7", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduHidControlTimestamp", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.7.1.4.10.2.1.4.1.7", NULL, SU_FLAG_OK, NULL), /* pduHidControlTimestamp.1.8 = STRING: "2000/00/00 00:00:00" */ - { "unmapped.pduHidControlTimestamp", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.7.1.4.10.2.1.4.1.8", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduHidControlTimestamp", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.7.1.4.10.2.1.4.1.8", NULL, SU_FLAG_OK, NULL), /* pduHidControlTimestamp.1.9 = STRING: "2000/00/00 00:00:00" */ - { "unmapped.pduHidControlTimestamp", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.7.1.4.10.2.1.4.1.9", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduHidControlTimestamp", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.7.1.4.10.2.1.4.1.9", NULL, SU_FLAG_OK, NULL), /* pduHidControlTimestamp.1.10 = STRING: "2000/00/00 00:00:00" */ - { "unmapped.pduHidControlTimestamp", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.7.1.4.10.2.1.4.1.10", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduHidControlTimestamp", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.7.1.4.10.2.1.4.1.10", NULL, SU_FLAG_OK, NULL), /* pduHidControlTimestamp.1.11 = STRING: "2000/00/00 00:00:00" */ - { "unmapped.pduHidControlTimestamp", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.7.1.4.10.2.1.4.1.11", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduHidControlTimestamp", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.7.1.4.10.2.1.4.1.11", NULL, SU_FLAG_OK, NULL), /* pduHidControlTimestamp.1.12 = STRING: "2000/00/00 00:00:00" */ - { "unmapped.pduHidControlTimestamp", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.7.1.4.10.2.1.4.1.12", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduHidControlTimestamp", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.7.1.4.10.2.1.4.1.12", NULL, SU_FLAG_OK, NULL), /* pduHidControlTimestamp.1.13 = STRING: "2000/00/00 00:00:00" */ - { "unmapped.pduHidControlTimestamp", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.7.1.4.10.2.1.4.1.13", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduHidControlTimestamp", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.7.1.4.10.2.1.4.1.13", NULL, SU_FLAG_OK, NULL), /* pduHidControlTimestamp.1.14 = STRING: "2000/00/00 00:00:00" */ - { "unmapped.pduHidControlTimestamp", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.7.1.4.10.2.1.4.1.14", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduHidControlTimestamp", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.7.1.4.10.2.1.4.1.14", NULL, SU_FLAG_OK, NULL), /* pduHidControlTimestamp.1.15 = STRING: "2000/00/00 00:00:00" */ - { "unmapped.pduHidControlTimestamp", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.7.1.4.10.2.1.4.1.15", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduHidControlTimestamp", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.7.1.4.10.2.1.4.1.15", NULL, SU_FLAG_OK, NULL), /* pduHidControlTimestamp.1.16 = STRING: "2000/00/00 00:00:00" */ - { "unmapped.pduHidControlTimestamp", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.7.1.4.10.2.1.4.1.16", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduHidControlTimestamp", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.7.1.4.10.2.1.4.1.16", NULL, SU_FLAG_OK, NULL), /* pduHidControlCardAisle.1.1 = INTEGER: 0 */ - { "unmapped.pduHidControlCardAisle", 0, 1, ".1.3.6.1.4.1.534.7.1.4.10.2.1.5.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduHidControlCardAisle", 0, 1, ".1.3.6.1.4.1.534.7.1.4.10.2.1.5.1.1", NULL, SU_FLAG_OK, NULL), /* pduHidControlCardAisle.1.2 = INTEGER: 0 */ - { "unmapped.pduHidControlCardAisle", 0, 1, ".1.3.6.1.4.1.534.7.1.4.10.2.1.5.1.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduHidControlCardAisle", 0, 1, ".1.3.6.1.4.1.534.7.1.4.10.2.1.5.1.2", NULL, SU_FLAG_OK, NULL), /* pduHidControlCardAisle.1.3 = INTEGER: 0 */ - { "unmapped.pduHidControlCardAisle", 0, 1, ".1.3.6.1.4.1.534.7.1.4.10.2.1.5.1.3", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduHidControlCardAisle", 0, 1, ".1.3.6.1.4.1.534.7.1.4.10.2.1.5.1.3", NULL, SU_FLAG_OK, NULL), /* pduHidControlCardAisle.1.4 = INTEGER: 0 */ - { "unmapped.pduHidControlCardAisle", 0, 1, ".1.3.6.1.4.1.534.7.1.4.10.2.1.5.1.4", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduHidControlCardAisle", 0, 1, ".1.3.6.1.4.1.534.7.1.4.10.2.1.5.1.4", NULL, SU_FLAG_OK, NULL), /* pduHidControlCardAisle.1.5 = INTEGER: 0 */ - { "unmapped.pduHidControlCardAisle", 0, 1, ".1.3.6.1.4.1.534.7.1.4.10.2.1.5.1.5", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduHidControlCardAisle", 0, 1, ".1.3.6.1.4.1.534.7.1.4.10.2.1.5.1.5", NULL, SU_FLAG_OK, NULL), /* pduHidControlCardAisle.1.6 = INTEGER: 0 */ - { "unmapped.pduHidControlCardAisle", 0, 1, ".1.3.6.1.4.1.534.7.1.4.10.2.1.5.1.6", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduHidControlCardAisle", 0, 1, ".1.3.6.1.4.1.534.7.1.4.10.2.1.5.1.6", NULL, SU_FLAG_OK, NULL), /* pduHidControlCardAisle.1.7 = INTEGER: 0 */ - { "unmapped.pduHidControlCardAisle", 0, 1, ".1.3.6.1.4.1.534.7.1.4.10.2.1.5.1.7", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduHidControlCardAisle", 0, 1, ".1.3.6.1.4.1.534.7.1.4.10.2.1.5.1.7", NULL, SU_FLAG_OK, NULL), /* pduHidControlCardAisle.1.8 = INTEGER: 0 */ - { "unmapped.pduHidControlCardAisle", 0, 1, ".1.3.6.1.4.1.534.7.1.4.10.2.1.5.1.8", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduHidControlCardAisle", 0, 1, ".1.3.6.1.4.1.534.7.1.4.10.2.1.5.1.8", NULL, SU_FLAG_OK, NULL), /* pduHidControlCardAisle.1.9 = INTEGER: 0 */ - { "unmapped.pduHidControlCardAisle", 0, 1, ".1.3.6.1.4.1.534.7.1.4.10.2.1.5.1.9", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduHidControlCardAisle", 0, 1, ".1.3.6.1.4.1.534.7.1.4.10.2.1.5.1.9", NULL, SU_FLAG_OK, NULL), /* pduHidControlCardAisle.1.10 = INTEGER: 0 */ - { "unmapped.pduHidControlCardAisle", 0, 1, ".1.3.6.1.4.1.534.7.1.4.10.2.1.5.1.10", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduHidControlCardAisle", 0, 1, ".1.3.6.1.4.1.534.7.1.4.10.2.1.5.1.10", NULL, SU_FLAG_OK, NULL), /* pduHidControlCardAisle.1.11 = INTEGER: 0 */ - { "unmapped.pduHidControlCardAisle", 0, 1, ".1.3.6.1.4.1.534.7.1.4.10.2.1.5.1.11", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduHidControlCardAisle", 0, 1, ".1.3.6.1.4.1.534.7.1.4.10.2.1.5.1.11", NULL, SU_FLAG_OK, NULL), /* pduHidControlCardAisle.1.12 = INTEGER: 0 */ - { "unmapped.pduHidControlCardAisle", 0, 1, ".1.3.6.1.4.1.534.7.1.4.10.2.1.5.1.12", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduHidControlCardAisle", 0, 1, ".1.3.6.1.4.1.534.7.1.4.10.2.1.5.1.12", NULL, SU_FLAG_OK, NULL), /* pduHidControlCardAisle.1.13 = INTEGER: 0 */ - { "unmapped.pduHidControlCardAisle", 0, 1, ".1.3.6.1.4.1.534.7.1.4.10.2.1.5.1.13", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduHidControlCardAisle", 0, 1, ".1.3.6.1.4.1.534.7.1.4.10.2.1.5.1.13", NULL, SU_FLAG_OK, NULL), /* pduHidControlCardAisle.1.14 = INTEGER: 0 */ - { "unmapped.pduHidControlCardAisle", 0, 1, ".1.3.6.1.4.1.534.7.1.4.10.2.1.5.1.14", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduHidControlCardAisle", 0, 1, ".1.3.6.1.4.1.534.7.1.4.10.2.1.5.1.14", NULL, SU_FLAG_OK, NULL), /* pduHidControlCardAisle.1.15 = INTEGER: 0 */ - { "unmapped.pduHidControlCardAisle", 0, 1, ".1.3.6.1.4.1.534.7.1.4.10.2.1.5.1.15", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduHidControlCardAisle", 0, 1, ".1.3.6.1.4.1.534.7.1.4.10.2.1.5.1.15", NULL, SU_FLAG_OK, NULL), /* pduHidControlCardAisle.1.16 = INTEGER: 0 */ - { "unmapped.pduHidControlCardAisle", 0, 1, ".1.3.6.1.4.1.534.7.1.4.10.2.1.5.1.16", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduHidControlCardAisle", 0, 1, ".1.3.6.1.4.1.534.7.1.4.10.2.1.5.1.16", NULL, SU_FLAG_OK, NULL), /* pduOutletIndex.1.1 = INTEGER: 1 */ - { "unmapped.pduOutletIndex", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.1.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletIndex", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.1.1.1", NULL, SU_FLAG_OK, NULL), /* pduOutletIndex.1.2 = INTEGER: 2 */ - { "unmapped.pduOutletIndex", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.1.1.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletIndex", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.1.1.2", NULL, SU_FLAG_OK, NULL), /* pduOutletIndex.1.3 = INTEGER: 3 */ - { "unmapped.pduOutletIndex", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.1.1.3", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletIndex", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.1.1.3", NULL, SU_FLAG_OK, NULL), /* pduOutletIndex.1.4 = INTEGER: 4 */ - { "unmapped.pduOutletIndex", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.1.1.4", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletIndex", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.1.1.4", NULL, SU_FLAG_OK, NULL), /* pduOutletIndex.1.5 = INTEGER: 5 */ - { "unmapped.pduOutletIndex", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.1.1.5", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletIndex", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.1.1.5", NULL, SU_FLAG_OK, NULL), /* pduOutletIndex.1.6 = INTEGER: 6 */ - { "unmapped.pduOutletIndex", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.1.1.6", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletIndex", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.1.1.6", NULL, SU_FLAG_OK, NULL), /* pduOutletIndex.1.7 = INTEGER: 0 */ - { "unmapped.pduOutletIndex", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.1.1.7", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletIndex", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.1.1.7", NULL, SU_FLAG_OK, NULL), /* pduOutletIndex.1.8 = INTEGER: 0 */ - { "unmapped.pduOutletIndex", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.1.1.8", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletIndex", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.1.1.8", NULL, SU_FLAG_OK, NULL), /* pduOutletIndex.1.9 = INTEGER: 0 */ - { "unmapped.pduOutletIndex", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.1.1.9", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletIndex", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.1.1.9", NULL, SU_FLAG_OK, NULL), /* pduOutletIndex.1.10 = INTEGER: 0 */ - { "unmapped.pduOutletIndex", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.1.1.10", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletIndex", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.1.1.10", NULL, SU_FLAG_OK, NULL), /* pduOutletIndex.1.11 = INTEGER: 0 */ - { "unmapped.pduOutletIndex", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.1.1.11", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletIndex", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.1.1.11", NULL, SU_FLAG_OK, NULL), /* pduOutletIndex.1.12 = INTEGER: 0 */ - { "unmapped.pduOutletIndex", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.1.1.12", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletIndex", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.1.1.12", NULL, SU_FLAG_OK, NULL), /* pduOutletIndex.1.13 = INTEGER: 0 */ - { "unmapped.pduOutletIndex", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.1.1.13", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletIndex", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.1.1.13", NULL, SU_FLAG_OK, NULL), /* pduOutletIndex.1.14 = INTEGER: 0 */ - { "unmapped.pduOutletIndex", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.1.1.14", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletIndex", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.1.1.14", NULL, SU_FLAG_OK, NULL), /* pduOutletIndex.1.15 = INTEGER: 0 */ - { "unmapped.pduOutletIndex", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.1.1.15", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletIndex", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.1.1.15", NULL, SU_FLAG_OK, NULL), /* pduOutletIndex.1.16 = INTEGER: 0 */ - { "unmapped.pduOutletIndex", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.1.1.16", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletIndex", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.1.1.16", NULL, SU_FLAG_OK, NULL), /* pduOutletIndex.1.17 = INTEGER: 0 */ - { "unmapped.pduOutletIndex", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.1.1.17", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletIndex", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.1.1.17", NULL, SU_FLAG_OK, NULL), /* pduOutletIndex.1.18 = INTEGER: 0 */ - { "unmapped.pduOutletIndex", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.1.1.18", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletIndex", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.1.1.18", NULL, SU_FLAG_OK, NULL), /* pduOutletIndex.1.19 = INTEGER: 0 */ - { "unmapped.pduOutletIndex", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.1.1.19", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletIndex", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.1.1.19", NULL, SU_FLAG_OK, NULL), /* pduOutletIndex.1.20 = INTEGER: 0 */ - { "unmapped.pduOutletIndex", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.1.1.20", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletIndex", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.1.1.20", NULL, SU_FLAG_OK, NULL), /* pduOutletIndex.1.21 = INTEGER: 0 */ - { "unmapped.pduOutletIndex", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.1.1.21", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletIndex", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.1.1.21", NULL, SU_FLAG_OK, NULL), /* pduOutletIndex.1.22 = INTEGER: 0 */ - { "unmapped.pduOutletIndex", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.1.1.22", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletIndex", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.1.1.22", NULL, SU_FLAG_OK, NULL), /* pduOutletIndex.1.23 = INTEGER: 0 */ - { "unmapped.pduOutletIndex", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.1.1.23", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletIndex", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.1.1.23", NULL, SU_FLAG_OK, NULL), /* pduOutletIndex.1.24 = INTEGER: 0 */ - { "unmapped.pduOutletIndex", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.1.1.24", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletIndex", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.1.1.24", NULL, SU_FLAG_OK, NULL), /* pduOutletIndex.1.25 = INTEGER: 0 */ - { "unmapped.pduOutletIndex", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.1.1.25", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletIndex", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.1.1.25", NULL, SU_FLAG_OK, NULL), /* pduOutletIndex.1.26 = INTEGER: 0 */ - { "unmapped.pduOutletIndex", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.1.1.26", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletIndex", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.1.1.26", NULL, SU_FLAG_OK, NULL), /* pduOutletIndex.1.27 = INTEGER: 0 */ - { "unmapped.pduOutletIndex", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.1.1.27", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletIndex", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.1.1.27", NULL, SU_FLAG_OK, NULL), /* pduOutletIndex.1.28 = INTEGER: 0 */ - { "unmapped.pduOutletIndex", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.1.1.28", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletIndex", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.1.1.28", NULL, SU_FLAG_OK, NULL), /* pduOutletIndex.1.29 = INTEGER: 0 */ - { "unmapped.pduOutletIndex", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.1.1.29", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletIndex", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.1.1.29", NULL, SU_FLAG_OK, NULL), /* pduOutletIndex.1.30 = INTEGER: 0 */ - { "unmapped.pduOutletIndex", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.1.1.30", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletIndex", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.1.1.30", NULL, SU_FLAG_OK, NULL), /* pduOutletIndex.1.31 = INTEGER: 0 */ - { "unmapped.pduOutletIndex", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.1.1.31", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletIndex", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.1.1.31", NULL, SU_FLAG_OK, NULL), /* pduOutletIndex.1.32 = INTEGER: 0 */ - { "unmapped.pduOutletIndex", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.1.1.32", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletIndex", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.1.1.32", NULL, SU_FLAG_OK, NULL), /* pduOutletIndex.1.33 = INTEGER: 0 */ - { "unmapped.pduOutletIndex", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.1.1.33", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletIndex", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.1.1.33", NULL, SU_FLAG_OK, NULL), /* pduOutletIndex.1.34 = INTEGER: 0 */ - { "unmapped.pduOutletIndex", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.1.1.34", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletIndex", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.1.1.34", NULL, SU_FLAG_OK, NULL), /* pduOutletIndex.1.35 = INTEGER: 0 */ - { "unmapped.pduOutletIndex", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.1.1.35", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletIndex", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.1.1.35", NULL, SU_FLAG_OK, NULL), /* pduOutletIndex.1.36 = INTEGER: 0 */ - { "unmapped.pduOutletIndex", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.1.1.36", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletIndex", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.1.1.36", NULL, SU_FLAG_OK, NULL), /* pduOutletIndex.1.37 = INTEGER: 0 */ - { "unmapped.pduOutletIndex", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.1.1.37", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletIndex", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.1.1.37", NULL, SU_FLAG_OK, NULL), /* pduOutletIndex.1.38 = INTEGER: 0 */ - { "unmapped.pduOutletIndex", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.1.1.38", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletIndex", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.1.1.38", NULL, SU_FLAG_OK, NULL), /* pduOutletIndex.1.39 = INTEGER: 0 */ - { "unmapped.pduOutletIndex", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.1.1.39", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletIndex", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.1.1.39", NULL, SU_FLAG_OK, NULL), /* pduOutletIndex.1.40 = INTEGER: 0 */ - { "unmapped.pduOutletIndex", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.1.1.40", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletIndex", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.1.1.40", NULL, SU_FLAG_OK, NULL), /* pduOutletIndex.1.41 = INTEGER: 0 */ - { "unmapped.pduOutletIndex", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.1.1.41", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletIndex", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.1.1.41", NULL, SU_FLAG_OK, NULL), /* pduOutletIndex.1.42 = INTEGER: 0 */ - { "unmapped.pduOutletIndex", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.1.1.42", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletIndex", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.1.1.42", NULL, SU_FLAG_OK, NULL), /* pduOutletIndex.1.43 = INTEGER: 0 */ - { "unmapped.pduOutletIndex", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.1.1.43", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletIndex", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.1.1.43", NULL, SU_FLAG_OK, NULL), /* pduOutletIndex.1.44 = INTEGER: 0 */ - { "unmapped.pduOutletIndex", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.1.1.44", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletIndex", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.1.1.44", NULL, SU_FLAG_OK, NULL), /* pduOutletIndex.1.45 = INTEGER: 0 */ - { "unmapped.pduOutletIndex", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.1.1.45", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletIndex", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.1.1.45", NULL, SU_FLAG_OK, NULL), /* pduOutletIndex.1.46 = INTEGER: 0 */ - { "unmapped.pduOutletIndex", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.1.1.46", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletIndex", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.1.1.46", NULL, SU_FLAG_OK, NULL), /* pduOutletIndex.1.47 = INTEGER: 0 */ - { "unmapped.pduOutletIndex", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.1.1.47", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletIndex", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.1.1.47", NULL, SU_FLAG_OK, NULL), /* pduOutletIndex.1.48 = INTEGER: 0 */ - { "unmapped.pduOutletIndex", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.1.1.48", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletIndex", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.1.1.48", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThStatus.1.1 = INTEGER: 1 */ - { "unmapped.pduOutletActivePowerThStatus", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.6.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThStatus", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.6.1.1", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThStatus.1.2 = INTEGER: 1 */ - { "unmapped.pduOutletActivePowerThStatus", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.6.1.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThStatus", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.6.1.2", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThStatus.1.3 = INTEGER: 1 */ - { "unmapped.pduOutletActivePowerThStatus", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.6.1.3", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThStatus", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.6.1.3", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThStatus.1.4 = INTEGER: 1 */ - { "unmapped.pduOutletActivePowerThStatus", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.6.1.4", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThStatus", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.6.1.4", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThStatus.1.5 = INTEGER: 1 */ - { "unmapped.pduOutletActivePowerThStatus", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.6.1.5", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThStatus", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.6.1.5", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThStatus.1.6 = INTEGER: 1 */ - { "unmapped.pduOutletActivePowerThStatus", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.6.1.6", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThStatus", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.6.1.6", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThStatus.1.7 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThStatus", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.6.1.7", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThStatus", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.6.1.7", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThStatus.1.8 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThStatus", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.6.1.8", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThStatus", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.6.1.8", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThStatus.1.9 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThStatus", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.6.1.9", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThStatus", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.6.1.9", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThStatus.1.10 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThStatus", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.6.1.10", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThStatus", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.6.1.10", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThStatus.1.11 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThStatus", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.6.1.11", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThStatus", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.6.1.11", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThStatus.1.12 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThStatus", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.6.1.12", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThStatus", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.6.1.12", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThStatus.1.13 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThStatus", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.6.1.13", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThStatus", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.6.1.13", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThStatus.1.14 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThStatus", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.6.1.14", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThStatus", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.6.1.14", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThStatus.1.15 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThStatus", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.6.1.15", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThStatus", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.6.1.15", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThStatus.1.16 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThStatus", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.6.1.16", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThStatus", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.6.1.16", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThStatus.1.17 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThStatus", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.6.1.17", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThStatus", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.6.1.17", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThStatus.1.18 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThStatus", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.6.1.18", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThStatus", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.6.1.18", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThStatus.1.19 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThStatus", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.6.1.19", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThStatus", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.6.1.19", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThStatus.1.20 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThStatus", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.6.1.20", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThStatus", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.6.1.20", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThStatus.1.21 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThStatus", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.6.1.21", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThStatus", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.6.1.21", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThStatus.1.22 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThStatus", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.6.1.22", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThStatus", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.6.1.22", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThStatus.1.23 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThStatus", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.6.1.23", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThStatus", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.6.1.23", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThStatus.1.24 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThStatus", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.6.1.24", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThStatus", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.6.1.24", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThStatus.1.25 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThStatus", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.6.1.25", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThStatus", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.6.1.25", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThStatus.1.26 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThStatus", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.6.1.26", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThStatus", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.6.1.26", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThStatus.1.27 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThStatus", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.6.1.27", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThStatus", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.6.1.27", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThStatus.1.28 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThStatus", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.6.1.28", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThStatus", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.6.1.28", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThStatus.1.29 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThStatus", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.6.1.29", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThStatus", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.6.1.29", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThStatus.1.30 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThStatus", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.6.1.30", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThStatus", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.6.1.30", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThStatus.1.31 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThStatus", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.6.1.31", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThStatus", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.6.1.31", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThStatus.1.32 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThStatus", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.6.1.32", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThStatus", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.6.1.32", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThStatus.1.33 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThStatus", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.6.1.33", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThStatus", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.6.1.33", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThStatus.1.34 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThStatus", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.6.1.34", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThStatus", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.6.1.34", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThStatus.1.35 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThStatus", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.6.1.35", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThStatus", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.6.1.35", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThStatus.1.36 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThStatus", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.6.1.36", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThStatus", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.6.1.36", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThStatus.1.37 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThStatus", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.6.1.37", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThStatus", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.6.1.37", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThStatus.1.38 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThStatus", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.6.1.38", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThStatus", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.6.1.38", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThStatus.1.39 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThStatus", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.6.1.39", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThStatus", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.6.1.39", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThStatus.1.40 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThStatus", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.6.1.40", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThStatus", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.6.1.40", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThStatus.1.41 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThStatus", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.6.1.41", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThStatus", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.6.1.41", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThStatus.1.42 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThStatus", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.6.1.42", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThStatus", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.6.1.42", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThStatus.1.43 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThStatus", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.6.1.43", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThStatus", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.6.1.43", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThStatus.1.44 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThStatus", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.6.1.44", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThStatus", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.6.1.44", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThStatus.1.45 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThStatus", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.6.1.45", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThStatus", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.6.1.45", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThStatus.1.46 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThStatus", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.6.1.46", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThStatus", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.6.1.46", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThStatus.1.47 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThStatus", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.6.1.47", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThStatus", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.6.1.47", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThStatus.1.48 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThStatus", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.6.1.48", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThStatus", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.6.1.48", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThLowerWarning.1.1 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThLowerWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.7.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThLowerWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.7.1.1", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThLowerWarning.1.2 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThLowerWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.7.1.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThLowerWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.7.1.2", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThLowerWarning.1.3 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThLowerWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.7.1.3", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThLowerWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.7.1.3", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThLowerWarning.1.4 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThLowerWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.7.1.4", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThLowerWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.7.1.4", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThLowerWarning.1.5 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThLowerWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.7.1.5", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThLowerWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.7.1.5", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThLowerWarning.1.6 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThLowerWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.7.1.6", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThLowerWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.7.1.6", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThLowerWarning.1.7 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThLowerWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.7.1.7", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThLowerWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.7.1.7", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThLowerWarning.1.8 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThLowerWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.7.1.8", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThLowerWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.7.1.8", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThLowerWarning.1.9 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThLowerWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.7.1.9", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThLowerWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.7.1.9", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThLowerWarning.1.10 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThLowerWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.7.1.10", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThLowerWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.7.1.10", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThLowerWarning.1.11 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThLowerWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.7.1.11", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThLowerWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.7.1.11", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThLowerWarning.1.12 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThLowerWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.7.1.12", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThLowerWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.7.1.12", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThLowerWarning.1.13 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThLowerWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.7.1.13", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThLowerWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.7.1.13", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThLowerWarning.1.14 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThLowerWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.7.1.14", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThLowerWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.7.1.14", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThLowerWarning.1.15 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThLowerWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.7.1.15", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThLowerWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.7.1.15", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThLowerWarning.1.16 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThLowerWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.7.1.16", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThLowerWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.7.1.16", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThLowerWarning.1.17 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThLowerWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.7.1.17", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThLowerWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.7.1.17", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThLowerWarning.1.18 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThLowerWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.7.1.18", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThLowerWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.7.1.18", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThLowerWarning.1.19 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThLowerWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.7.1.19", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThLowerWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.7.1.19", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThLowerWarning.1.20 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThLowerWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.7.1.20", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThLowerWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.7.1.20", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThLowerWarning.1.21 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThLowerWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.7.1.21", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThLowerWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.7.1.21", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThLowerWarning.1.22 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThLowerWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.7.1.22", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThLowerWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.7.1.22", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThLowerWarning.1.23 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThLowerWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.7.1.23", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThLowerWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.7.1.23", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThLowerWarning.1.24 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThLowerWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.7.1.24", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThLowerWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.7.1.24", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThLowerWarning.1.25 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThLowerWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.7.1.25", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThLowerWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.7.1.25", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThLowerWarning.1.26 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThLowerWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.7.1.26", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThLowerWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.7.1.26", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThLowerWarning.1.27 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThLowerWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.7.1.27", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThLowerWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.7.1.27", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThLowerWarning.1.28 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThLowerWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.7.1.28", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThLowerWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.7.1.28", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThLowerWarning.1.29 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThLowerWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.7.1.29", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThLowerWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.7.1.29", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThLowerWarning.1.30 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThLowerWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.7.1.30", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThLowerWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.7.1.30", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThLowerWarning.1.31 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThLowerWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.7.1.31", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThLowerWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.7.1.31", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThLowerWarning.1.32 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThLowerWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.7.1.32", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThLowerWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.7.1.32", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThLowerWarning.1.33 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThLowerWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.7.1.33", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThLowerWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.7.1.33", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThLowerWarning.1.34 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThLowerWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.7.1.34", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThLowerWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.7.1.34", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThLowerWarning.1.35 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThLowerWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.7.1.35", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThLowerWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.7.1.35", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThLowerWarning.1.36 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThLowerWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.7.1.36", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThLowerWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.7.1.36", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThLowerWarning.1.37 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThLowerWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.7.1.37", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThLowerWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.7.1.37", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThLowerWarning.1.38 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThLowerWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.7.1.38", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThLowerWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.7.1.38", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThLowerWarning.1.39 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThLowerWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.7.1.39", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThLowerWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.7.1.39", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThLowerWarning.1.40 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThLowerWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.7.1.40", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThLowerWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.7.1.40", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThLowerWarning.1.41 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThLowerWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.7.1.41", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThLowerWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.7.1.41", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThLowerWarning.1.42 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThLowerWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.7.1.42", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThLowerWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.7.1.42", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThLowerWarning.1.43 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThLowerWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.7.1.43", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThLowerWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.7.1.43", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThLowerWarning.1.44 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThLowerWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.7.1.44", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThLowerWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.7.1.44", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThLowerWarning.1.45 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThLowerWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.7.1.45", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThLowerWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.7.1.45", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThLowerWarning.1.46 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThLowerWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.7.1.46", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThLowerWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.7.1.46", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThLowerWarning.1.47 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThLowerWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.7.1.47", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThLowerWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.7.1.47", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThLowerWarning.1.48 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThLowerWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.7.1.48", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThLowerWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.7.1.48", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThLowerCritical.1.1 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThLowerCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.8.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThLowerCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.8.1.1", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThLowerCritical.1.2 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThLowerCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.8.1.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThLowerCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.8.1.2", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThLowerCritical.1.3 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThLowerCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.8.1.3", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThLowerCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.8.1.3", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThLowerCritical.1.4 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThLowerCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.8.1.4", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThLowerCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.8.1.4", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThLowerCritical.1.5 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThLowerCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.8.1.5", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThLowerCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.8.1.5", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThLowerCritical.1.6 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThLowerCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.8.1.6", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThLowerCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.8.1.6", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThLowerCritical.1.7 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThLowerCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.8.1.7", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThLowerCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.8.1.7", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThLowerCritical.1.8 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThLowerCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.8.1.8", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThLowerCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.8.1.8", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThLowerCritical.1.9 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThLowerCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.8.1.9", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThLowerCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.8.1.9", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThLowerCritical.1.10 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThLowerCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.8.1.10", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThLowerCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.8.1.10", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThLowerCritical.1.11 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThLowerCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.8.1.11", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThLowerCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.8.1.11", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThLowerCritical.1.12 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThLowerCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.8.1.12", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThLowerCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.8.1.12", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThLowerCritical.1.13 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThLowerCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.8.1.13", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThLowerCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.8.1.13", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThLowerCritical.1.14 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThLowerCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.8.1.14", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThLowerCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.8.1.14", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThLowerCritical.1.15 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThLowerCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.8.1.15", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThLowerCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.8.1.15", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThLowerCritical.1.16 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThLowerCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.8.1.16", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThLowerCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.8.1.16", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThLowerCritical.1.17 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThLowerCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.8.1.17", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThLowerCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.8.1.17", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThLowerCritical.1.18 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThLowerCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.8.1.18", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThLowerCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.8.1.18", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThLowerCritical.1.19 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThLowerCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.8.1.19", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThLowerCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.8.1.19", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThLowerCritical.1.20 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThLowerCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.8.1.20", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThLowerCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.8.1.20", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThLowerCritical.1.21 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThLowerCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.8.1.21", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThLowerCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.8.1.21", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThLowerCritical.1.22 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThLowerCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.8.1.22", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThLowerCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.8.1.22", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThLowerCritical.1.23 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThLowerCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.8.1.23", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThLowerCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.8.1.23", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThLowerCritical.1.24 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThLowerCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.8.1.24", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThLowerCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.8.1.24", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThLowerCritical.1.25 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThLowerCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.8.1.25", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThLowerCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.8.1.25", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThLowerCritical.1.26 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThLowerCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.8.1.26", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThLowerCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.8.1.26", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThLowerCritical.1.27 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThLowerCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.8.1.27", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThLowerCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.8.1.27", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThLowerCritical.1.28 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThLowerCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.8.1.28", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThLowerCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.8.1.28", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThLowerCritical.1.29 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThLowerCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.8.1.29", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThLowerCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.8.1.29", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThLowerCritical.1.30 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThLowerCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.8.1.30", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThLowerCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.8.1.30", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThLowerCritical.1.31 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThLowerCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.8.1.31", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThLowerCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.8.1.31", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThLowerCritical.1.32 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThLowerCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.8.1.32", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThLowerCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.8.1.32", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThLowerCritical.1.33 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThLowerCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.8.1.33", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThLowerCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.8.1.33", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThLowerCritical.1.34 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThLowerCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.8.1.34", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThLowerCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.8.1.34", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThLowerCritical.1.35 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThLowerCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.8.1.35", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThLowerCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.8.1.35", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThLowerCritical.1.36 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThLowerCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.8.1.36", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThLowerCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.8.1.36", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThLowerCritical.1.37 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThLowerCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.8.1.37", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThLowerCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.8.1.37", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThLowerCritical.1.38 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThLowerCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.8.1.38", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThLowerCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.8.1.38", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThLowerCritical.1.39 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThLowerCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.8.1.39", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThLowerCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.8.1.39", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThLowerCritical.1.40 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThLowerCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.8.1.40", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThLowerCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.8.1.40", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThLowerCritical.1.41 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThLowerCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.8.1.41", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThLowerCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.8.1.41", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThLowerCritical.1.42 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThLowerCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.8.1.42", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThLowerCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.8.1.42", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThLowerCritical.1.43 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThLowerCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.8.1.43", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThLowerCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.8.1.43", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThLowerCritical.1.44 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThLowerCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.8.1.44", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThLowerCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.8.1.44", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThLowerCritical.1.45 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThLowerCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.8.1.45", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThLowerCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.8.1.45", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThLowerCritical.1.46 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThLowerCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.8.1.46", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThLowerCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.8.1.46", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThLowerCritical.1.47 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThLowerCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.8.1.47", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThLowerCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.8.1.47", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThLowerCritical.1.48 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThLowerCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.8.1.48", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThLowerCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.8.1.48", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThUpperWarning.1.1 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThUpperWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.9.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThUpperWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.9.1.1", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThUpperWarning.1.2 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThUpperWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.9.1.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThUpperWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.9.1.2", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThUpperWarning.1.3 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThUpperWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.9.1.3", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThUpperWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.9.1.3", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThUpperWarning.1.4 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThUpperWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.9.1.4", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThUpperWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.9.1.4", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThUpperWarning.1.5 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThUpperWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.9.1.5", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThUpperWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.9.1.5", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThUpperWarning.1.6 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThUpperWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.9.1.6", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThUpperWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.9.1.6", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThUpperWarning.1.7 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThUpperWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.9.1.7", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThUpperWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.9.1.7", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThUpperWarning.1.8 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThUpperWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.9.1.8", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThUpperWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.9.1.8", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThUpperWarning.1.9 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThUpperWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.9.1.9", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThUpperWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.9.1.9", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThUpperWarning.1.10 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThUpperWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.9.1.10", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThUpperWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.9.1.10", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThUpperWarning.1.11 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThUpperWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.9.1.11", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThUpperWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.9.1.11", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThUpperWarning.1.12 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThUpperWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.9.1.12", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThUpperWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.9.1.12", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThUpperWarning.1.13 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThUpperWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.9.1.13", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThUpperWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.9.1.13", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThUpperWarning.1.14 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThUpperWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.9.1.14", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThUpperWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.9.1.14", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThUpperWarning.1.15 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThUpperWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.9.1.15", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThUpperWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.9.1.15", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThUpperWarning.1.16 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThUpperWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.9.1.16", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThUpperWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.9.1.16", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThUpperWarning.1.17 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThUpperWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.9.1.17", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThUpperWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.9.1.17", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThUpperWarning.1.18 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThUpperWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.9.1.18", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThUpperWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.9.1.18", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThUpperWarning.1.19 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThUpperWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.9.1.19", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThUpperWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.9.1.19", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThUpperWarning.1.20 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThUpperWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.9.1.20", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThUpperWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.9.1.20", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThUpperWarning.1.21 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThUpperWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.9.1.21", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThUpperWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.9.1.21", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThUpperWarning.1.22 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThUpperWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.9.1.22", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThUpperWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.9.1.22", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThUpperWarning.1.23 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThUpperWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.9.1.23", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThUpperWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.9.1.23", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThUpperWarning.1.24 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThUpperWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.9.1.24", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThUpperWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.9.1.24", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThUpperWarning.1.25 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThUpperWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.9.1.25", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThUpperWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.9.1.25", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThUpperWarning.1.26 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThUpperWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.9.1.26", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThUpperWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.9.1.26", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThUpperWarning.1.27 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThUpperWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.9.1.27", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThUpperWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.9.1.27", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThUpperWarning.1.28 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThUpperWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.9.1.28", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThUpperWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.9.1.28", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThUpperWarning.1.29 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThUpperWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.9.1.29", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThUpperWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.9.1.29", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThUpperWarning.1.30 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThUpperWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.9.1.30", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThUpperWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.9.1.30", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThUpperWarning.1.31 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThUpperWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.9.1.31", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThUpperWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.9.1.31", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThUpperWarning.1.32 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThUpperWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.9.1.32", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThUpperWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.9.1.32", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThUpperWarning.1.33 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThUpperWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.9.1.33", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThUpperWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.9.1.33", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThUpperWarning.1.34 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThUpperWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.9.1.34", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThUpperWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.9.1.34", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThUpperWarning.1.35 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThUpperWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.9.1.35", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThUpperWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.9.1.35", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThUpperWarning.1.36 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThUpperWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.9.1.36", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThUpperWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.9.1.36", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThUpperWarning.1.37 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThUpperWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.9.1.37", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThUpperWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.9.1.37", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThUpperWarning.1.38 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThUpperWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.9.1.38", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThUpperWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.9.1.38", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThUpperWarning.1.39 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThUpperWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.9.1.39", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThUpperWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.9.1.39", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThUpperWarning.1.40 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThUpperWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.9.1.40", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThUpperWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.9.1.40", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThUpperWarning.1.41 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThUpperWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.9.1.41", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThUpperWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.9.1.41", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThUpperWarning.1.42 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThUpperWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.9.1.42", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThUpperWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.9.1.42", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThUpperWarning.1.43 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThUpperWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.9.1.43", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThUpperWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.9.1.43", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThUpperWarning.1.44 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThUpperWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.9.1.44", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThUpperWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.9.1.44", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThUpperWarning.1.45 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThUpperWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.9.1.45", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThUpperWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.9.1.45", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThUpperWarning.1.46 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThUpperWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.9.1.46", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThUpperWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.9.1.46", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThUpperWarning.1.47 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThUpperWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.9.1.47", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThUpperWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.9.1.47", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThUpperWarning.1.48 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThUpperWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.9.1.48", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThUpperWarning", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.9.1.48", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThUpperCritical.1.1 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThUpperCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.10.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThUpperCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.10.1.1", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThUpperCritical.1.2 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThUpperCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.10.1.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThUpperCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.10.1.2", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThUpperCritical.1.3 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThUpperCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.10.1.3", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThUpperCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.10.1.3", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThUpperCritical.1.4 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThUpperCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.10.1.4", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThUpperCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.10.1.4", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThUpperCritical.1.5 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThUpperCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.10.1.5", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThUpperCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.10.1.5", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThUpperCritical.1.6 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThUpperCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.10.1.6", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThUpperCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.10.1.6", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThUpperCritical.1.7 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThUpperCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.10.1.7", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThUpperCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.10.1.7", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThUpperCritical.1.8 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThUpperCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.10.1.8", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThUpperCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.10.1.8", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThUpperCritical.1.9 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThUpperCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.10.1.9", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThUpperCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.10.1.9", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThUpperCritical.1.10 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThUpperCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.10.1.10", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThUpperCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.10.1.10", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThUpperCritical.1.11 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThUpperCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.10.1.11", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThUpperCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.10.1.11", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThUpperCritical.1.12 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThUpperCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.10.1.12", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThUpperCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.10.1.12", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThUpperCritical.1.13 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThUpperCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.10.1.13", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThUpperCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.10.1.13", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThUpperCritical.1.14 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThUpperCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.10.1.14", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThUpperCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.10.1.14", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThUpperCritical.1.15 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThUpperCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.10.1.15", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThUpperCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.10.1.15", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThUpperCritical.1.16 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThUpperCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.10.1.16", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThUpperCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.10.1.16", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThUpperCritical.1.17 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThUpperCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.10.1.17", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThUpperCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.10.1.17", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThUpperCritical.1.18 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThUpperCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.10.1.18", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThUpperCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.10.1.18", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThUpperCritical.1.19 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThUpperCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.10.1.19", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThUpperCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.10.1.19", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThUpperCritical.1.20 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThUpperCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.10.1.20", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThUpperCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.10.1.20", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThUpperCritical.1.21 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThUpperCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.10.1.21", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThUpperCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.10.1.21", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThUpperCritical.1.22 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThUpperCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.10.1.22", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThUpperCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.10.1.22", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThUpperCritical.1.23 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThUpperCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.10.1.23", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThUpperCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.10.1.23", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThUpperCritical.1.24 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThUpperCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.10.1.24", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThUpperCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.10.1.24", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThUpperCritical.1.25 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThUpperCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.10.1.25", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThUpperCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.10.1.25", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThUpperCritical.1.26 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThUpperCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.10.1.26", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThUpperCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.10.1.26", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThUpperCritical.1.27 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThUpperCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.10.1.27", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThUpperCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.10.1.27", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThUpperCritical.1.28 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThUpperCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.10.1.28", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThUpperCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.10.1.28", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThUpperCritical.1.29 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThUpperCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.10.1.29", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThUpperCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.10.1.29", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThUpperCritical.1.30 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThUpperCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.10.1.30", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThUpperCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.10.1.30", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThUpperCritical.1.31 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThUpperCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.10.1.31", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThUpperCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.10.1.31", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThUpperCritical.1.32 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThUpperCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.10.1.32", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThUpperCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.10.1.32", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThUpperCritical.1.33 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThUpperCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.10.1.33", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThUpperCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.10.1.33", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThUpperCritical.1.34 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThUpperCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.10.1.34", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThUpperCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.10.1.34", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThUpperCritical.1.35 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThUpperCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.10.1.35", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThUpperCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.10.1.35", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThUpperCritical.1.36 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThUpperCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.10.1.36", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThUpperCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.10.1.36", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThUpperCritical.1.37 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThUpperCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.10.1.37", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThUpperCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.10.1.37", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThUpperCritical.1.38 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThUpperCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.10.1.38", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThUpperCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.10.1.38", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThUpperCritical.1.39 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThUpperCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.10.1.39", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThUpperCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.10.1.39", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThUpperCritical.1.40 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThUpperCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.10.1.40", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThUpperCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.10.1.40", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThUpperCritical.1.41 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThUpperCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.10.1.41", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThUpperCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.10.1.41", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThUpperCritical.1.42 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThUpperCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.10.1.42", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThUpperCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.10.1.42", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThUpperCritical.1.43 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThUpperCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.10.1.43", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThUpperCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.10.1.43", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThUpperCritical.1.44 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThUpperCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.10.1.44", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThUpperCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.10.1.44", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThUpperCritical.1.45 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThUpperCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.10.1.45", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThUpperCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.10.1.45", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThUpperCritical.1.46 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThUpperCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.10.1.46", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThUpperCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.10.1.46", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThUpperCritical.1.47 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThUpperCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.10.1.47", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThUpperCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.10.1.47", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThUpperCritical.1.48 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThUpperCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.10.1.48", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThUpperCritical", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.10.1.48", NULL, SU_FLAG_OK, NULL), /* pduOutletWh.1.1 = INTEGER: 0 */ - { "unmapped.pduOutletWh", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.14.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletWh", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.14.1.1", NULL, SU_FLAG_OK, NULL), /* pduOutletWh.1.2 = INTEGER: 0 */ - { "unmapped.pduOutletWh", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.14.1.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletWh", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.14.1.2", NULL, SU_FLAG_OK, NULL), /* pduOutletWh.1.3 = INTEGER: 0 */ - { "unmapped.pduOutletWh", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.14.1.3", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletWh", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.14.1.3", NULL, SU_FLAG_OK, NULL), /* pduOutletWh.1.4 = INTEGER: 0 */ - { "unmapped.pduOutletWh", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.14.1.4", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletWh", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.14.1.4", NULL, SU_FLAG_OK, NULL), /* pduOutletWh.1.5 = INTEGER: 0 */ - { "unmapped.pduOutletWh", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.14.1.5", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletWh", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.14.1.5", NULL, SU_FLAG_OK, NULL), /* pduOutletWh.1.6 = INTEGER: 0 */ - { "unmapped.pduOutletWh", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.14.1.6", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletWh", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.14.1.6", NULL, SU_FLAG_OK, NULL), /* pduOutletWh.1.7 = INTEGER: 0 */ - { "unmapped.pduOutletWh", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.14.1.7", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletWh", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.14.1.7", NULL, SU_FLAG_OK, NULL), /* pduOutletWh.1.8 = INTEGER: 0 */ - { "unmapped.pduOutletWh", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.14.1.8", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletWh", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.14.1.8", NULL, SU_FLAG_OK, NULL), /* pduOutletWh.1.9 = INTEGER: 0 */ - { "unmapped.pduOutletWh", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.14.1.9", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletWh", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.14.1.9", NULL, SU_FLAG_OK, NULL), /* pduOutletWh.1.10 = INTEGER: 0 */ - { "unmapped.pduOutletWh", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.14.1.10", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletWh", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.14.1.10", NULL, SU_FLAG_OK, NULL), /* pduOutletWh.1.11 = INTEGER: 0 */ - { "unmapped.pduOutletWh", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.14.1.11", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletWh", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.14.1.11", NULL, SU_FLAG_OK, NULL), /* pduOutletWh.1.12 = INTEGER: 0 */ - { "unmapped.pduOutletWh", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.14.1.12", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletWh", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.14.1.12", NULL, SU_FLAG_OK, NULL), /* pduOutletWh.1.13 = INTEGER: 0 */ - { "unmapped.pduOutletWh", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.14.1.13", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletWh", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.14.1.13", NULL, SU_FLAG_OK, NULL), /* pduOutletWh.1.14 = INTEGER: 0 */ - { "unmapped.pduOutletWh", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.14.1.14", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletWh", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.14.1.14", NULL, SU_FLAG_OK, NULL), /* pduOutletWh.1.15 = INTEGER: 0 */ - { "unmapped.pduOutletWh", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.14.1.15", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletWh", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.14.1.15", NULL, SU_FLAG_OK, NULL), /* pduOutletWh.1.16 = INTEGER: 0 */ - { "unmapped.pduOutletWh", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.14.1.16", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletWh", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.14.1.16", NULL, SU_FLAG_OK, NULL), /* pduOutletWh.1.17 = INTEGER: 0 */ - { "unmapped.pduOutletWh", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.14.1.17", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletWh", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.14.1.17", NULL, SU_FLAG_OK, NULL), /* pduOutletWh.1.18 = INTEGER: 0 */ - { "unmapped.pduOutletWh", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.14.1.18", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletWh", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.14.1.18", NULL, SU_FLAG_OK, NULL), /* pduOutletWh.1.19 = INTEGER: 0 */ - { "unmapped.pduOutletWh", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.14.1.19", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletWh", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.14.1.19", NULL, SU_FLAG_OK, NULL), /* pduOutletWh.1.20 = INTEGER: 0 */ - { "unmapped.pduOutletWh", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.14.1.20", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletWh", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.14.1.20", NULL, SU_FLAG_OK, NULL), /* pduOutletWh.1.21 = INTEGER: 0 */ - { "unmapped.pduOutletWh", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.14.1.21", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletWh", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.14.1.21", NULL, SU_FLAG_OK, NULL), /* pduOutletWh.1.22 = INTEGER: 0 */ - { "unmapped.pduOutletWh", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.14.1.22", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletWh", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.14.1.22", NULL, SU_FLAG_OK, NULL), /* pduOutletWh.1.23 = INTEGER: 0 */ - { "unmapped.pduOutletWh", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.14.1.23", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletWh", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.14.1.23", NULL, SU_FLAG_OK, NULL), /* pduOutletWh.1.24 = INTEGER: 0 */ - { "unmapped.pduOutletWh", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.14.1.24", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletWh", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.14.1.24", NULL, SU_FLAG_OK, NULL), /* pduOutletWh.1.25 = INTEGER: 0 */ - { "unmapped.pduOutletWh", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.14.1.25", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletWh", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.14.1.25", NULL, SU_FLAG_OK, NULL), /* pduOutletWh.1.26 = INTEGER: 0 */ - { "unmapped.pduOutletWh", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.14.1.26", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletWh", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.14.1.26", NULL, SU_FLAG_OK, NULL), /* pduOutletWh.1.27 = INTEGER: 0 */ - { "unmapped.pduOutletWh", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.14.1.27", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletWh", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.14.1.27", NULL, SU_FLAG_OK, NULL), /* pduOutletWh.1.28 = INTEGER: 0 */ - { "unmapped.pduOutletWh", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.14.1.28", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletWh", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.14.1.28", NULL, SU_FLAG_OK, NULL), /* pduOutletWh.1.29 = INTEGER: 0 */ - { "unmapped.pduOutletWh", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.14.1.29", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletWh", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.14.1.29", NULL, SU_FLAG_OK, NULL), /* pduOutletWh.1.30 = INTEGER: 0 */ - { "unmapped.pduOutletWh", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.14.1.30", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletWh", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.14.1.30", NULL, SU_FLAG_OK, NULL), /* pduOutletWh.1.31 = INTEGER: 0 */ - { "unmapped.pduOutletWh", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.14.1.31", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletWh", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.14.1.31", NULL, SU_FLAG_OK, NULL), /* pduOutletWh.1.32 = INTEGER: 0 */ - { "unmapped.pduOutletWh", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.14.1.32", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletWh", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.14.1.32", NULL, SU_FLAG_OK, NULL), /* pduOutletWh.1.33 = INTEGER: 0 */ - { "unmapped.pduOutletWh", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.14.1.33", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletWh", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.14.1.33", NULL, SU_FLAG_OK, NULL), /* pduOutletWh.1.34 = INTEGER: 0 */ - { "unmapped.pduOutletWh", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.14.1.34", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletWh", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.14.1.34", NULL, SU_FLAG_OK, NULL), /* pduOutletWh.1.35 = INTEGER: 0 */ - { "unmapped.pduOutletWh", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.14.1.35", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletWh", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.14.1.35", NULL, SU_FLAG_OK, NULL), /* pduOutletWh.1.36 = INTEGER: 0 */ - { "unmapped.pduOutletWh", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.14.1.36", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletWh", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.14.1.36", NULL, SU_FLAG_OK, NULL), /* pduOutletWh.1.37 = INTEGER: 0 */ - { "unmapped.pduOutletWh", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.14.1.37", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletWh", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.14.1.37", NULL, SU_FLAG_OK, NULL), /* pduOutletWh.1.38 = INTEGER: 0 */ - { "unmapped.pduOutletWh", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.14.1.38", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletWh", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.14.1.38", NULL, SU_FLAG_OK, NULL), /* pduOutletWh.1.39 = INTEGER: 0 */ - { "unmapped.pduOutletWh", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.14.1.39", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletWh", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.14.1.39", NULL, SU_FLAG_OK, NULL), /* pduOutletWh.1.40 = INTEGER: 0 */ - { "unmapped.pduOutletWh", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.14.1.40", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletWh", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.14.1.40", NULL, SU_FLAG_OK, NULL), /* pduOutletWh.1.41 = INTEGER: 0 */ - { "unmapped.pduOutletWh", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.14.1.41", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletWh", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.14.1.41", NULL, SU_FLAG_OK, NULL), /* pduOutletWh.1.42 = INTEGER: 0 */ - { "unmapped.pduOutletWh", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.14.1.42", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletWh", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.14.1.42", NULL, SU_FLAG_OK, NULL), /* pduOutletWh.1.43 = INTEGER: 0 */ - { "unmapped.pduOutletWh", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.14.1.43", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletWh", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.14.1.43", NULL, SU_FLAG_OK, NULL), /* pduOutletWh.1.44 = INTEGER: 0 */ - { "unmapped.pduOutletWh", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.14.1.44", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletWh", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.14.1.44", NULL, SU_FLAG_OK, NULL), /* pduOutletWh.1.45 = INTEGER: 0 */ - { "unmapped.pduOutletWh", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.14.1.45", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletWh", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.14.1.45", NULL, SU_FLAG_OK, NULL), /* pduOutletWh.1.46 = INTEGER: 0 */ - { "unmapped.pduOutletWh", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.14.1.46", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletWh", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.14.1.46", NULL, SU_FLAG_OK, NULL), /* pduOutletWh.1.47 = INTEGER: 0 */ - { "unmapped.pduOutletWh", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.14.1.47", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletWh", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.14.1.47", NULL, SU_FLAG_OK, NULL), /* pduOutletWh.1.48 = INTEGER: 0 */ - { "unmapped.pduOutletWh", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.14.1.48", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletWh", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.14.1.48", NULL, SU_FLAG_OK, NULL), /* pduOutletWhTimer.1.1 = Hex-STRING: 32 30 32 31 2F 30 35 2F 32 39 20 30 39 3A 30 36 */ - { "unmapped.pduOutletWhTimer", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.7.1.5.1.1.15.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletWhTimer", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.7.1.5.1.1.15.1.1", NULL, SU_FLAG_OK, NULL), /* pduOutletWhTimer.1.2 = Hex-STRING: 32 30 32 31 2F 30 35 2F 32 39 20 30 39 3A 30 36 */ - { "unmapped.pduOutletWhTimer", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.7.1.5.1.1.15.1.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletWhTimer", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.7.1.5.1.1.15.1.2", NULL, SU_FLAG_OK, NULL), /* pduOutletWhTimer.1.3 = Hex-STRING: 32 30 32 31 2F 30 35 2F 32 39 20 30 39 3A 30 36 */ - { "unmapped.pduOutletWhTimer", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.7.1.5.1.1.15.1.3", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletWhTimer", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.7.1.5.1.1.15.1.3", NULL, SU_FLAG_OK, NULL), /* pduOutletWhTimer.1.4 = Hex-STRING: 32 30 32 31 2F 30 35 2F 32 39 20 30 39 3A 30 36 */ - { "unmapped.pduOutletWhTimer", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.7.1.5.1.1.15.1.4", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletWhTimer", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.7.1.5.1.1.15.1.4", NULL, SU_FLAG_OK, NULL), /* pduOutletWhTimer.1.5 = Hex-STRING: 32 30 32 31 2F 30 35 2F 32 39 20 30 39 3A 30 36 */ - { "unmapped.pduOutletWhTimer", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.7.1.5.1.1.15.1.5", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletWhTimer", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.7.1.5.1.1.15.1.5", NULL, SU_FLAG_OK, NULL), /* pduOutletWhTimer.1.6 = Hex-STRING: 32 30 32 31 2F 30 35 2F 32 39 20 30 39 3A 30 36 */ - { "unmapped.pduOutletWhTimer", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.7.1.5.1.1.15.1.6", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletWhTimer", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.7.1.5.1.1.15.1.6", NULL, SU_FLAG_OK, NULL), /* pduOutletWhTimer.1.7 = Hex-STRING: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 */ - { "unmapped.pduOutletWhTimer", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.7.1.5.1.1.15.1.7", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletWhTimer", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.7.1.5.1.1.15.1.7", NULL, SU_FLAG_OK, NULL), /* pduOutletWhTimer.1.8 = Hex-STRING: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 */ - { "unmapped.pduOutletWhTimer", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.7.1.5.1.1.15.1.8", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletWhTimer", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.7.1.5.1.1.15.1.8", NULL, SU_FLAG_OK, NULL), /* pduOutletWhTimer.1.9 = Hex-STRING: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 */ - { "unmapped.pduOutletWhTimer", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.7.1.5.1.1.15.1.9", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletWhTimer", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.7.1.5.1.1.15.1.9", NULL, SU_FLAG_OK, NULL), /* pduOutletWhTimer.1.10 = Hex-STRING: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 */ - { "unmapped.pduOutletWhTimer", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.7.1.5.1.1.15.1.10", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletWhTimer", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.7.1.5.1.1.15.1.10", NULL, SU_FLAG_OK, NULL), /* pduOutletWhTimer.1.11 = Hex-STRING: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 */ - { "unmapped.pduOutletWhTimer", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.7.1.5.1.1.15.1.11", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletWhTimer", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.7.1.5.1.1.15.1.11", NULL, SU_FLAG_OK, NULL), /* pduOutletWhTimer.1.12 = Hex-STRING: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 */ - { "unmapped.pduOutletWhTimer", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.7.1.5.1.1.15.1.12", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletWhTimer", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.7.1.5.1.1.15.1.12", NULL, SU_FLAG_OK, NULL), /* pduOutletWhTimer.1.13 = Hex-STRING: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 */ - { "unmapped.pduOutletWhTimer", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.7.1.5.1.1.15.1.13", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletWhTimer", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.7.1.5.1.1.15.1.13", NULL, SU_FLAG_OK, NULL), /* pduOutletWhTimer.1.14 = Hex-STRING: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 */ - { "unmapped.pduOutletWhTimer", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.7.1.5.1.1.15.1.14", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletWhTimer", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.7.1.5.1.1.15.1.14", NULL, SU_FLAG_OK, NULL), /* pduOutletWhTimer.1.15 = Hex-STRING: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 */ - { "unmapped.pduOutletWhTimer", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.7.1.5.1.1.15.1.15", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletWhTimer", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.7.1.5.1.1.15.1.15", NULL, SU_FLAG_OK, NULL), /* pduOutletWhTimer.1.16 = Hex-STRING: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 */ - { "unmapped.pduOutletWhTimer", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.7.1.5.1.1.15.1.16", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletWhTimer", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.7.1.5.1.1.15.1.16", NULL, SU_FLAG_OK, NULL), /* pduOutletWhTimer.1.17 = Hex-STRING: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 */ - { "unmapped.pduOutletWhTimer", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.7.1.5.1.1.15.1.17", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletWhTimer", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.7.1.5.1.1.15.1.17", NULL, SU_FLAG_OK, NULL), /* pduOutletWhTimer.1.18 = Hex-STRING: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 */ - { "unmapped.pduOutletWhTimer", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.7.1.5.1.1.15.1.18", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletWhTimer", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.7.1.5.1.1.15.1.18", NULL, SU_FLAG_OK, NULL), /* pduOutletWhTimer.1.19 = Hex-STRING: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 */ - { "unmapped.pduOutletWhTimer", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.7.1.5.1.1.15.1.19", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletWhTimer", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.7.1.5.1.1.15.1.19", NULL, SU_FLAG_OK, NULL), /* pduOutletWhTimer.1.20 = Hex-STRING: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 */ - { "unmapped.pduOutletWhTimer", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.7.1.5.1.1.15.1.20", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletWhTimer", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.7.1.5.1.1.15.1.20", NULL, SU_FLAG_OK, NULL), /* pduOutletWhTimer.1.21 = Hex-STRING: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 */ - { "unmapped.pduOutletWhTimer", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.7.1.5.1.1.15.1.21", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletWhTimer", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.7.1.5.1.1.15.1.21", NULL, SU_FLAG_OK, NULL), /* pduOutletWhTimer.1.22 = Hex-STRING: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 */ - { "unmapped.pduOutletWhTimer", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.7.1.5.1.1.15.1.22", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletWhTimer", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.7.1.5.1.1.15.1.22", NULL, SU_FLAG_OK, NULL), /* pduOutletWhTimer.1.23 = Hex-STRING: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 */ - { "unmapped.pduOutletWhTimer", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.7.1.5.1.1.15.1.23", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletWhTimer", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.7.1.5.1.1.15.1.23", NULL, SU_FLAG_OK, NULL), /* pduOutletWhTimer.1.24 = Hex-STRING: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 */ - { "unmapped.pduOutletWhTimer", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.7.1.5.1.1.15.1.24", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletWhTimer", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.7.1.5.1.1.15.1.24", NULL, SU_FLAG_OK, NULL), /* pduOutletWhTimer.1.25 = Hex-STRING: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 */ - { "unmapped.pduOutletWhTimer", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.7.1.5.1.1.15.1.25", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletWhTimer", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.7.1.5.1.1.15.1.25", NULL, SU_FLAG_OK, NULL), /* pduOutletWhTimer.1.26 = Hex-STRING: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 */ - { "unmapped.pduOutletWhTimer", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.7.1.5.1.1.15.1.26", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletWhTimer", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.7.1.5.1.1.15.1.26", NULL, SU_FLAG_OK, NULL), /* pduOutletWhTimer.1.27 = Hex-STRING: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 */ - { "unmapped.pduOutletWhTimer", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.7.1.5.1.1.15.1.27", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletWhTimer", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.7.1.5.1.1.15.1.27", NULL, SU_FLAG_OK, NULL), /* pduOutletWhTimer.1.28 = Hex-STRING: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 */ - { "unmapped.pduOutletWhTimer", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.7.1.5.1.1.15.1.28", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletWhTimer", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.7.1.5.1.1.15.1.28", NULL, SU_FLAG_OK, NULL), /* pduOutletWhTimer.1.29 = Hex-STRING: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 */ - { "unmapped.pduOutletWhTimer", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.7.1.5.1.1.15.1.29", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletWhTimer", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.7.1.5.1.1.15.1.29", NULL, SU_FLAG_OK, NULL), /* pduOutletWhTimer.1.30 = Hex-STRING: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 */ - { "unmapped.pduOutletWhTimer", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.7.1.5.1.1.15.1.30", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletWhTimer", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.7.1.5.1.1.15.1.30", NULL, SU_FLAG_OK, NULL), /* pduOutletWhTimer.1.31 = Hex-STRING: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 */ - { "unmapped.pduOutletWhTimer", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.7.1.5.1.1.15.1.31", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletWhTimer", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.7.1.5.1.1.15.1.31", NULL, SU_FLAG_OK, NULL), /* pduOutletWhTimer.1.32 = Hex-STRING: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 */ - { "unmapped.pduOutletWhTimer", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.7.1.5.1.1.15.1.32", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletWhTimer", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.7.1.5.1.1.15.1.32", NULL, SU_FLAG_OK, NULL), /* pduOutletWhTimer.1.33 = Hex-STRING: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 */ - { "unmapped.pduOutletWhTimer", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.7.1.5.1.1.15.1.33", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletWhTimer", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.7.1.5.1.1.15.1.33", NULL, SU_FLAG_OK, NULL), /* pduOutletWhTimer.1.34 = Hex-STRING: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 */ - { "unmapped.pduOutletWhTimer", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.7.1.5.1.1.15.1.34", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletWhTimer", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.7.1.5.1.1.15.1.34", NULL, SU_FLAG_OK, NULL), /* pduOutletWhTimer.1.35 = Hex-STRING: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 */ - { "unmapped.pduOutletWhTimer", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.7.1.5.1.1.15.1.35", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletWhTimer", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.7.1.5.1.1.15.1.35", NULL, SU_FLAG_OK, NULL), /* pduOutletWhTimer.1.36 = Hex-STRING: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 */ - { "unmapped.pduOutletWhTimer", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.7.1.5.1.1.15.1.36", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletWhTimer", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.7.1.5.1.1.15.1.36", NULL, SU_FLAG_OK, NULL), /* pduOutletWhTimer.1.37 = Hex-STRING: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 */ - { "unmapped.pduOutletWhTimer", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.7.1.5.1.1.15.1.37", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletWhTimer", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.7.1.5.1.1.15.1.37", NULL, SU_FLAG_OK, NULL), /* pduOutletWhTimer.1.38 = Hex-STRING: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 */ - { "unmapped.pduOutletWhTimer", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.7.1.5.1.1.15.1.38", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletWhTimer", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.7.1.5.1.1.15.1.38", NULL, SU_FLAG_OK, NULL), /* pduOutletWhTimer.1.39 = Hex-STRING: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 */ - { "unmapped.pduOutletWhTimer", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.7.1.5.1.1.15.1.39", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletWhTimer", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.7.1.5.1.1.15.1.39", NULL, SU_FLAG_OK, NULL), /* pduOutletWhTimer.1.40 = Hex-STRING: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 */ - { "unmapped.pduOutletWhTimer", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.7.1.5.1.1.15.1.40", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletWhTimer", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.7.1.5.1.1.15.1.40", NULL, SU_FLAG_OK, NULL), /* pduOutletWhTimer.1.41 = Hex-STRING: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 */ - { "unmapped.pduOutletWhTimer", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.7.1.5.1.1.15.1.41", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletWhTimer", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.7.1.5.1.1.15.1.41", NULL, SU_FLAG_OK, NULL), /* pduOutletWhTimer.1.42 = Hex-STRING: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 */ - { "unmapped.pduOutletWhTimer", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.7.1.5.1.1.15.1.42", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletWhTimer", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.7.1.5.1.1.15.1.42", NULL, SU_FLAG_OK, NULL), /* pduOutletWhTimer.1.43 = Hex-STRING: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 */ - { "unmapped.pduOutletWhTimer", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.7.1.5.1.1.15.1.43", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletWhTimer", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.7.1.5.1.1.15.1.43", NULL, SU_FLAG_OK, NULL), /* pduOutletWhTimer.1.44 = Hex-STRING: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 */ - { "unmapped.pduOutletWhTimer", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.7.1.5.1.1.15.1.44", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletWhTimer", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.7.1.5.1.1.15.1.44", NULL, SU_FLAG_OK, NULL), /* pduOutletWhTimer.1.45 = Hex-STRING: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 */ - { "unmapped.pduOutletWhTimer", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.7.1.5.1.1.15.1.45", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletWhTimer", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.7.1.5.1.1.15.1.45", NULL, SU_FLAG_OK, NULL), /* pduOutletWhTimer.1.46 = Hex-STRING: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 */ - { "unmapped.pduOutletWhTimer", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.7.1.5.1.1.15.1.46", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletWhTimer", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.7.1.5.1.1.15.1.46", NULL, SU_FLAG_OK, NULL), /* pduOutletWhTimer.1.47 = Hex-STRING: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 */ - { "unmapped.pduOutletWhTimer", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.7.1.5.1.1.15.1.47", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletWhTimer", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.7.1.5.1.1.15.1.47", NULL, SU_FLAG_OK, NULL), /* pduOutletWhTimer.1.48 = Hex-STRING: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 */ - { "unmapped.pduOutletWhTimer", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.7.1.5.1.1.15.1.48", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletWhTimer", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.7.1.5.1.1.15.1.48", NULL, SU_FLAG_OK, NULL), /* pduOutletPowerFactor.1.1 = INTEGER: 100 */ - { "unmapped.pduOutletPowerFactor", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.16.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletPowerFactor", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.16.1.1", NULL, SU_FLAG_OK, NULL), /* pduOutletPowerFactor.1.2 = INTEGER: 100 */ - { "unmapped.pduOutletPowerFactor", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.16.1.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletPowerFactor", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.16.1.2", NULL, SU_FLAG_OK, NULL), /* pduOutletPowerFactor.1.3 = INTEGER: 100 */ - { "unmapped.pduOutletPowerFactor", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.16.1.3", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletPowerFactor", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.16.1.3", NULL, SU_FLAG_OK, NULL), /* pduOutletPowerFactor.1.4 = INTEGER: 100 */ - { "unmapped.pduOutletPowerFactor", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.16.1.4", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletPowerFactor", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.16.1.4", NULL, SU_FLAG_OK, NULL), /* pduOutletPowerFactor.1.5 = INTEGER: 100 */ - { "unmapped.pduOutletPowerFactor", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.16.1.5", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletPowerFactor", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.16.1.5", NULL, SU_FLAG_OK, NULL), /* pduOutletPowerFactor.1.6 = INTEGER: 100 */ - { "unmapped.pduOutletPowerFactor", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.16.1.6", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletPowerFactor", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.16.1.6", NULL, SU_FLAG_OK, NULL), /* pduOutletPowerFactor.1.7 = INTEGER: 0 */ - { "unmapped.pduOutletPowerFactor", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.16.1.7", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletPowerFactor", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.16.1.7", NULL, SU_FLAG_OK, NULL), /* pduOutletPowerFactor.1.8 = INTEGER: 0 */ - { "unmapped.pduOutletPowerFactor", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.16.1.8", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletPowerFactor", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.16.1.8", NULL, SU_FLAG_OK, NULL), /* pduOutletPowerFactor.1.9 = INTEGER: 0 */ - { "unmapped.pduOutletPowerFactor", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.16.1.9", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletPowerFactor", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.16.1.9", NULL, SU_FLAG_OK, NULL), /* pduOutletPowerFactor.1.10 = INTEGER: 0 */ - { "unmapped.pduOutletPowerFactor", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.16.1.10", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletPowerFactor", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.16.1.10", NULL, SU_FLAG_OK, NULL), /* pduOutletPowerFactor.1.11 = INTEGER: 0 */ - { "unmapped.pduOutletPowerFactor", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.16.1.11", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletPowerFactor", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.16.1.11", NULL, SU_FLAG_OK, NULL), /* pduOutletPowerFactor.1.12 = INTEGER: 0 */ - { "unmapped.pduOutletPowerFactor", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.16.1.12", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletPowerFactor", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.16.1.12", NULL, SU_FLAG_OK, NULL), /* pduOutletPowerFactor.1.13 = INTEGER: 0 */ - { "unmapped.pduOutletPowerFactor", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.16.1.13", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletPowerFactor", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.16.1.13", NULL, SU_FLAG_OK, NULL), /* pduOutletPowerFactor.1.14 = INTEGER: 0 */ - { "unmapped.pduOutletPowerFactor", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.16.1.14", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletPowerFactor", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.16.1.14", NULL, SU_FLAG_OK, NULL), /* pduOutletPowerFactor.1.15 = INTEGER: 0 */ - { "unmapped.pduOutletPowerFactor", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.16.1.15", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletPowerFactor", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.16.1.15", NULL, SU_FLAG_OK, NULL), /* pduOutletPowerFactor.1.16 = INTEGER: 0 */ - { "unmapped.pduOutletPowerFactor", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.16.1.16", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletPowerFactor", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.16.1.16", NULL, SU_FLAG_OK, NULL), /* pduOutletPowerFactor.1.17 = INTEGER: 0 */ - { "unmapped.pduOutletPowerFactor", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.16.1.17", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletPowerFactor", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.16.1.17", NULL, SU_FLAG_OK, NULL), /* pduOutletPowerFactor.1.18 = INTEGER: 0 */ - { "unmapped.pduOutletPowerFactor", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.16.1.18", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletPowerFactor", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.16.1.18", NULL, SU_FLAG_OK, NULL), /* pduOutletPowerFactor.1.19 = INTEGER: 0 */ - { "unmapped.pduOutletPowerFactor", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.16.1.19", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletPowerFactor", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.16.1.19", NULL, SU_FLAG_OK, NULL), /* pduOutletPowerFactor.1.20 = INTEGER: 0 */ - { "unmapped.pduOutletPowerFactor", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.16.1.20", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletPowerFactor", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.16.1.20", NULL, SU_FLAG_OK, NULL), /* pduOutletPowerFactor.1.21 = INTEGER: 0 */ - { "unmapped.pduOutletPowerFactor", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.16.1.21", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletPowerFactor", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.16.1.21", NULL, SU_FLAG_OK, NULL), /* pduOutletPowerFactor.1.22 = INTEGER: 0 */ - { "unmapped.pduOutletPowerFactor", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.16.1.22", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletPowerFactor", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.16.1.22", NULL, SU_FLAG_OK, NULL), /* pduOutletPowerFactor.1.23 = INTEGER: 0 */ - { "unmapped.pduOutletPowerFactor", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.16.1.23", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletPowerFactor", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.16.1.23", NULL, SU_FLAG_OK, NULL), /* pduOutletPowerFactor.1.24 = INTEGER: 0 */ - { "unmapped.pduOutletPowerFactor", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.16.1.24", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletPowerFactor", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.16.1.24", NULL, SU_FLAG_OK, NULL), /* pduOutletPowerFactor.1.25 = INTEGER: 0 */ - { "unmapped.pduOutletPowerFactor", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.16.1.25", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletPowerFactor", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.16.1.25", NULL, SU_FLAG_OK, NULL), /* pduOutletPowerFactor.1.26 = INTEGER: 0 */ - { "unmapped.pduOutletPowerFactor", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.16.1.26", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletPowerFactor", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.16.1.26", NULL, SU_FLAG_OK, NULL), /* pduOutletPowerFactor.1.27 = INTEGER: 0 */ - { "unmapped.pduOutletPowerFactor", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.16.1.27", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletPowerFactor", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.16.1.27", NULL, SU_FLAG_OK, NULL), /* pduOutletPowerFactor.1.28 = INTEGER: 0 */ - { "unmapped.pduOutletPowerFactor", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.16.1.28", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletPowerFactor", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.16.1.28", NULL, SU_FLAG_OK, NULL), /* pduOutletPowerFactor.1.29 = INTEGER: 0 */ - { "unmapped.pduOutletPowerFactor", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.16.1.29", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletPowerFactor", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.16.1.29", NULL, SU_FLAG_OK, NULL), /* pduOutletPowerFactor.1.30 = INTEGER: 0 */ - { "unmapped.pduOutletPowerFactor", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.16.1.30", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletPowerFactor", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.16.1.30", NULL, SU_FLAG_OK, NULL), /* pduOutletPowerFactor.1.31 = INTEGER: 0 */ - { "unmapped.pduOutletPowerFactor", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.16.1.31", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletPowerFactor", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.16.1.31", NULL, SU_FLAG_OK, NULL), /* pduOutletPowerFactor.1.32 = INTEGER: 0 */ - { "unmapped.pduOutletPowerFactor", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.16.1.32", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletPowerFactor", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.16.1.32", NULL, SU_FLAG_OK, NULL), /* pduOutletPowerFactor.1.33 = INTEGER: 0 */ - { "unmapped.pduOutletPowerFactor", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.16.1.33", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletPowerFactor", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.16.1.33", NULL, SU_FLAG_OK, NULL), /* pduOutletPowerFactor.1.34 = INTEGER: 0 */ - { "unmapped.pduOutletPowerFactor", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.16.1.34", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletPowerFactor", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.16.1.34", NULL, SU_FLAG_OK, NULL), /* pduOutletPowerFactor.1.35 = INTEGER: 0 */ - { "unmapped.pduOutletPowerFactor", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.16.1.35", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletPowerFactor", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.16.1.35", NULL, SU_FLAG_OK, NULL), /* pduOutletPowerFactor.1.36 = INTEGER: 0 */ - { "unmapped.pduOutletPowerFactor", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.16.1.36", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletPowerFactor", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.16.1.36", NULL, SU_FLAG_OK, NULL), /* pduOutletPowerFactor.1.37 = INTEGER: 0 */ - { "unmapped.pduOutletPowerFactor", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.16.1.37", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletPowerFactor", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.16.1.37", NULL, SU_FLAG_OK, NULL), /* pduOutletPowerFactor.1.38 = INTEGER: 0 */ - { "unmapped.pduOutletPowerFactor", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.16.1.38", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletPowerFactor", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.16.1.38", NULL, SU_FLAG_OK, NULL), /* pduOutletPowerFactor.1.39 = INTEGER: 0 */ - { "unmapped.pduOutletPowerFactor", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.16.1.39", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletPowerFactor", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.16.1.39", NULL, SU_FLAG_OK, NULL), /* pduOutletPowerFactor.1.40 = INTEGER: 0 */ - { "unmapped.pduOutletPowerFactor", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.16.1.40", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletPowerFactor", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.16.1.40", NULL, SU_FLAG_OK, NULL), /* pduOutletPowerFactor.1.41 = INTEGER: 0 */ - { "unmapped.pduOutletPowerFactor", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.16.1.41", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletPowerFactor", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.16.1.41", NULL, SU_FLAG_OK, NULL), /* pduOutletPowerFactor.1.42 = INTEGER: 0 */ - { "unmapped.pduOutletPowerFactor", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.16.1.42", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletPowerFactor", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.16.1.42", NULL, SU_FLAG_OK, NULL), /* pduOutletPowerFactor.1.43 = INTEGER: 0 */ - { "unmapped.pduOutletPowerFactor", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.16.1.43", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletPowerFactor", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.16.1.43", NULL, SU_FLAG_OK, NULL), /* pduOutletPowerFactor.1.44 = INTEGER: 0 */ - { "unmapped.pduOutletPowerFactor", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.16.1.44", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletPowerFactor", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.16.1.44", NULL, SU_FLAG_OK, NULL), /* pduOutletPowerFactor.1.45 = INTEGER: 0 */ - { "unmapped.pduOutletPowerFactor", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.16.1.45", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletPowerFactor", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.16.1.45", NULL, SU_FLAG_OK, NULL), /* pduOutletPowerFactor.1.46 = INTEGER: 0 */ - { "unmapped.pduOutletPowerFactor", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.16.1.46", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletPowerFactor", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.16.1.46", NULL, SU_FLAG_OK, NULL), /* pduOutletPowerFactor.1.47 = INTEGER: 0 */ - { "unmapped.pduOutletPowerFactor", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.16.1.47", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletPowerFactor", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.16.1.47", NULL, SU_FLAG_OK, NULL), /* pduOutletPowerFactor.1.48 = INTEGER: 0 */ - { "unmapped.pduOutletPowerFactor", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.16.1.48", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletPowerFactor", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.16.1.48", NULL, SU_FLAG_OK, NULL), /* pduOutletVAR.1.1 = INTEGER: 0 */ - { "unmapped.pduOutletVAR", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.17.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletVAR", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.17.1.1", NULL, SU_FLAG_OK, NULL), /* pduOutletVAR.1.2 = INTEGER: 0 */ - { "unmapped.pduOutletVAR", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.17.1.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletVAR", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.17.1.2", NULL, SU_FLAG_OK, NULL), /* pduOutletVAR.1.3 = INTEGER: 0 */ - { "unmapped.pduOutletVAR", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.17.1.3", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletVAR", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.17.1.3", NULL, SU_FLAG_OK, NULL), /* pduOutletVAR.1.4 = INTEGER: 0 */ - { "unmapped.pduOutletVAR", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.17.1.4", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletVAR", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.17.1.4", NULL, SU_FLAG_OK, NULL), /* pduOutletVAR.1.5 = INTEGER: 0 */ - { "unmapped.pduOutletVAR", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.17.1.5", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletVAR", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.17.1.5", NULL, SU_FLAG_OK, NULL), /* pduOutletVAR.1.6 = INTEGER: 0 */ - { "unmapped.pduOutletVAR", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.17.1.6", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletVAR", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.17.1.6", NULL, SU_FLAG_OK, NULL), /* pduOutletVAR.1.7 = INTEGER: 0 */ - { "unmapped.pduOutletVAR", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.17.1.7", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletVAR", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.17.1.7", NULL, SU_FLAG_OK, NULL), /* pduOutletVAR.1.8 = INTEGER: 0 */ - { "unmapped.pduOutletVAR", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.17.1.8", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletVAR", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.17.1.8", NULL, SU_FLAG_OK, NULL), /* pduOutletVAR.1.9 = INTEGER: 0 */ - { "unmapped.pduOutletVAR", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.17.1.9", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletVAR", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.17.1.9", NULL, SU_FLAG_OK, NULL), /* pduOutletVAR.1.10 = INTEGER: 0 */ - { "unmapped.pduOutletVAR", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.17.1.10", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletVAR", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.17.1.10", NULL, SU_FLAG_OK, NULL), /* pduOutletVAR.1.11 = INTEGER: 0 */ - { "unmapped.pduOutletVAR", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.17.1.11", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletVAR", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.17.1.11", NULL, SU_FLAG_OK, NULL), /* pduOutletVAR.1.12 = INTEGER: 0 */ - { "unmapped.pduOutletVAR", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.17.1.12", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletVAR", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.17.1.12", NULL, SU_FLAG_OK, NULL), /* pduOutletVAR.1.13 = INTEGER: 0 */ - { "unmapped.pduOutletVAR", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.17.1.13", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletVAR", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.17.1.13", NULL, SU_FLAG_OK, NULL), /* pduOutletVAR.1.14 = INTEGER: 0 */ - { "unmapped.pduOutletVAR", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.17.1.14", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletVAR", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.17.1.14", NULL, SU_FLAG_OK, NULL), /* pduOutletVAR.1.15 = INTEGER: 0 */ - { "unmapped.pduOutletVAR", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.17.1.15", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletVAR", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.17.1.15", NULL, SU_FLAG_OK, NULL), /* pduOutletVAR.1.16 = INTEGER: 0 */ - { "unmapped.pduOutletVAR", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.17.1.16", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletVAR", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.17.1.16", NULL, SU_FLAG_OK, NULL), /* pduOutletVAR.1.17 = INTEGER: 0 */ - { "unmapped.pduOutletVAR", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.17.1.17", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletVAR", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.17.1.17", NULL, SU_FLAG_OK, NULL), /* pduOutletVAR.1.18 = INTEGER: 0 */ - { "unmapped.pduOutletVAR", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.17.1.18", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletVAR", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.17.1.18", NULL, SU_FLAG_OK, NULL), /* pduOutletVAR.1.19 = INTEGER: 0 */ - { "unmapped.pduOutletVAR", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.17.1.19", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletVAR", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.17.1.19", NULL, SU_FLAG_OK, NULL), /* pduOutletVAR.1.20 = INTEGER: 0 */ - { "unmapped.pduOutletVAR", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.17.1.20", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletVAR", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.17.1.20", NULL, SU_FLAG_OK, NULL), /* pduOutletVAR.1.21 = INTEGER: 0 */ - { "unmapped.pduOutletVAR", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.17.1.21", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletVAR", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.17.1.21", NULL, SU_FLAG_OK, NULL), /* pduOutletVAR.1.22 = INTEGER: 0 */ - { "unmapped.pduOutletVAR", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.17.1.22", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletVAR", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.17.1.22", NULL, SU_FLAG_OK, NULL), /* pduOutletVAR.1.23 = INTEGER: 0 */ - { "unmapped.pduOutletVAR", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.17.1.23", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletVAR", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.17.1.23", NULL, SU_FLAG_OK, NULL), /* pduOutletVAR.1.24 = INTEGER: 0 */ - { "unmapped.pduOutletVAR", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.17.1.24", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletVAR", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.17.1.24", NULL, SU_FLAG_OK, NULL), /* pduOutletVAR.1.25 = INTEGER: 0 */ - { "unmapped.pduOutletVAR", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.17.1.25", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletVAR", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.17.1.25", NULL, SU_FLAG_OK, NULL), /* pduOutletVAR.1.26 = INTEGER: 0 */ - { "unmapped.pduOutletVAR", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.17.1.26", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletVAR", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.17.1.26", NULL, SU_FLAG_OK, NULL), /* pduOutletVAR.1.27 = INTEGER: 0 */ - { "unmapped.pduOutletVAR", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.17.1.27", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletVAR", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.17.1.27", NULL, SU_FLAG_OK, NULL), /* pduOutletVAR.1.28 = INTEGER: 0 */ - { "unmapped.pduOutletVAR", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.17.1.28", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletVAR", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.17.1.28", NULL, SU_FLAG_OK, NULL), /* pduOutletVAR.1.29 = INTEGER: 0 */ - { "unmapped.pduOutletVAR", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.17.1.29", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletVAR", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.17.1.29", NULL, SU_FLAG_OK, NULL), /* pduOutletVAR.1.30 = INTEGER: 0 */ - { "unmapped.pduOutletVAR", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.17.1.30", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletVAR", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.17.1.30", NULL, SU_FLAG_OK, NULL), /* pduOutletVAR.1.31 = INTEGER: 0 */ - { "unmapped.pduOutletVAR", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.17.1.31", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletVAR", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.17.1.31", NULL, SU_FLAG_OK, NULL), /* pduOutletVAR.1.32 = INTEGER: 0 */ - { "unmapped.pduOutletVAR", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.17.1.32", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletVAR", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.17.1.32", NULL, SU_FLAG_OK, NULL), /* pduOutletVAR.1.33 = INTEGER: 0 */ - { "unmapped.pduOutletVAR", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.17.1.33", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletVAR", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.17.1.33", NULL, SU_FLAG_OK, NULL), /* pduOutletVAR.1.34 = INTEGER: 0 */ - { "unmapped.pduOutletVAR", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.17.1.34", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletVAR", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.17.1.34", NULL, SU_FLAG_OK, NULL), /* pduOutletVAR.1.35 = INTEGER: 0 */ - { "unmapped.pduOutletVAR", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.17.1.35", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletVAR", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.17.1.35", NULL, SU_FLAG_OK, NULL), /* pduOutletVAR.1.36 = INTEGER: 0 */ - { "unmapped.pduOutletVAR", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.17.1.36", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletVAR", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.17.1.36", NULL, SU_FLAG_OK, NULL), /* pduOutletVAR.1.37 = INTEGER: 0 */ - { "unmapped.pduOutletVAR", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.17.1.37", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletVAR", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.17.1.37", NULL, SU_FLAG_OK, NULL), /* pduOutletVAR.1.38 = INTEGER: 0 */ - { "unmapped.pduOutletVAR", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.17.1.38", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletVAR", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.17.1.38", NULL, SU_FLAG_OK, NULL), /* pduOutletVAR.1.39 = INTEGER: 0 */ - { "unmapped.pduOutletVAR", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.17.1.39", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletVAR", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.17.1.39", NULL, SU_FLAG_OK, NULL), /* pduOutletVAR.1.40 = INTEGER: 0 */ - { "unmapped.pduOutletVAR", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.17.1.40", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletVAR", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.17.1.40", NULL, SU_FLAG_OK, NULL), /* pduOutletVAR.1.41 = INTEGER: 0 */ - { "unmapped.pduOutletVAR", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.17.1.41", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletVAR", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.17.1.41", NULL, SU_FLAG_OK, NULL), /* pduOutletVAR.1.42 = INTEGER: 0 */ - { "unmapped.pduOutletVAR", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.17.1.42", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletVAR", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.17.1.42", NULL, SU_FLAG_OK, NULL), /* pduOutletVAR.1.43 = INTEGER: 0 */ - { "unmapped.pduOutletVAR", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.17.1.43", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletVAR", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.17.1.43", NULL, SU_FLAG_OK, NULL), /* pduOutletVAR.1.44 = INTEGER: 0 */ - { "unmapped.pduOutletVAR", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.17.1.44", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletVAR", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.17.1.44", NULL, SU_FLAG_OK, NULL), /* pduOutletVAR.1.45 = INTEGER: 0 */ - { "unmapped.pduOutletVAR", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.17.1.45", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletVAR", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.17.1.45", NULL, SU_FLAG_OK, NULL), /* pduOutletVAR.1.46 = INTEGER: 0 */ - { "unmapped.pduOutletVAR", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.17.1.46", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletVAR", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.17.1.46", NULL, SU_FLAG_OK, NULL), /* pduOutletVAR.1.47 = INTEGER: 0 */ - { "unmapped.pduOutletVAR", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.17.1.47", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletVAR", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.17.1.47", NULL, SU_FLAG_OK, NULL), /* pduOutletVAR.1.48 = INTEGER: 0 */ - { "unmapped.pduOutletVAR", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.17.1.48", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletVAR", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.17.1.48", NULL, SU_FLAG_OK, NULL), /* pduOutletBranch.1.1 = INTEGER: 0 */ - { "unmapped.pduOutletBranch", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.18.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletBranch", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.18.1.1", NULL, SU_FLAG_OK, NULL), /* pduOutletBranch.1.2 = INTEGER: 0 */ - { "unmapped.pduOutletBranch", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.18.1.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletBranch", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.18.1.2", NULL, SU_FLAG_OK, NULL), /* pduOutletBranch.1.3 = INTEGER: 0 */ - { "unmapped.pduOutletBranch", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.18.1.3", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletBranch", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.18.1.3", NULL, SU_FLAG_OK, NULL), /* pduOutletBranch.1.4 = INTEGER: 0 */ - { "unmapped.pduOutletBranch", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.18.1.4", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletBranch", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.18.1.4", NULL, SU_FLAG_OK, NULL), /* pduOutletBranch.1.5 = INTEGER: 0 */ - { "unmapped.pduOutletBranch", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.18.1.5", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletBranch", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.18.1.5", NULL, SU_FLAG_OK, NULL), /* pduOutletBranch.1.6 = INTEGER: 0 */ - { "unmapped.pduOutletBranch", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.18.1.6", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletBranch", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.18.1.6", NULL, SU_FLAG_OK, NULL), /* pduOutletBranch.1.7 = INTEGER: 0 */ - { "unmapped.pduOutletBranch", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.18.1.7", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletBranch", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.18.1.7", NULL, SU_FLAG_OK, NULL), /* pduOutletBranch.1.8 = INTEGER: 0 */ - { "unmapped.pduOutletBranch", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.18.1.8", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletBranch", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.18.1.8", NULL, SU_FLAG_OK, NULL), /* pduOutletBranch.1.9 = INTEGER: 0 */ - { "unmapped.pduOutletBranch", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.18.1.9", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletBranch", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.18.1.9", NULL, SU_FLAG_OK, NULL), /* pduOutletBranch.1.10 = INTEGER: 0 */ - { "unmapped.pduOutletBranch", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.18.1.10", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletBranch", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.18.1.10", NULL, SU_FLAG_OK, NULL), /* pduOutletBranch.1.11 = INTEGER: 0 */ - { "unmapped.pduOutletBranch", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.18.1.11", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletBranch", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.18.1.11", NULL, SU_FLAG_OK, NULL), /* pduOutletBranch.1.12 = INTEGER: 0 */ - { "unmapped.pduOutletBranch", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.18.1.12", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletBranch", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.18.1.12", NULL, SU_FLAG_OK, NULL), /* pduOutletBranch.1.13 = INTEGER: 0 */ - { "unmapped.pduOutletBranch", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.18.1.13", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletBranch", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.18.1.13", NULL, SU_FLAG_OK, NULL), /* pduOutletBranch.1.14 = INTEGER: 0 */ - { "unmapped.pduOutletBranch", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.18.1.14", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletBranch", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.18.1.14", NULL, SU_FLAG_OK, NULL), /* pduOutletBranch.1.15 = INTEGER: 0 */ - { "unmapped.pduOutletBranch", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.18.1.15", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletBranch", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.18.1.15", NULL, SU_FLAG_OK, NULL), /* pduOutletBranch.1.16 = INTEGER: 0 */ - { "unmapped.pduOutletBranch", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.18.1.16", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletBranch", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.18.1.16", NULL, SU_FLAG_OK, NULL), /* pduOutletBranch.1.17 = INTEGER: 0 */ - { "unmapped.pduOutletBranch", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.18.1.17", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletBranch", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.18.1.17", NULL, SU_FLAG_OK, NULL), /* pduOutletBranch.1.18 = INTEGER: 0 */ - { "unmapped.pduOutletBranch", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.18.1.18", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletBranch", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.18.1.18", NULL, SU_FLAG_OK, NULL), /* pduOutletBranch.1.19 = INTEGER: 0 */ - { "unmapped.pduOutletBranch", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.18.1.19", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletBranch", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.18.1.19", NULL, SU_FLAG_OK, NULL), /* pduOutletBranch.1.20 = INTEGER: 0 */ - { "unmapped.pduOutletBranch", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.18.1.20", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletBranch", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.18.1.20", NULL, SU_FLAG_OK, NULL), /* pduOutletBranch.1.21 = INTEGER: 0 */ - { "unmapped.pduOutletBranch", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.18.1.21", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletBranch", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.18.1.21", NULL, SU_FLAG_OK, NULL), /* pduOutletBranch.1.22 = INTEGER: 0 */ - { "unmapped.pduOutletBranch", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.18.1.22", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletBranch", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.18.1.22", NULL, SU_FLAG_OK, NULL), /* pduOutletBranch.1.23 = INTEGER: 0 */ - { "unmapped.pduOutletBranch", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.18.1.23", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletBranch", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.18.1.23", NULL, SU_FLAG_OK, NULL), /* pduOutletBranch.1.24 = INTEGER: 0 */ - { "unmapped.pduOutletBranch", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.18.1.24", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletBranch", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.18.1.24", NULL, SU_FLAG_OK, NULL), /* pduOutletBranch.1.25 = INTEGER: 0 */ - { "unmapped.pduOutletBranch", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.18.1.25", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletBranch", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.18.1.25", NULL, SU_FLAG_OK, NULL), /* pduOutletBranch.1.26 = INTEGER: 0 */ - { "unmapped.pduOutletBranch", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.18.1.26", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletBranch", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.18.1.26", NULL, SU_FLAG_OK, NULL), /* pduOutletBranch.1.27 = INTEGER: 0 */ - { "unmapped.pduOutletBranch", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.18.1.27", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletBranch", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.18.1.27", NULL, SU_FLAG_OK, NULL), /* pduOutletBranch.1.28 = INTEGER: 0 */ - { "unmapped.pduOutletBranch", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.18.1.28", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletBranch", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.18.1.28", NULL, SU_FLAG_OK, NULL), /* pduOutletBranch.1.29 = INTEGER: 0 */ - { "unmapped.pduOutletBranch", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.18.1.29", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletBranch", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.18.1.29", NULL, SU_FLAG_OK, NULL), /* pduOutletBranch.1.30 = INTEGER: 0 */ - { "unmapped.pduOutletBranch", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.18.1.30", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletBranch", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.18.1.30", NULL, SU_FLAG_OK, NULL), /* pduOutletBranch.1.31 = INTEGER: 0 */ - { "unmapped.pduOutletBranch", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.18.1.31", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletBranch", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.18.1.31", NULL, SU_FLAG_OK, NULL), /* pduOutletBranch.1.32 = INTEGER: 0 */ - { "unmapped.pduOutletBranch", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.18.1.32", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletBranch", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.18.1.32", NULL, SU_FLAG_OK, NULL), /* pduOutletBranch.1.33 = INTEGER: 0 */ - { "unmapped.pduOutletBranch", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.18.1.33", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletBranch", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.18.1.33", NULL, SU_FLAG_OK, NULL), /* pduOutletBranch.1.34 = INTEGER: 0 */ - { "unmapped.pduOutletBranch", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.18.1.34", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletBranch", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.18.1.34", NULL, SU_FLAG_OK, NULL), /* pduOutletBranch.1.35 = INTEGER: 0 */ - { "unmapped.pduOutletBranch", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.18.1.35", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletBranch", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.18.1.35", NULL, SU_FLAG_OK, NULL), /* pduOutletBranch.1.36 = INTEGER: 0 */ - { "unmapped.pduOutletBranch", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.18.1.36", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletBranch", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.18.1.36", NULL, SU_FLAG_OK, NULL), /* pduOutletBranch.1.37 = INTEGER: 0 */ - { "unmapped.pduOutletBranch", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.18.1.37", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletBranch", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.18.1.37", NULL, SU_FLAG_OK, NULL), /* pduOutletBranch.1.38 = INTEGER: 0 */ - { "unmapped.pduOutletBranch", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.18.1.38", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletBranch", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.18.1.38", NULL, SU_FLAG_OK, NULL), /* pduOutletBranch.1.39 = INTEGER: 0 */ - { "unmapped.pduOutletBranch", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.18.1.39", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletBranch", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.18.1.39", NULL, SU_FLAG_OK, NULL), /* pduOutletBranch.1.40 = INTEGER: 0 */ - { "unmapped.pduOutletBranch", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.18.1.40", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletBranch", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.18.1.40", NULL, SU_FLAG_OK, NULL), /* pduOutletBranch.1.41 = INTEGER: 0 */ - { "unmapped.pduOutletBranch", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.18.1.41", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletBranch", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.18.1.41", NULL, SU_FLAG_OK, NULL), /* pduOutletBranch.1.42 = INTEGER: 0 */ - { "unmapped.pduOutletBranch", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.18.1.42", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletBranch", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.18.1.42", NULL, SU_FLAG_OK, NULL), /* pduOutletBranch.1.43 = INTEGER: 0 */ - { "unmapped.pduOutletBranch", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.18.1.43", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletBranch", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.18.1.43", NULL, SU_FLAG_OK, NULL), /* pduOutletBranch.1.44 = INTEGER: 0 */ - { "unmapped.pduOutletBranch", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.18.1.44", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletBranch", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.18.1.44", NULL, SU_FLAG_OK, NULL), /* pduOutletBranch.1.45 = INTEGER: 0 */ - { "unmapped.pduOutletBranch", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.18.1.45", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletBranch", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.18.1.45", NULL, SU_FLAG_OK, NULL), /* pduOutletBranch.1.46 = INTEGER: 0 */ - { "unmapped.pduOutletBranch", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.18.1.46", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletBranch", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.18.1.46", NULL, SU_FLAG_OK, NULL), /* pduOutletBranch.1.47 = INTEGER: 0 */ - { "unmapped.pduOutletBranch", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.18.1.47", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletBranch", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.18.1.47", NULL, SU_FLAG_OK, NULL), /* pduOutletBranch.1.48 = INTEGER: 0 */ - { "unmapped.pduOutletBranch", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.18.1.48", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletBranch", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.18.1.48", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThResetThld.1.1 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThResetThld", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.19.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThResetThld", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.19.1.1", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThResetThld.1.2 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThResetThld", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.19.1.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThResetThld", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.19.1.2", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThResetThld.1.3 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThResetThld", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.19.1.3", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThResetThld", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.19.1.3", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThResetThld.1.4 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThResetThld", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.19.1.4", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThResetThld", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.19.1.4", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThResetThld.1.5 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThResetThld", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.19.1.5", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThResetThld", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.19.1.5", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThResetThld.1.6 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThResetThld", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.19.1.6", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThResetThld", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.19.1.6", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThResetThld.1.7 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThResetThld", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.19.1.7", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThResetThld", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.19.1.7", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThResetThld.1.8 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThResetThld", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.19.1.8", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThResetThld", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.19.1.8", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThResetThld.1.9 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThResetThld", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.19.1.9", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThResetThld", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.19.1.9", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThResetThld.1.10 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThResetThld", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.19.1.10", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThResetThld", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.19.1.10", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThResetThld.1.11 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThResetThld", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.19.1.11", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThResetThld", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.19.1.11", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThResetThld.1.12 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThResetThld", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.19.1.12", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThResetThld", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.19.1.12", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThResetThld.1.13 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThResetThld", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.19.1.13", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThResetThld", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.19.1.13", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThResetThld.1.14 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThResetThld", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.19.1.14", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThResetThld", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.19.1.14", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThResetThld.1.15 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThResetThld", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.19.1.15", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThResetThld", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.19.1.15", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThResetThld.1.16 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThResetThld", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.19.1.16", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThResetThld", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.19.1.16", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThResetThld.1.17 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThResetThld", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.19.1.17", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThResetThld", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.19.1.17", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThResetThld.1.18 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThResetThld", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.19.1.18", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThResetThld", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.19.1.18", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThResetThld.1.19 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThResetThld", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.19.1.19", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThResetThld", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.19.1.19", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThResetThld.1.20 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThResetThld", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.19.1.20", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThResetThld", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.19.1.20", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThResetThld.1.21 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThResetThld", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.19.1.21", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThResetThld", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.19.1.21", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThResetThld.1.22 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThResetThld", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.19.1.22", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThResetThld", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.19.1.22", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThResetThld.1.23 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThResetThld", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.19.1.23", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThResetThld", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.19.1.23", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThResetThld.1.24 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThResetThld", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.19.1.24", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThResetThld", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.19.1.24", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThResetThld.1.25 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThResetThld", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.19.1.25", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThResetThld", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.19.1.25", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThResetThld.1.26 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThResetThld", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.19.1.26", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThResetThld", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.19.1.26", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThResetThld.1.27 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThResetThld", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.19.1.27", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThResetThld", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.19.1.27", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThResetThld.1.28 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThResetThld", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.19.1.28", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThResetThld", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.19.1.28", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThResetThld.1.29 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThResetThld", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.19.1.29", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThResetThld", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.19.1.29", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThResetThld.1.30 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThResetThld", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.19.1.30", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThResetThld", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.19.1.30", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThResetThld.1.31 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThResetThld", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.19.1.31", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThResetThld", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.19.1.31", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThResetThld.1.32 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThResetThld", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.19.1.32", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThResetThld", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.19.1.32", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThResetThld.1.33 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThResetThld", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.19.1.33", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThResetThld", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.19.1.33", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThResetThld.1.34 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThResetThld", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.19.1.34", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThResetThld", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.19.1.34", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThResetThld.1.35 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThResetThld", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.19.1.35", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThResetThld", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.19.1.35", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThResetThld.1.36 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThResetThld", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.19.1.36", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThResetThld", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.19.1.36", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThResetThld.1.37 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThResetThld", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.19.1.37", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThResetThld", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.19.1.37", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThResetThld.1.38 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThResetThld", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.19.1.38", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThResetThld", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.19.1.38", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThResetThld.1.39 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThResetThld", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.19.1.39", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThResetThld", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.19.1.39", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThResetThld.1.40 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThResetThld", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.19.1.40", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThResetThld", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.19.1.40", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThResetThld.1.41 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThResetThld", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.19.1.41", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThResetThld", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.19.1.41", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThResetThld.1.42 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThResetThld", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.19.1.42", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThResetThld", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.19.1.42", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThResetThld.1.43 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThResetThld", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.19.1.43", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThResetThld", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.19.1.43", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThResetThld.1.44 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThResetThld", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.19.1.44", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThResetThld", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.19.1.44", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThResetThld.1.45 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThResetThld", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.19.1.45", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThResetThld", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.19.1.45", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThResetThld.1.46 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThResetThld", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.19.1.46", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThResetThld", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.19.1.46", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThResetThld.1.47 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThResetThld", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.19.1.47", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThResetThld", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.19.1.47", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThResetThld.1.48 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThResetThld", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.19.1.48", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThResetThld", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.19.1.48", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThChangeDelay.1.1 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThChangeDelay", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.20.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThChangeDelay", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.20.1.1", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThChangeDelay.1.2 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThChangeDelay", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.20.1.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThChangeDelay", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.20.1.2", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThChangeDelay.1.3 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThChangeDelay", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.20.1.3", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThChangeDelay", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.20.1.3", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThChangeDelay.1.4 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThChangeDelay", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.20.1.4", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThChangeDelay", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.20.1.4", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThChangeDelay.1.5 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThChangeDelay", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.20.1.5", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThChangeDelay", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.20.1.5", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThChangeDelay.1.6 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThChangeDelay", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.20.1.6", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThChangeDelay", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.20.1.6", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThChangeDelay.1.7 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThChangeDelay", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.20.1.7", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThChangeDelay", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.20.1.7", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThChangeDelay.1.8 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThChangeDelay", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.20.1.8", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThChangeDelay", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.20.1.8", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThChangeDelay.1.9 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThChangeDelay", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.20.1.9", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThChangeDelay", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.20.1.9", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThChangeDelay.1.10 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThChangeDelay", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.20.1.10", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThChangeDelay", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.20.1.10", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThChangeDelay.1.11 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThChangeDelay", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.20.1.11", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThChangeDelay", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.20.1.11", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThChangeDelay.1.12 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThChangeDelay", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.20.1.12", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThChangeDelay", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.20.1.12", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThChangeDelay.1.13 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThChangeDelay", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.20.1.13", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThChangeDelay", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.20.1.13", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThChangeDelay.1.14 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThChangeDelay", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.20.1.14", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThChangeDelay", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.20.1.14", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThChangeDelay.1.15 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThChangeDelay", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.20.1.15", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThChangeDelay", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.20.1.15", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThChangeDelay.1.16 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThChangeDelay", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.20.1.16", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThChangeDelay", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.20.1.16", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThChangeDelay.1.17 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThChangeDelay", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.20.1.17", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThChangeDelay", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.20.1.17", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThChangeDelay.1.18 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThChangeDelay", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.20.1.18", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThChangeDelay", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.20.1.18", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThChangeDelay.1.19 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThChangeDelay", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.20.1.19", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThChangeDelay", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.20.1.19", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThChangeDelay.1.20 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThChangeDelay", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.20.1.20", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThChangeDelay", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.20.1.20", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThChangeDelay.1.21 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThChangeDelay", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.20.1.21", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThChangeDelay", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.20.1.21", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThChangeDelay.1.22 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThChangeDelay", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.20.1.22", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThChangeDelay", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.20.1.22", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThChangeDelay.1.23 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThChangeDelay", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.20.1.23", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThChangeDelay", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.20.1.23", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThChangeDelay.1.24 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThChangeDelay", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.20.1.24", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThChangeDelay", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.20.1.24", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThChangeDelay.1.25 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThChangeDelay", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.20.1.25", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThChangeDelay", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.20.1.25", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThChangeDelay.1.26 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThChangeDelay", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.20.1.26", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThChangeDelay", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.20.1.26", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThChangeDelay.1.27 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThChangeDelay", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.20.1.27", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThChangeDelay", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.20.1.27", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThChangeDelay.1.28 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThChangeDelay", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.20.1.28", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThChangeDelay", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.20.1.28", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThChangeDelay.1.29 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThChangeDelay", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.20.1.29", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThChangeDelay", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.20.1.29", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThChangeDelay.1.30 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThChangeDelay", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.20.1.30", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThChangeDelay", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.20.1.30", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThChangeDelay.1.31 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThChangeDelay", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.20.1.31", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThChangeDelay", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.20.1.31", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThChangeDelay.1.32 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThChangeDelay", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.20.1.32", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThChangeDelay", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.20.1.32", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThChangeDelay.1.33 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThChangeDelay", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.20.1.33", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThChangeDelay", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.20.1.33", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThChangeDelay.1.34 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThChangeDelay", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.20.1.34", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThChangeDelay", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.20.1.34", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThChangeDelay.1.35 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThChangeDelay", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.20.1.35", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThChangeDelay", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.20.1.35", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThChangeDelay.1.36 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThChangeDelay", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.20.1.36", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThChangeDelay", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.20.1.36", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThChangeDelay.1.37 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThChangeDelay", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.20.1.37", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThChangeDelay", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.20.1.37", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThChangeDelay.1.38 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThChangeDelay", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.20.1.38", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThChangeDelay", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.20.1.38", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThChangeDelay.1.39 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThChangeDelay", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.20.1.39", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThChangeDelay", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.20.1.39", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThChangeDelay.1.40 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThChangeDelay", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.20.1.40", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThChangeDelay", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.20.1.40", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThChangeDelay.1.41 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThChangeDelay", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.20.1.41", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThChangeDelay", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.20.1.41", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThChangeDelay.1.42 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThChangeDelay", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.20.1.42", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThChangeDelay", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.20.1.42", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThChangeDelay.1.43 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThChangeDelay", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.20.1.43", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThChangeDelay", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.20.1.43", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThChangeDelay.1.44 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThChangeDelay", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.20.1.44", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThChangeDelay", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.20.1.44", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThChangeDelay.1.45 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThChangeDelay", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.20.1.45", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThChangeDelay", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.20.1.45", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThChangeDelay.1.46 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThChangeDelay", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.20.1.46", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThChangeDelay", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.20.1.46", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThChangeDelay.1.47 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThChangeDelay", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.20.1.47", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThChangeDelay", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.20.1.47", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThChangeDelay.1.48 = INTEGER: 0 */ - { "unmapped.pduOutletActivePowerThChangeDelay", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.20.1.48", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThChangeDelay", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.20.1.48", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThCtrl.1.1 = INTEGER: 15 */ - { "unmapped.pduOutletActivePowerThCtrl", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.21.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThCtrl", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.21.1.1", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThCtrl.1.2 = INTEGER: 15 */ - { "unmapped.pduOutletActivePowerThCtrl", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.21.1.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThCtrl", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.21.1.2", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThCtrl.1.3 = INTEGER: 15 */ - { "unmapped.pduOutletActivePowerThCtrl", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.21.1.3", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThCtrl", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.21.1.3", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThCtrl.1.4 = INTEGER: 15 */ - { "unmapped.pduOutletActivePowerThCtrl", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.21.1.4", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThCtrl", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.21.1.4", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThCtrl.1.5 = INTEGER: 15 */ - { "unmapped.pduOutletActivePowerThCtrl", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.21.1.5", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThCtrl", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.21.1.5", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThCtrl.1.6 = INTEGER: 15 */ - { "unmapped.pduOutletActivePowerThCtrl", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.21.1.6", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThCtrl", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.21.1.6", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThCtrl.1.7 = INTEGER: 15 */ - { "unmapped.pduOutletActivePowerThCtrl", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.21.1.7", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThCtrl", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.21.1.7", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThCtrl.1.8 = INTEGER: 15 */ - { "unmapped.pduOutletActivePowerThCtrl", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.21.1.8", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThCtrl", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.21.1.8", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThCtrl.1.9 = INTEGER: 15 */ - { "unmapped.pduOutletActivePowerThCtrl", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.21.1.9", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThCtrl", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.21.1.9", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThCtrl.1.10 = INTEGER: 15 */ - { "unmapped.pduOutletActivePowerThCtrl", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.21.1.10", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThCtrl", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.21.1.10", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThCtrl.1.11 = INTEGER: 15 */ - { "unmapped.pduOutletActivePowerThCtrl", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.21.1.11", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThCtrl", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.21.1.11", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThCtrl.1.12 = INTEGER: 15 */ - { "unmapped.pduOutletActivePowerThCtrl", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.21.1.12", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThCtrl", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.21.1.12", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThCtrl.1.13 = INTEGER: 15 */ - { "unmapped.pduOutletActivePowerThCtrl", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.21.1.13", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThCtrl", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.21.1.13", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThCtrl.1.14 = INTEGER: 15 */ - { "unmapped.pduOutletActivePowerThCtrl", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.21.1.14", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThCtrl", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.21.1.14", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThCtrl.1.15 = INTEGER: 15 */ - { "unmapped.pduOutletActivePowerThCtrl", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.21.1.15", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThCtrl", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.21.1.15", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThCtrl.1.16 = INTEGER: 15 */ - { "unmapped.pduOutletActivePowerThCtrl", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.21.1.16", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThCtrl", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.21.1.16", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThCtrl.1.17 = INTEGER: 15 */ - { "unmapped.pduOutletActivePowerThCtrl", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.21.1.17", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThCtrl", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.21.1.17", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThCtrl.1.18 = INTEGER: 15 */ - { "unmapped.pduOutletActivePowerThCtrl", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.21.1.18", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThCtrl", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.21.1.18", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThCtrl.1.19 = INTEGER: 15 */ - { "unmapped.pduOutletActivePowerThCtrl", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.21.1.19", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThCtrl", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.21.1.19", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThCtrl.1.20 = INTEGER: 15 */ - { "unmapped.pduOutletActivePowerThCtrl", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.21.1.20", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThCtrl", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.21.1.20", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThCtrl.1.21 = INTEGER: 15 */ - { "unmapped.pduOutletActivePowerThCtrl", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.21.1.21", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThCtrl", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.21.1.21", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThCtrl.1.22 = INTEGER: 15 */ - { "unmapped.pduOutletActivePowerThCtrl", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.21.1.22", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThCtrl", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.21.1.22", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThCtrl.1.23 = INTEGER: 15 */ - { "unmapped.pduOutletActivePowerThCtrl", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.21.1.23", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThCtrl", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.21.1.23", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThCtrl.1.24 = INTEGER: 15 */ - { "unmapped.pduOutletActivePowerThCtrl", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.21.1.24", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThCtrl", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.21.1.24", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThCtrl.1.25 = INTEGER: 15 */ - { "unmapped.pduOutletActivePowerThCtrl", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.21.1.25", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThCtrl", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.21.1.25", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThCtrl.1.26 = INTEGER: 15 */ - { "unmapped.pduOutletActivePowerThCtrl", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.21.1.26", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThCtrl", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.21.1.26", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThCtrl.1.27 = INTEGER: 15 */ - { "unmapped.pduOutletActivePowerThCtrl", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.21.1.27", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThCtrl", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.21.1.27", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThCtrl.1.28 = INTEGER: 15 */ - { "unmapped.pduOutletActivePowerThCtrl", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.21.1.28", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThCtrl", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.21.1.28", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThCtrl.1.29 = INTEGER: 15 */ - { "unmapped.pduOutletActivePowerThCtrl", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.21.1.29", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThCtrl", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.21.1.29", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThCtrl.1.30 = INTEGER: 15 */ - { "unmapped.pduOutletActivePowerThCtrl", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.21.1.30", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThCtrl", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.21.1.30", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThCtrl.1.31 = INTEGER: 15 */ - { "unmapped.pduOutletActivePowerThCtrl", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.21.1.31", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThCtrl", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.21.1.31", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThCtrl.1.32 = INTEGER: 15 */ - { "unmapped.pduOutletActivePowerThCtrl", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.21.1.32", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThCtrl", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.21.1.32", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThCtrl.1.33 = INTEGER: 15 */ - { "unmapped.pduOutletActivePowerThCtrl", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.21.1.33", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThCtrl", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.21.1.33", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThCtrl.1.34 = INTEGER: 15 */ - { "unmapped.pduOutletActivePowerThCtrl", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.21.1.34", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThCtrl", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.21.1.34", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThCtrl.1.35 = INTEGER: 15 */ - { "unmapped.pduOutletActivePowerThCtrl", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.21.1.35", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThCtrl", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.21.1.35", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThCtrl.1.36 = INTEGER: 15 */ - { "unmapped.pduOutletActivePowerThCtrl", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.21.1.36", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThCtrl", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.21.1.36", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThCtrl.1.37 = INTEGER: 15 */ - { "unmapped.pduOutletActivePowerThCtrl", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.21.1.37", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThCtrl", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.21.1.37", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThCtrl.1.38 = INTEGER: 15 */ - { "unmapped.pduOutletActivePowerThCtrl", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.21.1.38", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThCtrl", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.21.1.38", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThCtrl.1.39 = INTEGER: 15 */ - { "unmapped.pduOutletActivePowerThCtrl", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.21.1.39", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThCtrl", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.21.1.39", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThCtrl.1.40 = INTEGER: 15 */ - { "unmapped.pduOutletActivePowerThCtrl", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.21.1.40", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThCtrl", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.21.1.40", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThCtrl.1.41 = INTEGER: 15 */ - { "unmapped.pduOutletActivePowerThCtrl", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.21.1.41", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThCtrl", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.21.1.41", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThCtrl.1.42 = INTEGER: 15 */ - { "unmapped.pduOutletActivePowerThCtrl", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.21.1.42", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThCtrl", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.21.1.42", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThCtrl.1.43 = INTEGER: 15 */ - { "unmapped.pduOutletActivePowerThCtrl", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.21.1.43", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThCtrl", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.21.1.43", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThCtrl.1.44 = INTEGER: 15 */ - { "unmapped.pduOutletActivePowerThCtrl", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.21.1.44", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThCtrl", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.21.1.44", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThCtrl.1.45 = INTEGER: 15 */ - { "unmapped.pduOutletActivePowerThCtrl", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.21.1.45", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThCtrl", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.21.1.45", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThCtrl.1.46 = INTEGER: 15 */ - { "unmapped.pduOutletActivePowerThCtrl", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.21.1.46", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThCtrl", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.21.1.46", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThCtrl.1.47 = INTEGER: 15 */ - { "unmapped.pduOutletActivePowerThCtrl", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.21.1.47", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThCtrl", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.21.1.47", NULL, SU_FLAG_OK, NULL), /* pduOutletActivePowerThCtrl.1.48 = INTEGER: 15 */ - { "unmapped.pduOutletActivePowerThCtrl", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.21.1.48", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletActivePowerThCtrl", 0, 1, ".1.3.6.1.4.1.534.7.1.5.1.1.21.1.48", NULL, SU_FLAG_OK, NULL), /* pduOutletControlOffCmd.1.1 = INTEGER: -1 */ - { "unmapped.pduOutletControlOffCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.2.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletControlOffCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.2.1.1", NULL, SU_FLAG_OK, NULL), /* pduOutletControlOffCmd.1.2 = INTEGER: -1 */ - { "unmapped.pduOutletControlOffCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.2.1.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletControlOffCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.2.1.2", NULL, SU_FLAG_OK, NULL), /* pduOutletControlOffCmd.1.3 = INTEGER: -1 */ - { "unmapped.pduOutletControlOffCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.2.1.3", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletControlOffCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.2.1.3", NULL, SU_FLAG_OK, NULL), /* pduOutletControlOffCmd.1.4 = INTEGER: -1 */ - { "unmapped.pduOutletControlOffCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.2.1.4", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletControlOffCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.2.1.4", NULL, SU_FLAG_OK, NULL), /* pduOutletControlOffCmd.1.5 = INTEGER: -1 */ - { "unmapped.pduOutletControlOffCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.2.1.5", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletControlOffCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.2.1.5", NULL, SU_FLAG_OK, NULL), /* pduOutletControlOffCmd.1.6 = INTEGER: -1 */ - { "unmapped.pduOutletControlOffCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.2.1.6", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletControlOffCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.2.1.6", NULL, SU_FLAG_OK, NULL), /* pduOutletControlOffCmd.1.7 = INTEGER: 0 */ - { "unmapped.pduOutletControlOffCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.2.1.7", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletControlOffCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.2.1.7", NULL, SU_FLAG_OK, NULL), /* pduOutletControlOffCmd.1.8 = INTEGER: 0 */ - { "unmapped.pduOutletControlOffCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.2.1.8", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletControlOffCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.2.1.8", NULL, SU_FLAG_OK, NULL), /* pduOutletControlOffCmd.1.9 = INTEGER: 0 */ - { "unmapped.pduOutletControlOffCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.2.1.9", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletControlOffCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.2.1.9", NULL, SU_FLAG_OK, NULL), /* pduOutletControlOffCmd.1.10 = INTEGER: 0 */ - { "unmapped.pduOutletControlOffCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.2.1.10", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletControlOffCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.2.1.10", NULL, SU_FLAG_OK, NULL), /* pduOutletControlOffCmd.1.11 = INTEGER: 0 */ - { "unmapped.pduOutletControlOffCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.2.1.11", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletControlOffCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.2.1.11", NULL, SU_FLAG_OK, NULL), /* pduOutletControlOffCmd.1.12 = INTEGER: 0 */ - { "unmapped.pduOutletControlOffCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.2.1.12", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletControlOffCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.2.1.12", NULL, SU_FLAG_OK, NULL), /* pduOutletControlOffCmd.1.13 = INTEGER: 0 */ - { "unmapped.pduOutletControlOffCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.2.1.13", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletControlOffCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.2.1.13", NULL, SU_FLAG_OK, NULL), /* pduOutletControlOffCmd.1.14 = INTEGER: 0 */ - { "unmapped.pduOutletControlOffCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.2.1.14", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletControlOffCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.2.1.14", NULL, SU_FLAG_OK, NULL), /* pduOutletControlOffCmd.1.15 = INTEGER: 0 */ - { "unmapped.pduOutletControlOffCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.2.1.15", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletControlOffCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.2.1.15", NULL, SU_FLAG_OK, NULL), /* pduOutletControlOffCmd.1.16 = INTEGER: 0 */ - { "unmapped.pduOutletControlOffCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.2.1.16", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletControlOffCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.2.1.16", NULL, SU_FLAG_OK, NULL), /* pduOutletControlOffCmd.1.17 = INTEGER: 0 */ - { "unmapped.pduOutletControlOffCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.2.1.17", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletControlOffCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.2.1.17", NULL, SU_FLAG_OK, NULL), /* pduOutletControlOffCmd.1.18 = INTEGER: 0 */ - { "unmapped.pduOutletControlOffCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.2.1.18", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletControlOffCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.2.1.18", NULL, SU_FLAG_OK, NULL), /* pduOutletControlOffCmd.1.19 = INTEGER: 0 */ - { "unmapped.pduOutletControlOffCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.2.1.19", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletControlOffCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.2.1.19", NULL, SU_FLAG_OK, NULL), /* pduOutletControlOffCmd.1.20 = INTEGER: 0 */ - { "unmapped.pduOutletControlOffCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.2.1.20", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletControlOffCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.2.1.20", NULL, SU_FLAG_OK, NULL), /* pduOutletControlOffCmd.1.21 = INTEGER: 0 */ - { "unmapped.pduOutletControlOffCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.2.1.21", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletControlOffCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.2.1.21", NULL, SU_FLAG_OK, NULL), /* pduOutletControlOffCmd.1.22 = INTEGER: 0 */ - { "unmapped.pduOutletControlOffCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.2.1.22", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletControlOffCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.2.1.22", NULL, SU_FLAG_OK, NULL), /* pduOutletControlOffCmd.1.23 = INTEGER: 0 */ - { "unmapped.pduOutletControlOffCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.2.1.23", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletControlOffCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.2.1.23", NULL, SU_FLAG_OK, NULL), /* pduOutletControlOffCmd.1.24 = INTEGER: 0 */ - { "unmapped.pduOutletControlOffCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.2.1.24", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletControlOffCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.2.1.24", NULL, SU_FLAG_OK, NULL), /* pduOutletControlOffCmd.1.25 = INTEGER: 0 */ - { "unmapped.pduOutletControlOffCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.2.1.25", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletControlOffCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.2.1.25", NULL, SU_FLAG_OK, NULL), /* pduOutletControlOffCmd.1.26 = INTEGER: 0 */ - { "unmapped.pduOutletControlOffCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.2.1.26", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletControlOffCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.2.1.26", NULL, SU_FLAG_OK, NULL), /* pduOutletControlOffCmd.1.27 = INTEGER: 0 */ - { "unmapped.pduOutletControlOffCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.2.1.27", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletControlOffCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.2.1.27", NULL, SU_FLAG_OK, NULL), /* pduOutletControlOffCmd.1.28 = INTEGER: 0 */ - { "unmapped.pduOutletControlOffCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.2.1.28", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletControlOffCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.2.1.28", NULL, SU_FLAG_OK, NULL), /* pduOutletControlOffCmd.1.29 = INTEGER: 0 */ - { "unmapped.pduOutletControlOffCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.2.1.29", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletControlOffCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.2.1.29", NULL, SU_FLAG_OK, NULL), /* pduOutletControlOffCmd.1.30 = INTEGER: 0 */ - { "unmapped.pduOutletControlOffCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.2.1.30", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletControlOffCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.2.1.30", NULL, SU_FLAG_OK, NULL), /* pduOutletControlOffCmd.1.31 = INTEGER: 0 */ - { "unmapped.pduOutletControlOffCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.2.1.31", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletControlOffCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.2.1.31", NULL, SU_FLAG_OK, NULL), /* pduOutletControlOffCmd.1.32 = INTEGER: 0 */ - { "unmapped.pduOutletControlOffCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.2.1.32", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletControlOffCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.2.1.32", NULL, SU_FLAG_OK, NULL), /* pduOutletControlOffCmd.1.33 = INTEGER: 0 */ - { "unmapped.pduOutletControlOffCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.2.1.33", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletControlOffCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.2.1.33", NULL, SU_FLAG_OK, NULL), /* pduOutletControlOffCmd.1.34 = INTEGER: 0 */ - { "unmapped.pduOutletControlOffCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.2.1.34", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletControlOffCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.2.1.34", NULL, SU_FLAG_OK, NULL), /* pduOutletControlOffCmd.1.35 = INTEGER: 0 */ - { "unmapped.pduOutletControlOffCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.2.1.35", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletControlOffCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.2.1.35", NULL, SU_FLAG_OK, NULL), /* pduOutletControlOffCmd.1.36 = INTEGER: 0 */ - { "unmapped.pduOutletControlOffCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.2.1.36", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletControlOffCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.2.1.36", NULL, SU_FLAG_OK, NULL), /* pduOutletControlOffCmd.1.37 = INTEGER: 0 */ - { "unmapped.pduOutletControlOffCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.2.1.37", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletControlOffCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.2.1.37", NULL, SU_FLAG_OK, NULL), /* pduOutletControlOffCmd.1.38 = INTEGER: 0 */ - { "unmapped.pduOutletControlOffCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.2.1.38", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletControlOffCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.2.1.38", NULL, SU_FLAG_OK, NULL), /* pduOutletControlOffCmd.1.39 = INTEGER: 0 */ - { "unmapped.pduOutletControlOffCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.2.1.39", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletControlOffCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.2.1.39", NULL, SU_FLAG_OK, NULL), /* pduOutletControlOffCmd.1.40 = INTEGER: 0 */ - { "unmapped.pduOutletControlOffCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.2.1.40", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletControlOffCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.2.1.40", NULL, SU_FLAG_OK, NULL), /* pduOutletControlOffCmd.1.41 = INTEGER: 0 */ - { "unmapped.pduOutletControlOffCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.2.1.41", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletControlOffCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.2.1.41", NULL, SU_FLAG_OK, NULL), /* pduOutletControlOffCmd.1.42 = INTEGER: 0 */ - { "unmapped.pduOutletControlOffCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.2.1.42", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletControlOffCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.2.1.42", NULL, SU_FLAG_OK, NULL), /* pduOutletControlOffCmd.1.43 = INTEGER: 0 */ - { "unmapped.pduOutletControlOffCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.2.1.43", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletControlOffCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.2.1.43", NULL, SU_FLAG_OK, NULL), /* pduOutletControlOffCmd.1.44 = INTEGER: 0 */ - { "unmapped.pduOutletControlOffCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.2.1.44", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletControlOffCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.2.1.44", NULL, SU_FLAG_OK, NULL), /* pduOutletControlOffCmd.1.45 = INTEGER: 0 */ - { "unmapped.pduOutletControlOffCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.2.1.45", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletControlOffCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.2.1.45", NULL, SU_FLAG_OK, NULL), /* pduOutletControlOffCmd.1.46 = INTEGER: 0 */ - { "unmapped.pduOutletControlOffCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.2.1.46", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletControlOffCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.2.1.46", NULL, SU_FLAG_OK, NULL), /* pduOutletControlOffCmd.1.47 = INTEGER: 0 */ - { "unmapped.pduOutletControlOffCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.2.1.47", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletControlOffCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.2.1.47", NULL, SU_FLAG_OK, NULL), /* pduOutletControlOffCmd.1.48 = INTEGER: 0 */ - { "unmapped.pduOutletControlOffCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.2.1.48", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletControlOffCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.2.1.48", NULL, SU_FLAG_OK, NULL), /* pduOutletControlOnCmd.1.1 = INTEGER: -1 */ - { "unmapped.pduOutletControlOnCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.3.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletControlOnCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.3.1.1", NULL, SU_FLAG_OK, NULL), /* pduOutletControlOnCmd.1.2 = INTEGER: -1 */ - { "unmapped.pduOutletControlOnCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.3.1.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletControlOnCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.3.1.2", NULL, SU_FLAG_OK, NULL), /* pduOutletControlOnCmd.1.3 = INTEGER: -1 */ - { "unmapped.pduOutletControlOnCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.3.1.3", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletControlOnCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.3.1.3", NULL, SU_FLAG_OK, NULL), /* pduOutletControlOnCmd.1.4 = INTEGER: -1 */ - { "unmapped.pduOutletControlOnCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.3.1.4", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletControlOnCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.3.1.4", NULL, SU_FLAG_OK, NULL), /* pduOutletControlOnCmd.1.5 = INTEGER: -1 */ - { "unmapped.pduOutletControlOnCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.3.1.5", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletControlOnCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.3.1.5", NULL, SU_FLAG_OK, NULL), /* pduOutletControlOnCmd.1.6 = INTEGER: -1 */ - { "unmapped.pduOutletControlOnCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.3.1.6", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletControlOnCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.3.1.6", NULL, SU_FLAG_OK, NULL), /* pduOutletControlOnCmd.1.7 = INTEGER: 0 */ - { "unmapped.pduOutletControlOnCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.3.1.7", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletControlOnCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.3.1.7", NULL, SU_FLAG_OK, NULL), /* pduOutletControlOnCmd.1.8 = INTEGER: 0 */ - { "unmapped.pduOutletControlOnCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.3.1.8", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletControlOnCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.3.1.8", NULL, SU_FLAG_OK, NULL), /* pduOutletControlOnCmd.1.9 = INTEGER: 0 */ - { "unmapped.pduOutletControlOnCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.3.1.9", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletControlOnCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.3.1.9", NULL, SU_FLAG_OK, NULL), /* pduOutletControlOnCmd.1.10 = INTEGER: 0 */ - { "unmapped.pduOutletControlOnCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.3.1.10", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletControlOnCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.3.1.10", NULL, SU_FLAG_OK, NULL), /* pduOutletControlOnCmd.1.11 = INTEGER: 0 */ - { "unmapped.pduOutletControlOnCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.3.1.11", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletControlOnCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.3.1.11", NULL, SU_FLAG_OK, NULL), /* pduOutletControlOnCmd.1.12 = INTEGER: 0 */ - { "unmapped.pduOutletControlOnCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.3.1.12", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletControlOnCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.3.1.12", NULL, SU_FLAG_OK, NULL), /* pduOutletControlOnCmd.1.13 = INTEGER: 0 */ - { "unmapped.pduOutletControlOnCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.3.1.13", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletControlOnCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.3.1.13", NULL, SU_FLAG_OK, NULL), /* pduOutletControlOnCmd.1.14 = INTEGER: 0 */ - { "unmapped.pduOutletControlOnCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.3.1.14", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletControlOnCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.3.1.14", NULL, SU_FLAG_OK, NULL), /* pduOutletControlOnCmd.1.15 = INTEGER: 0 */ - { "unmapped.pduOutletControlOnCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.3.1.15", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletControlOnCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.3.1.15", NULL, SU_FLAG_OK, NULL), /* pduOutletControlOnCmd.1.16 = INTEGER: 0 */ - { "unmapped.pduOutletControlOnCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.3.1.16", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletControlOnCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.3.1.16", NULL, SU_FLAG_OK, NULL), /* pduOutletControlOnCmd.1.17 = INTEGER: 0 */ - { "unmapped.pduOutletControlOnCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.3.1.17", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletControlOnCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.3.1.17", NULL, SU_FLAG_OK, NULL), /* pduOutletControlOnCmd.1.18 = INTEGER: 0 */ - { "unmapped.pduOutletControlOnCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.3.1.18", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletControlOnCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.3.1.18", NULL, SU_FLAG_OK, NULL), /* pduOutletControlOnCmd.1.19 = INTEGER: 0 */ - { "unmapped.pduOutletControlOnCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.3.1.19", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletControlOnCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.3.1.19", NULL, SU_FLAG_OK, NULL), /* pduOutletControlOnCmd.1.20 = INTEGER: 0 */ - { "unmapped.pduOutletControlOnCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.3.1.20", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletControlOnCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.3.1.20", NULL, SU_FLAG_OK, NULL), /* pduOutletControlOnCmd.1.21 = INTEGER: 0 */ - { "unmapped.pduOutletControlOnCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.3.1.21", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletControlOnCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.3.1.21", NULL, SU_FLAG_OK, NULL), /* pduOutletControlOnCmd.1.22 = INTEGER: 0 */ - { "unmapped.pduOutletControlOnCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.3.1.22", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletControlOnCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.3.1.22", NULL, SU_FLAG_OK, NULL), /* pduOutletControlOnCmd.1.23 = INTEGER: 0 */ - { "unmapped.pduOutletControlOnCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.3.1.23", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletControlOnCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.3.1.23", NULL, SU_FLAG_OK, NULL), /* pduOutletControlOnCmd.1.24 = INTEGER: 0 */ - { "unmapped.pduOutletControlOnCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.3.1.24", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletControlOnCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.3.1.24", NULL, SU_FLAG_OK, NULL), /* pduOutletControlOnCmd.1.25 = INTEGER: 0 */ - { "unmapped.pduOutletControlOnCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.3.1.25", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletControlOnCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.3.1.25", NULL, SU_FLAG_OK, NULL), /* pduOutletControlOnCmd.1.26 = INTEGER: 0 */ - { "unmapped.pduOutletControlOnCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.3.1.26", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletControlOnCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.3.1.26", NULL, SU_FLAG_OK, NULL), /* pduOutletControlOnCmd.1.27 = INTEGER: 0 */ - { "unmapped.pduOutletControlOnCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.3.1.27", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletControlOnCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.3.1.27", NULL, SU_FLAG_OK, NULL), /* pduOutletControlOnCmd.1.28 = INTEGER: 0 */ - { "unmapped.pduOutletControlOnCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.3.1.28", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletControlOnCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.3.1.28", NULL, SU_FLAG_OK, NULL), /* pduOutletControlOnCmd.1.29 = INTEGER: 0 */ - { "unmapped.pduOutletControlOnCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.3.1.29", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletControlOnCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.3.1.29", NULL, SU_FLAG_OK, NULL), /* pduOutletControlOnCmd.1.30 = INTEGER: 0 */ - { "unmapped.pduOutletControlOnCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.3.1.30", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletControlOnCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.3.1.30", NULL, SU_FLAG_OK, NULL), /* pduOutletControlOnCmd.1.31 = INTEGER: 0 */ - { "unmapped.pduOutletControlOnCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.3.1.31", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletControlOnCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.3.1.31", NULL, SU_FLAG_OK, NULL), /* pduOutletControlOnCmd.1.32 = INTEGER: 0 */ - { "unmapped.pduOutletControlOnCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.3.1.32", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletControlOnCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.3.1.32", NULL, SU_FLAG_OK, NULL), /* pduOutletControlOnCmd.1.33 = INTEGER: 0 */ - { "unmapped.pduOutletControlOnCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.3.1.33", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletControlOnCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.3.1.33", NULL, SU_FLAG_OK, NULL), /* pduOutletControlOnCmd.1.34 = INTEGER: 0 */ - { "unmapped.pduOutletControlOnCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.3.1.34", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletControlOnCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.3.1.34", NULL, SU_FLAG_OK, NULL), /* pduOutletControlOnCmd.1.35 = INTEGER: 0 */ - { "unmapped.pduOutletControlOnCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.3.1.35", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletControlOnCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.3.1.35", NULL, SU_FLAG_OK, NULL), /* pduOutletControlOnCmd.1.36 = INTEGER: 0 */ - { "unmapped.pduOutletControlOnCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.3.1.36", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletControlOnCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.3.1.36", NULL, SU_FLAG_OK, NULL), /* pduOutletControlOnCmd.1.37 = INTEGER: 0 */ - { "unmapped.pduOutletControlOnCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.3.1.37", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletControlOnCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.3.1.37", NULL, SU_FLAG_OK, NULL), /* pduOutletControlOnCmd.1.38 = INTEGER: 0 */ - { "unmapped.pduOutletControlOnCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.3.1.38", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletControlOnCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.3.1.38", NULL, SU_FLAG_OK, NULL), /* pduOutletControlOnCmd.1.39 = INTEGER: 0 */ - { "unmapped.pduOutletControlOnCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.3.1.39", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletControlOnCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.3.1.39", NULL, SU_FLAG_OK, NULL), /* pduOutletControlOnCmd.1.40 = INTEGER: 0 */ - { "unmapped.pduOutletControlOnCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.3.1.40", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletControlOnCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.3.1.40", NULL, SU_FLAG_OK, NULL), /* pduOutletControlOnCmd.1.41 = INTEGER: 0 */ - { "unmapped.pduOutletControlOnCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.3.1.41", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletControlOnCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.3.1.41", NULL, SU_FLAG_OK, NULL), /* pduOutletControlOnCmd.1.42 = INTEGER: 0 */ - { "unmapped.pduOutletControlOnCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.3.1.42", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletControlOnCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.3.1.42", NULL, SU_FLAG_OK, NULL), /* pduOutletControlOnCmd.1.43 = INTEGER: 0 */ - { "unmapped.pduOutletControlOnCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.3.1.43", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletControlOnCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.3.1.43", NULL, SU_FLAG_OK, NULL), /* pduOutletControlOnCmd.1.44 = INTEGER: 0 */ - { "unmapped.pduOutletControlOnCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.3.1.44", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletControlOnCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.3.1.44", NULL, SU_FLAG_OK, NULL), /* pduOutletControlOnCmd.1.45 = INTEGER: 0 */ - { "unmapped.pduOutletControlOnCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.3.1.45", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletControlOnCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.3.1.45", NULL, SU_FLAG_OK, NULL), /* pduOutletControlOnCmd.1.46 = INTEGER: 0 */ - { "unmapped.pduOutletControlOnCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.3.1.46", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletControlOnCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.3.1.46", NULL, SU_FLAG_OK, NULL), /* pduOutletControlOnCmd.1.47 = INTEGER: 0 */ - { "unmapped.pduOutletControlOnCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.3.1.47", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletControlOnCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.3.1.47", NULL, SU_FLAG_OK, NULL), /* pduOutletControlOnCmd.1.48 = INTEGER: 0 */ - { "unmapped.pduOutletControlOnCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.3.1.48", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletControlOnCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.3.1.48", NULL, SU_FLAG_OK, NULL), /* pduOutletControlRebootCmd.1.1 = INTEGER: -1 */ - { "unmapped.pduOutletControlRebootCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.4.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletControlRebootCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.4.1.1", NULL, SU_FLAG_OK, NULL), /* pduOutletControlRebootCmd.1.2 = INTEGER: -1 */ - { "unmapped.pduOutletControlRebootCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.4.1.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletControlRebootCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.4.1.2", NULL, SU_FLAG_OK, NULL), /* pduOutletControlRebootCmd.1.3 = INTEGER: -1 */ - { "unmapped.pduOutletControlRebootCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.4.1.3", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletControlRebootCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.4.1.3", NULL, SU_FLAG_OK, NULL), /* pduOutletControlRebootCmd.1.4 = INTEGER: -1 */ - { "unmapped.pduOutletControlRebootCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.4.1.4", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletControlRebootCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.4.1.4", NULL, SU_FLAG_OK, NULL), /* pduOutletControlRebootCmd.1.5 = INTEGER: -1 */ - { "unmapped.pduOutletControlRebootCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.4.1.5", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletControlRebootCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.4.1.5", NULL, SU_FLAG_OK, NULL), /* pduOutletControlRebootCmd.1.6 = INTEGER: -1 */ - { "unmapped.pduOutletControlRebootCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.4.1.6", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletControlRebootCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.4.1.6", NULL, SU_FLAG_OK, NULL), /* pduOutletControlRebootCmd.1.7 = INTEGER: 0 */ - { "unmapped.pduOutletControlRebootCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.4.1.7", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletControlRebootCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.4.1.7", NULL, SU_FLAG_OK, NULL), /* pduOutletControlRebootCmd.1.8 = INTEGER: 0 */ - { "unmapped.pduOutletControlRebootCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.4.1.8", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletControlRebootCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.4.1.8", NULL, SU_FLAG_OK, NULL), /* pduOutletControlRebootCmd.1.9 = INTEGER: 0 */ - { "unmapped.pduOutletControlRebootCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.4.1.9", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletControlRebootCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.4.1.9", NULL, SU_FLAG_OK, NULL), /* pduOutletControlRebootCmd.1.10 = INTEGER: 0 */ - { "unmapped.pduOutletControlRebootCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.4.1.10", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletControlRebootCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.4.1.10", NULL, SU_FLAG_OK, NULL), /* pduOutletControlRebootCmd.1.11 = INTEGER: 0 */ - { "unmapped.pduOutletControlRebootCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.4.1.11", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletControlRebootCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.4.1.11", NULL, SU_FLAG_OK, NULL), /* pduOutletControlRebootCmd.1.12 = INTEGER: 0 */ - { "unmapped.pduOutletControlRebootCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.4.1.12", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletControlRebootCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.4.1.12", NULL, SU_FLAG_OK, NULL), /* pduOutletControlRebootCmd.1.13 = INTEGER: 0 */ - { "unmapped.pduOutletControlRebootCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.4.1.13", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletControlRebootCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.4.1.13", NULL, SU_FLAG_OK, NULL), /* pduOutletControlRebootCmd.1.14 = INTEGER: 0 */ - { "unmapped.pduOutletControlRebootCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.4.1.14", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletControlRebootCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.4.1.14", NULL, SU_FLAG_OK, NULL), /* pduOutletControlRebootCmd.1.15 = INTEGER: 0 */ - { "unmapped.pduOutletControlRebootCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.4.1.15", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletControlRebootCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.4.1.15", NULL, SU_FLAG_OK, NULL), /* pduOutletControlRebootCmd.1.16 = INTEGER: 0 */ - { "unmapped.pduOutletControlRebootCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.4.1.16", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletControlRebootCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.4.1.16", NULL, SU_FLAG_OK, NULL), /* pduOutletControlRebootCmd.1.17 = INTEGER: 0 */ - { "unmapped.pduOutletControlRebootCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.4.1.17", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletControlRebootCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.4.1.17", NULL, SU_FLAG_OK, NULL), /* pduOutletControlRebootCmd.1.18 = INTEGER: 0 */ - { "unmapped.pduOutletControlRebootCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.4.1.18", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletControlRebootCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.4.1.18", NULL, SU_FLAG_OK, NULL), /* pduOutletControlRebootCmd.1.19 = INTEGER: 0 */ - { "unmapped.pduOutletControlRebootCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.4.1.19", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletControlRebootCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.4.1.19", NULL, SU_FLAG_OK, NULL), /* pduOutletControlRebootCmd.1.20 = INTEGER: 0 */ - { "unmapped.pduOutletControlRebootCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.4.1.20", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletControlRebootCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.4.1.20", NULL, SU_FLAG_OK, NULL), /* pduOutletControlRebootCmd.1.21 = INTEGER: 0 */ - { "unmapped.pduOutletControlRebootCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.4.1.21", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletControlRebootCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.4.1.21", NULL, SU_FLAG_OK, NULL), /* pduOutletControlRebootCmd.1.22 = INTEGER: 0 */ - { "unmapped.pduOutletControlRebootCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.4.1.22", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletControlRebootCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.4.1.22", NULL, SU_FLAG_OK, NULL), /* pduOutletControlRebootCmd.1.23 = INTEGER: 0 */ - { "unmapped.pduOutletControlRebootCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.4.1.23", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletControlRebootCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.4.1.23", NULL, SU_FLAG_OK, NULL), /* pduOutletControlRebootCmd.1.24 = INTEGER: 0 */ - { "unmapped.pduOutletControlRebootCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.4.1.24", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletControlRebootCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.4.1.24", NULL, SU_FLAG_OK, NULL), /* pduOutletControlRebootCmd.1.25 = INTEGER: 0 */ - { "unmapped.pduOutletControlRebootCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.4.1.25", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletControlRebootCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.4.1.25", NULL, SU_FLAG_OK, NULL), /* pduOutletControlRebootCmd.1.26 = INTEGER: 0 */ - { "unmapped.pduOutletControlRebootCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.4.1.26", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletControlRebootCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.4.1.26", NULL, SU_FLAG_OK, NULL), /* pduOutletControlRebootCmd.1.27 = INTEGER: 0 */ - { "unmapped.pduOutletControlRebootCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.4.1.27", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletControlRebootCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.4.1.27", NULL, SU_FLAG_OK, NULL), /* pduOutletControlRebootCmd.1.28 = INTEGER: 0 */ - { "unmapped.pduOutletControlRebootCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.4.1.28", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletControlRebootCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.4.1.28", NULL, SU_FLAG_OK, NULL), /* pduOutletControlRebootCmd.1.29 = INTEGER: 0 */ - { "unmapped.pduOutletControlRebootCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.4.1.29", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletControlRebootCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.4.1.29", NULL, SU_FLAG_OK, NULL), /* pduOutletControlRebootCmd.1.30 = INTEGER: 0 */ - { "unmapped.pduOutletControlRebootCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.4.1.30", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletControlRebootCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.4.1.30", NULL, SU_FLAG_OK, NULL), /* pduOutletControlRebootCmd.1.31 = INTEGER: 0 */ - { "unmapped.pduOutletControlRebootCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.4.1.31", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletControlRebootCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.4.1.31", NULL, SU_FLAG_OK, NULL), /* pduOutletControlRebootCmd.1.32 = INTEGER: 0 */ - { "unmapped.pduOutletControlRebootCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.4.1.32", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletControlRebootCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.4.1.32", NULL, SU_FLAG_OK, NULL), /* pduOutletControlRebootCmd.1.33 = INTEGER: 0 */ - { "unmapped.pduOutletControlRebootCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.4.1.33", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletControlRebootCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.4.1.33", NULL, SU_FLAG_OK, NULL), /* pduOutletControlRebootCmd.1.34 = INTEGER: 0 */ - { "unmapped.pduOutletControlRebootCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.4.1.34", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletControlRebootCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.4.1.34", NULL, SU_FLAG_OK, NULL), /* pduOutletControlRebootCmd.1.35 = INTEGER: 0 */ - { "unmapped.pduOutletControlRebootCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.4.1.35", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletControlRebootCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.4.1.35", NULL, SU_FLAG_OK, NULL), /* pduOutletControlRebootCmd.1.36 = INTEGER: 0 */ - { "unmapped.pduOutletControlRebootCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.4.1.36", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletControlRebootCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.4.1.36", NULL, SU_FLAG_OK, NULL), /* pduOutletControlRebootCmd.1.37 = INTEGER: 0 */ - { "unmapped.pduOutletControlRebootCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.4.1.37", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletControlRebootCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.4.1.37", NULL, SU_FLAG_OK, NULL), /* pduOutletControlRebootCmd.1.38 = INTEGER: 0 */ - { "unmapped.pduOutletControlRebootCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.4.1.38", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletControlRebootCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.4.1.38", NULL, SU_FLAG_OK, NULL), /* pduOutletControlRebootCmd.1.39 = INTEGER: 0 */ - { "unmapped.pduOutletControlRebootCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.4.1.39", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletControlRebootCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.4.1.39", NULL, SU_FLAG_OK, NULL), /* pduOutletControlRebootCmd.1.40 = INTEGER: 0 */ - { "unmapped.pduOutletControlRebootCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.4.1.40", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletControlRebootCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.4.1.40", NULL, SU_FLAG_OK, NULL), /* pduOutletControlRebootCmd.1.41 = INTEGER: 0 */ - { "unmapped.pduOutletControlRebootCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.4.1.41", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletControlRebootCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.4.1.41", NULL, SU_FLAG_OK, NULL), /* pduOutletControlRebootCmd.1.42 = INTEGER: 0 */ - { "unmapped.pduOutletControlRebootCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.4.1.42", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletControlRebootCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.4.1.42", NULL, SU_FLAG_OK, NULL), /* pduOutletControlRebootCmd.1.43 = INTEGER: 0 */ - { "unmapped.pduOutletControlRebootCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.4.1.43", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletControlRebootCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.4.1.43", NULL, SU_FLAG_OK, NULL), /* pduOutletControlRebootCmd.1.44 = INTEGER: 0 */ - { "unmapped.pduOutletControlRebootCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.4.1.44", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletControlRebootCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.4.1.44", NULL, SU_FLAG_OK, NULL), /* pduOutletControlRebootCmd.1.45 = INTEGER: 0 */ - { "unmapped.pduOutletControlRebootCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.4.1.45", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletControlRebootCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.4.1.45", NULL, SU_FLAG_OK, NULL), /* pduOutletControlRebootCmd.1.46 = INTEGER: 0 */ - { "unmapped.pduOutletControlRebootCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.4.1.46", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletControlRebootCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.4.1.46", NULL, SU_FLAG_OK, NULL), /* pduOutletControlRebootCmd.1.47 = INTEGER: 0 */ - { "unmapped.pduOutletControlRebootCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.4.1.47", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletControlRebootCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.4.1.47", NULL, SU_FLAG_OK, NULL), /* pduOutletControlRebootCmd.1.48 = INTEGER: 0 */ - { "unmapped.pduOutletControlRebootCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.4.1.48", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletControlRebootCmd", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.4.1.48", NULL, SU_FLAG_OK, NULL), /* pduOutletControlPowerOnState.1.1 = INTEGER: 2 */ - { "unmapped.pduOutletControlPowerOnState", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.5.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletControlPowerOnState", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.5.1.1", NULL, SU_FLAG_OK, NULL), /* pduOutletControlPowerOnState.1.2 = INTEGER: 2 */ - { "unmapped.pduOutletControlPowerOnState", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.5.1.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletControlPowerOnState", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.5.1.2", NULL, SU_FLAG_OK, NULL), /* pduOutletControlPowerOnState.1.3 = INTEGER: 2 */ - { "unmapped.pduOutletControlPowerOnState", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.5.1.3", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletControlPowerOnState", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.5.1.3", NULL, SU_FLAG_OK, NULL), /* pduOutletControlPowerOnState.1.4 = INTEGER: 2 */ - { "unmapped.pduOutletControlPowerOnState", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.5.1.4", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletControlPowerOnState", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.5.1.4", NULL, SU_FLAG_OK, NULL), /* pduOutletControlPowerOnState.1.5 = INTEGER: 2 */ - { "unmapped.pduOutletControlPowerOnState", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.5.1.5", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletControlPowerOnState", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.5.1.5", NULL, SU_FLAG_OK, NULL), /* pduOutletControlPowerOnState.1.6 = INTEGER: 2 */ - { "unmapped.pduOutletControlPowerOnState", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.5.1.6", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletControlPowerOnState", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.5.1.6", NULL, SU_FLAG_OK, NULL), /* pduOutletControlPowerOnState.1.7 = INTEGER: 0 */ - { "unmapped.pduOutletControlPowerOnState", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.5.1.7", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletControlPowerOnState", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.5.1.7", NULL, SU_FLAG_OK, NULL), /* pduOutletControlPowerOnState.1.8 = INTEGER: 0 */ - { "unmapped.pduOutletControlPowerOnState", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.5.1.8", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletControlPowerOnState", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.5.1.8", NULL, SU_FLAG_OK, NULL), /* pduOutletControlPowerOnState.1.9 = INTEGER: 0 */ - { "unmapped.pduOutletControlPowerOnState", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.5.1.9", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletControlPowerOnState", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.5.1.9", NULL, SU_FLAG_OK, NULL), /* pduOutletControlPowerOnState.1.10 = INTEGER: 0 */ - { "unmapped.pduOutletControlPowerOnState", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.5.1.10", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletControlPowerOnState", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.5.1.10", NULL, SU_FLAG_OK, NULL), /* pduOutletControlPowerOnState.1.11 = INTEGER: 0 */ - { "unmapped.pduOutletControlPowerOnState", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.5.1.11", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletControlPowerOnState", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.5.1.11", NULL, SU_FLAG_OK, NULL), /* pduOutletControlPowerOnState.1.12 = INTEGER: 0 */ - { "unmapped.pduOutletControlPowerOnState", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.5.1.12", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletControlPowerOnState", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.5.1.12", NULL, SU_FLAG_OK, NULL), /* pduOutletControlPowerOnState.1.13 = INTEGER: 0 */ - { "unmapped.pduOutletControlPowerOnState", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.5.1.13", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletControlPowerOnState", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.5.1.13", NULL, SU_FLAG_OK, NULL), /* pduOutletControlPowerOnState.1.14 = INTEGER: 0 */ - { "unmapped.pduOutletControlPowerOnState", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.5.1.14", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletControlPowerOnState", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.5.1.14", NULL, SU_FLAG_OK, NULL), /* pduOutletControlPowerOnState.1.15 = INTEGER: 0 */ - { "unmapped.pduOutletControlPowerOnState", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.5.1.15", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletControlPowerOnState", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.5.1.15", NULL, SU_FLAG_OK, NULL), /* pduOutletControlPowerOnState.1.16 = INTEGER: 0 */ - { "unmapped.pduOutletControlPowerOnState", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.5.1.16", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletControlPowerOnState", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.5.1.16", NULL, SU_FLAG_OK, NULL), /* pduOutletControlPowerOnState.1.17 = INTEGER: 0 */ - { "unmapped.pduOutletControlPowerOnState", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.5.1.17", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletControlPowerOnState", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.5.1.17", NULL, SU_FLAG_OK, NULL), /* pduOutletControlPowerOnState.1.18 = INTEGER: 0 */ - { "unmapped.pduOutletControlPowerOnState", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.5.1.18", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletControlPowerOnState", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.5.1.18", NULL, SU_FLAG_OK, NULL), /* pduOutletControlPowerOnState.1.19 = INTEGER: 0 */ - { "unmapped.pduOutletControlPowerOnState", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.5.1.19", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletControlPowerOnState", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.5.1.19", NULL, SU_FLAG_OK, NULL), /* pduOutletControlPowerOnState.1.20 = INTEGER: 0 */ - { "unmapped.pduOutletControlPowerOnState", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.5.1.20", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletControlPowerOnState", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.5.1.20", NULL, SU_FLAG_OK, NULL), /* pduOutletControlPowerOnState.1.21 = INTEGER: 0 */ - { "unmapped.pduOutletControlPowerOnState", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.5.1.21", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletControlPowerOnState", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.5.1.21", NULL, SU_FLAG_OK, NULL), /* pduOutletControlPowerOnState.1.22 = INTEGER: 0 */ - { "unmapped.pduOutletControlPowerOnState", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.5.1.22", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletControlPowerOnState", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.5.1.22", NULL, SU_FLAG_OK, NULL), /* pduOutletControlPowerOnState.1.23 = INTEGER: 0 */ - { "unmapped.pduOutletControlPowerOnState", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.5.1.23", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletControlPowerOnState", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.5.1.23", NULL, SU_FLAG_OK, NULL), /* pduOutletControlPowerOnState.1.24 = INTEGER: 0 */ - { "unmapped.pduOutletControlPowerOnState", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.5.1.24", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletControlPowerOnState", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.5.1.24", NULL, SU_FLAG_OK, NULL), /* pduOutletControlPowerOnState.1.25 = INTEGER: 0 */ - { "unmapped.pduOutletControlPowerOnState", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.5.1.25", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletControlPowerOnState", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.5.1.25", NULL, SU_FLAG_OK, NULL), /* pduOutletControlPowerOnState.1.26 = INTEGER: 0 */ - { "unmapped.pduOutletControlPowerOnState", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.5.1.26", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletControlPowerOnState", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.5.1.26", NULL, SU_FLAG_OK, NULL), /* pduOutletControlPowerOnState.1.27 = INTEGER: 0 */ - { "unmapped.pduOutletControlPowerOnState", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.5.1.27", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletControlPowerOnState", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.5.1.27", NULL, SU_FLAG_OK, NULL), /* pduOutletControlPowerOnState.1.28 = INTEGER: 0 */ - { "unmapped.pduOutletControlPowerOnState", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.5.1.28", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletControlPowerOnState", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.5.1.28", NULL, SU_FLAG_OK, NULL), /* pduOutletControlPowerOnState.1.29 = INTEGER: 0 */ - { "unmapped.pduOutletControlPowerOnState", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.5.1.29", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletControlPowerOnState", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.5.1.29", NULL, SU_FLAG_OK, NULL), /* pduOutletControlPowerOnState.1.30 = INTEGER: 0 */ - { "unmapped.pduOutletControlPowerOnState", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.5.1.30", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletControlPowerOnState", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.5.1.30", NULL, SU_FLAG_OK, NULL), /* pduOutletControlPowerOnState.1.31 = INTEGER: 0 */ - { "unmapped.pduOutletControlPowerOnState", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.5.1.31", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletControlPowerOnState", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.5.1.31", NULL, SU_FLAG_OK, NULL), /* pduOutletControlPowerOnState.1.32 = INTEGER: 0 */ - { "unmapped.pduOutletControlPowerOnState", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.5.1.32", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletControlPowerOnState", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.5.1.32", NULL, SU_FLAG_OK, NULL), /* pduOutletControlPowerOnState.1.33 = INTEGER: 0 */ - { "unmapped.pduOutletControlPowerOnState", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.5.1.33", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletControlPowerOnState", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.5.1.33", NULL, SU_FLAG_OK, NULL), /* pduOutletControlPowerOnState.1.34 = INTEGER: 0 */ - { "unmapped.pduOutletControlPowerOnState", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.5.1.34", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletControlPowerOnState", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.5.1.34", NULL, SU_FLAG_OK, NULL), /* pduOutletControlPowerOnState.1.35 = INTEGER: 0 */ - { "unmapped.pduOutletControlPowerOnState", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.5.1.35", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletControlPowerOnState", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.5.1.35", NULL, SU_FLAG_OK, NULL), /* pduOutletControlPowerOnState.1.36 = INTEGER: 0 */ - { "unmapped.pduOutletControlPowerOnState", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.5.1.36", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletControlPowerOnState", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.5.1.36", NULL, SU_FLAG_OK, NULL), /* pduOutletControlPowerOnState.1.37 = INTEGER: 0 */ - { "unmapped.pduOutletControlPowerOnState", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.5.1.37", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletControlPowerOnState", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.5.1.37", NULL, SU_FLAG_OK, NULL), /* pduOutletControlPowerOnState.1.38 = INTEGER: 0 */ - { "unmapped.pduOutletControlPowerOnState", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.5.1.38", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletControlPowerOnState", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.5.1.38", NULL, SU_FLAG_OK, NULL), /* pduOutletControlPowerOnState.1.39 = INTEGER: 0 */ - { "unmapped.pduOutletControlPowerOnState", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.5.1.39", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletControlPowerOnState", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.5.1.39", NULL, SU_FLAG_OK, NULL), /* pduOutletControlPowerOnState.1.40 = INTEGER: 0 */ - { "unmapped.pduOutletControlPowerOnState", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.5.1.40", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletControlPowerOnState", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.5.1.40", NULL, SU_FLAG_OK, NULL), /* pduOutletControlPowerOnState.1.41 = INTEGER: 0 */ - { "unmapped.pduOutletControlPowerOnState", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.5.1.41", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletControlPowerOnState", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.5.1.41", NULL, SU_FLAG_OK, NULL), /* pduOutletControlPowerOnState.1.42 = INTEGER: 0 */ - { "unmapped.pduOutletControlPowerOnState", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.5.1.42", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletControlPowerOnState", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.5.1.42", NULL, SU_FLAG_OK, NULL), /* pduOutletControlPowerOnState.1.43 = INTEGER: 0 */ - { "unmapped.pduOutletControlPowerOnState", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.5.1.43", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletControlPowerOnState", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.5.1.43", NULL, SU_FLAG_OK, NULL), /* pduOutletControlPowerOnState.1.44 = INTEGER: 0 */ - { "unmapped.pduOutletControlPowerOnState", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.5.1.44", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletControlPowerOnState", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.5.1.44", NULL, SU_FLAG_OK, NULL), /* pduOutletControlPowerOnState.1.45 = INTEGER: 0 */ - { "unmapped.pduOutletControlPowerOnState", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.5.1.45", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletControlPowerOnState", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.5.1.45", NULL, SU_FLAG_OK, NULL), /* pduOutletControlPowerOnState.1.46 = INTEGER: 0 */ - { "unmapped.pduOutletControlPowerOnState", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.5.1.46", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletControlPowerOnState", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.5.1.46", NULL, SU_FLAG_OK, NULL), /* pduOutletControlPowerOnState.1.47 = INTEGER: 0 */ - { "unmapped.pduOutletControlPowerOnState", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.5.1.47", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduOutletControlPowerOnState", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.5.1.47", NULL, SU_FLAG_OK, NULL), /* pduOutletControlPowerOnState.1.48 = INTEGER: 0 */ - { "unmapped.pduOutletControlPowerOnState", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.5.1.48", NULL, SU_FLAG_OK, NULL }, - + snmp_info_default("unmapped.pduOutletControlPowerOnState", 0, 1, ".1.3.6.1.4.1.534.7.1.5.2.1.5.1.48", NULL, SU_FLAG_OK, NULL), #endif /* if WITH_UNMAPPED_DATA_POINTS */ + /* end of structure. */ - { NULL, 0, 0, NULL, NULL, 0, NULL } + snmp_info_sentinel }; mib2nut_info_t eaton_pdu_nlogic = { "eaton_pdu_nlogic", EATON_PDU_NLOGIC_MIB_VERSION, NULL, NULL, eaton_pdu_nlogic_mib, EATON_PDU_NLOGIC_SYSOID, NULL }; diff --git a/drivers/eaton-pdu-pulizzi-mib.c b/drivers/eaton-pdu-pulizzi-mib.c index 54b81433b3..87158ad891 100644 --- a/drivers/eaton-pdu-pulizzi-mib.c +++ b/drivers/eaton-pdu-pulizzi-mib.c @@ -42,7 +42,7 @@ /* Pulizzi Switched ePDU */ -#define EATON_PULIZZI_SW_MIB_VERSION "0.5" +#define EATON_PULIZZI_SW_MIB_VERSION "0.50" #define PULIZZI_SW_OID_MIB ".1.3.6.1.4.1.20677.3.1.1" #define PULIZZI_SW_OID_MODEL_NAME ".1.3.6.1.4.1.20677.2.1.1.0" @@ -53,87 +53,87 @@ static info_lkp_t pulizzi_sw_outlet_status_info[] = { - { 1, "on", NULL, NULL }, - { 2, "off", NULL, NULL }, - { 0, NULL, NULL, NULL } + info_lkp_default(1, "on"), + info_lkp_default(2, "off"), + info_lkp_sentinel }; /* simply remap the above status to "yes" */ static info_lkp_t pulizzi_sw_outlet_switchability_info[] = { - { 1, "yes", NULL, NULL }, - { 2, "yes", NULL, NULL }, - { 0, NULL, NULL, NULL } + info_lkp_default(1, "yes"), + info_lkp_default(2, "yes"), + info_lkp_sentinel }; /* Snmp2NUT lookup table for Eaton Pulizzi Switched ePDU MIB */ static snmp_info_t eaton_pulizzi_switched_mib[] = { /* standard MIB items */ - { "device.description", ST_FLAG_STRING | ST_FLAG_RW, SU_INFOSIZE, ".1.3.6.1.2.1.1.1.0", NULL, SU_FLAG_OK, NULL }, - { "device.contact", ST_FLAG_STRING | ST_FLAG_RW, SU_INFOSIZE, ".1.3.6.1.2.1.1.4.0", NULL, SU_FLAG_OK, NULL }, - { "device.location", ST_FLAG_STRING | ST_FLAG_RW, SU_INFOSIZE, ".1.3.6.1.2.1.1.6.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("device.description", ST_FLAG_STRING | ST_FLAG_RW, SU_INFOSIZE, ".1.3.6.1.2.1.1.1.0", NULL, SU_FLAG_OK, NULL), + snmp_info_default("device.contact", ST_FLAG_STRING | ST_FLAG_RW, SU_INFOSIZE, ".1.3.6.1.2.1.1.4.0", NULL, SU_FLAG_OK, NULL), + snmp_info_default("device.location", ST_FLAG_STRING | ST_FLAG_RW, SU_INFOSIZE, ".1.3.6.1.2.1.1.6.0", NULL, SU_FLAG_OK, NULL), /* Device page */ - { "device.mfr", ST_FLAG_STRING, SU_INFOSIZE, NULL, "EATON | Powerware", - SU_FLAG_STATIC | SU_FLAG_ABSENT | SU_FLAG_OK, NULL }, - { "device.model", ST_FLAG_STRING, SU_INFOSIZE, PULIZZI_SW_OID_MODEL_NAME, - "Switched ePDU", SU_FLAG_STATIC | SU_FLAG_OK, NULL }, - { "device.type", ST_FLAG_STRING, SU_INFOSIZE, NULL, "pdu", - SU_FLAG_STATIC | SU_FLAG_ABSENT | SU_FLAG_OK, NULL }, - { "device.macaddr", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.20677.2.2.6.0", - "unknown", 0, NULL }, + snmp_info_default("device.mfr", ST_FLAG_STRING, SU_INFOSIZE, NULL, "EATON | Powerware", + SU_FLAG_STATIC | SU_FLAG_ABSENT | SU_FLAG_OK, NULL), + snmp_info_default("device.model", ST_FLAG_STRING, SU_INFOSIZE, PULIZZI_SW_OID_MODEL_NAME, + "Switched ePDU", SU_FLAG_STATIC | SU_FLAG_OK, NULL), + snmp_info_default("device.type", ST_FLAG_STRING, SU_INFOSIZE, NULL, "pdu", + SU_FLAG_STATIC | SU_FLAG_ABSENT | SU_FLAG_OK, NULL), + snmp_info_default("device.macaddr", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.20677.2.2.6.0", + "unknown", 0, NULL), /* UPS page */ - { "ups.mfr", ST_FLAG_STRING, SU_INFOSIZE, NULL, "EATON", - SU_FLAG_STATIC | SU_FLAG_ABSENT | SU_FLAG_OK, NULL }, - { "ups.model", ST_FLAG_STRING, SU_INFOSIZE, PULIZZI_SW_OID_MODEL_NAME, - "Switched ePDU", SU_FLAG_STATIC | SU_FLAG_OK, NULL }, + snmp_info_default("ups.mfr", ST_FLAG_STRING, SU_INFOSIZE, NULL, "EATON", + SU_FLAG_STATIC | SU_FLAG_ABSENT | SU_FLAG_OK, NULL), + snmp_info_default("ups.model", ST_FLAG_STRING, SU_INFOSIZE, PULIZZI_SW_OID_MODEL_NAME, + "Switched ePDU", SU_FLAG_STATIC | SU_FLAG_OK, NULL), /* FIXME: to be moved to the device collection! */ - { "ups.date", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.20677.2.1.4.0", - "", SU_FLAG_STATIC | SU_FLAG_OK, NULL }, - { "ups.time", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.20677.2.1.3.0", - "", SU_FLAG_STATIC | SU_FLAG_OK, NULL }, + snmp_info_default("ups.date", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.20677.2.1.4.0", + "", SU_FLAG_STATIC | SU_FLAG_OK, NULL), + snmp_info_default("ups.time", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.20677.2.1.3.0", + "", SU_FLAG_STATIC | SU_FLAG_OK, NULL), /* Outlet page */ /* Note: outlet.count is deduced, with guesstimate_outlet_count() */ - { "outlet.id", 0, 1, NULL, "0", SU_FLAG_STATIC | SU_FLAG_ABSENT | SU_FLAG_OK, NULL }, - { "outlet.desc", ST_FLAG_RW | ST_FLAG_STRING, 20, NULL, "All outlets", - SU_FLAG_STATIC | SU_FLAG_ABSENT | SU_FLAG_OK, NULL }, + snmp_info_default("outlet.id", 0, 1, NULL, "0", SU_FLAG_STATIC | SU_FLAG_ABSENT | SU_FLAG_OK, NULL), + snmp_info_default("outlet.desc", ST_FLAG_RW | ST_FLAG_STRING, 20, NULL, "All outlets", + SU_FLAG_STATIC | SU_FLAG_ABSENT | SU_FLAG_OK, NULL), - { "outlet.current", 0, 1.0, ".1.3.6.1.4.1.20677.2.8.6.4.2.0", NULL, 0, NULL }, - { "outlet.voltage", 0, 1.0, ".1.3.6.1.4.1.20677.2.8.6.4.1.0", NULL, 0, NULL }, - { "outlet.power", 0, 1.0, ".1.3.6.1.4.1.20677.2.8.6.4.3.0", NULL, 0, NULL }, + snmp_info_default("outlet.current", 0, 1.0, ".1.3.6.1.4.1.20677.2.8.6.4.2.0", NULL, 0, NULL), + snmp_info_default("outlet.voltage", 0, 1.0, ".1.3.6.1.4.1.20677.2.8.6.4.1.0", NULL, 0, NULL), + snmp_info_default("outlet.power", 0, 1.0, ".1.3.6.1.4.1.20677.2.8.6.4.3.0", NULL, 0, NULL), /* outlet template definition * Notes: * - indexes start from 1, ie outlet.1 => .1 * - the first definition is used to determine the base index (ie 0 or 1) * - outlet.count is estimated, based on the below OID iteration capabilities */ - { "outlet.%i.desc", ST_FLAG_RW | ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.20677.2.6.1.%i.1.0", NULL, SU_FLAG_STATIC | SU_FLAG_OK | SU_OUTLET, NULL }, - { "outlet.%i.status", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.20677.2.6.3.%i.0", - NULL, SU_FLAG_OK | SU_OUTLET, &pulizzi_sw_outlet_status_info[0] }, - { "outlet.%i.id", 0, 1, NULL, "%i", SU_FLAG_STATIC | SU_FLAG_ABSENT | SU_FLAG_OK | SU_OUTLET, NULL }, + snmp_info_default("outlet.%i.desc", ST_FLAG_RW | ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.20677.2.6.1.%i.1.0", NULL, SU_FLAG_STATIC | SU_FLAG_OK | SU_OUTLET, NULL), + snmp_info_default("outlet.%i.status", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.20677.2.6.3.%i.0", + NULL, SU_FLAG_OK | SU_OUTLET, &pulizzi_sw_outlet_status_info[0]), + snmp_info_default("outlet.%i.id", 0, 1, NULL, "%i", SU_FLAG_STATIC | SU_FLAG_ABSENT | SU_FLAG_OK | SU_OUTLET, NULL), /* we use the same OID as outlet.n.status..., to expose switchability */ - { "outlet.%i.switchable", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.20677.2.6.3.%i.0", "yes", SU_FLAG_STATIC | SU_FLAG_OK | SU_OUTLET, &pulizzi_sw_outlet_switchability_info[0] }, + snmp_info_default("outlet.%i.switchable", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.20677.2.6.3.%i.0", "yes", SU_FLAG_STATIC | SU_FLAG_OK | SU_OUTLET, &pulizzi_sw_outlet_switchability_info[0]), /* FIXME: need to be added to the namespace! */ - { "outlet.%i.delay.reboot", ST_FLAG_RW, 1, ".1.3.6.1.4.1.20677.2.6.1.%i.5.0", NULL, SU_OUTLET, NULL }, + snmp_info_default("outlet.%i.delay.reboot", ST_FLAG_RW, 1, ".1.3.6.1.4.1.20677.2.6.1.%i.5.0", NULL, SU_OUTLET, NULL), /* "outlet1SequenceTime" is used for global sequence */ - { "outlet.%i.delay.start", ST_FLAG_RW, 1, ".1.3.6.1.4.1.20677.2.6.1.%i.4.0", NULL, SU_OUTLET, NULL }, + snmp_info_default("outlet.%i.delay.start", ST_FLAG_RW, 1, ".1.3.6.1.4.1.20677.2.6.1.%i.4.0", NULL, SU_OUTLET, NULL), /* instant commands. */ /* FIXME: not exposed as "outlet.load...", or otherwise specific processing applies (template instanciation) */ - { "load.on", 0, 1, ".1.3.6.1.4.1.20677.2.6.2.1.0", "1", SU_TYPE_CMD, NULL }, - { "load.off", 0, 1, ".1.3.6.1.4.1.20677.2.6.2.1.0", "2", SU_TYPE_CMD, NULL }, - { "load.on.delay", 0, 1, ".1.3.6.1.4.1.20677.2.6.2.1.0", "3", SU_TYPE_CMD, NULL }, - { "load.off.delay", 0, 1, ".1.3.6.1.4.1.20677.2.6.2.1.0", "4", SU_TYPE_CMD, NULL }, + snmp_info_default("load.on", 0, 1, ".1.3.6.1.4.1.20677.2.6.2.1.0", "1", SU_TYPE_CMD, NULL), + snmp_info_default("load.off", 0, 1, ".1.3.6.1.4.1.20677.2.6.2.1.0", "2", SU_TYPE_CMD, NULL), + snmp_info_default("load.on.delay", 0, 1, ".1.3.6.1.4.1.20677.2.6.2.1.0", "3", SU_TYPE_CMD, NULL), + snmp_info_default("load.off.delay", 0, 1, ".1.3.6.1.4.1.20677.2.6.2.1.0", "4", SU_TYPE_CMD, NULL), /* WARNING: outlet 1 => index 2, so SU_CMD_OFFSET! */ - { "outlet.%i.load.on", 0, 1, ".1.3.6.1.4.1.20677.2.6.2.%i.0", "1", SU_TYPE_CMD | SU_OUTLET | SU_CMD_OFFSET, NULL }, - { "outlet.%i.load.off", 0, 1, ".1.3.6.1.4.1.20677.2.6.2.%i.0", "2", SU_TYPE_CMD | SU_OUTLET | SU_CMD_OFFSET, NULL }, - { "outlet.%i.load.cycle", 0, 1, ".1.3.6.1.4.1.20677.2.6.2.%i.0", "3", SU_TYPE_CMD | SU_OUTLET | SU_CMD_OFFSET, NULL }, + snmp_info_default("outlet.%i.load.on", 0, 1, ".1.3.6.1.4.1.20677.2.6.2.%i.0", "1", SU_TYPE_CMD | SU_OUTLET | SU_CMD_OFFSET, NULL), + snmp_info_default("outlet.%i.load.off", 0, 1, ".1.3.6.1.4.1.20677.2.6.2.%i.0", "2", SU_TYPE_CMD | SU_OUTLET | SU_CMD_OFFSET, NULL), + snmp_info_default("outlet.%i.load.cycle", 0, 1, ".1.3.6.1.4.1.20677.2.6.2.%i.0", "3", SU_TYPE_CMD | SU_OUTLET | SU_CMD_OFFSET, NULL), /* end of structure. */ - { NULL, 0, 0, NULL, NULL, 0, NULL } + snmp_info_sentinel }; diff --git a/drivers/eaton-pdu-revelation-mib.c b/drivers/eaton-pdu-revelation-mib.c index 8c1cd8340f..6a162288f3 100644 --- a/drivers/eaton-pdu-revelation-mib.c +++ b/drivers/eaton-pdu-revelation-mib.c @@ -55,21 +55,21 @@ #define AR_OID_OUTLET_STATUS AR_BASE_OID ".1.2.2.1.3" static info_lkp_t revelation_outlet_status_info[] = { - { -1, "error", NULL, NULL }, - { 0, "off", NULL, NULL }, - { 1, "on", NULL, NULL }, - { 2, "cycling", NULL, NULL }, /* transitional status */ - { 0, NULL, NULL, NULL } + info_lkp_default(-1, "error"), + info_lkp_default(0, "off"), + info_lkp_default(1, "on"), + info_lkp_default(2, "cycling"), /* transitional status */ + info_lkp_sentinel }; /* Ugly hack: having the matching OID present means that the outlet is * switchable. So, it should not require this value lookup */ static info_lkp_t revelation_outlet_switchability_info[] = { - { -1, "yes", NULL, NULL }, - { 0, "yes", NULL, NULL }, - { 1, "yes", NULL, NULL }, - { 2, "yes", NULL, NULL }, - { 0, NULL, NULL, NULL } + info_lkp_default(-1, "yes"), + info_lkp_default(0, "yes"), + info_lkp_default(1, "yes"), + info_lkp_default(2, "yes"), + info_lkp_sentinel }; #define DO_OFF "0" @@ -88,64 +88,64 @@ static info_lkp_t revelation_outlet_switchability_info[] = { static snmp_info_t eaton_aphel_revelation_mib[] = { /* standard MIB items */ - { "device.description", ST_FLAG_STRING | ST_FLAG_RW, SU_INFOSIZE, ".1.3.6.1.2.1.1.1.0", NULL, SU_FLAG_OK, NULL }, - { "device.contact", ST_FLAG_STRING | ST_FLAG_RW, SU_INFOSIZE, ".1.3.6.1.2.1.1.4.0", NULL, SU_FLAG_OK, NULL }, - { "device.location", ST_FLAG_STRING | ST_FLAG_RW, SU_INFOSIZE, ".1.3.6.1.2.1.1.6.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("device.description", ST_FLAG_STRING | ST_FLAG_RW, SU_INFOSIZE, ".1.3.6.1.2.1.1.1.0", NULL, SU_FLAG_OK, NULL), + snmp_info_default("device.contact", ST_FLAG_STRING | ST_FLAG_RW, SU_INFOSIZE, ".1.3.6.1.2.1.1.4.0", NULL, SU_FLAG_OK, NULL), + snmp_info_default("device.location", ST_FLAG_STRING | ST_FLAG_RW, SU_INFOSIZE, ".1.3.6.1.2.1.1.6.0", NULL, SU_FLAG_OK, NULL), /* Device collection */ - { "device.mfr", ST_FLAG_STRING, SU_INFOSIZE, NULL, "EATON | Powerware", - SU_FLAG_STATIC | SU_FLAG_ABSENT | SU_FLAG_OK, NULL }, - { "device.model", ST_FLAG_STRING, SU_INFOSIZE, AR_OID_MODEL_NAME, - "Eaton Powerware ePDU Managed", SU_FLAG_STATIC | SU_FLAG_OK, NULL }, - { "device.serial", ST_FLAG_STRING, SU_INFOSIZE, AR_OID_SERIAL, "", - SU_FLAG_STATIC | SU_FLAG_OK, NULL }, - { "device.type", ST_FLAG_STRING, SU_INFOSIZE, NULL, "pdu", - SU_FLAG_STATIC | SU_FLAG_ABSENT | SU_FLAG_OK, NULL }, - { "device.macaddr", ST_FLAG_STRING, SU_INFOSIZE, AR_OID_UNIT_MACADDR, "", - SU_FLAG_STATIC | SU_FLAG_OK, NULL }, + snmp_info_default("device.mfr", ST_FLAG_STRING, SU_INFOSIZE, NULL, "EATON | Powerware", + SU_FLAG_STATIC | SU_FLAG_ABSENT | SU_FLAG_OK, NULL), + snmp_info_default("device.model", ST_FLAG_STRING, SU_INFOSIZE, AR_OID_MODEL_NAME, + "Eaton Powerware ePDU Managed", SU_FLAG_STATIC | SU_FLAG_OK, NULL), + snmp_info_default("device.serial", ST_FLAG_STRING, SU_INFOSIZE, AR_OID_SERIAL, "", + SU_FLAG_STATIC | SU_FLAG_OK, NULL), + snmp_info_default("device.type", ST_FLAG_STRING, SU_INFOSIZE, NULL, "pdu", + SU_FLAG_STATIC | SU_FLAG_ABSENT | SU_FLAG_OK, NULL), + snmp_info_default("device.macaddr", ST_FLAG_STRING, SU_INFOSIZE, AR_OID_UNIT_MACADDR, "", + SU_FLAG_STATIC | SU_FLAG_OK, NULL), /* hardwareRev.0 = Integer: 26 */ /* FIXME: not compliant! to be RFC'ed */ - { "device.revision", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.6.6.6.1.1.7.0", - "", SU_FLAG_STATIC | SU_FLAG_OK, NULL }, + snmp_info_default("device.revision", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.6.6.6.1.1.7.0", + "", SU_FLAG_STATIC | SU_FLAG_OK, NULL), /* UPS collection */ - { "ups.mfr", ST_FLAG_STRING, SU_INFOSIZE, NULL, "EATON | Powerware", - SU_FLAG_STATIC | SU_FLAG_ABSENT | SU_FLAG_OK, NULL }, - { "ups.model", ST_FLAG_STRING, SU_INFOSIZE, AR_OID_MODEL_NAME, - "Generic SNMP PDU", SU_FLAG_STATIC | SU_FLAG_OK, NULL }, - { "ups.id", ST_FLAG_STRING, SU_INFOSIZE, AR_OID_DEVICE_NAME, - "unknown", SU_FLAG_STATIC | SU_FLAG_OK, NULL }, - { "ups.serial", ST_FLAG_STRING, SU_INFOSIZE, AR_OID_SERIAL, "", - SU_FLAG_STATIC | SU_FLAG_OK, NULL }, - { "ups.firmware", ST_FLAG_STRING, SU_INFOSIZE, AR_OID_FIRMREV, "", - SU_FLAG_STATIC | SU_FLAG_OK, NULL }, - { "ups.type", ST_FLAG_STRING, SU_INFOSIZE, NULL, "pdu", - SU_FLAG_STATIC | SU_FLAG_ABSENT | SU_FLAG_OK, NULL }, - { "ups.temperature", 0, 1, AR_OID_UNIT_CPUTEMPERATURE, NULL, 0, NULL }, + snmp_info_default("ups.mfr", ST_FLAG_STRING, SU_INFOSIZE, NULL, "EATON | Powerware", + SU_FLAG_STATIC | SU_FLAG_ABSENT | SU_FLAG_OK, NULL), + snmp_info_default("ups.model", ST_FLAG_STRING, SU_INFOSIZE, AR_OID_MODEL_NAME, + "Generic SNMP PDU", SU_FLAG_STATIC | SU_FLAG_OK, NULL), + snmp_info_default("ups.id", ST_FLAG_STRING, SU_INFOSIZE, AR_OID_DEVICE_NAME, + "unknown", SU_FLAG_STATIC | SU_FLAG_OK, NULL), + snmp_info_default("ups.serial", ST_FLAG_STRING, SU_INFOSIZE, AR_OID_SERIAL, "", + SU_FLAG_STATIC | SU_FLAG_OK, NULL), + snmp_info_default("ups.firmware", ST_FLAG_STRING, SU_INFOSIZE, AR_OID_FIRMREV, "", + SU_FLAG_STATIC | SU_FLAG_OK, NULL), + snmp_info_default("ups.type", ST_FLAG_STRING, SU_INFOSIZE, NULL, "pdu", + SU_FLAG_STATIC | SU_FLAG_ABSENT | SU_FLAG_OK, NULL), + snmp_info_default("ups.temperature", 0, 1, AR_OID_UNIT_CPUTEMPERATURE, NULL, 0, NULL), /* Outlet collection */ - { "outlet.id", 0, 1, NULL, "0", SU_FLAG_STATIC | SU_FLAG_ABSENT | SU_FLAG_OK, NULL }, - { "outlet.desc", ST_FLAG_RW | ST_FLAG_STRING, 20, NULL, "All outlets", - SU_FLAG_STATIC | SU_FLAG_ABSENT | SU_FLAG_OK, NULL }, - { "outlet.count", 0, 1, AR_OID_OUTLET_COUNT, "0", 0, NULL }, - { "outlet.current", 0, 0.001, AR_OID_UNIT_CURRENT ".0", NULL, 0, NULL }, - { "outlet.voltage", 0, 0.001, AR_OID_UNIT_VOLTAGE ".0", NULL, 0, NULL }, - { "outlet.realpower", 0, 1.0, AR_OID_UNIT_ACTIVEPOWER ".0", NULL, 0, NULL }, - { "outlet.power", 0, 1.0, AR_OID_UNIT_APPARENTPOWER ".0", NULL, 0, NULL }, + snmp_info_default("outlet.id", 0, 1, NULL, "0", SU_FLAG_STATIC | SU_FLAG_ABSENT | SU_FLAG_OK, NULL), + snmp_info_default("outlet.desc", ST_FLAG_RW | ST_FLAG_STRING, 20, NULL, "All outlets", + SU_FLAG_STATIC | SU_FLAG_ABSENT | SU_FLAG_OK, NULL), + snmp_info_default("outlet.count", 0, 1, AR_OID_OUTLET_COUNT, "0", 0, NULL), + snmp_info_default("outlet.current", 0, 0.001, AR_OID_UNIT_CURRENT ".0", NULL, 0, NULL), + snmp_info_default("outlet.voltage", 0, 0.001, AR_OID_UNIT_VOLTAGE ".0", NULL, 0, NULL), + snmp_info_default("outlet.realpower", 0, 1.0, AR_OID_UNIT_ACTIVEPOWER ".0", NULL, 0, NULL), + snmp_info_default("outlet.power", 0, 1.0, AR_OID_UNIT_APPARENTPOWER ".0", NULL, 0, NULL), /* outlet template definition * Caution: the index of the data start at 0, while the name is +1 * ie outlet.1 => .0 */ - { "outlet.%i.switchable", 0, 1, AR_OID_OUTLET_STATUS ".%i", "yes", SU_FLAG_STATIC | SU_OUTLET, &revelation_outlet_switchability_info[0] }, - { "outlet.%i.id", 0, 1, NULL, "%i", SU_FLAG_STATIC | SU_FLAG_ABSENT | SU_FLAG_OK | SU_OUTLET, NULL }, - { "outlet.%i.desc", ST_FLAG_RW | ST_FLAG_STRING, SU_INFOSIZE, AR_OID_OUTLET_NAME ".%i", NULL, SU_OUTLET, NULL }, - { "outlet.%i.status", ST_FLAG_STRING, SU_INFOSIZE, AR_OID_OUTLET_STATUS ".%i", NULL, SU_FLAG_OK | SU_OUTLET, &revelation_outlet_status_info[0] }, - { "outlet.%i.current", 0, 0.001, AR_OID_OUTLET_CURRENT ".%i", NULL, SU_OUTLET, NULL }, - { "outlet.%i.current.maximum", 0, 0.001, AR_OID_OUTLET_MAXCURRENT ".%i", NULL, SU_OUTLET, NULL }, - { "outlet.%i.realpower", 0, 1.0, AR_OID_OUTLET_ACTIVEPOWER ".%i", NULL, SU_OUTLET, NULL }, - { "outlet.%i.voltage", 0, 1.0, AR_OID_OUTLET_VOLTAGE ".%i", NULL, SU_OUTLET, NULL }, - { "outlet.%i.powerfactor", 0, 0.01, AR_OID_OUTLET_POWERFACTOR ".%i", NULL, SU_OUTLET, NULL }, - { "outlet.%i.power", 0, 1.0, AR_OID_OUTLET_APPARENTPOWER ".%i", NULL, SU_OUTLET, NULL }, + snmp_info_default("outlet.%i.switchable", 0, 1, AR_OID_OUTLET_STATUS ".%i", "yes", SU_FLAG_STATIC | SU_OUTLET, &revelation_outlet_switchability_info[0]), + snmp_info_default("outlet.%i.id", 0, 1, NULL, "%i", SU_FLAG_STATIC | SU_FLAG_ABSENT | SU_FLAG_OK | SU_OUTLET, NULL), + snmp_info_default("outlet.%i.desc", ST_FLAG_RW | ST_FLAG_STRING, SU_INFOSIZE, AR_OID_OUTLET_NAME ".%i", NULL, SU_OUTLET, NULL), + snmp_info_default("outlet.%i.status", ST_FLAG_STRING, SU_INFOSIZE, AR_OID_OUTLET_STATUS ".%i", NULL, SU_FLAG_OK | SU_OUTLET, &revelation_outlet_status_info[0]), + snmp_info_default("outlet.%i.current", 0, 0.001, AR_OID_OUTLET_CURRENT ".%i", NULL, SU_OUTLET, NULL), + snmp_info_default("outlet.%i.current.maximum", 0, 0.001, AR_OID_OUTLET_MAXCURRENT ".%i", NULL, SU_OUTLET, NULL), + snmp_info_default("outlet.%i.realpower", 0, 1.0, AR_OID_OUTLET_ACTIVEPOWER ".%i", NULL, SU_OUTLET, NULL), + snmp_info_default("outlet.%i.voltage", 0, 1.0, AR_OID_OUTLET_VOLTAGE ".%i", NULL, SU_OUTLET, NULL), + snmp_info_default("outlet.%i.powerfactor", 0, 0.01, AR_OID_OUTLET_POWERFACTOR ".%i", NULL, SU_OUTLET, NULL), + snmp_info_default("outlet.%i.power", 0, 1.0, AR_OID_OUTLET_APPARENTPOWER ".%i", NULL, SU_OUTLET, NULL), /* FIXME: * - delay for startup/shutdown sequence @@ -157,25 +157,25 @@ static snmp_info_t eaton_aphel_revelation_mib[] = { /* Ambient collection */ /* We use critical levels, for both temperature and humidity, * since warning levels are also available! */ - { "ambient.temperature", 0, 1.0, ".1.3.6.1.4.1.534.6.6.6.2.2.1.3.0", NULL, SU_FLAG_OK, NULL }, - { "ambient.temperature.low", 0, 1.0, "1.3.6.1.4.1.534.6.6.6.2.2.1.6.0", NULL, SU_FLAG_OK, NULL }, - { "ambient.temperature.high", 0, 1.0, "1.3.6.1.4.1.534.6.6.6.2.2.1.7.0", NULL, SU_FLAG_OK, NULL }, - { "ambient.humidity", 0, 1.0, ".1.3.6.1.4.1.534.6.6.6.2.4.1.3.0", NULL, SU_FLAG_OK, NULL }, - { "ambient.humidity.low", 0, 1.0, ".1.3.6.1.4.1.534.6.6.6.2.4.1.6.0", NULL, SU_FLAG_OK, NULL }, - { "ambient.humidity.high", 0, 1.0, ".1.3.6.1.4.1.534.6.6.6.2.4.1.7.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("ambient.temperature", 0, 1.0, ".1.3.6.1.4.1.534.6.6.6.2.2.1.3.0", NULL, SU_FLAG_OK, NULL), + snmp_info_default("ambient.temperature.low", 0, 1.0, "1.3.6.1.4.1.534.6.6.6.2.2.1.6.0", NULL, SU_FLAG_OK, NULL), + snmp_info_default("ambient.temperature.high", 0, 1.0, "1.3.6.1.4.1.534.6.6.6.2.2.1.7.0", NULL, SU_FLAG_OK, NULL), + snmp_info_default("ambient.humidity", 0, 1.0, ".1.3.6.1.4.1.534.6.6.6.2.4.1.3.0", NULL, SU_FLAG_OK, NULL), + snmp_info_default("ambient.humidity.low", 0, 1.0, ".1.3.6.1.4.1.534.6.6.6.2.4.1.6.0", NULL, SU_FLAG_OK, NULL), + snmp_info_default("ambient.humidity.high", 0, 1.0, ".1.3.6.1.4.1.534.6.6.6.2.4.1.7.0", NULL, SU_FLAG_OK, NULL), /* instant commands. */ /* Note that load.cycle might be replaced by / mapped on shutdown.reboot */ /* no counterpart found! - { "outlet.load.off", 0, DO_OFF, AR_OID_OUTLET_STATUS ".0", NULL, SU_TYPE_CMD, NULL }, - { "outlet.load.on", 0, DO_ON, AR_OID_OUTLET_STATUS ".0", NULL, SU_TYPE_CMD, NULL }, - { "outlet.load.cycle", 0, DO_CYCLE, AR_OID_OUTLET_STATUS ".0", NULL, SU_TYPE_CMD, NULL }, */ - { "outlet.%i.load.off", 0, 1, AR_OID_OUTLET_STATUS ".%i", DO_OFF, SU_TYPE_CMD | SU_OUTLET, NULL }, - { "outlet.%i.load.on", 0, 1, AR_OID_OUTLET_STATUS ".%i", DO_ON, SU_TYPE_CMD | SU_OUTLET, NULL }, - { "outlet.%i.load.cycle", 0, 1, AR_OID_OUTLET_STATUS ".%i", DO_CYCLE, SU_TYPE_CMD | SU_OUTLET, NULL }, + snmp_info_default("outlet.load.off", 0, DO_OFF, AR_OID_OUTLET_STATUS ".0", NULL, SU_TYPE_CMD, NULL), + snmp_info_default("outlet.load.on", 0, DO_ON, AR_OID_OUTLET_STATUS ".0", NULL, SU_TYPE_CMD, NULL), + snmp_info_default("outlet.load.cycle", 0, DO_CYCLE, AR_OID_OUTLET_STATUS ".0", NULL, SU_TYPE_CMD, NULL), */ + snmp_info_default("outlet.%i.load.off", 0, 1, AR_OID_OUTLET_STATUS ".%i", DO_OFF, SU_TYPE_CMD | SU_OUTLET, NULL), + snmp_info_default("outlet.%i.load.on", 0, 1, AR_OID_OUTLET_STATUS ".%i", DO_ON, SU_TYPE_CMD | SU_OUTLET, NULL), + snmp_info_default("outlet.%i.load.cycle", 0, 1, AR_OID_OUTLET_STATUS ".%i", DO_CYCLE, SU_TYPE_CMD | SU_OUTLET, NULL), /* end of structure. */ - { NULL, 0, 0, NULL, NULL, 0, NULL } + snmp_info_sentinel }; diff --git a/drivers/eaton-ups-pwnm2-mib.c b/drivers/eaton-ups-pwnm2-mib.c index 29a7f1d244..5347c06e83 100644 --- a/drivers/eaton-ups-pwnm2-mib.c +++ b/drivers/eaton-ups-pwnm2-mib.c @@ -1,5 +1,7 @@ /* eaton-ups-pwnm2-mib.c - data to monitor Powerware and Eaton NM2 UPS with NUT * (using MIBs described in stdupsv1.mib and Xups.mib) + * Previously known as powerware-mib.c for "pw" mapping, + * later split into several subdrivers * * Copyright (C) * 2005-2006 Olli Savia @@ -29,7 +31,7 @@ #include "eaton-pdu-marlin-helpers.h" #endif -#define PW_MIB_VERSION "0.105" +#define PW_MIB_VERSION "0.106" /* Powerware UPS (Ingrasys X-SLOT and BD-SLOT) * Eaton Gigabit Network Card (Genepi) */ @@ -97,33 +99,35 @@ #define DEFAULT_SHUTDOWNDELAY 0 static info_lkp_t pw_alarm_ob[] = { - { 1, "OB", NULL, NULL }, - { 2, "", NULL, NULL }, - { 0, NULL, NULL, NULL } + info_lkp_default(1, "OB"), + info_lkp_default(2, ""), + info_lkp_sentinel }; static info_lkp_t pw_alarm_lb[] = { - { 1, "LB", NULL, NULL }, - { 2, "", NULL, NULL }, - { 0, NULL, NULL, NULL } + info_lkp_default(1, "LB"), + info_lkp_default(2, ""), + info_lkp_sentinel }; static info_lkp_t pw_pwr_info[] = { - { 1, "" /* other */, NULL, NULL }, - { 2, "OFF" /* none */, NULL, NULL }, - { 3, "OL" /* normal */, NULL, NULL }, - { 4, "BYPASS" /* bypass */, NULL, NULL }, - { 5, "OB" /* battery */, NULL, NULL }, - { 6, "OL BOOST" /* booster */, NULL, NULL }, - { 7, "OL TRIM" /* reducer */, NULL, NULL }, - { 8, "OL" /* parallel capacity */, NULL, NULL }, - { 9, "OL" /* parallel redundancy */, NULL, NULL }, - { 10, "OL" /* high efficiency */, NULL, NULL }, - { 11, "BYPASS" /* maintenanceBypass */, NULL, NULL }, - { 11, "OL" /* essMode */, NULL, NULL }, - - { 0, NULL, NULL, NULL } -}; + info_lkp_default(1, ""), /* other */ + info_lkp_default(2, "OFF"), /* none */ + info_lkp_default(3, "OL"), /* normal */ + info_lkp_default(4, "BYPASS"), /* bypass */ + info_lkp_default(5, "OB"), /* battery */ + info_lkp_default(6, "OL BOOST"), /* booster */ + info_lkp_default(7, "OL TRIM"), /* reducer */ + info_lkp_default(8, "OL"), /* parallel capacity */ + info_lkp_default(9, "OL"), /* parallel redundancy */ + info_lkp_default(10, "OL"), /* high efficiency */ + + info_lkp_default(11, "BYPASS"), /* maintenanceBypass */ + info_lkp_default(11, "OL"), /* essMode */ + /* FIXME: is "11" correct here or in the line above? */ + + info_lkp_sentinel +}; /* FIXME: mapped to (experimental.)ups.type, but * should be output.source or ups.mode (need RFC) @@ -140,112 +144,115 @@ static info_lkp_t pw_pwr_info[] = { #if USE_PW_MODE_INFO static info_lkp_t pw_mode_info[] = { - { 1, "", NULL, NULL }, - { 2, "", NULL, NULL }, - { 3, "normal", NULL, NULL }, - { 4, "", NULL, NULL }, - { 5, "", NULL, NULL }, - { 6, "", NULL, NULL }, - { 7, "", NULL, NULL }, - { 8, "parallel capacity", NULL, NULL }, - { 9, "parallel redundancy", NULL, NULL }, - { 10, "high efficiency", NULL, NULL }, + info_lkp_default(1, ""), + info_lkp_default(2, ""), + info_lkp_default(3, "normal"), + info_lkp_default(4, ""), + info_lkp_default(5, ""), + info_lkp_default(6, ""), + info_lkp_default(7, ""), + info_lkp_default(8, "parallel capacity"), + info_lkp_default(9, "parallel redundancy"), + info_lkp_default(10, "high efficiency"), + /* Extended status values, * FIXME: check for source and completion */ - { 240, "" /* battery (0xF0) */, NULL, NULL }, - { 100, "" /* maintenanceBypass (0x64) */, NULL, NULL }, - { 96, "" /* Bypass (0x60) */, NULL, NULL }, - { 81, "high efficiency" /* high efficiency (0x51) */, NULL, NULL }, - { 80, "normal" /* normal (0x50) */, NULL, NULL }, - { 64, "" /* UPS supporting load, normal degraded mode (0x40) */, NULL, NULL }, - { 16, "" /* none (0x10) */, NULL, NULL }, - { 0, NULL, NULL, NULL } + info_lkp_default(240, ""), /* battery (0xF0) */ + info_lkp_default(100, ""), /* maintenanceBypass (0x64) */ + info_lkp_default(96, ""), /* Bypass (0x60) */ + info_lkp_default(81, "high efficiency"), /* high efficiency (0x51) */ + info_lkp_default(80, "normal"), /* normal (0x50) */ + info_lkp_default(64, ""), /* UPS supporting load, normal degraded mode (0x40) */ + info_lkp_default(16, ""), /* none (0x10) */ + info_lkp_sentinel }; #endif /* USE_PW_MODE_INFO */ /* FIXME: may be standardized * extracted from bcmxcp.c->BCMXCP_TOPOLOGY_*, Make some common definitions */ static info_lkp_t pw_topology_info[] = { - { 0x0000, "", NULL, NULL }, /* None; use the Table of Elements */ - { 0x0010, "Off-line switcher, Single Phase", NULL, NULL }, - { 0x0020, "Line-Interactive UPS, Single Phase", NULL, NULL }, - { 0x0021, "Line-Interactive UPS, Two Phase", NULL, NULL }, - { 0x0022, "Line-Interactive UPS, Three Phase", NULL, NULL }, - { 0x0030, "Dual AC Input, On-Line UPS, Single Phase", NULL, NULL }, - { 0x0031, "Dual AC Input, On-Line UPS, Two Phase", NULL, NULL }, - { 0x0032, "Dual AC Input, On-Line UPS, Three Phase", NULL, NULL }, - { 0x0040, "On-Line UPS, Single Phase", NULL, NULL }, - { 0x0041, "On-Line UPS, Two Phase", NULL, NULL }, - { 0x0042, "On-Line UPS, Three Phase", NULL, NULL }, - { 0x0050, "Parallel Redundant On-Line UPS, Single Phase", NULL, NULL }, - { 0x0051, "Parallel Redundant On-Line UPS, Two Phase", NULL, NULL }, - { 0x0052, "Parallel Redundant On-Line UPS, Three Phase", NULL, NULL }, - { 0x0060, "Parallel for Capacity On-Line UPS, Single Phase", NULL, NULL }, - { 0x0061, "Parallel for Capacity On-Line UPS, Two Phase", NULL, NULL }, - { 0x0062, "Parallel for Capacity On-Line UPS, Three Phase", NULL, NULL }, - { 0x0102, "System Bypass Module, Three Phase", NULL, NULL }, - { 0x0122, "Hot-Tie Cabinet, Three Phase", NULL, NULL }, - { 0x0200, "Outlet Controller, Single Phase", NULL, NULL }, - { 0x0222, "Dual AC Input Static Switch Module, 3 Phase", NULL, NULL }, - { 0, NULL, NULL, NULL } + info_lkp_default(0x0000, ""), /* None; use the Table of Elements */ + info_lkp_default(0x0010, "Off-line switcher, Single Phase"), + info_lkp_default(0x0020, "Line-Interactive UPS, Single Phase"), + info_lkp_default(0x0021, "Line-Interactive UPS, Two Phase"), + info_lkp_default(0x0022, "Line-Interactive UPS, Three Phase"), + info_lkp_default(0x0030, "Dual AC Input, On-Line UPS, Single Phase"), + info_lkp_default(0x0031, "Dual AC Input, On-Line UPS, Two Phase"), + info_lkp_default(0x0032, "Dual AC Input, On-Line UPS, Three Phase"), + info_lkp_default(0x0040, "On-Line UPS, Single Phase"), + info_lkp_default(0x0041, "On-Line UPS, Two Phase"), + info_lkp_default(0x0042, "On-Line UPS, Three Phase"), + info_lkp_default(0x0050, "Parallel Redundant On-Line UPS, Single Phase"), + info_lkp_default(0x0051, "Parallel Redundant On-Line UPS, Two Phase"), + info_lkp_default(0x0052, "Parallel Redundant On-Line UPS, Three Phase"), + info_lkp_default(0x0060, "Parallel for Capacity On-Line UPS, Single Phase"), + info_lkp_default(0x0061, "Parallel for Capacity On-Line UPS, Two Phase"), + info_lkp_default(0x0062, "Parallel for Capacity On-Line UPS, Three Phase"), + info_lkp_default(0x0102, "System Bypass Module, Three Phase"), + info_lkp_default(0x0122, "Hot-Tie Cabinet, Three Phase"), + info_lkp_default(0x0200, "Outlet Controller, Single Phase"), + info_lkp_default(0x0222, "Dual AC Input Static Switch Module, 3 Phase"), + info_lkp_sentinel }; /* Legacy implementation */ static info_lkp_t pw_battery_abm_status[] = { - { 1, "CHRG", NULL, NULL }, - { 2, "DISCHRG", NULL, NULL }, -/* { 3, "Floating", NULL, NULL }, */ -/* { 4, "Resting", NULL, NULL }, */ -/* { 5, "Unknown", NULL, NULL }, */ - { 0, NULL, NULL, NULL } + info_lkp_default(1, "CHRG"), + info_lkp_default(2, "DISCHRG"), +/* + info_lkp_default(3, "Floating"), + info_lkp_default(4, "Resting"), + info_lkp_default(5, "Unknown"), +*/ + info_lkp_sentinel }; static info_lkp_t pw_abm_status_info[] = { - { 1, "charging", NULL, NULL }, - { 2, "discharging", NULL, NULL }, - { 3, "floating", NULL, NULL }, - { 4, "resting", NULL, NULL }, - { 5, "unknown", NULL, NULL }, /* Undefined - ABM is not activated */ - { 6, "disabled", NULL, NULL }, /* ABM Charger Disabled */ - { 0, NULL, NULL, NULL } + info_lkp_default(1, "charging"), + info_lkp_default(2, "discharging"), + info_lkp_default(3, "floating"), + info_lkp_default(4, "resting"), + info_lkp_default(5, "unknown"), /* Undefined - ABM is not activated */ + info_lkp_default(6, "disabled"), /* ABM Charger Disabled */ + info_lkp_sentinel }; static info_lkp_t pw_batt_test_info[] = { - { 1, "Unknown", NULL, NULL }, - { 2, "Done and passed", NULL, NULL }, - { 3, "Done and error", NULL, NULL }, - { 4, "In progress", NULL, NULL }, - { 5, "Not supported", NULL, NULL }, - { 6, "Inhibited", NULL, NULL }, - { 7, "Scheduled", NULL, NULL }, - { 0, NULL, NULL, NULL } + info_lkp_default(1, "Unknown"), + info_lkp_default(2, "Done and passed"), + info_lkp_default(3, "Done and error"), + info_lkp_default(4, "In progress"), + info_lkp_default(5, "Not supported"), + info_lkp_default(6, "Inhibited"), + info_lkp_default(7, "Scheduled"), + info_lkp_sentinel }; static info_lkp_t pw_yes_no_info[] = { - { 1, "yes", NULL, NULL }, - { 2, "no", NULL, NULL }, - { 0, NULL, NULL, NULL } + info_lkp_default(1, "yes"), + info_lkp_default(2, "no"), + info_lkp_sentinel }; static info_lkp_t pw_outlet_status_info[] = { - { 1, "on", NULL, NULL }, - { 2, "off", NULL, NULL }, - { 3, "on", NULL, NULL }, /* pendingOff, transitional status */ - { 4, "off", NULL, NULL }, /* pendingOn, transitional status */ - /* { 5, "", NULL, NULL }, unknown */ - /* { 6, "", NULL, NULL }, reserved */ - { 7, "off", NULL, NULL }, /* Failed in Closed position */ - { 8, "on", NULL, NULL }, /* Failed in Open position */ - { 0, NULL, NULL, NULL } + info_lkp_default(1, "on"), + info_lkp_default(2, "off"), + info_lkp_default(3, "on"), /* pendingOff, transitional status */ + info_lkp_default(4, "off"), /* pendingOn, transitional status */ + /* info_lkp_default(5, ""), // unknown */ + /* info_lkp_default(6, ""), // reserved */ + info_lkp_default(7, "off"), /* Failed in Closed position */ + info_lkp_default(8, "on"), /* Failed in Open position */ + info_lkp_sentinel }; static info_lkp_t pw_ambient_drycontacts_info[] = { - { -1, "unknown", NULL, NULL }, - { 1, "opened", NULL, NULL }, - { 2, "closed", NULL, NULL }, - { 3, "opened", NULL, NULL }, /* openWithNotice */ - { 4, "closed", NULL, NULL }, /* closedWithNotice */ - { 0, NULL, NULL, NULL } + info_lkp_default(-1, "unknown"), + info_lkp_default(1, "opened"), + info_lkp_default(2, "closed"), + info_lkp_default(3, "opened"), /* openWithNotice */ + info_lkp_default(4, "closed"), /* closedWithNotice */ + info_lkp_sentinel }; #if WITH_SNMP_LKP_FUN @@ -270,13 +277,13 @@ const char *su_temperature_read_fun(void *raw_snmp_value) { # endif /* WITH_SNMP_LKP_FUN_DUMMY */ static info_lkp_t pw_sensor_temperature_unit_info[] = { - { 0, "dummy", eaton_sensor_temperature_unit_fun, NULL }, - { 0, NULL, NULL, NULL } + info_lkp_fun_vp2s(0, "dummy", eaton_sensor_temperature_unit_fun), + info_lkp_sentinel }; static info_lkp_t pw_sensor_temperature_read_info[] = { - { 0, "dummy", su_temperature_read_fun, NULL }, - { 0, NULL, NULL, NULL } + info_lkp_fun_vp2s(0, "dummy", su_temperature_read_fun), + info_lkp_sentinel }; #else /* if not WITH_SNMP_LKP_FUN: */ @@ -285,60 +292,60 @@ static info_lkp_t pw_sensor_temperature_read_info[] = { * lookup/mapping tables for this, which can easily go into the DMF XML file. */ static info_lkp_t pw_sensor_temperature_unit_info[] = { - { 0, "kelvin", NULL, NULL }, - { 1, "celsius", NULL, NULL }, - { 2, "fahrenheit", NULL, NULL }, - { 0, NULL, NULL, NULL } + info_lkp_default(0, "kelvin"), + info_lkp_default(1, "celsius"), + info_lkp_default(2, "fahrenheit"), + info_lkp_sentinel }; #endif /* WITH_SNMP_LKP_FUN */ static info_lkp_t pw_ambient_drycontacts_polarity_info[] = { - { 0, "normal-opened", NULL, NULL }, - { 1, "normal-closed", NULL, NULL }, - { 0, NULL, NULL, NULL } + info_lkp_default(0, "normal-opened"), + info_lkp_default(1, "normal-closed"), + info_lkp_sentinel }; static info_lkp_t pw_ambient_drycontacts_state_info[] = { - { 0, "inactive", NULL, NULL }, - { 1, "active", NULL, NULL }, - { 0, NULL, NULL, NULL } + info_lkp_default(0, "inactive"), + info_lkp_default(1, "active"), + info_lkp_sentinel }; static info_lkp_t pw_emp002_ambient_presence_info[] = { - { 0, "unknown", NULL, NULL }, - { 2, "yes", NULL, NULL }, /* communicationOK */ - { 3, "no", NULL, NULL }, /* communicationLost */ - { 0, NULL, NULL, NULL } + info_lkp_default(0, "unknown"), + info_lkp_default(2, "yes"), /* communicationOK */ + info_lkp_default(3, "no"), /* communicationLost */ + info_lkp_sentinel }; /* extracted from drivers/eaton-pdu-marlin-mib.c -> marlin_threshold_status_info */ static info_lkp_t pw_threshold_status_info[] = { - { 0, "good", NULL, NULL }, /* No threshold triggered */ - { 1, "warning-low", NULL, NULL }, /* Warning low threshold triggered */ - { 2, "critical-low", NULL, NULL }, /* Critical low threshold triggered */ - { 3, "warning-high", NULL, NULL }, /* Warning high threshold triggered */ - { 4, "critical-high", NULL, NULL }, /* Critical high threshold triggered */ - { 0, NULL, NULL, NULL } + info_lkp_default(0, "good"), /* No threshold triggered */ + info_lkp_default(1, "warning-low"), /* Warning low threshold triggered */ + info_lkp_default(2, "critical-low"), /* Critical low threshold triggered */ + info_lkp_default(3, "warning-high"), /* Warning high threshold triggered */ + info_lkp_default(4, "critical-high"), /* Critical high threshold triggered */ + info_lkp_sentinel }; /* extracted from drivers/eaton-pdu-marlin-mib.c -> marlin_threshold_xxx_alarms_info */ static info_lkp_t pw_threshold_temperature_alarms_info[] = { - { 0, "", NULL, NULL }, /* No threshold triggered */ - { 1, "low temperature warning!", NULL, NULL }, /* Warning low threshold triggered */ - { 2, "low temperature critical!", NULL, NULL }, /* Critical low threshold triggered */ - { 3, "high temperature warning!", NULL, NULL }, /* Warning high threshold triggered */ - { 4, "high temperature critical!", NULL, NULL }, /* Critical high threshold triggered */ - { 0, NULL, NULL, NULL } + info_lkp_default(0, ""), /* No threshold triggered */ + info_lkp_default(1, "low temperature warning!"), /* Warning low threshold triggered */ + info_lkp_default(2, "low temperature critical!"), /* Critical low threshold triggered */ + info_lkp_default(3, "high temperature warning!"), /* Warning high threshold triggered */ + info_lkp_default(4, "high temperature critical!"), /* Critical high threshold triggered */ + info_lkp_sentinel }; static info_lkp_t pw_threshold_humidity_alarms_info[] = { - { 0, "", NULL, NULL }, /* No threshold triggered */ - { 1, "low humidity warning!", NULL, NULL }, /* Warning low threshold triggered */ - { 2, "low humidity critical!", NULL, NULL }, /* Critical low threshold triggered */ - { 3, "high humidity warning!", NULL, NULL }, /* Warning high threshold triggered */ - { 4, "high humidity critical!", NULL, NULL }, /* Critical high threshold triggered */ - { 0, NULL, NULL, NULL } + info_lkp_default(0, ""), /* No threshold triggered */ + info_lkp_default(1, "low humidity warning!"), /* Warning low threshold triggered */ + info_lkp_default(2, "low humidity critical!"), /* Critical low threshold triggered */ + info_lkp_default(3, "high humidity warning!"), /* Warning high threshold triggered */ + info_lkp_default(4, "high humidity critical!"), /* Critical high threshold triggered */ + info_lkp_sentinel }; /* Snmp2NUT lookup table */ @@ -346,354 +353,356 @@ static info_lkp_t pw_threshold_humidity_alarms_info[] = { static snmp_info_t pw_mib[] = { /* standard MIB items */ - { "device.description", ST_FLAG_STRING | ST_FLAG_RW, SU_INFOSIZE, ".1.3.6.1.2.1.1.1.0", NULL, SU_FLAG_OK, NULL }, - { "device.contact", ST_FLAG_STRING | ST_FLAG_RW, SU_INFOSIZE, ".1.3.6.1.2.1.1.4.0", NULL, SU_FLAG_OK, NULL }, - { "device.location", ST_FLAG_STRING | ST_FLAG_RW, SU_INFOSIZE, ".1.3.6.1.2.1.1.6.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("device.description", ST_FLAG_STRING | ST_FLAG_RW, SU_INFOSIZE, ".1.3.6.1.2.1.1.1.0", NULL, SU_FLAG_OK, NULL), + snmp_info_default("device.contact", ST_FLAG_STRING | ST_FLAG_RW, SU_INFOSIZE, ".1.3.6.1.2.1.1.4.0", NULL, SU_FLAG_OK, NULL), + snmp_info_default("device.location", ST_FLAG_STRING | ST_FLAG_RW, SU_INFOSIZE, ".1.3.6.1.2.1.1.6.0", NULL, SU_FLAG_OK, NULL), /* FIXME: miss device page! */ /* UPS page */ /* info_type, info_flags, info_len, OID, dfl, flags, oid2info, setvar */ - { "ups.mfr", ST_FLAG_STRING, SU_INFOSIZE, PW_OID_MFR_NAME, "", - SU_FLAG_STATIC, NULL }, - { "ups.model", ST_FLAG_STRING, SU_INFOSIZE, PW_OID_MODEL_NAME, "", - SU_FLAG_STATIC, NULL }, + snmp_info_default("ups.mfr", ST_FLAG_STRING, SU_INFOSIZE, PW_OID_MFR_NAME, "", + SU_FLAG_STATIC, NULL), + snmp_info_default("ups.model", ST_FLAG_STRING, SU_INFOSIZE, PW_OID_MODEL_NAME, "", + SU_FLAG_STATIC, NULL), /* FIXME: the 2 "firmware" entries below should be SU_FLAG_SEMI_STATIC */ - { "ups.firmware", ST_FLAG_STRING, SU_INFOSIZE, PW_OID_FIRMREV, "", - 0, NULL }, - { "ups.firmware.aux", ST_FLAG_STRING, SU_INFOSIZE, IETF_OID_AGENTREV, "", - 0, NULL }, - { "ups.serial", ST_FLAG_STRING, SU_INFOSIZE, IETF_OID_IDENT, "", - SU_FLAG_STATIC, NULL }, - { "ups.load", 0, 1.0, PW_OID_OUT_LOAD, "", - 0, NULL }, + snmp_info_default("ups.firmware", ST_FLAG_STRING, SU_INFOSIZE, PW_OID_FIRMREV, "", + 0, NULL), + snmp_info_default("ups.firmware.aux", ST_FLAG_STRING, SU_INFOSIZE, IETF_OID_AGENTREV, "", + 0, NULL), + snmp_info_default("ups.serial", ST_FLAG_STRING, SU_INFOSIZE, IETF_OID_IDENT, "", + SU_FLAG_STATIC, NULL), + snmp_info_default("ups.load", 0, 1.0, PW_OID_OUT_LOAD, "", + 0, NULL), /* FIXME: should be removed in favor of output.power */ - { "ups.power", 0, 1.0, PW_OID_OUT_POWER ".1", "", - 0, NULL }, + snmp_info_default("ups.power", 0, 1.0, PW_OID_OUT_POWER ".1", "", + 0, NULL), /* Duplicate of the above entry, but pointing at the first index */ /* xupsOutputWatts.1.0; Value (Integer): 300 */ - { "ups.power", 0, 1.0, "1.3.6.1.4.1.534.1.4.4.1.4.1.0", "", - 0, NULL }, - - { "ups.status", ST_FLAG_STRING, SU_INFOSIZE, PW_OID_POWER_STATUS, "OFF", - SU_STATUS_PWR, &pw_pwr_info[0] }, - { "ups.status", ST_FLAG_STRING, SU_INFOSIZE, PW_OID_ALARM_OB, "", - SU_STATUS_BATT, &pw_alarm_ob[0] }, - { "ups.status", ST_FLAG_STRING, SU_INFOSIZE, PW_OID_ALARM_LB, "", - SU_STATUS_BATT, &pw_alarm_lb[0] }, - { "ups.status", ST_FLAG_STRING, SU_INFOSIZE, PW_OID_BATT_STATUS, "", - SU_STATUS_BATT, &pw_battery_abm_status[0] }, + snmp_info_default("ups.power", 0, 1.0, "1.3.6.1.4.1.534.1.4.4.1.4.1.0", "", + 0, NULL), + + snmp_info_default("ups.status", ST_FLAG_STRING, SU_INFOSIZE, PW_OID_POWER_STATUS, "OFF", + SU_STATUS_PWR, &pw_pwr_info[0]), + snmp_info_default("ups.status", ST_FLAG_STRING, SU_INFOSIZE, PW_OID_ALARM_OB, "", + SU_STATUS_BATT, &pw_alarm_ob[0]), + snmp_info_default("ups.status", ST_FLAG_STRING, SU_INFOSIZE, PW_OID_ALARM_LB, "", + SU_STATUS_BATT, &pw_alarm_lb[0]), + snmp_info_default("ups.status", ST_FLAG_STRING, SU_INFOSIZE, PW_OID_BATT_STATUS, "", + SU_STATUS_BATT, &pw_battery_abm_status[0]), #if USE_PW_MODE_INFO /* FIXME: should be ups.mode or output.source (need RFC) */ /* Note: this define is not set via project options; code hidden with * commit to "snmp-ups: support newer Genepi management cards" */ - { "experimental.ups.type", ST_FLAG_STRING, SU_INFOSIZE, PW_OID_POWER_STATUS, "", - SU_FLAG_STATIC | SU_FLAG_OK, &pw_mode_info[0] }, + snmp_info_default("experimental.ups.type", ST_FLAG_STRING, SU_INFOSIZE, PW_OID_POWER_STATUS, "", + SU_FLAG_STATIC | SU_FLAG_OK, &pw_mode_info[0]), #endif /* USE_PW_MODE_INFO */ /* xupsTopologyType.0; Value (Integer): 32 */ - { "ups.type", ST_FLAG_STRING, SU_INFOSIZE, "1.3.6.1.4.1.534.1.13.1.0", "", - SU_FLAG_STATIC | SU_FLAG_OK, &pw_topology_info[0] }, + snmp_info_default("ups.type", ST_FLAG_STRING, SU_INFOSIZE, "1.3.6.1.4.1.534.1.13.1.0", "", + SU_FLAG_STATIC | SU_FLAG_OK, &pw_topology_info[0]), /* FIXME: should be removed in favor of their output. equivalent! */ - { "ups.realpower.nominal", 0, 1.0, PW_OID_CONF_POWER, "", - 0, NULL }, + snmp_info_default("ups.realpower.nominal", 0, 1.0, PW_OID_CONF_POWER, "", + 0, NULL), /* FIXME: should be removed in favor of output.power.nominal */ - { "ups.power.nominal", 0, 1.0, IETF_OID_CONF_OUT_VA, "", - 0, NULL }, + snmp_info_default("ups.power.nominal", 0, 1.0, IETF_OID_CONF_OUT_VA, "", + 0, NULL), /* XUPS-MIB::xupsEnvAmbientTemp.0 */ - { "ups.temperature", 0, 1.0, "1.3.6.1.4.1.534.1.6.1.0", "", 0, NULL }, + snmp_info_default("ups.temperature", 0, 1.0, "1.3.6.1.4.1.534.1.6.1.0", "", 0, NULL), /* FIXME: These 2 data needs RFC! */ /* XUPS-MIB::xupsEnvAmbientLowerLimit.0 */ - { "ups.temperature.low", ST_FLAG_RW, 1.0, "1.3.6.1.4.1.534.1.6.2.0", "", 0, NULL }, + snmp_info_default("ups.temperature.low", ST_FLAG_RW, 1.0, "1.3.6.1.4.1.534.1.6.2.0", "", 0, NULL), /* XUPS-MIB::xupsEnvAmbientUpperLimit.0 */ - { "ups.temperature.high", ST_FLAG_RW, 1.0, "1.3.6.1.4.1.534.1.6.3.0", "", 0, NULL }, + snmp_info_default("ups.temperature.high", ST_FLAG_RW, 1.0, "1.3.6.1.4.1.534.1.6.3.0", "", 0, NULL), /* XUPS-MIB::xupsTestBatteryStatus */ - { "ups.test.result", ST_FLAG_STRING, SU_INFOSIZE, "1.3.6.1.4.1.534.1.8.2.0", "", 0, &pw_batt_test_info[0] }, + snmp_info_default("ups.test.result", ST_FLAG_STRING, SU_INFOSIZE, "1.3.6.1.4.1.534.1.8.2.0", "", 0, &pw_batt_test_info[0]), /* UPS-MIB::upsAutoRestart */ - { "ups.start.auto", ST_FLAG_RW | ST_FLAG_STRING, SU_INFOSIZE, "1.3.6.1.2.1.33.1.8.5.0", "", SU_FLAG_OK, &pw_yes_no_info[0] }, + snmp_info_default("ups.start.auto", ST_FLAG_RW | ST_FLAG_STRING, SU_INFOSIZE, "1.3.6.1.2.1.33.1.8.5.0", "", SU_FLAG_OK, &pw_yes_no_info[0]), /* XUPS-MIB::xupsBatteryAbmStatus.0 */ - { "battery.charger.status", ST_FLAG_STRING, SU_INFOSIZE, "1.3.6.1.4.1.534.1.2.5.0", "", SU_STATUS_BATT, &pw_abm_status_info[0] }, + snmp_info_default("battery.charger.status", ST_FLAG_STRING, SU_INFOSIZE, "1.3.6.1.4.1.534.1.2.5.0", "", SU_STATUS_BATT, &pw_abm_status_info[0]), /* Battery page */ - { "battery.charge", 0, 1.0, PW_OID_BATT_CHARGE, "", - 0, NULL }, - { "battery.runtime", 0, 1.0, PW_OID_BATT_RUNTIME, "", - 0, NULL }, - { "battery.voltage", 0, 1.0, PW_OID_BATT_VOLTAGE, "", - 0, NULL }, - { "battery.current", 0, 0.1, PW_OID_BATT_CURRENT, "", - 0, NULL }, - { "battery.runtime.low", 0, 60.0, IETF_OID_CONF_RUNTIME_LOW, "", - 0, NULL }, - { "battery.date", ST_FLAG_RW | ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.1.2.6.0", NULL, SU_FLAG_OK, &su_convert_to_iso_date_info[FUNMAP_USDATE_TO_ISODATE] }, + snmp_info_default("battery.charge", 0, 1.0, PW_OID_BATT_CHARGE, "", + 0, NULL), + snmp_info_default("battery.runtime", 0, 1.0, PW_OID_BATT_RUNTIME, "", + 0, NULL), + snmp_info_default("battery.voltage", 0, 1.0, PW_OID_BATT_VOLTAGE, "", + 0, NULL), + snmp_info_default("battery.current", 0, 0.1, PW_OID_BATT_CURRENT, "", + 0, NULL), + snmp_info_default("battery.runtime.low", 0, 60.0, IETF_OID_CONF_RUNTIME_LOW, "", + 0, NULL), + snmp_info_default("battery.date", ST_FLAG_RW | ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.1.2.6.0", NULL, SU_FLAG_OK, &su_convert_to_iso_date_info[FUNMAP_USDATE_TO_ISODATE]), /* Output page */ - { "output.phases", 0, 1.0, PW_OID_OUT_LINES, "", 0, NULL }, + snmp_info_default("output.phases", 0, 1.0, PW_OID_OUT_LINES, "", 0, NULL), /* XUPS-MIB::xupsOutputFrequency.0 */ - { "output.frequency", 0, 0.1, "1.3.6.1.4.1.534.1.4.2.0", "", 0, NULL }, + snmp_info_default("output.frequency", 0, 0.1, "1.3.6.1.4.1.534.1.4.2.0", "", 0, NULL), /* XUPS-MIB::xupsConfigOutputFreq.0 */ - { "output.frequency.nominal", 0, 0.1, "1.3.6.1.4.1.534.1.10.4.0", "", 0, NULL }, + snmp_info_default("output.frequency.nominal", 0, 0.1, "1.3.6.1.4.1.534.1.10.4.0", "", 0, NULL), /* XUPS-MIB::xupsOutputVoltage.1 */ - { "output.voltage", 0, 1.0, "1.3.6.1.4.1.534.1.4.4.1.2.1", "", SU_OUTPUT_1, NULL }, + snmp_info_default("output.voltage", 0, 1.0, "1.3.6.1.4.1.534.1.4.4.1.2.1", "", SU_OUTPUT_1, NULL), /* Duplicate of the above entry, but pointing at the first index */ /* xupsOutputVoltage.1.0; Value (Integer): 230 */ - { "output.voltage", 0, 1.0, "1.3.6.1.4.1.534.1.4.4.1.2.1.0", "", SU_OUTPUT_1, NULL }, + snmp_info_default("output.voltage", 0, 1.0, "1.3.6.1.4.1.534.1.4.4.1.2.1.0", "", SU_OUTPUT_1, NULL), /* XUPS-MIB::xupsConfigOutputVoltage.0 */ - { "output.voltage.nominal", 0, 1.0, "1.3.6.1.4.1.534.1.10.1.0", "", 0, NULL }, + snmp_info_default("output.voltage.nominal", 0, 1.0, "1.3.6.1.4.1.534.1.10.1.0", "", 0, NULL), /* XUPS-MIB::xupsConfigLowOutputVoltageLimit.0 */ - { "output.voltage.low", 0, 1.0, ".1.3.6.1.4.1.534.1.10.6.0", "", 0, NULL }, + snmp_info_default("output.voltage.low", 0, 1.0, ".1.3.6.1.4.1.534.1.10.6.0", "", 0, NULL), /* XUPS-MIB::xupsConfigHighOutputVoltageLimit.0 */ - { "output.voltage.high", 0, 1.0, ".1.3.6.1.4.1.534.1.10.7.0", "", 0, NULL }, - { "output.current", 0, 1.0, PW_OID_OUT_CURRENT ".1", "", - SU_OUTPUT_1, NULL }, + snmp_info_default("output.voltage.high", 0, 1.0, ".1.3.6.1.4.1.534.1.10.7.0", "", 0, NULL), + snmp_info_default("output.current", 0, 1.0, PW_OID_OUT_CURRENT ".1", "", + SU_OUTPUT_1, NULL), /* Duplicate of the above entry, but pointing at the first index */ /* xupsOutputCurrent.1.0; Value (Integer): 0 */ - { "output.current", 0, 1.0, "1.3.6.1.4.1.534.1.4.4.1.3.1.0", "", - SU_OUTPUT_1, NULL }, - { "output.realpower", 0, 1.0, PW_OID_OUT_POWER ".1", "", - SU_OUTPUT_1, NULL }, + snmp_info_default("output.current", 0, 1.0, "1.3.6.1.4.1.534.1.4.4.1.3.1.0", "", + SU_OUTPUT_1, NULL), + snmp_info_default("output.realpower", 0, 1.0, PW_OID_OUT_POWER ".1", "", + SU_OUTPUT_1, NULL), /* Duplicate of the above entry, but pointing at the first index */ /* Name/OID: xupsOutputWatts.1.0; Value (Integer): 1200 */ - { "output.realpower", 0, 1.0, "1.3.6.1.4.1.534.1.4.4.1.4.1.0", "", - 0, NULL }, + snmp_info_default("output.realpower", 0, 1.0, "1.3.6.1.4.1.534.1.4.4.1.4.1.0", "", + 0, NULL), /* Duplicate of "ups.realpower.nominal" * FIXME: map either ups or output, but not both (or have an auto-remap) */ - { "output.realpower.nominal", 0, 1.0, PW_OID_CONF_POWER, "", - 0, NULL }, - { "output.L1-N.voltage", 0, 1.0, PW_OID_OUT_VOLTAGE ".1", "", - SU_OUTPUT_3, NULL }, - { "output.L2-N.voltage", 0, 1.0, PW_OID_OUT_VOLTAGE ".2", "", - SU_OUTPUT_3, NULL }, - { "output.L3-N.voltage", 0, 1.0, PW_OID_OUT_VOLTAGE ".3", "", - SU_OUTPUT_3, NULL }, - { "output.L1.current", 0, 1.0, PW_OID_OUT_CURRENT ".1", "", - SU_OUTPUT_3, NULL }, - { "output.L2.current", 0, 1.0, PW_OID_OUT_CURRENT ".2", "", - SU_OUTPUT_3, NULL }, - { "output.L3.current", 0, 1.0, PW_OID_OUT_CURRENT ".3", "", - SU_OUTPUT_3, NULL }, - { "output.L1.realpower", 0, 1.0, PW_OID_OUT_POWER ".1", "", - SU_OUTPUT_3, NULL }, - { "output.L2.realpower", 0, 1.0, PW_OID_OUT_POWER ".2", "", - SU_OUTPUT_3, NULL }, - { "output.L3.realpower", 0, 1.0, PW_OID_OUT_POWER ".3", "", - SU_OUTPUT_3, NULL }, + snmp_info_default("output.realpower.nominal", 0, 1.0, PW_OID_CONF_POWER, "", + 0, NULL), + snmp_info_default("output.L1-N.voltage", 0, 1.0, PW_OID_OUT_VOLTAGE ".1", "", + SU_OUTPUT_3, NULL), + snmp_info_default("output.L2-N.voltage", 0, 1.0, PW_OID_OUT_VOLTAGE ".2", "", + SU_OUTPUT_3, NULL), + snmp_info_default("output.L3-N.voltage", 0, 1.0, PW_OID_OUT_VOLTAGE ".3", "", + SU_OUTPUT_3, NULL), + snmp_info_default("output.L1.current", 0, 1.0, PW_OID_OUT_CURRENT ".1", "", + SU_OUTPUT_3, NULL), + snmp_info_default("output.L2.current", 0, 1.0, PW_OID_OUT_CURRENT ".2", "", + SU_OUTPUT_3, NULL), + snmp_info_default("output.L3.current", 0, 1.0, PW_OID_OUT_CURRENT ".3", "", + SU_OUTPUT_3, NULL), + snmp_info_default("output.L1.realpower", 0, 1.0, PW_OID_OUT_POWER ".1", "", + SU_OUTPUT_3, NULL), + snmp_info_default("output.L2.realpower", 0, 1.0, PW_OID_OUT_POWER ".2", "", + SU_OUTPUT_3, NULL), + snmp_info_default("output.L3.realpower", 0, 1.0, PW_OID_OUT_POWER ".3", "", + SU_OUTPUT_3, NULL), /* FIXME: should better be output.Lx.load */ - { "output.L1.power.percent", 0, 1.0, IETF_OID_LOAD_LEVEL ".1", "", - SU_OUTPUT_3, NULL }, - { "output.L2.power.percent", 0, 1.0, IETF_OID_LOAD_LEVEL ".2", "", - SU_OUTPUT_3, NULL }, - { "output.L3.power.percent", 0, 1.0, IETF_OID_LOAD_LEVEL ".3", "", - SU_OUTPUT_3, NULL }, - { "output.voltage.nominal", 0, 1.0, PW_OID_CONF_OVOLTAGE, "", - 0, NULL }, + snmp_info_default("output.L1.power.percent", 0, 1.0, IETF_OID_LOAD_LEVEL ".1", "", + SU_OUTPUT_3, NULL), + snmp_info_default("output.L2.power.percent", 0, 1.0, IETF_OID_LOAD_LEVEL ".2", "", + SU_OUTPUT_3, NULL), + snmp_info_default("output.L3.power.percent", 0, 1.0, IETF_OID_LOAD_LEVEL ".3", "", + SU_OUTPUT_3, NULL), + snmp_info_default("output.voltage.nominal", 0, 1.0, PW_OID_CONF_OVOLTAGE, "", + 0, NULL), /* Input page */ - { "input.phases", 0, 1.0, PW_OID_IN_LINES, "", - 0, NULL }, - { "input.frequency", 0, 0.1, PW_OID_IN_FREQUENCY, "", - 0, NULL }, - { "input.voltage", 0, 1.0, PW_OID_IN_VOLTAGE ".0", "", - SU_INPUT_1, NULL }, + snmp_info_default("input.phases", 0, 1.0, PW_OID_IN_LINES, "", + 0, NULL), + snmp_info_default("input.frequency", 0, 0.1, PW_OID_IN_FREQUENCY, "", + 0, NULL), + snmp_info_default("input.voltage", 0, 1.0, PW_OID_IN_VOLTAGE ".0", "", + SU_INPUT_1, NULL), /* Duplicate of the above entry, but pointing at the first index */ /* xupsInputVoltage.1[.0]; Value (Integer): 245 */ - { "input.voltage", 0, 1.0, "1.3.6.1.4.1.534.1.3.4.1.2.1", "", - SU_INPUT_1, NULL }, + snmp_info_default("input.voltage", 0, 1.0, "1.3.6.1.4.1.534.1.3.4.1.2.1", "", + SU_INPUT_1, NULL), /* XUPS-MIB::xupsConfigInputVoltage.0 */ - { "input.voltage.nominal", 0, 1.0, "1.3.6.1.4.1.534.1.10.2.0", "", 0, NULL }, - { "input.current", 0, 0.1, PW_OID_IN_CURRENT ".0", "", - SU_INPUT_1, NULL }, - { "input.L1-N.voltage", 0, 1.0, PW_OID_IN_VOLTAGE ".1", "", - SU_INPUT_3, NULL }, - { "input.L2-N.voltage", 0, 1.0, PW_OID_IN_VOLTAGE ".2", "", - SU_INPUT_3, NULL }, - { "input.L3-N.voltage", 0, 1.0, PW_OID_IN_VOLTAGE ".3", "", - SU_INPUT_3, NULL }, - { "input.L1.current", 0, 1.0, PW_OID_IN_CURRENT ".1", "", - SU_INPUT_3, NULL }, - { "input.L2.current", 0, 1.0, PW_OID_IN_CURRENT ".2", "", - SU_INPUT_3, NULL }, - { "input.L3.current", 0, 1.0, PW_OID_IN_CURRENT ".3", "", - SU_INPUT_3, NULL }, - { "input.L1.realpower", 0, 1.0, PW_OID_IN_POWER ".1", "", - SU_INPUT_3, NULL }, - { "input.L2.realpower", 0, 1.0, PW_OID_IN_POWER ".2", "", - SU_INPUT_3, NULL }, - { "input.L3.realpower", 0, 1.0, PW_OID_IN_POWER ".3", "", - SU_INPUT_3, NULL }, - { "input.quality", 0, 1.0, PW_OID_IN_LINE_BADS, "", - 0, NULL }, + snmp_info_default("input.voltage.nominal", 0, 1.0, "1.3.6.1.4.1.534.1.10.2.0", "", 0, NULL), + snmp_info_default("input.current", 0, 0.1, PW_OID_IN_CURRENT ".0", "", + SU_INPUT_1, NULL), + snmp_info_default("input.L1-N.voltage", 0, 1.0, PW_OID_IN_VOLTAGE ".1", "", + SU_INPUT_3, NULL), + snmp_info_default("input.L2-N.voltage", 0, 1.0, PW_OID_IN_VOLTAGE ".2", "", + SU_INPUT_3, NULL), + snmp_info_default("input.L3-N.voltage", 0, 1.0, PW_OID_IN_VOLTAGE ".3", "", + SU_INPUT_3, NULL), + snmp_info_default("input.L1.current", 0, 1.0, PW_OID_IN_CURRENT ".1", "", + SU_INPUT_3, NULL), + snmp_info_default("input.L2.current", 0, 1.0, PW_OID_IN_CURRENT ".2", "", + SU_INPUT_3, NULL), + snmp_info_default("input.L3.current", 0, 1.0, PW_OID_IN_CURRENT ".3", "", + SU_INPUT_3, NULL), + snmp_info_default("input.L1.realpower", 0, 1.0, PW_OID_IN_POWER ".1", "", + SU_INPUT_3, NULL), + snmp_info_default("input.L2.realpower", 0, 1.0, PW_OID_IN_POWER ".2", "", + SU_INPUT_3, NULL), + snmp_info_default("input.L3.realpower", 0, 1.0, PW_OID_IN_POWER ".3", "", + SU_INPUT_3, NULL), + snmp_info_default("input.quality", 0, 1.0, PW_OID_IN_LINE_BADS, "", + 0, NULL), /* FIXME: this segfaults! do we assume the same number of bypass phases as input phases? - { "input.bypass.phases", 0, 1.0, PW_OID_BY_LINES, "", 0, NULL }, */ - { "input.bypass.frequency", 0, 0.1, PW_OID_BY_FREQUENCY, "", 0, NULL }, - { "input.bypass.voltage", 0, 1.0, PW_OID_BY_VOLTAGE ".0", "", - SU_INPUT_1, NULL }, + snmp_info_default("input.bypass.phases", 0, 1.0, PW_OID_BY_LINES, "", 0, NULL), */ + snmp_info_default("input.bypass.frequency", 0, 0.1, PW_OID_BY_FREQUENCY, "", 0, NULL), + snmp_info_default("input.bypass.voltage", 0, 1.0, PW_OID_BY_VOLTAGE ".0", "", + SU_INPUT_1, NULL), /* Duplicate of the above entry, but pointing at the first index */ /* xupsBypassVoltage.1.0; Value (Integer): 244 */ - { "input.bypass.voltage", 0, 1.0, "1.3.6.1.4.1.534.1.5.3.1.2.1.0", "", - SU_INPUT_1, NULL }, - { "input.bypass.L1-N.voltage", 0, 1.0, PW_OID_BY_VOLTAGE ".1", "", - SU_INPUT_3, NULL }, - { "input.bypass.L2-N.voltage", 0, 1.0, PW_OID_BY_VOLTAGE ".2", "", - SU_INPUT_3, NULL }, - { "input.bypass.L3-N.voltage", 0, 1.0, PW_OID_BY_VOLTAGE ".3", "", - SU_INPUT_3, NULL }, + snmp_info_default("input.bypass.voltage", 0, 1.0, "1.3.6.1.4.1.534.1.5.3.1.2.1.0", "", + SU_INPUT_1, NULL), + snmp_info_default("input.bypass.L1-N.voltage", 0, 1.0, PW_OID_BY_VOLTAGE ".1", "", + SU_INPUT_3, NULL), + snmp_info_default("input.bypass.L2-N.voltage", 0, 1.0, PW_OID_BY_VOLTAGE ".2", "", + SU_INPUT_3, NULL), + snmp_info_default("input.bypass.L3-N.voltage", 0, 1.0, PW_OID_BY_VOLTAGE ".3", "", + SU_INPUT_3, NULL), /* Outlet page */ - /* Master outlet id always equal to 0 */ - { "outlet.id", 0, 1, NULL, "0", SU_FLAG_STATIC , NULL }, - /* XUPS-MIB:: xupsSwitchable.0 */ - { "outlet.switchable", 0, 1, ".1.3.6.1.4.1.534.1.9.7.0", NULL, SU_FLAG_STATIC , &pw_yes_no_info[0] }, + /* Master outlet id always equal to 0 */ + snmp_info_default("outlet.id", 0, 1, NULL, "0", SU_FLAG_STATIC , NULL), + /* XUPS-MIB:: xupsSwitchable.0 */ + snmp_info_default("outlet.switchable", 0, 1, ".1.3.6.1.4.1.534.1.9.7.0", NULL, SU_FLAG_STATIC , &pw_yes_no_info[0]), /* XUPS-MIB::xupsNumReceptacles; Value (Integer): 2 */ - { "outlet.count", 0, 1, ".1.3.6.1.4.1.534.1.12.1.0", NULL, SU_FLAG_STATIC, NULL }, + snmp_info_default("outlet.count", 0, 1, ".1.3.6.1.4.1.534.1.12.1.0", NULL, SU_FLAG_STATIC, NULL), /* XUPS-MIB::xupsRecepIndex.X; Value (Integer): X */ - { "outlet.%i.id", 0, 1, ".1.3.6.1.4.1.534.1.12.2.1.1.%i", NULL, SU_FLAG_STATIC | SU_OUTLET, NULL }, + snmp_info_default("outlet.%i.id", 0, 1, ".1.3.6.1.4.1.534.1.12.2.1.1.%i", NULL, SU_FLAG_STATIC | SU_OUTLET, NULL), /* This MIB does not provide outlets switchability info. So map to a nearby OID, for data activation, and map all values to "yes" */ - { "outlet.%i.switchable", 0, 1, ".1.3.6.1.4.1.534.1.12.2.1.1.%i", NULL, SU_FLAG_STATIC | SU_OUTLET, NULL }, + snmp_info_default("outlet.%i.switchable", 0, 1, ".1.3.6.1.4.1.534.1.12.2.1.1.%i", NULL, SU_FLAG_STATIC | SU_OUTLET, NULL), /* XUPS-MIB::xupsRecepStatus.X; Value (Integer): 1 */ - { "outlet.%i.status", 0, 1, ".1.3.6.1.4.1.534.1.12.2.1.2.%i", NULL, SU_OUTLET, &pw_outlet_status_info[0] }, + snmp_info_default("outlet.%i.status", 0, 1, ".1.3.6.1.4.1.534.1.12.2.1.2.%i", NULL, SU_OUTLET, &pw_outlet_status_info[0]), /* Ambient collection */ /* EMP001 (legacy) mapping */ /* XUPS-MIB::xupsEnvRemoteTemp.0 */ - { "ambient.temperature", 0, 1.0, "1.3.6.1.4.1.534.1.6.5.0", "", 0, NULL }, + snmp_info_default("ambient.temperature", 0, 1.0, "1.3.6.1.4.1.534.1.6.5.0", "", 0, NULL), /* XUPS-MIB::xupsEnvRemoteTempLowerLimit.0 */ - { "ambient.temperature.low", ST_FLAG_RW, 1.0, "1.3.6.1.4.1.534.1.6.9.0", "", 0, NULL }, + snmp_info_default("ambient.temperature.low", ST_FLAG_RW, 1.0, "1.3.6.1.4.1.534.1.6.9.0", "", 0, NULL), /* XUPS-MIB::xupsEnvRemoteTempUpperLimit.0 */ - { "ambient.temperature.high", ST_FLAG_RW, 1.0, "1.3.6.1.4.1.534.1.6.10.0", "", 0, NULL }, + snmp_info_default("ambient.temperature.high", ST_FLAG_RW, 1.0, "1.3.6.1.4.1.534.1.6.10.0", "", 0, NULL), /* XUPS-MIB::xupsEnvRemoteHumidity.0 */ - { "ambient.humidity", 0, 1.0, "1.3.6.1.4.1.534.1.6.6.0", "", 0, NULL }, + snmp_info_default("ambient.humidity", 0, 1.0, "1.3.6.1.4.1.534.1.6.6.0", "", 0, NULL), /* XUPS-MIB::xupsEnvRemoteHumidityLowerLimit.0 */ - { "ambient.humidity.low", ST_FLAG_RW, 1.0, "1.3.6.1.4.1.534.1.6.11.0", "", 0, NULL }, + snmp_info_default("ambient.humidity.low", ST_FLAG_RW, 1.0, "1.3.6.1.4.1.534.1.6.11.0", "", 0, NULL), /* XUPS-MIB::xupsEnvRemoteHumidityUpperLimit.0 */ - { "ambient.humidity.high", ST_FLAG_RW, 1.0, "1.3.6.1.4.1.534.1.6.12.0", "", 0, NULL }, + snmp_info_default("ambient.humidity.high", ST_FLAG_RW, 1.0, "1.3.6.1.4.1.534.1.6.12.0", "", 0, NULL), /* XUPS-MIB::xupsContactDescr.n */ - { "ambient.contacts.1.name", ST_FLAG_STRING, 1.0, ".1.3.6.1.4.1.534.1.6.8.1.4.1", "", 0, NULL }, - { "ambient.contacts.2.name", ST_FLAG_STRING, 1.0, ".1.3.6.1.4.1.534.1.6.8.1.4.2", "", 0, NULL }, + snmp_info_default("ambient.contacts.1.name", ST_FLAG_STRING, 1.0, ".1.3.6.1.4.1.534.1.6.8.1.4.1", "", 0, NULL), + snmp_info_default("ambient.contacts.2.name", ST_FLAG_STRING, 1.0, ".1.3.6.1.4.1.534.1.6.8.1.4.2", "", 0, NULL), /* XUPS-MIB::xupsContactState.n */ - { "ambient.contacts.1.status", ST_FLAG_STRING, 1.0, ".1.3.6.1.4.1.534.1.6.8.1.3.1", "", 0, &pw_ambient_drycontacts_info[0] }, - { "ambient.contacts.2.status", ST_FLAG_STRING, 1.0, ".1.3.6.1.4.1.534.1.6.8.1.3.2", "", 0, &pw_ambient_drycontacts_info[0] }, + snmp_info_default("ambient.contacts.1.status", ST_FLAG_STRING, 1.0, ".1.3.6.1.4.1.534.1.6.8.1.3.1", "", 0, &pw_ambient_drycontacts_info[0]), + snmp_info_default("ambient.contacts.2.status", ST_FLAG_STRING, 1.0, ".1.3.6.1.4.1.534.1.6.8.1.3.2", "", 0, &pw_ambient_drycontacts_info[0]), /* EMP002 (EATON EMP MIB) mapping, including daisychain support */ /* Warning: indexes start at '1' not '0'! */ /* sensorCount.0 */ - { "ambient.count", ST_FLAG_RW, 1.0, ".1.3.6.1.4.1.534.6.8.1.1.1.0", "", 0, NULL }, + snmp_info_default("ambient.count", ST_FLAG_RW, 1.0, ".1.3.6.1.4.1.534.6.8.1.1.1.0", "", 0, NULL), /* CommunicationStatus.n */ - { "ambient.%i.present", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.6.8.1.1.4.1.1.%i", - NULL, SU_AMBIENT_TEMPLATE, &pw_emp002_ambient_presence_info[0] }, + snmp_info_default("ambient.%i.present", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.6.8.1.1.4.1.1.%i", + NULL, SU_AMBIENT_TEMPLATE, &pw_emp002_ambient_presence_info[0]), /* sensorName.n: OctetString EMPDT1H1C2 @1 */ - { "ambient.%i.name", ST_FLAG_STRING, 1.0, ".1.3.6.1.4.1.534.6.8.1.1.3.1.1.%i", "", SU_AMBIENT_TEMPLATE, NULL }, + snmp_info_default("ambient.%i.name", ST_FLAG_STRING, 1.0, ".1.3.6.1.4.1.534.6.8.1.1.3.1.1.%i", "", SU_AMBIENT_TEMPLATE, NULL), /* sensorManufacturer.n */ - { "ambient.%i.mfr", ST_FLAG_STRING, 1.0, ".1.3.6.1.4.1.534.6.8.1.1.2.1.6.%i", "", SU_AMBIENT_TEMPLATE, NULL }, + snmp_info_default("ambient.%i.mfr", ST_FLAG_STRING, 1.0, ".1.3.6.1.4.1.534.6.8.1.1.2.1.6.%i", "", SU_AMBIENT_TEMPLATE, NULL), /* sensorModel.n */ - { "ambient.%i.model", ST_FLAG_STRING, 1.0, ".1.3.6.1.4.1.534.6.8.1.1.2.1.7.%i", "", SU_AMBIENT_TEMPLATE, NULL }, + snmp_info_default("ambient.%i.model", ST_FLAG_STRING, 1.0, ".1.3.6.1.4.1.534.6.8.1.1.2.1.7.%i", "", SU_AMBIENT_TEMPLATE, NULL), /* sensorSerialNumber.n */ - { "ambient.%i.serial", ST_FLAG_STRING, 1.0, ".1.3.6.1.4.1.534.6.8.1.1.2.1.9.%i", "", SU_AMBIENT_TEMPLATE, NULL }, + snmp_info_default("ambient.%i.serial", ST_FLAG_STRING, 1.0, ".1.3.6.1.4.1.534.6.8.1.1.2.1.9.%i", "", SU_AMBIENT_TEMPLATE, NULL), /* sensorUuid.n */ - { "ambient.%i.id", ST_FLAG_STRING, 1.0, ".1.3.6.1.4.1.534.6.8.1.1.2.1.2.%i", "", SU_AMBIENT_TEMPLATE, NULL }, + snmp_info_default("ambient.%i.id", ST_FLAG_STRING, 1.0, ".1.3.6.1.4.1.534.6.8.1.1.2.1.2.%i", "", SU_AMBIENT_TEMPLATE, NULL), /* sensorAddress.n */ - { "ambient.%i.address", 0, 1, ".1.3.6.1.4.1.534.6.8.1.1.2.1.4.%i", "", SU_AMBIENT_TEMPLATE, NULL }, + snmp_info_default("ambient.%i.address", 0, 1, ".1.3.6.1.4.1.534.6.8.1.1.2.1.4.%i", "", SU_AMBIENT_TEMPLATE, NULL), /* sensorFirmwareVersion.n */ - { "ambient.%i.firmware", ST_FLAG_STRING, 1.0, ".1.3.6.1.4.1.534.6.8.1.1.2.1.10.%i", "", SU_AMBIENT_TEMPLATE, NULL }, + snmp_info_default("ambient.%i.firmware", ST_FLAG_STRING, 1.0, ".1.3.6.1.4.1.534.6.8.1.1.2.1.10.%i", "", SU_AMBIENT_TEMPLATE, NULL), /* temperatureUnit.1 * MUST be before the temperature data reading! */ - { "ambient.%i.temperature.unit", 0, 1.0, ".1.3.6.1.4.1.534.6.8.1.2.5.0", "", SU_AMBIENT_TEMPLATE, &pw_sensor_temperature_unit_info[0] }, + snmp_info_default("ambient.%i.temperature.unit", 0, 1.0, ".1.3.6.1.4.1.534.6.8.1.2.5.0", "", SU_AMBIENT_TEMPLATE, &pw_sensor_temperature_unit_info[0]), + /* temperatureValue.n.1 */ - { "ambient.%i.temperature", 0, 0.1, ".1.3.6.1.4.1.534.6.8.1.2.3.1.3.%i.1", "", SU_AMBIENT_TEMPLATE, #if WITH_SNMP_LKP_FUN - &pw_sensor_temperature_read_info[0] + snmp_info_default("ambient.%i.temperature", 0, 0.1, ".1.3.6.1.4.1.534.6.8.1.2.3.1.3.%i.1", "", SU_AMBIENT_TEMPLATE, + &pw_sensor_temperature_read_info[0]), #else - NULL + snmp_info_default("ambient.%i.temperature", 0, 0.1, ".1.3.6.1.4.1.534.6.8.1.2.3.1.3.%i.1", "", SU_AMBIENT_TEMPLATE, + NULL), #endif - }, - { "ambient.%i.temperature.status", ST_FLAG_STRING, SU_INFOSIZE, + + snmp_info_default("ambient.%i.temperature.status", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.6.8.1.2.3.1.1.%i.1", - NULL, SU_AMBIENT_TEMPLATE, &pw_threshold_status_info[0] }, - { "ups.alarm", ST_FLAG_STRING, SU_INFOSIZE, + NULL, SU_AMBIENT_TEMPLATE, &pw_threshold_status_info[0]), + snmp_info_default("ups.alarm", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.6.8.1.2.3.1.1.%i.1", - NULL, SU_AMBIENT_TEMPLATE, &pw_threshold_temperature_alarms_info[0] }, + NULL, SU_AMBIENT_TEMPLATE, &pw_threshold_temperature_alarms_info[0]), /* FIXME: ambient.n.temperature.{minimum,maximum} */ /* temperatureThresholdLowCritical.n.1 */ - { "ambient.%i.temperature.low.critical", ST_FLAG_RW, 0.1, ".1.3.6.1.4.1.534.6.8.1.2.2.1.6.%i.1", "", SU_AMBIENT_TEMPLATE, NULL }, + snmp_info_default("ambient.%i.temperature.low.critical", ST_FLAG_RW, 0.1, ".1.3.6.1.4.1.534.6.8.1.2.2.1.6.%i.1", "", SU_AMBIENT_TEMPLATE, NULL), /* temperatureThresholdLowWarning.n.1 */ - { "ambient.%i.temperature.low.warning", ST_FLAG_RW, 0.1, ".1.3.6.1.4.1.534.6.8.1.2.2.1.5.%i.1", "", SU_AMBIENT_TEMPLATE, NULL }, + snmp_info_default("ambient.%i.temperature.low.warning", ST_FLAG_RW, 0.1, ".1.3.6.1.4.1.534.6.8.1.2.2.1.5.%i.1", "", SU_AMBIENT_TEMPLATE, NULL), /* temperatureThresholdHighWarning.n.1 */ - { "ambient.%i.temperature.high.warning", ST_FLAG_RW, 0.1, ".1.3.6.1.4.1.534.6.8.1.2.2.1.7.%i.1", "", SU_AMBIENT_TEMPLATE, NULL }, + snmp_info_default("ambient.%i.temperature.high.warning", ST_FLAG_RW, 0.1, ".1.3.6.1.4.1.534.6.8.1.2.2.1.7.%i.1", "", SU_AMBIENT_TEMPLATE, NULL), /* temperatureThresholdHighCritical.n.1 */ - { "ambient.%i.temperature.high.critical", ST_FLAG_RW, 0.1, ".1.3.6.1.4.1.534.6.8.1.2.2.1.8.%i.1", "", SU_AMBIENT_TEMPLATE, NULL }, + snmp_info_default("ambient.%i.temperature.high.critical", ST_FLAG_RW, 0.1, ".1.3.6.1.4.1.534.6.8.1.2.2.1.8.%i.1", "", SU_AMBIENT_TEMPLATE, NULL), /* humidityValue.n.1 */ - { "ambient.%i.humidity", 0, 0.1, ".1.3.6.1.4.1.534.6.8.1.3.3.1.3.%i.1", "", SU_AMBIENT_TEMPLATE, NULL }, - { "ambient.%i.humidity.status", ST_FLAG_STRING, SU_INFOSIZE, + snmp_info_default("ambient.%i.humidity", 0, 0.1, ".1.3.6.1.4.1.534.6.8.1.3.3.1.3.%i.1", "", SU_AMBIENT_TEMPLATE, NULL), + snmp_info_default("ambient.%i.humidity.status", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.6.8.1.3.3.1.1.%i.1", - NULL, SU_AMBIENT_TEMPLATE, &pw_threshold_status_info[0] }, - { "ups.alarm", ST_FLAG_STRING, SU_INFOSIZE, + NULL, SU_AMBIENT_TEMPLATE, &pw_threshold_status_info[0]), + snmp_info_default("ups.alarm", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.6.8.1.3.3.1.1.%i.1", - NULL, SU_AMBIENT_TEMPLATE, &pw_threshold_humidity_alarms_info[0] }, + NULL, SU_AMBIENT_TEMPLATE, &pw_threshold_humidity_alarms_info[0]), /* FIXME: consider ambient.n.humidity.{minimum,maximum} */ /* humidityThresholdLowCritical.n.1 */ - { "ambient.%i.humidity.low.critical", ST_FLAG_RW, 0.1, ".1.3.6.1.4.1.534.6.8.1.3.2.1.6.%i.1", "", SU_AMBIENT_TEMPLATE, NULL }, + snmp_info_default("ambient.%i.humidity.low.critical", ST_FLAG_RW, 0.1, ".1.3.6.1.4.1.534.6.8.1.3.2.1.6.%i.1", "", SU_AMBIENT_TEMPLATE, NULL), /* humidityThresholdLowWarning.n.1 */ - { "ambient.%i.humidity.low.warning", ST_FLAG_RW, 0.1, ".1.3.6.1.4.1.534.6.8.1.3.2.1.5.%i.1", "", SU_AMBIENT_TEMPLATE, NULL }, + snmp_info_default("ambient.%i.humidity.low.warning", ST_FLAG_RW, 0.1, ".1.3.6.1.4.1.534.6.8.1.3.2.1.5.%i.1", "", SU_AMBIENT_TEMPLATE, NULL), /* humidityThresholdHighWarning.n.1 */ - { "ambient.%i.humidity.high.warning", ST_FLAG_RW, 0.1, ".1.3.6.1.4.1.534.6.8.1.3.2.1.7.%i.1", "", SU_AMBIENT_TEMPLATE, NULL }, + snmp_info_default("ambient.%i.humidity.high.warning", ST_FLAG_RW, 0.1, ".1.3.6.1.4.1.534.6.8.1.3.2.1.7.%i.1", "", SU_AMBIENT_TEMPLATE, NULL), /* humidityThresholdHighCritical.n.1 */ - { "ambient.%i.humidity.high.critical", ST_FLAG_RW, 0.1, ".1.3.6.1.4.1.534.6.8.1.3.2.1.8.%i.1", "", SU_AMBIENT_TEMPLATE, NULL }, + snmp_info_default("ambient.%i.humidity.high.critical", ST_FLAG_RW, 0.1, ".1.3.6.1.4.1.534.6.8.1.3.2.1.8.%i.1", "", SU_AMBIENT_TEMPLATE, NULL), /* digitalInputName.n.{1,2} */ - { "ambient.%i.contacts.1.name", ST_FLAG_STRING, 1.0, ".1.3.6.1.4.1.534.6.8.1.4.2.1.1.%i.1", "", SU_AMBIENT_TEMPLATE, NULL }, - { "ambient.%i.contacts.2.name", ST_FLAG_STRING, 1.0, ".1.3.6.1.4.1.534.6.8.1.4.2.1.1.%i.2", "", SU_AMBIENT_TEMPLATE, NULL }, + snmp_info_default("ambient.%i.contacts.1.name", ST_FLAG_STRING, 1.0, ".1.3.6.1.4.1.534.6.8.1.4.2.1.1.%i.1", "", SU_AMBIENT_TEMPLATE, NULL), + snmp_info_default("ambient.%i.contacts.2.name", ST_FLAG_STRING, 1.0, ".1.3.6.1.4.1.534.6.8.1.4.2.1.1.%i.2", "", SU_AMBIENT_TEMPLATE, NULL), /* digitalInputPolarity.n */ - { "ambient.%i.contacts.1.config", ST_FLAG_RW | ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.6.8.1.4.2.1.3.%i.1", "", SU_AMBIENT_TEMPLATE, &pw_ambient_drycontacts_polarity_info[0] }, - { "ambient.%i.contacts.2.config", ST_FLAG_RW | ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.6.8.1.4.2.1.3.%i.2", "", SU_AMBIENT_TEMPLATE, &pw_ambient_drycontacts_polarity_info[0] }, + snmp_info_default("ambient.%i.contacts.1.config", ST_FLAG_RW | ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.6.8.1.4.2.1.3.%i.1", "", SU_AMBIENT_TEMPLATE, &pw_ambient_drycontacts_polarity_info[0]), + snmp_info_default("ambient.%i.contacts.2.config", ST_FLAG_RW | ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.6.8.1.4.2.1.3.%i.2", "", SU_AMBIENT_TEMPLATE, &pw_ambient_drycontacts_polarity_info[0]), /* XUPS-MIB::xupsContactState.n */ - { "ambient.%i.contacts.1.status", ST_FLAG_STRING, 1.0, ".1.3.6.1.4.1.534.6.8.1.4.3.1.3.%i.1", "", SU_AMBIENT_TEMPLATE, &pw_ambient_drycontacts_state_info[0] }, - { "ambient.%i.contacts.2.status", ST_FLAG_STRING, 1.0, ".1.3.6.1.4.1.534.6.8.1.4.3.1.3.%i.2", "", SU_AMBIENT_TEMPLATE, &pw_ambient_drycontacts_state_info[0] }, + snmp_info_default("ambient.%i.contacts.1.status", ST_FLAG_STRING, 1.0, ".1.3.6.1.4.1.534.6.8.1.4.3.1.3.%i.1", "", SU_AMBIENT_TEMPLATE, &pw_ambient_drycontacts_state_info[0]), + snmp_info_default("ambient.%i.contacts.2.status", ST_FLAG_STRING, 1.0, ".1.3.6.1.4.1.534.6.8.1.4.3.1.3.%i.2", "", SU_AMBIENT_TEMPLATE, &pw_ambient_drycontacts_state_info[0]), /* instant commands */ - { "test.battery.start.quick", 0, 1, PW_OID_BATTEST_START, "", - SU_TYPE_CMD | SU_FLAG_OK, NULL }, + snmp_info_default("test.battery.start.quick", 0, 1, PW_OID_BATTEST_START, "", + SU_TYPE_CMD | SU_FLAG_OK, NULL), /* Shed load and restart when line power back on; cannot be canceled */ - { "shutdown.return", 0, DEFAULT_SHUTDOWNDELAY, PW_OID_CONT_LOAD_SHED_AND_RESTART, "", - SU_TYPE_CMD | SU_FLAG_OK, NULL }, + snmp_info_default("shutdown.return", 0, DEFAULT_SHUTDOWNDELAY, PW_OID_CONT_LOAD_SHED_AND_RESTART, "", + SU_TYPE_CMD | SU_FLAG_OK, NULL), /* Cancel output off, by writing 0 to xupsControlOutputOffDelay */ - { "shutdown.stop", 0, 0, PW_OID_CONT_OFFDELAY, "", - SU_TYPE_CMD | SU_FLAG_OK, NULL }, + snmp_info_default("shutdown.stop", 0, 0, PW_OID_CONT_OFFDELAY, "", + SU_TYPE_CMD | SU_FLAG_OK, NULL), /* XUPS-MIB::xupsControlOutputOffDelay */ /* load off after 1 sec, shortest possible delay; 0 cancels */ - { "load.off", 0, 1, PW_OID_CONT_OFFDELAY, "1", - SU_TYPE_CMD | SU_FLAG_OK, NULL }, + snmp_info_default("load.off", 0, 1, PW_OID_CONT_OFFDELAY, "1", + SU_TYPE_CMD | SU_FLAG_OK, NULL), /* Delayed version, parameter is mandatory (so dfl is NULL)! */ - { "load.off.delay", 0, 1, PW_OID_CONT_OFFDELAY, NULL, - SU_TYPE_CMD | SU_FLAG_OK, NULL }, + snmp_info_default("load.off.delay", 0, 1, PW_OID_CONT_OFFDELAY, NULL, + SU_TYPE_CMD | SU_FLAG_OK, NULL), /* XUPS-MIB::xupsControlOutputOnDelay */ /* load on after 1 sec, shortest possible delay; 0 cancels */ - { "load.on", 0, 1, PW_OID_CONT_ONDELAY, "1", - SU_TYPE_CMD | SU_FLAG_OK, NULL }, + snmp_info_default("load.on", 0, 1, PW_OID_CONT_ONDELAY, "1", + SU_TYPE_CMD | SU_FLAG_OK, NULL), /* Delayed version, parameter is mandatory (so dfl is NULL)! */ - { "load.on.delay", 0, 1, PW_OID_CONT_ONDELAY, NULL, - SU_TYPE_CMD | SU_FLAG_OK, NULL }, + snmp_info_default("load.on.delay", 0, 1, PW_OID_CONT_ONDELAY, NULL, + SU_TYPE_CMD | SU_FLAG_OK, NULL), /* Delays handling: * 0-n :Time in seconds until the command is issued * -1:Cancel a pending Off/On command */ /* XUPS-MIB::xupsRecepOffDelaySecs.n */ - { "outlet.%i.load.off", 0, 1, ".1.3.6.1.4.1.534.1.12.2.1.3.%i", - "0", SU_TYPE_CMD | SU_OUTLET, NULL }, + snmp_info_default("outlet.%i.load.off", 0, 1, ".1.3.6.1.4.1.534.1.12.2.1.3.%i", + "0", SU_TYPE_CMD | SU_OUTLET, NULL), /* XUPS-MIB::xupsRecepOnDelaySecs.n */ - { "outlet.%i.load.on", 0, 1, ".1.3.6.1.4.1.534.1.12.2.1.4.%i", - "0", SU_TYPE_CMD | SU_OUTLET, NULL }, + snmp_info_default("outlet.%i.load.on", 0, 1, ".1.3.6.1.4.1.534.1.12.2.1.4.%i", + "0", SU_TYPE_CMD | SU_OUTLET, NULL), /* Delayed version, parameter is mandatory (so dfl is NULL)! */ - { "outlet.%i.load.off.delay", 0, 1, ".1.3.6.1.4.1.534.1.12.2.1.3.%i", - NULL, SU_TYPE_CMD | SU_OUTLET, NULL }, + snmp_info_default("outlet.%i.load.off.delay", 0, 1, ".1.3.6.1.4.1.534.1.12.2.1.3.%i", + NULL, SU_TYPE_CMD | SU_OUTLET, NULL), /* XUPS-MIB::xupsRecepOnDelaySecs.n */ - { "outlet.%i.load.on.delay", 0, 1, ".1.3.6.1.4.1.534.1.12.2.1.4.%i", - NULL, SU_TYPE_CMD | SU_OUTLET, NULL }, + snmp_info_default("outlet.%i.load.on.delay", 0, 1, ".1.3.6.1.4.1.534.1.12.2.1.4.%i", + NULL, SU_TYPE_CMD | SU_OUTLET, NULL), - { "ups.alarms", 0, 1.0, PW_OID_ALARMS, "", - 0, NULL }, + snmp_info_default("ups.alarms", 0, 1.0, PW_OID_ALARMS, "", + 0, NULL), /* end of structure. */ - { NULL, 0, 0, NULL, NULL, 0, NULL } + snmp_info_sentinel } ; static alarms_info_t pw_alarms[] = { @@ -798,5 +807,4 @@ static alarms_info_t pw_alarms[] = { { NULL, NULL, NULL } } ; - mib2nut_info_t eaton_pw_nm2 = { "eaton_pw_nm2", PW_MIB_VERSION, NULL, PW_OID_MODEL_NAME, pw_mib, POWERWARE_SYSOID , pw_alarms }; diff --git a/drivers/eaton-ups-pxg-mib.c b/drivers/eaton-ups-pxg-mib.c index 7e27777446..5d3830930d 100644 --- a/drivers/eaton-ups-pxg-mib.c +++ b/drivers/eaton-ups-pxg-mib.c @@ -1,5 +1,7 @@ /* eaton-ups-pxg-mib.c - data to monitor Eaton / Powerware PXG UPS with NUT * (using MIBs described in stdupsv1.mib and Xups.mib) + * Previously known as powerware-mib.c for "pw" mapping, + * later split into several subdrivers * * Copyright (C) * 2005-2006 Olli Savia @@ -95,59 +97,58 @@ /* Default shutdown.return delay in seconds */ #define DEFAULT_SHUTDOWNDELAY 0 -static info_lkp_t pw_alarm_ob[] = { - { 1, "OB", NULL, NULL }, - { 2, "", NULL, NULL }, - { 0, NULL, NULL, NULL } +static info_lkp_t eaton_pxg_alarm_ob[] = { + info_lkp_default(1, "OB"), + info_lkp_default(2, ""), + info_lkp_sentinel }; -static info_lkp_t pw_alarm_lb[] = { - { 1, "LB", NULL, NULL }, - { 2, "", NULL, NULL }, - { 0, NULL, NULL, NULL } +static info_lkp_t eaton_pxg_alarm_lb[] = { + info_lkp_default(1, "LB"), + info_lkp_default(2, ""), + info_lkp_sentinel }; -static info_lkp_t pw_pwr_info[] = { - - { 0, "OFF" /* off */, NULL, NULL }, - { 1, "OL" /* systemNormal */, NULL, NULL }, - { 2, "OL" /* systemNormalUPSRedundant */, NULL, NULL }, - { 3, "OL" /* systemNormalNotRedundant */, NULL, NULL }, - { 4, "OB" /* systemOnDCSource*/, NULL, NULL }, - { 5, "OB LB" /* systemOnDCSourceShutdownImminent */, NULL, NULL }, - { 6, "OL" /* systemNormalBypassNotAvailable */, NULL, NULL }, - { 7, "OL" /* systemNormalOnLine */, NULL, NULL }, - { 8, "OL" /* systemNormalEnergySaverSystem */, NULL, NULL }, - { 9, "OL" /* systemNormalVMMS */, NULL, NULL }, - { 10, "OL" /* systemNormalHRS */, NULL, NULL }, - { 13, "OL OVER" /* outputOverload */, NULL, NULL }, - { 14, "OL TRIM" /* systemNormalOnBuck */, NULL, NULL }, - { 15, "OL BOOST" /* systemNormalOnBoost */, NULL, NULL }, - { 16, "BYPASS" /* onBypass */, NULL, NULL }, - { 17, "BYPASS" /* onBypassStarting */, NULL, NULL }, - { 18, "BYPASS" /* onBypassReady */, NULL, NULL }, - { 32, "BYPASS" /* onMaintenanceBypass */, NULL, NULL }, - { 33, "OL BYPASS" /* onMBSUPSOnLine */, NULL, NULL }, - { 34, "BYPASS" /* onMBSUPSOnBypass */, NULL, NULL }, - { 35, "OFF BYPASS" /* onMBSUPSOff */, NULL, NULL }, - { 36, "OB BYPASS" /* onMBSUPSOnBattery */, NULL, NULL }, - { 37, "OL" /* onMBSUPSOnLineESS */, NULL, NULL }, - { 38, "OL" /* onMBSUPSOnLineVMMS */, NULL, NULL }, - { 39, "OL" /* onMBSUPSOnLineHRS */, NULL, NULL }, - { 40, "OL" /* onMBSStarting */, NULL, NULL }, - { 41, "OL" /* onMBSReady */, NULL, NULL }, - { 48, "OFF" /* loadOff */, NULL, NULL }, - { 49, "OFF" /* loadOffStarting */, NULL, NULL }, - { 50, "OFF" /* loadOffReady */, NULL, NULL }, - { 64, "OL" /* supportingLoad */, NULL, NULL }, - { 80, "OL" /* systemNormalSP */, NULL, NULL }, - { 81, "OL" /* systemNormalEnergySaverSystemSP */, NULL, NULL }, - { 96, "BYPASS" /* systemOnBypassSP */, NULL, NULL }, - { 100, "BYPASS" /* systemOnManualMaintenanceBypassSP (0x64) */, NULL, NULL }, - { 224, "OL OVER" /* loadSegmentOverload (0x64) */, NULL, NULL }, - { 240, "OB" /* systemOnDCSourceSP */, NULL, NULL }, - { 241, "OFF" /* systemOffSP */, NULL, NULL }, - { 0, NULL, NULL, NULL } +static info_lkp_t eaton_pxg_pwr_info[] = { + info_lkp_default(0, "OFF"), /* off */ + info_lkp_default(1, "OL"), /* systemNormal */ + info_lkp_default(2, "OL"), /* systemNormalUPSRedundant */ + info_lkp_default(3, "OL"), /* systemNormalNotRedundant */ + info_lkp_default(4, "OB"), /* systemOnDCSource*/ + info_lkp_default(5, "OB LB"), /* systemOnDCSourceShutdownImminent */ + info_lkp_default(6, "OL"), /* systemNormalBypassNotAvailable */ + info_lkp_default(7, "OL"), /* systemNormalOnLine */ + info_lkp_default(8, "OL"), /* systemNormalEnergySaverSystem */ + info_lkp_default(9, "OL"), /* systemNormalVMMS */ + info_lkp_default(10, "OL"), /* systemNormalHRS */ + info_lkp_default(13, "OL OVER"), /* outputOverload */ + info_lkp_default(14, "OL TRIM"), /* systemNormalOnBuck */ + info_lkp_default(15, "OL BOOST"), /* systemNormalOnBoost */ + info_lkp_default(16, "BYPASS"), /* onBypass */ + info_lkp_default(17, "BYPASS"), /* onBypassStarting */ + info_lkp_default(18, "BYPASS"), /* onBypassReady */ + info_lkp_default(32, "BYPASS"), /* onMaintenanceBypass */ + info_lkp_default(33, "OL BYPASS"), /* onMBSUPSOnLine */ + info_lkp_default(34, "BYPASS"), /* onMBSUPSOnBypass */ + info_lkp_default(35, "OFF BYPASS"), /* onMBSUPSOff */ + info_lkp_default(36, "OB BYPASS"), /* onMBSUPSOnBattery */ + info_lkp_default(37, "OL"), /* onMBSUPSOnLineESS */ + info_lkp_default(38, "OL"), /* onMBSUPSOnLineVMMS */ + info_lkp_default(39, "OL"), /* onMBSUPSOnLineHRS */ + info_lkp_default(40, "OL"), /* onMBSStarting */ + info_lkp_default(41, "OL"), /* onMBSReady */ + info_lkp_default(48, "OFF"), /* loadOff */ + info_lkp_default(49, "OFF"), /* loadOffStarting */ + info_lkp_default(50, "OFF"), /* loadOffReady */ + info_lkp_default(64, "OL"), /* supportingLoad */ + info_lkp_default(80, "OL"), /* systemNormalSP */ + info_lkp_default(81, "OL"), /* systemNormalEnergySaverSystemSP */ + info_lkp_default(96, "BYPASS"), /* systemOnBypassSP */ + info_lkp_default(100, "BYPASS"), /* systemOnManualMaintenanceBypassSP (0x64) */ + info_lkp_default(224, "OL OVER"), /* loadSegmentOverload (0x64) */ + info_lkp_default(240, "OB"), /* systemOnDCSourceSP */ + info_lkp_default(241, "OFF"), /* systemOffSP */ + info_lkp_sentinel }; /* FIXME: mapped to (experimental.)ups.type, but @@ -164,113 +165,116 @@ static info_lkp_t pw_pwr_info[] = { #endif #if USE_PW_MODE_INFO -static info_lkp_t pw_mode_info[] = { - { 1, "", NULL, NULL }, - { 2, "", NULL, NULL }, - { 3, "normal", NULL, NULL }, - { 4, "", NULL, NULL }, - { 5, "", NULL, NULL }, - { 6, "", NULL, NULL }, - { 7, "", NULL, NULL }, - { 8, "parallel capacity", NULL, NULL }, - { 9, "parallel redundancy", NULL, NULL }, - { 10, "high efficiency", NULL, NULL }, +static info_lkp_t eaton_pxg_mode_info[] = { + info_lkp_default(1, ""), + info_lkp_default(2, ""), + info_lkp_default(3, "normal"), + info_lkp_default(4, ""), + info_lkp_default(5, ""), + info_lkp_default(6, ""), + info_lkp_default(7, ""), + info_lkp_default(8, "parallel capacity"), + info_lkp_default(9, "parallel redundancy"), + info_lkp_default(10, "high efficiency"), + /* Extended status values, * FIXME: check for source and completion */ - { 240, "" /* battery (0xF0) */, NULL, NULL }, - { 100, "" /* maintenanceBypass (0x64) */, NULL, NULL }, - { 96, "" /* Bypass (0x60) */, NULL, NULL }, - { 81, "high efficiency" /* high efficiency (0x51) */, NULL, NULL }, - { 80, "normal" /* normal (0x50) */, NULL, NULL }, - { 64, "" /* UPS supporting load, normal degraded mode (0x40) */, NULL, NULL }, - { 16, "" /* none (0x10) */, NULL, NULL }, - { 0, NULL, NULL, NULL } + info_lkp_default(240, ""), /* battery (0xF0) */ + info_lkp_default(100, ""), /* maintenanceBypass (0x64) */ + info_lkp_default(96, ""), /* Bypass (0x60) */ + info_lkp_default(81, "high efficiency"), /* high efficiency (0x51) */ + info_lkp_default(80, "normal"), /* normal (0x50) */ + info_lkp_default(64, ""), /* UPS supporting load, normal degraded mode (0x40) */ + info_lkp_default(16, ""), /* none (0x10) */ + info_lkp_sentinel }; #endif /* USE_PW_MODE_INFO */ /* FIXME: may be standardized * extracted from bcmxcp.c->BCMXCP_TOPOLOGY_*, Make some common definitions */ -static info_lkp_t pw_topology_info[] = { - { 0x0000, "", NULL, NULL }, /* None; use the Table of Elements */ - { 0x0010, "Off-line switcher, Single Phase", NULL, NULL }, - { 0x0020, "Line-Interactive UPS, Single Phase", NULL, NULL }, - { 0x0021, "Line-Interactive UPS, Two Phase", NULL, NULL }, - { 0x0022, "Line-Interactive UPS, Three Phase", NULL, NULL }, - { 0x0030, "Dual AC Input, On-Line UPS, Single Phase", NULL, NULL }, - { 0x0031, "Dual AC Input, On-Line UPS, Two Phase", NULL, NULL }, - { 0x0032, "Dual AC Input, On-Line UPS, Three Phase", NULL, NULL }, - { 0x0040, "On-Line UPS, Single Phase", NULL, NULL }, - { 0x0041, "On-Line UPS, Two Phase", NULL, NULL }, - { 0x0042, "On-Line UPS, Three Phase", NULL, NULL }, - { 0x0050, "Parallel Redundant On-Line UPS, Single Phase", NULL, NULL }, - { 0x0051, "Parallel Redundant On-Line UPS, Two Phase", NULL, NULL }, - { 0x0052, "Parallel Redundant On-Line UPS, Three Phase", NULL, NULL }, - { 0x0060, "Parallel for Capacity On-Line UPS, Single Phase", NULL, NULL }, - { 0x0061, "Parallel for Capacity On-Line UPS, Two Phase", NULL, NULL }, - { 0x0062, "Parallel for Capacity On-Line UPS, Three Phase", NULL, NULL }, - { 0x0102, "System Bypass Module, Three Phase", NULL, NULL }, - { 0x0122, "Hot-Tie Cabinet, Three Phase", NULL, NULL }, - { 0x0200, "Outlet Controller, Single Phase", NULL, NULL }, - { 0x0222, "Dual AC Input Static Switch Module, 3 Phase", NULL, NULL }, - { 0, NULL, NULL, NULL } +static info_lkp_t eaton_pxg_topology_info[] = { + info_lkp_default(0x0000, ""), /* None; use the Table of Elements */ + info_lkp_default(0x0010, "Off-line switcher, Single Phase"), + info_lkp_default(0x0020, "Line-Interactive UPS, Single Phase"), + info_lkp_default(0x0021, "Line-Interactive UPS, Two Phase"), + info_lkp_default(0x0022, "Line-Interactive UPS, Three Phase"), + info_lkp_default(0x0030, "Dual AC Input, On-Line UPS, Single Phase"), + info_lkp_default(0x0031, "Dual AC Input, On-Line UPS, Two Phase"), + info_lkp_default(0x0032, "Dual AC Input, On-Line UPS, Three Phase"), + info_lkp_default(0x0040, "On-Line UPS, Single Phase"), + info_lkp_default(0x0041, "On-Line UPS, Two Phase"), + info_lkp_default(0x0042, "On-Line UPS, Three Phase"), + info_lkp_default(0x0050, "Parallel Redundant On-Line UPS, Single Phase"), + info_lkp_default(0x0051, "Parallel Redundant On-Line UPS, Two Phase"), + info_lkp_default(0x0052, "Parallel Redundant On-Line UPS, Three Phase"), + info_lkp_default(0x0060, "Parallel for Capacity On-Line UPS, Single Phase"), + info_lkp_default(0x0061, "Parallel for Capacity On-Line UPS, Two Phase"), + info_lkp_default(0x0062, "Parallel for Capacity On-Line UPS, Three Phase"), + info_lkp_default(0x0102, "System Bypass Module, Three Phase"), + info_lkp_default(0x0122, "Hot-Tie Cabinet, Three Phase"), + info_lkp_default(0x0200, "Outlet Controller, Single Phase"), + info_lkp_default(0x0222, "Dual AC Input Static Switch Module, 3 Phase"), + info_lkp_sentinel }; /* Legacy implementation */ -static info_lkp_t pw_battery_abm_status[] = { - { 1, "CHRG", NULL, NULL }, - { 2, "DISCHRG", NULL, NULL }, -/* { 3, "Floating", NULL, NULL }, */ -/* { 4, "Resting", NULL, NULL }, */ -/* { 5, "Unknown", NULL, NULL }, */ - { 0, NULL, NULL, NULL } +static info_lkp_t eaton_pxg_battery_abm_status[] = { + info_lkp_default(1, "CHRG"), + info_lkp_default(2, "DISCHRG"), +/* + info_lkp_default(3, "Floating"), + info_lkp_default(4, "Resting"), + info_lkp_default(5, "Unknown"), +*/ + info_lkp_sentinel }; -static info_lkp_t pw_abm_status_info[] = { - { 1, "charging", NULL, NULL }, - { 2, "discharging", NULL, NULL }, - { 3, "floating", NULL, NULL }, - { 4, "resting", NULL, NULL }, - { 5, "unknown", NULL, NULL }, /* Undefined - ABM is not activated */ - { 6, "disabled", NULL, NULL }, /* ABM Charger Disabled */ - { 0, NULL, NULL, NULL } +static info_lkp_t eaton_pxg_abm_status_info[] = { + info_lkp_default(1, "charging"), + info_lkp_default(2, "discharging"), + info_lkp_default(3, "floating"), + info_lkp_default(4, "resting"), + info_lkp_default(5, "unknown"), /* Undefined - ABM is not activated */ + info_lkp_default(6, "disabled"), /* ABM Charger Disabled */ + info_lkp_sentinel }; -static info_lkp_t pw_batt_test_info[] = { - { 1, "Unknown", NULL, NULL }, - { 2, "Done and passed", NULL, NULL }, - { 3, "Done and error", NULL, NULL }, - { 4, "In progress", NULL, NULL }, - { 5, "Not supported", NULL, NULL }, - { 6, "Inhibited", NULL, NULL }, - { 7, "Scheduled", NULL, NULL }, - { 0, NULL, NULL, NULL } +static info_lkp_t eaton_pxg_batt_test_info[] = { + info_lkp_default(1, "Unknown"), + info_lkp_default(2, "Done and passed"), + info_lkp_default(3, "Done and error"), + info_lkp_default(4, "In progress"), + info_lkp_default(5, "Not supported"), + info_lkp_default(6, "Inhibited"), + info_lkp_default(7, "Scheduled"), + info_lkp_sentinel }; -static info_lkp_t pw_yes_no_info[] = { - { 1, "yes", NULL, NULL }, - { 2, "no", NULL, NULL }, - { 0, NULL, NULL, NULL } +static info_lkp_t eaton_pxg_yes_no_info[] = { + info_lkp_default(1, "yes"), + info_lkp_default(2, "no"), + info_lkp_sentinel }; -static info_lkp_t pw_outlet_status_info[] = { - { 1, "on", NULL, NULL }, - { 2, "off", NULL, NULL }, - { 3, "on", NULL, NULL }, /* pendingOff, transitional status */ - { 4, "off", NULL, NULL }, /* pendingOn, transitional status */ - /* { 5, "", NULL, NULL }, unknown */ - /* { 6, "", NULL, NULL }, reserved */ - { 7, "off", NULL, NULL }, /* Failed in Closed position */ - { 8, "on", NULL, NULL }, /* Failed in Open position */ - { 0, NULL, NULL, NULL } +static info_lkp_t eaton_pxg_outlet_status_info[] = { + info_lkp_default(1, "on"), + info_lkp_default(2, "off"), + info_lkp_default(3, "on"), /* pendingOff, transitional status */ + info_lkp_default(4, "off"), /* pendingOn, transitional status */ + /* info_lkp_default(5, ""), // unknown */ + /* info_lkp_default(6, ""), // reserved */ + info_lkp_default(7, "off"), /* Failed in Closed position */ + info_lkp_default(8, "on"), /* Failed in Open position */ + info_lkp_sentinel }; -static info_lkp_t pw_ambient_drycontacts_info[] = { - { -1, "unknown", NULL, NULL }, - { 1, "opened", NULL, NULL }, - { 2, "closed", NULL, NULL }, - { 3, "opened", NULL, NULL }, /* openWithNotice */ - { 4, "closed", NULL, NULL }, /* closedWithNotice */ - { 0, NULL, NULL, NULL } +static info_lkp_t eaton_pxg_ambient_drycontacts_info[] = { + info_lkp_default(-1, "unknown"), + info_lkp_default(1, "opened"), + info_lkp_default(2, "closed"), + info_lkp_default(3, "opened"), /* openWithNotice */ + info_lkp_default(4, "closed"), /* closedWithNotice */ + info_lkp_sentinel }; #if WITH_SNMP_LKP_FUN @@ -294,14 +298,14 @@ const char *su_temperature_read_fun(void *raw_snmp_value) { }; # endif /* WITH_SNMP_LKP_FUN_DUMMY */ -static info_lkp_t pw_sensor_temperature_unit_info[] = { - { 0, "dummy", eaton_sensor_temperature_unit_fun, NULL }, - { 0, NULL, NULL, NULL } +static info_lkp_t eaton_pxg_sensor_temperature_unit_info[] = { + info_lkp_fun_vp2s(0, "dummy", eaton_sensor_temperature_unit_fun), + info_lkp_sentinel }; -static info_lkp_t pw_sensor_temperature_read_info[] = { - { 0, "dummy", su_temperature_read_fun, NULL }, - { 0, NULL, NULL, NULL } +static info_lkp_t eaton_pxg_sensor_temperature_read_info[] = { + info_lkp_fun_vp2s(0, "dummy", su_temperature_read_fun), + info_lkp_sentinel }; #else /* if not WITH_SNMP_LKP_FUN: */ @@ -309,61 +313,61 @@ static info_lkp_t pw_sensor_temperature_read_info[] = { /* FIXME: For now, DMF codebase falls back to old implementation with static * lookup/mapping tables for this, which can easily go into the DMF XML file. */ -static info_lkp_t pw_sensor_temperature_unit_info[] = { - { 0, "kelvin", NULL, NULL }, - { 1, "celsius", NULL, NULL }, - { 2, "fahrenheit", NULL, NULL }, - { 0, NULL, NULL, NULL } +static info_lkp_t eaton_pxg_sensor_temperature_unit_info[] = { + info_lkp_default(0, "kelvin"), + info_lkp_default(1, "celsius"), + info_lkp_default(2, "fahrenheit"), + info_lkp_sentinel }; #endif /* WITH_SNMP_LKP_FUN */ -static info_lkp_t pw_ambient_drycontacts_polarity_info[] = { - { 0, "normal-opened", NULL, NULL }, - { 1, "normal-closed", NULL, NULL }, - { 0, NULL, NULL, NULL } +static info_lkp_t eaton_pxg_ambient_drycontacts_polarity_info[] = { + info_lkp_default(0, "normal-opened"), + info_lkp_default(1, "normal-closed"), + info_lkp_sentinel }; -static info_lkp_t pw_ambient_drycontacts_state_info[] = { - { 0, "inactive", NULL, NULL }, - { 1, "active", NULL, NULL }, - { 0, NULL, NULL, NULL } +static info_lkp_t eaton_pxg_ambient_drycontacts_state_info[] = { + info_lkp_default(0, "inactive"), + info_lkp_default(1, "active"), + info_lkp_sentinel }; -static info_lkp_t pw_emp002_ambient_presence_info[] = { - { 0, "unknown", NULL, NULL }, - { 2, "yes", NULL, NULL }, /* communicationOK */ - { 3, "no", NULL, NULL }, /* communicationLost */ - { 0, NULL, NULL, NULL } +static info_lkp_t eaton_pxg_emp002_ambient_presence_info[] = { + info_lkp_default(0, "unknown"), + info_lkp_default(2, "yes"), /* communicationOK */ + info_lkp_default(3, "no"), /* communicationLost */ + info_lkp_sentinel }; /* extracted from drivers/eaton-pdu-marlin-mib.c -> marlin_threshold_status_info */ -static info_lkp_t pw_threshold_status_info[] = { - { 0, "good", NULL, NULL }, /* No threshold triggered */ - { 1, "warning-low", NULL, NULL }, /* Warning low threshold triggered */ - { 2, "critical-low", NULL, NULL }, /* Critical low threshold triggered */ - { 3, "warning-high", NULL, NULL }, /* Warning high threshold triggered */ - { 4, "critical-high", NULL, NULL }, /* Critical high threshold triggered */ - { 0, NULL, NULL, NULL } +static info_lkp_t eaton_pxg_threshold_status_info[] = { + info_lkp_default(0, "good"), /* No threshold triggered */ + info_lkp_default(1, "warning-low"), /* Warning low threshold triggered */ + info_lkp_default(2, "critical-low"), /* Critical low threshold triggered */ + info_lkp_default(3, "warning-high"), /* Warning high threshold triggered */ + info_lkp_default(4, "critical-high"), /* Critical high threshold triggered */ + info_lkp_sentinel }; /* extracted from drivers/eaton-pdu-marlin-mib.c -> marlin_threshold_xxx_alarms_info */ -static info_lkp_t pw_threshold_temperature_alarms_info[] = { - { 0, "", NULL, NULL }, /* No threshold triggered */ - { 1, "low temperature warning!", NULL, NULL }, /* Warning low threshold triggered */ - { 2, "low temperature critical!", NULL, NULL }, /* Critical low threshold triggered */ - { 3, "high temperature warning!", NULL, NULL }, /* Warning high threshold triggered */ - { 4, "high temperature critical!", NULL, NULL }, /* Critical high threshold triggered */ - { 0, NULL, NULL, NULL } +static info_lkp_t eaton_pxg_threshold_temperature_alarms_info[] = { + info_lkp_default(0, ""), /* No threshold triggered */ + info_lkp_default(1, "low temperature warning!"), /* Warning low threshold triggered */ + info_lkp_default(2, "low temperature critical!"), /* Critical low threshold triggered */ + info_lkp_default(3, "high temperature warning!"), /* Warning high threshold triggered */ + info_lkp_default(4, "high temperature critical!"), /* Critical high threshold triggered */ + info_lkp_sentinel }; -static info_lkp_t pw_threshold_humidity_alarms_info[] = { - { 0, "", NULL, NULL }, /* No threshold triggered */ - { 1, "low humidity warning!", NULL, NULL }, /* Warning low threshold triggered */ - { 2, "low humidity critical!", NULL, NULL }, /* Critical low threshold triggered */ - { 3, "high humidity warning!", NULL, NULL }, /* Warning high threshold triggered */ - { 4, "high humidity critical!", NULL, NULL }, /* Critical high threshold triggered */ - { 0, NULL, NULL, NULL } +static info_lkp_t eaton_pxg_threshold_humidity_alarms_info[] = { + info_lkp_default(0, ""), /* No threshold triggered */ + info_lkp_default(1, "low humidity warning!"), /* Warning low threshold triggered */ + info_lkp_default(2, "low humidity critical!"), /* Critical low threshold triggered */ + info_lkp_default(3, "high humidity warning!"), /* Warning high threshold triggered */ + info_lkp_default(4, "high humidity critical!"), /* Critical high threshold triggered */ + info_lkp_sentinel }; /* Snmp2NUT lookup table */ @@ -371,354 +375,357 @@ static info_lkp_t pw_threshold_humidity_alarms_info[] = { static snmp_info_t eaton_pxg_mib[] = { /* standard MIB items */ - { "device.description", ST_FLAG_STRING | ST_FLAG_RW, SU_INFOSIZE, ".1.3.6.1.2.1.1.1.0", NULL, SU_FLAG_OK, NULL }, - { "device.contact", ST_FLAG_STRING | ST_FLAG_RW, SU_INFOSIZE, ".1.3.6.1.2.1.1.4.0", NULL, SU_FLAG_OK, NULL }, - { "device.location", ST_FLAG_STRING | ST_FLAG_RW, SU_INFOSIZE, ".1.3.6.1.2.1.1.6.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("device.description", ST_FLAG_STRING | ST_FLAG_RW, SU_INFOSIZE, ".1.3.6.1.2.1.1.1.0", NULL, SU_FLAG_OK, NULL), + snmp_info_default("device.contact", ST_FLAG_STRING | ST_FLAG_RW, SU_INFOSIZE, ".1.3.6.1.2.1.1.4.0", NULL, SU_FLAG_OK, NULL), + snmp_info_default("device.location", ST_FLAG_STRING | ST_FLAG_RW, SU_INFOSIZE, ".1.3.6.1.2.1.1.6.0", NULL, SU_FLAG_OK, NULL), /* FIXME: miss device page! */ /* UPS page */ /* info_type, info_flags, info_len, OID, dfl, flags, oid2info, setvar */ - { "ups.mfr", ST_FLAG_STRING, SU_INFOSIZE, PW_OID_MFR_NAME, "", - SU_FLAG_STATIC, NULL }, - { "ups.model", ST_FLAG_STRING, SU_INFOSIZE, PW_OID_MODEL_NAME, "", - SU_FLAG_STATIC, NULL }, + snmp_info_default("ups.mfr", ST_FLAG_STRING, SU_INFOSIZE, PW_OID_MFR_NAME, "", + SU_FLAG_STATIC, NULL), + snmp_info_default("ups.model", ST_FLAG_STRING, SU_INFOSIZE, PW_OID_MODEL_NAME, "", + SU_FLAG_STATIC, NULL), /* FIXME: the 2 "firmware" entries below should be SU_FLAG_SEMI_STATIC */ - { "ups.firmware", ST_FLAG_STRING, SU_INFOSIZE, PW_OID_FIRMREV, "", - 0, NULL }, - { "ups.firmware.aux", ST_FLAG_STRING, SU_INFOSIZE, IETF_OID_AGENTREV, "", - 0, NULL }, - { "ups.serial", ST_FLAG_STRING, SU_INFOSIZE, IETF_OID_IDENT, "", - SU_FLAG_STATIC, NULL }, - { "ups.load", 0, 1.0, PW_OID_OUT_LOAD, "", - 0, NULL }, + snmp_info_default("ups.firmware", ST_FLAG_STRING, SU_INFOSIZE, PW_OID_FIRMREV, "", + 0, NULL), + snmp_info_default("ups.firmware.aux", ST_FLAG_STRING, SU_INFOSIZE, IETF_OID_AGENTREV, "", + 0, NULL), + snmp_info_default("ups.serial", ST_FLAG_STRING, SU_INFOSIZE, IETF_OID_IDENT, "", + SU_FLAG_STATIC, NULL), + snmp_info_default("ups.load", 0, 1.0, PW_OID_OUT_LOAD, "", + 0, NULL), /* FIXME: should be removed in favor of output.power */ - { "ups.power", 0, 1.0, PW_OID_OUT_POWER ".1", "", - 0, NULL }, + snmp_info_default("ups.power", 0, 1.0, PW_OID_OUT_POWER ".1", "", + 0, NULL), /* Duplicate of the above entry, but pointing at the first index */ /* xupsOutputWatts.1.0; Value (Integer): 300 */ - { "ups.power", 0, 1.0, "1.3.6.1.4.1.534.1.4.4.1.4.1.0", "", - 0, NULL }, - - { "ups.status", ST_FLAG_STRING, SU_INFOSIZE, PW_OID_POWER_STATUS, "OFF", - SU_STATUS_PWR, &pw_pwr_info[0] }, - { "ups.status", ST_FLAG_STRING, SU_INFOSIZE, PW_OID_ALARM_OB, "", - SU_STATUS_BATT, &pw_alarm_ob[0] }, - { "ups.status", ST_FLAG_STRING, SU_INFOSIZE, PW_OID_ALARM_LB, "", - SU_STATUS_BATT, &pw_alarm_lb[0] }, - { "ups.status", ST_FLAG_STRING, SU_INFOSIZE, PW_OID_BATT_STATUS, "", - SU_STATUS_BATT, &pw_battery_abm_status[0] }, + snmp_info_default("ups.power", 0, 1.0, "1.3.6.1.4.1.534.1.4.4.1.4.1.0", "", + 0, NULL), + + snmp_info_default("ups.status", ST_FLAG_STRING, SU_INFOSIZE, PW_OID_POWER_STATUS, "OFF", + SU_STATUS_PWR, &eaton_pxg_pwr_info[0]), + snmp_info_default("ups.status", ST_FLAG_STRING, SU_INFOSIZE, PW_OID_ALARM_OB, "", + SU_STATUS_BATT, &eaton_pxg_alarm_ob[0]), + snmp_info_default("ups.status", ST_FLAG_STRING, SU_INFOSIZE, PW_OID_ALARM_LB, "", + SU_STATUS_BATT, &eaton_pxg_alarm_lb[0]), + snmp_info_default("ups.status", ST_FLAG_STRING, SU_INFOSIZE, PW_OID_BATT_STATUS, "", + SU_STATUS_BATT, &eaton_pxg_battery_abm_status[0]), + #if USE_PW_MODE_INFO /* FIXME: should be ups.mode or output.source (need RFC) */ /* Note: this define is not set via project options; code hidden with * commit to "snmp-ups: support newer Genepi management cards" */ - { "experimental.ups.type", ST_FLAG_STRING, SU_INFOSIZE, PW_OID_POWER_STATUS, "", - SU_FLAG_STATIC | SU_FLAG_OK, &pw_mode_info[0] }, + snmp_info_default("experimental.ups.type", ST_FLAG_STRING, SU_INFOSIZE, PW_OID_POWER_STATUS, "", + SU_FLAG_STATIC | SU_FLAG_OK, &eaton_pxg_mode_info[0]), #endif /* USE_PW_MODE_INFO */ /* xupsTopologyType.0; Value (Integer): 32 */ - { "ups.type", ST_FLAG_STRING, SU_INFOSIZE, "1.3.6.1.4.1.534.1.13.1.0", "", - SU_FLAG_STATIC | SU_FLAG_OK, &pw_topology_info[0] }, + snmp_info_default("ups.type", ST_FLAG_STRING, SU_INFOSIZE, "1.3.6.1.4.1.534.1.13.1.0", "", + SU_FLAG_STATIC | SU_FLAG_OK, &eaton_pxg_topology_info[0]), /* FIXME: should be removed in favor of their output. equivalent! */ - { "ups.realpower.nominal", 0, 1.0, PW_OID_CONF_POWER, "", - 0, NULL }, + snmp_info_default("ups.realpower.nominal", 0, 1.0, PW_OID_CONF_POWER, "", + 0, NULL), /* FIXME: should be removed in favor of output.power.nominal */ - { "ups.power.nominal", 0, 1.0, IETF_OID_CONF_OUT_VA, "", - 0, NULL }, + snmp_info_default("ups.power.nominal", 0, 1.0, IETF_OID_CONF_OUT_VA, "", + 0, NULL), /* XUPS-MIB::xupsEnvAmbientTemp.0 */ - { "ups.temperature", 0, 1.0, "1.3.6.1.4.1.534.1.6.1.0", "", 0, NULL }, + snmp_info_default("ups.temperature", 0, 1.0, "1.3.6.1.4.1.534.1.6.1.0", "", 0, NULL), /* FIXME: These 2 data needs RFC! */ /* XUPS-MIB::xupsEnvAmbientLowerLimit.0 */ - { "ups.temperature.low", ST_FLAG_RW, 1.0, "1.3.6.1.4.1.534.1.6.2.0", "", 0, NULL }, + snmp_info_default("ups.temperature.low", ST_FLAG_RW, 1.0, "1.3.6.1.4.1.534.1.6.2.0", "", 0, NULL), /* XUPS-MIB::xupsEnvAmbientUpperLimit.0 */ - { "ups.temperature.high", ST_FLAG_RW, 1.0, "1.3.6.1.4.1.534.1.6.3.0", "", 0, NULL }, + snmp_info_default("ups.temperature.high", ST_FLAG_RW, 1.0, "1.3.6.1.4.1.534.1.6.3.0", "", 0, NULL), /* XUPS-MIB::xupsTestBatteryStatus */ - { "ups.test.result", ST_FLAG_STRING, SU_INFOSIZE, "1.3.6.1.4.1.534.1.8.2.0", "", 0, &pw_batt_test_info[0] }, + snmp_info_default("ups.test.result", ST_FLAG_STRING, SU_INFOSIZE, "1.3.6.1.4.1.534.1.8.2.0", "", 0, &eaton_pxg_batt_test_info[0]), /* UPS-MIB::upsAutoRestart */ - { "ups.start.auto", ST_FLAG_RW | ST_FLAG_STRING, SU_INFOSIZE, "1.3.6.1.2.1.33.1.8.5.0", "", SU_FLAG_OK, &pw_yes_no_info[0] }, + snmp_info_default("ups.start.auto", ST_FLAG_RW | ST_FLAG_STRING, SU_INFOSIZE, "1.3.6.1.2.1.33.1.8.5.0", "", SU_FLAG_OK, &eaton_pxg_yes_no_info[0]), /* XUPS-MIB::xupsBatteryAbmStatus.0 */ - { "battery.charger.status", ST_FLAG_STRING, SU_INFOSIZE, "1.3.6.1.4.1.534.1.2.5.0", "", SU_STATUS_BATT, &pw_abm_status_info[0] }, + snmp_info_default("battery.charger.status", ST_FLAG_STRING, SU_INFOSIZE, "1.3.6.1.4.1.534.1.2.5.0", "", SU_STATUS_BATT, &eaton_pxg_abm_status_info[0]), /* Battery page */ - { "battery.charge", 0, 1.0, PW_OID_BATT_CHARGE, "", - 0, NULL }, - { "battery.runtime", 0, 1.0, PW_OID_BATT_RUNTIME, "", - 0, NULL }, - { "battery.voltage", 0, 1.0, PW_OID_BATT_VOLTAGE, "", - 0, NULL }, - { "battery.current", 0, 0.1, PW_OID_BATT_CURRENT, "", - 0, NULL }, - { "battery.runtime.low", 0, 60.0, IETF_OID_CONF_RUNTIME_LOW, "", - 0, NULL }, - { "battery.date", ST_FLAG_RW | ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.1.2.6.0", NULL, SU_FLAG_OK, &su_convert_to_iso_date_info[FUNMAP_USDATE_TO_ISODATE] }, + snmp_info_default("battery.charge", 0, 1.0, PW_OID_BATT_CHARGE, "", + 0, NULL), + snmp_info_default("battery.runtime", 0, 1.0, PW_OID_BATT_RUNTIME, "", + 0, NULL), + snmp_info_default("battery.voltage", 0, 1.0, PW_OID_BATT_VOLTAGE, "", + 0, NULL), + snmp_info_default("battery.current", 0, 0.1, PW_OID_BATT_CURRENT, "", + 0, NULL), + snmp_info_default("battery.runtime.low", 0, 60.0, IETF_OID_CONF_RUNTIME_LOW, "", + 0, NULL), + snmp_info_default("battery.date", ST_FLAG_RW | ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.1.2.6.0", NULL, SU_FLAG_OK, &su_convert_to_iso_date_info[FUNMAP_USDATE_TO_ISODATE]), /* Output page */ - { "output.phases", 0, 1.0, PW_OID_OUT_LINES, "", 0, NULL }, + snmp_info_default("output.phases", 0, 1.0, PW_OID_OUT_LINES, "", 0, NULL), /* XUPS-MIB::xupsOutputFrequency.0 */ - { "output.frequency", 0, 0.1, "1.3.6.1.4.1.534.1.4.2.0", "", 0, NULL }, + snmp_info_default("output.frequency", 0, 0.1, "1.3.6.1.4.1.534.1.4.2.0", "", 0, NULL), /* XUPS-MIB::xupsConfigOutputFreq.0 */ - { "output.frequency.nominal", 0, 0.1, "1.3.6.1.4.1.534.1.10.4.0", "", 0, NULL }, + snmp_info_default("output.frequency.nominal", 0, 0.1, "1.3.6.1.4.1.534.1.10.4.0", "", 0, NULL), /* XUPS-MIB::xupsOutputVoltage.1 */ - { "output.voltage", 0, 1.0, "1.3.6.1.4.1.534.1.4.4.1.2.1", "", SU_OUTPUT_1, NULL }, + snmp_info_default("output.voltage", 0, 1.0, "1.3.6.1.4.1.534.1.4.4.1.2.1", "", SU_OUTPUT_1, NULL), /* Duplicate of the above entry, but pointing at the first index */ /* xupsOutputVoltage.1.0; Value (Integer): 230 */ - { "output.voltage", 0, 1.0, "1.3.6.1.4.1.534.1.4.4.1.2.1.0", "", SU_OUTPUT_1, NULL }, + snmp_info_default("output.voltage", 0, 1.0, "1.3.6.1.4.1.534.1.4.4.1.2.1.0", "", SU_OUTPUT_1, NULL), /* XUPS-MIB::xupsConfigOutputVoltage.0 */ - { "output.voltage.nominal", 0, 1.0, "1.3.6.1.4.1.534.1.10.1.0", "", 0, NULL }, + snmp_info_default("output.voltage.nominal", 0, 1.0, "1.3.6.1.4.1.534.1.10.1.0", "", 0, NULL), /* XUPS-MIB::xupsConfigLowOutputVoltageLimit.0 */ - { "output.voltage.low", 0, 1.0, ".1.3.6.1.4.1.534.1.10.6.0", "", 0, NULL }, + snmp_info_default("output.voltage.low", 0, 1.0, ".1.3.6.1.4.1.534.1.10.6.0", "", 0, NULL), /* XUPS-MIB::xupsConfigHighOutputVoltageLimit.0 */ - { "output.voltage.high", 0, 1.0, ".1.3.6.1.4.1.534.1.10.7.0", "", 0, NULL }, - { "output.current", 0, 1.0, PW_OID_OUT_CURRENT ".1", "", - SU_OUTPUT_1, NULL }, + snmp_info_default("output.voltage.high", 0, 1.0, ".1.3.6.1.4.1.534.1.10.7.0", "", 0, NULL), + snmp_info_default("output.current", 0, 1.0, PW_OID_OUT_CURRENT ".1", "", + SU_OUTPUT_1, NULL), /* Duplicate of the above entry, but pointing at the first index */ /* xupsOutputCurrent.1.0; Value (Integer): 0 */ - { "output.current", 0, 1.0, "1.3.6.1.4.1.534.1.4.4.1.3.1.0", "", - SU_OUTPUT_1, NULL }, - { "output.realpower", 0, 1.0, PW_OID_OUT_POWER ".1", "", - SU_OUTPUT_1, NULL }, + snmp_info_default("output.current", 0, 1.0, "1.3.6.1.4.1.534.1.4.4.1.3.1.0", "", + SU_OUTPUT_1, NULL), + snmp_info_default("output.realpower", 0, 1.0, PW_OID_OUT_POWER ".1", "", + SU_OUTPUT_1, NULL), /* Duplicate of the above entry, but pointing at the first index */ /* Name/OID: xupsOutputWatts.1.0; Value (Integer): 1200 */ - { "output.realpower", 0, 1.0, "1.3.6.1.4.1.534.1.4.4.1.4.1.0", "", - 0, NULL }, + snmp_info_default("output.realpower", 0, 1.0, "1.3.6.1.4.1.534.1.4.4.1.4.1.0", "", + 0, NULL), /* Duplicate of "ups.realpower.nominal" * FIXME: map either ups or output, but not both (or have an auto-remap) */ - { "output.realpower.nominal", 0, 1.0, PW_OID_CONF_POWER, "", - 0, NULL }, - { "output.L1-N.voltage", 0, 1.0, PW_OID_OUT_VOLTAGE ".1", "", - SU_OUTPUT_3, NULL }, - { "output.L2-N.voltage", 0, 1.0, PW_OID_OUT_VOLTAGE ".2", "", - SU_OUTPUT_3, NULL }, - { "output.L3-N.voltage", 0, 1.0, PW_OID_OUT_VOLTAGE ".3", "", - SU_OUTPUT_3, NULL }, - { "output.L1.current", 0, 1.0, PW_OID_OUT_CURRENT ".1", "", - SU_OUTPUT_3, NULL }, - { "output.L2.current", 0, 1.0, PW_OID_OUT_CURRENT ".2", "", - SU_OUTPUT_3, NULL }, - { "output.L3.current", 0, 1.0, PW_OID_OUT_CURRENT ".3", "", - SU_OUTPUT_3, NULL }, - { "output.L1.realpower", 0, 1.0, PW_OID_OUT_POWER ".1", "", - SU_OUTPUT_3, NULL }, - { "output.L2.realpower", 0, 1.0, PW_OID_OUT_POWER ".2", "", - SU_OUTPUT_3, NULL }, - { "output.L3.realpower", 0, 1.0, PW_OID_OUT_POWER ".3", "", - SU_OUTPUT_3, NULL }, + snmp_info_default("output.realpower.nominal", 0, 1.0, PW_OID_CONF_POWER, "", + 0, NULL), + snmp_info_default("output.L1-N.voltage", 0, 1.0, PW_OID_OUT_VOLTAGE ".1", "", + SU_OUTPUT_3, NULL), + snmp_info_default("output.L2-N.voltage", 0, 1.0, PW_OID_OUT_VOLTAGE ".2", "", + SU_OUTPUT_3, NULL), + snmp_info_default("output.L3-N.voltage", 0, 1.0, PW_OID_OUT_VOLTAGE ".3", "", + SU_OUTPUT_3, NULL), + snmp_info_default("output.L1.current", 0, 1.0, PW_OID_OUT_CURRENT ".1", "", + SU_OUTPUT_3, NULL), + snmp_info_default("output.L2.current", 0, 1.0, PW_OID_OUT_CURRENT ".2", "", + SU_OUTPUT_3, NULL), + snmp_info_default("output.L3.current", 0, 1.0, PW_OID_OUT_CURRENT ".3", "", + SU_OUTPUT_3, NULL), + snmp_info_default("output.L1.realpower", 0, 1.0, PW_OID_OUT_POWER ".1", "", + SU_OUTPUT_3, NULL), + snmp_info_default("output.L2.realpower", 0, 1.0, PW_OID_OUT_POWER ".2", "", + SU_OUTPUT_3, NULL), + snmp_info_default("output.L3.realpower", 0, 1.0, PW_OID_OUT_POWER ".3", "", + SU_OUTPUT_3, NULL), /* FIXME: should better be output.Lx.load */ - { "output.L1.power.percent", 0, 1.0, IETF_OID_LOAD_LEVEL ".1", "", - SU_OUTPUT_3, NULL }, - { "output.L2.power.percent", 0, 1.0, IETF_OID_LOAD_LEVEL ".2", "", - SU_OUTPUT_3, NULL }, - { "output.L3.power.percent", 0, 1.0, IETF_OID_LOAD_LEVEL ".3", "", - SU_OUTPUT_3, NULL }, - { "output.voltage.nominal", 0, 1.0, PW_OID_CONF_OVOLTAGE, "", - 0, NULL }, + snmp_info_default("output.L1.power.percent", 0, 1.0, IETF_OID_LOAD_LEVEL ".1", "", + SU_OUTPUT_3, NULL), + snmp_info_default("output.L2.power.percent", 0, 1.0, IETF_OID_LOAD_LEVEL ".2", "", + SU_OUTPUT_3, NULL), + snmp_info_default("output.L3.power.percent", 0, 1.0, IETF_OID_LOAD_LEVEL ".3", "", + SU_OUTPUT_3, NULL), + snmp_info_default("output.voltage.nominal", 0, 1.0, PW_OID_CONF_OVOLTAGE, "", + 0, NULL), /* Input page */ - { "input.phases", 0, 1.0, PW_OID_IN_LINES, "", - 0, NULL }, - { "input.frequency", 0, 0.1, PW_OID_IN_FREQUENCY, "", - 0, NULL }, - { "input.voltage", 0, 1.0, PW_OID_IN_VOLTAGE ".0", "", - SU_INPUT_1, NULL }, + snmp_info_default("input.phases", 0, 1.0, PW_OID_IN_LINES, "", + 0, NULL), + snmp_info_default("input.frequency", 0, 0.1, PW_OID_IN_FREQUENCY, "", + 0, NULL), + snmp_info_default("input.voltage", 0, 1.0, PW_OID_IN_VOLTAGE ".0", "", + SU_INPUT_1, NULL), /* Duplicate of the above entry, but pointing at the first index */ /* xupsInputVoltage.1[.0]; Value (Integer): 245 */ - { "input.voltage", 0, 1.0, "1.3.6.1.4.1.534.1.3.4.1.2.1", "", - SU_INPUT_1, NULL }, + snmp_info_default("input.voltage", 0, 1.0, "1.3.6.1.4.1.534.1.3.4.1.2.1", "", + SU_INPUT_1, NULL), /* XUPS-MIB::xupsConfigInputVoltage.0 */ - { "input.voltage.nominal", 0, 1.0, "1.3.6.1.4.1.534.1.10.2.0", "", 0, NULL }, - { "input.current", 0, 0.1, PW_OID_IN_CURRENT ".0", "", - SU_INPUT_1, NULL }, - { "input.L1-N.voltage", 0, 1.0, PW_OID_IN_VOLTAGE ".1", "", - SU_INPUT_3, NULL }, - { "input.L2-N.voltage", 0, 1.0, PW_OID_IN_VOLTAGE ".2", "", - SU_INPUT_3, NULL }, - { "input.L3-N.voltage", 0, 1.0, PW_OID_IN_VOLTAGE ".3", "", - SU_INPUT_3, NULL }, - { "input.L1.current", 0, 1.0, PW_OID_IN_CURRENT ".1", "", - SU_INPUT_3, NULL }, - { "input.L2.current", 0, 1.0, PW_OID_IN_CURRENT ".2", "", - SU_INPUT_3, NULL }, - { "input.L3.current", 0, 1.0, PW_OID_IN_CURRENT ".3", "", - SU_INPUT_3, NULL }, - { "input.L1.realpower", 0, 1.0, PW_OID_IN_POWER ".1", "", - SU_INPUT_3, NULL }, - { "input.L2.realpower", 0, 1.0, PW_OID_IN_POWER ".2", "", - SU_INPUT_3, NULL }, - { "input.L3.realpower", 0, 1.0, PW_OID_IN_POWER ".3", "", - SU_INPUT_3, NULL }, - { "input.quality", 0, 1.0, PW_OID_IN_LINE_BADS, "", - 0, NULL }, + snmp_info_default("input.voltage.nominal", 0, 1.0, "1.3.6.1.4.1.534.1.10.2.0", "", 0, NULL), + snmp_info_default("input.current", 0, 0.1, PW_OID_IN_CURRENT ".0", "", + SU_INPUT_1, NULL), + snmp_info_default("input.L1-N.voltage", 0, 1.0, PW_OID_IN_VOLTAGE ".1", "", + SU_INPUT_3, NULL), + snmp_info_default("input.L2-N.voltage", 0, 1.0, PW_OID_IN_VOLTAGE ".2", "", + SU_INPUT_3, NULL), + snmp_info_default("input.L3-N.voltage", 0, 1.0, PW_OID_IN_VOLTAGE ".3", "", + SU_INPUT_3, NULL), + snmp_info_default("input.L1.current", 0, 1.0, PW_OID_IN_CURRENT ".1", "", + SU_INPUT_3, NULL), + snmp_info_default("input.L2.current", 0, 1.0, PW_OID_IN_CURRENT ".2", "", + SU_INPUT_3, NULL), + snmp_info_default("input.L3.current", 0, 1.0, PW_OID_IN_CURRENT ".3", "", + SU_INPUT_3, NULL), + snmp_info_default("input.L1.realpower", 0, 1.0, PW_OID_IN_POWER ".1", "", + SU_INPUT_3, NULL), + snmp_info_default("input.L2.realpower", 0, 1.0, PW_OID_IN_POWER ".2", "", + SU_INPUT_3, NULL), + snmp_info_default("input.L3.realpower", 0, 1.0, PW_OID_IN_POWER ".3", "", + SU_INPUT_3, NULL), + snmp_info_default("input.quality", 0, 1.0, PW_OID_IN_LINE_BADS, "", + 0, NULL), /* FIXME: this segfaults! do we assume the same number of bypass phases as input phases? - { "input.bypass.phases", 0, 1.0, PW_OID_BY_LINES, "", 0, NULL }, */ - { "input.bypass.frequency", 0, 0.1, PW_OID_BY_FREQUENCY, "", 0, NULL }, - { "input.bypass.voltage", 0, 1.0, PW_OID_BY_VOLTAGE ".0", "", - SU_INPUT_1, NULL }, + snmp_info_default("input.bypass.phases", 0, 1.0, PW_OID_BY_LINES, "", 0, NULL), */ + snmp_info_default("input.bypass.frequency", 0, 0.1, PW_OID_BY_FREQUENCY, "", 0, NULL), + snmp_info_default("input.bypass.voltage", 0, 1.0, PW_OID_BY_VOLTAGE ".0", "", + SU_INPUT_1, NULL), /* Duplicate of the above entry, but pointing at the first index */ /* xupsBypassVoltage.1.0; Value (Integer): 244 */ - { "input.bypass.voltage", 0, 1.0, "1.3.6.1.4.1.534.1.5.3.1.2.1.0", "", - SU_INPUT_1, NULL }, - { "input.bypass.L1-N.voltage", 0, 1.0, PW_OID_BY_VOLTAGE ".1", "", - SU_INPUT_3, NULL }, - { "input.bypass.L2-N.voltage", 0, 1.0, PW_OID_BY_VOLTAGE ".2", "", - SU_INPUT_3, NULL }, - { "input.bypass.L3-N.voltage", 0, 1.0, PW_OID_BY_VOLTAGE ".3", "", - SU_INPUT_3, NULL }, + snmp_info_default("input.bypass.voltage", 0, 1.0, "1.3.6.1.4.1.534.1.5.3.1.2.1.0", "", + SU_INPUT_1, NULL), + snmp_info_default("input.bypass.L1-N.voltage", 0, 1.0, PW_OID_BY_VOLTAGE ".1", "", + SU_INPUT_3, NULL), + snmp_info_default("input.bypass.L2-N.voltage", 0, 1.0, PW_OID_BY_VOLTAGE ".2", "", + SU_INPUT_3, NULL), + snmp_info_default("input.bypass.L3-N.voltage", 0, 1.0, PW_OID_BY_VOLTAGE ".3", "", + SU_INPUT_3, NULL), /* Outlet page */ - /* Master outlet id always equal to 0 */ - { "outlet.id", 0, 1, NULL, "0", SU_FLAG_STATIC , NULL }, - /* XUPS-MIB:: xupsSwitchable.0 */ - { "outlet.switchable", 0, 1, ".1.3.6.1.4.1.534.1.9.7.0", NULL, SU_FLAG_STATIC , &pw_yes_no_info[0] }, + /* Master outlet id always equal to 0 */ + snmp_info_default("outlet.id", 0, 1, NULL, "0", SU_FLAG_STATIC , NULL), + /* XUPS-MIB:: xupsSwitchable.0 */ + snmp_info_default("outlet.switchable", 0, 1, ".1.3.6.1.4.1.534.1.9.7.0", NULL, SU_FLAG_STATIC , &eaton_pxg_yes_no_info[0]), /* XUPS-MIB::xupsNumReceptacles; Value (Integer): 2 */ - { "outlet.count", 0, 1, ".1.3.6.1.4.1.534.1.12.1.0", NULL, SU_FLAG_STATIC, NULL }, + snmp_info_default("outlet.count", 0, 1, ".1.3.6.1.4.1.534.1.12.1.0", NULL, SU_FLAG_STATIC, NULL), /* XUPS-MIB::xupsRecepIndex.X; Value (Integer): X */ - { "outlet.%i.id", 0, 1, ".1.3.6.1.4.1.534.1.12.2.1.1.%i", NULL, SU_FLAG_STATIC | SU_OUTLET, NULL }, + snmp_info_default("outlet.%i.id", 0, 1, ".1.3.6.1.4.1.534.1.12.2.1.1.%i", NULL, SU_FLAG_STATIC | SU_OUTLET, NULL), /* This MIB does not provide outlets switchability info. So map to a nearby OID, for data activation, and map all values to "yes" */ - { "outlet.%i.switchable", 0, 1, ".1.3.6.1.4.1.534.1.12.2.1.1.%i", NULL, SU_FLAG_STATIC | SU_OUTLET, NULL }, + snmp_info_default("outlet.%i.switchable", 0, 1, ".1.3.6.1.4.1.534.1.12.2.1.1.%i", NULL, SU_FLAG_STATIC | SU_OUTLET, NULL), /* XUPS-MIB::xupsRecepStatus.X; Value (Integer): 1 */ - { "outlet.%i.status", 0, 1, ".1.3.6.1.4.1.534.1.12.2.1.2.%i", NULL, SU_OUTLET, &pw_outlet_status_info[0] }, + snmp_info_default("outlet.%i.status", 0, 1, ".1.3.6.1.4.1.534.1.12.2.1.2.%i", NULL, SU_OUTLET, &eaton_pxg_outlet_status_info[0]), /* Ambient collection */ /* EMP001 (legacy) mapping */ /* XUPS-MIB::xupsEnvRemoteTemp.0 */ - { "ambient.temperature", 0, 1.0, "1.3.6.1.4.1.534.1.6.5.0", "", 0, NULL }, + snmp_info_default("ambient.temperature", 0, 1.0, "1.3.6.1.4.1.534.1.6.5.0", "", 0, NULL), /* XUPS-MIB::xupsEnvRemoteTempLowerLimit.0 */ - { "ambient.temperature.low", ST_FLAG_RW, 1.0, "1.3.6.1.4.1.534.1.6.9.0", "", 0, NULL }, + snmp_info_default("ambient.temperature.low", ST_FLAG_RW, 1.0, "1.3.6.1.4.1.534.1.6.9.0", "", 0, NULL), /* XUPS-MIB::xupsEnvRemoteTempUpperLimit.0 */ - { "ambient.temperature.high", ST_FLAG_RW, 1.0, "1.3.6.1.4.1.534.1.6.10.0", "", 0, NULL }, + snmp_info_default("ambient.temperature.high", ST_FLAG_RW, 1.0, "1.3.6.1.4.1.534.1.6.10.0", "", 0, NULL), /* XUPS-MIB::xupsEnvRemoteHumidity.0 */ - { "ambient.humidity", 0, 1.0, "1.3.6.1.4.1.534.1.6.6.0", "", 0, NULL }, + snmp_info_default("ambient.humidity", 0, 1.0, "1.3.6.1.4.1.534.1.6.6.0", "", 0, NULL), /* XUPS-MIB::xupsEnvRemoteHumidityLowerLimit.0 */ - { "ambient.humidity.low", ST_FLAG_RW, 1.0, "1.3.6.1.4.1.534.1.6.11.0", "", 0, NULL }, + snmp_info_default("ambient.humidity.low", ST_FLAG_RW, 1.0, "1.3.6.1.4.1.534.1.6.11.0", "", 0, NULL), /* XUPS-MIB::xupsEnvRemoteHumidityUpperLimit.0 */ - { "ambient.humidity.high", ST_FLAG_RW, 1.0, "1.3.6.1.4.1.534.1.6.12.0", "", 0, NULL }, + snmp_info_default("ambient.humidity.high", ST_FLAG_RW, 1.0, "1.3.6.1.4.1.534.1.6.12.0", "", 0, NULL), /* XUPS-MIB::xupsContactDescr.n */ - { "ambient.contacts.1.name", ST_FLAG_STRING, 1.0, ".1.3.6.1.4.1.534.1.6.8.1.4.1", "", 0, NULL }, - { "ambient.contacts.2.name", ST_FLAG_STRING, 1.0, ".1.3.6.1.4.1.534.1.6.8.1.4.2", "", 0, NULL }, + snmp_info_default("ambient.contacts.1.name", ST_FLAG_STRING, 1.0, ".1.3.6.1.4.1.534.1.6.8.1.4.1", "", 0, NULL), + snmp_info_default("ambient.contacts.2.name", ST_FLAG_STRING, 1.0, ".1.3.6.1.4.1.534.1.6.8.1.4.2", "", 0, NULL), /* XUPS-MIB::xupsContactState.n */ - { "ambient.contacts.1.status", ST_FLAG_STRING, 1.0, ".1.3.6.1.4.1.534.1.6.8.1.3.1", "", 0, &pw_ambient_drycontacts_info[0] }, - { "ambient.contacts.2.status", ST_FLAG_STRING, 1.0, ".1.3.6.1.4.1.534.1.6.8.1.3.2", "", 0, &pw_ambient_drycontacts_info[0] }, + snmp_info_default("ambient.contacts.1.status", ST_FLAG_STRING, 1.0, ".1.3.6.1.4.1.534.1.6.8.1.3.1", "", 0, &eaton_pxg_ambient_drycontacts_info[0]), + snmp_info_default("ambient.contacts.2.status", ST_FLAG_STRING, 1.0, ".1.3.6.1.4.1.534.1.6.8.1.3.2", "", 0, &eaton_pxg_ambient_drycontacts_info[0]), /* EMP002 (EATON EMP MIB) mapping, including daisychain support */ /* Warning: indexes start at '1' not '0'! */ /* sensorCount.0 */ - { "ambient.count", ST_FLAG_RW, 1.0, ".1.3.6.1.4.1.534.6.8.1.1.1.0", "", 0, NULL }, + snmp_info_default("ambient.count", ST_FLAG_RW, 1.0, ".1.3.6.1.4.1.534.6.8.1.1.1.0", "", 0, NULL), /* CommunicationStatus.n */ - { "ambient.%i.present", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.6.8.1.1.4.1.1.%i", - NULL, SU_AMBIENT_TEMPLATE, &pw_emp002_ambient_presence_info[0] }, + snmp_info_default("ambient.%i.present", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.6.8.1.1.4.1.1.%i", + NULL, SU_AMBIENT_TEMPLATE, &eaton_pxg_emp002_ambient_presence_info[0]), /* sensorName.n: OctetString EMPDT1H1C2 @1 */ - { "ambient.%i.name", ST_FLAG_STRING, 1.0, ".1.3.6.1.4.1.534.6.8.1.1.3.1.1.%i", "", SU_AMBIENT_TEMPLATE, NULL }, + snmp_info_default("ambient.%i.name", ST_FLAG_STRING, 1.0, ".1.3.6.1.4.1.534.6.8.1.1.3.1.1.%i", "", SU_AMBIENT_TEMPLATE, NULL), /* sensorManufacturer.n */ - { "ambient.%i.mfr", ST_FLAG_STRING, 1.0, ".1.3.6.1.4.1.534.6.8.1.1.2.1.6.%i", "", SU_AMBIENT_TEMPLATE, NULL }, + snmp_info_default("ambient.%i.mfr", ST_FLAG_STRING, 1.0, ".1.3.6.1.4.1.534.6.8.1.1.2.1.6.%i", "", SU_AMBIENT_TEMPLATE, NULL), /* sensorModel.n */ - { "ambient.%i.model", ST_FLAG_STRING, 1.0, ".1.3.6.1.4.1.534.6.8.1.1.2.1.7.%i", "", SU_AMBIENT_TEMPLATE, NULL }, + snmp_info_default("ambient.%i.model", ST_FLAG_STRING, 1.0, ".1.3.6.1.4.1.534.6.8.1.1.2.1.7.%i", "", SU_AMBIENT_TEMPLATE, NULL), /* sensorSerialNumber.n */ - { "ambient.%i.serial", ST_FLAG_STRING, 1.0, ".1.3.6.1.4.1.534.6.8.1.1.2.1.9.%i", "", SU_AMBIENT_TEMPLATE, NULL }, + snmp_info_default("ambient.%i.serial", ST_FLAG_STRING, 1.0, ".1.3.6.1.4.1.534.6.8.1.1.2.1.9.%i", "", SU_AMBIENT_TEMPLATE, NULL), /* sensorUuid.n */ - { "ambient.%i.id", ST_FLAG_STRING, 1.0, ".1.3.6.1.4.1.534.6.8.1.1.2.1.2.%i", "", SU_AMBIENT_TEMPLATE, NULL }, + snmp_info_default("ambient.%i.id", ST_FLAG_STRING, 1.0, ".1.3.6.1.4.1.534.6.8.1.1.2.1.2.%i", "", SU_AMBIENT_TEMPLATE, NULL), /* sensorAddress.n */ - { "ambient.%i.address", 0, 1, ".1.3.6.1.4.1.534.6.8.1.1.2.1.4.%i", "", SU_AMBIENT_TEMPLATE, NULL }, + snmp_info_default("ambient.%i.address", 0, 1, ".1.3.6.1.4.1.534.6.8.1.1.2.1.4.%i", "", SU_AMBIENT_TEMPLATE, NULL), /* sensorFirmwareVersion.n */ - { "ambient.%i.firmware", ST_FLAG_STRING, 1.0, ".1.3.6.1.4.1.534.6.8.1.1.2.1.10.%i", "", SU_AMBIENT_TEMPLATE, NULL }, + snmp_info_default("ambient.%i.firmware", ST_FLAG_STRING, 1.0, ".1.3.6.1.4.1.534.6.8.1.1.2.1.10.%i", "", SU_AMBIENT_TEMPLATE, NULL), /* temperatureUnit.1 * MUST be before the temperature data reading! */ - { "ambient.%i.temperature.unit", 0, 1.0, ".1.3.6.1.4.1.534.6.8.1.2.5.0", "", SU_AMBIENT_TEMPLATE, &pw_sensor_temperature_unit_info[0] }, + snmp_info_default("ambient.%i.temperature.unit", 0, 1.0, ".1.3.6.1.4.1.534.6.8.1.2.5.0", "", SU_AMBIENT_TEMPLATE, &eaton_pxg_sensor_temperature_unit_info[0]), + /* temperatureValue.n.1 */ - { "ambient.%i.temperature", 0, 0.1, ".1.3.6.1.4.1.534.6.8.1.2.3.1.3.%i.1", "", SU_AMBIENT_TEMPLATE, #if WITH_SNMP_LKP_FUN - &pw_sensor_temperature_read_info[0] + snmp_info_default("ambient.%i.temperature", 0, 0.1, ".1.3.6.1.4.1.534.6.8.1.2.3.1.3.%i.1", "", SU_AMBIENT_TEMPLATE, + &eaton_pxg_sensor_temperature_read_info[0]), #else - NULL + snmp_info_default("ambient.%i.temperature", 0, 0.1, ".1.3.6.1.4.1.534.6.8.1.2.3.1.3.%i.1", "", SU_AMBIENT_TEMPLATE, + NULL), #endif - }, - { "ambient.%i.temperature.status", ST_FLAG_STRING, SU_INFOSIZE, + + snmp_info_default("ambient.%i.temperature.status", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.6.8.1.2.3.1.1.%i.1", - NULL, SU_AMBIENT_TEMPLATE, &pw_threshold_status_info[0] }, - { "ups.alarm", ST_FLAG_STRING, SU_INFOSIZE, + NULL, SU_AMBIENT_TEMPLATE, &eaton_pxg_threshold_status_info[0]), + snmp_info_default("ups.alarm", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.6.8.1.2.3.1.1.%i.1", - NULL, SU_AMBIENT_TEMPLATE, &pw_threshold_temperature_alarms_info[0] }, + NULL, SU_AMBIENT_TEMPLATE, &eaton_pxg_threshold_temperature_alarms_info[0]), /* FIXME: ambient.n.temperature.{minimum,maximum} */ /* temperatureThresholdLowCritical.n.1 */ - { "ambient.%i.temperature.low.critical", ST_FLAG_RW, 0.1, ".1.3.6.1.4.1.534.6.8.1.2.2.1.6.%i.1", "", SU_AMBIENT_TEMPLATE, NULL }, + snmp_info_default("ambient.%i.temperature.low.critical", ST_FLAG_RW, 0.1, ".1.3.6.1.4.1.534.6.8.1.2.2.1.6.%i.1", "", SU_AMBIENT_TEMPLATE, NULL), /* temperatureThresholdLowWarning.n.1 */ - { "ambient.%i.temperature.low.warning", ST_FLAG_RW, 0.1, ".1.3.6.1.4.1.534.6.8.1.2.2.1.5.%i.1", "", SU_AMBIENT_TEMPLATE, NULL }, + snmp_info_default("ambient.%i.temperature.low.warning", ST_FLAG_RW, 0.1, ".1.3.6.1.4.1.534.6.8.1.2.2.1.5.%i.1", "", SU_AMBIENT_TEMPLATE, NULL), /* temperatureThresholdHighWarning.n.1 */ - { "ambient.%i.temperature.high.warning", ST_FLAG_RW, 0.1, ".1.3.6.1.4.1.534.6.8.1.2.2.1.7.%i.1", "", SU_AMBIENT_TEMPLATE, NULL }, + snmp_info_default("ambient.%i.temperature.high.warning", ST_FLAG_RW, 0.1, ".1.3.6.1.4.1.534.6.8.1.2.2.1.7.%i.1", "", SU_AMBIENT_TEMPLATE, NULL), /* temperatureThresholdHighCritical.n.1 */ - { "ambient.%i.temperature.high.critical", ST_FLAG_RW, 0.1, ".1.3.6.1.4.1.534.6.8.1.2.2.1.8.%i.1", "", SU_AMBIENT_TEMPLATE, NULL }, + snmp_info_default("ambient.%i.temperature.high.critical", ST_FLAG_RW, 0.1, ".1.3.6.1.4.1.534.6.8.1.2.2.1.8.%i.1", "", SU_AMBIENT_TEMPLATE, NULL), /* humidityValue.n.1 */ - { "ambient.%i.humidity", 0, 0.1, ".1.3.6.1.4.1.534.6.8.1.3.3.1.3.%i.1", "", SU_AMBIENT_TEMPLATE, NULL }, - { "ambient.%i.humidity.status", ST_FLAG_STRING, SU_INFOSIZE, + snmp_info_default("ambient.%i.humidity", 0, 0.1, ".1.3.6.1.4.1.534.6.8.1.3.3.1.3.%i.1", "", SU_AMBIENT_TEMPLATE, NULL), + snmp_info_default("ambient.%i.humidity.status", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.6.8.1.3.3.1.1.%i.1", - NULL, SU_AMBIENT_TEMPLATE, &pw_threshold_status_info[0] }, - { "ups.alarm", ST_FLAG_STRING, SU_INFOSIZE, + NULL, SU_AMBIENT_TEMPLATE, &eaton_pxg_threshold_status_info[0]), + snmp_info_default("ups.alarm", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.6.8.1.3.3.1.1.%i.1", - NULL, SU_AMBIENT_TEMPLATE, &pw_threshold_humidity_alarms_info[0] }, + NULL, SU_AMBIENT_TEMPLATE, &eaton_pxg_threshold_humidity_alarms_info[0]), /* FIXME: consider ambient.n.humidity.{minimum,maximum} */ /* humidityThresholdLowCritical.n.1 */ - { "ambient.%i.humidity.low.critical", ST_FLAG_RW, 0.1, ".1.3.6.1.4.1.534.6.8.1.3.2.1.6.%i.1", "", SU_AMBIENT_TEMPLATE, NULL }, + snmp_info_default("ambient.%i.humidity.low.critical", ST_FLAG_RW, 0.1, ".1.3.6.1.4.1.534.6.8.1.3.2.1.6.%i.1", "", SU_AMBIENT_TEMPLATE, NULL), /* humidityThresholdLowWarning.n.1 */ - { "ambient.%i.humidity.low.warning", ST_FLAG_RW, 0.1, ".1.3.6.1.4.1.534.6.8.1.3.2.1.5.%i.1", "", SU_AMBIENT_TEMPLATE, NULL }, + snmp_info_default("ambient.%i.humidity.low.warning", ST_FLAG_RW, 0.1, ".1.3.6.1.4.1.534.6.8.1.3.2.1.5.%i.1", "", SU_AMBIENT_TEMPLATE, NULL), /* humidityThresholdHighWarning.n.1 */ - { "ambient.%i.humidity.high.warning", ST_FLAG_RW, 0.1, ".1.3.6.1.4.1.534.6.8.1.3.2.1.7.%i.1", "", SU_AMBIENT_TEMPLATE, NULL }, + snmp_info_default("ambient.%i.humidity.high.warning", ST_FLAG_RW, 0.1, ".1.3.6.1.4.1.534.6.8.1.3.2.1.7.%i.1", "", SU_AMBIENT_TEMPLATE, NULL), /* humidityThresholdHighCritical.n.1 */ - { "ambient.%i.humidity.high.critical", ST_FLAG_RW, 0.1, ".1.3.6.1.4.1.534.6.8.1.3.2.1.8.%i.1", "", SU_AMBIENT_TEMPLATE, NULL }, + snmp_info_default("ambient.%i.humidity.high.critical", ST_FLAG_RW, 0.1, ".1.3.6.1.4.1.534.6.8.1.3.2.1.8.%i.1", "", SU_AMBIENT_TEMPLATE, NULL), /* digitalInputName.n.{1,2} */ - { "ambient.%i.contacts.1.name", ST_FLAG_STRING, 1.0, ".1.3.6.1.4.1.534.6.8.1.4.2.1.1.%i.1", "", SU_AMBIENT_TEMPLATE, NULL }, - { "ambient.%i.contacts.2.name", ST_FLAG_STRING, 1.0, ".1.3.6.1.4.1.534.6.8.1.4.2.1.1.%i.2", "", SU_AMBIENT_TEMPLATE, NULL }, + snmp_info_default("ambient.%i.contacts.1.name", ST_FLAG_STRING, 1.0, ".1.3.6.1.4.1.534.6.8.1.4.2.1.1.%i.1", "", SU_AMBIENT_TEMPLATE, NULL), + snmp_info_default("ambient.%i.contacts.2.name", ST_FLAG_STRING, 1.0, ".1.3.6.1.4.1.534.6.8.1.4.2.1.1.%i.2", "", SU_AMBIENT_TEMPLATE, NULL), /* digitalInputPolarity.n */ - { "ambient.%i.contacts.1.config", ST_FLAG_RW | ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.6.8.1.4.2.1.3.%i.1", "", SU_AMBIENT_TEMPLATE, &pw_ambient_drycontacts_polarity_info[0] }, - { "ambient.%i.contacts.2.config", ST_FLAG_RW | ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.6.8.1.4.2.1.3.%i.2", "", SU_AMBIENT_TEMPLATE, &pw_ambient_drycontacts_polarity_info[0] }, + snmp_info_default("ambient.%i.contacts.1.config", ST_FLAG_RW | ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.6.8.1.4.2.1.3.%i.1", "", SU_AMBIENT_TEMPLATE, &eaton_pxg_ambient_drycontacts_polarity_info[0]), + snmp_info_default("ambient.%i.contacts.2.config", ST_FLAG_RW | ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.6.8.1.4.2.1.3.%i.2", "", SU_AMBIENT_TEMPLATE, &eaton_pxg_ambient_drycontacts_polarity_info[0]), /* XUPS-MIB::xupsContactState.n */ - { "ambient.%i.contacts.1.status", ST_FLAG_STRING, 1.0, ".1.3.6.1.4.1.534.6.8.1.4.3.1.3.%i.1", "", SU_AMBIENT_TEMPLATE, &pw_ambient_drycontacts_state_info[0] }, - { "ambient.%i.contacts.2.status", ST_FLAG_STRING, 1.0, ".1.3.6.1.4.1.534.6.8.1.4.3.1.3.%i.2", "", SU_AMBIENT_TEMPLATE, &pw_ambient_drycontacts_state_info[0] }, + snmp_info_default("ambient.%i.contacts.1.status", ST_FLAG_STRING, 1.0, ".1.3.6.1.4.1.534.6.8.1.4.3.1.3.%i.1", "", SU_AMBIENT_TEMPLATE, &eaton_pxg_ambient_drycontacts_state_info[0]), + snmp_info_default("ambient.%i.contacts.2.status", ST_FLAG_STRING, 1.0, ".1.3.6.1.4.1.534.6.8.1.4.3.1.3.%i.2", "", SU_AMBIENT_TEMPLATE, &eaton_pxg_ambient_drycontacts_state_info[0]), /* instant commands */ - { "test.battery.start.quick", 0, 1, PW_OID_BATTEST_START, "", - SU_TYPE_CMD | SU_FLAG_OK, NULL }, + snmp_info_default("test.battery.start.quick", 0, 1, PW_OID_BATTEST_START, "", + SU_TYPE_CMD | SU_FLAG_OK, NULL), /* Shed load and restart when line power back on; cannot be canceled */ - { "shutdown.return", 0, DEFAULT_SHUTDOWNDELAY, PW_OID_CONT_LOAD_SHED_AND_RESTART, "", - SU_TYPE_CMD | SU_FLAG_OK, NULL }, + snmp_info_default("shutdown.return", 0, DEFAULT_SHUTDOWNDELAY, PW_OID_CONT_LOAD_SHED_AND_RESTART, "", + SU_TYPE_CMD | SU_FLAG_OK, NULL), /* Cancel output off, by writing 0 to xupsControlOutputOffDelay */ - { "shutdown.stop", 0, 0, PW_OID_CONT_OFFDELAY, "", - SU_TYPE_CMD | SU_FLAG_OK, NULL }, + snmp_info_default("shutdown.stop", 0, 0, PW_OID_CONT_OFFDELAY, "", + SU_TYPE_CMD | SU_FLAG_OK, NULL), /* XUPS-MIB::xupsControlOutputOffDelay */ /* load off after 1 sec, shortest possible delay; 0 cancels */ - { "load.off", 0, 1, PW_OID_CONT_OFFDELAY, "1", - SU_TYPE_CMD | SU_FLAG_OK, NULL }, + snmp_info_default("load.off", 0, 1, PW_OID_CONT_OFFDELAY, "1", + SU_TYPE_CMD | SU_FLAG_OK, NULL), /* Delayed version, parameter is mandatory (so dfl is NULL)! */ - { "load.off.delay", 0, 1, PW_OID_CONT_OFFDELAY, NULL, - SU_TYPE_CMD | SU_FLAG_OK, NULL }, + snmp_info_default("load.off.delay", 0, 1, PW_OID_CONT_OFFDELAY, NULL, + SU_TYPE_CMD | SU_FLAG_OK, NULL), /* XUPS-MIB::xupsControlOutputOnDelay */ /* load on after 1 sec, shortest possible delay; 0 cancels */ - { "load.on", 0, 1, PW_OID_CONT_ONDELAY, "1", - SU_TYPE_CMD | SU_FLAG_OK, NULL }, + snmp_info_default("load.on", 0, 1, PW_OID_CONT_ONDELAY, "1", + SU_TYPE_CMD | SU_FLAG_OK, NULL), /* Delayed version, parameter is mandatory (so dfl is NULL)! */ - { "load.on.delay", 0, 1, PW_OID_CONT_ONDELAY, NULL, - SU_TYPE_CMD | SU_FLAG_OK, NULL }, + snmp_info_default("load.on.delay", 0, 1, PW_OID_CONT_ONDELAY, NULL, + SU_TYPE_CMD | SU_FLAG_OK, NULL), /* Delays handling: * 0-n :Time in seconds until the command is issued * -1:Cancel a pending Off/On command */ /* XUPS-MIB::xupsRecepOffDelaySecs.n */ - { "outlet.%i.load.off", 0, 1, ".1.3.6.1.4.1.534.1.12.2.1.3.%i", - "0", SU_TYPE_CMD | SU_OUTLET, NULL }, + snmp_info_default("outlet.%i.load.off", 0, 1, ".1.3.6.1.4.1.534.1.12.2.1.3.%i", + "0", SU_TYPE_CMD | SU_OUTLET, NULL), /* XUPS-MIB::xupsRecepOnDelaySecs.n */ - { "outlet.%i.load.on", 0, 1, ".1.3.6.1.4.1.534.1.12.2.1.4.%i", - "0", SU_TYPE_CMD | SU_OUTLET, NULL }, + snmp_info_default("outlet.%i.load.on", 0, 1, ".1.3.6.1.4.1.534.1.12.2.1.4.%i", + "0", SU_TYPE_CMD | SU_OUTLET, NULL), /* Delayed version, parameter is mandatory (so dfl is NULL)! */ - { "outlet.%i.load.off.delay", 0, 1, ".1.3.6.1.4.1.534.1.12.2.1.3.%i", - NULL, SU_TYPE_CMD | SU_OUTLET, NULL }, + snmp_info_default("outlet.%i.load.off.delay", 0, 1, ".1.3.6.1.4.1.534.1.12.2.1.3.%i", + NULL, SU_TYPE_CMD | SU_OUTLET, NULL), /* XUPS-MIB::xupsRecepOnDelaySecs.n */ - { "outlet.%i.load.on.delay", 0, 1, ".1.3.6.1.4.1.534.1.12.2.1.4.%i", - NULL, SU_TYPE_CMD | SU_OUTLET, NULL }, + snmp_info_default("outlet.%i.load.on.delay", 0, 1, ".1.3.6.1.4.1.534.1.12.2.1.4.%i", + NULL, SU_TYPE_CMD | SU_OUTLET, NULL), - { "ups.alarms", 0, 1.0, PW_OID_ALARMS, "", - 0, NULL }, + snmp_info_default("ups.alarms", 0, 1.0, PW_OID_ALARMS, "", + 0, NULL), /* end of structure. */ - { NULL, 0, 0, NULL, NULL, 0, NULL } + snmp_info_sentinel } ; static alarms_info_t eaton_pxg_alarms[] = { @@ -823,5 +830,4 @@ static alarms_info_t eaton_pxg_alarms[] = { { NULL, NULL, NULL } } ; - mib2nut_info_t eaton_pxg_ups = { "eaton_pxg_ups", EATON_PXG_MIB_VERSION, NULL, PW_OID_MODEL_NAME, eaton_pxg_mib, EATON_PXGX_SYSOID , eaton_pxg_alarms }; diff --git a/drivers/emerson-avocent-pdu-mib.c b/drivers/emerson-avocent-pdu-mib.c index 8ca90d8a3c..6111cff36b 100644 --- a/drivers/emerson-avocent-pdu-mib.c +++ b/drivers/emerson-avocent-pdu-mib.c @@ -25,7 +25,7 @@ #include "emerson-avocent-pdu-mib.h" -#define EMERSON_AVOCENT_MIB_VERSION "1.3" +#define EMERSON_AVOCENT_MIB_VERSION "1.30" #define EMERSON_AVOCENT_SYSOID ".1.3.6.1.4.1.10418.17.1.7" #define EMERSON_AVOCENT_OID_MODEL_NAME ".1.3.6.1.4.1.10418.17.2.1.2.0" @@ -60,103 +60,103 @@ #endif static info_lkp_t avocent_outlet_status_info[] = { - { 1, "off", NULL, NULL }, - { 2, "on", NULL, NULL }, + info_lkp_default(1, "off"), + info_lkp_default(2, "on"), /* - { 3, "offLocked", NULL, NULL }, - { 4, "onLocked", NULL, NULL }, - { 5, "offCycle", NULL, NULL }, - { 6, "onPendingOff", NULL, NULL }, - { 7, "offPendingOn", NULL, NULL }, - { 8, "onPendingCycle", NULL, NULL }, - { 9, "notSet", NULL, NULL }, - { 10, "onFixed", NULL, NULL }, - { 11, "offShutdown", NULL, NULL }, - { 12, "tripped", NULL, NULL }, + info_lkp_default(3, "offLocked"), + info_lkp_default(4, "onLocked"), + info_lkp_default(5, "offCycle"), + info_lkp_default(6, "onPendingOff"), + info_lkp_default(7, "offPendingOn"), + info_lkp_default(8, "onPendingCycle"), + info_lkp_default(9, "notSet"), + info_lkp_default(10, "onFixed"), + info_lkp_default(11, "offShutdown"), + info_lkp_default(12, "tripped"), */ - { 0, NULL, NULL, NULL } + info_lkp_sentinel }; static snmp_info_t emerson_avocent_pdu_mib[] = { /* standard MIB items */ - { "device.description", ST_FLAG_STRING | ST_FLAG_RW, SU_INFOSIZE, ".1.3.6.1.2.1.1.1.0", NULL, SU_FLAG_OK, NULL }, - { "device.contact", ST_FLAG_STRING | ST_FLAG_RW, SU_INFOSIZE, ".1.3.6.1.2.1.1.4.0", NULL, SU_FLAG_OK, NULL }, - { "device.location", ST_FLAG_STRING | ST_FLAG_RW, SU_INFOSIZE, ".1.3.6.1.2.1.1.6.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("device.description", ST_FLAG_STRING | ST_FLAG_RW, SU_INFOSIZE, ".1.3.6.1.2.1.1.1.0", NULL, SU_FLAG_OK, NULL), + snmp_info_default("device.contact", ST_FLAG_STRING | ST_FLAG_RW, SU_INFOSIZE, ".1.3.6.1.2.1.1.4.0", NULL, SU_FLAG_OK, NULL), + snmp_info_default("device.location", ST_FLAG_STRING | ST_FLAG_RW, SU_INFOSIZE, ".1.3.6.1.2.1.1.6.0", NULL, SU_FLAG_OK, NULL), /* Device page */ - { "device.mfr", ST_FLAG_STRING, SU_INFOSIZE, NULL, "Avocent", - SU_FLAG_STATIC | SU_FLAG_ABSENT | SU_FLAG_OK, NULL }, - { "device.model", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.10418.17.2.5.3.1.5.1.%i", /* EMERSON_AVOCENT_OID_MODEL_NAME */ - "Avocent SNMP PDU", SU_FLAG_ABSENT | SU_FLAG_OK | SU_FLAG_NAINVALID, NULL }, - { "device.serial", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.10418.17.2.1.4.0", "", - SU_FLAG_STATIC | SU_FLAG_OK, NULL }, - { "device.type", ST_FLAG_STRING, SU_INFOSIZE, NULL, "pdu", - SU_FLAG_STATIC | SU_FLAG_ABSENT | SU_FLAG_OK, NULL }, + snmp_info_default("device.mfr", ST_FLAG_STRING, SU_INFOSIZE, NULL, "Avocent", + SU_FLAG_STATIC | SU_FLAG_ABSENT | SU_FLAG_OK, NULL), + snmp_info_default("device.model", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.10418.17.2.5.3.1.5.1.%i", /* EMERSON_AVOCENT_OID_MODEL_NAME */ + "Avocent SNMP PDU", SU_FLAG_ABSENT | SU_FLAG_OK | SU_FLAG_NAINVALID, NULL), + snmp_info_default("device.serial", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.10418.17.2.1.4.0", "", + SU_FLAG_STATIC | SU_FLAG_OK, NULL), + snmp_info_default("device.type", ST_FLAG_STRING, SU_INFOSIZE, NULL, "pdu", + SU_FLAG_STATIC | SU_FLAG_ABSENT | SU_FLAG_OK, NULL), /* Daisychained devices support * Notes: this definition is used to: * - estimate the number of devices, based on the below OID iteration capabilities * - determine the base index of the SNMP OID (ie 0 or 1) */ - { "device.count", 0, 1, ".1.3.6.1.4.1.10418.17.2.5.2.1.4.1", - "1", SU_FLAG_STATIC, NULL }, + snmp_info_default("device.count", 0, 1, ".1.3.6.1.4.1.10418.17.2.5.2.1.4.1", + "1", SU_FLAG_STATIC, NULL), /* UPS page */ - { "ups.mfr", ST_FLAG_STRING, SU_INFOSIZE, NULL, "Avocent", - SU_FLAG_STATIC | SU_FLAG_ABSENT | SU_FLAG_OK, NULL }, - { "ups.model", ST_FLAG_STRING, SU_INFOSIZE, EMERSON_AVOCENT_OID_MODEL_NAME, - "Avocent SNMP PDU", SU_FLAG_STATIC | SU_FLAG_OK, NULL }, - { "ups.id", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.10418.17.2.1.1.0", - "unknown", SU_FLAG_STATIC | SU_FLAG_OK, NULL }, - { "ups.serial", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.10418.17.2.1.4.0", "", - SU_FLAG_STATIC | SU_FLAG_OK, NULL }, - { "ups.firmware", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.10418.17.2.1.7.0", "", - SU_FLAG_STATIC | SU_FLAG_OK, NULL }, - { "ups.type", ST_FLAG_STRING, SU_INFOSIZE, NULL, "pdu", - SU_FLAG_STATIC | SU_FLAG_ABSENT | SU_FLAG_OK, NULL }, - { "ups.macaddr", ST_FLAG_STRING, SU_INFOSIZE, AVOCENT_OID_UNIT_MACADDR, - "", SU_FLAG_STATIC | SU_FLAG_OK, NULL }, + snmp_info_default("ups.mfr", ST_FLAG_STRING, SU_INFOSIZE, NULL, "Avocent", + SU_FLAG_STATIC | SU_FLAG_ABSENT | SU_FLAG_OK, NULL), + snmp_info_default("ups.model", ST_FLAG_STRING, SU_INFOSIZE, EMERSON_AVOCENT_OID_MODEL_NAME, + "Avocent SNMP PDU", SU_FLAG_STATIC | SU_FLAG_OK, NULL), + snmp_info_default("ups.id", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.10418.17.2.1.1.0", + "unknown", SU_FLAG_STATIC | SU_FLAG_OK, NULL), + snmp_info_default("ups.serial", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.10418.17.2.1.4.0", "", + SU_FLAG_STATIC | SU_FLAG_OK, NULL), + snmp_info_default("ups.firmware", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.10418.17.2.1.7.0", "", + SU_FLAG_STATIC | SU_FLAG_OK, NULL), + snmp_info_default("ups.type", ST_FLAG_STRING, SU_INFOSIZE, NULL, "pdu", + SU_FLAG_STATIC | SU_FLAG_ABSENT | SU_FLAG_OK, NULL), + snmp_info_default("ups.macaddr", ST_FLAG_STRING, SU_INFOSIZE, AVOCENT_OID_UNIT_MACADDR, + "", SU_FLAG_STATIC | SU_FLAG_OK, NULL), /* Outlet page */ - { "outlet.id", 0, 1, NULL, "0", SU_FLAG_STATIC | SU_FLAG_ABSENT | SU_FLAG_OK, NULL }, - { "outlet.desc", ST_FLAG_RW | ST_FLAG_STRING, 20, NULL, "All outlets", - SU_FLAG_STATIC | SU_FLAG_ABSENT | SU_FLAG_OK, NULL }, - { "outlet.count", 0, 1, ".1.3.6.1.4.1.10418.17.2.5.3.1.8.1.%i", "0", SU_FLAG_STATIC | SU_FLAG_ZEROINVALID | SU_FLAG_OK, NULL }, + snmp_info_default("outlet.id", 0, 1, NULL, "0", SU_FLAG_STATIC | SU_FLAG_ABSENT | SU_FLAG_OK, NULL), + snmp_info_default("outlet.desc", ST_FLAG_RW | ST_FLAG_STRING, 20, NULL, "All outlets", + SU_FLAG_STATIC | SU_FLAG_ABSENT | SU_FLAG_OK, NULL), + snmp_info_default("outlet.count", 0, 1, ".1.3.6.1.4.1.10418.17.2.5.3.1.8.1.%i", "0", SU_FLAG_STATIC | SU_FLAG_ZEROINVALID | SU_FLAG_OK, NULL), /* outlets */ /* NOTE: there is a bug in Avocent FW: * index '0' should not respond (and is not in subtree mode) but answers * to unitary get, since OIDs start at index '1'. *Use the status data below to test since '0' is not a supported value */ - { "outlet.%i.status", ST_FLAG_STRING, SU_INFOSIZE, - ".1.3.6.1.4.1.10418.17.2.5.5.1.5.1.%i.%i", NULL, SU_OUTLET | SU_TYPE_DAISY_1 | SU_FLAG_ZEROINVALID, &avocent_outlet_status_info[0] }, - { "outlet.%i.id", 0, 1, - ".1.3.6.1.4.1.10418.17.2.5.5.1.3.1.%i.%i", NULL, SU_FLAG_STATIC | SU_FLAG_ABSENT | SU_FLAG_OK | SU_OUTLET | SU_TYPE_DAISY_1, NULL }, - { "outlet.%i.desc", ST_FLAG_RW | ST_FLAG_STRING, SU_INFOSIZE, - ".1.3.6.1.4.1.10418.17.2.5.5.1.4.1.%i.%i", NULL, SU_OUTLET | SU_TYPE_DAISY_1 | SU_FLAG_NAINVALID, NULL }, + snmp_info_default("outlet.%i.status", ST_FLAG_STRING, SU_INFOSIZE, + ".1.3.6.1.4.1.10418.17.2.5.5.1.5.1.%i.%i", NULL, SU_OUTLET | SU_TYPE_DAISY_1 | SU_FLAG_ZEROINVALID, &avocent_outlet_status_info[0]), + snmp_info_default("outlet.%i.id", 0, 1, + ".1.3.6.1.4.1.10418.17.2.5.5.1.3.1.%i.%i", NULL, SU_FLAG_STATIC | SU_FLAG_ABSENT | SU_FLAG_OK | SU_OUTLET | SU_TYPE_DAISY_1, NULL), + snmp_info_default("outlet.%i.desc", ST_FLAG_RW | ST_FLAG_STRING, SU_INFOSIZE, + ".1.3.6.1.4.1.10418.17.2.5.5.1.4.1.%i.%i", NULL, SU_OUTLET | SU_TYPE_DAISY_1 | SU_FLAG_NAINVALID, NULL), /* pmPowerMgmtOutletsTableCurrentValue.1.1.1; Value (Integer): 0 */ - { "outlet.%i.current", 0, 0.1, - ".1.3.6.1.4.1.10418.17.2.5.5.1.50.1.%i.%i", NULL, SU_OUTLET | SU_TYPE_DAISY_1, NULL }, + snmp_info_default("outlet.%i.current", 0, 0.1, + ".1.3.6.1.4.1.10418.17.2.5.5.1.50.1.%i.%i", NULL, SU_OUTLET | SU_TYPE_DAISY_1, NULL), /* pmPowerMgmtOutletsTableCurrentHighCritical.1.1.1; Value (Integer): 160 */ - { "outlet.%i.current.high.critical", ST_FLAG_RW, 0.1, + snmp_info_default("outlet.%i.current.high.critical", ST_FLAG_RW, 0.1, ".1.3.6.1.4.1.10418.17.2.5.5.1.100.1.%i.%i", - NULL, SU_OUTLET | SU_TYPE_DAISY_1, NULL }, + NULL, SU_OUTLET | SU_TYPE_DAISY_1, NULL), /* pmPowerMgmtOutletsTableCurrentHighWarning.1.1.1; Value (Integer): 120 */ - { "outlet.%i.current.high.warning", ST_FLAG_RW, 0.1, + snmp_info_default("outlet.%i.current.high.warning", ST_FLAG_RW, 0.1, ".1.3.6.1.4.1.10418.17.2.5.5.1.101.1.%i.%i", - NULL, SU_OUTLET | SU_TYPE_DAISY_1, NULL }, + NULL, SU_OUTLET | SU_TYPE_DAISY_1, NULL), /* pmPowerMgmtOutletsTableCurrentLowWarning.1.1.1; Value (Integer): 0 */ - { "outlet.%i.current.low.warning", ST_FLAG_RW, 0.1, + snmp_info_default("outlet.%i.current.low.warning", ST_FLAG_RW, 0.1, ".1.3.6.1.4.1.10418.17.2.5.5.1.102.1.%i.%i", - NULL, SU_OUTLET | SU_TYPE_DAISY_1, NULL }, + NULL, SU_OUTLET | SU_TYPE_DAISY_1, NULL), /* pmPowerMgmtOutletsTableCurrentLowCritical.1.1.1; Value (Integer): 0 */ - { "outlet.%i.current.low.critical", ST_FLAG_RW, 0.1, + snmp_info_default("outlet.%i.current.low.critical", ST_FLAG_RW, 0.1, ".1.3.6.1.4.1.10418.17.2.5.5.1.103.1.%i.%i", - NULL, SU_OUTLET | SU_TYPE_DAISY_1, NULL }, + NULL, SU_OUTLET | SU_TYPE_DAISY_1, NULL), /* pmPowerMgmtOutletsTablePowerValue.1.1.1; Value (Integer): 0 */ - { "outlet.%i.realpower", 0, 0.1, - ".1.3.6.1.4.1.10418.17.2.5.5.1.60.1.%i.%i", NULL, SU_OUTLET | SU_TYPE_DAISY_1, NULL }, + snmp_info_default("outlet.%i.realpower", 0, 0.1, + ".1.3.6.1.4.1.10418.17.2.5.5.1.60.1.%i.%i", NULL, SU_OUTLET | SU_TYPE_DAISY_1, NULL), /* pmPowerMgmtOutletsTableVoltageValue.1.1.1; Value (Integer): 238 */ - { "outlet.%i.voltage", 0, 1, - ".1.3.6.1.4.1.10418.17.2.5.5.1.70.1.%i.%i", NULL, SU_OUTLET | SU_TYPE_DAISY_1, NULL }, + snmp_info_default("outlet.%i.voltage", 0, 1, + ".1.3.6.1.4.1.10418.17.2.5.5.1.70.1.%i.%i", NULL, SU_OUTLET | SU_TYPE_DAISY_1, NULL), /* TODO: handle statistics * pmPowerMgmtOutletsTableEnergyValue.1.1.1; Value (Integer): 0 (Wh) @@ -166,8 +166,8 @@ static snmp_info_t emerson_avocent_pdu_mib[] = { /* Outlet groups collection */ /* pmPowerMgmtNumberOfOutletGroup.0; Value (Integer): 0 */ - { "outlet.group.count", 0, 1, ".1.3.6.1.4.1.10418.17.2.5.6.%i", - "0", SU_FLAG_STATIC | SU_TYPE_DAISY_1, NULL }, + snmp_info_default("outlet.group.count", 0, 1, ".1.3.6.1.4.1.10418.17.2.5.6.%i", + "0", SU_FLAG_STATIC | SU_TYPE_DAISY_1, NULL), /* TODO: support for "Banks" (not sure to understand what is this?!) * pmPowerMgmtTotalNumberOfBanks.0; Value (Integer): 6 @@ -182,12 +182,12 @@ static snmp_info_t emerson_avocent_pdu_mib[] = { * powerLock(5), * powerUnlock(6) */ - { "outlet.%i.load.cycle", 0, 1, ".1.3.6.1.4.1.10418.17.2.5.5.1.6.1.%i.%i", "4", SU_TYPE_CMD | SU_OUTLET | SU_TYPE_DAISY_1, NULL }, - { "outlet.%i.load.off", 0, 1, ".1.3.6.1.4.1.10418.17.2.5.5.1.6.1.%i.%i", "3", SU_TYPE_CMD | SU_OUTLET | SU_TYPE_DAISY_1, NULL }, - { "outlet.%i.load.on", 0, 1, ".1.3.6.1.4.1.10418.17.2.5.5.1.6.1.%i.%i", "2", SU_TYPE_CMD | SU_OUTLET | SU_TYPE_DAISY_1, NULL }, + snmp_info_default("outlet.%i.load.cycle", 0, 1, ".1.3.6.1.4.1.10418.17.2.5.5.1.6.1.%i.%i", "4", SU_TYPE_CMD | SU_OUTLET | SU_TYPE_DAISY_1, NULL), + snmp_info_default("outlet.%i.load.off", 0, 1, ".1.3.6.1.4.1.10418.17.2.5.5.1.6.1.%i.%i", "3", SU_TYPE_CMD | SU_OUTLET | SU_TYPE_DAISY_1, NULL), + snmp_info_default("outlet.%i.load.on", 0, 1, ".1.3.6.1.4.1.10418.17.2.5.5.1.6.1.%i.%i", "2", SU_TYPE_CMD | SU_OUTLET | SU_TYPE_DAISY_1, NULL), /* end of structure. */ - { NULL, 0, 0, NULL, NULL, 0, NULL } + snmp_info_sentinel }; mib2nut_info_t emerson_avocent_pdu = { "emerson_avocent_pdu", EMERSON_AVOCENT_MIB_VERSION, NULL, EMERSON_AVOCENT_OID_MODEL_NAME, emerson_avocent_pdu_mib, EMERSON_AVOCENT_SYSOID, NULL }; diff --git a/drivers/ever-hid.c b/drivers/ever-hid.c index a455e618df..ed4c439164 100644 --- a/drivers/ever-hid.c +++ b/drivers/ever-hid.c @@ -41,6 +41,10 @@ /* ST Microelectronics */ #define STMICRO_VENDORID 0x0483 +/* Please note that USB vendor ID 0x0483 is from ST Microelectronics - + * with actual product IDs delegated to different OEMs. + * Devices handled in this driver are marketed under Ever brand. + */ /* USB IDs device table */ static usb_device_id_t ever_usb_device_table[] = { diff --git a/drivers/hpe-pdu-mib.c b/drivers/hpe-pdu-mib.c index a0b60adb3d..ad2960f735 100644 --- a/drivers/hpe-pdu-mib.c +++ b/drivers/hpe-pdu-mib.c @@ -24,255 +24,256 @@ #include "hpe-pdu-mib.h" #include "dstate.h" -#define HPE_EPDU_MIB_VERSION "0.33" +#define HPE_EPDU_MIB_VERSION "0.34" #define HPE_EPDU_MIB_SYSOID ".1.3.6.1.4.1.232.165.7" #define HPE_EPDU_OID_MODEL_NAME ".1.3.6.1.4.1.232.165.7.1.2.1.3.0" static info_lkp_t hpe_pdu_outlet_status_info[] = { - { 1, "off", NULL, NULL }, - { 2, "on", NULL, NULL }, - { 3, "pendingOff", NULL, NULL }, /* transitional status */ - { 4, "pendingOn", NULL, NULL }, /* transitional status */ - { 0, NULL, NULL, NULL } + info_lkp_default(1, "off"), + info_lkp_default(2, "on"), + info_lkp_default(3, "pendingOff"), /* transitional status */ + info_lkp_default(4, "pendingOn"), /* transitional status */ + info_lkp_sentinel }; static info_lkp_t hpe_pdu_outletgroups_status_info[] = { - { 1, "N/A", NULL, NULL }, /* notApplicable, if group.type == outlet-section */ - { 2, "on", NULL, NULL }, /* breakerOn */ - { 3, "off", NULL, NULL }, /* breakerOff */ - { 0, NULL, NULL, NULL } + info_lkp_default(1, "N/A"), /* notApplicable, if group.type == outlet-section */ + info_lkp_default(2, "on"), /* breakerOn */ + info_lkp_default(3, "off"), /* breakerOff */ + info_lkp_sentinel }; static info_lkp_t hpe_pdu_outlet_switchability_info[] = { - { 1, "yes", NULL, NULL }, - { 2, "no", NULL, NULL }, - { 0, NULL, NULL, NULL } + info_lkp_default(1, "yes"), + info_lkp_default(2, "no"), + info_lkp_sentinel }; /* The physical type of outlet */ static info_lkp_t hpe_pdu_outlet_type_info[] = { - { 0, "unknown", NULL, NULL }, - { 1, "iecC13", NULL, NULL }, - { 2, "iecC19", NULL, NULL }, - { 10, "uk", NULL, NULL }, - { 11, "french", NULL, NULL }, - { 12, "schuko", NULL, NULL }, - { 20, "nema515", NULL, NULL }, - { 21, "nema51520", NULL, NULL }, - { 22, "nema520", NULL, NULL }, - { 23, "nemaL520", NULL, NULL }, - { 24, "nemaL530", NULL, NULL }, - { 25, "nema615", NULL, NULL }, - { 26, "nema620", NULL, NULL }, - { 27, "nemaL620", NULL, NULL }, - { 28, "nemaL630", NULL, NULL }, - { 29, "nemaL715", NULL, NULL }, - { 30, "rf203p277", NULL, NULL }, - { 0, NULL, NULL, NULL } + info_lkp_default(0, "unknown"), + info_lkp_default(1, "iecC13"), + info_lkp_default(2, "iecC19"), + info_lkp_default(10, "uk"), + info_lkp_default(11, "french"), + info_lkp_default(12, "schuko"), + info_lkp_default(20, "nema515"), + info_lkp_default(21, "nema51520"), + info_lkp_default(22, "nema520"), + info_lkp_default(23, "nemaL520"), + info_lkp_default(24, "nemaL530"), + info_lkp_default(25, "nema615"), + info_lkp_default(26, "nema620"), + info_lkp_default(27, "nemaL620"), + info_lkp_default(28, "nemaL630"), + info_lkp_default(29, "nemaL715"), + info_lkp_default(30, "rf203p277"), + info_lkp_sentinel }; static info_lkp_t hpe_pdu_ambient_presence_info[] = { - { -1, "unknown", NULL, NULL }, - { 1, "no", NULL, NULL }, /* disconnected */ - { 2, "yes", NULL, NULL }, /* connected */ - { 0, NULL, NULL, NULL } + info_lkp_default(-1, "unknown"), + info_lkp_default(1, "no"), /* disconnected */ + info_lkp_default(2, "yes"), /* connected */ + info_lkp_sentinel }; static info_lkp_t hpe_pdu_threshold_status_info[] = { - { 1, "good", NULL, NULL }, /* No threshold triggered */ - { 2, "warning-low", NULL, NULL }, /* Warning low threshold triggered */ - { 3, "critical-low", NULL, NULL }, /* Critical low threshold triggered */ - { 4, "warning-high", NULL, NULL }, /* Warning high threshold triggered */ - { 5, "critical-high", NULL, NULL }, /* Critical high threshold triggered */ - { 0, NULL, NULL, NULL } + info_lkp_default(1, "good"), /* No threshold triggered */ + info_lkp_default(2, "warning-low"), /* Warning low threshold triggered */ + info_lkp_default(3, "critical-low"), /* Critical low threshold triggered */ + info_lkp_default(4, "warning-high"), /* Warning high threshold triggered */ + info_lkp_default(5, "critical-high"), /* Critical high threshold triggered */ + info_lkp_sentinel }; static info_lkp_t hpe_pdu_threshold_frequency_status_info[] = { - { 1, "good", NULL, NULL }, /* No threshold triggered */ - { 2, "out-of-range", NULL, NULL }, /* Frequency out of range triggered */ - { 0, NULL, NULL, NULL } + info_lkp_default(1, "good"), /* No threshold triggered */ + info_lkp_default(2, "out-of-range"), /* Frequency out of range triggered */ + info_lkp_sentinel }; static info_lkp_t hpe_pdu_ambient_drycontacts_info[] = { - { -1, "unknown", NULL, NULL }, - { 0, "unknown", NULL, NULL }, - { 1, "open", NULL, NULL }, - { 2, "closed", NULL, NULL }, - { 3, "bad", NULL, NULL }, /* FIXME: what to do with that? */ - { 0, NULL, NULL, NULL } + info_lkp_default(-1, "unknown"), + info_lkp_default(0, "unknown"), + info_lkp_default(1, "opened"), + info_lkp_default(2, "closed"), + info_lkp_default(3, "bad"), + /* FIXME: what to do with that? */ + info_lkp_sentinel }; static info_lkp_t hpe_pdu_threshold_voltage_alarms_info[] = { - { 1, "", NULL, NULL }, /* No threshold triggered */ - { 2, "low voltage warning!", NULL, NULL }, /* Warning low threshold triggered */ - { 3, "low voltage critical!", NULL, NULL }, /* Critical low threshold triggered */ - { 4, "high voltage warning!", NULL, NULL }, /* Warning high threshold triggered */ - { 5, "high voltage critical!", NULL, NULL }, /* Critical high threshold triggered */ - { 0, NULL, NULL, NULL } + info_lkp_default(1, ""), /* No threshold triggered */ + info_lkp_default(2, "low voltage warning!"), /* Warning low threshold triggered */ + info_lkp_default(3, "low voltage critical!"), /* Critical low threshold triggered */ + info_lkp_default(4, "high voltage warning!"), /* Warning high threshold triggered */ + info_lkp_default(5, "high voltage critical!"), /* Critical high threshold triggered */ + info_lkp_sentinel }; static info_lkp_t hpe_pdu_threshold_current_alarms_info[] = { - { 1, "", NULL, NULL }, /* No threshold triggered */ - { 2, "low current warning!", NULL, NULL }, /* Warning low threshold triggered */ - { 3, "low current critical!", NULL, NULL }, /* Critical low threshold triggered */ - { 4, "high current warning!", NULL, NULL }, /* Warning high threshold triggered */ - { 5, "high current critical!", NULL, NULL }, /* Critical high threshold triggered */ - { 0, NULL, NULL, NULL } + info_lkp_default(1, ""), /* No threshold triggered */ + info_lkp_default(2, "low current warning!"), /* Warning low threshold triggered */ + info_lkp_default(3, "low current critical!"), /* Critical low threshold triggered */ + info_lkp_default(4, "high current warning!"), /* Warning high threshold triggered */ + info_lkp_default(5, "high current critical!"), /* Critical high threshold triggered */ + info_lkp_sentinel }; static info_lkp_t hpe_pdu_threshold_frequency_alarm_info[] = { - { 1, "", NULL, NULL }, /* No threshold triggered */ - { 2, "frequency out of range!", NULL, NULL }, /* Frequency out of range triggered */ - { 0, NULL, NULL, NULL } + info_lkp_default(1, ""), /* No threshold triggered */ + info_lkp_default(2, "frequency out of range!"), /* Frequency out of range triggered */ + info_lkp_sentinel }; static info_lkp_t hpe_pdu_threshold_temperature_alarms_info[] = { - { 1, "", NULL, NULL }, /* No threshold triggered */ - { 2, "low temperature warning!", NULL, NULL }, /* Warning low threshold triggered */ - { 3, "low temperature critical!", NULL, NULL }, /* Critical low threshold triggered */ - { 4, "high temperature warning!", NULL, NULL }, /* Warning high threshold triggered */ - { 5, "high temperature critical!", NULL, NULL }, /* Critical high threshold triggered */ - { 0, NULL, NULL, NULL } + info_lkp_default(1, ""), /* No threshold triggered */ + info_lkp_default(2, "low temperature warning!"), /* Warning low threshold triggered */ + info_lkp_default(3, "low temperature critical!"), /* Critical low threshold triggered */ + info_lkp_default(4, "high temperature warning!"), /* Warning high threshold triggered */ + info_lkp_default(5, "high temperature critical!"), /* Critical high threshold triggered */ + info_lkp_sentinel }; static info_lkp_t hpe_pdu_threshold_humidity_alarms_info[] = { - { 1, "", NULL, NULL }, /* No threshold triggered */ - { 2, "low humidity warning!", NULL, NULL }, /* Warning low threshold triggered */ - { 3, "low humidity critical!", NULL, NULL }, /* Critical low threshold triggered */ - { 4, "high humidity warning!", NULL, NULL }, /* Warning high threshold triggered */ - { 5, "high humidity critical!", NULL, NULL }, /* Critical high threshold triggered */ - { 0, NULL, NULL, NULL } + info_lkp_default(1, ""), /* No threshold triggered */ + info_lkp_default(2, "low humidity warning!"), /* Warning low threshold triggered */ + info_lkp_default(3, "low humidity critical!"), /* Critical low threshold triggered */ + info_lkp_default(4, "high humidity warning!"), /* Warning high threshold triggered */ + info_lkp_default(5, "high humidity critical!"), /* Critical high threshold triggered */ + info_lkp_sentinel }; static info_lkp_t hpe_pdu_outlet_group_type_info[] = { - { 0, "unknown", NULL, NULL }, - { 1, "unknown", NULL, NULL }, - { 2, "breaker1pole", NULL, NULL }, - { 3, "breaker2pole", NULL, NULL }, - { 4, "breaker3pole", NULL, NULL }, - { 5, "outlet-section", NULL, NULL }, - { 0, NULL, NULL, NULL } + info_lkp_default(0, "unknown"), + info_lkp_default(1, "unknown"), + info_lkp_default(2, "breaker1pole"), + info_lkp_default(3, "breaker2pole"), + info_lkp_default(4, "breaker3pole"), + info_lkp_default(5, "outlet-section"), + info_lkp_sentinel }; static info_lkp_t hpe_pdu_input_type_info[] = { - { 1, "1", NULL, NULL }, /* singlePhase */ - { 2, "2", NULL, NULL }, /* splitPhase */ - { 3, "3", NULL, NULL }, /* threePhaseDelta */ - { 4, "3", NULL, NULL }, /* threePhaseWye */ - { 0, NULL, NULL, NULL } + info_lkp_default(1, "1"), /* singlePhase */ + info_lkp_default(2, "2"), /* splitPhase */ + info_lkp_default(3, "3"), /* threePhaseDelta */ + info_lkp_default(4, "3"), /* threePhaseWye */ + info_lkp_sentinel }; static info_lkp_t hpe_pdu_outlet_group_phase_info[] = { - { 1, "L1", NULL, NULL }, /* singlePhase */ - { 2, "L1", NULL, NULL }, /* phase1toN */ - { 3, "L2", NULL, NULL }, /* phase2toN */ - { 4, "L3", NULL, NULL }, /* phase3toN */ - { 5, "L1", NULL, NULL }, /* phase1to2 */ - { 6, "L2", NULL, NULL }, /* phase2to3 */ - { 7, "L3", NULL, NULL }, /* phase3to1 */ - { 0, NULL, NULL, NULL } + info_lkp_default(1, "L1"), /* singlePhase */ + info_lkp_default(2, "L1"), /* phase1toN */ + info_lkp_default(3, "L2"), /* phase2toN */ + info_lkp_default(4, "L3"), /* phase3toN */ + info_lkp_default(5, "L1"), /* phase1to2 */ + info_lkp_default(6, "L2"), /* phase2to3 */ + info_lkp_default(7, "L3"), /* phase3to1 */ + info_lkp_sentinel }; /* Snmp2NUT lookup table for HPE PDU MIB */ static snmp_info_t hpe_pdu_mib[] = { /* standard MIB items */ - { "device.description", ST_FLAG_STRING | ST_FLAG_RW, SU_INFOSIZE, ".1.3.6.1.2.1.1.1.0", NULL, SU_FLAG_OK, NULL }, - { "device.contact", ST_FLAG_STRING | ST_FLAG_RW, SU_INFOSIZE, ".1.3.6.1.2.1.1.4.0", NULL, SU_FLAG_OK, NULL }, - { "device.location", ST_FLAG_STRING | ST_FLAG_RW, SU_INFOSIZE, ".1.3.6.1.2.1.1.6.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("device.description", ST_FLAG_STRING | ST_FLAG_RW, SU_INFOSIZE, ".1.3.6.1.2.1.1.1.0", NULL, SU_FLAG_OK, NULL), + snmp_info_default("device.contact", ST_FLAG_STRING | ST_FLAG_RW, SU_INFOSIZE, ".1.3.6.1.2.1.1.4.0", NULL, SU_FLAG_OK, NULL), + snmp_info_default("device.location", ST_FLAG_STRING | ST_FLAG_RW, SU_INFOSIZE, ".1.3.6.1.2.1.1.6.0", NULL, SU_FLAG_OK, NULL), /* Device collection */ - { "device.mfr", ST_FLAG_STRING, SU_INFOSIZE, NULL, "HPE", - SU_FLAG_STATIC | SU_FLAG_ABSENT | SU_FLAG_OK, NULL }, + snmp_info_default("device.mfr", ST_FLAG_STRING, SU_INFOSIZE, NULL, "HPE", + SU_FLAG_STATIC | SU_FLAG_ABSENT | SU_FLAG_OK, NULL), /* pdu2Model.0 = STRING: "HP 8.6kVA 208V 30A 3Ph NA/JP maPDU" */ - { "device.model", ST_FLAG_STRING, SU_INFOSIZE, + snmp_info_default("device.model", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.232.165.7.1.2.1.3.%i", - "HPE ePDU", SU_FLAG_STATIC | SU_FLAG_OK, NULL }, + "HPE ePDU", SU_FLAG_STATIC | SU_FLAG_OK, NULL), /* pdu2SerialNumber.0 = STRING: "CN94230105" */ - { "device.serial", ST_FLAG_STRING, SU_INFOSIZE, + snmp_info_default("device.serial", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.232.165.7.1.2.1.7.%i", - "", SU_FLAG_STATIC | SU_FLAG_OK, NULL }, - { "device.type", ST_FLAG_STRING, SU_INFOSIZE, NULL, "pdu", - SU_FLAG_STATIC | SU_FLAG_ABSENT | SU_FLAG_OK, NULL }, + "", SU_FLAG_STATIC | SU_FLAG_OK, NULL), + snmp_info_default("device.type", ST_FLAG_STRING, SU_INFOSIZE, NULL, "pdu", + SU_FLAG_STATIC | SU_FLAG_ABSENT | SU_FLAG_OK, NULL), /* pdu2PartNumber.0 = STRING: "H8B52A" */ - { "device.part", ST_FLAG_STRING, SU_INFOSIZE, + snmp_info_default("device.part", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.232.165.7.1.2.1.6.%i", - "", SU_FLAG_STATIC | SU_FLAG_OK, NULL }, + "", SU_FLAG_STATIC | SU_FLAG_OK, NULL), /* For daisychain, there is only 1 physical interface! */ - { "device.macaddr", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.2.1.2.2.1.6.2", - "", SU_FLAG_STATIC | SU_FLAG_OK, NULL }, + snmp_info_default("device.macaddr", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.2.1.2.2.1.6.2", + "", SU_FLAG_STATIC | SU_FLAG_OK, NULL), /* Daisychained devices support * Notes: this definition is used to: * - estimate the number of devices, based on the below OID iteration capabilities * - determine the base index of the SNMP OID (ie 0 or 1) */ /* pdu2NumberPDU.0 = INTEGER: 1 */ - { "device.count", 0, 1, + snmp_info_default("device.count", 0, 1, ".1.3.6.1.4.1.232.165.7.1.1.0", - "1", SU_FLAG_STATIC, NULL }, + "1", SU_FLAG_STATIC, NULL), /* UPS collection */ - { "ups.mfr", ST_FLAG_STRING, SU_INFOSIZE, NULL, "HPE", - SU_FLAG_STATIC | SU_FLAG_ABSENT | SU_FLAG_OK, NULL }, - { "ups.model", ST_FLAG_STRING, SU_INFOSIZE, + snmp_info_default("ups.mfr", ST_FLAG_STRING, SU_INFOSIZE, NULL, "HPE", + SU_FLAG_STATIC | SU_FLAG_ABSENT | SU_FLAG_OK, NULL), + snmp_info_default("ups.model", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.232.165.7.1.2.1.3.%i", - "HPE ePDU", SU_FLAG_STATIC | SU_FLAG_OK, NULL }, + "HPE ePDU", SU_FLAG_STATIC | SU_FLAG_OK, NULL), /* FIXME: use unitName.0 (ePDU)? - * { "ups.id", ST_FLAG_STRING, SU_INFOSIZE, AR_OID_DEVICE_NAME, - "unknown", SU_FLAG_STATIC | SU_FLAG_OK, NULL, NULL }, */ - { "ups.serial", ST_FLAG_STRING, SU_INFOSIZE, + * snmp_info_default("ups.id", ST_FLAG_STRING, SU_INFOSIZE, AR_OID_DEVICE_NAME, + "unknown", SU_FLAG_STATIC | SU_FLAG_OK, NULL, NULL), */ + snmp_info_default("ups.serial", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.232.165.7.1.2.1.7.%i", - "", SU_FLAG_STATIC | SU_FLAG_OK, NULL }, + "", SU_FLAG_STATIC | SU_FLAG_OK, NULL), /* FIXME: this entry should be SU_FLAG_SEMI_STATIC */ /* pdu2FirmwareVersion.0 = STRING: "02.00.0043" */ - { "ups.firmware", ST_FLAG_STRING, SU_INFOSIZE, + snmp_info_default("ups.firmware", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.232.165.7.1.2.1.5.%i", - "", SU_FLAG_OK, NULL }, - { "ups.type", ST_FLAG_STRING, SU_INFOSIZE, NULL, "pdu", - SU_FLAG_STATIC | SU_FLAG_ABSENT | SU_FLAG_OK, NULL }, + "", SU_FLAG_OK, NULL), + snmp_info_default("ups.type", ST_FLAG_STRING, SU_INFOSIZE, NULL, "pdu", + SU_FLAG_STATIC | SU_FLAG_ABSENT | SU_FLAG_OK, NULL), /* FIXME: needs a date reformatting callback * 2011-8-29,16:27:25.0,+1:0 * Hex-STRING: 07 DB 08 1D 10 0C 36 00 2B 01 00 00 - * { "ups.date", ST_FLAG_STRING, SU_INFOSIZE, + * snmp_info_default("ups.date", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.6.6.7.1.2.1.8.0", - "", SU_FLAG_STATIC | SU_FLAG_OK, NULL }, - * { "ups.time", ST_FLAG_STRING, SU_INFOSIZE, + "", SU_FLAG_STATIC | SU_FLAG_OK, NULL), + * snmp_info_default("ups.time", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.6.6.7.1.2.1.8.0", - "", SU_FLAG_STATIC | SU_FLAG_OK, NULL }, + "", SU_FLAG_STATIC | SU_FLAG_OK, NULL), */ /* Input collection */ /* Note: for daisychain mode, we must handle phase(s) per device, not as a whole */ /* pdu2InputType.0 = INTEGER: threePhaseWye(4) */ - { "input.phases", 0, 1, ".1.3.6.1.4.1.232.165.7.2.1.1.1.%i", - NULL, SU_FLAG_STATIC, &hpe_pdu_input_type_info[0] }, + snmp_info_default("input.phases", 0, 1, ".1.3.6.1.4.1.232.165.7.2.1.1.1.%i", + NULL, SU_FLAG_STATIC, &hpe_pdu_input_type_info[0]), /* Frequency is measured globally */ /* pdu2InputFrequency.0 = INTEGER: 500 */ - { "input.frequency", 0, 0.1, ".1.3.6.1.4.1.232.165.7.2.1.1.2.%i", - NULL, 0, NULL }, + snmp_info_default("input.frequency", 0, 0.1, ".1.3.6.1.4.1.232.165.7.2.1.1.2.%i", + NULL, 0, NULL), /* pdu2InputFrequencyStatus.0 = INTEGER: good(1) */ - { "input.frequency.status", ST_FLAG_STRING, SU_INFOSIZE, + snmp_info_default("input.frequency.status", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.232.165.7.2.1.1.3.%i", - NULL, SU_FLAG_OK, &hpe_pdu_threshold_frequency_status_info[0] }, - { "ups.alarm", ST_FLAG_STRING, SU_INFOSIZE, + NULL, SU_FLAG_OK, &hpe_pdu_threshold_frequency_status_info[0]), + snmp_info_default("ups.alarm", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.232.165.7.2.1.1.3.%i", - NULL, SU_FLAG_OK, &hpe_pdu_threshold_frequency_alarm_info[0] }, + NULL, SU_FLAG_OK, &hpe_pdu_threshold_frequency_alarm_info[0]), /* inputCurrentPercentLoad (measured globally) * Current percent load, based on the rated current capacity */ /* FIXME: input.load is mapped on input.L1.load for both single and 3phase !!! */ - { "input.load", 0, 1.0, ".1.3.6.1.4.1.534.6.6.7.3.3.1.11.%i.1.1", - NULL, SU_FLAG_NEGINVALID | SU_FLAG_OK, NULL }, + snmp_info_default("input.load", 0, 1.0, ".1.3.6.1.4.1.534.6.6.7.3.3.1.11.%i.1.1", + NULL, SU_FLAG_NEGINVALID | SU_FLAG_OK, NULL), /* pdu2InputPhaseCurrentPercentLoad.0.1 = INTEGER: 0 */ - { "input.L1.load", 0, 1.0, ".1.3.6.1.4.1.232.165.7.2.2.1.18.%i.1", - NULL, SU_FLAG_NEGINVALID | SU_FLAG_OK, NULL }, + snmp_info_default("input.L1.load", 0, 1.0, ".1.3.6.1.4.1.232.165.7.2.2.1.18.%i.1", + NULL, SU_FLAG_NEGINVALID | SU_FLAG_OK, NULL), /* pdu2InputPhaseCurrentPercentLoad.0.2 = INTEGER: 0 */ - { "input.L1.load", 0, 1.0, ".1.3.6.1.4.1.232.165.7.2.2.1.18.%i.2", - NULL, SU_FLAG_NEGINVALID | SU_FLAG_OK, NULL }, + snmp_info_default("input.L1.load", 0, 1.0, ".1.3.6.1.4.1.232.165.7.2.2.1.18.%i.2", + NULL, SU_FLAG_NEGINVALID | SU_FLAG_OK, NULL), /* pdu2InputPhaseCurrentPercentLoad.0.3 = INTEGER: 0 */ - { "input.L1.load", 0, 1.0, ".1.3.6.1.4.1.232.165.7.2.2.1.18.%i.3", - NULL, SU_FLAG_NEGINVALID | SU_FLAG_OK, NULL }, + snmp_info_default("input.L1.load", 0, 1.0, ".1.3.6.1.4.1.232.165.7.2.2.1.18.%i.3", + NULL, SU_FLAG_NEGINVALID | SU_FLAG_OK, NULL), /* FIXME: * - Voltage is only measured per phase, as mV! @@ -283,624 +284,624 @@ static snmp_info_t hpe_pdu_mib[] = { * INTEGER {singlePhase (1),phase1toN (2),phase2toN (3),phase3toN (4),phase1to2 (5),phase2to3 (6),phase3to1 (7) * => RFC input.Lx.voltage.context */ /* pdu2InputPhaseVoltage.0.1 = INTEGER: 216790 */ - { "input.voltage", 0, 0.001, ".1.3.6.1.4.1.232.165.7.2.2.1.3.%i.1", - NULL, 0, NULL }, + snmp_info_default("input.voltage", 0, 0.001, ".1.3.6.1.4.1.232.165.7.2.2.1.3.%i.1", + NULL, 0, NULL), /* pdu2InputPhaseVoltageThStatus.0.1 = INTEGER: good(1) */ - { "input.voltage.status", ST_FLAG_STRING, SU_INFOSIZE, + snmp_info_default("input.voltage.status", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.232.165.7.2.2.1.4.%i.1", - NULL, SU_FLAG_OK, &hpe_pdu_threshold_status_info[0] }, - { "ups.alarm", ST_FLAG_STRING, SU_INFOSIZE, + NULL, SU_FLAG_OK, &hpe_pdu_threshold_status_info[0]), + snmp_info_default("ups.alarm", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.232.165.7.2.2.1.4.%i.1", - NULL, SU_FLAG_OK, &hpe_pdu_threshold_voltage_alarms_info[0] }, + NULL, SU_FLAG_OK, &hpe_pdu_threshold_voltage_alarms_info[0]), /* pdu2InputPhaseVoltageThLowerWarning.0.1 = INTEGER: 190000 */ - { "input.voltage.low.warning", ST_FLAG_RW, 0.001, + snmp_info_default("input.voltage.low.warning", ST_FLAG_RW, 0.001, ".1.3.6.1.4.1.232.165.7.2.2.1.5.%i.1", - NULL, SU_FLAG_NEGINVALID, NULL }, + NULL, SU_FLAG_NEGINVALID, NULL), /* pdu2InputPhaseVoltageThLowerCritical.0.1 = INTEGER: 180000 */ - { "input.voltage.low.critical", ST_FLAG_RW, 0.001, + snmp_info_default("input.voltage.low.critical", ST_FLAG_RW, 0.001, ".1.3.6.1.4.1.232.165.7.2.2.1.6.%i.1", - NULL, SU_FLAG_NEGINVALID, NULL }, + NULL, SU_FLAG_NEGINVALID, NULL), /* pdu2InputPhaseVoltageThUpperWarning.0.1 = INTEGER: 255000 */ - { "input.voltage.high.warning", ST_FLAG_RW, 0.001, + snmp_info_default("input.voltage.high.warning", ST_FLAG_RW, 0.001, ".1.3.6.1.4.1.232.165.7.2.2.1.7.%i.1", - NULL, SU_FLAG_NEGINVALID, NULL }, + NULL, SU_FLAG_NEGINVALID, NULL), /* pdu2InputPhaseVoltageThUpperCritical.0.1 = INTEGER: 265000 */ - { "input.voltage.high.critical", ST_FLAG_RW, 0.001, + snmp_info_default("input.voltage.high.critical", ST_FLAG_RW, 0.001, ".1.3.6.1.4.1.232.165.7.2.2.1.8.%i.1", - NULL, SU_FLAG_NEGINVALID, NULL }, + NULL, SU_FLAG_NEGINVALID, NULL), /* pdu2InputPhaseVoltage.0.1 = INTEGER: 216790 */ - { "input.L1.voltage", 0, 0.001, ".1.3.6.1.4.1.232.165.7.2.2.1.3.%i.1", - NULL, 0, NULL }, + snmp_info_default("input.L1.voltage", 0, 0.001, ".1.3.6.1.4.1.232.165.7.2.2.1.3.%i.1", + NULL, 0, NULL), /* pdu2InputPhaseVoltageThStatus.0.1 = INTEGER: good(1) */ - { "input.L1.voltage.status", ST_FLAG_STRING, SU_INFOSIZE, + snmp_info_default("input.L1.voltage.status", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.232.165.7.2.2.1.4.%i.1", - NULL, SU_FLAG_OK, &hpe_pdu_threshold_status_info[0] }, - { "L1.alarm", ST_FLAG_STRING, SU_INFOSIZE, + NULL, SU_FLAG_OK, &hpe_pdu_threshold_status_info[0]), + snmp_info_default("L1.alarm", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.232.165.7.2.2.1.4.%i.1", - NULL, SU_FLAG_OK, &hpe_pdu_threshold_voltage_alarms_info[0] }, + NULL, SU_FLAG_OK, &hpe_pdu_threshold_voltage_alarms_info[0]), /* pdu2InputPhaseVoltageThLowerWarning.0.1 = INTEGER: 190000 */ - { "input.L1.voltage.low.warning", ST_FLAG_RW, 0.001, + snmp_info_default("input.L1.voltage.low.warning", ST_FLAG_RW, 0.001, ".1.3.6.1.4.1.232.165.7.2.2.1.5.%i.1", - NULL, SU_FLAG_NEGINVALID, NULL }, + NULL, SU_FLAG_NEGINVALID, NULL), /* pdu2InputPhaseVoltageThLowerCritical.0.1 = INTEGER: 180000 */ - { "input.L1.voltage.low.critical", ST_FLAG_RW, 0.001, + snmp_info_default("input.L1.voltage.low.critical", ST_FLAG_RW, 0.001, ".1.3.6.1.4.1.232.165.7.2.2.1.6.%i.1", - NULL, SU_FLAG_NEGINVALID, NULL }, + NULL, SU_FLAG_NEGINVALID, NULL), /* pdu2InputPhaseVoltageThUpperWarning.0.1 = INTEGER: 255000 */ - { "input.L1.voltage.high.warning", ST_FLAG_RW, 0.001, + snmp_info_default("input.L1.voltage.high.warning", ST_FLAG_RW, 0.001, ".1.3.6.1.4.1.232.165.7.2.2.1.7.%i.1", - NULL, SU_FLAG_NEGINVALID, NULL }, + NULL, SU_FLAG_NEGINVALID, NULL), /* pdu2InputPhaseVoltageThUpperCritical.0.1 = INTEGER: 265000 */ - { "input.L1.voltage.high.critical", ST_FLAG_RW, 0.001, + snmp_info_default("input.L1.voltage.high.critical", ST_FLAG_RW, 0.001, ".1.3.6.1.4.1.232.165.7.2.2.1.8.%i.1", - NULL, SU_FLAG_NEGINVALID, NULL }, + NULL, SU_FLAG_NEGINVALID, NULL), /* pdu2InputPhaseVoltage.0.2 = INTEGER: 216790 */ - { "input.L2.voltage", 0, 0.001, ".1.3.6.1.4.1.232.165.7.2.2.1.3.%i.2", - NULL, 0, NULL }, + snmp_info_default("input.L2.voltage", 0, 0.001, ".1.3.6.1.4.1.232.165.7.2.2.1.3.%i.2", + NULL, 0, NULL), /* pdu2InputPhaseVoltageThStatus.0.2 = INTEGER: good(1) */ - { "input.L2.voltage.status", ST_FLAG_STRING, SU_INFOSIZE, + snmp_info_default("input.L2.voltage.status", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.232.165.7.2.2.1.4.%i.2", - NULL, SU_FLAG_OK, &hpe_pdu_threshold_status_info[0] }, - { "L2.alarm", ST_FLAG_STRING, SU_INFOSIZE, + NULL, SU_FLAG_OK, &hpe_pdu_threshold_status_info[0]), + snmp_info_default("L2.alarm", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.232.165.7.2.2.1.4.%i.2", - NULL, SU_FLAG_OK, &hpe_pdu_threshold_voltage_alarms_info[0] }, + NULL, SU_FLAG_OK, &hpe_pdu_threshold_voltage_alarms_info[0]), /* pdu2InputPhaseVoltageThLowerWarning.0.2 = INTEGER: 190000 */ - { "input.L2.voltage.low.warning", ST_FLAG_RW, 0.001, + snmp_info_default("input.L2.voltage.low.warning", ST_FLAG_RW, 0.001, ".1.3.6.1.4.1.232.165.7.2.2.1.5.%i.2", - NULL, SU_FLAG_NEGINVALID, NULL }, + NULL, SU_FLAG_NEGINVALID, NULL), /* pdu2InputPhaseVoltageThLowerCritical.0.2 = INTEGER: 180000 */ - { "input.L2.voltage.low.critical", ST_FLAG_RW, 0.001, + snmp_info_default("input.L2.voltage.low.critical", ST_FLAG_RW, 0.001, ".1.3.6.1.4.1.232.165.7.2.2.1.6.%i.2", - NULL, SU_FLAG_NEGINVALID, NULL }, + NULL, SU_FLAG_NEGINVALID, NULL), /* pdu2InputPhaseVoltageThUpperWarning.0.2 = INTEGER: 255000 */ - { "input.L2.voltage.high.warning", ST_FLAG_RW, 0.001, + snmp_info_default("input.L2.voltage.high.warning", ST_FLAG_RW, 0.001, ".1.3.6.1.4.1.232.165.7.2.2.1.7.%i.2", - NULL, SU_FLAG_NEGINVALID, NULL }, + NULL, SU_FLAG_NEGINVALID, NULL), /* pdu2InputPhaseVoltageThUpperCritical.0.2 = INTEGER: 265000 */ - { "input.L2.voltage.high.critical", ST_FLAG_RW, 0.001, + snmp_info_default("input.L2.voltage.high.critical", ST_FLAG_RW, 0.001, ".1.3.6.1.4.1.232.165.7.2.2.1.8.%i.2", - NULL, SU_FLAG_NEGINVALID, NULL }, + NULL, SU_FLAG_NEGINVALID, NULL), /* pdu2InputPhaseVoltage.0.3 = INTEGER: 216790 */ - { "input.L3.voltage", 0, 0.001, ".1.3.6.1.4.1.232.165.7.2.2.1.3.%i.3", - NULL, 0, NULL }, + snmp_info_default("input.L3.voltage", 0, 0.001, ".1.3.6.1.4.1.232.165.7.2.2.1.3.%i.3", + NULL, 0, NULL), /* pdu2InputPhaseVoltageThStatus.0.3 = INTEGER: good(1) */ - { "input.L3.voltage.status", ST_FLAG_STRING, SU_INFOSIZE, + snmp_info_default("input.L3.voltage.status", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.232.165.7.2.2.1.4.%i.3", - NULL, SU_FLAG_OK, &hpe_pdu_threshold_status_info[0] }, - { "L3.alarm", ST_FLAG_STRING, SU_INFOSIZE, + NULL, SU_FLAG_OK, &hpe_pdu_threshold_status_info[0]), + snmp_info_default("L3.alarm", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.232.165.7.2.2.1.4.%i.3", - NULL, SU_FLAG_OK, &hpe_pdu_threshold_voltage_alarms_info[0] }, + NULL, SU_FLAG_OK, &hpe_pdu_threshold_voltage_alarms_info[0]), /* pdu2InputPhaseVoltageThLowerWarning.0.3 = INTEGER: 190000 */ - { "input.L3.voltage.low.warning", ST_FLAG_RW, 0.001, + snmp_info_default("input.L3.voltage.low.warning", ST_FLAG_RW, 0.001, ".1.3.6.1.4.1.232.165.7.2.2.1.5.%i.3", - NULL, SU_FLAG_NEGINVALID, NULL }, + NULL, SU_FLAG_NEGINVALID, NULL), /* pdu2InputPhaseVoltageThLowerCritical.0.3 = INTEGER: 180000 */ - { "input.L3.voltage.low.critical", ST_FLAG_RW, 0.001, + snmp_info_default("input.L3.voltage.low.critical", ST_FLAG_RW, 0.001, ".1.3.6.1.4.1.232.165.7.2.2.1.6.%i.3", - NULL, SU_FLAG_NEGINVALID, NULL }, + NULL, SU_FLAG_NEGINVALID, NULL), /* pdu2InputPhaseVoltageThUpperWarning.0.3 = INTEGER: 255000 */ - { "input.L3.voltage.high.warning", ST_FLAG_RW, 0.001, + snmp_info_default("input.L3.voltage.high.warning", ST_FLAG_RW, 0.001, ".1.3.6.1.4.1.232.165.7.2.2.1.7.%i.3", - NULL, SU_FLAG_NEGINVALID, NULL }, + NULL, SU_FLAG_NEGINVALID, NULL), /* pdu2InputPhaseVoltageThUpperCritical.0.3 = INTEGER: 265000 */ - { "input.L3.voltage.high.critical", ST_FLAG_RW, 0.001, + snmp_info_default("input.L3.voltage.high.critical", ST_FLAG_RW, 0.001, ".1.3.6.1.4.1.232.165.7.2.2.1.8.%i.3", - NULL, SU_FLAG_NEGINVALID, NULL }, + NULL, SU_FLAG_NEGINVALID, NULL), /* FIXME: * - input.current is mapped on input.L1.current for both single and 3phase !!! */ /* pdu2InputPhaseCurrent.0.1 = INTEGER: 185 */ - { "input.current", 0, 0.001, + snmp_info_default("input.current", 0, 0.001, ".1.3.6.1.4.1.232.165.7.2.2.1.11.%i.1", - NULL, 0, NULL }, + NULL, 0, NULL), /* pdu2InputPhaseCurrentRating.0.1 = INTEGER: 24000 */ - { "input.current.nominal", 0, 0.001, + snmp_info_default("input.current.nominal", 0, 0.001, ".1.3.6.1.4.1.232.165.7.2.2.1.10.%i.1", - NULL, SU_FLAG_NEGINVALID, NULL }, + NULL, SU_FLAG_NEGINVALID, NULL), /* pdu2InputPhaseCurrentThStatus.0.1 = INTEGER: good(1) */ - { "input.current.status", ST_FLAG_STRING, SU_INFOSIZE, + snmp_info_default("input.current.status", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.232.165.7.2.2.1.12.%i.1", - NULL, SU_FLAG_OK, &hpe_pdu_threshold_status_info[0] }, - { "ups.alarm", ST_FLAG_STRING, SU_INFOSIZE, + NULL, SU_FLAG_OK, &hpe_pdu_threshold_status_info[0]), + snmp_info_default("ups.alarm", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.232.165.7.2.2.1.12.%i.1", - NULL, SU_FLAG_OK, &hpe_pdu_threshold_current_alarms_info[0] }, + NULL, SU_FLAG_OK, &hpe_pdu_threshold_current_alarms_info[0]), /* pdu2InputPhaseCurrentThLowerWarning.0.1 = INTEGER: 0 */ - { "input.current.low.warning", ST_FLAG_RW, 0.001, + snmp_info_default("input.current.low.warning", ST_FLAG_RW, 0.001, ".1.3.6.1.4.1.232.165.7.2.2.1.13.%i.1", - NULL, SU_FLAG_NEGINVALID, NULL }, + NULL, SU_FLAG_NEGINVALID, NULL), /* pdu2InputPhaseCurrentThLowerCritical.0.1 = INTEGER: -1 */ - { "input.current.low.critical", ST_FLAG_RW, 0.001, + snmp_info_default("input.current.low.critical", ST_FLAG_RW, 0.001, ".1.3.6.1.4.1.232.165.7.2.2.1.14.%i.1", - NULL, SU_FLAG_NEGINVALID, NULL }, + NULL, SU_FLAG_NEGINVALID, NULL), /* pdu2InputPhaseCurrentThUpperWarning.0.1 = INTEGER: 19200 */ - { "input.current.high.warning", ST_FLAG_RW, 0.001, + snmp_info_default("input.current.high.warning", ST_FLAG_RW, 0.001, ".1.3.6.1.4.1.232.165.7.2.2.1.15.%i.1", - NULL, SU_FLAG_NEGINVALID, NULL }, + NULL, SU_FLAG_NEGINVALID, NULL), /* pdu2InputPhaseCurrentThUpperCritical.0.1 = INTEGER: 24000 */ - { "input.current.high.critical", ST_FLAG_RW, 0.001, + snmp_info_default("input.current.high.critical", ST_FLAG_RW, 0.001, ".1.3.6.1.4.1.232.165.7.2.2.1.16.%i.1", - NULL, SU_FLAG_NEGINVALID, NULL }, + NULL, SU_FLAG_NEGINVALID, NULL), /* pdu2InputPhaseCurrent.0.1 = INTEGER: 185 */ - { "input.L1.current", 0, 0.001, + snmp_info_default("input.L1.current", 0, 0.001, ".1.3.6.1.4.1.232.165.7.2.2.1.11.%i.1", - NULL, 0, NULL }, + NULL, 0, NULL), /* pdu2InputPhaseCurrentRating.0.1 = INTEGER: 24000 */ - { "input.L1.current.nominal", 0, 0.001, + snmp_info_default("input.L1.current.nominal", 0, 0.001, ".1.3.6.1.4.1.232.165.7.2.2.1.10.%i.1", - NULL, SU_FLAG_NEGINVALID, NULL }, + NULL, SU_FLAG_NEGINVALID, NULL), /* pdu2InputPhaseCurrentThStatus.0.1 = INTEGER: good(1) */ - { "input.L1.current.status", ST_FLAG_STRING, SU_INFOSIZE, + snmp_info_default("input.L1.current.status", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.232.165.7.2.2.1.12.%i.1", - NULL, SU_FLAG_OK, &hpe_pdu_threshold_status_info[0] }, - { "L1.alarm", ST_FLAG_STRING, SU_INFOSIZE, + NULL, SU_FLAG_OK, &hpe_pdu_threshold_status_info[0]), + snmp_info_default("L1.alarm", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.232.165.7.2.2.1.12.%i.1", - NULL, SU_FLAG_OK, &hpe_pdu_threshold_current_alarms_info[0] }, + NULL, SU_FLAG_OK, &hpe_pdu_threshold_current_alarms_info[0]), /* pdu2InputPhaseCurrentThLowerWarning.0.1 = INTEGER: 0 */ - { "input.L1.current.low.warning", ST_FLAG_RW, 0.001, + snmp_info_default("input.L1.current.low.warning", ST_FLAG_RW, 0.001, ".1.3.6.1.4.1.232.165.7.2.2.1.13.%i.1", - NULL, SU_FLAG_NEGINVALID, NULL }, + NULL, SU_FLAG_NEGINVALID, NULL), /* pdu2InputPhaseCurrentThLowerCritical.0.1 = INTEGER: -1 */ - { "input.L1.current.low.critical", ST_FLAG_RW, 0.001, + snmp_info_default("input.L1.current.low.critical", ST_FLAG_RW, 0.001, ".1.3.6.1.4.1.232.165.7.2.2.1.14.%i.1", - NULL, SU_FLAG_NEGINVALID, NULL }, + NULL, SU_FLAG_NEGINVALID, NULL), /* pdu2InputPhaseCurrentThUpperWarning.0.1 = INTEGER: 19200 */ - { "input.L1.current.high.warning", ST_FLAG_RW, 0.001, + snmp_info_default("input.L1.current.high.warning", ST_FLAG_RW, 0.001, ".1.3.6.1.4.1.232.165.7.2.2.1.15.%i.1", - NULL, SU_FLAG_NEGINVALID, NULL }, + NULL, SU_FLAG_NEGINVALID, NULL), /* pdu2InputPhaseCurrentThUpperCritical.0.1 = INTEGER: 24000 */ - { "input.L1.current.high.critical", ST_FLAG_RW, 0.001, + snmp_info_default("input.L1.current.high.critical", ST_FLAG_RW, 0.001, ".1.3.6.1.4.1.232.165.7.2.2.1.16.%i.1", - NULL, SU_FLAG_NEGINVALID, NULL }, + NULL, SU_FLAG_NEGINVALID, NULL), /* pdu2InputPhaseCurrent.0.2 = INTEGER: 185 */ - { "input.L2.current", 0, 0.001, + snmp_info_default("input.L2.current", 0, 0.001, ".1.3.6.1.4.1.232.165.7.2.2.1.11.%i.2", - NULL, 0, NULL }, + NULL, 0, NULL), /* pdu2InputPhaseCurrentRating.0.2 = INTEGER: 24000 */ - { "input.L2.current.nominal", 0, 0.001, + snmp_info_default("input.L2.current.nominal", 0, 0.001, ".1.3.6.1.4.1.232.165.7.2.2.1.10.%i.2", - NULL, SU_FLAG_NEGINVALID, NULL }, + NULL, SU_FLAG_NEGINVALID, NULL), /* pdu2InputPhaseCurrentThStatus.0.2 = INTEGER: good(1) */ - { "input.L2.current.status", ST_FLAG_STRING, SU_INFOSIZE, + snmp_info_default("input.L2.current.status", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.232.165.7.2.2.1.12.%i.2", - NULL, SU_FLAG_OK, &hpe_pdu_threshold_status_info[0] }, - { "L2.alarm", ST_FLAG_STRING, SU_INFOSIZE, + NULL, SU_FLAG_OK, &hpe_pdu_threshold_status_info[0]), + snmp_info_default("L2.alarm", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.232.165.7.2.2.1.12.%i.2", - NULL, SU_FLAG_OK, &hpe_pdu_threshold_current_alarms_info[0] }, + NULL, SU_FLAG_OK, &hpe_pdu_threshold_current_alarms_info[0]), /* pdu2InputPhaseCurrentThLowerWarning.0.2 = INTEGER: 0 */ - { "input.L2.current.low.warning", ST_FLAG_RW, 0.001, + snmp_info_default("input.L2.current.low.warning", ST_FLAG_RW, 0.001, ".1.3.6.1.4.1.232.165.7.2.2.1.13.%i.2", - NULL, SU_FLAG_NEGINVALID, NULL }, + NULL, SU_FLAG_NEGINVALID, NULL), /* pdu2InputPhaseCurrentThLowerCritical.0.2 = INTEGER: -1 */ - { "input.L2.current.low.critical", ST_FLAG_RW, 0.001, + snmp_info_default("input.L2.current.low.critical", ST_FLAG_RW, 0.001, ".1.3.6.1.4.1.232.165.7.2.2.1.14.%i.2", - NULL, SU_FLAG_NEGINVALID, NULL }, + NULL, SU_FLAG_NEGINVALID, NULL), /* pdu2InputPhaseCurrentThUpperWarning.0.2 = INTEGER: 19200 */ - { "input.L2.current.high.warning", ST_FLAG_RW, 0.001, + snmp_info_default("input.L2.current.high.warning", ST_FLAG_RW, 0.001, ".1.3.6.1.4.1.232.165.7.2.2.1.15.%i.2", - NULL, SU_FLAG_NEGINVALID, NULL }, + NULL, SU_FLAG_NEGINVALID, NULL), /* pdu2InputPhaseCurrentThUpperCritical.0.2 = INTEGER: 24000 */ - { "input.L2.current.high.critical", ST_FLAG_RW, 0.001, + snmp_info_default("input.L2.current.high.critical", ST_FLAG_RW, 0.001, ".1.3.6.1.4.1.232.165.7.2.2.1.16.%i.2", - NULL, SU_FLAG_NEGINVALID, NULL }, + NULL, SU_FLAG_NEGINVALID, NULL), /* pdu2InputPhaseCurrent.0.3 = INTEGER: 185 */ - { "input.L3.current", 0, 0.001, + snmp_info_default("input.L3.current", 0, 0.001, ".1.3.6.1.4.1.232.165.7.2.2.1.11.%i.3", - NULL, 0, NULL }, + NULL, 0, NULL), /* pdu2InputPhaseCurrentRating.0.3 = INTEGER: 24000 */ - { "input.L3.current.nominal", 0, 0.001, + snmp_info_default("input.L3.current.nominal", 0, 0.001, ".1.3.6.1.4.1.232.165.7.2.2.1.10.%i.3", - NULL, SU_FLAG_NEGINVALID, NULL }, + NULL, SU_FLAG_NEGINVALID, NULL), /* pdu2InputPhaseCurrentThStatus.0.3 = INTEGER: good(1) */ - { "input.L3.current.status", ST_FLAG_STRING, SU_INFOSIZE, + snmp_info_default("input.L3.current.status", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.232.165.7.2.2.1.12.%i.3", - NULL, SU_FLAG_OK, &hpe_pdu_threshold_status_info[0] }, - { "L2.alarm", ST_FLAG_STRING, SU_INFOSIZE, + NULL, SU_FLAG_OK, &hpe_pdu_threshold_status_info[0]), + snmp_info_default("L2.alarm", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.232.165.7.2.2.1.12.%i.2", - NULL, SU_FLAG_OK, &hpe_pdu_threshold_current_alarms_info[0] }, + NULL, SU_FLAG_OK, &hpe_pdu_threshold_current_alarms_info[0]), /* pdu2InputPhaseCurrentThLowerWarning.0.3 = INTEGER: 0 */ - { "input.L3.current.low.warning", ST_FLAG_RW, 0.001, + snmp_info_default("input.L3.current.low.warning", ST_FLAG_RW, 0.001, ".1.3.6.1.4.1.232.165.7.2.2.1.13.%i.3", - NULL, SU_FLAG_NEGINVALID, NULL }, + NULL, SU_FLAG_NEGINVALID, NULL), /* pdu2InputPhaseCurrentThLowerCritical.0.3 = INTEGER: -1 */ - { "input.L3.current.low.critical", ST_FLAG_RW, 0.001, + snmp_info_default("input.L3.current.low.critical", ST_FLAG_RW, 0.001, ".1.3.6.1.4.1.232.165.7.2.2.1.14.%i.3", - NULL, SU_FLAG_NEGINVALID, NULL }, + NULL, SU_FLAG_NEGINVALID, NULL), /* pdu2InputPhaseCurrentThUpperWarning.0.3 = INTEGER: 19200 */ - { "input.L3.current.high.warning", ST_FLAG_RW, 0.001, + snmp_info_default("input.L3.current.high.warning", ST_FLAG_RW, 0.001, ".1.3.6.1.4.1.232.165.7.2.2.1.15.%i.3", - NULL, SU_FLAG_NEGINVALID, NULL }, + NULL, SU_FLAG_NEGINVALID, NULL), /* pdu2InputPhaseCurrentThUpperCritical.0.3 = INTEGER: 24000 */ - { "input.L3.current.high.critical", ST_FLAG_RW, 0.001, + snmp_info_default("input.L3.current.high.critical", ST_FLAG_RW, 0.001, ".1.3.6.1.4.1.232.165.7.2.2.1.16.%i.3", - NULL, SU_FLAG_NEGINVALID, NULL }, + NULL, SU_FLAG_NEGINVALID, NULL), /* pdu2InputPowerWatts.0 = INTEGER: 19 */ - { "input.realpower", 0, 1.0, + snmp_info_default("input.realpower", 0, 1.0, ".1.3.6.1.4.1.232.165.7.2.1.1.5.%i", - NULL, SU_FLAG_NEGINVALID | SU_FLAG_UNIQUE | SU_FLAG_OK, NULL }, + NULL, SU_FLAG_NEGINVALID | SU_FLAG_UNIQUE | SU_FLAG_OK, NULL), /* pdu2InputPhasePowerWatts.0.1 = INTEGER: 19 */ - { "input.L1.realpower", 0, 1.0, + snmp_info_default("input.L1.realpower", 0, 1.0, ".1.3.6.1.4.1.232.165.7.2.2.1.21.%i.1", - NULL, SU_FLAG_NEGINVALID | SU_FLAG_OK, NULL }, + NULL, SU_FLAG_NEGINVALID | SU_FLAG_OK, NULL), /* pdu2InputPhasePowerWatts.0.2 = INTEGER: 0 */ - { "input.L2.realpower", 0, 1.0, + snmp_info_default("input.L2.realpower", 0, 1.0, ".1.3.6.1.4.1.232.165.7.2.2.1.21.%i.2", - NULL, SU_FLAG_NEGINVALID | SU_FLAG_OK, NULL }, + NULL, SU_FLAG_NEGINVALID | SU_FLAG_OK, NULL), /* pdu2InputPhasePowerWatts.0.3 = INTEGER: 0 */ - { "input.L3.realpower", 0, 1.0, + snmp_info_default("input.L3.realpower", 0, 1.0, ".1.3.6.1.4.1.232.165.7.2.2.1.21.%i.3", - NULL, SU_FLAG_NEGINVALID | SU_FLAG_OK, NULL }, + NULL, SU_FLAG_NEGINVALID | SU_FLAG_OK, NULL), /* Sum of all phases apparent power, valid for Shark 1ph/3ph only */ /* pdu2InputPowerVA.0 = INTEGER: 39 */ - { "input.power", 0, 1.0, + snmp_info_default("input.power", 0, 1.0, ".1.3.6.1.4.1.232.165.7.2.1.1.4.%i", - NULL, SU_FLAG_NEGINVALID | SU_FLAG_UNIQUE | SU_FLAG_OK, NULL }, + NULL, SU_FLAG_NEGINVALID | SU_FLAG_UNIQUE | SU_FLAG_OK, NULL), /* pdu2InputPhasePowerVA.0.1 = INTEGER: 40 */ - { "input.L1.power", 0, 1.0, + snmp_info_default("input.L1.power", 0, 1.0, ".1.3.6.1.4.1.232.165.7.2.2.1.20.%i.1", - NULL, SU_FLAG_NEGINVALID | SU_FLAG_OK, NULL }, + NULL, SU_FLAG_NEGINVALID | SU_FLAG_OK, NULL), /* pdu2InputPhasePowerVA.0.2 = INTEGER: 0 */ - { "input.L2.power", 0, 1.0, + snmp_info_default("input.L2.power", 0, 1.0, ".1.3.6.1.4.1.232.165.7.2.2.1.20.%i.2", - NULL, SU_FLAG_NEGINVALID | SU_FLAG_OK, NULL }, + NULL, SU_FLAG_NEGINVALID | SU_FLAG_OK, NULL), /* pdu2InputPhasePowerVA.0.3 = INTEGER: 0 */ - { "input.L3.power", 0, 1.0, + snmp_info_default("input.L3.power", 0, 1.0, ".1.3.6.1.4.1.232.165.7.2.2.1.20.%i.3", - NULL, SU_FLAG_NEGINVALID | SU_FLAG_OK, NULL }, + NULL, SU_FLAG_NEGINVALID | SU_FLAG_OK, NULL), /* TODO: handle statistics */ #if WITH_UNMAPPED_DATA_POINTS /* pdu2InputPowerWattHour.0 = INTEGER: 91819 */ - { "unmapped.pdu2InputPowerWattHour", 0, 1, ".1.3.6.1.4.1.232.165.7.2.1.1.6.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu2InputPowerWattHour", 0, 1, ".1.3.6.1.4.1.232.165.7.2.1.1.6.0", NULL, SU_FLAG_OK, NULL), /* pdu2InputPowerWattHourTimer.0 = STRING: "16/10/2017,17:58:53" */ - { "unmapped.pdu2InputPowerWattHourTimer", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.232.165.7.2.1.1.7.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu2InputPowerWattHourTimer", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.232.165.7.2.1.1.7.0", NULL, SU_FLAG_OK, NULL), #endif /* #if WIH_UNMAPPED_DATA_POINTS */ /* pdu2InputPowerFactor.0 = INTEGER: 483 */ - { "input.powerfactor", 0, 0.001, + snmp_info_default("input.powerfactor", 0, 0.001, ".1.3.6.1.4.1.232.165.7.2.1.1.8.%i", - NULL, SU_FLAG_NEGINVALID | SU_FLAG_OK, NULL }, + NULL, SU_FLAG_NEGINVALID | SU_FLAG_OK, NULL), /* Ambient collection */ /* pdu2TemperatureProbeStatus.0.1 = INTEGER: disconnected(1) */ - { "ambient.present", ST_FLAG_STRING, SU_INFOSIZE, + snmp_info_default("ambient.present", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.232.165.7.4.2.1.3.%i.1", - NULL, SU_FLAG_OK, &hpe_pdu_ambient_presence_info[0] }, + NULL, SU_FLAG_OK, &hpe_pdu_ambient_presence_info[0]), /* pdu2TemperatureThStatus.0.1 = INTEGER: good(1) */ - { "ambient.temperature.status", ST_FLAG_STRING, SU_INFOSIZE, + snmp_info_default("ambient.temperature.status", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.232.165.7.4.2.1.5.%i.1", - NULL, SU_FLAG_OK, &hpe_pdu_threshold_status_info[0] }, - { "ups.alarm", ST_FLAG_STRING, SU_INFOSIZE, + NULL, SU_FLAG_OK, &hpe_pdu_threshold_status_info[0]), + snmp_info_default("ups.alarm", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.232.165.7.4.2.1.5.%i.1", - NULL, SU_FLAG_OK, &hpe_pdu_threshold_temperature_alarms_info[0] }, + NULL, SU_FLAG_OK, &hpe_pdu_threshold_temperature_alarms_info[0]), /* pdu2TemperatureValue.0.1 = INTEGER: 0 */ - { "ambient.temperature", 0, 0.1, + snmp_info_default("ambient.temperature", 0, 0.1, ".1.3.6.1.4.1.232.165.7.4.2.1.4.%i.1", - NULL, SU_FLAG_OK, NULL }, + NULL, SU_FLAG_OK, NULL), /* Low and high threshold use the respective critical levels */ /* pdu2TemperatureThLowerCritical.0.1 = INTEGER: 50 */ - { "ambient.temperature.low", ST_FLAG_RW, 0.1, + snmp_info_default("ambient.temperature.low", ST_FLAG_RW, 0.1, ".1.3.6.1.4.1.232.165.7.4.2.1.7.%i.1", - NULL, SU_FLAG_NEGINVALID | SU_FLAG_OK, NULL }, - { "ambient.temperature.low.critical", ST_FLAG_RW, 0.1, + NULL, SU_FLAG_NEGINVALID | SU_FLAG_OK, NULL), + snmp_info_default("ambient.temperature.low.critical", ST_FLAG_RW, 0.1, ".1.3.6.1.4.1.232.165.7.4.2.1.7.%i.1", - NULL, SU_FLAG_NEGINVALID | SU_FLAG_OK, NULL }, + NULL, SU_FLAG_NEGINVALID | SU_FLAG_OK, NULL), /* pdu2TemperatureThLowerWarning.0.1 = INTEGER: 100 */ - { "ambient.temperature.low.warning", ST_FLAG_RW, 0.1, + snmp_info_default("ambient.temperature.low.warning", ST_FLAG_RW, 0.1, ".1.3.6.1.4.1.232.165.7.4.2.1.6.%i.1", - NULL, SU_FLAG_NEGINVALID | SU_FLAG_OK, NULL }, + NULL, SU_FLAG_NEGINVALID | SU_FLAG_OK, NULL), /* pdu2TemperatureThUpperCritical.0.1 = INTEGER: 650 */ - { "ambient.temperature.high", ST_FLAG_RW, 0.1, + snmp_info_default("ambient.temperature.high", ST_FLAG_RW, 0.1, ".1.3.6.1.4.1.232.165.7.4.2.1.9.%i.1", - NULL, SU_FLAG_NEGINVALID | SU_FLAG_OK, NULL }, - { "ambient.temperature.high.critical", ST_FLAG_RW, 0.1, + NULL, SU_FLAG_NEGINVALID | SU_FLAG_OK, NULL), + snmp_info_default("ambient.temperature.high.critical", ST_FLAG_RW, 0.1, ".1.3.6.1.4.1.232.165.7.4.2.1.9.%i.1", - NULL, SU_FLAG_NEGINVALID | SU_FLAG_OK, NULL }, + NULL, SU_FLAG_NEGINVALID | SU_FLAG_OK, NULL), /* pdu2TemperatureThUpperWarning.0.1 = INTEGER: 200 */ - { "ambient.temperature.high.warning", ST_FLAG_RW, 0.1, + snmp_info_default("ambient.temperature.high.warning", ST_FLAG_RW, 0.1, ".1.3.6.1.4.1.232.165.7.4.2.1.8.%i.1", - NULL, SU_FLAG_NEGINVALID | SU_FLAG_OK, NULL }, + NULL, SU_FLAG_NEGINVALID | SU_FLAG_OK, NULL), /* pdu2HumidityThStatus.0.1 = INTEGER: good(1) */ - { "ambient.humidity.status", ST_FLAG_STRING, SU_INFOSIZE, + snmp_info_default("ambient.humidity.status", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.232.165.7.4.3.1.5.%i.1", - NULL, SU_FLAG_OK, &hpe_pdu_threshold_status_info[0] }, - { "ups.alarm", ST_FLAG_STRING, SU_INFOSIZE, + NULL, SU_FLAG_OK, &hpe_pdu_threshold_status_info[0]), + snmp_info_default("ups.alarm", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.232.165.7.4.3.1.5.%i.1", - NULL, SU_FLAG_OK, &hpe_pdu_threshold_humidity_alarms_info[0] }, + NULL, SU_FLAG_OK, &hpe_pdu_threshold_humidity_alarms_info[0]), /* pdu2HumidityValue.0.1 = INTEGER: 0 */ - { "ambient.humidity", 0, 0.1, + snmp_info_default("ambient.humidity", 0, 0.1, ".1.3.6.1.4.1.232.165.7.4.3.1.4.%i.1", - NULL, SU_FLAG_OK, NULL }, + NULL, SU_FLAG_OK, NULL), /* Low and high threshold use the respective critical levels */ /* pdu2HumidityThLowerCritical.0.1 = INTEGER: 100 */ - { "ambient.humidity.low", ST_FLAG_RW, 0.1, + snmp_info_default("ambient.humidity.low", ST_FLAG_RW, 0.1, ".1.3.6.1.4.1.232.165.7.4.3.1.7.%i.1", - NULL, SU_FLAG_NEGINVALID | SU_FLAG_OK, NULL }, - { "ambient.humidity.low.critical", ST_FLAG_RW, 0.1, + NULL, SU_FLAG_NEGINVALID | SU_FLAG_OK, NULL), + snmp_info_default("ambient.humidity.low.critical", ST_FLAG_RW, 0.1, ".1.3.6.1.4.1.232.165.7.4.3.1.7.%i.1", - NULL, SU_FLAG_NEGINVALID | SU_FLAG_OK, NULL }, + NULL, SU_FLAG_NEGINVALID | SU_FLAG_OK, NULL), /* pdu2HumidityThLowerWarning.0.1 = INTEGER: 200 */ - { "ambient.humidity.low.warning", ST_FLAG_RW, 0.1, + snmp_info_default("ambient.humidity.low.warning", ST_FLAG_RW, 0.1, ".1.3.6.1.4.1.232.165.7.4.3.1.6.%i.1", - NULL, SU_FLAG_NEGINVALID | SU_FLAG_OK, NULL }, + NULL, SU_FLAG_NEGINVALID | SU_FLAG_OK, NULL), /* pdu2HumidityThUpperWarning.0.1 = INTEGER: 250 */ - { "ambient.humidity.high.warning", ST_FLAG_RW, 0.1, + snmp_info_default("ambient.humidity.high.warning", ST_FLAG_RW, 0.1, ".1.3.6.1.4.1.232.165.7.4.3.1.8.%i.1", - NULL, SU_FLAG_NEGINVALID | SU_FLAG_OK, NULL }, + NULL, SU_FLAG_NEGINVALID | SU_FLAG_OK, NULL), /* pdu2HumidityThUpperCritical.0.1 = INTEGER: 900 */ - { "ambient.humidity.high", ST_FLAG_RW, 0.1, + snmp_info_default("ambient.humidity.high", ST_FLAG_RW, 0.1, ".1.3.6.1.4.1.232.165.7.4.3.1.9.%i.1", - NULL, SU_FLAG_NEGINVALID | SU_FLAG_OK, NULL }, - { "ambient.humidity.high.critical", ST_FLAG_RW, 0.1, + NULL, SU_FLAG_NEGINVALID | SU_FLAG_OK, NULL), + snmp_info_default("ambient.humidity.high.critical", ST_FLAG_RW, 0.1, ".1.3.6.1.4.1.232.165.7.4.3.1.9.%i.1", - NULL, SU_FLAG_NEGINVALID | SU_FLAG_OK, NULL }, + NULL, SU_FLAG_NEGINVALID | SU_FLAG_OK, NULL), /* Dry contacts on TH module */ /* pdu2ContactState.0.1 = INTEGER: contactBad(3) */ - { "ambient.contacts.1.status", ST_FLAG_STRING, SU_INFOSIZE, + snmp_info_default("ambient.contacts.1.status", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.232.165.7.4.4.1.4.%i.1", - NULL, SU_FLAG_OK, &hpe_pdu_ambient_drycontacts_info[0] }, + NULL, SU_FLAG_OK, &hpe_pdu_ambient_drycontacts_info[0]), /* pdu2ContactState.0.2 = INTEGER: contactBad(3) */ - { "ambient.contacts.2.status", ST_FLAG_STRING, SU_INFOSIZE, + snmp_info_default("ambient.contacts.2.status", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.232.165.7.4.4.1.4.%i.2", - NULL, SU_FLAG_OK, &hpe_pdu_ambient_drycontacts_info[0] }, + NULL, SU_FLAG_OK, &hpe_pdu_ambient_drycontacts_info[0]), /* Outlet collection */ - { "outlet.id", 0, 1, NULL, - "0", SU_FLAG_STATIC | SU_FLAG_ABSENT | SU_FLAG_OK, NULL }, - { "outlet.desc", ST_FLAG_RW | ST_FLAG_STRING, 20, NULL, "All outlets", - SU_FLAG_STATIC | SU_FLAG_ABSENT | SU_FLAG_OK, NULL }, + snmp_info_default("outlet.id", 0, 1, NULL, + "0", SU_FLAG_STATIC | SU_FLAG_ABSENT | SU_FLAG_OK, NULL), + snmp_info_default("outlet.desc", ST_FLAG_RW | ST_FLAG_STRING, 20, NULL, "All outlets", + SU_FLAG_STATIC | SU_FLAG_ABSENT | SU_FLAG_OK, NULL), /* pdu2OutletCount.0 = INTEGER: 24 */ - { "outlet.count", 0, 1, + snmp_info_default("outlet.count", 0, 1, ".1.3.6.1.4.1.232.165.7.1.2.1.12.%i", - "0", SU_FLAG_STATIC | SU_FLAG_OK, NULL }, + "0", SU_FLAG_STATIC | SU_FLAG_OK, NULL), /* outlet template definition * Indexes start from 1, ie outlet.1 => .1 */ /* Note: the first definition is used to determine the base index (ie 0 or 1) */ /* pdu2OutletName.0.%i = STRING: "Outlet L1-%i" */ - { "outlet.%i.desc", ST_FLAG_STRING, SU_INFOSIZE, + snmp_info_default("outlet.%i.desc", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.232.165.7.5.1.1.2.%i.%i", - NULL, SU_FLAG_STATIC | SU_FLAG_OK | SU_OUTLET | SU_TYPE_DAISY_1, NULL }, + NULL, SU_FLAG_STATIC | SU_FLAG_OK | SU_OUTLET | SU_TYPE_DAISY_1, NULL), /* pdu2OutletControlStatus.0.%i = INTEGER: on(2) */ - { "outlet.%i.status", ST_FLAG_STRING, SU_INFOSIZE, + snmp_info_default("outlet.%i.status", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.232.165.7.5.2.1.1.%i.%i", - NULL, SU_FLAG_OK | SU_OUTLET | SU_TYPE_DAISY_1, &hpe_pdu_outlet_status_info[0] }, + NULL, SU_FLAG_OK | SU_OUTLET | SU_TYPE_DAISY_1, &hpe_pdu_outlet_status_info[0]), /* Numeric identifier of the outlet, tied to the whole unit */ - { "outlet.%i.id", 0, 1, NULL, "%i", - SU_FLAG_STATIC | SU_FLAG_ABSENT | SU_FLAG_OK | SU_OUTLET | SU_TYPE_DAISY_1, NULL }, + snmp_info_default("outlet.%i.id", 0, 1, NULL, "%i", + SU_FLAG_STATIC | SU_FLAG_ABSENT | SU_FLAG_OK | SU_OUTLET | SU_TYPE_DAISY_1, NULL), #if 0 /* FIXME: the last part of the OID gives the group number (i.e. %i.1 means "group 1") * Need to address that, without multiple declaration (%i.%i, SU_OUTLET | SU_OUTLET_GROUP)? */ - { "outlet.%i.groupid", ST_FLAG_STRING, SU_INFOSIZE, + snmp_info_default("outlet.%i.groupid", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.6.6.7.6.2.1.3.%i.%i.1", - NULL, SU_FLAG_STATIC | SU_FLAG_UNIQUE | SU_OUTLET | SU_TYPE_DAISY_1, NULL }, - { "outlet.%i.groupid", ST_FLAG_STRING, SU_INFOSIZE, + NULL, SU_FLAG_STATIC | SU_FLAG_UNIQUE | SU_OUTLET | SU_TYPE_DAISY_1, NULL), + snmp_info_default("outlet.%i.groupid", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.6.6.7.6.2.1.3.%i.%i.2", - NULL, SU_FLAG_STATIC | SU_FLAG_UNIQUE | SU_OUTLET | SU_TYPE_DAISY_1, NULL }, - { "outlet.%i.groupid", ST_FLAG_STRING, SU_INFOSIZE, + NULL, SU_FLAG_STATIC | SU_FLAG_UNIQUE | SU_OUTLET | SU_TYPE_DAISY_1, NULL), + snmp_info_default("outlet.%i.groupid", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.6.6.7.6.2.1.3.%i.%i.3", - NULL, SU_FLAG_STATIC | SU_FLAG_UNIQUE | SU_OUTLET | SU_TYPE_DAISY_1, NULL }, - { "outlet.%i.groupid", ST_FLAG_STRING, SU_INFOSIZE, + NULL, SU_FLAG_STATIC | SU_FLAG_UNIQUE | SU_OUTLET | SU_TYPE_DAISY_1, NULL), + snmp_info_default("outlet.%i.groupid", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.6.6.7.6.2.1.3.%i.%i.4", - NULL, SU_FLAG_STATIC | SU_FLAG_UNIQUE | SU_OUTLET | SU_TYPE_DAISY_1, NULL }, - { "outlet.%i.groupid", ST_FLAG_STRING, SU_INFOSIZE, + NULL, SU_FLAG_STATIC | SU_FLAG_UNIQUE | SU_OUTLET | SU_TYPE_DAISY_1, NULL), + snmp_info_default("outlet.%i.groupid", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.6.6.7.6.2.1.3.%i.%i.5", - NULL, SU_FLAG_STATIC | SU_FLAG_UNIQUE | SU_OUTLET | SU_TYPE_DAISY_1, NULL }, - { "outlet.%i.groupid", ST_FLAG_STRING, SU_INFOSIZE, + NULL, SU_FLAG_STATIC | SU_FLAG_UNIQUE | SU_OUTLET | SU_TYPE_DAISY_1, NULL), + snmp_info_default("outlet.%i.groupid", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.534.6.6.7.6.2.1.3.%i.%i.6", - NULL, SU_FLAG_STATIC | SU_FLAG_UNIQUE | SU_OUTLET | SU_TYPE_DAISY_1, NULL }, + NULL, SU_FLAG_STATIC | SU_FLAG_UNIQUE | SU_OUTLET | SU_TYPE_DAISY_1, NULL), #endif /* pdu2OutletCurrent.0.%i = INTEGER: 0 */ - { "outlet.%i.current", 0, 0.001, + snmp_info_default("outlet.%i.current", 0, 0.001, ".1.3.6.1.4.1.232.165.7.5.1.1.5.%i.%i", - NULL, SU_OUTLET | SU_TYPE_DAISY_1, NULL }, + NULL, SU_OUTLET | SU_TYPE_DAISY_1, NULL), /* pdu2OutletCurrentThStatus.0.%i = INTEGER: good(1) */ - { "outlet.%i.current.status", ST_FLAG_STRING, SU_INFOSIZE, + snmp_info_default("outlet.%i.current.status", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.232.165.7.5.1.1.6.%i.%i", - NULL, SU_OUTLET | SU_TYPE_DAISY_1, &hpe_pdu_threshold_status_info[0] }, - { "outlet.%i.alarm", ST_FLAG_STRING, SU_INFOSIZE, + NULL, SU_OUTLET | SU_TYPE_DAISY_1, &hpe_pdu_threshold_status_info[0]), + snmp_info_default("outlet.%i.alarm", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.232.165.7.5.1.1.6.%i.%i", - NULL, SU_OUTLET | SU_TYPE_DAISY_1, &hpe_pdu_threshold_current_alarms_info[0] }, + NULL, SU_OUTLET | SU_TYPE_DAISY_1, &hpe_pdu_threshold_current_alarms_info[0]), /* pdu2OutletCurrentThLowerWarning.0.%i = INTEGER: 0 */ - { "outlet.%i.current.low.warning", ST_FLAG_RW, 0.001, + snmp_info_default("outlet.%i.current.low.warning", ST_FLAG_RW, 0.001, ".1.3.6.1.4.1.232.165.7.5.1.1.7.%i.%i", - NULL, SU_FLAG_NEGINVALID | SU_OUTLET | SU_TYPE_DAISY_1, NULL }, + NULL, SU_FLAG_NEGINVALID | SU_OUTLET | SU_TYPE_DAISY_1, NULL), /* pdu2OutletCurrentThLowerCritical.0.%i = INTEGER: -1 */ - { "outlet.%i.current.low.critical", ST_FLAG_RW, 0.001, + snmp_info_default("outlet.%i.current.low.critical", ST_FLAG_RW, 0.001, ".1.3.6.1.4.1.232.165.7.5.1.1.8.%i.%i", - NULL, SU_FLAG_NEGINVALID | SU_OUTLET | SU_TYPE_DAISY_1, NULL }, + NULL, SU_FLAG_NEGINVALID | SU_OUTLET | SU_TYPE_DAISY_1, NULL), /* pdu2OutletCurrentThUpperWarning.0.1 = INTEGER: 8000 */ - { "outlet.%i.current.high.warning", ST_FLAG_RW, 0.001, + snmp_info_default("outlet.%i.current.high.warning", ST_FLAG_RW, 0.001, ".1.3.6.1.4.1.232.165.7.5.1.1.9.%i.%i", - NULL, SU_FLAG_NEGINVALID | SU_OUTLET | SU_TYPE_DAISY_1, NULL }, + NULL, SU_FLAG_NEGINVALID | SU_OUTLET | SU_TYPE_DAISY_1, NULL), /* pdu2OutletCurrentThUpperCritical.0.1 = INTEGER: 10000 */ - { "outlet.%i.current.high.critical", ST_FLAG_RW, 0.001, + snmp_info_default("outlet.%i.current.high.critical", ST_FLAG_RW, 0.001, ".1.3.6.1.4.1.232.165.7.5.1.1.10.%i.%i", - NULL, SU_FLAG_NEGINVALID | SU_OUTLET | SU_TYPE_DAISY_1, NULL }, + NULL, SU_FLAG_NEGINVALID | SU_OUTLET | SU_TYPE_DAISY_1, NULL), /* pdu2OutletWatts.0.1 = INTEGER: 0 */ - { "outlet.%i.realpower", 0, 1.0, + snmp_info_default("outlet.%i.realpower", 0, 1.0, ".1.3.6.1.4.1.232.165.7.5.1.1.14.%i.%i", - NULL, SU_FLAG_NEGINVALID | SU_OUTLET | SU_TYPE_DAISY_1, NULL }, + NULL, SU_FLAG_NEGINVALID | SU_OUTLET | SU_TYPE_DAISY_1, NULL), /* pdu2OutletVA.0.%i = INTEGER: 0 */ - { "outlet.%i.power", 0, 1.0, + snmp_info_default("outlet.%i.power", 0, 1.0, ".1.3.6.1.4.1.232.165.7.5.1.1.13.%i.%i", - NULL, SU_OUTLET | SU_TYPE_DAISY_1, NULL }, + NULL, SU_OUTLET | SU_TYPE_DAISY_1, NULL), /* pdu2OutletControlSwitchable.0.%i = INTEGER: switchable(1) */ - { "outlet.%i.switchable", ST_FLAG_RW, SU_INFOSIZE, + snmp_info_default("outlet.%i.switchable", ST_FLAG_RW, SU_INFOSIZE, ".1.3.6.1.4.1.232.165.7.5.2.1.8.%i.%i", "no", SU_FLAG_STATIC | SU_OUTLET | SU_FLAG_OK | SU_TYPE_DAISY_1, - &hpe_pdu_outlet_switchability_info[0] }, + &hpe_pdu_outlet_switchability_info[0]), /* pdu2OutletType.0.%i = INTEGER: iecC13(1) */ - { "outlet.%i.type", ST_FLAG_STRING, SU_INFOSIZE, + snmp_info_default("outlet.%i.type", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.232.165.7.5.1.1.3.%i.%i", "unknown", SU_FLAG_STATIC | SU_OUTLET | SU_TYPE_DAISY_1, - &hpe_pdu_outlet_type_info[0] }, + &hpe_pdu_outlet_type_info[0]), /* pdu2OutletPowerFactor.0.%i = INTEGER: 1000 */ - { "outlet.%i.powerfactor", 0, 0.001, + snmp_info_default("outlet.%i.powerfactor", 0, 0.001, ".1.3.6.1.4.1.232.165.7.5.1.1.17.%i.%i", - NULL, SU_OUTLET | SU_TYPE_DAISY_1, NULL }, + NULL, SU_OUTLET | SU_TYPE_DAISY_1, NULL), /* TODO: handle statistics */ #if WITH_UNMAPPED_DATA_POINTS /* pdu2OutletWh.0.1 = INTEGER: 1167 * Note: setting this to zero resets the counter and timestamp => instcmd ???counter???.reset */ - { "unmapped.pdu2OutletWh", 0, 1, ".1.3.6.1.4.1.232.165.7.5.1.1.15.%i.%i", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu2OutletWh", 0, 1, ".1.3.6.1.4.1.232.165.7.5.1.1.15.%i.%i", NULL, SU_FLAG_OK, NULL), /* pdu2OutletWhTimer.0.1 = STRING: "25/03/2016,09:03:26" */ - { "unmapped.pdu2OutletWhTimer", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.232.165.7.5.1.1.16.%i.%i", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu2OutletWhTimer", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.232.165.7.5.1.1.16.%i.%i", NULL, SU_FLAG_OK, NULL), #endif /* #if WITH_UNMAPPED_DATA_POINTS */ /* Outlet groups collection */ /* pdu2GroupCount.0 = INTEGER: 3 */ - { "outlet.group.count", 0, 1, + snmp_info_default("outlet.group.count", 0, 1, ".1.3.6.1.4.1.232.165.7.1.2.1.11.%i", - "0", SU_FLAG_STATIC | SU_TYPE_DAISY_1, NULL }, + "0", SU_FLAG_STATIC | SU_TYPE_DAISY_1, NULL), /* outlet groups template definition * Indexes start from 1, ie outlet.group.1 => .1 */ /* Note: the first definition is used to determine the base index (ie 0 or 1) */ /* pdu2GroupIndex.0.%i = INTEGER: %i */ - { "outlet.group.%i.id", ST_FLAG_STRING, SU_INFOSIZE, + snmp_info_default("outlet.group.%i.id", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.232.165.7.3.1.1.1.%i.%i", - NULL, SU_FLAG_STATIC | SU_OUTLET_GROUP | SU_TYPE_DAISY_1, NULL }, + NULL, SU_FLAG_STATIC | SU_OUTLET_GROUP | SU_TYPE_DAISY_1, NULL), /* pdu2GroupName.0.%i = STRING: "Section L1" */ - { "outlet.group.%i.name", ST_FLAG_RW | ST_FLAG_STRING, SU_INFOSIZE, + snmp_info_default("outlet.group.%i.name", ST_FLAG_RW | ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.232.165.7.3.1.1.2.%i.%i", - NULL, SU_FLAG_STATIC | SU_OUTLET_GROUP | SU_TYPE_DAISY_1, NULL }, + NULL, SU_FLAG_STATIC | SU_OUTLET_GROUP | SU_TYPE_DAISY_1, NULL), /* pdu2GroupType.0.%i = INTEGER: breaker2pole(3) */ - { "outlet.group.%i.type", ST_FLAG_STRING, SU_INFOSIZE, + snmp_info_default("outlet.group.%i.type", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.232.165.7.3.1.1.3.%i.%i", - NULL, SU_FLAG_STATIC | SU_OUTLET_GROUP | SU_TYPE_DAISY_1, &hpe_pdu_outlet_group_type_info[0] }, + NULL, SU_FLAG_STATIC | SU_OUTLET_GROUP | SU_TYPE_DAISY_1, &hpe_pdu_outlet_group_type_info[0]), /* pdu2GroupVoltageMeasType.0.1 = INTEGER: phase1to2(5) */ - { "outlet.group.%i.phase", 0, SU_INFOSIZE, + snmp_info_default("outlet.group.%i.phase", 0, SU_INFOSIZE, ".1.3.6.1.4.1.232.165.7.3.1.1.4.%i.%i", NULL, SU_FLAG_STATIC | SU_OUTLET_GROUP | SU_TYPE_DAISY_1, - &hpe_pdu_outlet_group_phase_info[0] }, + &hpe_pdu_outlet_group_phase_info[0]), /* pdu2groupBreakerStatus.0.%i = INTEGER: breakerOn(2) */ - { "outlet.group.%i.status", ST_FLAG_STRING, SU_INFOSIZE, + snmp_info_default("outlet.group.%i.status", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.232.165.7.3.1.1.27.%i.%i", NULL, SU_FLAG_OK | SU_FLAG_NAINVALID | SU_OUTLET_GROUP | SU_TYPE_DAISY_1, - &hpe_pdu_outletgroups_status_info[0] }, + &hpe_pdu_outletgroups_status_info[0]), /* pdu2GroupOutletCount.0.%i = INTEGER: 8 */ - { "outlet.group.%i.count", 0, 1, + snmp_info_default("outlet.group.%i.count", 0, 1, ".1.3.6.1.4.1.232.165.7.3.1.1.26.%i.%i", - NULL, SU_OUTLET_GROUP | SU_TYPE_DAISY_1, NULL }, + NULL, SU_OUTLET_GROUP | SU_TYPE_DAISY_1, NULL), /* pdu2GroupVoltage.0.%i = INTEGER: 216760 */ - { "outlet.group.%i.voltage", 0, 0.001, + snmp_info_default("outlet.group.%i.voltage", 0, 0.001, ".1.3.6.1.4.1.232.165.7.3.1.1.5.%i.%i", - NULL, SU_OUTLET_GROUP | SU_TYPE_DAISY_1, NULL }, + NULL, SU_OUTLET_GROUP | SU_TYPE_DAISY_1, NULL), /* pdu2GroupVoltageThStatus.0.%i = INTEGER: good(1) */ - { "outlet.group.%i.voltage.status", ST_FLAG_STRING, SU_INFOSIZE, + snmp_info_default("outlet.group.%i.voltage.status", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.232.165.7.3.1.1.6.%i.%i", NULL, SU_OUTLET_GROUP | SU_TYPE_DAISY_1, - &hpe_pdu_threshold_status_info[0] }, - { "outlet.group.%i.alarm", ST_FLAG_STRING, SU_INFOSIZE, + &hpe_pdu_threshold_status_info[0]), + snmp_info_default("outlet.group.%i.alarm", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.232.165.7.3.1.1.6.%i.%i", NULL, SU_OUTLET_GROUP | SU_TYPE_DAISY_1, - &hpe_pdu_threshold_voltage_alarms_info[0] }, + &hpe_pdu_threshold_voltage_alarms_info[0]), /* pdu2GroupVoltageThLowerWarning.0.%i = INTEGER: 190000 */ - { "outlet.group.%i.voltage.low.warning", ST_FLAG_RW, 0.001, + snmp_info_default("outlet.group.%i.voltage.low.warning", ST_FLAG_RW, 0.001, ".1.3.6.1.4.1.232.165.7.3.1.1.7.%i.%i", - NULL, SU_FLAG_NEGINVALID | SU_OUTLET_GROUP | SU_TYPE_DAISY_1, NULL }, + NULL, SU_FLAG_NEGINVALID | SU_OUTLET_GROUP | SU_TYPE_DAISY_1, NULL), /* pdu2GroupVoltageThLowerCritical.0.%i = INTEGER: 180000 */ - { "outlet.group.%i.voltage.low.critical", ST_FLAG_RW, 0.001, + snmp_info_default("outlet.group.%i.voltage.low.critical", ST_FLAG_RW, 0.001, ".1.3.6.1.4.1.232.165.7.3.1.1.8.%i.%i", - NULL, SU_FLAG_NEGINVALID | SU_OUTLET_GROUP | SU_TYPE_DAISY_1, NULL }, + NULL, SU_FLAG_NEGINVALID | SU_OUTLET_GROUP | SU_TYPE_DAISY_1, NULL), /* pdu2GroupVoltageThUpperWarning.0.%i = INTEGER: 255000 */ - { "outlet.group.%i.voltage.high.warning", ST_FLAG_RW, 0.001, + snmp_info_default("outlet.group.%i.voltage.high.warning", ST_FLAG_RW, 0.001, ".1.3.6.1.4.1.232.165.7.3.1.1.9.%i.%i", - NULL, SU_FLAG_NEGINVALID | SU_OUTLET_GROUP | SU_TYPE_DAISY_1, NULL }, + NULL, SU_FLAG_NEGINVALID | SU_OUTLET_GROUP | SU_TYPE_DAISY_1, NULL), /* pdu2GroupVoltageThUpperCritical.0.%i = INTEGER: 265000 */ - { "outlet.group.%i.voltage.high.critical", ST_FLAG_RW, 0.001, + snmp_info_default("outlet.group.%i.voltage.high.critical", ST_FLAG_RW, 0.001, ".1.3.6.1.4.1.232.165.7.3.1.1.10.%i.%i", - NULL, SU_FLAG_NEGINVALID | SU_OUTLET_GROUP | SU_TYPE_DAISY_1, NULL }, + NULL, SU_FLAG_NEGINVALID | SU_OUTLET_GROUP | SU_TYPE_DAISY_1, NULL), /* pdu2GroupCurrent.0.%i = INTEGER: 0 */ - { "outlet.group.%i.current", 0, 0.001, + snmp_info_default("outlet.group.%i.current", 0, 0.001, ".1.3.6.1.4.1.232.165.7.3.1.1.12.%i.%i", - NULL, SU_OUTLET_GROUP | SU_TYPE_DAISY_1, NULL }, + NULL, SU_OUTLET_GROUP | SU_TYPE_DAISY_1, NULL), /* pdu2groupCurrentRating.0.%i = INTEGER: 16000 */ - { "outlet.group.%i.current.nominal", 0, 0.001, + snmp_info_default("outlet.group.%i.current.nominal", 0, 0.001, ".1.3.6.1.4.1.232.165.7.3.1.1.11.%i.%i", - NULL, SU_OUTLET_GROUP | SU_TYPE_DAISY_1, NULL }, + NULL, SU_OUTLET_GROUP | SU_TYPE_DAISY_1, NULL), /* pdu2GroupCurrentThStatus.0.%i = INTEGER: good(1) */ - { "outlet.group.%i.current.status", ST_FLAG_STRING, SU_INFOSIZE, + snmp_info_default("outlet.group.%i.current.status", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.232.165.7.3.1.1.13.%i.%i", NULL, SU_OUTLET_GROUP | SU_TYPE_DAISY_1, - &hpe_pdu_threshold_status_info[0] }, - { "outlet.group.%i.alarm", ST_FLAG_STRING, SU_INFOSIZE, + &hpe_pdu_threshold_status_info[0]), + snmp_info_default("outlet.group.%i.alarm", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.232.165.7.3.1.1.13.%i.%i", NULL, SU_OUTLET_GROUP | SU_TYPE_DAISY_1, - &hpe_pdu_threshold_current_alarms_info[0] }, + &hpe_pdu_threshold_current_alarms_info[0]), /* pdu2GroupCurrentThLowerWarning.0.%i = INTEGER: 0 */ - { "outlet.group.%i.current.low.warning", ST_FLAG_RW, 0.001, + snmp_info_default("outlet.group.%i.current.low.warning", ST_FLAG_RW, 0.001, ".1.3.6.1.4.1.232.165.7.3.1.1.14.%i.%i", - NULL, SU_FLAG_NEGINVALID | SU_OUTLET_GROUP | SU_TYPE_DAISY_1, NULL }, + NULL, SU_FLAG_NEGINVALID | SU_OUTLET_GROUP | SU_TYPE_DAISY_1, NULL), /* pdu2GroupCurrentThLowerCritical.0.%i = INTEGER: -1 */ - { "outlet.group.%i.current.low.critical", ST_FLAG_RW, 0.001, + snmp_info_default("outlet.group.%i.current.low.critical", ST_FLAG_RW, 0.001, ".1.3.6.1.4.1.232.165.7.3.1.1.15.%i.%i", - NULL, SU_FLAG_NEGINVALID | SU_OUTLET_GROUP | SU_TYPE_DAISY_1, NULL }, + NULL, SU_FLAG_NEGINVALID | SU_OUTLET_GROUP | SU_TYPE_DAISY_1, NULL), /* pdu2GroupCurrentThUpperWarning.0.%i = INTEGER: 12800 */ - { "outlet.group.%i.current.high.warning", ST_FLAG_RW, 0.001, + snmp_info_default("outlet.group.%i.current.high.warning", ST_FLAG_RW, 0.001, ".1.3.6.1.4.1.232.165.7.3.1.1.16.%i.%i", - NULL, SU_FLAG_NEGINVALID | SU_OUTLET_GROUP | SU_TYPE_DAISY_1, NULL }, + NULL, SU_FLAG_NEGINVALID | SU_OUTLET_GROUP | SU_TYPE_DAISY_1, NULL), /* pdu2GroupCurrentThUpperCritical.0.%i = INTEGER: 16000 */ - { "outlet.group.%i.current.high.critical", ST_FLAG_RW, 0.001, + snmp_info_default("outlet.group.%i.current.high.critical", ST_FLAG_RW, 0.001, ".1.3.6.1.4.1.232.165.7.3.1.1.17.%i.%i", - NULL, SU_FLAG_NEGINVALID | SU_OUTLET_GROUP | SU_TYPE_DAISY_1, NULL }, + NULL, SU_FLAG_NEGINVALID | SU_OUTLET_GROUP | SU_TYPE_DAISY_1, NULL), /* pdu2GroupCurrentPercentLoad.0.%i = INTEGER: 0 */ - { "outlet.group.%i.load", 0, 1.0, + snmp_info_default("outlet.group.%i.load", 0, 1.0, ".1.3.6.1.4.1.232.165.7.3.1.1.19.%i.%i", - NULL, SU_FLAG_NEGINVALID | SU_OUTLET_GROUP | SU_TYPE_DAISY_1, NULL }, + NULL, SU_FLAG_NEGINVALID | SU_OUTLET_GROUP | SU_TYPE_DAISY_1, NULL), /* pdu2GroupPowerWatts.0.%i = INTEGER: 0 */ - { "outlet.group.%i.realpower", 0, 1.0, + snmp_info_default("outlet.group.%i.realpower", 0, 1.0, ".1.3.6.1.4.1.232.165.7.3.1.1.21.%i.%i", - NULL, SU_FLAG_NEGINVALID | SU_OUTLET_GROUP | SU_TYPE_DAISY_1, NULL }, + NULL, SU_FLAG_NEGINVALID | SU_OUTLET_GROUP | SU_TYPE_DAISY_1, NULL), /* pdu2GroupPowerVA.0.%i = INTEGER: 0 */ - { "outlet.group.%i.power", 0, 1.0, + snmp_info_default("outlet.group.%i.power", 0, 1.0, ".1.3.6.1.4.1.232.165.7.3.1.1.20.%i.%i", - NULL, SU_FLAG_NEGINVALID | SU_OUTLET_GROUP | SU_TYPE_DAISY_1, NULL }, + NULL, SU_FLAG_NEGINVALID | SU_OUTLET_GROUP | SU_TYPE_DAISY_1, NULL), /* pdu2GroupPowerFactor.0.%i = INTEGER: 1000 */ - { "outlet.group.%i.powerfactor", 0, 0.001, + snmp_info_default("outlet.group.%i.powerfactor", 0, 0.001, ".1.3.6.1.4.1.232.165.7.3.1.1.24.%i.%i", - NULL, SU_OUTLET | SU_TYPE_DAISY_1, NULL }, + NULL, SU_OUTLET | SU_TYPE_DAISY_1, NULL), /* TODO: handle statistics */ #if WITH_UNMAPPED_DATA_POINTS /* pdu2GroupPowerWattHour.0.%i = INTEGER: 1373 * Note: setting this to zero resets the counter and timestamp => instcmd .reset */ - { "unmapped.pdu2GroupPowerWattHour", 0, 1, ".1.3.6.1.4.1.232.165.7.3.1.1.22.%i.%i", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu2GroupPowerWattHour", 0, 1, ".1.3.6.1.4.1.232.165.7.3.1.1.22.%i.%i", NULL, SU_FLAG_OK, NULL), /* pdu2GroupPowerWattHourTimer.0.%i = STRING: "25/03/2016,09:01:16" */ - { "unmapped.pdu2GroupPowerWattHourTimer", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.232.165.7.3.1.1.23.%i.%i", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu2GroupPowerWattHourTimer", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.232.165.7.3.1.1.23.%i.%i", NULL, SU_FLAG_OK, NULL), #endif /* #if WITH_UNMAPPED_DATA_POINTS */ /* instant commands. */ /* TODO: handle delays (outlet.%i.{on,off}.delay) */ /* pdu2OutletControlOffCmd.0.%i = INTEGER: -1 */ - { "outlet.%i.load.off", 0, 1, + snmp_info_default("outlet.%i.load.off", 0, 1, ".1.3.6.1.4.1.232.165.7.5.2.1.2.%i.%i", - "0", SU_TYPE_CMD | SU_OUTLET | SU_TYPE_DAISY_1, NULL }, + "0", SU_TYPE_CMD | SU_OUTLET | SU_TYPE_DAISY_1, NULL), /* pdu2OutletControlOnCmd.0.%i = INTEGER: -1 */ - { "outlet.%i.load.on", 0, 1, + snmp_info_default("outlet.%i.load.on", 0, 1, ".1.3.6.1.4.1.232.165.7.5.2.1.3.%i.%i", - "0", SU_TYPE_CMD | SU_OUTLET | SU_TYPE_DAISY_1, NULL }, + "0", SU_TYPE_CMD | SU_OUTLET | SU_TYPE_DAISY_1, NULL), /* pdu2OutletControlRebootCmd.0.%i = INTEGER: -1 */ - { "outlet.%i.load.cycle", 0, 1, + snmp_info_default("outlet.%i.load.cycle", 0, 1, ".1.3.6.1.4.1.232.165.7.5.2.1.4.%i.%i", - "0", SU_TYPE_CMD | SU_OUTLET | SU_TYPE_DAISY_1, NULL }, + "0", SU_TYPE_CMD | SU_OUTLET | SU_TYPE_DAISY_1, NULL), /* Delayed version, parameter is mandatory (so dfl is NULL)! */ /* pdu2OutletControlOffCmd.0.%i = INTEGER: -1 */ - { "outlet.%i.load.off.delay", 0, 1, + snmp_info_default("outlet.%i.load.off.delay", 0, 1, ".1.3.6.1.4.1.232.165.7.5.2.1.2.%i.%i", - NULL, SU_TYPE_CMD | SU_OUTLET | SU_TYPE_DAISY_1, NULL }, + NULL, SU_TYPE_CMD | SU_OUTLET | SU_TYPE_DAISY_1, NULL), /* pdu2OutletControlOnCmd.0.%i = INTEGER: -1 */ - { "outlet.%i.load.on.delay", 0, 1, + snmp_info_default("outlet.%i.load.on.delay", 0, 1, ".1.3.6.1.4.1.232.165.7.5.2.1.3.%i.%i", - NULL, SU_TYPE_CMD | SU_OUTLET | SU_TYPE_DAISY_1, NULL }, + NULL, SU_TYPE_CMD | SU_OUTLET | SU_TYPE_DAISY_1, NULL), /* pdu2OutletControlRebootCmd.0.%i = INTEGER: -1 */ - { "outlet.%i.load.cycle.delay", 0, 1, + snmp_info_default("outlet.%i.load.cycle.delay", 0, 1, ".1.3.6.1.4.1.232.165.7.5.2.1.4.%i.%i", - NULL, SU_TYPE_CMD | SU_OUTLET | SU_TYPE_DAISY_1, NULL }, + NULL, SU_TYPE_CMD | SU_OUTLET | SU_TYPE_DAISY_1, NULL), /* end of structure. */ - { NULL, 0, 0, NULL, NULL, 0, NULL } + snmp_info_sentinel }; diff --git a/drivers/hpe-pdu3-cis-mib.c b/drivers/hpe-pdu3-cis-mib.c index 5b6bf9ef86..c429173b39 100644 --- a/drivers/hpe-pdu3-cis-mib.c +++ b/drivers/hpe-pdu3-cis-mib.c @@ -21,60 +21,60 @@ #include "hpe-pdu3-cis-mib.h" -#define HPE_PDU3_CIS_MIB_VERSION "0.1" +#define HPE_PDU3_CIS_MIB_VERSION "0.10" #define HPE_PDU3_CIS_SYSOID ".1.3.6.1.4.1.232.165.11" #define HPE_PDU3_OID_MODEL_NAME ".1.3.6.1.4.1.232.165.11.1.2.1.3.1" static info_lkp_t hpe_cis_unit_switchability_info[] = { - { 1, "yes", NULL, NULL }, - { 2, "no", NULL, NULL }, - { 0, NULL, NULL, NULL } + info_lkp_default(1, "yes"), + info_lkp_default(2, "no"), + info_lkp_sentinel }; static info_lkp_t hpe_cis_outlet_group_type_info[] = { - { 2, "breaker1pole", NULL, NULL }, - { 3, "breaker2pole", NULL, NULL }, - { 4, "breaker3pole", NULL, NULL }, - { 5, "outlet-section", NULL, NULL }, - { 0, NULL, NULL, NULL } + info_lkp_default(2, "breaker1pole"), + info_lkp_default(3, "breaker2pole"), + info_lkp_default(4, "breaker3pole"), + info_lkp_default(5, "outlet-section"), + info_lkp_sentinel }; /* Note: same as marlin_outlet_type_info + i5-20R */ /* and to eaton_nlogic_outlet_type_info - few entries */ static info_lkp_t hpe_cis_outlet_type_info[] = { - { 1, "iecC13", NULL, NULL }, - { 2, "iecC19", NULL, NULL }, - { 10, "uk", NULL, NULL }, - { 11, "french", NULL, NULL }, - { 12, "schuko", NULL, NULL }, - { 20, "nema515", NULL, NULL }, - { 21, "nema51520", NULL, NULL }, - { 22, "nema520", NULL, NULL }, - { 23, "nemaL520", NULL, NULL }, - { 24, "nemaL530", NULL, NULL }, - { 25, "nema615", NULL, NULL }, - { 26, "nema620", NULL, NULL }, - { 27, "nemaL620", NULL, NULL }, - { 28, "nemaL630", NULL, NULL }, - { 29, "nemaL715", NULL, NULL }, - { 30, "rf203p277", NULL, NULL }, - { 0, NULL, NULL, NULL } + info_lkp_default(1, "iecC13"), + info_lkp_default(2, "iecC19"), + info_lkp_default(10, "uk"), + info_lkp_default(11, "french"), + info_lkp_default(12, "schuko"), + info_lkp_default(20, "nema515"), + info_lkp_default(21, "nema51520"), + info_lkp_default(22, "nema520"), + info_lkp_default(23, "nemaL520"), + info_lkp_default(24, "nemaL530"), + info_lkp_default(25, "nema615"), + info_lkp_default(26, "nema620"), + info_lkp_default(27, "nemaL620"), + info_lkp_default(28, "nemaL630"), + info_lkp_default(29, "nemaL715"), + info_lkp_default(30, "rf203p277"), + info_lkp_sentinel }; /* Same as eaton_nlogic_outlet_status_info */ static info_lkp_t hpe_cis_outlet_status_info[] = { - { 1, "off", NULL, NULL }, - { 2, "on", NULL, NULL }, - { 3, "pendingOff", NULL, NULL }, /* transitional status */ - { 4, "pendingOn", NULL, NULL }, /* transitional status */ - { 0, NULL, NULL, NULL } + info_lkp_default(1, "off"), + info_lkp_default(2, "on"), + info_lkp_default(3, "pendingOff"), /* transitional status */ + info_lkp_default(4, "pendingOn"), /* transitional status */ + info_lkp_sentinel }; static info_lkp_t hpe_cis_outlet_switchability_info[] = { - { 1, "yes", NULL, NULL }, /* switchable */ - { 2, "no", NULL, NULL }, /* notSwitchable */ - { 0, NULL, NULL, NULL } + info_lkp_default(1, "yes"), /* switchable */ + info_lkp_default(2, "no"), /* notSwitchable */ + info_lkp_sentinel }; /* HPE_PDU_CIS Snmp2NUT lookup table */ @@ -84,164 +84,164 @@ static snmp_info_t hpe_pdu3_cis_mib[] = { * this (e.g. with daisy-chain support), consider adding those here */ /* Device collection */ - { "device.description", ST_FLAG_STRING | ST_FLAG_RW, SU_INFOSIZE, ".1.3.6.1.2.1.1.1.0", NULL, SU_FLAG_OK, NULL }, - { "device.contact", ST_FLAG_STRING | ST_FLAG_RW, SU_INFOSIZE, ".1.3.6.1.2.1.1.4.0", NULL, SU_FLAG_OK, NULL }, - { "device.location", ST_FLAG_STRING | ST_FLAG_RW, SU_INFOSIZE, ".1.3.6.1.2.1.1.6.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("device.description", ST_FLAG_STRING | ST_FLAG_RW, SU_INFOSIZE, ".1.3.6.1.2.1.1.1.0", NULL, SU_FLAG_OK, NULL), + snmp_info_default("device.contact", ST_FLAG_STRING | ST_FLAG_RW, SU_INFOSIZE, ".1.3.6.1.2.1.1.4.0", NULL, SU_FLAG_OK, NULL), + snmp_info_default("device.location", ST_FLAG_STRING | ST_FLAG_RW, SU_INFOSIZE, ".1.3.6.1.2.1.1.6.0", NULL, SU_FLAG_OK, NULL), /* pdu3NumberPDU.0 = INTEGER: 1 (for daisychain support) */ /* - { "device.count", 0, 1, ".1.3.6.1.4.1.232.165.11.1.1.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("device.count", 0, 1, ".1.3.6.1.4.1.232.165.11.1.1.0", NULL, SU_FLAG_OK, NULL), */ /* pdu3Manufacturer.1 = STRING: "HPE" */ - { "device.mfr", ST_FLAG_STRING, SU_INFOSIZE, - ".1.3.6.1.4.1.232.165.11.1.2.1.4.1", NULL, SU_FLAG_STATIC | SU_FLAG_OK, NULL }, + snmp_info_default("device.mfr", ST_FLAG_STRING, SU_INFOSIZE, + ".1.3.6.1.4.1.232.165.11.1.2.1.4.1", NULL, SU_FLAG_STATIC | SU_FLAG_OK, NULL), /* pdu3Model.1 = STRING: "230V, 32A, 7.4kVA, 50/60Hz" */ - { "device.model", ST_FLAG_STRING, SU_INFOSIZE, - ".1.3.6.1.4.1.232.165.11.1.2.1.3.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("device.model", ST_FLAG_STRING, SU_INFOSIZE, + ".1.3.6.1.4.1.232.165.11.1.2.1.3.1", NULL, SU_FLAG_OK, NULL), /* pdu3FirmwareVersion.1 = STRING: "2.0.0.J" */ - { "device.firmware", ST_FLAG_STRING, SU_INFOSIZE, - ".1.3.6.1.4.1.232.165.11.1.2.1.5.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("device.firmware", ST_FLAG_STRING, SU_INFOSIZE, + ".1.3.6.1.4.1.232.165.11.1.2.1.5.1", NULL, SU_FLAG_OK, NULL), /* pdu3PartNumber.1 = STRING: "P9S18A" */ - { "device.part", ST_FLAG_STRING, SU_INFOSIZE, - ".1.3.6.1.4.1.232.165.11.1.2.1.7.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("device.part", ST_FLAG_STRING, SU_INFOSIZE, + ".1.3.6.1.4.1.232.165.11.1.2.1.7.1", NULL, SU_FLAG_OK, NULL), /* pdu3SerialNumber.1 = STRING: "CN09416708" */ - { "device.serial", ST_FLAG_STRING, SU_INFOSIZE, - ".1.3.6.1.4.1.232.165.11.1.2.1.8.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("device.serial", ST_FLAG_STRING, SU_INFOSIZE, + ".1.3.6.1.4.1.232.165.11.1.2.1.8.1", NULL, SU_FLAG_OK, NULL), /* pdu3MACAddress.1 = Hex-STRING: EC EB B8 3D 78 6D */ - { "device.macaddr", ST_FLAG_STRING, SU_INFOSIZE, - ".1.3.6.1.4.1.232.165.11.1.2.1.14.1", NULL, SU_FLAG_OK, NULL }, - { "device.type", ST_FLAG_STRING, SU_INFOSIZE, NULL, "pdu", - SU_FLAG_STATIC | SU_FLAG_ABSENT | SU_FLAG_OK, NULL }, + snmp_info_default("device.macaddr", ST_FLAG_STRING, SU_INFOSIZE, + ".1.3.6.1.4.1.232.165.11.1.2.1.14.1", NULL, SU_FLAG_OK, NULL), + snmp_info_default("device.type", ST_FLAG_STRING, SU_INFOSIZE, NULL, "pdu", + SU_FLAG_STATIC | SU_FLAG_ABSENT | SU_FLAG_OK, NULL), /* Input collection */ /* pdu3InputPhaseCount.1 = INTEGER: 1 */ - { "input.phases", 0, 1, - ".1.3.6.1.4.1.232.165.11.1.2.1.11.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("input.phases", 0, 1, + ".1.3.6.1.4.1.232.165.11.1.2.1.11.1", NULL, SU_FLAG_OK, NULL), /* pdu3InputPowerVA.1 = INTEGER: 922 */ - { "input.power", 0, 0.001, + snmp_info_default("input.power", 0, 0.001, ".1.3.6.1.4.1.232.165.11.2.1.1.4.1", - NULL, SU_FLAG_NEGINVALID | SU_FLAG_UNIQUE | SU_FLAG_OK, NULL }, + NULL, SU_FLAG_NEGINVALID | SU_FLAG_UNIQUE | SU_FLAG_OK, NULL), /* pdu3InputPowerWatts.1 = INTEGER: 900 */ - { "input.realpower", 0, 0.001, + snmp_info_default("input.realpower", 0, 0.001, ".1.3.6.1.4.1.232.165.11.2.1.1.5.1", - NULL, SU_FLAG_NEGINVALID | SU_FLAG_UNIQUE | SU_FLAG_OK, NULL }, + NULL, SU_FLAG_NEGINVALID | SU_FLAG_UNIQUE | SU_FLAG_OK, NULL), /* pdu3InputPhaseCurrentRating.1.%i = INTEGER: 3200 */ /* (can be instanciated by phase) */ - { "input.current.nominal", 0, 0.01, + snmp_info_default("input.current.nominal", 0, 0.01, ".1.3.6.1.4.1.232.165.11.2.2.1.10.1.1", - NULL, 0, NULL }, + NULL, 0, NULL), /* pdu3InputPhaseCurrent.1.%i = INTEGER: 398 */ /* (can be instanciated by phase) */ - { "input.current", 0, 0.01, + snmp_info_default("input.current", 0, 0.01, ".1.3.6.1.4.1.232.165.11.2.2.1.11.1.1", - NULL, 0, NULL }, + NULL, 0, NULL), /* pdu3InputPhaseVoltage.1.%i = INTEGER: 2286 */ /* (can be instanciated by phase) */ - { "input.voltage", 0, 0.1, + snmp_info_default("input.voltage", 0, 0.1, ".1.3.6.1.4.1.232.165.11.2.2.1.3.1.1", - NULL, 0, NULL }, + NULL, 0, NULL), /* pdu3InputFrequency.%i = INTEGER: 500 */ /* (can be instanciated by phase) */ - { "input.frequency", 0, 0.1, + snmp_info_default("input.frequency", 0, 0.1, ".1.3.6.1.4.1.232.165.11.2.1.1.2.1", - NULL, 0, NULL }, + NULL, 0, NULL), /* Outlet groups collection */ /* pdu3GroupCount.1 = INTEGER: 2 */ - { "outlet.group.count", 0, 1, - ".1.3.6.1.4.1.232.165.11.1.2.1.12.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("outlet.group.count", 0, 1, + ".1.3.6.1.4.1.232.165.11.1.2.1.12.1", NULL, SU_FLAG_OK, NULL), /* pdu3GroupName.1.%i = STRING: "B01" */ - { "outlet.group.%i.name", ST_FLAG_STRING, SU_INFOSIZE, + snmp_info_default("outlet.group.%i.name", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.232.165.11.3.1.1.2.1.%i", NULL, SU_FLAG_STATIC | SU_OUTLET_GROUP /*| SU_TYPE_DAISY_1*/, - NULL }, + NULL), /* pdu3GroupType.1.%i = INTEGER: 2 */ - { "outlet.group.%i.type", ST_FLAG_STRING, SU_INFOSIZE, + snmp_info_default("outlet.group.%i.type", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.232.165.11.3.1.1.3.1.%i", NULL, SU_FLAG_STATIC | SU_OUTLET_GROUP /*| SU_TYPE_DAISY_1*/, - &hpe_cis_outlet_group_type_info[0] }, + &hpe_cis_outlet_group_type_info[0]), /* pdu3GroupCurrentPercentLoad.1.%i = INTEGER: 11 */ - { "outlet.group.%i.load", 0, 1.0, + snmp_info_default("outlet.group.%i.load", 0, 1.0, ".1.3.6.1.4.1.232.165.11.3.1.1.18.1.%i", - NULL, SU_FLAG_NEGINVALID | SU_OUTLET_GROUP /*| SU_TYPE_DAISY_1*/, NULL }, + NULL, SU_FLAG_NEGINVALID | SU_OUTLET_GROUP /*| SU_TYPE_DAISY_1*/, NULL), /* pdu3GroupCurrent.1.1 = INTEGER: 187 */ - { "outlet.group.%i.current", 0, 0.01, + snmp_info_default("outlet.group.%i.current", 0, 0.01, ".1.3.6.1.4.1.232.165.11.3.1.1.12.1.%i", - NULL, SU_OUTLET_GROUP /*| SU_TYPE_DAISY_1*/, NULL }, + NULL, SU_OUTLET_GROUP /*| SU_TYPE_DAISY_1*/, NULL), /* pdu3GroupVoltage.1.%i = INTEGER: 2286 */ - { "outlet.group.%i.voltage", 0, 0.1, + snmp_info_default("outlet.group.%i.voltage", 0, 0.1, ".1.3.6.1.4.1.232.165.11.3.1.1.5.1.%i", - NULL, SU_OUTLET_GROUP, NULL }, + NULL, SU_OUTLET_GROUP, NULL), /* pdu3GroupOutletCount.1.1 = INTEGER: 12 */ - { "outlet.group.%i.count", 0, 1, + snmp_info_default("outlet.group.%i.count", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.25.1.1", - NULL, SU_OUTLET_GROUP /* | SU_TYPE_DAISY_1 */, NULL }, + NULL, SU_OUTLET_GROUP /* | SU_TYPE_DAISY_1 */, NULL), /* Outlet collection */ /* pdu3OutletCount.1 = INTEGER: 24 */ - { "outlet.count", 0, 1, - ".1.3.6.1.4.1.232.165.11.1.2.1.13.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("outlet.count", 0, 1, + ".1.3.6.1.4.1.232.165.11.1.2.1.13.1", NULL, SU_FLAG_OK, NULL), /* pdu3Controllable.1 = INTEGER: 1 */ - { "outlet.switchable", ST_FLAG_STRING, SU_INFOSIZE, + snmp_info_default("outlet.switchable", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.232.165.11.1.2.1.10.1", "no", SU_FLAG_STATIC, - &hpe_cis_unit_switchability_info[0] }, + &hpe_cis_unit_switchability_info[0]), /* pdu3OutletControlStatus.1.1 = INTEGER: 2 */ - { "outlet.%i.status", ST_FLAG_STRING, SU_INFOSIZE, + snmp_info_default("outlet.%i.status", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.232.165.11.5.2.1.1.1.%i", NULL, SU_OUTLET, - &hpe_cis_outlet_status_info[0] }, + &hpe_cis_outlet_status_info[0]), /* pdu3OutletName.1.%i = STRING: "CABNIET A FAN DOOR" */ - { "outlet.%i.name", ST_FLAG_RW |ST_FLAG_STRING, SU_INFOSIZE, + snmp_info_default("outlet.%i.name", ST_FLAG_RW |ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.232.165.11.5.1.1.2.1.%i", - NULL, SU_OUTLET, NULL }, + NULL, SU_OUTLET, NULL), /* pdu3OutletType.1.%i = INTEGER: 2 */ - { "outlet.%i.type", ST_FLAG_STRING, SU_INFOSIZE, + snmp_info_default("outlet.%i.type", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.232.165.11.5.1.1.3.1.%i", "unknown", SU_FLAG_STATIC | SU_OUTLET, - &hpe_cis_outlet_type_info[0] }, + &hpe_cis_outlet_type_info[0]), /* pdu3OutletCurrentRating.1.%i = INTEGER: 2000 */ - { "outlet.%i.current.nominal", 0, 0.01, + snmp_info_default("outlet.%i.current.nominal", 0, 0.01, ".1.3.6.1.4.1.232.165.11.5.1.1.4.1.%i", - NULL, SU_OUTLET | SU_FLAG_NEGINVALID, NULL }, + NULL, SU_OUTLET | SU_FLAG_NEGINVALID, NULL), /* pdu3OutletCurrent.1.%i = INTEGER: 36 */ - { "outlet.%i.current", 0, 0.01, + snmp_info_default("outlet.%i.current", 0, 0.01, ".1.3.6.1.4.1.232.165.11.5.1.1.5.1.%i", - NULL, SU_OUTLET | SU_FLAG_NEGINVALID, NULL }, + NULL, SU_OUTLET | SU_FLAG_NEGINVALID, NULL), /* pdu3OutletCurrentPercentLoad.1.%i = INTEGER: 18 */ - { "outlet.%i.load", 0, 1, + snmp_info_default("outlet.%i.load", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.11.1.%i", - NULL, SU_OUTLET | SU_FLAG_NEGINVALID, NULL }, + NULL, SU_OUTLET | SU_FLAG_NEGINVALID, NULL), /* pdu3OutletVA.1.%i = INTEGER: 84 */ - { "outlet.%i.power", 0, 1, + snmp_info_default("outlet.%i.power", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.12.1.%i", - NULL, SU_OUTLET | SU_FLAG_NEGINVALID, NULL }, + NULL, SU_OUTLET | SU_FLAG_NEGINVALID, NULL), /* pdu3OutletWatts.1.%i = INTEGER: 84 */ - { "outlet.%i.realpower", 0, 1, + snmp_info_default("outlet.%i.realpower", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.13.1.%i", - NULL, SU_OUTLET | SU_FLAG_NEGINVALID, NULL }, + NULL, SU_OUTLET | SU_FLAG_NEGINVALID, NULL), /* pdu3OutletControlSwitchable.1.%i = INTEGER: 1 */ - { "outlet.%i.switchable", ST_FLAG_STRING, SU_INFOSIZE, + snmp_info_default("outlet.%i.switchable", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.232.165.11.5.2.1.8.1.%i", "no", SU_OUTLET | SU_FLAG_UNIQUE | SU_TYPE_DAISY_1, - &hpe_cis_outlet_switchability_info[0] }, + &hpe_cis_outlet_switchability_info[0]), /* instant commands. */ /* Delays handling: * 0-n :Time in seconds until the group command is issued * -1:Cancel a pending group-level Off/On/Reboot command */ /* pdu3OutletControlOffCmd.1.%i = INTEGER: -1 */ - { "outlet.%i.load.off", 0, 1, + snmp_info_default("outlet.%i.load.off", 0, 1, ".1.3.6.1.4.1.232.165.11.5.2.1.2.1.%i", - "0", SU_TYPE_CMD | SU_OUTLET /*| SU_TYPE_DAISY_1*/, NULL }, + "0", SU_TYPE_CMD | SU_OUTLET /*| SU_TYPE_DAISY_1*/, NULL), /* pdu3OutletControlOnCmd.1.%i = INTEGER: -1 */ - { "outlet.%i.load.on", 0, 1, + snmp_info_default("outlet.%i.load.on", 0, 1, ".1.3.6.1.4.1.232.165.11.5.2.1.3.1.%i", - "0", SU_TYPE_CMD | SU_OUTLET /*| SU_TYPE_DAISY_1*/, NULL }, + "0", SU_TYPE_CMD | SU_OUTLET /*| SU_TYPE_DAISY_1*/, NULL), /* pdu3OutletControlRebootCmd.1.%i = INTEGER: -1 */ - { "outlet.%i.load.cycle", 0, 1, + snmp_info_default("outlet.%i.load.cycle", 0, 1, ".1.3.6.1.4.1.232.165.11.5.2.1.4.1.%i", - "0", SU_TYPE_CMD | SU_OUTLET /*| SU_TYPE_DAISY_1*/, NULL }, + "0", SU_TYPE_CMD | SU_OUTLET /*| SU_TYPE_DAISY_1*/, NULL), #if 0 @@ -250,1485 +250,1485 @@ static snmp_info_t hpe_pdu3_cis_mib[] = { * outletControlSequenceDelay.0.8 = INTEGER: 8 * (by default each output socket startup is delayed by its number in seconds) */ - { "outlet.%i.delay.shutdown", ST_FLAG_RW, 1, + snmp_info_default("outlet.%i.delay.shutdown", ST_FLAG_RW, 1, ".1.3.6.1.4.1.534.6.6.7.6.6.1.10.%i.%i", - NULL, SU_FLAG_NEGINVALID | SU_OUTLET /*| SU_TYPE_DAISY_1*/, NULL }, - { "outlet.%i.delay.start", ST_FLAG_RW, 1, + NULL, SU_FLAG_NEGINVALID | SU_OUTLET /*| SU_TYPE_DAISY_1*/, NULL), + snmp_info_default("outlet.%i.delay.start", ST_FLAG_RW, 1, ".1.3.6.1.4.1.534.6.6.7.6.6.1.7.%i.%i", - NULL, SU_FLAG_NEGINVALID | SU_OUTLET /*| SU_TYPE_DAISY_1*/, NULL }, + NULL, SU_FLAG_NEGINVALID | SU_OUTLET /*| SU_TYPE_DAISY_1*/, NULL), #endif /* Delayed version, parameter is mandatory (so dfl is NULL)! */ - { "outlet.%i.load.off.delay", 0, 1, + snmp_info_default("outlet.%i.load.off.delay", 0, 1, ".1.3.6.1.4.1.232.165.11.5.2.1.2.1.%i", - NULL, SU_TYPE_CMD | SU_OUTLET /*| SU_TYPE_DAISY_1*/, NULL }, - { "outlet.%i.load.on.delay", 0, 1, + NULL, SU_TYPE_CMD | SU_OUTLET /*| SU_TYPE_DAISY_1*/, NULL), + snmp_info_default("outlet.%i.load.on.delay", 0, 1, ".1.3.6.1.4.1.232.165.11.5.2.1.3.1.%i", - NULL, SU_TYPE_CMD | SU_OUTLET /*| SU_TYPE_DAISY_1*/, NULL }, - { "outlet.%i.load.cycle.delay", 0, 1, + NULL, SU_TYPE_CMD | SU_OUTLET /*| SU_TYPE_DAISY_1*/, NULL), + snmp_info_default("outlet.%i.load.cycle.delay", 0, 1, ".1.3.6.1.4.1.232.165.11.5.2.1.4.1.%i", - NULL, SU_TYPE_CMD | SU_OUTLET /*| SU_TYPE_DAISY_1*/, NULL }, + NULL, SU_TYPE_CMD | SU_OUTLET /*| SU_TYPE_DAISY_1*/, NULL), #if 0 /* Per-outlet shutdown / startup timers * outletControlOffCmd.0.1 = INTEGER: -1 * outletControlOnCmd.0.1 = INTEGER: -1 */ - { "outlet.%i.timer.shutdown", 0, 1, + snmp_info_default("outlet.%i.timer.shutdown", 0, 1, ".1.3.6.1.4.1.534.6.6.7.6.6.1.3.%i.%i", - NULL, SU_OUTLET /*| SU_TYPE_DAISY_1*/, NULL }, - { "outlet.%i.timer.start", 0, 1, + NULL, SU_OUTLET /*| SU_TYPE_DAISY_1*/, NULL), + snmp_info_default("outlet.%i.timer.start", 0, 1, ".1.3.6.1.4.1.534.6.6.7.6.6.1.4.%i.%i", - NULL, SU_OUTLET /*| SU_TYPE_DAISY_1*/, NULL }, + NULL, SU_OUTLET /*| SU_TYPE_DAISY_1*/, NULL), #endif #if WITH_UNMAPPED_DATA_POINTS /* pdu3IdentIndex.1 = INTEGER: 1 */ - { "unmapped.pdu3IdentIndex", 0, 1, ".1.3.6.1.4.1.232.165.11.1.2.1.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3IdentIndex", 0, 1, ".1.3.6.1.4.1.232.165.11.1.2.1.1.1", NULL, SU_FLAG_OK, NULL), /* pdu3Name.1 = "" */ - { "unmapped.pdu3Name", 0, 1, ".1.3.6.1.4.1.232.165.11.1.2.1.2.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3Name", 0, 1, ".1.3.6.1.4.1.232.165.11.1.2.1.2.1", NULL, SU_FLAG_OK, NULL), /* pdu3FirmwareVersionTimeStamp.1 = Hex-STRING: 32 30 31 36 2F 31 31 2F 30 31 20 32 30 3A 30 38 3A 33 39 00 */ - { "unmapped.pdu3FirmwareVersionTimeStamp", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.232.165.11.1.2.1.6.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3FirmwareVersionTimeStamp", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.232.165.11.1.2.1.6.1", NULL, SU_FLAG_OK, NULL), /* pdu3Status.1 = INTEGER: 2 */ - { "unmapped.pdu3Status", 0, 1, ".1.3.6.1.4.1.232.165.11.1.2.1.9.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3Status", 0, 1, ".1.3.6.1.4.1.232.165.11.1.2.1.9.1", NULL, SU_FLAG_OK, NULL), /* pdu3IPv4Address.1 = IpAddress: [PDU_IP] */ - { "unmapped.pdu3IPv4Address", 0, 1, ".1.3.6.1.4.1.232.165.11.1.2.1.15.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3IPv4Address", 0, 1, ".1.3.6.1.4.1.232.165.11.1.2.1.15.1", NULL, SU_FLAG_OK, NULL), /* pdu3IPv6Address.1 = STRING: "FE80::EEEB:B8FF:FE3D:786D" */ - { "unmapped.pdu3IPv6Address", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.232.165.11.1.2.1.16.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3IPv6Address", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.232.165.11.1.2.1.16.1", NULL, SU_FLAG_OK, NULL), /* pdu3ConfigSsh.1 = INTEGER: 1 */ - { "unmapped.pdu3ConfigSsh", 0, 1, ".1.3.6.1.4.1.232.165.11.1.3.1.2.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3ConfigSsh", 0, 1, ".1.3.6.1.4.1.232.165.11.1.3.1.2.1", NULL, SU_FLAG_OK, NULL), /* pdu3ConfigFtps.1 = INTEGER: 1 */ - { "unmapped.pdu3ConfigFtps", 0, 1, ".1.3.6.1.4.1.232.165.11.1.3.1.3.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3ConfigFtps", 0, 1, ".1.3.6.1.4.1.232.165.11.1.3.1.3.1", NULL, SU_FLAG_OK, NULL), /* pdu3ConfigHttp.1 = INTEGER: 1 */ - { "unmapped.pdu3ConfigHttp", 0, 1, ".1.3.6.1.4.1.232.165.11.1.3.1.4.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3ConfigHttp", 0, 1, ".1.3.6.1.4.1.232.165.11.1.3.1.4.1", NULL, SU_FLAG_OK, NULL), /* pdu3ConfigHttps.1 = INTEGER: 1 */ - { "unmapped.pdu3ConfigHttps", 0, 1, ".1.3.6.1.4.1.232.165.11.1.3.1.5.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3ConfigHttps", 0, 1, ".1.3.6.1.4.1.232.165.11.1.3.1.5.1", NULL, SU_FLAG_OK, NULL), /* pdu3ConfigIPv4IPv6Switch.1 = INTEGER: 1 */ - { "unmapped.pdu3ConfigIPv4IPv6Switch", 0, 1, ".1.3.6.1.4.1.232.165.11.1.3.1.6.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3ConfigIPv4IPv6Switch", 0, 1, ".1.3.6.1.4.1.232.165.11.1.3.1.6.1", NULL, SU_FLAG_OK, NULL), /* pdu3ConfigRedfishAPI.1 = INTEGER: 0 */ - { "unmapped.pdu3ConfigRedfishAPI", 0, 1, ".1.3.6.1.4.1.232.165.11.1.3.1.7.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3ConfigRedfishAPI", 0, 1, ".1.3.6.1.4.1.232.165.11.1.3.1.7.1", NULL, SU_FLAG_OK, NULL), /* pdu3ConfigOledDispalyOrientation.1 = INTEGER: 1 */ - { "unmapped.pdu3ConfigOledDispalyOrientation", 0, 1, ".1.3.6.1.4.1.232.165.11.1.3.1.8.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3ConfigOledDispalyOrientation", 0, 1, ".1.3.6.1.4.1.232.165.11.1.3.1.8.1", NULL, SU_FLAG_OK, NULL), /* pdu3ConfigEnergyReset.1 = INTEGER: 1 */ - { "unmapped.pdu3ConfigEnergyReset", 0, 1, ".1.3.6.1.4.1.232.165.11.1.3.1.9.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3ConfigEnergyReset", 0, 1, ".1.3.6.1.4.1.232.165.11.1.3.1.9.1", NULL, SU_FLAG_OK, NULL), /* pdu3ConfigNetworkManagementCardReset.1 = INTEGER: 0 */ - { "unmapped.pdu3ConfigNetworkManagementCardReset", 0, 1, ".1.3.6.1.4.1.232.165.11.1.3.1.10.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3ConfigNetworkManagementCardReset", 0, 1, ".1.3.6.1.4.1.232.165.11.1.3.1.10.1", NULL, SU_FLAG_OK, NULL), /* pdu3ConfigDaisyChainStatus.1 = INTEGER: 0 */ - { "unmapped.pdu3ConfigDaisyChainStatus", 0, 1, ".1.3.6.1.4.1.232.165.11.1.3.1.11.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3ConfigDaisyChainStatus", 0, 1, ".1.3.6.1.4.1.232.165.11.1.3.1.11.1", NULL, SU_FLAG_OK, NULL), /* pdu3InputType.1 = INTEGER: 1 */ - { "unmapped.pdu3InputType", 0, 1, ".1.3.6.1.4.1.232.165.11.2.1.1.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3InputType", 0, 1, ".1.3.6.1.4.1.232.165.11.2.1.1.1.1", NULL, SU_FLAG_OK, NULL), /* pdu3InputFrequencyStatus.1 = INTEGER: 1 */ - { "unmapped.pdu3InputFrequencyStatus", 0, 1, ".1.3.6.1.4.1.232.165.11.2.1.1.3.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3InputFrequencyStatus", 0, 1, ".1.3.6.1.4.1.232.165.11.2.1.1.3.1", NULL, SU_FLAG_OK, NULL), /* pdu3InputTotalEnergy.1 = INTEGER: 0 */ - { "unmapped.pdu3InputTotalEnergy", 0, 1, ".1.3.6.1.4.1.232.165.11.2.1.1.6.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3InputTotalEnergy", 0, 1, ".1.3.6.1.4.1.232.165.11.2.1.1.6.1", NULL, SU_FLAG_OK, NULL), /* pdu3InputPowerWattHourTimer.1 = Hex-STRING: 32 30 31 36 2F 31 30 2F 31 31 20 30 32 3A 34 36 3A 35 30 00 */ - { "unmapped.pdu3InputPowerWattHourTimer", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.232.165.11.2.1.1.7.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3InputPowerWattHourTimer", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.232.165.11.2.1.1.7.1", NULL, SU_FLAG_OK, NULL), /* pdu3InputResettableEnergy.1 = INTEGER: 0 */ - { "unmapped.pdu3InputResettableEnergy", 0, 1, ".1.3.6.1.4.1.232.165.11.2.1.1.8.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3InputResettableEnergy", 0, 1, ".1.3.6.1.4.1.232.165.11.2.1.1.8.1", NULL, SU_FLAG_OK, NULL), /* pdu3InputPowerFactor.1 = INTEGER: 97 */ - { "unmapped.pdu3InputPowerFactor", 0, 1, ".1.3.6.1.4.1.232.165.11.2.1.1.9.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3InputPowerFactor", 0, 1, ".1.3.6.1.4.1.232.165.11.2.1.1.9.1", NULL, SU_FLAG_OK, NULL), /* pdu3InputPowerVAR.1 = INTEGER: 197 */ - { "unmapped.pdu3InputPowerVAR", 0, 1, ".1.3.6.1.4.1.232.165.11.2.1.1.10.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3InputPowerVAR", 0, 1, ".1.3.6.1.4.1.232.165.11.2.1.1.10.1", NULL, SU_FLAG_OK, NULL), /* pdu3InputPhaseIndex.1.1 = INTEGER: 1 */ - { "unmapped.pdu3InputPhaseIndex", 0, 1, ".1.3.6.1.4.1.232.165.11.2.2.1.1.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3InputPhaseIndex", 0, 1, ".1.3.6.1.4.1.232.165.11.2.2.1.1.1.1", NULL, SU_FLAG_OK, NULL), /* pdu3InputPhaseIndex.1.2 = INTEGER: 0 */ - { "unmapped.pdu3InputPhaseIndex", 0, 1, ".1.3.6.1.4.1.232.165.11.2.2.1.1.1.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3InputPhaseIndex", 0, 1, ".1.3.6.1.4.1.232.165.11.2.2.1.1.1.2", NULL, SU_FLAG_OK, NULL), /* pdu3InputPhaseIndex.1.3 = INTEGER: 0 */ - { "unmapped.pdu3InputPhaseIndex", 0, 1, ".1.3.6.1.4.1.232.165.11.2.2.1.1.1.3", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3InputPhaseIndex", 0, 1, ".1.3.6.1.4.1.232.165.11.2.2.1.1.1.3", NULL, SU_FLAG_OK, NULL), /* pdu3InputPhaseVoltageMeasType.1.1 = INTEGER: 1 */ - { "unmapped.pdu3InputPhaseVoltageMeasType", 0, 1, ".1.3.6.1.4.1.232.165.11.2.2.1.2.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3InputPhaseVoltageMeasType", 0, 1, ".1.3.6.1.4.1.232.165.11.2.2.1.2.1.1", NULL, SU_FLAG_OK, NULL), /* pdu3InputPhaseVoltageMeasType.1.2 = INTEGER: 0 */ - { "unmapped.pdu3InputPhaseVoltageMeasType", 0, 1, ".1.3.6.1.4.1.232.165.11.2.2.1.2.1.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3InputPhaseVoltageMeasType", 0, 1, ".1.3.6.1.4.1.232.165.11.2.2.1.2.1.2", NULL, SU_FLAG_OK, NULL), /* pdu3InputPhaseVoltageMeasType.1.3 = INTEGER: 0 */ - { "unmapped.pdu3InputPhaseVoltageMeasType", 0, 1, ".1.3.6.1.4.1.232.165.11.2.2.1.2.1.3", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3InputPhaseVoltageMeasType", 0, 1, ".1.3.6.1.4.1.232.165.11.2.2.1.2.1.3", NULL, SU_FLAG_OK, NULL), /* pdu3InputPhaseVoltageThStatus.1.1 = INTEGER: 1 */ - { "unmapped.pdu3InputPhaseVoltageThStatus", 0, 1, ".1.3.6.1.4.1.232.165.11.2.2.1.4.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3InputPhaseVoltageThStatus", 0, 1, ".1.3.6.1.4.1.232.165.11.2.2.1.4.1.1", NULL, SU_FLAG_OK, NULL), /* pdu3InputPhaseVoltageThStatus.1.2 = INTEGER: 0 */ - { "unmapped.pdu3InputPhaseVoltageThStatus", 0, 1, ".1.3.6.1.4.1.232.165.11.2.2.1.4.1.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3InputPhaseVoltageThStatus", 0, 1, ".1.3.6.1.4.1.232.165.11.2.2.1.4.1.2", NULL, SU_FLAG_OK, NULL), /* pdu3InputPhaseVoltageThStatus.1.3 = INTEGER: 0 */ - { "unmapped.pdu3InputPhaseVoltageThStatus", 0, 1, ".1.3.6.1.4.1.232.165.11.2.2.1.4.1.3", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3InputPhaseVoltageThStatus", 0, 1, ".1.3.6.1.4.1.232.165.11.2.2.1.4.1.3", NULL, SU_FLAG_OK, NULL), /* pdu3InputPhaseVoltageThLowerWarning.1.1 = INTEGER: 1900 */ - { "unmapped.pdu3InputPhaseVoltageThLowerWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.2.2.1.5.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3InputPhaseVoltageThLowerWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.2.2.1.5.1.1", NULL, SU_FLAG_OK, NULL), /* pdu3InputPhaseVoltageThLowerWarning.1.2 = INTEGER: 0 */ - { "unmapped.pdu3InputPhaseVoltageThLowerWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.2.2.1.5.1.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3InputPhaseVoltageThLowerWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.2.2.1.5.1.2", NULL, SU_FLAG_OK, NULL), /* pdu3InputPhaseVoltageThLowerWarning.1.3 = INTEGER: 0 */ - { "unmapped.pdu3InputPhaseVoltageThLowerWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.2.2.1.5.1.3", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3InputPhaseVoltageThLowerWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.2.2.1.5.1.3", NULL, SU_FLAG_OK, NULL), /* pdu3InputPhaseVoltageThLowerCritical.1.1 = INTEGER: 1800 */ - { "unmapped.pdu3InputPhaseVoltageThLowerCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.2.2.1.6.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3InputPhaseVoltageThLowerCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.2.2.1.6.1.1", NULL, SU_FLAG_OK, NULL), /* pdu3InputPhaseVoltageThLowerCritical.1.2 = INTEGER: 0 */ - { "unmapped.pdu3InputPhaseVoltageThLowerCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.2.2.1.6.1.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3InputPhaseVoltageThLowerCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.2.2.1.6.1.2", NULL, SU_FLAG_OK, NULL), /* pdu3InputPhaseVoltageThLowerCritical.1.3 = INTEGER: 0 */ - { "unmapped.pdu3InputPhaseVoltageThLowerCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.2.2.1.6.1.3", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3InputPhaseVoltageThLowerCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.2.2.1.6.1.3", NULL, SU_FLAG_OK, NULL), /* pdu3InputPhaseVoltageThUpperWarning.1.1 = INTEGER: 2500 */ - { "unmapped.pdu3InputPhaseVoltageThUpperWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.2.2.1.7.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3InputPhaseVoltageThUpperWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.2.2.1.7.1.1", NULL, SU_FLAG_OK, NULL), /* pdu3InputPhaseVoltageThUpperWarning.1.2 = INTEGER: 0 */ - { "unmapped.pdu3InputPhaseVoltageThUpperWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.2.2.1.7.1.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3InputPhaseVoltageThUpperWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.2.2.1.7.1.2", NULL, SU_FLAG_OK, NULL), /* pdu3InputPhaseVoltageThUpperWarning.1.3 = INTEGER: 0 */ - { "unmapped.pdu3InputPhaseVoltageThUpperWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.2.2.1.7.1.3", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3InputPhaseVoltageThUpperWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.2.2.1.7.1.3", NULL, SU_FLAG_OK, NULL), /* pdu3InputPhaseVoltageThUpperCritical.1.1 = INTEGER: 2600 */ - { "unmapped.pdu3InputPhaseVoltageThUpperCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.2.2.1.8.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3InputPhaseVoltageThUpperCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.2.2.1.8.1.1", NULL, SU_FLAG_OK, NULL), /* pdu3InputPhaseVoltageThUpperCritical.1.2 = INTEGER: 0 */ - { "unmapped.pdu3InputPhaseVoltageThUpperCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.2.2.1.8.1.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3InputPhaseVoltageThUpperCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.2.2.1.8.1.2", NULL, SU_FLAG_OK, NULL), /* pdu3InputPhaseVoltageThUpperCritical.1.3 = INTEGER: 0 */ - { "unmapped.pdu3InputPhaseVoltageThUpperCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.2.2.1.8.1.3", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3InputPhaseVoltageThUpperCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.2.2.1.8.1.3", NULL, SU_FLAG_OK, NULL), /* pdu3InputPhaseCurrentMeasType.1.1 = INTEGER: 1 */ - { "unmapped.pdu3InputPhaseCurrentMeasType", 0, 1, ".1.3.6.1.4.1.232.165.11.2.2.1.9.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3InputPhaseCurrentMeasType", 0, 1, ".1.3.6.1.4.1.232.165.11.2.2.1.9.1.1", NULL, SU_FLAG_OK, NULL), /* pdu3InputPhaseCurrentMeasType.1.2 = INTEGER: 0 */ - { "unmapped.pdu3InputPhaseCurrentMeasType", 0, 1, ".1.3.6.1.4.1.232.165.11.2.2.1.9.1.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3InputPhaseCurrentMeasType", 0, 1, ".1.3.6.1.4.1.232.165.11.2.2.1.9.1.2", NULL, SU_FLAG_OK, NULL), /* pdu3InputPhaseCurrentMeasType.1.3 = INTEGER: 0 */ - { "unmapped.pdu3InputPhaseCurrentMeasType", 0, 1, ".1.3.6.1.4.1.232.165.11.2.2.1.9.1.3", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3InputPhaseCurrentMeasType", 0, 1, ".1.3.6.1.4.1.232.165.11.2.2.1.9.1.3", NULL, SU_FLAG_OK, NULL), /* pdu3InputPhaseCurrentThStatus.1.1 = INTEGER: 1 */ - { "unmapped.pdu3InputPhaseCurrentThStatus", 0, 1, ".1.3.6.1.4.1.232.165.11.2.2.1.12.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3InputPhaseCurrentThStatus", 0, 1, ".1.3.6.1.4.1.232.165.11.2.2.1.12.1.1", NULL, SU_FLAG_OK, NULL), /* pdu3InputPhaseCurrentThStatus.1.2 = INTEGER: 0 */ - { "unmapped.pdu3InputPhaseCurrentThStatus", 0, 1, ".1.3.6.1.4.1.232.165.11.2.2.1.12.1.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3InputPhaseCurrentThStatus", 0, 1, ".1.3.6.1.4.1.232.165.11.2.2.1.12.1.2", NULL, SU_FLAG_OK, NULL), /* pdu3InputPhaseCurrentThStatus.1.3 = INTEGER: 0 */ - { "unmapped.pdu3InputPhaseCurrentThStatus", 0, 1, ".1.3.6.1.4.1.232.165.11.2.2.1.12.1.3", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3InputPhaseCurrentThStatus", 0, 1, ".1.3.6.1.4.1.232.165.11.2.2.1.12.1.3", NULL, SU_FLAG_OK, NULL), /* pdu3InputPhaseCurrentThLowerWarning.1.1 = INTEGER: 0 */ - { "unmapped.pdu3InputPhaseCurrentThLowerWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.2.2.1.13.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3InputPhaseCurrentThLowerWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.2.2.1.13.1.1", NULL, SU_FLAG_OK, NULL), /* pdu3InputPhaseCurrentThLowerWarning.1.2 = INTEGER: 0 */ - { "unmapped.pdu3InputPhaseCurrentThLowerWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.2.2.1.13.1.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3InputPhaseCurrentThLowerWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.2.2.1.13.1.2", NULL, SU_FLAG_OK, NULL), /* pdu3InputPhaseCurrentThLowerWarning.1.3 = INTEGER: 0 */ - { "unmapped.pdu3InputPhaseCurrentThLowerWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.2.2.1.13.1.3", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3InputPhaseCurrentThLowerWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.2.2.1.13.1.3", NULL, SU_FLAG_OK, NULL), /* pdu3InputPhaseCurrentThLowerCritical.1.1 = INTEGER: 0 */ - { "unmapped.pdu3InputPhaseCurrentThLowerCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.2.2.1.14.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3InputPhaseCurrentThLowerCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.2.2.1.14.1.1", NULL, SU_FLAG_OK, NULL), /* pdu3InputPhaseCurrentThLowerCritical.1.2 = INTEGER: 0 */ - { "unmapped.pdu3InputPhaseCurrentThLowerCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.2.2.1.14.1.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3InputPhaseCurrentThLowerCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.2.2.1.14.1.2", NULL, SU_FLAG_OK, NULL), /* pdu3InputPhaseCurrentThLowerCritical.1.3 = INTEGER: 0 */ - { "unmapped.pdu3InputPhaseCurrentThLowerCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.2.2.1.14.1.3", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3InputPhaseCurrentThLowerCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.2.2.1.14.1.3", NULL, SU_FLAG_OK, NULL), /* pdu3InputPhaseCurrentThUpperWarning.1.1 = INTEGER: 2200 */ - { "unmapped.pdu3InputPhaseCurrentThUpperWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.2.2.1.15.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3InputPhaseCurrentThUpperWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.2.2.1.15.1.1", NULL, SU_FLAG_OK, NULL), /* pdu3InputPhaseCurrentThUpperWarning.1.2 = INTEGER: 0 */ - { "unmapped.pdu3InputPhaseCurrentThUpperWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.2.2.1.15.1.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3InputPhaseCurrentThUpperWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.2.2.1.15.1.2", NULL, SU_FLAG_OK, NULL), /* pdu3InputPhaseCurrentThUpperWarning.1.3 = INTEGER: 0 */ - { "unmapped.pdu3InputPhaseCurrentThUpperWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.2.2.1.15.1.3", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3InputPhaseCurrentThUpperWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.2.2.1.15.1.3", NULL, SU_FLAG_OK, NULL), /* pdu3InputPhaseCurrentThUpperCritical.1.1 = INTEGER: 2800 */ - { "unmapped.pdu3InputPhaseCurrentThUpperCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.2.2.1.16.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3InputPhaseCurrentThUpperCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.2.2.1.16.1.1", NULL, SU_FLAG_OK, NULL), /* pdu3InputPhaseCurrentThUpperCritical.1.2 = INTEGER: 0 */ - { "unmapped.pdu3InputPhaseCurrentThUpperCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.2.2.1.16.1.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3InputPhaseCurrentThUpperCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.2.2.1.16.1.2", NULL, SU_FLAG_OK, NULL), /* pdu3InputPhaseCurrentThUpperCritical.1.3 = INTEGER: 0 */ - { "unmapped.pdu3InputPhaseCurrentThUpperCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.2.2.1.16.1.3", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3InputPhaseCurrentThUpperCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.2.2.1.16.1.3", NULL, SU_FLAG_OK, NULL), /* pdu3InputPhaseCurrentPercentLoad.1.1 = INTEGER: 124 */ - { "unmapped.pdu3InputPhaseCurrentPercentLoad", 0, 1, ".1.3.6.1.4.1.232.165.11.2.2.1.17.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3InputPhaseCurrentPercentLoad", 0, 1, ".1.3.6.1.4.1.232.165.11.2.2.1.17.1.1", NULL, SU_FLAG_OK, NULL), /* pdu3InputPhaseCurrentPercentLoad.1.2 = INTEGER: 0 */ - { "unmapped.pdu3InputPhaseCurrentPercentLoad", 0, 1, ".1.3.6.1.4.1.232.165.11.2.2.1.17.1.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3InputPhaseCurrentPercentLoad", 0, 1, ".1.3.6.1.4.1.232.165.11.2.2.1.17.1.2", NULL, SU_FLAG_OK, NULL), /* pdu3InputPhaseCurrentPercentLoad.1.3 = INTEGER: 0 */ - { "unmapped.pdu3InputPhaseCurrentPercentLoad", 0, 1, ".1.3.6.1.4.1.232.165.11.2.2.1.17.1.3", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3InputPhaseCurrentPercentLoad", 0, 1, ".1.3.6.1.4.1.232.165.11.2.2.1.17.1.3", NULL, SU_FLAG_OK, NULL), /* pdu3InputPhasePowerMeasType.1.1 = INTEGER: 1 */ - { "unmapped.pdu3InputPhasePowerMeasType", 0, 1, ".1.3.6.1.4.1.232.165.11.2.2.1.18.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3InputPhasePowerMeasType", 0, 1, ".1.3.6.1.4.1.232.165.11.2.2.1.18.1.1", NULL, SU_FLAG_OK, NULL), /* pdu3InputPhasePowerMeasType.1.2 = INTEGER: 0 */ - { "unmapped.pdu3InputPhasePowerMeasType", 0, 1, ".1.3.6.1.4.1.232.165.11.2.2.1.18.1.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3InputPhasePowerMeasType", 0, 1, ".1.3.6.1.4.1.232.165.11.2.2.1.18.1.2", NULL, SU_FLAG_OK, NULL), /* pdu3InputPhasePowerMeasType.1.3 = INTEGER: 0 */ - { "unmapped.pdu3InputPhasePowerMeasType", 0, 1, ".1.3.6.1.4.1.232.165.11.2.2.1.18.1.3", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3InputPhasePowerMeasType", 0, 1, ".1.3.6.1.4.1.232.165.11.2.2.1.18.1.3", NULL, SU_FLAG_OK, NULL), /* pdu3InputPhasePowerVA.1.1 = INTEGER: 921 */ - { "unmapped.pdu3InputPhasePowerVA", 0, 1, ".1.3.6.1.4.1.232.165.11.2.2.1.19.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3InputPhasePowerVA", 0, 1, ".1.3.6.1.4.1.232.165.11.2.2.1.19.1.1", NULL, SU_FLAG_OK, NULL), /* pdu3InputPhasePowerVA.1.2 = INTEGER: 921 */ - { "unmapped.pdu3InputPhasePowerVA", 0, 1, ".1.3.6.1.4.1.232.165.11.2.2.1.19.1.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3InputPhasePowerVA", 0, 1, ".1.3.6.1.4.1.232.165.11.2.2.1.19.1.2", NULL, SU_FLAG_OK, NULL), /* pdu3InputPhasePowerVA.1.3 = INTEGER: 921 */ - { "unmapped.pdu3InputPhasePowerVA", 0, 1, ".1.3.6.1.4.1.232.165.11.2.2.1.19.1.3", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3InputPhasePowerVA", 0, 1, ".1.3.6.1.4.1.232.165.11.2.2.1.19.1.3", NULL, SU_FLAG_OK, NULL), /* pdu3InputPhasePowerWatts.1.1 = INTEGER: 899 */ - { "unmapped.pdu3InputPhasePowerWatts", 0, 1, ".1.3.6.1.4.1.232.165.11.2.2.1.20.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3InputPhasePowerWatts", 0, 1, ".1.3.6.1.4.1.232.165.11.2.2.1.20.1.1", NULL, SU_FLAG_OK, NULL), /* pdu3InputPhasePowerWatts.1.2 = INTEGER: 0 */ - { "unmapped.pdu3InputPhasePowerWatts", 0, 1, ".1.3.6.1.4.1.232.165.11.2.2.1.20.1.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3InputPhasePowerWatts", 0, 1, ".1.3.6.1.4.1.232.165.11.2.2.1.20.1.2", NULL, SU_FLAG_OK, NULL), /* pdu3InputPhasePowerWatts.1.3 = INTEGER: 0 */ - { "unmapped.pdu3InputPhasePowerWatts", 0, 1, ".1.3.6.1.4.1.232.165.11.2.2.1.20.1.3", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3InputPhasePowerWatts", 0, 1, ".1.3.6.1.4.1.232.165.11.2.2.1.20.1.3", NULL, SU_FLAG_OK, NULL), /* pdu3InputPhasePowerWattHour.1.1 = INTEGER: 0 */ - { "unmapped.pdu3InputPhasePowerWattHour", 0, 1, ".1.3.6.1.4.1.232.165.11.2.2.1.21.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3InputPhasePowerWattHour", 0, 1, ".1.3.6.1.4.1.232.165.11.2.2.1.21.1.1", NULL, SU_FLAG_OK, NULL), /* pdu3InputPhasePowerWattHour.1.2 = INTEGER: 0 */ - { "unmapped.pdu3InputPhasePowerWattHour", 0, 1, ".1.3.6.1.4.1.232.165.11.2.2.1.21.1.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3InputPhasePowerWattHour", 0, 1, ".1.3.6.1.4.1.232.165.11.2.2.1.21.1.2", NULL, SU_FLAG_OK, NULL), /* pdu3InputPhasePowerWattHour.1.3 = INTEGER: 0 */ - { "unmapped.pdu3InputPhasePowerWattHour", 0, 1, ".1.3.6.1.4.1.232.165.11.2.2.1.21.1.3", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3InputPhasePowerWattHour", 0, 1, ".1.3.6.1.4.1.232.165.11.2.2.1.21.1.3", NULL, SU_FLAG_OK, NULL), /* pdu3InputPhasePowerWattHourTimer.1.1 = Hex-STRING: 32 30 31 36 2F 31 30 2F 31 31 20 30 32 3A 34 36 3A 35 30 00 */ - { "unmapped.pdu3InputPhasePowerWattHourTimer", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.232.165.11.2.2.1.22.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3InputPhasePowerWattHourTimer", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.232.165.11.2.2.1.22.1.1", NULL, SU_FLAG_OK, NULL), /* pdu3InputPhasePowerWattHourTimer.1.2 = Hex-STRING: 32 30 31 36 2F 31 30 2F 31 31 20 30 32 3A 34 36 3A 35 30 00 */ - { "unmapped.pdu3InputPhasePowerWattHourTimer", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.232.165.11.2.2.1.22.1.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3InputPhasePowerWattHourTimer", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.232.165.11.2.2.1.22.1.2", NULL, SU_FLAG_OK, NULL), /* pdu3InputPhasePowerWattHourTimer.1.3 = Hex-STRING: 32 30 31 36 2F 31 30 2F 31 31 20 30 32 3A 34 36 3A 35 30 00 */ - { "unmapped.pdu3InputPhasePowerWattHourTimer", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.232.165.11.2.2.1.22.1.3", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3InputPhasePowerWattHourTimer", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.232.165.11.2.2.1.22.1.3", NULL, SU_FLAG_OK, NULL), /* pdu3InputPhasePowerFactor.1.1 = INTEGER: 97 */ - { "unmapped.pdu3InputPhasePowerFactor", 0, 1, ".1.3.6.1.4.1.232.165.11.2.2.1.23.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3InputPhasePowerFactor", 0, 1, ".1.3.6.1.4.1.232.165.11.2.2.1.23.1.1", NULL, SU_FLAG_OK, NULL), /* pdu3InputPhasePowerFactor.1.2 = INTEGER: 0 */ - { "unmapped.pdu3InputPhasePowerFactor", 0, 1, ".1.3.6.1.4.1.232.165.11.2.2.1.23.1.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3InputPhasePowerFactor", 0, 1, ".1.3.6.1.4.1.232.165.11.2.2.1.23.1.2", NULL, SU_FLAG_OK, NULL), /* pdu3InputPhasePowerFactor.1.3 = INTEGER: 0 */ - { "unmapped.pdu3InputPhasePowerFactor", 0, 1, ".1.3.6.1.4.1.232.165.11.2.2.1.23.1.3", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3InputPhasePowerFactor", 0, 1, ".1.3.6.1.4.1.232.165.11.2.2.1.23.1.3", NULL, SU_FLAG_OK, NULL), /* pdu3InputPhasePowerVAR.1.1 = INTEGER: 195 */ - { "unmapped.pdu3InputPhasePowerVAR", 0, 1, ".1.3.6.1.4.1.232.165.11.2.2.1.24.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3InputPhasePowerVAR", 0, 1, ".1.3.6.1.4.1.232.165.11.2.2.1.24.1.1", NULL, SU_FLAG_OK, NULL), /* pdu3InputPhasePowerVAR.1.2 = INTEGER: 0 */ - { "unmapped.pdu3InputPhasePowerVAR", 0, 1, ".1.3.6.1.4.1.232.165.11.2.2.1.24.1.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3InputPhasePowerVAR", 0, 1, ".1.3.6.1.4.1.232.165.11.2.2.1.24.1.2", NULL, SU_FLAG_OK, NULL), /* pdu3InputPhasePowerVAR.1.3 = INTEGER: 0 */ - { "unmapped.pdu3InputPhasePowerVAR", 0, 1, ".1.3.6.1.4.1.232.165.11.2.2.1.24.1.3", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3InputPhasePowerVAR", 0, 1, ".1.3.6.1.4.1.232.165.11.2.2.1.24.1.3", NULL, SU_FLAG_OK, NULL), /* pdu3GroupIndex.1.1 = INTEGER: 1 */ - { "unmapped.pdu3GroupIndex", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.1.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3GroupIndex", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.1.1.1", NULL, SU_FLAG_OK, NULL), /* pdu3GroupIndex.1.2 = INTEGER: 2 */ - { "unmapped.pdu3GroupIndex", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.1.1.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3GroupIndex", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.1.1.2", NULL, SU_FLAG_OK, NULL), /* pdu3GroupIndex.1.3 = INTEGER: 3 */ - { "unmapped.pdu3GroupIndex", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.1.1.3", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3GroupIndex", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.1.1.3", NULL, SU_FLAG_OK, NULL), /* pdu3GroupIndex.1.4 = INTEGER: 4 */ - { "unmapped.pdu3GroupIndex", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.1.1.4", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3GroupIndex", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.1.1.4", NULL, SU_FLAG_OK, NULL), /* pdu3GroupIndex.1.5 = INTEGER: 5 */ - { "unmapped.pdu3GroupIndex", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.1.1.5", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3GroupIndex", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.1.1.5", NULL, SU_FLAG_OK, NULL), /* pdu3GroupIndex.1.6 = INTEGER: 6 */ - { "unmapped.pdu3GroupIndex", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.1.1.6", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3GroupIndex", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.1.1.6", NULL, SU_FLAG_OK, NULL), /* pdu3GroupIndex.1.7 = INTEGER: 7 */ - { "unmapped.pdu3GroupIndex", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.1.1.7", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3GroupIndex", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.1.1.7", NULL, SU_FLAG_OK, NULL), /* pdu3GroupIndex.1.8 = INTEGER: 8 */ - { "unmapped.pdu3GroupIndex", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.1.1.8", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3GroupIndex", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.1.1.8", NULL, SU_FLAG_OK, NULL), /* pdu3GroupIndex.1.9 = INTEGER: 9 */ - { "unmapped.pdu3GroupIndex", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.1.1.9", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3GroupIndex", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.1.1.9", NULL, SU_FLAG_OK, NULL), /* pdu3GroupIndex.1.10 = INTEGER: 10 */ - { "unmapped.pdu3GroupIndex", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.1.1.10", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3GroupIndex", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.1.1.10", NULL, SU_FLAG_OK, NULL), /* pdu3GroupIndex.1.11 = INTEGER: 11 */ - { "unmapped.pdu3GroupIndex", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.1.1.11", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3GroupIndex", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.1.1.11", NULL, SU_FLAG_OK, NULL), /* pdu3GroupIndex.1.12 = INTEGER: 12 */ - { "unmapped.pdu3GroupIndex", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.1.1.12", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3GroupIndex", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.1.1.12", NULL, SU_FLAG_OK, NULL), /* pdu3GroupVoltageMeasType.1.1 = INTEGER: 1 */ - { "unmapped.pdu3GroupVoltageMeasType", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.4.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3GroupVoltageMeasType", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.4.1.1", NULL, SU_FLAG_OK, NULL), /* pdu3GroupVoltageMeasType.1.2 = INTEGER: 1 */ - { "unmapped.pdu3GroupVoltageMeasType", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.4.1.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3GroupVoltageMeasType", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.4.1.2", NULL, SU_FLAG_OK, NULL), /* pdu3GroupVoltageMeasType.1.3 = INTEGER: 0 */ - { "unmapped.pdu3GroupVoltageMeasType", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.4.1.3", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3GroupVoltageMeasType", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.4.1.3", NULL, SU_FLAG_OK, NULL), /* pdu3GroupVoltageMeasType.1.4 = INTEGER: 0 */ - { "unmapped.pdu3GroupVoltageMeasType", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.4.1.4", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3GroupVoltageMeasType", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.4.1.4", NULL, SU_FLAG_OK, NULL), /* pdu3GroupVoltageMeasType.1.5 = INTEGER: 0 */ - { "unmapped.pdu3GroupVoltageMeasType", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.4.1.5", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3GroupVoltageMeasType", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.4.1.5", NULL, SU_FLAG_OK, NULL), /* pdu3GroupVoltageMeasType.1.6 = INTEGER: 0 */ - { "unmapped.pdu3GroupVoltageMeasType", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.4.1.6", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3GroupVoltageMeasType", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.4.1.6", NULL, SU_FLAG_OK, NULL), /* pdu3GroupVoltageMeasType.1.7 = INTEGER: 0 */ - { "unmapped.pdu3GroupVoltageMeasType", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.4.1.7", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3GroupVoltageMeasType", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.4.1.7", NULL, SU_FLAG_OK, NULL), /* pdu3GroupVoltageMeasType.1.8 = INTEGER: 0 */ - { "unmapped.pdu3GroupVoltageMeasType", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.4.1.8", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3GroupVoltageMeasType", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.4.1.8", NULL, SU_FLAG_OK, NULL), /* pdu3GroupVoltageMeasType.1.9 = INTEGER: 0 */ - { "unmapped.pdu3GroupVoltageMeasType", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.4.1.9", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3GroupVoltageMeasType", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.4.1.9", NULL, SU_FLAG_OK, NULL), /* pdu3GroupVoltageMeasType.1.10 = INTEGER: 0 */ - { "unmapped.pdu3GroupVoltageMeasType", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.4.1.10", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3GroupVoltageMeasType", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.4.1.10", NULL, SU_FLAG_OK, NULL), /* pdu3GroupVoltageMeasType.1.11 = INTEGER: 0 */ - { "unmapped.pdu3GroupVoltageMeasType", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.4.1.11", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3GroupVoltageMeasType", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.4.1.11", NULL, SU_FLAG_OK, NULL), /* pdu3GroupVoltageMeasType.1.12 = INTEGER: 0 */ - { "unmapped.pdu3GroupVoltageMeasType", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.4.1.12", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3GroupVoltageMeasType", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.4.1.12", NULL, SU_FLAG_OK, NULL), /* pdu3GroupVoltageThStatus.1.1 = INTEGER: 1 */ - { "unmapped.pdu3GroupVoltageThStatus", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.6.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3GroupVoltageThStatus", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.6.1.1", NULL, SU_FLAG_OK, NULL), /* pdu3GroupVoltageThStatus.1.2 = INTEGER: 1 */ - { "unmapped.pdu3GroupVoltageThStatus", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.6.1.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3GroupVoltageThStatus", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.6.1.2", NULL, SU_FLAG_OK, NULL), /* pdu3GroupVoltageThStatus.1.3 = INTEGER: 0 */ - { "unmapped.pdu3GroupVoltageThStatus", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.6.1.3", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3GroupVoltageThStatus", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.6.1.3", NULL, SU_FLAG_OK, NULL), /* pdu3GroupVoltageThStatus.1.4 = INTEGER: 0 */ - { "unmapped.pdu3GroupVoltageThStatus", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.6.1.4", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3GroupVoltageThStatus", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.6.1.4", NULL, SU_FLAG_OK, NULL), /* pdu3GroupVoltageThStatus.1.5 = INTEGER: 0 */ - { "unmapped.pdu3GroupVoltageThStatus", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.6.1.5", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3GroupVoltageThStatus", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.6.1.5", NULL, SU_FLAG_OK, NULL), /* pdu3GroupVoltageThStatus.1.6 = INTEGER: 0 */ - { "unmapped.pdu3GroupVoltageThStatus", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.6.1.6", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3GroupVoltageThStatus", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.6.1.6", NULL, SU_FLAG_OK, NULL), /* pdu3GroupVoltageThStatus.1.7 = INTEGER: 0 */ - { "unmapped.pdu3GroupVoltageThStatus", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.6.1.7", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3GroupVoltageThStatus", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.6.1.7", NULL, SU_FLAG_OK, NULL), /* pdu3GroupVoltageThStatus.1.8 = INTEGER: 0 */ - { "unmapped.pdu3GroupVoltageThStatus", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.6.1.8", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3GroupVoltageThStatus", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.6.1.8", NULL, SU_FLAG_OK, NULL), /* pdu3GroupVoltageThStatus.1.9 = INTEGER: 0 */ - { "unmapped.pdu3GroupVoltageThStatus", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.6.1.9", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3GroupVoltageThStatus", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.6.1.9", NULL, SU_FLAG_OK, NULL), /* pdu3GroupVoltageThStatus.1.10 = INTEGER: 0 */ - { "unmapped.pdu3GroupVoltageThStatus", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.6.1.10", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3GroupVoltageThStatus", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.6.1.10", NULL, SU_FLAG_OK, NULL), /* pdu3GroupVoltageThStatus.1.11 = INTEGER: 0 */ - { "unmapped.pdu3GroupVoltageThStatus", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.6.1.11", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3GroupVoltageThStatus", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.6.1.11", NULL, SU_FLAG_OK, NULL), /* pdu3GroupVoltageThStatus.1.12 = INTEGER: 0 */ - { "unmapped.pdu3GroupVoltageThStatus", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.6.1.12", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3GroupVoltageThStatus", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.6.1.12", NULL, SU_FLAG_OK, NULL), /* pdu3GroupVoltageThLowerWarning.1.1 = INTEGER: 0 */ - { "unmapped.pdu3GroupVoltageThLowerWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.7.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3GroupVoltageThLowerWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.7.1.1", NULL, SU_FLAG_OK, NULL), /* pdu3GroupVoltageThLowerWarning.1.2 = INTEGER: 0 */ - { "unmapped.pdu3GroupVoltageThLowerWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.7.1.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3GroupVoltageThLowerWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.7.1.2", NULL, SU_FLAG_OK, NULL), /* pdu3GroupVoltageThLowerWarning.1.3 = INTEGER: 0 */ - { "unmapped.pdu3GroupVoltageThLowerWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.7.1.3", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3GroupVoltageThLowerWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.7.1.3", NULL, SU_FLAG_OK, NULL), /* pdu3GroupVoltageThLowerWarning.1.4 = INTEGER: 0 */ - { "unmapped.pdu3GroupVoltageThLowerWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.7.1.4", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3GroupVoltageThLowerWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.7.1.4", NULL, SU_FLAG_OK, NULL), /* pdu3GroupVoltageThLowerWarning.1.5 = INTEGER: 0 */ - { "unmapped.pdu3GroupVoltageThLowerWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.7.1.5", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3GroupVoltageThLowerWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.7.1.5", NULL, SU_FLAG_OK, NULL), /* pdu3GroupVoltageThLowerWarning.1.6 = INTEGER: 0 */ - { "unmapped.pdu3GroupVoltageThLowerWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.7.1.6", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3GroupVoltageThLowerWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.7.1.6", NULL, SU_FLAG_OK, NULL), /* pdu3GroupVoltageThLowerWarning.1.7 = INTEGER: 0 */ - { "unmapped.pdu3GroupVoltageThLowerWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.7.1.7", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3GroupVoltageThLowerWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.7.1.7", NULL, SU_FLAG_OK, NULL), /* pdu3GroupVoltageThLowerWarning.1.8 = INTEGER: 0 */ - { "unmapped.pdu3GroupVoltageThLowerWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.7.1.8", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3GroupVoltageThLowerWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.7.1.8", NULL, SU_FLAG_OK, NULL), /* pdu3GroupVoltageThLowerWarning.1.9 = INTEGER: 0 */ - { "unmapped.pdu3GroupVoltageThLowerWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.7.1.9", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3GroupVoltageThLowerWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.7.1.9", NULL, SU_FLAG_OK, NULL), /* pdu3GroupVoltageThLowerWarning.1.10 = INTEGER: 0 */ - { "unmapped.pdu3GroupVoltageThLowerWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.7.1.10", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3GroupVoltageThLowerWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.7.1.10", NULL, SU_FLAG_OK, NULL), /* pdu3GroupVoltageThLowerWarning.1.11 = INTEGER: 0 */ - { "unmapped.pdu3GroupVoltageThLowerWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.7.1.11", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3GroupVoltageThLowerWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.7.1.11", NULL, SU_FLAG_OK, NULL), /* pdu3GroupVoltageThLowerWarning.1.12 = INTEGER: 0 */ - { "unmapped.pdu3GroupVoltageThLowerWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.7.1.12", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3GroupVoltageThLowerWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.7.1.12", NULL, SU_FLAG_OK, NULL), /* pdu3GroupVoltageThLowerCritical.1.1 = INTEGER: 0 */ - { "unmapped.pdu3GroupVoltageThLowerCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.8.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3GroupVoltageThLowerCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.8.1.1", NULL, SU_FLAG_OK, NULL), /* pdu3GroupVoltageThLowerCritical.1.2 = INTEGER: 0 */ - { "unmapped.pdu3GroupVoltageThLowerCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.8.1.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3GroupVoltageThLowerCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.8.1.2", NULL, SU_FLAG_OK, NULL), /* pdu3GroupVoltageThLowerCritical.1.3 = INTEGER: 0 */ - { "unmapped.pdu3GroupVoltageThLowerCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.8.1.3", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3GroupVoltageThLowerCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.8.1.3", NULL, SU_FLAG_OK, NULL), /* pdu3GroupVoltageThLowerCritical.1.4 = INTEGER: 0 */ - { "unmapped.pdu3GroupVoltageThLowerCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.8.1.4", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3GroupVoltageThLowerCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.8.1.4", NULL, SU_FLAG_OK, NULL), /* pdu3GroupVoltageThLowerCritical.1.5 = INTEGER: 0 */ - { "unmapped.pdu3GroupVoltageThLowerCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.8.1.5", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3GroupVoltageThLowerCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.8.1.5", NULL, SU_FLAG_OK, NULL), /* pdu3GroupVoltageThLowerCritical.1.6 = INTEGER: 0 */ - { "unmapped.pdu3GroupVoltageThLowerCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.8.1.6", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3GroupVoltageThLowerCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.8.1.6", NULL, SU_FLAG_OK, NULL), /* pdu3GroupVoltageThLowerCritical.1.7 = INTEGER: 0 */ - { "unmapped.pdu3GroupVoltageThLowerCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.8.1.7", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3GroupVoltageThLowerCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.8.1.7", NULL, SU_FLAG_OK, NULL), /* pdu3GroupVoltageThLowerCritical.1.8 = INTEGER: 0 */ - { "unmapped.pdu3GroupVoltageThLowerCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.8.1.8", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3GroupVoltageThLowerCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.8.1.8", NULL, SU_FLAG_OK, NULL), /* pdu3GroupVoltageThLowerCritical.1.9 = INTEGER: 0 */ - { "unmapped.pdu3GroupVoltageThLowerCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.8.1.9", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3GroupVoltageThLowerCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.8.1.9", NULL, SU_FLAG_OK, NULL), /* pdu3GroupVoltageThLowerCritical.1.10 = INTEGER: 0 */ - { "unmapped.pdu3GroupVoltageThLowerCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.8.1.10", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3GroupVoltageThLowerCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.8.1.10", NULL, SU_FLAG_OK, NULL), /* pdu3GroupVoltageThLowerCritical.1.11 = INTEGER: 0 */ - { "unmapped.pdu3GroupVoltageThLowerCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.8.1.11", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3GroupVoltageThLowerCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.8.1.11", NULL, SU_FLAG_OK, NULL), /* pdu3GroupVoltageThLowerCritical.1.12 = INTEGER: 0 */ - { "unmapped.pdu3GroupVoltageThLowerCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.8.1.12", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3GroupVoltageThLowerCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.8.1.12", NULL, SU_FLAG_OK, NULL), /* pdu3GroupVoltageThUpperWarning.1.%i = INTEGER: 0 */ - { "unmapped.pdu3GroupVoltageThUpperWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.9.1.%i", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3GroupVoltageThUpperWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.9.1.%i", NULL, SU_FLAG_OK, NULL), /* pdu3GroupVoltageThUpperCritical.1.1 = INTEGER: 0 */ - { "unmapped.pdu3GroupVoltageThUpperCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.10.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3GroupVoltageThUpperCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.10.1.1", NULL, SU_FLAG_OK, NULL), /* pdu3GroupVoltageThUpperCritical.1.2 = INTEGER: 0 */ - { "unmapped.pdu3GroupVoltageThUpperCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.10.1.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3GroupVoltageThUpperCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.10.1.2", NULL, SU_FLAG_OK, NULL), /* pdu3GroupVoltageThUpperCritical.1.3 = INTEGER: 0 */ - { "unmapped.pdu3GroupVoltageThUpperCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.10.1.3", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3GroupVoltageThUpperCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.10.1.3", NULL, SU_FLAG_OK, NULL), /* pdu3GroupVoltageThUpperCritical.1.4 = INTEGER: 0 */ - { "unmapped.pdu3GroupVoltageThUpperCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.10.1.4", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3GroupVoltageThUpperCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.10.1.4", NULL, SU_FLAG_OK, NULL), /* pdu3GroupVoltageThUpperCritical.1.5 = INTEGER: 0 */ - { "unmapped.pdu3GroupVoltageThUpperCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.10.1.5", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3GroupVoltageThUpperCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.10.1.5", NULL, SU_FLAG_OK, NULL), /* pdu3GroupVoltageThUpperCritical.1.6 = INTEGER: 0 */ - { "unmapped.pdu3GroupVoltageThUpperCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.10.1.6", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3GroupVoltageThUpperCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.10.1.6", NULL, SU_FLAG_OK, NULL), /* pdu3GroupVoltageThUpperCritical.1.7 = INTEGER: 0 */ - { "unmapped.pdu3GroupVoltageThUpperCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.10.1.7", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3GroupVoltageThUpperCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.10.1.7", NULL, SU_FLAG_OK, NULL), /* pdu3GroupVoltageThUpperCritical.1.8 = INTEGER: 0 */ - { "unmapped.pdu3GroupVoltageThUpperCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.10.1.8", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3GroupVoltageThUpperCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.10.1.8", NULL, SU_FLAG_OK, NULL), /* pdu3GroupVoltageThUpperCritical.1.9 = INTEGER: 0 */ - { "unmapped.pdu3GroupVoltageThUpperCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.10.1.9", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3GroupVoltageThUpperCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.10.1.9", NULL, SU_FLAG_OK, NULL), /* pdu3GroupVoltageThUpperCritical.1.10 = INTEGER: 0 */ - { "unmapped.pdu3GroupVoltageThUpperCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.10.1.10", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3GroupVoltageThUpperCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.10.1.10", NULL, SU_FLAG_OK, NULL), /* pdu3GroupVoltageThUpperCritical.1.11 = INTEGER: 0 */ - { "unmapped.pdu3GroupVoltageThUpperCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.10.1.11", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3GroupVoltageThUpperCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.10.1.11", NULL, SU_FLAG_OK, NULL), /* pdu3GroupVoltageThUpperCritical.1.12 = INTEGER: 0 */ - { "unmapped.pdu3GroupVoltageThUpperCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.10.1.12", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3GroupVoltageThUpperCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.10.1.12", NULL, SU_FLAG_OK, NULL), /* pdu3groupCurrentRating.1.1 = INTEGER: 1600 */ - { "unmapped.pdu3groupCurrentRating", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.11.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3groupCurrentRating", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.11.1.1", NULL, SU_FLAG_OK, NULL), /* pdu3groupCurrentRating.1.2 = INTEGER: 1600 */ - { "unmapped.pdu3groupCurrentRating", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.11.1.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3groupCurrentRating", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.11.1.2", NULL, SU_FLAG_OK, NULL), /* pdu3groupCurrentRating.1.3 = INTEGER: 0 */ - { "unmapped.pdu3groupCurrentRating", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.11.1.3", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3groupCurrentRating", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.11.1.3", NULL, SU_FLAG_OK, NULL), /* pdu3groupCurrentRating.1.4 = INTEGER: 0 */ - { "unmapped.pdu3groupCurrentRating", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.11.1.4", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3groupCurrentRating", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.11.1.4", NULL, SU_FLAG_OK, NULL), /* pdu3groupCurrentRating.1.5 = INTEGER: 0 */ - { "unmapped.pdu3groupCurrentRating", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.11.1.5", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3groupCurrentRating", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.11.1.5", NULL, SU_FLAG_OK, NULL), /* pdu3groupCurrentRating.1.6 = INTEGER: 0 */ - { "unmapped.pdu3groupCurrentRating", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.11.1.6", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3groupCurrentRating", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.11.1.6", NULL, SU_FLAG_OK, NULL), /* pdu3groupCurrentRating.1.7 = INTEGER: 0 */ - { "unmapped.pdu3groupCurrentRating", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.11.1.7", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3groupCurrentRating", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.11.1.7", NULL, SU_FLAG_OK, NULL), /* pdu3groupCurrentRating.1.8 = INTEGER: 0 */ - { "unmapped.pdu3groupCurrentRating", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.11.1.8", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3groupCurrentRating", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.11.1.8", NULL, SU_FLAG_OK, NULL), /* pdu3groupCurrentRating.1.9 = INTEGER: 0 */ - { "unmapped.pdu3groupCurrentRating", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.11.1.9", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3groupCurrentRating", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.11.1.9", NULL, SU_FLAG_OK, NULL), /* pdu3groupCurrentRating.1.10 = INTEGER: 0 */ - { "unmapped.pdu3groupCurrentRating", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.11.1.10", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3groupCurrentRating", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.11.1.10", NULL, SU_FLAG_OK, NULL), /* pdu3groupCurrentRating.1.11 = INTEGER: 0 */ - { "unmapped.pdu3groupCurrentRating", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.11.1.11", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3groupCurrentRating", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.11.1.11", NULL, SU_FLAG_OK, NULL), /* pdu3groupCurrentRating.1.12 = INTEGER: 0 */ - { "unmapped.pdu3groupCurrentRating", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.11.1.12", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3groupCurrentRating", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.11.1.12", NULL, SU_FLAG_OK, NULL), /* pdu3GroupCurrentThStatus.1.%i = INTEGER: 1 */ - { "unmapped.pdu3GroupCurrentThStatus", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.13.1.%i", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3GroupCurrentThStatus", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.13.1.%i", NULL, SU_FLAG_OK, NULL), /* pdu3GroupCurrentThLowerWarning.1.%i = INTEGER: 0 */ - { "unmapped.pdu3GroupCurrentThLowerWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.14.1.%i", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3GroupCurrentThLowerWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.14.1.%i", NULL, SU_FLAG_OK, NULL), /* pdu3GroupCurrentThLowerCritical.1.1 = INTEGER: 0 */ - { "unmapped.pdu3GroupCurrentThLowerCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.15.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3GroupCurrentThLowerCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.15.1.1", NULL, SU_FLAG_OK, NULL), /* pdu3GroupCurrentThLowerCritical.1.2 = INTEGER: 0 */ - { "unmapped.pdu3GroupCurrentThLowerCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.15.1.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3GroupCurrentThLowerCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.15.1.2", NULL, SU_FLAG_OK, NULL), /* pdu3GroupCurrentThLowerCritical.1.3 = INTEGER: 0 */ - { "unmapped.pdu3GroupCurrentThLowerCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.15.1.3", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3GroupCurrentThLowerCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.15.1.3", NULL, SU_FLAG_OK, NULL), /* pdu3GroupCurrentThLowerCritical.1.4 = INTEGER: 0 */ - { "unmapped.pdu3GroupCurrentThLowerCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.15.1.4", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3GroupCurrentThLowerCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.15.1.4", NULL, SU_FLAG_OK, NULL), /* pdu3GroupCurrentThLowerCritical.1.5 = INTEGER: 0 */ - { "unmapped.pdu3GroupCurrentThLowerCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.15.1.5", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3GroupCurrentThLowerCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.15.1.5", NULL, SU_FLAG_OK, NULL), /* pdu3GroupCurrentThLowerCritical.1.6 = INTEGER: 0 */ - { "unmapped.pdu3GroupCurrentThLowerCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.15.1.6", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3GroupCurrentThLowerCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.15.1.6", NULL, SU_FLAG_OK, NULL), /* pdu3GroupCurrentThLowerCritical.1.7 = INTEGER: 0 */ - { "unmapped.pdu3GroupCurrentThLowerCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.15.1.7", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3GroupCurrentThLowerCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.15.1.7", NULL, SU_FLAG_OK, NULL), /* pdu3GroupCurrentThLowerCritical.1.8 = INTEGER: 0 */ - { "unmapped.pdu3GroupCurrentThLowerCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.15.1.8", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3GroupCurrentThLowerCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.15.1.8", NULL, SU_FLAG_OK, NULL), /* pdu3GroupCurrentThLowerCritical.1.9 = INTEGER: 0 */ - { "unmapped.pdu3GroupCurrentThLowerCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.15.1.9", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3GroupCurrentThLowerCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.15.1.9", NULL, SU_FLAG_OK, NULL), /* pdu3GroupCurrentThLowerCritical.1.10 = INTEGER: 0 */ - { "unmapped.pdu3GroupCurrentThLowerCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.15.1.10", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3GroupCurrentThLowerCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.15.1.10", NULL, SU_FLAG_OK, NULL), /* pdu3GroupCurrentThLowerCritical.1.11 = INTEGER: 0 */ - { "unmapped.pdu3GroupCurrentThLowerCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.15.1.11", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3GroupCurrentThLowerCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.15.1.11", NULL, SU_FLAG_OK, NULL), /* pdu3GroupCurrentThLowerCritical.1.12 = INTEGER: 0 */ - { "unmapped.pdu3GroupCurrentThLowerCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.15.1.12", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3GroupCurrentThLowerCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.15.1.12", NULL, SU_FLAG_OK, NULL), /* pdu3GroupCurrentThUpperWarning.1.1 = INTEGER: 1100 */ - { "unmapped.pdu3GroupCurrentThUpperWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.16.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3GroupCurrentThUpperWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.16.1.1", NULL, SU_FLAG_OK, NULL), /* pdu3GroupCurrentThUpperWarning.1.2 = INTEGER: 1100 */ - { "unmapped.pdu3GroupCurrentThUpperWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.16.1.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3GroupCurrentThUpperWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.16.1.2", NULL, SU_FLAG_OK, NULL), /* pdu3GroupCurrentThUpperWarning.1.3 = INTEGER: 0 */ - { "unmapped.pdu3GroupCurrentThUpperWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.16.1.3", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3GroupCurrentThUpperWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.16.1.3", NULL, SU_FLAG_OK, NULL), /* pdu3GroupCurrentThUpperWarning.1.4 = INTEGER: 0 */ - { "unmapped.pdu3GroupCurrentThUpperWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.16.1.4", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3GroupCurrentThUpperWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.16.1.4", NULL, SU_FLAG_OK, NULL), /* pdu3GroupCurrentThUpperWarning.1.5 = INTEGER: 0 */ - { "unmapped.pdu3GroupCurrentThUpperWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.16.1.5", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3GroupCurrentThUpperWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.16.1.5", NULL, SU_FLAG_OK, NULL), /* pdu3GroupCurrentThUpperWarning.1.6 = INTEGER: 0 */ - { "unmapped.pdu3GroupCurrentThUpperWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.16.1.6", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3GroupCurrentThUpperWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.16.1.6", NULL, SU_FLAG_OK, NULL), /* pdu3GroupCurrentThUpperWarning.1.7 = INTEGER: 0 */ - { "unmapped.pdu3GroupCurrentThUpperWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.16.1.7", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3GroupCurrentThUpperWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.16.1.7", NULL, SU_FLAG_OK, NULL), /* pdu3GroupCurrentThUpperWarning.1.8 = INTEGER: 0 */ - { "unmapped.pdu3GroupCurrentThUpperWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.16.1.8", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3GroupCurrentThUpperWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.16.1.8", NULL, SU_FLAG_OK, NULL), /* pdu3GroupCurrentThUpperWarning.1.9 = INTEGER: 0 */ - { "unmapped.pdu3GroupCurrentThUpperWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.16.1.9", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3GroupCurrentThUpperWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.16.1.9", NULL, SU_FLAG_OK, NULL), /* pdu3GroupCurrentThUpperWarning.1.10 = INTEGER: 0 */ - { "unmapped.pdu3GroupCurrentThUpperWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.16.1.10", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3GroupCurrentThUpperWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.16.1.10", NULL, SU_FLAG_OK, NULL), /* pdu3GroupCurrentThUpperWarning.1.11 = INTEGER: 0 */ - { "unmapped.pdu3GroupCurrentThUpperWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.16.1.11", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3GroupCurrentThUpperWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.16.1.11", NULL, SU_FLAG_OK, NULL), /* pdu3GroupCurrentThUpperWarning.1.12 = INTEGER: 0 */ - { "unmapped.pdu3GroupCurrentThUpperWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.16.1.12", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3GroupCurrentThUpperWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.16.1.12", NULL, SU_FLAG_OK, NULL), /* pdu3GroupCurrentThUpperCritical.1.1 = INTEGER: 1400 */ - { "unmapped.pdu3GroupCurrentThUpperCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.17.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3GroupCurrentThUpperCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.17.1.1", NULL, SU_FLAG_OK, NULL), /* pdu3GroupCurrentThUpperCritical.1.2 = INTEGER: 1400 */ - { "unmapped.pdu3GroupCurrentThUpperCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.17.1.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3GroupCurrentThUpperCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.17.1.2", NULL, SU_FLAG_OK, NULL), /* pdu3GroupCurrentThUpperCritical.1.3 = INTEGER: 0 */ - { "unmapped.pdu3GroupCurrentThUpperCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.17.1.3", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3GroupCurrentThUpperCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.17.1.3", NULL, SU_FLAG_OK, NULL), /* pdu3GroupCurrentThUpperCritical.1.4 = INTEGER: 0 */ - { "unmapped.pdu3GroupCurrentThUpperCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.17.1.4", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3GroupCurrentThUpperCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.17.1.4", NULL, SU_FLAG_OK, NULL), /* pdu3GroupCurrentThUpperCritical.1.5 = INTEGER: 0 */ - { "unmapped.pdu3GroupCurrentThUpperCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.17.1.5", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3GroupCurrentThUpperCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.17.1.5", NULL, SU_FLAG_OK, NULL), /* pdu3GroupCurrentThUpperCritical.1.6 = INTEGER: 0 */ - { "unmapped.pdu3GroupCurrentThUpperCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.17.1.6", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3GroupCurrentThUpperCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.17.1.6", NULL, SU_FLAG_OK, NULL), /* pdu3GroupCurrentThUpperCritical.1.7 = INTEGER: 0 */ - { "unmapped.pdu3GroupCurrentThUpperCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.17.1.7", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3GroupCurrentThUpperCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.17.1.7", NULL, SU_FLAG_OK, NULL), /* pdu3GroupCurrentThUpperCritical.1.8 = INTEGER: 0 */ - { "unmapped.pdu3GroupCurrentThUpperCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.17.1.8", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3GroupCurrentThUpperCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.17.1.8", NULL, SU_FLAG_OK, NULL), /* pdu3GroupCurrentThUpperCritical.1.9 = INTEGER: 0 */ - { "unmapped.pdu3GroupCurrentThUpperCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.17.1.9", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3GroupCurrentThUpperCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.17.1.9", NULL, SU_FLAG_OK, NULL), /* pdu3GroupCurrentThUpperCritical.1.10 = INTEGER: 0 */ - { "unmapped.pdu3GroupCurrentThUpperCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.17.1.10", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3GroupCurrentThUpperCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.17.1.10", NULL, SU_FLAG_OK, NULL), /* pdu3GroupCurrentThUpperCritical.1.11 = INTEGER: 0 */ - { "unmapped.pdu3GroupCurrentThUpperCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.17.1.11", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3GroupCurrentThUpperCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.17.1.11", NULL, SU_FLAG_OK, NULL), /* pdu3GroupCurrentThUpperCritical.1.12 = INTEGER: 0 */ - { "unmapped.pdu3GroupCurrentThUpperCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.17.1.12", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3GroupCurrentThUpperCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.17.1.12", NULL, SU_FLAG_OK, NULL), /* pdu3GroupPowerVA.1.1 = INTEGER: 430 */ - { "unmapped.pdu3GroupPowerVA", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.19.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3GroupPowerVA", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.19.1.1", NULL, SU_FLAG_OK, NULL), /* pdu3GroupPowerVA.1.2 = INTEGER: 530 */ - { "unmapped.pdu3GroupPowerVA", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.19.1.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3GroupPowerVA", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.19.1.2", NULL, SU_FLAG_OK, NULL), /* pdu3GroupPowerVA.1.3 = INTEGER: 0 */ - { "unmapped.pdu3GroupPowerVA", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.19.1.3", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3GroupPowerVA", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.19.1.3", NULL, SU_FLAG_OK, NULL), /* pdu3GroupPowerVA.1.4 = INTEGER: 0 */ - { "unmapped.pdu3GroupPowerVA", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.19.1.4", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3GroupPowerVA", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.19.1.4", NULL, SU_FLAG_OK, NULL), /* pdu3GroupPowerVA.1.5 = INTEGER: 0 */ - { "unmapped.pdu3GroupPowerVA", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.19.1.5", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3GroupPowerVA", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.19.1.5", NULL, SU_FLAG_OK, NULL), /* pdu3GroupPowerVA.1.6 = INTEGER: 0 */ - { "unmapped.pdu3GroupPowerVA", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.19.1.6", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3GroupPowerVA", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.19.1.6", NULL, SU_FLAG_OK, NULL), /* pdu3GroupPowerVA.1.7 = INTEGER: 0 */ - { "unmapped.pdu3GroupPowerVA", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.19.1.7", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3GroupPowerVA", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.19.1.7", NULL, SU_FLAG_OK, NULL), /* pdu3GroupPowerVA.1.8 = INTEGER: 0 */ - { "unmapped.pdu3GroupPowerVA", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.19.1.8", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3GroupPowerVA", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.19.1.8", NULL, SU_FLAG_OK, NULL), /* pdu3GroupPowerVA.1.9 = INTEGER: 0 */ - { "unmapped.pdu3GroupPowerVA", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.19.1.9", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3GroupPowerVA", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.19.1.9", NULL, SU_FLAG_OK, NULL), /* pdu3GroupPowerVA.1.10 = INTEGER: 0 */ - { "unmapped.pdu3GroupPowerVA", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.19.1.10", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3GroupPowerVA", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.19.1.10", NULL, SU_FLAG_OK, NULL), /* pdu3GroupPowerVA.1.11 = INTEGER: 0 */ - { "unmapped.pdu3GroupPowerVA", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.19.1.11", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3GroupPowerVA", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.19.1.11", NULL, SU_FLAG_OK, NULL), /* pdu3GroupPowerVA.1.12 = INTEGER: 0 */ - { "unmapped.pdu3GroupPowerVA", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.19.1.12", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3GroupPowerVA", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.19.1.12", NULL, SU_FLAG_OK, NULL), /* pdu3GroupPowerWatts.1.1 = INTEGER: 422 */ - { "unmapped.pdu3GroupPowerWatts", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.20.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3GroupPowerWatts", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.20.1.1", NULL, SU_FLAG_OK, NULL), /* pdu3GroupPowerWatts.1.2 = INTEGER: 512 */ - { "unmapped.pdu3GroupPowerWatts", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.20.1.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3GroupPowerWatts", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.20.1.2", NULL, SU_FLAG_OK, NULL), /* pdu3GroupPowerWatts.1.3 = INTEGER: 0 */ - { "unmapped.pdu3GroupPowerWatts", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.20.1.3", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3GroupPowerWatts", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.20.1.3", NULL, SU_FLAG_OK, NULL), /* pdu3GroupPowerWatts.1.4 = INTEGER: 0 */ - { "unmapped.pdu3GroupPowerWatts", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.20.1.4", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3GroupPowerWatts", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.20.1.4", NULL, SU_FLAG_OK, NULL), /* pdu3GroupPowerWatts.1.5 = INTEGER: 0 */ - { "unmapped.pdu3GroupPowerWatts", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.20.1.5", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3GroupPowerWatts", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.20.1.5", NULL, SU_FLAG_OK, NULL), /* pdu3GroupPowerWatts.1.6 = INTEGER: 0 */ - { "unmapped.pdu3GroupPowerWatts", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.20.1.6", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3GroupPowerWatts", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.20.1.6", NULL, SU_FLAG_OK, NULL), /* pdu3GroupPowerWatts.1.7 = INTEGER: 0 */ - { "unmapped.pdu3GroupPowerWatts", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.20.1.7", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3GroupPowerWatts", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.20.1.7", NULL, SU_FLAG_OK, NULL), /* pdu3GroupPowerWatts.1.8 = INTEGER: 0 */ - { "unmapped.pdu3GroupPowerWatts", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.20.1.8", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3GroupPowerWatts", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.20.1.8", NULL, SU_FLAG_OK, NULL), /* pdu3GroupPowerWatts.1.9 = INTEGER: 0 */ - { "unmapped.pdu3GroupPowerWatts", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.20.1.9", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3GroupPowerWatts", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.20.1.9", NULL, SU_FLAG_OK, NULL), /* pdu3GroupPowerWatts.1.10 = INTEGER: 0 */ - { "unmapped.pdu3GroupPowerWatts", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.20.1.10", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3GroupPowerWatts", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.20.1.10", NULL, SU_FLAG_OK, NULL), /* pdu3GroupPowerWatts.1.11 = INTEGER: 0 */ - { "unmapped.pdu3GroupPowerWatts", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.20.1.11", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3GroupPowerWatts", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.20.1.11", NULL, SU_FLAG_OK, NULL), /* pdu3GroupPowerWatts.1.12 = INTEGER: 0 */ - { "unmapped.pdu3GroupPowerWatts", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.20.1.12", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3GroupPowerWatts", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.20.1.12", NULL, SU_FLAG_OK, NULL), /* pdu3GroupPowerWattHour.1.1 = INTEGER: 0 */ - { "unmapped.pdu3GroupPowerWattHour", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.21.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3GroupPowerWattHour", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.21.1.1", NULL, SU_FLAG_OK, NULL), /* pdu3GroupPowerWattHour.1.2 = INTEGER: 0 */ - { "unmapped.pdu3GroupPowerWattHour", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.21.1.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3GroupPowerWattHour", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.21.1.2", NULL, SU_FLAG_OK, NULL), /* pdu3GroupPowerWattHour.1.3 = INTEGER: 0 */ - { "unmapped.pdu3GroupPowerWattHour", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.21.1.3", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3GroupPowerWattHour", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.21.1.3", NULL, SU_FLAG_OK, NULL), /* pdu3GroupPowerWattHour.1.4 = INTEGER: 0 */ - { "unmapped.pdu3GroupPowerWattHour", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.21.1.4", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3GroupPowerWattHour", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.21.1.4", NULL, SU_FLAG_OK, NULL), /* pdu3GroupPowerWattHour.1.5 = INTEGER: 0 */ - { "unmapped.pdu3GroupPowerWattHour", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.21.1.5", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3GroupPowerWattHour", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.21.1.5", NULL, SU_FLAG_OK, NULL), /* pdu3GroupPowerWattHour.1.6 = INTEGER: 0 */ - { "unmapped.pdu3GroupPowerWattHour", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.21.1.6", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3GroupPowerWattHour", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.21.1.6", NULL, SU_FLAG_OK, NULL), /* pdu3GroupPowerWattHour.1.7 = INTEGER: 0 */ - { "unmapped.pdu3GroupPowerWattHour", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.21.1.7", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3GroupPowerWattHour", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.21.1.7", NULL, SU_FLAG_OK, NULL), /* pdu3GroupPowerWattHour.1.8 = INTEGER: 0 */ - { "unmapped.pdu3GroupPowerWattHour", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.21.1.8", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3GroupPowerWattHour", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.21.1.8", NULL, SU_FLAG_OK, NULL), /* pdu3GroupPowerWattHour.1.9 = INTEGER: 0 */ - { "unmapped.pdu3GroupPowerWattHour", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.21.1.9", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3GroupPowerWattHour", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.21.1.9", NULL, SU_FLAG_OK, NULL), /* pdu3GroupPowerWattHour.1.10 = INTEGER: 0 */ - { "unmapped.pdu3GroupPowerWattHour", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.21.1.10", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3GroupPowerWattHour", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.21.1.10", NULL, SU_FLAG_OK, NULL), /* pdu3GroupPowerWattHour.1.11 = INTEGER: 0 */ - { "unmapped.pdu3GroupPowerWattHour", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.21.1.11", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3GroupPowerWattHour", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.21.1.11", NULL, SU_FLAG_OK, NULL), /* pdu3GroupPowerWattHour.1.12 = INTEGER: 0 */ - { "unmapped.pdu3GroupPowerWattHour", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.21.1.12", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3GroupPowerWattHour", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.21.1.12", NULL, SU_FLAG_OK, NULL), /* pdu3GroupPowerWattHourTimer.1.1 = Hex-STRING: 32 30 31 36 2F 31 30 2F 31 31 20 30 32 3A 34 36 3A 35 30 00 */ - { "unmapped.pdu3GroupPowerWattHourTimer", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.232.165.11.3.1.1.22.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3GroupPowerWattHourTimer", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.232.165.11.3.1.1.22.1.1", NULL, SU_FLAG_OK, NULL), /* pdu3GroupPowerWattHourTimer.1.2 = Hex-STRING: 32 30 31 36 2F 31 30 2F 31 31 20 30 32 3A 34 36 3A 35 30 00 */ - { "unmapped.pdu3GroupPowerWattHourTimer", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.232.165.11.3.1.1.22.1.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3GroupPowerWattHourTimer", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.232.165.11.3.1.1.22.1.2", NULL, SU_FLAG_OK, NULL), /* pdu3GroupPowerWattHourTimer.1.3 = Hex-STRING: 32 30 31 36 2F 31 30 2F 31 31 20 30 32 3A 34 36 3A 35 30 00 */ - { "unmapped.pdu3GroupPowerWattHourTimer", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.232.165.11.3.1.1.22.1.3", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3GroupPowerWattHourTimer", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.232.165.11.3.1.1.22.1.3", NULL, SU_FLAG_OK, NULL), /* pdu3GroupPowerWattHourTimer.1.4 = Hex-STRING: 32 30 31 36 2F 31 30 2F 31 31 20 30 32 3A 34 36 3A 35 30 00 */ - { "unmapped.pdu3GroupPowerWattHourTimer", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.232.165.11.3.1.1.22.1.4", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3GroupPowerWattHourTimer", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.232.165.11.3.1.1.22.1.4", NULL, SU_FLAG_OK, NULL), /* pdu3GroupPowerWattHourTimer.1.5 = Hex-STRING: 32 30 31 36 2F 31 30 2F 31 31 20 30 32 3A 34 36 3A 35 30 00 */ - { "unmapped.pdu3GroupPowerWattHourTimer", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.232.165.11.3.1.1.22.1.5", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3GroupPowerWattHourTimer", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.232.165.11.3.1.1.22.1.5", NULL, SU_FLAG_OK, NULL), /* pdu3GroupPowerWattHourTimer.1.6 = Hex-STRING: 32 30 31 36 2F 31 30 2F 31 31 20 30 32 3A 34 36 3A 35 30 00 */ - { "unmapped.pdu3GroupPowerWattHourTimer", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.232.165.11.3.1.1.22.1.6", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3GroupPowerWattHourTimer", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.232.165.11.3.1.1.22.1.6", NULL, SU_FLAG_OK, NULL), /* pdu3GroupPowerWattHourTimer.1.7 = Hex-STRING: 32 30 31 36 2F 31 30 2F 31 31 20 30 32 3A 34 36 3A 35 30 00 */ - { "unmapped.pdu3GroupPowerWattHourTimer", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.232.165.11.3.1.1.22.1.7", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3GroupPowerWattHourTimer", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.232.165.11.3.1.1.22.1.7", NULL, SU_FLAG_OK, NULL), /* pdu3GroupPowerWattHourTimer.1.8 = Hex-STRING: 32 30 31 36 2F 31 30 2F 31 31 20 30 32 3A 34 36 3A 35 30 00 */ - { "unmapped.pdu3GroupPowerWattHourTimer", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.232.165.11.3.1.1.22.1.8", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3GroupPowerWattHourTimer", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.232.165.11.3.1.1.22.1.8", NULL, SU_FLAG_OK, NULL), /* pdu3GroupPowerWattHourTimer.1.9 = Hex-STRING: 32 30 31 36 2F 31 30 2F 31 31 20 30 32 3A 34 36 3A 35 30 00 */ - { "unmapped.pdu3GroupPowerWattHourTimer", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.232.165.11.3.1.1.22.1.9", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3GroupPowerWattHourTimer", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.232.165.11.3.1.1.22.1.9", NULL, SU_FLAG_OK, NULL), /* pdu3GroupPowerWattHourTimer.1.10 = Hex-STRING: 32 30 31 36 2F 31 30 2F 31 31 20 30 32 3A 34 36 3A 35 30 00 */ - { "unmapped.pdu3GroupPowerWattHourTimer", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.232.165.11.3.1.1.22.1.10", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3GroupPowerWattHourTimer", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.232.165.11.3.1.1.22.1.10", NULL, SU_FLAG_OK, NULL), /* pdu3GroupPowerWattHourTimer.1.11 = Hex-STRING: 32 30 31 36 2F 31 30 2F 31 31 20 30 32 3A 34 36 3A 35 30 00 */ - { "unmapped.pdu3GroupPowerWattHourTimer", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.232.165.11.3.1.1.22.1.11", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3GroupPowerWattHourTimer", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.232.165.11.3.1.1.22.1.11", NULL, SU_FLAG_OK, NULL), /* pdu3GroupPowerWattHourTimer.1.12 = Hex-STRING: 32 30 31 36 2F 31 30 2F 31 31 20 30 32 3A 34 36 3A 35 30 00 */ - { "unmapped.pdu3GroupPowerWattHourTimer", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.232.165.11.3.1.1.22.1.12", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3GroupPowerWattHourTimer", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.232.165.11.3.1.1.22.1.12", NULL, SU_FLAG_OK, NULL), /* pdu3GroupPowerFactor.1.1 = INTEGER: 98 */ - { "unmapped.pdu3GroupPowerFactor", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.23.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3GroupPowerFactor", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.23.1.1", NULL, SU_FLAG_OK, NULL), /* pdu3GroupPowerFactor.1.2 = INTEGER: 97 */ - { "unmapped.pdu3GroupPowerFactor", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.23.1.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3GroupPowerFactor", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.23.1.2", NULL, SU_FLAG_OK, NULL), /* pdu3GroupPowerFactor.1.3 = INTEGER: 0 */ - { "unmapped.pdu3GroupPowerFactor", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.23.1.3", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3GroupPowerFactor", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.23.1.3", NULL, SU_FLAG_OK, NULL), /* pdu3GroupPowerFactor.1.4 = INTEGER: 0 */ - { "unmapped.pdu3GroupPowerFactor", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.23.1.4", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3GroupPowerFactor", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.23.1.4", NULL, SU_FLAG_OK, NULL), /* pdu3GroupPowerFactor.1.5 = INTEGER: 0 */ - { "unmapped.pdu3GroupPowerFactor", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.23.1.5", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3GroupPowerFactor", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.23.1.5", NULL, SU_FLAG_OK, NULL), /* pdu3GroupPowerFactor.1.6 = INTEGER: 0 */ - { "unmapped.pdu3GroupPowerFactor", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.23.1.6", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3GroupPowerFactor", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.23.1.6", NULL, SU_FLAG_OK, NULL), /* pdu3GroupPowerFactor.1.7 = INTEGER: 0 */ - { "unmapped.pdu3GroupPowerFactor", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.23.1.7", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3GroupPowerFactor", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.23.1.7", NULL, SU_FLAG_OK, NULL), /* pdu3GroupPowerFactor.1.8 = INTEGER: 0 */ - { "unmapped.pdu3GroupPowerFactor", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.23.1.8", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3GroupPowerFactor", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.23.1.8", NULL, SU_FLAG_OK, NULL), /* pdu3GroupPowerFactor.1.9 = INTEGER: 0 */ - { "unmapped.pdu3GroupPowerFactor", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.23.1.9", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3GroupPowerFactor", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.23.1.9", NULL, SU_FLAG_OK, NULL), /* pdu3GroupPowerFactor.1.10 = INTEGER: 0 */ - { "unmapped.pdu3GroupPowerFactor", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.23.1.10", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3GroupPowerFactor", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.23.1.10", NULL, SU_FLAG_OK, NULL), /* pdu3GroupPowerFactor.1.11 = INTEGER: 0 */ - { "unmapped.pdu3GroupPowerFactor", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.23.1.11", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3GroupPowerFactor", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.23.1.11", NULL, SU_FLAG_OK, NULL), /* pdu3GroupPowerFactor.1.12 = INTEGER: 0 */ - { "unmapped.pdu3GroupPowerFactor", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.23.1.12", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3GroupPowerFactor", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.23.1.12", NULL, SU_FLAG_OK, NULL), /* pdu3GroupPowerVAR.1.1 = INTEGER: 43 */ - { "unmapped.pdu3GroupPowerVAR", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.24.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3GroupPowerVAR", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.24.1.1", NULL, SU_FLAG_OK, NULL), /* pdu3GroupPowerVAR.1.2 = INTEGER: 36 */ - { "unmapped.pdu3GroupPowerVAR", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.24.1.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3GroupPowerVAR", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.24.1.2", NULL, SU_FLAG_OK, NULL), /* pdu3GroupPowerVAR.1.3 = INTEGER: 0 */ - { "unmapped.pdu3GroupPowerVAR", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.24.1.3", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3GroupPowerVAR", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.24.1.3", NULL, SU_FLAG_OK, NULL), /* pdu3GroupPowerVAR.1.4 = INTEGER: 0 */ - { "unmapped.pdu3GroupPowerVAR", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.24.1.4", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3GroupPowerVAR", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.24.1.4", NULL, SU_FLAG_OK, NULL), /* pdu3GroupPowerVAR.1.5 = INTEGER: 0 */ - { "unmapped.pdu3GroupPowerVAR", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.24.1.5", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3GroupPowerVAR", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.24.1.5", NULL, SU_FLAG_OK, NULL), /* pdu3GroupPowerVAR.1.6 = INTEGER: 0 */ - { "unmapped.pdu3GroupPowerVAR", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.24.1.6", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3GroupPowerVAR", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.24.1.6", NULL, SU_FLAG_OK, NULL), /* pdu3GroupPowerVAR.1.7 = INTEGER: 0 */ - { "unmapped.pdu3GroupPowerVAR", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.24.1.7", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3GroupPowerVAR", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.24.1.7", NULL, SU_FLAG_OK, NULL), /* pdu3GroupPowerVAR.1.8 = INTEGER: 0 */ - { "unmapped.pdu3GroupPowerVAR", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.24.1.8", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3GroupPowerVAR", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.24.1.8", NULL, SU_FLAG_OK, NULL), /* pdu3GroupPowerVAR.1.9 = INTEGER: 0 */ - { "unmapped.pdu3GroupPowerVAR", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.24.1.9", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3GroupPowerVAR", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.24.1.9", NULL, SU_FLAG_OK, NULL), /* pdu3GroupPowerVAR.1.10 = INTEGER: 0 */ - { "unmapped.pdu3GroupPowerVAR", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.24.1.10", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3GroupPowerVAR", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.24.1.10", NULL, SU_FLAG_OK, NULL), /* pdu3GroupPowerVAR.1.11 = INTEGER: 0 */ - { "unmapped.pdu3GroupPowerVAR", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.24.1.11", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3GroupPowerVAR", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.24.1.11", NULL, SU_FLAG_OK, NULL), /* pdu3GroupPowerVAR.1.12 = INTEGER: 0 */ - { "unmapped.pdu3GroupPowerVAR", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.24.1.12", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3GroupPowerVAR", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.24.1.12", NULL, SU_FLAG_OK, NULL), /* pdu3GroupBreakerStatus.1.1 = INTEGER: 2 */ - { "unmapped.pdu3GroupBreakerStatus", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.26.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3GroupBreakerStatus", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.26.1.1", NULL, SU_FLAG_OK, NULL), /* pdu3GroupBreakerStatus.1.2 = INTEGER: 2 */ - { "unmapped.pdu3GroupBreakerStatus", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.26.1.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3GroupBreakerStatus", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.26.1.2", NULL, SU_FLAG_OK, NULL), /* pdu3GroupBreakerStatus.1.3 = INTEGER: 0 */ - { "unmapped.pdu3GroupBreakerStatus", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.26.1.3", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3GroupBreakerStatus", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.26.1.3", NULL, SU_FLAG_OK, NULL), /* pdu3GroupBreakerStatus.1.4 = INTEGER: 0 */ - { "unmapped.pdu3GroupBreakerStatus", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.26.1.4", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3GroupBreakerStatus", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.26.1.4", NULL, SU_FLAG_OK, NULL), /* pdu3GroupBreakerStatus.1.5 = INTEGER: 0 */ - { "unmapped.pdu3GroupBreakerStatus", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.26.1.5", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3GroupBreakerStatus", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.26.1.5", NULL, SU_FLAG_OK, NULL), /* pdu3GroupBreakerStatus.1.6 = INTEGER: 0 */ - { "unmapped.pdu3GroupBreakerStatus", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.26.1.6", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3GroupBreakerStatus", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.26.1.6", NULL, SU_FLAG_OK, NULL), /* pdu3GroupBreakerStatus.1.7 = INTEGER: 0 */ - { "unmapped.pdu3GroupBreakerStatus", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.26.1.7", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3GroupBreakerStatus", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.26.1.7", NULL, SU_FLAG_OK, NULL), /* pdu3GroupBreakerStatus.1.8 = INTEGER: 0 */ - { "unmapped.pdu3GroupBreakerStatus", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.26.1.8", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3GroupBreakerStatus", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.26.1.8", NULL, SU_FLAG_OK, NULL), /* pdu3GroupBreakerStatus.1.9 = INTEGER: 0 */ - { "unmapped.pdu3GroupBreakerStatus", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.26.1.9", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3GroupBreakerStatus", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.26.1.9", NULL, SU_FLAG_OK, NULL), /* pdu3GroupBreakerStatus.1.10 = INTEGER: 0 */ - { "unmapped.pdu3GroupBreakerStatus", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.26.1.10", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3GroupBreakerStatus", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.26.1.10", NULL, SU_FLAG_OK, NULL), /* pdu3GroupBreakerStatus.1.11 = INTEGER: 0 */ - { "unmapped.pdu3GroupBreakerStatus", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.26.1.11", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3GroupBreakerStatus", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.26.1.11", NULL, SU_FLAG_OK, NULL), /* pdu3GroupBreakerStatus.1.12 = INTEGER: 0 */ - { "unmapped.pdu3GroupBreakerStatus", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.26.1.12", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3GroupBreakerStatus", 0, 1, ".1.3.6.1.4.1.232.165.11.3.1.1.26.1.12", NULL, SU_FLAG_OK, NULL), /* pdu3TemperatureScale.1 = INTEGER: 1 */ - { "unmapped.pdu3TemperatureScale", 0, 1, ".1.3.6.1.4.1.232.165.11.4.1.1.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3TemperatureScale", 0, 1, ".1.3.6.1.4.1.232.165.11.4.1.1.1.1", NULL, SU_FLAG_OK, NULL), /* pdu3TemperatureCount.1 = INTEGER: 1 */ - { "unmapped.pdu3TemperatureCount", 0, 1, ".1.3.6.1.4.1.232.165.11.4.1.1.2.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3TemperatureCount", 0, 1, ".1.3.6.1.4.1.232.165.11.4.1.1.2.1", NULL, SU_FLAG_OK, NULL), /* pdu3HumidityCount.1 = INTEGER: 1 */ - { "unmapped.pdu3HumidityCount", 0, 1, ".1.3.6.1.4.1.232.165.11.4.1.1.3.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3HumidityCount", 0, 1, ".1.3.6.1.4.1.232.165.11.4.1.1.3.1", NULL, SU_FLAG_OK, NULL), /* pdu3ContactCount.1 = INTEGER: 0 */ - { "unmapped.pdu3ContactCount", 0, 1, ".1.3.6.1.4.1.232.165.11.4.1.1.4.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3ContactCount", 0, 1, ".1.3.6.1.4.1.232.165.11.4.1.1.4.1", NULL, SU_FLAG_OK, NULL), /* pdu3TemperatureIndex.1.1 = INTEGER: 1 */ - { "unmapped.pdu3TemperatureIndex", 0, 1, ".1.3.6.1.4.1.232.165.11.4.2.1.1.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3TemperatureIndex", 0, 1, ".1.3.6.1.4.1.232.165.11.4.2.1.1.1.1", NULL, SU_FLAG_OK, NULL), /* pdu3TemperatureIndex.1.2 = INTEGER: 0 */ - { "unmapped.pdu3TemperatureIndex", 0, 1, ".1.3.6.1.4.1.232.165.11.4.2.1.1.1.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3TemperatureIndex", 0, 1, ".1.3.6.1.4.1.232.165.11.4.2.1.1.1.2", NULL, SU_FLAG_OK, NULL), /* = INTEGER: 0 */ - { "unmapped. = INTEGER: 0", 0, 1, ".1.3.6.1.4.1.232.165.11.4.2.1.1.1.3", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped. = INTEGER: 0", 0, 1, ".1.3.6.1.4.1.232.165.11.4.2.1.1.1.3", NULL, SU_FLAG_OK, NULL), /* = INTEGER: 0 */ - { "unmapped. = INTEGER: 0", 0, 1, ".1.3.6.1.4.1.232.165.11.4.2.1.1.1.4", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped. = INTEGER: 0", 0, 1, ".1.3.6.1.4.1.232.165.11.4.2.1.1.1.4", NULL, SU_FLAG_OK, NULL), /* = INTEGER: 0 */ - { "unmapped. = INTEGER: 0", 0, 1, ".1.3.6.1.4.1.232.165.11.4.2.1.1.1.5", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped. = INTEGER: 0", 0, 1, ".1.3.6.1.4.1.232.165.11.4.2.1.1.1.5", NULL, SU_FLAG_OK, NULL), /* = INTEGER: 0 */ - { "unmapped. = INTEGER: 0", 0, 1, ".1.3.6.1.4.1.232.165.11.4.2.1.1.1.6", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped. = INTEGER: 0", 0, 1, ".1.3.6.1.4.1.232.165.11.4.2.1.1.1.6", NULL, SU_FLAG_OK, NULL), /* pdu3TemperatureName.1.1 = STRING: "T" */ - { "unmapped.pdu3TemperatureName", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.232.165.11.4.2.1.2.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3TemperatureName", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.232.165.11.4.2.1.2.1.1", NULL, SU_FLAG_OK, NULL), /* pdu3TemperatureName.1.2 = STRING: " " */ - { "unmapped.pdu3TemperatureName", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.232.165.11.4.2.1.2.1.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3TemperatureName", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.232.165.11.4.2.1.2.1.2", NULL, SU_FLAG_OK, NULL), /* = STRING: " " */ - { "unmapped. = STRING: " "", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.232.165.11.4.2.1.2.1.3", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped. = STRING: " "", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.232.165.11.4.2.1.2.1.3", NULL, SU_FLAG_OK, NULL), /* = STRING: " " */ - { "unmapped. = STRING: " "", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.232.165.11.4.2.1.2.1.4", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped. = STRING: " "", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.232.165.11.4.2.1.2.1.4", NULL, SU_FLAG_OK, NULL), /* = STRING: " " */ - { "unmapped. = STRING: " "", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.232.165.11.4.2.1.2.1.5", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped. = STRING: " "", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.232.165.11.4.2.1.2.1.5", NULL, SU_FLAG_OK, NULL), /* = STRING: " " */ - { "unmapped. = STRING: " "", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.232.165.11.4.2.1.2.1.6", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped. = STRING: " "", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.232.165.11.4.2.1.2.1.6", NULL, SU_FLAG_OK, NULL), /* pdu3TemperatureProbeStatus.1.1 = INTEGER: 2 */ - { "unmapped.pdu3TemperatureProbeStatus", 0, 1, ".1.3.6.1.4.1.232.165.11.4.2.1.3.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3TemperatureProbeStatus", 0, 1, ".1.3.6.1.4.1.232.165.11.4.2.1.3.1.1", NULL, SU_FLAG_OK, NULL), /* pdu3TemperatureProbeStatus.1.2 = INTEGER: 1 */ - { "unmapped.pdu3TemperatureProbeStatus", 0, 1, ".1.3.6.1.4.1.232.165.11.4.2.1.3.1.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3TemperatureProbeStatus", 0, 1, ".1.3.6.1.4.1.232.165.11.4.2.1.3.1.2", NULL, SU_FLAG_OK, NULL), /* = INTEGER: 1 */ - { "unmapped. = INTEGER: 1", 0, 1, ".1.3.6.1.4.1.232.165.11.4.2.1.3.1.3", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped. = INTEGER: 1", 0, 1, ".1.3.6.1.4.1.232.165.11.4.2.1.3.1.3", NULL, SU_FLAG_OK, NULL), /* = INTEGER: 1 */ - { "unmapped. = INTEGER: 1", 0, 1, ".1.3.6.1.4.1.232.165.11.4.2.1.3.1.4", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped. = INTEGER: 1", 0, 1, ".1.3.6.1.4.1.232.165.11.4.2.1.3.1.4", NULL, SU_FLAG_OK, NULL), /* = INTEGER: 1 */ - { "unmapped. = INTEGER: 1", 0, 1, ".1.3.6.1.4.1.232.165.11.4.2.1.3.1.5", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped. = INTEGER: 1", 0, 1, ".1.3.6.1.4.1.232.165.11.4.2.1.3.1.5", NULL, SU_FLAG_OK, NULL), /* = INTEGER: 1 */ - { "unmapped. = INTEGER: 1", 0, 1, ".1.3.6.1.4.1.232.165.11.4.2.1.3.1.6", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped. = INTEGER: 1", 0, 1, ".1.3.6.1.4.1.232.165.11.4.2.1.3.1.6", NULL, SU_FLAG_OK, NULL), /* pdu3TemperatureValue.1.1 = INTEGER: 27 */ - { "unmapped.pdu3TemperatureValue", 0, 1, ".1.3.6.1.4.1.232.165.11.4.2.1.4.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3TemperatureValue", 0, 1, ".1.3.6.1.4.1.232.165.11.4.2.1.4.1.1", NULL, SU_FLAG_OK, NULL), /* pdu3TemperatureValue.1.2 = INTEGER: 0 */ - { "unmapped.pdu3TemperatureValue", 0, 1, ".1.3.6.1.4.1.232.165.11.4.2.1.4.1.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3TemperatureValue", 0, 1, ".1.3.6.1.4.1.232.165.11.4.2.1.4.1.2", NULL, SU_FLAG_OK, NULL), /* = INTEGER: 0 */ - { "unmapped. = INTEGER: 0", 0, 1, ".1.3.6.1.4.1.232.165.11.4.2.1.4.1.3", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped. = INTEGER: 0", 0, 1, ".1.3.6.1.4.1.232.165.11.4.2.1.4.1.3", NULL, SU_FLAG_OK, NULL), /* = INTEGER: 0 */ - { "unmapped. = INTEGER: 0", 0, 1, ".1.3.6.1.4.1.232.165.11.4.2.1.4.1.4", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped. = INTEGER: 0", 0, 1, ".1.3.6.1.4.1.232.165.11.4.2.1.4.1.4", NULL, SU_FLAG_OK, NULL), /* = INTEGER: 0 */ - { "unmapped. = INTEGER: 0", 0, 1, ".1.3.6.1.4.1.232.165.11.4.2.1.4.1.5", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped. = INTEGER: 0", 0, 1, ".1.3.6.1.4.1.232.165.11.4.2.1.4.1.5", NULL, SU_FLAG_OK, NULL), /* = INTEGER: 0 */ - { "unmapped. = INTEGER: 0", 0, 1, ".1.3.6.1.4.1.232.165.11.4.2.1.4.1.6", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped. = INTEGER: 0", 0, 1, ".1.3.6.1.4.1.232.165.11.4.2.1.4.1.6", NULL, SU_FLAG_OK, NULL), /* pdu3TemperatureThStatus.1.1 = INTEGER: 1 */ - { "unmapped.pdu3TemperatureThStatus", 0, 1, ".1.3.6.1.4.1.232.165.11.4.2.1.5.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3TemperatureThStatus", 0, 1, ".1.3.6.1.4.1.232.165.11.4.2.1.5.1.1", NULL, SU_FLAG_OK, NULL), /* pdu3TemperatureThStatus.1.2 = INTEGER: 0 */ - { "unmapped.pdu3TemperatureThStatus", 0, 1, ".1.3.6.1.4.1.232.165.11.4.2.1.5.1.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3TemperatureThStatus", 0, 1, ".1.3.6.1.4.1.232.165.11.4.2.1.5.1.2", NULL, SU_FLAG_OK, NULL), /* = INTEGER: 0 */ - { "unmapped. = INTEGER: 0", 0, 1, ".1.3.6.1.4.1.232.165.11.4.2.1.5.1.3", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped. = INTEGER: 0", 0, 1, ".1.3.6.1.4.1.232.165.11.4.2.1.5.1.3", NULL, SU_FLAG_OK, NULL), /* = INTEGER: 0 */ - { "unmapped. = INTEGER: 0", 0, 1, ".1.3.6.1.4.1.232.165.11.4.2.1.5.1.4", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped. = INTEGER: 0", 0, 1, ".1.3.6.1.4.1.232.165.11.4.2.1.5.1.4", NULL, SU_FLAG_OK, NULL), /* = INTEGER: 0 */ - { "unmapped. = INTEGER: 0", 0, 1, ".1.3.6.1.4.1.232.165.11.4.2.1.5.1.5", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped. = INTEGER: 0", 0, 1, ".1.3.6.1.4.1.232.165.11.4.2.1.5.1.5", NULL, SU_FLAG_OK, NULL), /* = INTEGER: 0 */ - { "unmapped. = INTEGER: 0", 0, 1, ".1.3.6.1.4.1.232.165.11.4.2.1.5.1.6", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped. = INTEGER: 0", 0, 1, ".1.3.6.1.4.1.232.165.11.4.2.1.5.1.6", NULL, SU_FLAG_OK, NULL), /* pdu3TemperatureThLowerWarning.1.1 = INTEGER: 15 */ - { "unmapped.pdu3TemperatureThLowerWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.4.2.1.6.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3TemperatureThLowerWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.4.2.1.6.1.1", NULL, SU_FLAG_OK, NULL), /* pdu3TemperatureThLowerWarning.1.2 = INTEGER: 0 */ - { "unmapped.pdu3TemperatureThLowerWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.4.2.1.6.1.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3TemperatureThLowerWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.4.2.1.6.1.2", NULL, SU_FLAG_OK, NULL), /* = INTEGER: 0 */ - { "unmapped. = INTEGER: 0", 0, 1, ".1.3.6.1.4.1.232.165.11.4.2.1.6.1.3", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped. = INTEGER: 0", 0, 1, ".1.3.6.1.4.1.232.165.11.4.2.1.6.1.3", NULL, SU_FLAG_OK, NULL), /* = INTEGER: 0 */ - { "unmapped. = INTEGER: 0", 0, 1, ".1.3.6.1.4.1.232.165.11.4.2.1.6.1.4", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped. = INTEGER: 0", 0, 1, ".1.3.6.1.4.1.232.165.11.4.2.1.6.1.4", NULL, SU_FLAG_OK, NULL), /* = INTEGER: 0 */ - { "unmapped. = INTEGER: 0", 0, 1, ".1.3.6.1.4.1.232.165.11.4.2.1.6.1.5", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped. = INTEGER: 0", 0, 1, ".1.3.6.1.4.1.232.165.11.4.2.1.6.1.5", NULL, SU_FLAG_OK, NULL), /* = INTEGER: 0 */ - { "unmapped. = INTEGER: 0", 0, 1, ".1.3.6.1.4.1.232.165.11.4.2.1.6.1.6", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped. = INTEGER: 0", 0, 1, ".1.3.6.1.4.1.232.165.11.4.2.1.6.1.6", NULL, SU_FLAG_OK, NULL), /* pdu3TemperatureThLowerCritical.1.1 = INTEGER: 10 */ - { "unmapped.pdu3TemperatureThLowerCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.4.2.1.7.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3TemperatureThLowerCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.4.2.1.7.1.1", NULL, SU_FLAG_OK, NULL), /* pdu3TemperatureThLowerCritical.1.2 = INTEGER: 0 */ - { "unmapped.pdu3TemperatureThLowerCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.4.2.1.7.1.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3TemperatureThLowerCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.4.2.1.7.1.2", NULL, SU_FLAG_OK, NULL), /* = INTEGER: 0 */ - { "unmapped. = INTEGER: 0", 0, 1, ".1.3.6.1.4.1.232.165.11.4.2.1.7.1.3", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped. = INTEGER: 0", 0, 1, ".1.3.6.1.4.1.232.165.11.4.2.1.7.1.3", NULL, SU_FLAG_OK, NULL), /* = INTEGER: 0 */ - { "unmapped. = INTEGER: 0", 0, 1, ".1.3.6.1.4.1.232.165.11.4.2.1.7.1.4", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped. = INTEGER: 0", 0, 1, ".1.3.6.1.4.1.232.165.11.4.2.1.7.1.4", NULL, SU_FLAG_OK, NULL), /* = INTEGER: 0 */ - { "unmapped. = INTEGER: 0", 0, 1, ".1.3.6.1.4.1.232.165.11.4.2.1.7.1.5", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped. = INTEGER: 0", 0, 1, ".1.3.6.1.4.1.232.165.11.4.2.1.7.1.5", NULL, SU_FLAG_OK, NULL), /* = INTEGER: 0 */ - { "unmapped. = INTEGER: 0", 0, 1, ".1.3.6.1.4.1.232.165.11.4.2.1.7.1.6", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped. = INTEGER: 0", 0, 1, ".1.3.6.1.4.1.232.165.11.4.2.1.7.1.6", NULL, SU_FLAG_OK, NULL), /* pdu3TemperatureThUpperWarning.1.1 = INTEGER: 30 */ - { "unmapped.pdu3TemperatureThUpperWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.4.2.1.8.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3TemperatureThUpperWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.4.2.1.8.1.1", NULL, SU_FLAG_OK, NULL), /* pdu3TemperatureThUpperWarning.1.2 = INTEGER: 0 */ - { "unmapped.pdu3TemperatureThUpperWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.4.2.1.8.1.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3TemperatureThUpperWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.4.2.1.8.1.2", NULL, SU_FLAG_OK, NULL), /* = INTEGER: 0 */ - { "unmapped. = INTEGER: 0", 0, 1, ".1.3.6.1.4.1.232.165.11.4.2.1.8.1.3", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped. = INTEGER: 0", 0, 1, ".1.3.6.1.4.1.232.165.11.4.2.1.8.1.3", NULL, SU_FLAG_OK, NULL), /* = INTEGER: 0 */ - { "unmapped. = INTEGER: 0", 0, 1, ".1.3.6.1.4.1.232.165.11.4.2.1.8.1.4", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped. = INTEGER: 0", 0, 1, ".1.3.6.1.4.1.232.165.11.4.2.1.8.1.4", NULL, SU_FLAG_OK, NULL), /* = INTEGER: 0 */ - { "unmapped. = INTEGER: 0", 0, 1, ".1.3.6.1.4.1.232.165.11.4.2.1.8.1.5", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped. = INTEGER: 0", 0, 1, ".1.3.6.1.4.1.232.165.11.4.2.1.8.1.5", NULL, SU_FLAG_OK, NULL), /* = INTEGER: 0 */ - { "unmapped. = INTEGER: 0", 0, 1, ".1.3.6.1.4.1.232.165.11.4.2.1.8.1.6", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped. = INTEGER: 0", 0, 1, ".1.3.6.1.4.1.232.165.11.4.2.1.8.1.6", NULL, SU_FLAG_OK, NULL), /* pdu3TemperatureThUpperCritical.1.1 = INTEGER: 35 */ - { "unmapped.pdu3TemperatureThUpperCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.4.2.1.9.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3TemperatureThUpperCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.4.2.1.9.1.1", NULL, SU_FLAG_OK, NULL), /* pdu3TemperatureThUpperCritical.1.2 = INTEGER: 0 */ - { "unmapped.pdu3TemperatureThUpperCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.4.2.1.9.1.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3TemperatureThUpperCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.4.2.1.9.1.2", NULL, SU_FLAG_OK, NULL), /* = INTEGER: 0 */ - { "unmapped. = INTEGER: 0", 0, 1, ".1.3.6.1.4.1.232.165.11.4.2.1.9.1.3", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped. = INTEGER: 0", 0, 1, ".1.3.6.1.4.1.232.165.11.4.2.1.9.1.3", NULL, SU_FLAG_OK, NULL), /* = INTEGER: 0 */ - { "unmapped. = INTEGER: 0", 0, 1, ".1.3.6.1.4.1.232.165.11.4.2.1.9.1.4", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped. = INTEGER: 0", 0, 1, ".1.3.6.1.4.1.232.165.11.4.2.1.9.1.4", NULL, SU_FLAG_OK, NULL), /* = INTEGER: 0 */ - { "unmapped. = INTEGER: 0", 0, 1, ".1.3.6.1.4.1.232.165.11.4.2.1.9.1.5", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped. = INTEGER: 0", 0, 1, ".1.3.6.1.4.1.232.165.11.4.2.1.9.1.5", NULL, SU_FLAG_OK, NULL), /* = INTEGER: 0 */ - { "unmapped. = INTEGER: 0", 0, 1, ".1.3.6.1.4.1.232.165.11.4.2.1.9.1.6", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped. = INTEGER: 0", 0, 1, ".1.3.6.1.4.1.232.165.11.4.2.1.9.1.6", NULL, SU_FLAG_OK, NULL), /* pdu3HumidityIndex.1.1 = INTEGER: 2 */ - { "unmapped.pdu3HumidityIndex", 0, 1, ".1.3.6.1.4.1.232.165.11.4.3.1.1.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3HumidityIndex", 0, 1, ".1.3.6.1.4.1.232.165.11.4.3.1.1.1.1", NULL, SU_FLAG_OK, NULL), /* pdu3HumidityIndex.1.2 = INTEGER: 0 */ - { "unmapped.pdu3HumidityIndex", 0, 1, ".1.3.6.1.4.1.232.165.11.4.3.1.1.1.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3HumidityIndex", 0, 1, ".1.3.6.1.4.1.232.165.11.4.3.1.1.1.2", NULL, SU_FLAG_OK, NULL), /* = INTEGER: 0 */ - { "unmapped. = INTEGER: 0", 0, 1, ".1.3.6.1.4.1.232.165.11.4.3.1.1.1.3", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped. = INTEGER: 0", 0, 1, ".1.3.6.1.4.1.232.165.11.4.3.1.1.1.3", NULL, SU_FLAG_OK, NULL), /* = INTEGER: 0 */ - { "unmapped. = INTEGER: 0", 0, 1, ".1.3.6.1.4.1.232.165.11.4.3.1.1.1.4", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped. = INTEGER: 0", 0, 1, ".1.3.6.1.4.1.232.165.11.4.3.1.1.1.4", NULL, SU_FLAG_OK, NULL), /* = INTEGER: 0 */ - { "unmapped. = INTEGER: 0", 0, 1, ".1.3.6.1.4.1.232.165.11.4.3.1.1.1.5", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped. = INTEGER: 0", 0, 1, ".1.3.6.1.4.1.232.165.11.4.3.1.1.1.5", NULL, SU_FLAG_OK, NULL), /* = INTEGER: 0 */ - { "unmapped. = INTEGER: 0", 0, 1, ".1.3.6.1.4.1.232.165.11.4.3.1.1.1.6", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped. = INTEGER: 0", 0, 1, ".1.3.6.1.4.1.232.165.11.4.3.1.1.1.6", NULL, SU_FLAG_OK, NULL), /* pdu3HumidityName.1.1 = STRING: "RH" */ - { "unmapped.pdu3HumidityName", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.232.165.11.4.3.1.2.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3HumidityName", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.232.165.11.4.3.1.2.1.1", NULL, SU_FLAG_OK, NULL), /* pdu3HumidityName.1.2 = STRING: " " */ - { "unmapped.pdu3HumidityName", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.232.165.11.4.3.1.2.1.2", NULL, SU_FLAG_OK, NULL }, -//FIXME: missing sub MIB for ambient sensor? + snmp_info_default("unmapped.pdu3HumidityName", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.232.165.11.4.3.1.2.1.2", NULL, SU_FLAG_OK, NULL), +/* FIXME: missing sub MIB for ambient sensor? */ /* = STRING: " " */ - { "unmapped. = STRING: " "", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.232.165.11.4.3.1.2.1.3", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped. = STRING: " "", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.232.165.11.4.3.1.2.1.3", NULL, SU_FLAG_OK, NULL), /* = STRING: " " */ - { "unmapped. = STRING: " "", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.232.165.11.4.3.1.2.1.4", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped. = STRING: " "", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.232.165.11.4.3.1.2.1.4", NULL, SU_FLAG_OK, NULL), /* = STRING: " " */ - { "unmapped. = STRING: " "", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.232.165.11.4.3.1.2.1.5", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped. = STRING: " "", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.232.165.11.4.3.1.2.1.5", NULL, SU_FLAG_OK, NULL), /* = STRING: " " */ - { "unmapped. = STRING: " "", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.232.165.11.4.3.1.2.1.6", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped. = STRING: " "", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.232.165.11.4.3.1.2.1.6", NULL, SU_FLAG_OK, NULL), /* pdu3HumidityProbeStatus.1.1 = INTEGER: 2 */ - { "unmapped.pdu3HumidityProbeStatus", 0, 1, ".1.3.6.1.4.1.232.165.11.4.3.1.3.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3HumidityProbeStatus", 0, 1, ".1.3.6.1.4.1.232.165.11.4.3.1.3.1.1", NULL, SU_FLAG_OK, NULL), /* pdu3HumidityProbeStatus.1.2 = INTEGER: 1 */ - { "unmapped.pdu3HumidityProbeStatus", 0, 1, ".1.3.6.1.4.1.232.165.11.4.3.1.3.1.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3HumidityProbeStatus", 0, 1, ".1.3.6.1.4.1.232.165.11.4.3.1.3.1.2", NULL, SU_FLAG_OK, NULL), /* = INTEGER: 1 */ - { "unmapped. = INTEGER: 1", 0, 1, ".1.3.6.1.4.1.232.165.11.4.3.1.3.1.3", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped. = INTEGER: 1", 0, 1, ".1.3.6.1.4.1.232.165.11.4.3.1.3.1.3", NULL, SU_FLAG_OK, NULL), /* = INTEGER: 1 */ - { "unmapped. = INTEGER: 1", 0, 1, ".1.3.6.1.4.1.232.165.11.4.3.1.3.1.4", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped. = INTEGER: 1", 0, 1, ".1.3.6.1.4.1.232.165.11.4.3.1.3.1.4", NULL, SU_FLAG_OK, NULL), /* = INTEGER: 1 */ - { "unmapped. = INTEGER: 1", 0, 1, ".1.3.6.1.4.1.232.165.11.4.3.1.3.1.5", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped. = INTEGER: 1", 0, 1, ".1.3.6.1.4.1.232.165.11.4.3.1.3.1.5", NULL, SU_FLAG_OK, NULL), /* = INTEGER: 1 */ - { "unmapped. = INTEGER: 1", 0, 1, ".1.3.6.1.4.1.232.165.11.4.3.1.3.1.6", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped. = INTEGER: 1", 0, 1, ".1.3.6.1.4.1.232.165.11.4.3.1.3.1.6", NULL, SU_FLAG_OK, NULL), /* pdu3HumidityValue.1.1 = INTEGER: 27 */ - { "unmapped.pdu3HumidityValue", 0, 1, ".1.3.6.1.4.1.232.165.11.4.3.1.4.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3HumidityValue", 0, 1, ".1.3.6.1.4.1.232.165.11.4.3.1.4.1.1", NULL, SU_FLAG_OK, NULL), /* pdu3HumidityValue.1.2 = INTEGER: 0 */ - { "unmapped.pdu3HumidityValue", 0, 1, ".1.3.6.1.4.1.232.165.11.4.3.1.4.1.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3HumidityValue", 0, 1, ".1.3.6.1.4.1.232.165.11.4.3.1.4.1.2", NULL, SU_FLAG_OK, NULL), /* = INTEGER: 0 */ - { "unmapped. = INTEGER: 0", 0, 1, ".1.3.6.1.4.1.232.165.11.4.3.1.4.1.3", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped. = INTEGER: 0", 0, 1, ".1.3.6.1.4.1.232.165.11.4.3.1.4.1.3", NULL, SU_FLAG_OK, NULL), /* = INTEGER: 0 */ - { "unmapped. = INTEGER: 0", 0, 1, ".1.3.6.1.4.1.232.165.11.4.3.1.4.1.4", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped. = INTEGER: 0", 0, 1, ".1.3.6.1.4.1.232.165.11.4.3.1.4.1.4", NULL, SU_FLAG_OK, NULL), /* = INTEGER: 0 */ - { "unmapped. = INTEGER: 0", 0, 1, ".1.3.6.1.4.1.232.165.11.4.3.1.4.1.5", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped. = INTEGER: 0", 0, 1, ".1.3.6.1.4.1.232.165.11.4.3.1.4.1.5", NULL, SU_FLAG_OK, NULL), /* = INTEGER: 0 */ - { "unmapped. = INTEGER: 0", 0, 1, ".1.3.6.1.4.1.232.165.11.4.3.1.4.1.6", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped. = INTEGER: 0", 0, 1, ".1.3.6.1.4.1.232.165.11.4.3.1.4.1.6", NULL, SU_FLAG_OK, NULL), /* pdu3HumidityThStatus.1.1 = INTEGER: 2 */ - { "unmapped.pdu3HumidityThStatus", 0, 1, ".1.3.6.1.4.1.232.165.11.4.3.1.5.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3HumidityThStatus", 0, 1, ".1.3.6.1.4.1.232.165.11.4.3.1.5.1.1", NULL, SU_FLAG_OK, NULL), /* pdu3HumidityThStatus.1.2 = INTEGER: 0 */ - { "unmapped.pdu3HumidityThStatus", 0, 1, ".1.3.6.1.4.1.232.165.11.4.3.1.5.1.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3HumidityThStatus", 0, 1, ".1.3.6.1.4.1.232.165.11.4.3.1.5.1.2", NULL, SU_FLAG_OK, NULL), /* = INTEGER: 0 */ - { "unmapped. = INTEGER: 0", 0, 1, ".1.3.6.1.4.1.232.165.11.4.3.1.5.1.3", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped. = INTEGER: 0", 0, 1, ".1.3.6.1.4.1.232.165.11.4.3.1.5.1.3", NULL, SU_FLAG_OK, NULL), /* = INTEGER: 0 */ - { "unmapped. = INTEGER: 0", 0, 1, ".1.3.6.1.4.1.232.165.11.4.3.1.5.1.4", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped. = INTEGER: 0", 0, 1, ".1.3.6.1.4.1.232.165.11.4.3.1.5.1.4", NULL, SU_FLAG_OK, NULL), /* = INTEGER: 0 */ - { "unmapped. = INTEGER: 0", 0, 1, ".1.3.6.1.4.1.232.165.11.4.3.1.5.1.5", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped. = INTEGER: 0", 0, 1, ".1.3.6.1.4.1.232.165.11.4.3.1.5.1.5", NULL, SU_FLAG_OK, NULL), /* = INTEGER: 0 */ - { "unmapped. = INTEGER: 0", 0, 1, ".1.3.6.1.4.1.232.165.11.4.3.1.5.1.6", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped. = INTEGER: 0", 0, 1, ".1.3.6.1.4.1.232.165.11.4.3.1.5.1.6", NULL, SU_FLAG_OK, NULL), /* pdu3HumidityThLowerWarning.1.1 = INTEGER: 30 */ - { "unmapped.pdu3HumidityThLowerWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.4.3.1.6.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3HumidityThLowerWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.4.3.1.6.1.1", NULL, SU_FLAG_OK, NULL), /* pdu3HumidityThLowerWarning.1.2 = INTEGER: 0 */ - { "unmapped.pdu3HumidityThLowerWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.4.3.1.6.1.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3HumidityThLowerWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.4.3.1.6.1.2", NULL, SU_FLAG_OK, NULL), /* = INTEGER: 0 */ - { "unmapped. = INTEGER: 0", 0, 1, ".1.3.6.1.4.1.232.165.11.4.3.1.6.1.3", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped. = INTEGER: 0", 0, 1, ".1.3.6.1.4.1.232.165.11.4.3.1.6.1.3", NULL, SU_FLAG_OK, NULL), /* = INTEGER: 0 */ - { "unmapped. = INTEGER: 0", 0, 1, ".1.3.6.1.4.1.232.165.11.4.3.1.6.1.4", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped. = INTEGER: 0", 0, 1, ".1.3.6.1.4.1.232.165.11.4.3.1.6.1.4", NULL, SU_FLAG_OK, NULL), /* = INTEGER: 0 */ - { "unmapped. = INTEGER: 0", 0, 1, ".1.3.6.1.4.1.232.165.11.4.3.1.6.1.5", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped. = INTEGER: 0", 0, 1, ".1.3.6.1.4.1.232.165.11.4.3.1.6.1.5", NULL, SU_FLAG_OK, NULL), /* = INTEGER: 0 */ - { "unmapped. = INTEGER: 0", 0, 1, ".1.3.6.1.4.1.232.165.11.4.3.1.6.1.6", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped. = INTEGER: 0", 0, 1, ".1.3.6.1.4.1.232.165.11.4.3.1.6.1.6", NULL, SU_FLAG_OK, NULL), /* pdu3HumidityThLowerCritical.1.1 = INTEGER: 10 */ - { "unmapped.pdu3HumidityThLowerCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.4.3.1.7.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3HumidityThLowerCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.4.3.1.7.1.1", NULL, SU_FLAG_OK, NULL), /* pdu3HumidityThLowerCritical.1.2 = INTEGER: 0 */ - { "unmapped.pdu3HumidityThLowerCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.4.3.1.7.1.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3HumidityThLowerCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.4.3.1.7.1.2", NULL, SU_FLAG_OK, NULL), /* = INTEGER: 0 */ - { "unmapped. = INTEGER: 0", 0, 1, ".1.3.6.1.4.1.232.165.11.4.3.1.7.1.3", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped. = INTEGER: 0", 0, 1, ".1.3.6.1.4.1.232.165.11.4.3.1.7.1.3", NULL, SU_FLAG_OK, NULL), /* = INTEGER: 0 */ - { "unmapped. = INTEGER: 0", 0, 1, ".1.3.6.1.4.1.232.165.11.4.3.1.7.1.4", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped. = INTEGER: 0", 0, 1, ".1.3.6.1.4.1.232.165.11.4.3.1.7.1.4", NULL, SU_FLAG_OK, NULL), /* = INTEGER: 0 */ - { "unmapped. = INTEGER: 0", 0, 1, ".1.3.6.1.4.1.232.165.11.4.3.1.7.1.5", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped. = INTEGER: 0", 0, 1, ".1.3.6.1.4.1.232.165.11.4.3.1.7.1.5", NULL, SU_FLAG_OK, NULL), /* = INTEGER: 0 */ - { "unmapped. = INTEGER: 0", 0, 1, ".1.3.6.1.4.1.232.165.11.4.3.1.7.1.6", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped. = INTEGER: 0", 0, 1, ".1.3.6.1.4.1.232.165.11.4.3.1.7.1.6", NULL, SU_FLAG_OK, NULL), /* pdu3HumidityThUpperWarning.1.1 = INTEGER: 60 */ - { "unmapped.pdu3HumidityThUpperWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.4.3.1.8.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3HumidityThUpperWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.4.3.1.8.1.1", NULL, SU_FLAG_OK, NULL), /* pdu3HumidityThUpperWarning.1.2 = INTEGER: 0 */ - { "unmapped.pdu3HumidityThUpperWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.4.3.1.8.1.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3HumidityThUpperWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.4.3.1.8.1.2", NULL, SU_FLAG_OK, NULL), /* = INTEGER: 0 */ - { "unmapped. = INTEGER: 0", 0, 1, ".1.3.6.1.4.1.232.165.11.4.3.1.8.1.3", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped. = INTEGER: 0", 0, 1, ".1.3.6.1.4.1.232.165.11.4.3.1.8.1.3", NULL, SU_FLAG_OK, NULL), /* = INTEGER: 0 */ - { "unmapped. = INTEGER: 0", 0, 1, ".1.3.6.1.4.1.232.165.11.4.3.1.8.1.4", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped. = INTEGER: 0", 0, 1, ".1.3.6.1.4.1.232.165.11.4.3.1.8.1.4", NULL, SU_FLAG_OK, NULL), /* = INTEGER: 0 */ - { "unmapped. = INTEGER: 0", 0, 1, ".1.3.6.1.4.1.232.165.11.4.3.1.8.1.5", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped. = INTEGER: 0", 0, 1, ".1.3.6.1.4.1.232.165.11.4.3.1.8.1.5", NULL, SU_FLAG_OK, NULL), /* = INTEGER: 0 */ - { "unmapped. = INTEGER: 0", 0, 1, ".1.3.6.1.4.1.232.165.11.4.3.1.8.1.6", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped. = INTEGER: 0", 0, 1, ".1.3.6.1.4.1.232.165.11.4.3.1.8.1.6", NULL, SU_FLAG_OK, NULL), /* pdu3HumidityThUpperCritical.1.1 = INTEGER: 80 */ - { "unmapped.pdu3HumidityThUpperCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.4.3.1.9.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3HumidityThUpperCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.4.3.1.9.1.1", NULL, SU_FLAG_OK, NULL), /* pdu3HumidityThUpperCritical.1.2 = INTEGER: 0 */ - { "unmapped.pdu3HumidityThUpperCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.4.3.1.9.1.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3HumidityThUpperCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.4.3.1.9.1.2", NULL, SU_FLAG_OK, NULL), /* = INTEGER: 0 */ - { "unmapped. = INTEGER: 0", 0, 1, ".1.3.6.1.4.1.232.165.11.4.3.1.9.1.3", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped. = INTEGER: 0", 0, 1, ".1.3.6.1.4.1.232.165.11.4.3.1.9.1.3", NULL, SU_FLAG_OK, NULL), /* = INTEGER: 0 */ - { "unmapped. = INTEGER: 0", 0, 1, ".1.3.6.1.4.1.232.165.11.4.3.1.9.1.4", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped. = INTEGER: 0", 0, 1, ".1.3.6.1.4.1.232.165.11.4.3.1.9.1.4", NULL, SU_FLAG_OK, NULL), /* = INTEGER: 0 */ - { "unmapped. = INTEGER: 0", 0, 1, ".1.3.6.1.4.1.232.165.11.4.3.1.9.1.5", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped. = INTEGER: 0", 0, 1, ".1.3.6.1.4.1.232.165.11.4.3.1.9.1.5", NULL, SU_FLAG_OK, NULL), /* = INTEGER: 0 */ - { "unmapped. = INTEGER: 0", 0, 1, ".1.3.6.1.4.1.232.165.11.4.3.1.9.1.6", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped. = INTEGER: 0", 0, 1, ".1.3.6.1.4.1.232.165.11.4.3.1.9.1.6", NULL, SU_FLAG_OK, NULL), /* pdu3ContactIndex.1.1 = INTEGER: 0 */ - { "unmapped.pdu3ContactIndex", 0, 1, ".1.3.6.1.4.1.232.165.11.4.4.1.1.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3ContactIndex", 0, 1, ".1.3.6.1.4.1.232.165.11.4.4.1.1.1.1", NULL, SU_FLAG_OK, NULL), /* pdu3ContactIndex.1.2 = INTEGER: 0 */ - { "unmapped.pdu3ContactIndex", 0, 1, ".1.3.6.1.4.1.232.165.11.4.4.1.1.1.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3ContactIndex", 0, 1, ".1.3.6.1.4.1.232.165.11.4.4.1.1.1.2", NULL, SU_FLAG_OK, NULL), /* pdu3ContactName.1.1 = STRING: " " */ - { "unmapped.pdu3ContactName", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.232.165.11.4.4.1.2.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3ContactName", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.232.165.11.4.4.1.2.1.1", NULL, SU_FLAG_OK, NULL), /* pdu3ContactName.1.2 = STRING: " " */ - { "unmapped.pdu3ContactName", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.232.165.11.4.4.1.2.1.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3ContactName", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.232.165.11.4.4.1.2.1.2", NULL, SU_FLAG_OK, NULL), /* pdu3ContactProbeStatus.1.1 = INTEGER: 1 */ - { "unmapped.pdu3ContactProbeStatus", 0, 1, ".1.3.6.1.4.1.232.165.11.4.4.1.3.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3ContactProbeStatus", 0, 1, ".1.3.6.1.4.1.232.165.11.4.4.1.3.1.1", NULL, SU_FLAG_OK, NULL), /* pdu3ContactProbeStatus.1.2 = INTEGER: 1 */ - { "unmapped.pdu3ContactProbeStatus", 0, 1, ".1.3.6.1.4.1.232.165.11.4.4.1.3.1.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3ContactProbeStatus", 0, 1, ".1.3.6.1.4.1.232.165.11.4.4.1.3.1.2", NULL, SU_FLAG_OK, NULL), /* pdu3ContactState.1.1 = INTEGER: 0 */ - { "unmapped.pdu3ContactState", 0, 1, ".1.3.6.1.4.1.232.165.11.4.4.1.4.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3ContactState", 0, 1, ".1.3.6.1.4.1.232.165.11.4.4.1.4.1.1", NULL, SU_FLAG_OK, NULL), /* pdu3ContactState.1.2 = INTEGER: 0 */ - { "unmapped.pdu3ContactState", 0, 1, ".1.3.6.1.4.1.232.165.11.4.4.1.4.1.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3ContactState", 0, 1, ".1.3.6.1.4.1.232.165.11.4.4.1.4.1.2", NULL, SU_FLAG_OK, NULL), /* pdu3OutletIndex.1.1 = INTEGER: 1 */ - { "unmapped.pdu3OutletIndex", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.1.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletIndex", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.1.1.1", NULL, SU_FLAG_OK, NULL), /* pdu3OutletIndex.1.2 = INTEGER: 2 */ - { "unmapped.pdu3OutletIndex", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.1.1.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletIndex", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.1.1.2", NULL, SU_FLAG_OK, NULL), /* pdu3OutletIndex.1.3 = INTEGER: 3 */ - { "unmapped.pdu3OutletIndex", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.1.1.3", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletIndex", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.1.1.3", NULL, SU_FLAG_OK, NULL), /* pdu3OutletIndex.1.4 = INTEGER: 4 */ - { "unmapped.pdu3OutletIndex", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.1.1.4", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletIndex", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.1.1.4", NULL, SU_FLAG_OK, NULL), /* pdu3OutletIndex.1.5 = INTEGER: 5 */ - { "unmapped.pdu3OutletIndex", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.1.1.5", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletIndex", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.1.1.5", NULL, SU_FLAG_OK, NULL), /* pdu3OutletIndex.1.6 = INTEGER: 6 */ - { "unmapped.pdu3OutletIndex", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.1.1.6", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletIndex", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.1.1.6", NULL, SU_FLAG_OK, NULL), /* pdu3OutletIndex.1.7 = INTEGER: 7 */ - { "unmapped.pdu3OutletIndex", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.1.1.7", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletIndex", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.1.1.7", NULL, SU_FLAG_OK, NULL), /* pdu3OutletIndex.1.8 = INTEGER: 8 */ - { "unmapped.pdu3OutletIndex", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.1.1.8", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletIndex", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.1.1.8", NULL, SU_FLAG_OK, NULL), /* pdu3OutletIndex.1.9 = INTEGER: 9 */ - { "unmapped.pdu3OutletIndex", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.1.1.9", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletIndex", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.1.1.9", NULL, SU_FLAG_OK, NULL), /* pdu3OutletIndex.1.10 = INTEGER: 10 */ - { "unmapped.pdu3OutletIndex", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.1.1.10", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletIndex", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.1.1.10", NULL, SU_FLAG_OK, NULL), /* pdu3OutletIndex.1.11 = INTEGER: 11 */ - { "unmapped.pdu3OutletIndex", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.1.1.11", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletIndex", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.1.1.11", NULL, SU_FLAG_OK, NULL), /* pdu3OutletIndex.1.12 = INTEGER: 12 */ - { "unmapped.pdu3OutletIndex", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.1.1.12", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletIndex", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.1.1.12", NULL, SU_FLAG_OK, NULL), /* pdu3OutletIndex.1.13 = INTEGER: 13 */ - { "unmapped.pdu3OutletIndex", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.1.1.13", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletIndex", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.1.1.13", NULL, SU_FLAG_OK, NULL), /* pdu3OutletIndex.1.14 = INTEGER: 14 */ - { "unmapped.pdu3OutletIndex", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.1.1.14", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletIndex", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.1.1.14", NULL, SU_FLAG_OK, NULL), /* pdu3OutletIndex.1.15 = INTEGER: 15 */ - { "unmapped.pdu3OutletIndex", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.1.1.15", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletIndex", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.1.1.15", NULL, SU_FLAG_OK, NULL), /* pdu3OutletIndex.1.16 = INTEGER: 16 */ - { "unmapped.pdu3OutletIndex", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.1.1.16", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletIndex", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.1.1.16", NULL, SU_FLAG_OK, NULL), /* pdu3OutletIndex.1.17 = INTEGER: 17 */ - { "unmapped.pdu3OutletIndex", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.1.1.17", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletIndex", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.1.1.17", NULL, SU_FLAG_OK, NULL), /* pdu3OutletIndex.1.18 = INTEGER: 18 */ - { "unmapped.pdu3OutletIndex", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.1.1.18", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletIndex", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.1.1.18", NULL, SU_FLAG_OK, NULL), /* pdu3OutletIndex.1.19 = INTEGER: 19 */ - { "unmapped.pdu3OutletIndex", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.1.1.19", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletIndex", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.1.1.19", NULL, SU_FLAG_OK, NULL), /* pdu3OutletIndex.1.20 = INTEGER: 20 */ - { "unmapped.pdu3OutletIndex", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.1.1.20", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletIndex", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.1.1.20", NULL, SU_FLAG_OK, NULL), /* pdu3OutletIndex.1.21 = INTEGER: 21 */ - { "unmapped.pdu3OutletIndex", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.1.1.21", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletIndex", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.1.1.21", NULL, SU_FLAG_OK, NULL), /* pdu3OutletIndex.1.22 = INTEGER: 22 */ - { "unmapped.pdu3OutletIndex", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.1.1.22", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletIndex", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.1.1.22", NULL, SU_FLAG_OK, NULL), /* pdu3OutletIndex.1.23 = INTEGER: 23 */ - { "unmapped.pdu3OutletIndex", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.1.1.23", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletIndex", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.1.1.23", NULL, SU_FLAG_OK, NULL), /* pdu3OutletIndex.1.24 = INTEGER: 24 */ - { "unmapped.pdu3OutletIndex", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.1.1.24", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletIndex", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.1.1.24", NULL, SU_FLAG_OK, NULL), /* pdu3OutletIndex.1.25 = INTEGER: 0 */ - { "unmapped.pdu3OutletIndex", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.1.1.25", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletIndex", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.1.1.25", NULL, SU_FLAG_OK, NULL), /* pdu3OutletIndex.1.26 = INTEGER: 0 */ - { "unmapped.pdu3OutletIndex", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.1.1.26", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletIndex", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.1.1.26", NULL, SU_FLAG_OK, NULL), /* pdu3OutletIndex.1.27 = INTEGER: 0 */ - { "unmapped.pdu3OutletIndex", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.1.1.27", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletIndex", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.1.1.27", NULL, SU_FLAG_OK, NULL), /* pdu3OutletIndex.1.28 = INTEGER: 0 */ - { "unmapped.pdu3OutletIndex", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.1.1.28", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletIndex", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.1.1.28", NULL, SU_FLAG_OK, NULL), /* pdu3OutletIndex.1.29 = INTEGER: 0 */ - { "unmapped.pdu3OutletIndex", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.1.1.29", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletIndex", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.1.1.29", NULL, SU_FLAG_OK, NULL), /* pdu3OutletIndex.1.30 = INTEGER: 0 */ - { "unmapped.pdu3OutletIndex", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.1.1.30", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletIndex", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.1.1.30", NULL, SU_FLAG_OK, NULL), /* pdu3OutletIndex.1.31 = INTEGER: 0 */ - { "unmapped.pdu3OutletIndex", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.1.1.31", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletIndex", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.1.1.31", NULL, SU_FLAG_OK, NULL), /* pdu3OutletIndex.1.32 = INTEGER: 0 */ - { "unmapped.pdu3OutletIndex", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.1.1.32", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletIndex", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.1.1.32", NULL, SU_FLAG_OK, NULL), /* pdu3OutletIndex.1.33 = INTEGER: 0 */ - { "unmapped.pdu3OutletIndex", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.1.1.33", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletIndex", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.1.1.33", NULL, SU_FLAG_OK, NULL), /* pdu3OutletIndex.1.34 = INTEGER: 0 */ - { "unmapped.pdu3OutletIndex", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.1.1.34", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletIndex", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.1.1.34", NULL, SU_FLAG_OK, NULL), /* pdu3OutletIndex.1.35 = INTEGER: 0 */ - { "unmapped.pdu3OutletIndex", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.1.1.35", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletIndex", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.1.1.35", NULL, SU_FLAG_OK, NULL), /* pdu3OutletIndex.1.36 = INTEGER: 0 */ - { "unmapped.pdu3OutletIndex", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.1.1.36", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletIndex", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.1.1.36", NULL, SU_FLAG_OK, NULL), /* pdu3OutletIndex.1.37 = INTEGER: 0 */ - { "unmapped.pdu3OutletIndex", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.1.1.37", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletIndex", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.1.1.37", NULL, SU_FLAG_OK, NULL), /* pdu3OutletIndex.1.38 = INTEGER: 0 */ - { "unmapped.pdu3OutletIndex", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.1.1.38", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletIndex", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.1.1.38", NULL, SU_FLAG_OK, NULL), /* pdu3OutletIndex.1.39 = INTEGER: 0 */ - { "unmapped.pdu3OutletIndex", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.1.1.39", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletIndex", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.1.1.39", NULL, SU_FLAG_OK, NULL), /* pdu3OutletIndex.1.40 = INTEGER: 0 */ - { "unmapped.pdu3OutletIndex", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.1.1.40", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletIndex", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.1.1.40", NULL, SU_FLAG_OK, NULL), /* pdu3OutletIndex.1.41 = INTEGER: 0 */ - { "unmapped.pdu3OutletIndex", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.1.1.41", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletIndex", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.1.1.41", NULL, SU_FLAG_OK, NULL), /* pdu3OutletIndex.1.42 = INTEGER: 0 */ - { "unmapped.pdu3OutletIndex", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.1.1.42", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletIndex", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.1.1.42", NULL, SU_FLAG_OK, NULL), /* pdu3OutletIndex.1.43 = INTEGER: 0 */ - { "unmapped.pdu3OutletIndex", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.1.1.43", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletIndex", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.1.1.43", NULL, SU_FLAG_OK, NULL), /* pdu3OutletIndex.1.44 = INTEGER: 0 */ - { "unmapped.pdu3OutletIndex", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.1.1.44", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletIndex", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.1.1.44", NULL, SU_FLAG_OK, NULL), /* pdu3OutletIndex.1.45 = INTEGER: 0 */ - { "unmapped.pdu3OutletIndex", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.1.1.45", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletIndex", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.1.1.45", NULL, SU_FLAG_OK, NULL), /* pdu3OutletIndex.1.46 = INTEGER: 0 */ - { "unmapped.pdu3OutletIndex", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.1.1.46", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletIndex", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.1.1.46", NULL, SU_FLAG_OK, NULL), /* pdu3OutletIndex.1.47 = INTEGER: 0 */ - { "unmapped.pdu3OutletIndex", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.1.1.47", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletIndex", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.1.1.47", NULL, SU_FLAG_OK, NULL), /* pdu3OutletIndex.1.48 = INTEGER: 0 */ - { "unmapped.pdu3OutletIndex", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.1.1.48", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletIndex", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.1.1.48", NULL, SU_FLAG_OK, NULL), /* pdu3OutletActivePowerThStatus.1.1 = INTEGER: 1 */ - { "unmapped.pdu3OutletActivePowerThStatus", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.6.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletActivePowerThStatus", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.6.1.1", NULL, SU_FLAG_OK, NULL), /* pdu3OutletActivePowerThStatus.1.2 = INTEGER: 1 */ - { "unmapped.pdu3OutletActivePowerThStatus", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.6.1.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletActivePowerThStatus", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.6.1.2", NULL, SU_FLAG_OK, NULL), /* pdu3OutletActivePowerThStatus.1.3 = INTEGER: 1 */ - { "unmapped.pdu3OutletActivePowerThStatus", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.6.1.3", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletActivePowerThStatus", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.6.1.3", NULL, SU_FLAG_OK, NULL), /* pdu3OutletActivePowerThStatus.1.4 = INTEGER: 1 */ - { "unmapped.pdu3OutletActivePowerThStatus", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.6.1.4", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletActivePowerThStatus", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.6.1.4", NULL, SU_FLAG_OK, NULL), /* pdu3OutletActivePowerThStatus.1.5 = INTEGER: 1 */ - { "unmapped.pdu3OutletActivePowerThStatus", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.6.1.5", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletActivePowerThStatus", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.6.1.5", NULL, SU_FLAG_OK, NULL), /* pdu3OutletActivePowerThStatus.1.6 = INTEGER: 1 */ - { "unmapped.pdu3OutletActivePowerThStatus", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.6.1.6", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletActivePowerThStatus", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.6.1.6", NULL, SU_FLAG_OK, NULL), /* pdu3OutletActivePowerThStatus.1.7 = INTEGER: 1 */ - { "unmapped.pdu3OutletActivePowerThStatus", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.6.1.7", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletActivePowerThStatus", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.6.1.7", NULL, SU_FLAG_OK, NULL), /* pdu3OutletActivePowerThStatus.1.8 = INTEGER: 1 */ - { "unmapped.pdu3OutletActivePowerThStatus", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.6.1.8", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletActivePowerThStatus", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.6.1.8", NULL, SU_FLAG_OK, NULL), /* pdu3OutletActivePowerThStatus.1.9 = INTEGER: 1 */ - { "unmapped.pdu3OutletActivePowerThStatus", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.6.1.9", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletActivePowerThStatus", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.6.1.9", NULL, SU_FLAG_OK, NULL), /* pdu3OutletActivePowerThStatus.1.10 = INTEGER: 1 */ - { "unmapped.pdu3OutletActivePowerThStatus", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.6.1.10", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletActivePowerThStatus", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.6.1.10", NULL, SU_FLAG_OK, NULL), /* pdu3OutletActivePowerThStatus.1.11 = INTEGER: 1 */ - { "unmapped.pdu3OutletActivePowerThStatus", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.6.1.11", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletActivePowerThStatus", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.6.1.11", NULL, SU_FLAG_OK, NULL), /* pdu3OutletActivePowerThStatus.1.12 = INTEGER: 1 */ - { "unmapped.pdu3OutletActivePowerThStatus", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.6.1.12", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletActivePowerThStatus", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.6.1.12", NULL, SU_FLAG_OK, NULL), /* pdu3OutletActivePowerThStatus.1.13 = INTEGER: 1 */ - { "unmapped.pdu3OutletActivePowerThStatus", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.6.1.13", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletActivePowerThStatus", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.6.1.13", NULL, SU_FLAG_OK, NULL), /* pdu3OutletActivePowerThStatus.1.14 = INTEGER: 1 */ - { "unmapped.pdu3OutletActivePowerThStatus", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.6.1.14", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletActivePowerThStatus", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.6.1.14", NULL, SU_FLAG_OK, NULL), /* pdu3OutletActivePowerThStatus.1.15 = INTEGER: 1 */ - { "unmapped.pdu3OutletActivePowerThStatus", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.6.1.15", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletActivePowerThStatus", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.6.1.15", NULL, SU_FLAG_OK, NULL), /* pdu3OutletActivePowerThStatus.1.16 = INTEGER: 1 */ - { "unmapped.pdu3OutletActivePowerThStatus", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.6.1.16", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletActivePowerThStatus", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.6.1.16", NULL, SU_FLAG_OK, NULL), /* pdu3OutletActivePowerThStatus.1.17 = INTEGER: 1 */ - { "unmapped.pdu3OutletActivePowerThStatus", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.6.1.17", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletActivePowerThStatus", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.6.1.17", NULL, SU_FLAG_OK, NULL), /* pdu3OutletActivePowerThStatus.1.18 = INTEGER: 1 */ - { "unmapped.pdu3OutletActivePowerThStatus", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.6.1.18", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletActivePowerThStatus", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.6.1.18", NULL, SU_FLAG_OK, NULL), /* pdu3OutletActivePowerThStatus.1.19 = INTEGER: 1 */ - { "unmapped.pdu3OutletActivePowerThStatus", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.6.1.19", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletActivePowerThStatus", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.6.1.19", NULL, SU_FLAG_OK, NULL), /* pdu3OutletActivePowerThStatus.1.20 = INTEGER: 1 */ - { "unmapped.pdu3OutletActivePowerThStatus", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.6.1.20", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletActivePowerThStatus", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.6.1.20", NULL, SU_FLAG_OK, NULL), /* pdu3OutletActivePowerThStatus.1.21 = INTEGER: 1 */ - { "unmapped.pdu3OutletActivePowerThStatus", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.6.1.21", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletActivePowerThStatus", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.6.1.21", NULL, SU_FLAG_OK, NULL), /* pdu3OutletActivePowerThStatus.1.22 = INTEGER: 1 */ - { "unmapped.pdu3OutletActivePowerThStatus", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.6.1.22", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletActivePowerThStatus", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.6.1.22", NULL, SU_FLAG_OK, NULL), /* pdu3OutletActivePowerThStatus.1.23 = INTEGER: 1 */ - { "unmapped.pdu3OutletActivePowerThStatus", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.6.1.23", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletActivePowerThStatus", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.6.1.23", NULL, SU_FLAG_OK, NULL), /* pdu3OutletActivePowerThStatus.1.24 = INTEGER: 1 */ - { "unmapped.pdu3OutletActivePowerThStatus", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.6.1.24", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletActivePowerThStatus", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.6.1.24", NULL, SU_FLAG_OK, NULL), /* pdu3OutletActivePowerThStatus.1.25 = INTEGER: 0 */ - { "unmapped.pdu3OutletActivePowerThStatus", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.6.1.25", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletActivePowerThStatus", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.6.1.25", NULL, SU_FLAG_OK, NULL), /* pdu3OutletActivePowerThStatus.1.26 = INTEGER: 0 */ - { "unmapped.pdu3OutletActivePowerThStatus", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.6.1.26", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletActivePowerThStatus", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.6.1.26", NULL, SU_FLAG_OK, NULL), /* pdu3OutletActivePowerThStatus.1.27 = INTEGER: 0 */ - { "unmapped.pdu3OutletActivePowerThStatus", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.6.1.27", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletActivePowerThStatus", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.6.1.27", NULL, SU_FLAG_OK, NULL), /* pdu3OutletActivePowerThStatus.1.28 = INTEGER: 0 */ - { "unmapped.pdu3OutletActivePowerThStatus", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.6.1.28", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletActivePowerThStatus", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.6.1.28", NULL, SU_FLAG_OK, NULL), /* pdu3OutletActivePowerThStatus.1.29 = INTEGER: 0 */ - { "unmapped.pdu3OutletActivePowerThStatus", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.6.1.29", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletActivePowerThStatus", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.6.1.29", NULL, SU_FLAG_OK, NULL), /* pdu3OutletActivePowerThStatus.1.30 = INTEGER: 0 */ - { "unmapped.pdu3OutletActivePowerThStatus", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.6.1.30", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletActivePowerThStatus", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.6.1.30", NULL, SU_FLAG_OK, NULL), /* pdu3OutletActivePowerThStatus.1.31 = INTEGER: 0 */ - { "unmapped.pdu3OutletActivePowerThStatus", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.6.1.31", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletActivePowerThStatus", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.6.1.31", NULL, SU_FLAG_OK, NULL), /* pdu3OutletActivePowerThStatus.1.32 = INTEGER: 0 */ - { "unmapped.pdu3OutletActivePowerThStatus", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.6.1.32", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletActivePowerThStatus", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.6.1.32", NULL, SU_FLAG_OK, NULL), /* pdu3OutletActivePowerThStatus.1.33 = INTEGER: 0 */ - { "unmapped.pdu3OutletActivePowerThStatus", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.6.1.33", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletActivePowerThStatus", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.6.1.33", NULL, SU_FLAG_OK, NULL), /* pdu3OutletActivePowerThStatus.1.34 = INTEGER: 0 */ - { "unmapped.pdu3OutletActivePowerThStatus", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.6.1.34", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletActivePowerThStatus", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.6.1.34", NULL, SU_FLAG_OK, NULL), /* pdu3OutletActivePowerThStatus.1.35 = INTEGER: 0 */ - { "unmapped.pdu3OutletActivePowerThStatus", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.6.1.35", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletActivePowerThStatus", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.6.1.35", NULL, SU_FLAG_OK, NULL), /* pdu3OutletActivePowerThStatus.1.36 = INTEGER: 0 */ - { "unmapped.pdu3OutletActivePowerThStatus", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.6.1.36", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletActivePowerThStatus", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.6.1.36", NULL, SU_FLAG_OK, NULL), /* pdu3OutletActivePowerThStatus.1.37 = INTEGER: 0 */ - { "unmapped.pdu3OutletActivePowerThStatus", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.6.1.37", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletActivePowerThStatus", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.6.1.37", NULL, SU_FLAG_OK, NULL), /* pdu3OutletActivePowerThStatus.1.38 = INTEGER: 0 */ - { "unmapped.pdu3OutletActivePowerThStatus", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.6.1.38", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletActivePowerThStatus", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.6.1.38", NULL, SU_FLAG_OK, NULL), /* pdu3OutletActivePowerThStatus.1.39 = INTEGER: 0 */ - { "unmapped.pdu3OutletActivePowerThStatus", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.6.1.39", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletActivePowerThStatus", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.6.1.39", NULL, SU_FLAG_OK, NULL), /* pdu3OutletActivePowerThStatus.1.40 = INTEGER: 0 */ - { "unmapped.pdu3OutletActivePowerThStatus", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.6.1.40", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletActivePowerThStatus", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.6.1.40", NULL, SU_FLAG_OK, NULL), /* pdu3OutletActivePowerThStatus.1.41 = INTEGER: 0 */ - { "unmapped.pdu3OutletActivePowerThStatus", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.6.1.41", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletActivePowerThStatus", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.6.1.41", NULL, SU_FLAG_OK, NULL), /* pdu3OutletActivePowerThStatus.1.42 = INTEGER: 0 */ - { "unmapped.pdu3OutletActivePowerThStatus", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.6.1.42", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletActivePowerThStatus", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.6.1.42", NULL, SU_FLAG_OK, NULL), /* pdu3OutletActivePowerThStatus.1.43 = INTEGER: 0 */ - { "unmapped.pdu3OutletActivePowerThStatus", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.6.1.43", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletActivePowerThStatus", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.6.1.43", NULL, SU_FLAG_OK, NULL), /* pdu3OutletActivePowerThStatus.1.44 = INTEGER: 0 */ - { "unmapped.pdu3OutletActivePowerThStatus", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.6.1.44", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletActivePowerThStatus", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.6.1.44", NULL, SU_FLAG_OK, NULL), /* pdu3OutletActivePowerThStatus.1.45 = INTEGER: 0 */ - { "unmapped.pdu3OutletActivePowerThStatus", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.6.1.45", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletActivePowerThStatus", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.6.1.45", NULL, SU_FLAG_OK, NULL), /* pdu3OutletActivePowerThStatus.1.46 = INTEGER: 0 */ - { "unmapped.pdu3OutletActivePowerThStatus", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.6.1.46", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletActivePowerThStatus", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.6.1.46", NULL, SU_FLAG_OK, NULL), /* pdu3OutletActivePowerThStatus.1.47 = INTEGER: 0 */ - { "unmapped.pdu3OutletActivePowerThStatus", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.6.1.47", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletActivePowerThStatus", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.6.1.47", NULL, SU_FLAG_OK, NULL), /* pdu3OutletActivePowerThStatus.1.48 = INTEGER: 0 */ - { "unmapped.pdu3OutletActivePowerThStatus", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.6.1.48", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletActivePowerThStatus", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.6.1.48", NULL, SU_FLAG_OK, NULL), /* pdu3OutletActivePowerThLowerWarning.1.1 = INTEGER: 0 */ - { "unmapped.pdu3OutletActivePowerThLowerWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.7.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletActivePowerThLowerWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.7.1.1", NULL, SU_FLAG_OK, NULL), /* pdu3OutletActivePowerThLowerWarning.1.2 = INTEGER: 0 */ - { "unmapped.pdu3OutletActivePowerThLowerWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.7.1.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletActivePowerThLowerWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.7.1.2", NULL, SU_FLAG_OK, NULL), /* pdu3OutletActivePowerThLowerWarning.1.3 = INTEGER: 0 */ - { "unmapped.pdu3OutletActivePowerThLowerWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.7.1.3", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletActivePowerThLowerWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.7.1.3", NULL, SU_FLAG_OK, NULL), /* pdu3OutletActivePowerThLowerWarning.1.4 = INTEGER: 0 */ - { "unmapped.pdu3OutletActivePowerThLowerWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.7.1.4", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletActivePowerThLowerWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.7.1.4", NULL, SU_FLAG_OK, NULL), /* pdu3OutletActivePowerThLowerWarning.1.5 = INTEGER: 0 */ - { "unmapped.pdu3OutletActivePowerThLowerWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.7.1.5", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletActivePowerThLowerWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.7.1.5", NULL, SU_FLAG_OK, NULL), /* pdu3OutletActivePowerThLowerWarning.1.6 = INTEGER: 0 */ - { "unmapped.pdu3OutletActivePowerThLowerWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.7.1.6", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletActivePowerThLowerWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.7.1.6", NULL, SU_FLAG_OK, NULL), /* pdu3OutletActivePowerThLowerWarning.1.7 = INTEGER: 0 */ - { "unmapped.pdu3OutletActivePowerThLowerWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.7.1.7", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletActivePowerThLowerWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.7.1.7", NULL, SU_FLAG_OK, NULL), /* pdu3OutletActivePowerThLowerWarning.1.8 = INTEGER: 0 */ - { "unmapped.pdu3OutletActivePowerThLowerWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.7.1.8", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletActivePowerThLowerWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.7.1.8", NULL, SU_FLAG_OK, NULL), /* pdu3OutletActivePowerThLowerWarning.1.9 = INTEGER: 0 */ - { "unmapped.pdu3OutletActivePowerThLowerWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.7.1.9", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletActivePowerThLowerWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.7.1.9", NULL, SU_FLAG_OK, NULL), /* pdu3OutletActivePowerThLowerWarning.1.10 = INTEGER: 0 */ - { "unmapped.pdu3OutletActivePowerThLowerWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.7.1.10", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletActivePowerThLowerWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.7.1.10", NULL, SU_FLAG_OK, NULL), /* pdu3OutletActivePowerThLowerWarning.1.11 = INTEGER: 0 */ - { "unmapped.pdu3OutletActivePowerThLowerWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.7.1.11", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletActivePowerThLowerWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.7.1.11", NULL, SU_FLAG_OK, NULL), /* pdu3OutletActivePowerThLowerWarning.1.12 = INTEGER: 0 */ - { "unmapped.pdu3OutletActivePowerThLowerWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.7.1.12", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletActivePowerThLowerWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.7.1.12", NULL, SU_FLAG_OK, NULL), /* pdu3OutletActivePowerThLowerWarning.1.13 = INTEGER: 0 */ - { "unmapped.pdu3OutletActivePowerThLowerWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.7.1.13", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletActivePowerThLowerWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.7.1.13", NULL, SU_FLAG_OK, NULL), /* pdu3OutletActivePowerThLowerWarning.1.14 = INTEGER: 0 */ - { "unmapped.pdu3OutletActivePowerThLowerWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.7.1.14", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletActivePowerThLowerWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.7.1.14", NULL, SU_FLAG_OK, NULL), /* pdu3OutletActivePowerThLowerWarning.1.15 = INTEGER: 0 */ - { "unmapped.pdu3OutletActivePowerThLowerWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.7.1.15", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletActivePowerThLowerWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.7.1.15", NULL, SU_FLAG_OK, NULL), /* pdu3OutletActivePowerThLowerWarning.1.16 = INTEGER: 0 */ - { "unmapped.pdu3OutletActivePowerThLowerWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.7.1.16", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletActivePowerThLowerWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.7.1.16", NULL, SU_FLAG_OK, NULL), /* pdu3OutletActivePowerThLowerWarning.1.17 = INTEGER: 0 */ - { "unmapped.pdu3OutletActivePowerThLowerWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.7.1.17", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletActivePowerThLowerWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.7.1.17", NULL, SU_FLAG_OK, NULL), /* pdu3OutletActivePowerThLowerWarning.1.18 = INTEGER: 0 */ - { "unmapped.pdu3OutletActivePowerThLowerWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.7.1.18", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletActivePowerThLowerWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.7.1.18", NULL, SU_FLAG_OK, NULL), /* pdu3OutletActivePowerThLowerWarning.1.19 = INTEGER: 0 */ - { "unmapped.pdu3OutletActivePowerThLowerWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.7.1.19", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletActivePowerThLowerWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.7.1.19", NULL, SU_FLAG_OK, NULL), /* pdu3OutletActivePowerThLowerWarning.1.20 = INTEGER: 0 */ - { "unmapped.pdu3OutletActivePowerThLowerWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.7.1.20", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletActivePowerThLowerWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.7.1.20", NULL, SU_FLAG_OK, NULL), /* pdu3OutletActivePowerThLowerWarning.1.21 = INTEGER: 0 */ - { "unmapped.pdu3OutletActivePowerThLowerWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.7.1.21", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletActivePowerThLowerWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.7.1.21", NULL, SU_FLAG_OK, NULL), /* pdu3OutletActivePowerThLowerWarning.1.22 = INTEGER: 0 */ - { "unmapped.pdu3OutletActivePowerThLowerWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.7.1.22", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletActivePowerThLowerWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.7.1.22", NULL, SU_FLAG_OK, NULL), /* pdu3OutletActivePowerThLowerWarning.1.23 = INTEGER: 0 */ - { "unmapped.pdu3OutletActivePowerThLowerWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.7.1.23", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletActivePowerThLowerWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.7.1.23", NULL, SU_FLAG_OK, NULL), /* pdu3OutletActivePowerThLowerWarning.1.24 = INTEGER: 0 */ - { "unmapped.pdu3OutletActivePowerThLowerWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.7.1.24", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletActivePowerThLowerWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.7.1.24", NULL, SU_FLAG_OK, NULL), /* pdu3OutletActivePowerThLowerWarning.1.25 = INTEGER: 0 */ - { "unmapped.pdu3OutletActivePowerThLowerWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.7.1.25", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletActivePowerThLowerWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.7.1.25", NULL, SU_FLAG_OK, NULL), /* pdu3OutletActivePowerThLowerWarning.1.26 = INTEGER: 0 */ - { "unmapped.pdu3OutletActivePowerThLowerWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.7.1.26", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletActivePowerThLowerWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.7.1.26", NULL, SU_FLAG_OK, NULL), /* pdu3OutletActivePowerThLowerWarning.1.27 = INTEGER: 0 */ - { "unmapped.pdu3OutletActivePowerThLowerWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.7.1.27", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletActivePowerThLowerWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.7.1.27", NULL, SU_FLAG_OK, NULL), /* pdu3OutletActivePowerThLowerWarning.1.28 = INTEGER: 0 */ - { "unmapped.pdu3OutletActivePowerThLowerWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.7.1.28", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletActivePowerThLowerWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.7.1.28", NULL, SU_FLAG_OK, NULL), /* pdu3OutletActivePowerThLowerWarning.1.29 = INTEGER: 0 */ - { "unmapped.pdu3OutletActivePowerThLowerWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.7.1.29", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletActivePowerThLowerWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.7.1.29", NULL, SU_FLAG_OK, NULL), /* pdu3OutletActivePowerThLowerWarning.1.30 = INTEGER: 0 */ - { "unmapped.pdu3OutletActivePowerThLowerWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.7.1.30", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletActivePowerThLowerWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.7.1.30", NULL, SU_FLAG_OK, NULL), /* pdu3OutletActivePowerThLowerWarning.1.31 = INTEGER: 0 */ - { "unmapped.pdu3OutletActivePowerThLowerWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.7.1.31", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletActivePowerThLowerWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.7.1.31", NULL, SU_FLAG_OK, NULL), /* pdu3OutletActivePowerThLowerWarning.1.32 = INTEGER: 0 */ - { "unmapped.pdu3OutletActivePowerThLowerWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.7.1.32", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletActivePowerThLowerWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.7.1.32", NULL, SU_FLAG_OK, NULL), /* pdu3OutletActivePowerThLowerWarning.1.33 = INTEGER: 0 */ - { "unmapped.pdu3OutletActivePowerThLowerWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.7.1.33", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletActivePowerThLowerWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.7.1.33", NULL, SU_FLAG_OK, NULL), /* pdu3OutletActivePowerThLowerWarning.1.34 = INTEGER: 0 */ - { "unmapped.pdu3OutletActivePowerThLowerWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.7.1.34", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletActivePowerThLowerWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.7.1.34", NULL, SU_FLAG_OK, NULL), /* pdu3OutletActivePowerThLowerWarning.1.35 = INTEGER: 0 */ - { "unmapped.pdu3OutletActivePowerThLowerWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.7.1.35", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletActivePowerThLowerWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.7.1.35", NULL, SU_FLAG_OK, NULL), /* pdu3OutletActivePowerThLowerWarning.1.36 = INTEGER: 0 */ - { "unmapped.pdu3OutletActivePowerThLowerWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.7.1.36", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletActivePowerThLowerWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.7.1.36", NULL, SU_FLAG_OK, NULL), /* pdu3OutletActivePowerThLowerWarning.1.37 = INTEGER: 0 */ - { "unmapped.pdu3OutletActivePowerThLowerWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.7.1.37", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletActivePowerThLowerWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.7.1.37", NULL, SU_FLAG_OK, NULL), /* pdu3OutletActivePowerThLowerWarning.1.38 = INTEGER: 0 */ - { "unmapped.pdu3OutletActivePowerThLowerWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.7.1.38", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletActivePowerThLowerWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.7.1.38", NULL, SU_FLAG_OK, NULL), /* pdu3OutletActivePowerThLowerWarning.1.39 = INTEGER: 0 */ - { "unmapped.pdu3OutletActivePowerThLowerWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.7.1.39", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletActivePowerThLowerWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.7.1.39", NULL, SU_FLAG_OK, NULL), /* pdu3OutletActivePowerThLowerWarning.1.40 = INTEGER: 0 */ - { "unmapped.pdu3OutletActivePowerThLowerWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.7.1.40", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletActivePowerThLowerWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.7.1.40", NULL, SU_FLAG_OK, NULL), /* pdu3OutletActivePowerThLowerWarning.1.41 = INTEGER: 0 */ - { "unmapped.pdu3OutletActivePowerThLowerWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.7.1.41", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletActivePowerThLowerWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.7.1.41", NULL, SU_FLAG_OK, NULL), /* pdu3OutletActivePowerThLowerWarning.1.42 = INTEGER: 0 */ - { "unmapped.pdu3OutletActivePowerThLowerWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.7.1.42", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletActivePowerThLowerWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.7.1.42", NULL, SU_FLAG_OK, NULL), /* pdu3OutletActivePowerThLowerWarning.1.43 = INTEGER: 0 */ - { "unmapped.pdu3OutletActivePowerThLowerWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.7.1.43", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletActivePowerThLowerWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.7.1.43", NULL, SU_FLAG_OK, NULL), /* pdu3OutletActivePowerThLowerWarning.1.44 = INTEGER: 0 */ - { "unmapped.pdu3OutletActivePowerThLowerWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.7.1.44", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletActivePowerThLowerWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.7.1.44", NULL, SU_FLAG_OK, NULL), /* pdu3OutletActivePowerThLowerWarning.1.45 = INTEGER: 0 */ - { "unmapped.pdu3OutletActivePowerThLowerWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.7.1.45", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletActivePowerThLowerWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.7.1.45", NULL, SU_FLAG_OK, NULL), /* pdu3OutletActivePowerThLowerWarning.1.46 = INTEGER: 0 */ - { "unmapped.pdu3OutletActivePowerThLowerWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.7.1.46", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletActivePowerThLowerWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.7.1.46", NULL, SU_FLAG_OK, NULL), /* pdu3OutletActivePowerThLowerWarning.1.47 = INTEGER: 0 */ - { "unmapped.pdu3OutletActivePowerThLowerWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.7.1.47", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletActivePowerThLowerWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.7.1.47", NULL, SU_FLAG_OK, NULL), /* pdu3OutletActivePowerThLowerWarning.1.48 = INTEGER: 0 */ - { "unmapped.pdu3OutletActivePowerThLowerWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.7.1.48", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletActivePowerThLowerWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.7.1.48", NULL, SU_FLAG_OK, NULL), /* pdu3OutletActivePowerThLowerCritical.1.1 = INTEGER: 0 */ - { "unmapped.pdu3OutletActivePowerThLowerCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.8.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletActivePowerThLowerCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.8.1.1", NULL, SU_FLAG_OK, NULL), /* pdu3OutletActivePowerThLowerCritical.1.2 = INTEGER: 0 */ - { "unmapped.pdu3OutletActivePowerThLowerCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.8.1.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletActivePowerThLowerCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.8.1.2", NULL, SU_FLAG_OK, NULL), /* pdu3OutletActivePowerThLowerCritical.1.3 = INTEGER: 0 */ - { "unmapped.pdu3OutletActivePowerThLowerCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.8.1.3", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletActivePowerThLowerCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.8.1.3", NULL, SU_FLAG_OK, NULL), /* pdu3OutletActivePowerThLowerCritical.1.4 = INTEGER: 0 */ - { "unmapped.pdu3OutletActivePowerThLowerCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.8.1.4", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletActivePowerThLowerCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.8.1.4", NULL, SU_FLAG_OK, NULL), /* pdu3OutletActivePowerThLowerCritical.1.5 = INTEGER: 0 */ - { "unmapped.pdu3OutletActivePowerThLowerCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.8.1.5", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletActivePowerThLowerCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.8.1.5", NULL, SU_FLAG_OK, NULL), /* pdu3OutletActivePowerThLowerCritical.1.6 = INTEGER: 0 */ - { "unmapped.pdu3OutletActivePowerThLowerCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.8.1.6", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletActivePowerThLowerCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.8.1.6", NULL, SU_FLAG_OK, NULL), /* pdu3OutletActivePowerThLowerCritical.1.7 = INTEGER: 0 */ - { "unmapped.pdu3OutletActivePowerThLowerCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.8.1.7", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletActivePowerThLowerCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.8.1.7", NULL, SU_FLAG_OK, NULL), /* pdu3OutletActivePowerThLowerCritical.1.8 = INTEGER: 0 */ - { "unmapped.pdu3OutletActivePowerThLowerCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.8.1.8", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletActivePowerThLowerCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.8.1.8", NULL, SU_FLAG_OK, NULL), /* pdu3OutletActivePowerThLowerCritical.1.9 = INTEGER: 0 */ - { "unmapped.pdu3OutletActivePowerThLowerCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.8.1.9", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletActivePowerThLowerCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.8.1.9", NULL, SU_FLAG_OK, NULL), /* pdu3OutletActivePowerThLowerCritical.1.10 = INTEGER: 0 */ - { "unmapped.pdu3OutletActivePowerThLowerCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.8.1.10", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletActivePowerThLowerCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.8.1.10", NULL, SU_FLAG_OK, NULL), /* pdu3OutletActivePowerThLowerCritical.1.11 = INTEGER: 0 */ - { "unmapped.pdu3OutletActivePowerThLowerCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.8.1.11", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletActivePowerThLowerCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.8.1.11", NULL, SU_FLAG_OK, NULL), /* pdu3OutletActivePowerThLowerCritical.1.12 = INTEGER: 0 */ - { "unmapped.pdu3OutletActivePowerThLowerCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.8.1.12", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletActivePowerThLowerCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.8.1.12", NULL, SU_FLAG_OK, NULL), /* pdu3OutletActivePowerThLowerCritical.1.13 = INTEGER: 0 */ - { "unmapped.pdu3OutletActivePowerThLowerCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.8.1.13", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletActivePowerThLowerCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.8.1.13", NULL, SU_FLAG_OK, NULL), /* pdu3OutletActivePowerThLowerCritical.1.14 = INTEGER: 0 */ - { "unmapped.pdu3OutletActivePowerThLowerCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.8.1.14", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletActivePowerThLowerCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.8.1.14", NULL, SU_FLAG_OK, NULL), /* pdu3OutletActivePowerThLowerCritical.1.15 = INTEGER: 0 */ - { "unmapped.pdu3OutletActivePowerThLowerCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.8.1.15", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletActivePowerThLowerCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.8.1.15", NULL, SU_FLAG_OK, NULL), /* pdu3OutletActivePowerThLowerCritical.1.16 = INTEGER: 0 */ - { "unmapped.pdu3OutletActivePowerThLowerCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.8.1.16", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletActivePowerThLowerCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.8.1.16", NULL, SU_FLAG_OK, NULL), /* pdu3OutletActivePowerThLowerCritical.1.17 = INTEGER: 0 */ - { "unmapped.pdu3OutletActivePowerThLowerCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.8.1.17", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletActivePowerThLowerCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.8.1.17", NULL, SU_FLAG_OK, NULL), /* pdu3OutletActivePowerThLowerCritical.1.18 = INTEGER: 0 */ - { "unmapped.pdu3OutletActivePowerThLowerCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.8.1.18", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletActivePowerThLowerCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.8.1.18", NULL, SU_FLAG_OK, NULL), /* pdu3OutletActivePowerThLowerCritical.1.19 = INTEGER: 0 */ - { "unmapped.pdu3OutletActivePowerThLowerCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.8.1.19", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletActivePowerThLowerCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.8.1.19", NULL, SU_FLAG_OK, NULL), /* pdu3OutletActivePowerThLowerCritical.1.20 = INTEGER: 0 */ - { "unmapped.pdu3OutletActivePowerThLowerCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.8.1.20", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletActivePowerThLowerCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.8.1.20", NULL, SU_FLAG_OK, NULL), /* pdu3OutletActivePowerThLowerCritical.1.21 = INTEGER: 0 */ - { "unmapped.pdu3OutletActivePowerThLowerCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.8.1.21", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletActivePowerThLowerCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.8.1.21", NULL, SU_FLAG_OK, NULL), /* pdu3OutletActivePowerThLowerCritical.1.22 = INTEGER: 0 */ - { "unmapped.pdu3OutletActivePowerThLowerCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.8.1.22", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletActivePowerThLowerCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.8.1.22", NULL, SU_FLAG_OK, NULL), /* pdu3OutletActivePowerThLowerCritical.1.23 = INTEGER: 0 */ - { "unmapped.pdu3OutletActivePowerThLowerCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.8.1.23", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletActivePowerThLowerCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.8.1.23", NULL, SU_FLAG_OK, NULL), /* pdu3OutletActivePowerThLowerCritical.1.24 = INTEGER: 0 */ - { "unmapped.pdu3OutletActivePowerThLowerCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.8.1.24", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletActivePowerThLowerCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.8.1.24", NULL, SU_FLAG_OK, NULL), /* pdu3OutletActivePowerThLowerCritical.1.25 = INTEGER: 0 */ - { "unmapped.pdu3OutletActivePowerThLowerCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.8.1.25", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletActivePowerThLowerCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.8.1.25", NULL, SU_FLAG_OK, NULL), /* pdu3OutletActivePowerThLowerCritical.1.26 = INTEGER: 0 */ - { "unmapped.pdu3OutletActivePowerThLowerCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.8.1.26", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletActivePowerThLowerCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.8.1.26", NULL, SU_FLAG_OK, NULL), /* pdu3OutletActivePowerThLowerCritical.1.27 = INTEGER: 0 */ - { "unmapped.pdu3OutletActivePowerThLowerCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.8.1.27", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletActivePowerThLowerCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.8.1.27", NULL, SU_FLAG_OK, NULL), /* pdu3OutletActivePowerThLowerCritical.1.28 = INTEGER: 0 */ - { "unmapped.pdu3OutletActivePowerThLowerCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.8.1.28", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletActivePowerThLowerCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.8.1.28", NULL, SU_FLAG_OK, NULL), /* pdu3OutletActivePowerThLowerCritical.1.29 = INTEGER: 0 */ - { "unmapped.pdu3OutletActivePowerThLowerCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.8.1.29", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletActivePowerThLowerCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.8.1.29", NULL, SU_FLAG_OK, NULL), /* pdu3OutletActivePowerThLowerCritical.1.30 = INTEGER: 0 */ - { "unmapped.pdu3OutletActivePowerThLowerCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.8.1.30", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletActivePowerThLowerCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.8.1.30", NULL, SU_FLAG_OK, NULL), /* pdu3OutletActivePowerThLowerCritical.1.31 = INTEGER: 0 */ - { "unmapped.pdu3OutletActivePowerThLowerCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.8.1.31", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletActivePowerThLowerCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.8.1.31", NULL, SU_FLAG_OK, NULL), /* pdu3OutletActivePowerThLowerCritical.1.32 = INTEGER: 0 */ - { "unmapped.pdu3OutletActivePowerThLowerCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.8.1.32", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletActivePowerThLowerCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.8.1.32", NULL, SU_FLAG_OK, NULL), /* pdu3OutletActivePowerThLowerCritical.1.33 = INTEGER: 0 */ - { "unmapped.pdu3OutletActivePowerThLowerCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.8.1.33", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletActivePowerThLowerCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.8.1.33", NULL, SU_FLAG_OK, NULL), /* pdu3OutletActivePowerThLowerCritical.1.34 = INTEGER: 0 */ - { "unmapped.pdu3OutletActivePowerThLowerCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.8.1.34", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletActivePowerThLowerCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.8.1.34", NULL, SU_FLAG_OK, NULL), /* pdu3OutletActivePowerThLowerCritical.1.35 = INTEGER: 0 */ - { "unmapped.pdu3OutletActivePowerThLowerCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.8.1.35", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletActivePowerThLowerCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.8.1.35", NULL, SU_FLAG_OK, NULL), /* pdu3OutletActivePowerThLowerCritical.1.36 = INTEGER: 0 */ - { "unmapped.pdu3OutletActivePowerThLowerCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.8.1.36", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletActivePowerThLowerCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.8.1.36", NULL, SU_FLAG_OK, NULL), /* pdu3OutletActivePowerThLowerCritical.1.37 = INTEGER: 0 */ - { "unmapped.pdu3OutletActivePowerThLowerCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.8.1.37", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletActivePowerThLowerCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.8.1.37", NULL, SU_FLAG_OK, NULL), /* pdu3OutletActivePowerThLowerCritical.1.38 = INTEGER: 0 */ - { "unmapped.pdu3OutletActivePowerThLowerCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.8.1.38", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletActivePowerThLowerCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.8.1.38", NULL, SU_FLAG_OK, NULL), /* pdu3OutletActivePowerThLowerCritical.1.39 = INTEGER: 0 */ - { "unmapped.pdu3OutletActivePowerThLowerCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.8.1.39", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletActivePowerThLowerCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.8.1.39", NULL, SU_FLAG_OK, NULL), /* pdu3OutletActivePowerThLowerCritical.1.40 = INTEGER: 0 */ - { "unmapped.pdu3OutletActivePowerThLowerCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.8.1.40", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletActivePowerThLowerCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.8.1.40", NULL, SU_FLAG_OK, NULL), /* pdu3OutletActivePowerThLowerCritical.1.41 = INTEGER: 0 */ - { "unmapped.pdu3OutletActivePowerThLowerCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.8.1.41", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletActivePowerThLowerCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.8.1.41", NULL, SU_FLAG_OK, NULL), /* pdu3OutletActivePowerThLowerCritical.1.42 = INTEGER: 0 */ - { "unmapped.pdu3OutletActivePowerThLowerCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.8.1.42", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletActivePowerThLowerCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.8.1.42", NULL, SU_FLAG_OK, NULL), /* pdu3OutletActivePowerThLowerCritical.1.43 = INTEGER: 0 */ - { "unmapped.pdu3OutletActivePowerThLowerCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.8.1.43", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletActivePowerThLowerCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.8.1.43", NULL, SU_FLAG_OK, NULL), /* pdu3OutletActivePowerThLowerCritical.1.44 = INTEGER: 0 */ - { "unmapped.pdu3OutletActivePowerThLowerCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.8.1.44", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletActivePowerThLowerCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.8.1.44", NULL, SU_FLAG_OK, NULL), /* pdu3OutletActivePowerThLowerCritical.1.45 = INTEGER: 0 */ - { "unmapped.pdu3OutletActivePowerThLowerCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.8.1.45", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletActivePowerThLowerCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.8.1.45", NULL, SU_FLAG_OK, NULL), /* pdu3OutletActivePowerThLowerCritical.1.46 = INTEGER: 0 */ - { "unmapped.pdu3OutletActivePowerThLowerCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.8.1.46", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletActivePowerThLowerCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.8.1.46", NULL, SU_FLAG_OK, NULL), /* pdu3OutletActivePowerThLowerCritical.1.47 = INTEGER: 0 */ - { "unmapped.pdu3OutletActivePowerThLowerCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.8.1.47", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletActivePowerThLowerCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.8.1.47", NULL, SU_FLAG_OK, NULL), /* pdu3OutletActivePowerThLowerCritical.1.48 = INTEGER: 0 */ - { "unmapped.pdu3OutletActivePowerThLowerCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.8.1.48", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletActivePowerThLowerCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.8.1.48", NULL, SU_FLAG_OK, NULL), /* pdu3OutletActivePowerThUpperWarning.1.1 = INTEGER: 0 */ - { "unmapped.pdu3OutletActivePowerThUpperWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.9.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletActivePowerThUpperWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.9.1.1", NULL, SU_FLAG_OK, NULL), /* pdu3OutletActivePowerThUpperWarning.1.2 = INTEGER: 0 */ - { "unmapped.pdu3OutletActivePowerThUpperWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.9.1.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletActivePowerThUpperWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.9.1.2", NULL, SU_FLAG_OK, NULL), /* pdu3OutletActivePowerThUpperWarning.1.3 = INTEGER: 0 */ - { "unmapped.pdu3OutletActivePowerThUpperWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.9.1.3", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletActivePowerThUpperWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.9.1.3", NULL, SU_FLAG_OK, NULL), /* pdu3OutletActivePowerThUpperWarning.1.4 = INTEGER: 0 */ - { "unmapped.pdu3OutletActivePowerThUpperWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.9.1.4", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletActivePowerThUpperWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.9.1.4", NULL, SU_FLAG_OK, NULL), /* pdu3OutletActivePowerThUpperWarning.1.5 = INTEGER: 0 */ - { "unmapped.pdu3OutletActivePowerThUpperWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.9.1.5", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletActivePowerThUpperWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.9.1.5", NULL, SU_FLAG_OK, NULL), /* pdu3OutletActivePowerThUpperWarning.1.6 = INTEGER: 0 */ - { "unmapped.pdu3OutletActivePowerThUpperWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.9.1.6", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletActivePowerThUpperWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.9.1.6", NULL, SU_FLAG_OK, NULL), /* pdu3OutletActivePowerThUpperWarning.1.7 = INTEGER: 0 */ - { "unmapped.pdu3OutletActivePowerThUpperWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.9.1.7", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletActivePowerThUpperWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.9.1.7", NULL, SU_FLAG_OK, NULL), /* pdu3OutletActivePowerThUpperWarning.1.8 = INTEGER: 0 */ - { "unmapped.pdu3OutletActivePowerThUpperWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.9.1.8", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletActivePowerThUpperWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.9.1.8", NULL, SU_FLAG_OK, NULL), /* pdu3OutletActivePowerThUpperWarning.1.9 = INTEGER: 0 */ - { "unmapped.pdu3OutletActivePowerThUpperWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.9.1.9", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletActivePowerThUpperWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.9.1.9", NULL, SU_FLAG_OK, NULL), /* pdu3OutletActivePowerThUpperWarning.1.10 = INTEGER: 0 */ - { "unmapped.pdu3OutletActivePowerThUpperWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.9.1.10", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletActivePowerThUpperWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.9.1.10", NULL, SU_FLAG_OK, NULL), /* pdu3OutletActivePowerThUpperWarning.1.11 = INTEGER: 0 */ - { "unmapped.pdu3OutletActivePowerThUpperWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.9.1.11", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletActivePowerThUpperWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.9.1.11", NULL, SU_FLAG_OK, NULL), /* pdu3OutletActivePowerThUpperWarning.1.12 = INTEGER: 0 */ - { "unmapped.pdu3OutletActivePowerThUpperWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.9.1.12", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletActivePowerThUpperWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.9.1.12", NULL, SU_FLAG_OK, NULL), /* pdu3OutletActivePowerThUpperWarning.1.13 = INTEGER: 0 */ - { "unmapped.pdu3OutletActivePowerThUpperWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.9.1.13", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletActivePowerThUpperWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.9.1.13", NULL, SU_FLAG_OK, NULL), /* pdu3OutletActivePowerThUpperWarning.1.14 = INTEGER: 0 */ - { "unmapped.pdu3OutletActivePowerThUpperWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.9.1.14", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletActivePowerThUpperWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.9.1.14", NULL, SU_FLAG_OK, NULL), /* pdu3OutletActivePowerThUpperWarning.1.15 = INTEGER: 0 */ - { "unmapped.pdu3OutletActivePowerThUpperWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.9.1.15", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletActivePowerThUpperWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.9.1.15", NULL, SU_FLAG_OK, NULL), /* pdu3OutletActivePowerThUpperWarning.1.16 = INTEGER: 0 */ - { "unmapped.pdu3OutletActivePowerThUpperWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.9.1.16", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletActivePowerThUpperWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.9.1.16", NULL, SU_FLAG_OK, NULL), /* pdu3OutletActivePowerThUpperWarning.1.17 = INTEGER: 0 */ - { "unmapped.pdu3OutletActivePowerThUpperWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.9.1.17", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletActivePowerThUpperWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.9.1.17", NULL, SU_FLAG_OK, NULL), /* pdu3OutletActivePowerThUpperWarning.1.18 = INTEGER: 0 */ - { "unmapped.pdu3OutletActivePowerThUpperWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.9.1.18", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletActivePowerThUpperWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.9.1.18", NULL, SU_FLAG_OK, NULL), /* pdu3OutletActivePowerThUpperWarning.1.19 = INTEGER: 0 */ - { "unmapped.pdu3OutletActivePowerThUpperWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.9.1.19", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletActivePowerThUpperWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.9.1.19", NULL, SU_FLAG_OK, NULL), /* pdu3OutletActivePowerThUpperWarning.1.20 = INTEGER: 0 */ - { "unmapped.pdu3OutletActivePowerThUpperWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.9.1.20", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletActivePowerThUpperWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.9.1.20", NULL, SU_FLAG_OK, NULL), /* pdu3OutletActivePowerThUpperWarning.1.21 = INTEGER: 0 */ - { "unmapped.pdu3OutletActivePowerThUpperWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.9.1.21", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletActivePowerThUpperWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.9.1.21", NULL, SU_FLAG_OK, NULL), /* pdu3OutletActivePowerThUpperWarning.1.22 = INTEGER: 0 */ - { "unmapped.pdu3OutletActivePowerThUpperWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.9.1.22", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletActivePowerThUpperWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.9.1.22", NULL, SU_FLAG_OK, NULL), /* pdu3OutletActivePowerThUpperWarning.1.23 = INTEGER: 0 */ - { "unmapped.pdu3OutletActivePowerThUpperWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.9.1.23", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletActivePowerThUpperWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.9.1.23", NULL, SU_FLAG_OK, NULL), /* pdu3OutletActivePowerThUpperWarning.1.24 = INTEGER: 0 */ - { "unmapped.pdu3OutletActivePowerThUpperWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.9.1.24", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletActivePowerThUpperWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.9.1.24", NULL, SU_FLAG_OK, NULL), /* pdu3OutletActivePowerThUpperWarning.1.25 = INTEGER: 0 */ - { "unmapped.pdu3OutletActivePowerThUpperWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.9.1.25", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletActivePowerThUpperWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.9.1.25", NULL, SU_FLAG_OK, NULL), /* pdu3OutletActivePowerThUpperWarning.1.26 = INTEGER: 0 */ - { "unmapped.pdu3OutletActivePowerThUpperWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.9.1.26", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletActivePowerThUpperWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.9.1.26", NULL, SU_FLAG_OK, NULL), /* pdu3OutletActivePowerThUpperWarning.1.27 = INTEGER: 0 */ - { "unmapped.pdu3OutletActivePowerThUpperWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.9.1.27", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletActivePowerThUpperWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.9.1.27", NULL, SU_FLAG_OK, NULL), /* pdu3OutletActivePowerThUpperWarning.1.28 = INTEGER: 0 */ - { "unmapped.pdu3OutletActivePowerThUpperWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.9.1.28", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletActivePowerThUpperWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.9.1.28", NULL, SU_FLAG_OK, NULL), /* pdu3OutletActivePowerThUpperWarning.1.29 = INTEGER: 0 */ - { "unmapped.pdu3OutletActivePowerThUpperWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.9.1.29", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletActivePowerThUpperWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.9.1.29", NULL, SU_FLAG_OK, NULL), /* pdu3OutletActivePowerThUpperWarning.1.30 = INTEGER: 0 */ - { "unmapped.pdu3OutletActivePowerThUpperWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.9.1.30", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletActivePowerThUpperWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.9.1.30", NULL, SU_FLAG_OK, NULL), /* pdu3OutletActivePowerThUpperWarning.1.31 = INTEGER: 0 */ - { "unmapped.pdu3OutletActivePowerThUpperWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.9.1.31", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletActivePowerThUpperWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.9.1.31", NULL, SU_FLAG_OK, NULL), /* pdu3OutletActivePowerThUpperWarning.1.32 = INTEGER: 0 */ - { "unmapped.pdu3OutletActivePowerThUpperWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.9.1.32", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletActivePowerThUpperWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.9.1.32", NULL, SU_FLAG_OK, NULL), /* pdu3OutletActivePowerThUpperWarning.1.33 = INTEGER: 0 */ - { "unmapped.pdu3OutletActivePowerThUpperWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.9.1.33", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletActivePowerThUpperWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.9.1.33", NULL, SU_FLAG_OK, NULL), /* pdu3OutletActivePowerThUpperWarning.1.34 = INTEGER: 0 */ - { "unmapped.pdu3OutletActivePowerThUpperWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.9.1.34", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletActivePowerThUpperWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.9.1.34", NULL, SU_FLAG_OK, NULL), /* pdu3OutletActivePowerThUpperWarning.1.35 = INTEGER: 0 */ - { "unmapped.pdu3OutletActivePowerThUpperWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.9.1.35", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletActivePowerThUpperWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.9.1.35", NULL, SU_FLAG_OK, NULL), /* pdu3OutletActivePowerThUpperWarning.1.36 = INTEGER: 0 */ - { "unmapped.pdu3OutletActivePowerThUpperWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.9.1.36", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletActivePowerThUpperWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.9.1.36", NULL, SU_FLAG_OK, NULL), /* pdu3OutletActivePowerThUpperWarning.1.37 = INTEGER: 0 */ - { "unmapped.pdu3OutletActivePowerThUpperWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.9.1.37", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletActivePowerThUpperWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.9.1.37", NULL, SU_FLAG_OK, NULL), /* pdu3OutletActivePowerThUpperWarning.1.38 = INTEGER: 0 */ - { "unmapped.pdu3OutletActivePowerThUpperWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.9.1.38", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletActivePowerThUpperWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.9.1.38", NULL, SU_FLAG_OK, NULL), /* pdu3OutletActivePowerThUpperWarning.1.39 = INTEGER: 0 */ - { "unmapped.pdu3OutletActivePowerThUpperWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.9.1.39", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletActivePowerThUpperWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.9.1.39", NULL, SU_FLAG_OK, NULL), /* pdu3OutletActivePowerThUpperWarning.1.40 = INTEGER: 0 */ - { "unmapped.pdu3OutletActivePowerThUpperWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.9.1.40", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletActivePowerThUpperWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.9.1.40", NULL, SU_FLAG_OK, NULL), /* pdu3OutletActivePowerThUpperWarning.1.41 = INTEGER: 0 */ - { "unmapped.pdu3OutletActivePowerThUpperWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.9.1.41", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletActivePowerThUpperWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.9.1.41", NULL, SU_FLAG_OK, NULL), /* pdu3OutletActivePowerThUpperWarning.1.42 = INTEGER: 0 */ - { "unmapped.pdu3OutletActivePowerThUpperWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.9.1.42", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletActivePowerThUpperWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.9.1.42", NULL, SU_FLAG_OK, NULL), /* pdu3OutletActivePowerThUpperWarning.1.43 = INTEGER: 0 */ - { "unmapped.pdu3OutletActivePowerThUpperWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.9.1.43", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletActivePowerThUpperWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.9.1.43", NULL, SU_FLAG_OK, NULL), /* pdu3OutletActivePowerThUpperWarning.1.44 = INTEGER: 0 */ - { "unmapped.pdu3OutletActivePowerThUpperWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.9.1.44", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletActivePowerThUpperWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.9.1.44", NULL, SU_FLAG_OK, NULL), /* pdu3OutletActivePowerThUpperWarning.1.45 = INTEGER: 0 */ - { "unmapped.pdu3OutletActivePowerThUpperWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.9.1.45", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletActivePowerThUpperWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.9.1.45", NULL, SU_FLAG_OK, NULL), /* pdu3OutletActivePowerThUpperWarning.1.46 = INTEGER: 0 */ - { "unmapped.pdu3OutletActivePowerThUpperWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.9.1.46", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletActivePowerThUpperWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.9.1.46", NULL, SU_FLAG_OK, NULL), /* pdu3OutletActivePowerThUpperWarning.1.47 = INTEGER: 0 */ - { "unmapped.pdu3OutletActivePowerThUpperWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.9.1.47", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletActivePowerThUpperWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.9.1.47", NULL, SU_FLAG_OK, NULL), /* pdu3OutletActivePowerThUpperWarning.1.48 = INTEGER: 0 */ - { "unmapped.pdu3OutletActivePowerThUpperWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.9.1.48", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletActivePowerThUpperWarning", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.9.1.48", NULL, SU_FLAG_OK, NULL), /* pdu3OutletActivePowerThUpperCritical.1.1 = INTEGER: 0 */ - { "unmapped.pdu3OutletActivePowerThUpperCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.10.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletActivePowerThUpperCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.10.1.1", NULL, SU_FLAG_OK, NULL), /* pdu3OutletActivePowerThUpperCritical.1.2 = INTEGER: 0 */ - { "unmapped.pdu3OutletActivePowerThUpperCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.10.1.2", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletActivePowerThUpperCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.10.1.2", NULL, SU_FLAG_OK, NULL), /* pdu3OutletActivePowerThUpperCritical.1.3 = INTEGER: 0 */ - { "unmapped.pdu3OutletActivePowerThUpperCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.10.1.3", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletActivePowerThUpperCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.10.1.3", NULL, SU_FLAG_OK, NULL), /* pdu3OutletActivePowerThUpperCritical.1.4 = INTEGER: 0 */ - { "unmapped.pdu3OutletActivePowerThUpperCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.10.1.4", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletActivePowerThUpperCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.10.1.4", NULL, SU_FLAG_OK, NULL), /* pdu3OutletActivePowerThUpperCritical.1.5 = INTEGER: 0 */ - { "unmapped.pdu3OutletActivePowerThUpperCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.10.1.5", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletActivePowerThUpperCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.10.1.5", NULL, SU_FLAG_OK, NULL), /* pdu3OutletActivePowerThUpperCritical.1.6 = INTEGER: 0 */ - { "unmapped.pdu3OutletActivePowerThUpperCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.10.1.6", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletActivePowerThUpperCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.10.1.6", NULL, SU_FLAG_OK, NULL), /* pdu3OutletActivePowerThUpperCritical.1.7 = INTEGER: 0 */ - { "unmapped.pdu3OutletActivePowerThUpperCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.10.1.7", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletActivePowerThUpperCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.10.1.7", NULL, SU_FLAG_OK, NULL), /* pdu3OutletActivePowerThUpperCritical.1.8 = INTEGER: 0 */ - { "unmapped.pdu3OutletActivePowerThUpperCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.10.1.8", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletActivePowerThUpperCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.10.1.8", NULL, SU_FLAG_OK, NULL), /* pdu3OutletActivePowerThUpperCritical.1.9 = INTEGER: 0 */ - { "unmapped.pdu3OutletActivePowerThUpperCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.10.1.9", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletActivePowerThUpperCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.10.1.9", NULL, SU_FLAG_OK, NULL), /* pdu3OutletActivePowerThUpperCritical.1.10 = INTEGER: 0 */ - { "unmapped.pdu3OutletActivePowerThUpperCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.10.1.10", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletActivePowerThUpperCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.10.1.10", NULL, SU_FLAG_OK, NULL), /* pdu3OutletActivePowerThUpperCritical.1.11 = INTEGER: 0 */ - { "unmapped.pdu3OutletActivePowerThUpperCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.10.1.11", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletActivePowerThUpperCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.10.1.11", NULL, SU_FLAG_OK, NULL), /* pdu3OutletActivePowerThUpperCritical.1.12 = INTEGER: 0 */ - { "unmapped.pdu3OutletActivePowerThUpperCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.10.1.12", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletActivePowerThUpperCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.10.1.12", NULL, SU_FLAG_OK, NULL), /* pdu3OutletActivePowerThUpperCritical.1.13 = INTEGER: 0 */ - { "unmapped.pdu3OutletActivePowerThUpperCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.10.1.13", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletActivePowerThUpperCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.10.1.13", NULL, SU_FLAG_OK, NULL), /* pdu3OutletActivePowerThUpperCritical.1.14 = INTEGER: 0 */ - { "unmapped.pdu3OutletActivePowerThUpperCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.10.1.14", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletActivePowerThUpperCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.10.1.14", NULL, SU_FLAG_OK, NULL), /* pdu3OutletActivePowerThUpperCritical.1.15 = INTEGER: 0 */ - { "unmapped.pdu3OutletActivePowerThUpperCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.10.1.15", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletActivePowerThUpperCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.10.1.15", NULL, SU_FLAG_OK, NULL), /* pdu3OutletActivePowerThUpperCritical.1.16 = INTEGER: 0 */ - { "unmapped.pdu3OutletActivePowerThUpperCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.10.1.16", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletActivePowerThUpperCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.10.1.16", NULL, SU_FLAG_OK, NULL), /* pdu3OutletActivePowerThUpperCritical.1.17 = INTEGER: 0 */ - { "unmapped.pdu3OutletActivePowerThUpperCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.10.1.17", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletActivePowerThUpperCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.10.1.17", NULL, SU_FLAG_OK, NULL), /* pdu3OutletActivePowerThUpperCritical.1.18 = INTEGER: 0 */ - { "unmapped.pdu3OutletActivePowerThUpperCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.10.1.18", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletActivePowerThUpperCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.10.1.18", NULL, SU_FLAG_OK, NULL), /* pdu3OutletActivePowerThUpperCritical.1.19 = INTEGER: 0 */ - { "unmapped.pdu3OutletActivePowerThUpperCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.10.1.19", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletActivePowerThUpperCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.10.1.19", NULL, SU_FLAG_OK, NULL), /* pdu3OutletActivePowerThUpperCritical.1.20 = INTEGER: 0 */ - { "unmapped.pdu3OutletActivePowerThUpperCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.10.1.20", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletActivePowerThUpperCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.10.1.20", NULL, SU_FLAG_OK, NULL), /* pdu3OutletActivePowerThUpperCritical.1.21 = INTEGER: 0 */ - { "unmapped.pdu3OutletActivePowerThUpperCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.10.1.21", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletActivePowerThUpperCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.10.1.21", NULL, SU_FLAG_OK, NULL), /* pdu3OutletActivePowerThUpperCritical.1.22 = INTEGER: 0 */ - { "unmapped.pdu3OutletActivePowerThUpperCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.10.1.22", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletActivePowerThUpperCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.10.1.22", NULL, SU_FLAG_OK, NULL), /* pdu3OutletActivePowerThUpperCritical.1.23 = INTEGER: 0 */ - { "unmapped.pdu3OutletActivePowerThUpperCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.10.1.23", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletActivePowerThUpperCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.10.1.23", NULL, SU_FLAG_OK, NULL), /* pdu3OutletActivePowerThUpperCritical.1.24 = INTEGER: 0 */ - { "unmapped.pdu3OutletActivePowerThUpperCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.10.1.24", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletActivePowerThUpperCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.10.1.24", NULL, SU_FLAG_OK, NULL), /* pdu3OutletActivePowerThUpperCritical.1.25 = INTEGER: 0 */ - { "unmapped.pdu3OutletActivePowerThUpperCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.10.1.25", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletActivePowerThUpperCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.10.1.25", NULL, SU_FLAG_OK, NULL), /* pdu3OutletActivePowerThUpperCritical.1.26 = INTEGER: 0 */ - { "unmapped.pdu3OutletActivePowerThUpperCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.10.1.26", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletActivePowerThUpperCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.10.1.26", NULL, SU_FLAG_OK, NULL), /* pdu3OutletActivePowerThUpperCritical.1.27 = INTEGER: 0 */ - { "unmapped.pdu3OutletActivePowerThUpperCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.10.1.27", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletActivePowerThUpperCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.10.1.27", NULL, SU_FLAG_OK, NULL), /* pdu3OutletActivePowerThUpperCritical.1.28 = INTEGER: 0 */ - { "unmapped.pdu3OutletActivePowerThUpperCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.10.1.28", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletActivePowerThUpperCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.10.1.28", NULL, SU_FLAG_OK, NULL), /* pdu3OutletActivePowerThUpperCritical.1.29 = INTEGER: 0 */ - { "unmapped.pdu3OutletActivePowerThUpperCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.10.1.29", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletActivePowerThUpperCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.10.1.29", NULL, SU_FLAG_OK, NULL), /* pdu3OutletActivePowerThUpperCritical.1.30 = INTEGER: 0 */ - { "unmapped.pdu3OutletActivePowerThUpperCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.10.1.30", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletActivePowerThUpperCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.10.1.30", NULL, SU_FLAG_OK, NULL), /* pdu3OutletActivePowerThUpperCritical.1.31 = INTEGER: 0 */ - { "unmapped.pdu3OutletActivePowerThUpperCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.10.1.31", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletActivePowerThUpperCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.10.1.31", NULL, SU_FLAG_OK, NULL), /* pdu3OutletActivePowerThUpperCritical.1.32 = INTEGER: 0 */ - { "unmapped.pdu3OutletActivePowerThUpperCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.10.1.32", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletActivePowerThUpperCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.10.1.32", NULL, SU_FLAG_OK, NULL), /* pdu3OutletActivePowerThUpperCritical.1.33 = INTEGER: 0 */ - { "unmapped.pdu3OutletActivePowerThUpperCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.10.1.33", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletActivePowerThUpperCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.10.1.33", NULL, SU_FLAG_OK, NULL), /* pdu3OutletActivePowerThUpperCritical.1.34 = INTEGER: 0 */ - { "unmapped.pdu3OutletActivePowerThUpperCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.10.1.34", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletActivePowerThUpperCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.10.1.34", NULL, SU_FLAG_OK, NULL), /* pdu3OutletActivePowerThUpperCritical.1.35 = INTEGER: 0 */ - { "unmapped.pdu3OutletActivePowerThUpperCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.10.1.35", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletActivePowerThUpperCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.10.1.35", NULL, SU_FLAG_OK, NULL), /* pdu3OutletActivePowerThUpperCritical.1.36 = INTEGER: 0 */ - { "unmapped.pdu3OutletActivePowerThUpperCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.10.1.36", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletActivePowerThUpperCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.10.1.36", NULL, SU_FLAG_OK, NULL), /* pdu3OutletActivePowerThUpperCritical.1.37 = INTEGER: 0 */ - { "unmapped.pdu3OutletActivePowerThUpperCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.10.1.37", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletActivePowerThUpperCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.10.1.37", NULL, SU_FLAG_OK, NULL), /* pdu3OutletActivePowerThUpperCritical.1.38 = INTEGER: 0 */ - { "unmapped.pdu3OutletActivePowerThUpperCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.10.1.38", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletActivePowerThUpperCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.10.1.38", NULL, SU_FLAG_OK, NULL), /* pdu3OutletActivePowerThUpperCritical.1.39 = INTEGER: 0 */ - { "unmapped.pdu3OutletActivePowerThUpperCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.10.1.39", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletActivePowerThUpperCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.10.1.39", NULL, SU_FLAG_OK, NULL), /* pdu3OutletActivePowerThUpperCritical.1.40 = INTEGER: 0 */ - { "unmapped.pdu3OutletActivePowerThUpperCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.10.1.40", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletActivePowerThUpperCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.10.1.40", NULL, SU_FLAG_OK, NULL), /* pdu3OutletActivePowerThUpperCritical.1.41 = INTEGER: 0 */ - { "unmapped.pdu3OutletActivePowerThUpperCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.10.1.41", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletActivePowerThUpperCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.10.1.41", NULL, SU_FLAG_OK, NULL), /* pdu3OutletActivePowerThUpperCritical.1.42 = INTEGER: 0 */ - { "unmapped.pdu3OutletActivePowerThUpperCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.10.1.42", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletActivePowerThUpperCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.10.1.42", NULL, SU_FLAG_OK, NULL), /* pdu3OutletActivePowerThUpperCritical.1.43 = INTEGER: 0 */ - { "unmapped.pdu3OutletActivePowerThUpperCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.10.1.43", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletActivePowerThUpperCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.10.1.43", NULL, SU_FLAG_OK, NULL), /* pdu3OutletActivePowerThUpperCritical.1.44 = INTEGER: 0 */ - { "unmapped.pdu3OutletActivePowerThUpperCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.10.1.44", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletActivePowerThUpperCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.10.1.44", NULL, SU_FLAG_OK, NULL), /* pdu3OutletActivePowerThUpperCritical.1.45 = INTEGER: 0 */ - { "unmapped.pdu3OutletActivePowerThUpperCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.10.1.45", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletActivePowerThUpperCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.10.1.45", NULL, SU_FLAG_OK, NULL), /* pdu3OutletActivePowerThUpperCritical.1.46 = INTEGER: 0 */ - { "unmapped.pdu3OutletActivePowerThUpperCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.10.1.46", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletActivePowerThUpperCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.10.1.46", NULL, SU_FLAG_OK, NULL), /* pdu3OutletActivePowerThUpperCritical.1.47 = INTEGER: 0 */ - { "unmapped.pdu3OutletActivePowerThUpperCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.10.1.47", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletActivePowerThUpperCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.10.1.47", NULL, SU_FLAG_OK, NULL), /* pdu3OutletActivePowerThUpperCritical.1.48 = INTEGER: 0 */ - { "unmapped.pdu3OutletActivePowerThUpperCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.10.1.48", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletActivePowerThUpperCritical", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.10.1.48", NULL, SU_FLAG_OK, NULL), /* pdu3OutletWh.1.%i = INTEGER: 0 */ - { "unmapped.pdu3OutletWh", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.14.1.%i", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletWh", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.14.1.%i", NULL, SU_FLAG_OK, NULL), /* pdu3OutletWhTimer.1.%i = Hex-STRING: 32 30 31 36 2F 31 30 2F 31 31 20 30 32 3A 34 36 3A 35 30 00 */ - { "unmapped.pdu3OutletWhTimer", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.232.165.11.5.1.1.15.1.%i", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletWhTimer", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.232.165.11.5.1.1.15.1.%i", NULL, SU_FLAG_OK, NULL), /* pdu3OutletPowerFactor.1.%i = INTEGER: 88 */ - { "unmapped.pdu3OutletPowerFactor", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.16.1.%i", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletPowerFactor", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.16.1.%i", NULL, SU_FLAG_OK, NULL), /* pdu3OutletVAR.1.%i = INTEGER: 2 */ - { "unmapped.pdu3OutletVAR", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.17.1.%i", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletVAR", 0, 1, ".1.3.6.1.4.1.232.165.11.5.1.1.17.1.%i", NULL, SU_FLAG_OK, NULL), /* pdu3OutletControlPowerOnState.1.%i = INTEGER: 2 */ - { "unmapped.pdu3OutletControlPowerOnState", 0, 1, ".1.3.6.1.4.1.232.165.11.5.2.1.5.1.%i", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletControlPowerOnState", 0, 1, ".1.3.6.1.4.1.232.165.11.5.2.1.5.1.%i", NULL, SU_FLAG_OK, NULL), /* pdu3OutletControlSequenceDelay.1.%i = INTEGER: 0 */ - { "unmapped.pdu3OutletControlSequenceDelay", 0, 1, ".1.3.6.1.4.1.232.165.11.5.2.1.6.1.%i", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletControlSequenceDelay", 0, 1, ".1.3.6.1.4.1.232.165.11.5.2.1.6.1.%i", NULL, SU_FLAG_OK, NULL), /* pdu3OutletControlRebootOffTime.1.%i = INTEGER: 5 */ - { "unmapped.pdu3OutletControlRebootOffTime", 0, 1, ".1.3.6.1.4.1.232.165.11.5.2.1.7.1.%i", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pdu3OutletControlRebootOffTime", 0, 1, ".1.3.6.1.4.1.232.165.11.5.2.1.7.1.%i", NULL, SU_FLAG_OK, NULL), /* pdu3OutletControlShutoffDelay.1.%i = INTEGER: 0 */ - { "unmapped.pdu3OutletControlShutoffDelay", 0, 1, ".1.3.6.1.4.1.232.165.11.5.2.1.9.1.%i", NULL, SU_FLAG_OK, NULL }, - + snmp_info_default("unmapped.pdu3OutletControlShutoffDelay", 0, 1, ".1.3.6.1.4.1.232.165.11.5.2.1.9.1.%i", NULL, SU_FLAG_OK, NULL), #endif /* WITH_UNMAPPED_DATA_POINTS */ + /* end of structure. */ - { NULL, 0, 0, NULL, NULL, 0, NULL } + snmp_info_sentinel }; mib2nut_info_t hpe_pdu3_cis = { "hpe_pdu3_cis", HPE_PDU3_CIS_MIB_VERSION, NULL, HPE_PDU3_OID_MODEL_NAME, hpe_pdu3_cis_mib, HPE_PDU3_CIS_SYSOID, NULL }; diff --git a/drivers/huawei-mib.c b/drivers/huawei-mib.c index 42b90e5845..8278a9c46e 100644 --- a/drivers/huawei-mib.c +++ b/drivers/huawei-mib.c @@ -21,7 +21,7 @@ #include "huawei-mib.h" -#define HUAWEI_MIB_VERSION "0.4" +#define HUAWEI_MIB_VERSION "0.40" #define HUAWEI_SYSOID ".1.3.6.1.4.1.8072.3.2.10" #define HUAWEI_UPSMIB ".1.3.6.1.4.1.2011" @@ -30,72 +30,72 @@ /* To create a value lookup structure (as needed on the 2nd line of the example * below), use the following kind of declaration, outside of the present snmp_info_t[]: * static info_lkp_t huawei_onbatt_info[] = { - * { 1, "OB", NULL, NULL }, - * { 2, "OL", NULL, NULL }, - * { 0, NULL, NULL, NULL } + * info_lkp_default(1, "OB"), + * info_lkp_default(2, "OL"), + * info_lkp_sentinel * }; */ static info_lkp_t huawei_supplymethod_info[] = { - { 1, "", NULL, NULL }, /* no supply */ - { 2, "OL BYPASS", NULL, NULL }, - { 3, "OL", NULL, NULL }, - { 4, "OB", NULL, NULL }, - { 5, "", NULL, NULL }, /* combined */ - { 6, "OL ECO", NULL, NULL }, - { 7, "OB ECO", NULL, NULL }, - { 0, NULL, NULL, NULL } + info_lkp_default(1, ""), /* no supply */ + info_lkp_default(2, "OL BYPASS"), + info_lkp_default(3, "OL"), + info_lkp_default(4, "OB"), + info_lkp_default(5, ""), /* combined */ + info_lkp_default(6, "OL ECO"), + info_lkp_default(7, "OB ECO"), + info_lkp_sentinel }; static info_lkp_t huawei_battstate_info[] = { - { 1, "", NULL, NULL }, /* not connected */ - { 2, "", NULL, NULL }, /* not charging or discharging */ - { 3, "", NULL, NULL }, /* hibernation */ - { 4, "", NULL, NULL }, /* float */ - { 5, "CHRG", NULL, NULL }, /* equalized charging */ - { 6, "DISCHRG", NULL, NULL }, - { 0, NULL, NULL, NULL } + info_lkp_default(1, ""), /* not connected */ + info_lkp_default(2, ""), /* not charging or discharging */ + info_lkp_default(3, ""), /* hibernation */ + info_lkp_default(4, ""), /* float */ + info_lkp_default(5, "CHRG"), /* equalized charging */ + info_lkp_default(6, "DISCHRG"), + info_lkp_sentinel }; static info_lkp_t huawei_phase_info[] = { - { 1, "1", NULL, NULL }, - { 2, "3", NULL, NULL }, - { 0, NULL, NULL, NULL } + info_lkp_default(1, "1"), + info_lkp_default(2, "3"), + info_lkp_sentinel }; static info_lkp_t huawei_voltrating_info[] = { - { 1, "200", NULL, NULL }, - { 2, "208", NULL, NULL }, - { 3, "220", NULL, NULL }, - { 4, "380", NULL, NULL }, - { 5, "400", NULL, NULL }, - { 6, "415", NULL, NULL }, - { 7, "480", NULL, NULL }, - { 8, "600", NULL, NULL }, - { 9, "690", NULL, NULL }, - { 0, NULL, NULL, NULL } + info_lkp_default(1, "200"), + info_lkp_default(2, "208"), + info_lkp_default(3, "220"), + info_lkp_default(4, "380"), + info_lkp_default(5, "400"), + info_lkp_default(6, "415"), + info_lkp_default(7, "480"), + info_lkp_default(8, "600"), + info_lkp_default(9, "690"), + info_lkp_sentinel }; static info_lkp_t huawei_freqrating_info[] = { - { 1, "50", NULL, NULL }, - { 2, "60", NULL, NULL }, - { 0, NULL, NULL, NULL } + info_lkp_default(1, "50"), + info_lkp_default(2, "60"), + info_lkp_sentinel }; static info_lkp_t huawei_pwrrating_info[] = { - { 1, "80000", NULL, NULL }, - { 2, "100000", NULL, NULL }, - { 3, "120000", NULL, NULL }, - { 4, "160000", NULL, NULL }, - { 5, "200000", NULL, NULL }, - { 6, "30000", NULL, NULL }, - { 7, "40000", NULL, NULL }, - { 8, "60000", NULL, NULL }, - { 9, "2400000", NULL, NULL }, - { 10, "2500000", NULL, NULL }, - { 11, "2800000", NULL, NULL }, - { 12, "3000000", NULL, NULL }, - { 0, NULL, NULL, NULL } + info_lkp_default(1, "80000"), + info_lkp_default(2, "100000"), + info_lkp_default(3, "120000"), + info_lkp_default(4, "160000"), + info_lkp_default(5, "200000"), + info_lkp_default(6, "30000"), + info_lkp_default(7, "40000"), + info_lkp_default(8, "60000"), + info_lkp_default(9, "2400000"), + info_lkp_default(10, "2500000"), + info_lkp_default(11, "2800000"), + info_lkp_default(12, "3000000"), + info_lkp_sentinel }; /* Note: This is currently identical to ietf_test_result_info from IETF MIB @@ -103,13 +103,13 @@ static info_lkp_t huawei_pwrrating_info[] = { * b) avoid namespace conflicts, especially with DMF loader of named objects */ static info_lkp_t huawei_test_result_info[] = { - { 1, "done and passed", NULL, NULL }, - { 2, "done and warning", NULL, NULL }, - { 3, "done and error", NULL, NULL }, - { 4, "aborted", NULL, NULL }, - { 5, "in progress", NULL, NULL }, - { 6, "no test initiated", NULL, NULL }, - { 0, NULL, NULL, NULL } + info_lkp_default(1, "done and passed"), + info_lkp_default(2, "done and warning"), + info_lkp_default(3, "done and error"), + info_lkp_default(4, "aborted"), + info_lkp_default(5, "in progress"), + info_lkp_default(6, "no test initiated"), + info_lkp_sentinel }; @@ -117,7 +117,7 @@ static info_lkp_t huawei_test_result_info[] = { static snmp_info_t huawei_mib[] = { /* Data format: - * { info_type, info_flags, info_len, OID, dfl, flags, oid2info, setvar }, + * snmp_info_default(info_type, info_flags, info_len, OID, dfl, flags, oid2info, setvar), * * info_type: NUT INFO_ or CMD_ element name * info_flags: flags to set in addinfo @@ -129,115 +129,115 @@ static snmp_info_t huawei_mib[] = { * oid2info: lookup table between OID and NUT values * * Example: - * { "input.voltage", 0, 0.1, ".1.3.6.1.4.1.705.1.6.2.1.2.1", "", SU_INPUT_1, NULL }, - * { "ups.status", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.705.1.7.3.0", "", SU_FLAG_OK | SU_STATUS_BATT, huawei_onbatt_info }, + * snmp_info_default("input.voltage", 0, 0.1, ".1.3.6.1.4.1.705.1.6.2.1.2.1", "", SU_INPUT_1, NULL), + * snmp_info_default("ups.status", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.705.1.7.3.0", "", SU_FLAG_OK | SU_STATUS_BATT, huawei_onbatt_info), * * To create a value lookup structure (as needed on the 2nd line), use the * following kind of declaration, outside of the present snmp_info_t[]: * static info_lkp_t huawei_onbatt_info[] = { - * { 1, "OB" }, - * { 2, "OL" }, - * { 0, NULL } + * info_lkp_default(1, "OB"), + * info_lkp_default(2, "OL"), + * info_lkp_sentinel * }; */ /* standard MIB items */ - { "device.description", ST_FLAG_STRING | ST_FLAG_RW, SU_INFOSIZE, ".1.3.6.1.2.1.1.1.0", NULL, SU_FLAG_OK, NULL }, - { "device.contact", ST_FLAG_STRING | ST_FLAG_RW, SU_INFOSIZE, ".1.3.6.1.2.1.1.4.0", NULL, SU_FLAG_OK, NULL }, - { "device.location", ST_FLAG_STRING | ST_FLAG_RW, SU_INFOSIZE, ".1.3.6.1.2.1.1.6.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("device.description", ST_FLAG_STRING | ST_FLAG_RW, SU_INFOSIZE, ".1.3.6.1.2.1.1.1.0", NULL, SU_FLAG_OK, NULL), + snmp_info_default("device.contact", ST_FLAG_STRING | ST_FLAG_RW, SU_INFOSIZE, ".1.3.6.1.2.1.1.4.0", NULL, SU_FLAG_OK, NULL), + snmp_info_default("device.location", ST_FLAG_STRING | ST_FLAG_RW, SU_INFOSIZE, ".1.3.6.1.2.1.1.6.0", NULL, SU_FLAG_OK, NULL), /* UPS page */ - { "ups.mfr", ST_FLAG_STRING, SU_INFOSIZE, NULL, "Huawei", SU_FLAG_ABSENT | SU_FLAG_OK, NULL }, - { "ups.model", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.2011.6.174.1.2.100.1.2.1", "Generic SNMP UPS", SU_FLAG_STATIC | SU_FLAG_OK, NULL }, - { "ups.id", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.2011.6.174.1.1.1.2.0", NULL, SU_FLAG_STATIC | SU_FLAG_OK, NULL }, + snmp_info_default("ups.mfr", ST_FLAG_STRING, SU_INFOSIZE, NULL, "Huawei", SU_FLAG_ABSENT | SU_FLAG_OK, NULL), + snmp_info_default("ups.model", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.2011.6.174.1.2.100.1.2.1", "Generic SNMP UPS", SU_FLAG_STATIC | SU_FLAG_OK, NULL), + snmp_info_default("ups.id", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.2011.6.174.1.1.1.2.0", NULL, SU_FLAG_STATIC | SU_FLAG_OK, NULL), - { "ups.time", 0, 1, ".1.3.6.1.4.1.2011.6.174.1.11.1.0", NULL, SU_FLAG_OK, NULL }, /* seconds since epoch */ + snmp_info_default("ups.time", 0, 1, ".1.3.6.1.4.1.2011.6.174.1.11.1.0", NULL, SU_FLAG_OK, NULL), /* seconds since epoch */ - { "ups.firmware", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.2011.6.174.1.2.100.1.3.1", NULL, SU_FLAG_STATIC | SU_FLAG_OK, NULL }, - { "ups.serial", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.2011.6.174.1.2.100.1.5.1", NULL, SU_FLAG_STATIC | SU_FLAG_OK, NULL }, + snmp_info_default("ups.firmware", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.2011.6.174.1.2.100.1.3.1", NULL, SU_FLAG_STATIC | SU_FLAG_OK, NULL), + snmp_info_default("ups.serial", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.2011.6.174.1.2.100.1.5.1", NULL, SU_FLAG_STATIC | SU_FLAG_OK, NULL), - { "ups.status", 0, 1, ".1.3.6.1.4.1.2011.6.174.1.2.101.1.1.1", NULL, SU_FLAG_OK, huawei_supplymethod_info }, - { "ups.status", 0, 1, ".1.3.6.1.4.1.2011.6.174.1.2.101.1.3.1", NULL, SU_STATUS_BATT | SU_FLAG_OK, huawei_battstate_info }, + snmp_info_default("ups.status", 0, 1, ".1.3.6.1.4.1.2011.6.174.1.2.101.1.1.1", NULL, SU_FLAG_OK, huawei_supplymethod_info), + snmp_info_default("ups.status", 0, 1, ".1.3.6.1.4.1.2011.6.174.1.2.101.1.3.1", NULL, SU_STATUS_BATT | SU_FLAG_OK, huawei_battstate_info), - { "ups.test.result", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.2.1.33.1.7.3.0", "", 0, huawei_test_result_info }, + snmp_info_default("ups.test.result", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.2.1.33.1.7.3.0", "", 0, huawei_test_result_info), /* Input page */ /* hwUpsCtrlInputStandard listed in MIB but not present on tested UPS5000-E */ - { "input.phases", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.2011.6.174.1.102.100.1.8", "3", SU_FLAG_ABSENT | SU_FLAG_OK, huawei_phase_info }, + snmp_info_default("input.phases", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.2011.6.174.1.102.100.1.8", "3", SU_FLAG_ABSENT | SU_FLAG_OK, huawei_phase_info), - { "input.L1-N.voltage", 0, 0.1, ".1.3.6.1.4.1.2011.6.174.1.3.100.1.1.1", NULL, SU_FLAG_OK, NULL }, - { "input.L2-N.voltage", 0, 0.1, ".1.3.6.1.4.1.2011.6.174.1.3.100.1.2.1", NULL, SU_FLAG_OK, NULL }, - { "input.L3-N.voltage", 0, 0.1, ".1.3.6.1.4.1.2011.6.174.1.3.100.1.3.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("input.L1-N.voltage", 0, 0.1, ".1.3.6.1.4.1.2011.6.174.1.3.100.1.1.1", NULL, SU_FLAG_OK, NULL), + snmp_info_default("input.L2-N.voltage", 0, 0.1, ".1.3.6.1.4.1.2011.6.174.1.3.100.1.2.1", NULL, SU_FLAG_OK, NULL), + snmp_info_default("input.L3-N.voltage", 0, 0.1, ".1.3.6.1.4.1.2011.6.174.1.3.100.1.3.1", NULL, SU_FLAG_OK, NULL), - { "input.frequency", 0, 0.01, ".1.3.6.1.4.1.2011.6.174.1.3.100.1.4.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("input.frequency", 0, 0.01, ".1.3.6.1.4.1.2011.6.174.1.3.100.1.4.1", NULL, SU_FLAG_OK, NULL), - { "input.L1.current", 0, 0.1, ".1.3.6.1.4.1.2011.6.174.1.3.100.1.5.1", NULL, SU_FLAG_OK, NULL }, - { "input.L2.current", 0, 0.1, ".1.3.6.1.4.1.2011.6.174.1.3.100.1.6.1", NULL, SU_FLAG_OK, NULL }, - { "input.L3.current", 0, 0.1, ".1.3.6.1.4.1.2011.6.174.1.3.100.1.7.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("input.L1.current", 0, 0.1, ".1.3.6.1.4.1.2011.6.174.1.3.100.1.5.1", NULL, SU_FLAG_OK, NULL), + snmp_info_default("input.L2.current", 0, 0.1, ".1.3.6.1.4.1.2011.6.174.1.3.100.1.6.1", NULL, SU_FLAG_OK, NULL), + snmp_info_default("input.L3.current", 0, 0.1, ".1.3.6.1.4.1.2011.6.174.1.3.100.1.7.1", NULL, SU_FLAG_OK, NULL), - { "input.L1.powerfactor", 0, 0.01, ".1.3.6.1.4.1.2011.6.174.1.3.100.1.8.1", NULL, SU_FLAG_OK, NULL }, - { "input.L2.powerfactor", 0, 0.01, ".1.3.6.1.4.1.2011.6.174.1.3.100.1.9.1", NULL, SU_FLAG_OK, NULL }, - { "input.L3.powerfactor", 0, 0.01, ".1.3.6.1.4.1.2011.6.174.1.3.100.1.10.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("input.L1.powerfactor", 0, 0.01, ".1.3.6.1.4.1.2011.6.174.1.3.100.1.8.1", NULL, SU_FLAG_OK, NULL), + snmp_info_default("input.L2.powerfactor", 0, 0.01, ".1.3.6.1.4.1.2011.6.174.1.3.100.1.9.1", NULL, SU_FLAG_OK, NULL), + snmp_info_default("input.L3.powerfactor", 0, 0.01, ".1.3.6.1.4.1.2011.6.174.1.3.100.1.10.1", NULL, SU_FLAG_OK, NULL), - { "input.bypass.L1-N.voltage", 0, 0.1, ".1.3.6.1.4.1.2011.6.174.1.5.100.1.1.1", NULL, SU_FLAG_OK, NULL }, - { "input.bypass.L2-N.voltage", 0, 0.1, ".1.3.6.1.4.1.2011.6.174.1.5.100.1.2.1", NULL, SU_FLAG_OK, NULL }, - { "input.bypass.L3-N.voltage", 0, 0.1, ".1.3.6.1.4.1.2011.6.174.1.5.100.1.3.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("input.bypass.L1-N.voltage", 0, 0.1, ".1.3.6.1.4.1.2011.6.174.1.5.100.1.1.1", NULL, SU_FLAG_OK, NULL), + snmp_info_default("input.bypass.L2-N.voltage", 0, 0.1, ".1.3.6.1.4.1.2011.6.174.1.5.100.1.2.1", NULL, SU_FLAG_OK, NULL), + snmp_info_default("input.bypass.L3-N.voltage", 0, 0.1, ".1.3.6.1.4.1.2011.6.174.1.5.100.1.3.1", NULL, SU_FLAG_OK, NULL), - { "input.bypass.frequency", 0, 0.01, ".1.3.6.1.4.1.2011.6.174.1.5.100.1.4.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("input.bypass.frequency", 0, 0.01, ".1.3.6.1.4.1.2011.6.174.1.5.100.1.4.1", NULL, SU_FLAG_OK, NULL), /* Output page */ /* hwUpsCtrlOutputStandard listed in MIB but not present on tested UPS5000-E */ - { "output.phases", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.2011.6.174.1.102.100.1.9", "3", SU_FLAG_ABSENT | SU_FLAG_OK, huawei_phase_info }, + snmp_info_default("output.phases", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.2011.6.174.1.102.100.1.9", "3", SU_FLAG_ABSENT | SU_FLAG_OK, huawei_phase_info), - { "output.L1-N.voltage", 0, 0.1, ".1.3.6.1.4.1.2011.6.174.1.4.100.1.1.1", NULL, SU_FLAG_OK, NULL }, - { "output.L2-N.voltage", 0, 0.1, ".1.3.6.1.4.1.2011.6.174.1.4.100.1.2.1", NULL, SU_FLAG_OK, NULL }, - { "output.L3-N.voltage", 0, 0.1, ".1.3.6.1.4.1.2011.6.174.1.4.100.1.3.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("output.L1-N.voltage", 0, 0.1, ".1.3.6.1.4.1.2011.6.174.1.4.100.1.1.1", NULL, SU_FLAG_OK, NULL), + snmp_info_default("output.L2-N.voltage", 0, 0.1, ".1.3.6.1.4.1.2011.6.174.1.4.100.1.2.1", NULL, SU_FLAG_OK, NULL), + snmp_info_default("output.L3-N.voltage", 0, 0.1, ".1.3.6.1.4.1.2011.6.174.1.4.100.1.3.1", NULL, SU_FLAG_OK, NULL), - { "output.L1.current", 0, 0.1, ".1.3.6.1.4.1.2011.6.174.1.4.100.1.4.1", NULL, SU_FLAG_OK, NULL }, - { "output.L2.current", 0, 0.1, ".1.3.6.1.4.1.2011.6.174.1.4.100.1.5.1", NULL, SU_FLAG_OK, NULL }, - { "output.L3.current", 0, 0.1, ".1.3.6.1.4.1.2011.6.174.1.4.100.1.6.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("output.L1.current", 0, 0.1, ".1.3.6.1.4.1.2011.6.174.1.4.100.1.4.1", NULL, SU_FLAG_OK, NULL), + snmp_info_default("output.L2.current", 0, 0.1, ".1.3.6.1.4.1.2011.6.174.1.4.100.1.5.1", NULL, SU_FLAG_OK, NULL), + snmp_info_default("output.L3.current", 0, 0.1, ".1.3.6.1.4.1.2011.6.174.1.4.100.1.6.1", NULL, SU_FLAG_OK, NULL), - { "output.frequency", 0, 0.01, ".1.3.6.1.4.1.2011.6.174.1.4.100.1.7.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("output.frequency", 0, 0.01, ".1.3.6.1.4.1.2011.6.174.1.4.100.1.7.1", NULL, SU_FLAG_OK, NULL), - { "output.L1.realpower", 0, 0.1, ".1.3.6.1.4.1.2011.6.174.1.4.100.1.8.1", NULL, SU_FLAG_OK, NULL }, - { "output.L1.realpower", 0, 0.1, ".1.3.6.1.4.1.2011.6.174.1.4.100.1.9.1", NULL, SU_FLAG_OK, NULL }, - { "output.L1.realpower", 0, 0.1, ".1.3.6.1.4.1.2011.6.174.1.4.100.1.10.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("output.L1.realpower", 0, 0.1, ".1.3.6.1.4.1.2011.6.174.1.4.100.1.8.1", NULL, SU_FLAG_OK, NULL), + snmp_info_default("output.L1.realpower", 0, 0.1, ".1.3.6.1.4.1.2011.6.174.1.4.100.1.9.1", NULL, SU_FLAG_OK, NULL), + snmp_info_default("output.L1.realpower", 0, 0.1, ".1.3.6.1.4.1.2011.6.174.1.4.100.1.10.1", NULL, SU_FLAG_OK, NULL), - { "output.L1.power", 0, 0.1, ".1.3.6.1.4.1.2011.6.174.1.4.100.1.11.1", NULL, SU_FLAG_OK, NULL }, - { "output.L2.power", 0, 0.1, ".1.3.6.1.4.1.2011.6.174.1.4.100.1.12.1", NULL, SU_FLAG_OK, NULL }, - { "output.L3.power", 0, 0.1, ".1.3.6.1.4.1.2011.6.174.1.4.100.1.13.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("output.L1.power", 0, 0.1, ".1.3.6.1.4.1.2011.6.174.1.4.100.1.11.1", NULL, SU_FLAG_OK, NULL), + snmp_info_default("output.L2.power", 0, 0.1, ".1.3.6.1.4.1.2011.6.174.1.4.100.1.12.1", NULL, SU_FLAG_OK, NULL), + snmp_info_default("output.L3.power", 0, 0.1, ".1.3.6.1.4.1.2011.6.174.1.4.100.1.13.1", NULL, SU_FLAG_OK, NULL), - { "output.L1.power.percent", 0, 0.1, ".1.3.6.1.4.1.2011.6.174.1.4.100.1.14.1", NULL, SU_FLAG_OK, NULL }, - { "output.L2.power.percent", 0, 0.1, ".1.3.6.1.4.1.2011.6.174.1.4.100.1.15.1", NULL, SU_FLAG_OK, NULL }, - { "output.L3.power.percent", 0, 0.1, ".1.3.6.1.4.1.2011.6.174.1.4.100.1.16.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("output.L1.power.percent", 0, 0.1, ".1.3.6.1.4.1.2011.6.174.1.4.100.1.14.1", NULL, SU_FLAG_OK, NULL), + snmp_info_default("output.L2.power.percent", 0, 0.1, ".1.3.6.1.4.1.2011.6.174.1.4.100.1.15.1", NULL, SU_FLAG_OK, NULL), + snmp_info_default("output.L3.power.percent", 0, 0.1, ".1.3.6.1.4.1.2011.6.174.1.4.100.1.16.1", NULL, SU_FLAG_OK, NULL), - { "output.voltage.nominal", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.2011.6.174.1.4.100.1.17.1", NULL, SU_FLAG_STATIC | SU_FLAG_OK, huawei_voltrating_info }, - { "output.frequency.nominal", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.2011.6.174.1.4.100.1.18.1", NULL, SU_FLAG_STATIC | SU_FLAG_OK, huawei_freqrating_info }, - { "output.power.nominal", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.2011.6.174.1.2.100.1.6.1", NULL, SU_FLAG_STATIC | SU_FLAG_OK, huawei_pwrrating_info }, + snmp_info_default("output.voltage.nominal", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.2011.6.174.1.4.100.1.17.1", NULL, SU_FLAG_STATIC | SU_FLAG_OK, huawei_voltrating_info), + snmp_info_default("output.frequency.nominal", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.2011.6.174.1.4.100.1.18.1", NULL, SU_FLAG_STATIC | SU_FLAG_OK, huawei_freqrating_info), + snmp_info_default("output.power.nominal", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.2011.6.174.1.2.100.1.6.1", NULL, SU_FLAG_STATIC | SU_FLAG_OK, huawei_pwrrating_info), - { "output.L1.powerfactor", 0, 0.01, ".1.3.6.1.4.1.2011.6.174.1.4.100.1.19.1", NULL, SU_FLAG_OK, NULL }, - { "output.L2.powerfactor", 0, 0.01, ".1.3.6.1.4.1.2011.6.174.1.4.100.1.20.1", NULL, SU_FLAG_OK, NULL }, - { "output.L2.powerfactor", 0, 0.01, ".1.3.6.1.4.1.2011.6.174.1.4.100.1.21.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("output.L1.powerfactor", 0, 0.01, ".1.3.6.1.4.1.2011.6.174.1.4.100.1.19.1", NULL, SU_FLAG_OK, NULL), + snmp_info_default("output.L2.powerfactor", 0, 0.01, ".1.3.6.1.4.1.2011.6.174.1.4.100.1.20.1", NULL, SU_FLAG_OK, NULL), + snmp_info_default("output.L2.powerfactor", 0, 0.01, ".1.3.6.1.4.1.2011.6.174.1.4.100.1.21.1", NULL, SU_FLAG_OK, NULL), /* Battery page */ - { "battery.voltage", 0, 0.1, ".1.3.6.1.4.1.2011.6.174.1.6.100.1.1.1", NULL, SU_FLAG_OK, NULL }, - { "battery.current", 0, 0.1, ".1.3.6.1.4.1.2011.6.174.1.6.100.1.2.1", NULL, SU_FLAG_OK, NULL }, - { "battery.charge", 0, 1, ".1.3.6.1.4.1.2011.6.174.1.6.100.1.3.1", NULL, SU_FLAG_OK, NULL }, - { "battery.runtime", 0, 1, ".1.3.6.1.4.1.2011.6.174.1.6.100.1.4.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("battery.voltage", 0, 0.1, ".1.3.6.1.4.1.2011.6.174.1.6.100.1.1.1", NULL, SU_FLAG_OK, NULL), + snmp_info_default("battery.current", 0, 0.1, ".1.3.6.1.4.1.2011.6.174.1.6.100.1.2.1", NULL, SU_FLAG_OK, NULL), + snmp_info_default("battery.charge", 0, 1, ".1.3.6.1.4.1.2011.6.174.1.6.100.1.3.1", NULL, SU_FLAG_OK, NULL), + snmp_info_default("battery.runtime", 0, 1, ".1.3.6.1.4.1.2011.6.174.1.6.100.1.4.1", NULL, SU_FLAG_OK, NULL), #if WITH_UNMAPPED_DATA_POINTS - { "unmapped.hwUpsBattTest", 0, 1, ".1.3.6.1.4.1.2011.6.174.1.103.101.1.6.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.hwUpsBattTest", 0, 1, ".1.3.6.1.4.1.2011.6.174.1.103.101.1.6.1", NULL, SU_FLAG_OK, NULL), #endif /* if WITH_UNMAPPED_DATA_POINTS */ /* end of structure. */ - { NULL, 0, 0, NULL, NULL, 0, NULL } + snmp_info_sentinel }; mib2nut_info_t huawei = { "huawei", HUAWEI_MIB_VERSION, NULL, HUAWEI_OID_MODEL_NAME, huawei_mib, HUAWEI_SYSOID, NULL }; diff --git a/drivers/ietf-mib.c b/drivers/ietf-mib.c index afcc63151a..7ab83effad 100644 --- a/drivers/ietf-mib.c +++ b/drivers/ietf-mib.c @@ -46,249 +46,249 @@ /* #define DEBUG */ static info_lkp_t ietf_battery_info[] = { - { 1, "" /* unknown */, NULL, NULL }, - { 2, "" /* batteryNormal */, NULL, NULL }, - { 3, "LB" /* batteryLow */, NULL, NULL }, - { 4, "LB" /* batteryDepleted */, NULL, NULL }, - { 0, NULL, NULL, NULL } + info_lkp_default(1, ""), /* unknown */ + info_lkp_default(2, ""), /* batteryNormal */ + info_lkp_default(3, "LB"), /* batteryLow */ + info_lkp_default(4, "LB"), /* batteryDepleted */ + info_lkp_sentinel }; static info_lkp_t ietf_power_source_info[] = { - { 1, "" /* other */, NULL, NULL }, - { 2, "OFF" /* none */, NULL, NULL }, - { 3, "OL" /* normal */, NULL, NULL }, - { 4, "OL BYPASS" /* bypass */, NULL, NULL }, - { 5, "OB" /* battery */, NULL, NULL }, - { 6, "OL BOOST" /* booster */, NULL, NULL }, - { 7, "OL TRIM" /* reducer */, NULL, NULL }, - { 0, NULL, NULL, NULL } + info_lkp_default(1, ""), /* other */ + info_lkp_default(2, "OFF"), /* none */ + info_lkp_default(3, "OL"), /* normal */ + info_lkp_default(4, "OL BYPASS"), /* bypass */ + info_lkp_default(5, "OB"), /* battery */ + info_lkp_default(6, "OL BOOST"), /* booster */ + info_lkp_default(7, "OL TRIM"), /* reducer */ + info_lkp_sentinel }; static info_lkp_t ietf_overload_info[] = { - { 1, "OVER", NULL, NULL }, /* output overload */ - { 0, NULL, NULL, NULL } + info_lkp_default(1, "OVER"), /* output overload */ + info_lkp_sentinel }; static info_lkp_t ietf_test_active_info[] = { - { 1, "", NULL, NULL }, /* upsTestNoTestsInitiated */ - { 2, "", NULL, NULL }, /* upsTestAbortTestInProgress */ - { 3, "TEST", NULL, NULL }, /* upsTestGeneralSystemsTest */ - { 4, "TEST", NULL, NULL }, /* upsTestQuickBatteryTest */ - { 5, "CAL", NULL, NULL }, /* upsTestDeepBatteryCalibration */ - { 0, NULL, NULL, NULL } + info_lkp_default(1, ""), /* upsTestNoTestsInitiated */ + info_lkp_default(2, ""), /* upsTestAbortTestInProgress */ + info_lkp_default(3, "TEST"), /* upsTestGeneralSystemsTest */ + info_lkp_default(4, "TEST"), /* upsTestQuickBatteryTest */ + info_lkp_default(5, "CAL"), /* upsTestDeepBatteryCalibration */ + info_lkp_sentinel }; static info_lkp_t ietf_test_result_info[] = { - { 1, "done and passed", NULL, NULL }, - { 2, "done and warning", NULL, NULL }, - { 3, "done and error", NULL, NULL }, - { 4, "aborted", NULL, NULL }, - { 5, "in progress", NULL, NULL }, - { 6, "no test initiated", NULL, NULL }, - { 0, NULL, NULL, NULL } + info_lkp_default(1, "done and passed"), + info_lkp_default(2, "done and warning"), + info_lkp_default(3, "done and error"), + info_lkp_default(4, "aborted"), + info_lkp_default(5, "in progress"), + info_lkp_default(6, "no test initiated"), + info_lkp_sentinel }; #ifdef DEBUG static info_lkp_t ietf_shutdown_type_info[] = { - { 1, "output", NULL, NULL }, - { 2, "system", NULL, NULL }, - { 0, NULL, NULL, NULL } + info_lkp_default(1, "output"), + info_lkp_default(2, "system"), + info_lkp_sentinel }; #endif static info_lkp_t ietf_yes_no_info[] = { - { 1, "yes", NULL, NULL }, - { 2, "no", NULL, NULL }, - { 0, NULL, NULL, NULL } + info_lkp_default(1, "yes"), + info_lkp_default(2, "no"), + info_lkp_sentinel }; static info_lkp_t ietf_beeper_status_info[] = { - { 1, "disabled", NULL, NULL }, - { 2, "enabled", NULL, NULL }, - { 3, "muted", NULL, NULL }, - { 0, NULL, NULL, NULL } + info_lkp_default(1, "disabled"), + info_lkp_default(2, "enabled"), + info_lkp_default(3, "muted"), + info_lkp_sentinel }; /* Snmp2NUT lookup table info_type, info_flags, info_len, OID, dfl, flags, oid2info, setvar */ static snmp_info_t ietf_mib[] = { /* standard MIB items */ - { "device.description", ST_FLAG_STRING | ST_FLAG_RW, SU_INFOSIZE, ".1.3.6.1.2.1.1.1.0", NULL, SU_FLAG_OK, NULL }, - { "device.contact", ST_FLAG_STRING | ST_FLAG_RW, SU_INFOSIZE, ".1.3.6.1.2.1.1.4.0", NULL, SU_FLAG_OK, NULL }, - { "device.location", ST_FLAG_STRING | ST_FLAG_RW, SU_INFOSIZE, ".1.3.6.1.2.1.1.6.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("device.description", ST_FLAG_STRING | ST_FLAG_RW, SU_INFOSIZE, ".1.3.6.1.2.1.1.1.0", NULL, SU_FLAG_OK, NULL), + snmp_info_default("device.contact", ST_FLAG_STRING | ST_FLAG_RW, SU_INFOSIZE, ".1.3.6.1.2.1.1.4.0", NULL, SU_FLAG_OK, NULL), + snmp_info_default("device.location", ST_FLAG_STRING | ST_FLAG_RW, SU_INFOSIZE, ".1.3.6.1.2.1.1.6.0", NULL, SU_FLAG_OK, NULL), /* The Device Identification group */ - { "ups.mfr", ST_FLAG_STRING, SU_INFOSIZE, IETF_OID_UPS_MIB "1.1.0", "Generic", SU_FLAG_STATIC, NULL }, /* upsIdentManufacturer */ - { "ups.model", ST_FLAG_STRING, SU_INFOSIZE, IETF_OID_UPS_MIB "1.2.0", "Generic SNMP UPS", SU_FLAG_STATIC, NULL }, /* upsIdentModel */ - { "ups.firmware", ST_FLAG_STRING, SU_INFOSIZE, IETF_OID_UPS_MIB "1.3.0", "", SU_FLAG_STATIC, NULL }, /* upsIdentUPSSoftwareVersion */ - { "ups.firmware.aux", ST_FLAG_STRING, SU_INFOSIZE, IETF_OID_UPS_MIB "1.4.0", "", SU_FLAG_STATIC, NULL }, /* upsIdentAgentSoftwareVersion */ + snmp_info_default("ups.mfr", ST_FLAG_STRING, SU_INFOSIZE, IETF_OID_UPS_MIB "1.1.0", "Generic", SU_FLAG_STATIC, NULL), /* upsIdentManufacturer */ + snmp_info_default("ups.model", ST_FLAG_STRING, SU_INFOSIZE, IETF_OID_UPS_MIB "1.2.0", "Generic SNMP UPS", SU_FLAG_STATIC, NULL), /* upsIdentModel */ + snmp_info_default("ups.firmware", ST_FLAG_STRING, SU_INFOSIZE, IETF_OID_UPS_MIB "1.3.0", "", SU_FLAG_STATIC, NULL), /* upsIdentUPSSoftwareVersion */ + snmp_info_default("ups.firmware.aux", ST_FLAG_STRING, SU_INFOSIZE, IETF_OID_UPS_MIB "1.4.0", "", SU_FLAG_STATIC, NULL), /* upsIdentAgentSoftwareVersion */ #ifdef DEBUG - { "debug.upsIdentName", ST_FLAG_STRING, SU_INFOSIZE, IETF_OID_UPS_MIB "1.5.0", "", 0, NULL }, /* upsIdentName */ - { "debug.upsIdentAttachedDevices", ST_FLAG_STRING, SU_INFOSIZE, IETF_OID_UPS_MIB "1.6.0", "", 0, NULL }, /* upsIdentAttachedDevices */ + snmp_info_default("debug.upsIdentName", ST_FLAG_STRING, SU_INFOSIZE, IETF_OID_UPS_MIB "1.5.0", "", 0, NULL), /* upsIdentName */ + snmp_info_default("debug.upsIdentAttachedDevices", ST_FLAG_STRING, SU_INFOSIZE, IETF_OID_UPS_MIB "1.6.0", "", 0, NULL), /* upsIdentAttachedDevices */ #endif /* Battery Group */ - { "ups.status", ST_FLAG_STRING, SU_INFOSIZE, IETF_OID_UPS_MIB "2.1.0", "", SU_STATUS_BATT, ietf_battery_info }, /* upsBatteryStatus */ + snmp_info_default("ups.status", ST_FLAG_STRING, SU_INFOSIZE, IETF_OID_UPS_MIB "2.1.0", "", SU_STATUS_BATT, ietf_battery_info), /* upsBatteryStatus */ #ifdef DEBUG - { "debug.upsSecondsOnBattery", 0, 1.0, IETF_OID_UPS_MIB "2.2.0", "", 0, NULL }, /* upsSecondsOnBattery */ + snmp_info_default("debug.upsSecondsOnBattery", 0, 1.0, IETF_OID_UPS_MIB "2.2.0", "", 0, NULL), /* upsSecondsOnBattery */ #endif - { "battery.runtime", 0, 60.0, IETF_OID_UPS_MIB "2.3.0", "", 0, NULL }, /* upsEstimatedMinutesRemaining */ - { "battery.charge", 0, 1, IETF_OID_UPS_MIB "2.4.0", "", 0, NULL }, /* upsEstimatedChargeRemaining */ - { "battery.voltage", 0, 0.1, IETF_OID_UPS_MIB "2.5.0", "", 0, NULL }, /* upsBatteryVoltage */ - { "battery.current", 0, 0.1, IETF_OID_UPS_MIB "2.6.0", "", SU_FLAG_NEGINVALID, NULL }, /* upsBatteryCurrent */ - { "battery.temperature", 0, 1.0, IETF_OID_UPS_MIB "2.7.0", "", 0, NULL }, /* upsBatteryTemperature */ + snmp_info_default("battery.runtime", 0, 60.0, IETF_OID_UPS_MIB "2.3.0", "", 0, NULL), /* upsEstimatedMinutesRemaining */ + snmp_info_default("battery.charge", 0, 1, IETF_OID_UPS_MIB "2.4.0", "", 0, NULL), /* upsEstimatedChargeRemaining */ + snmp_info_default("battery.voltage", 0, 0.1, IETF_OID_UPS_MIB "2.5.0", "", 0, NULL), /* upsBatteryVoltage */ + snmp_info_default("battery.current", 0, 0.1, IETF_OID_UPS_MIB "2.6.0", "", SU_FLAG_NEGINVALID, NULL), /* upsBatteryCurrent */ + snmp_info_default("battery.temperature", 0, 1.0, IETF_OID_UPS_MIB "2.7.0", "", 0, NULL), /* upsBatteryTemperature */ /* Input Group */ #ifdef DEBUG - { "debug.upsInputLineBads", 0, 1.0, IETF_OID_UPS_MIB "3.1.0", "", 0, NULL }, /* upsInputLineBads */ + snmp_info_default("debug.upsInputLineBads", 0, 1.0, IETF_OID_UPS_MIB "3.1.0", "", 0, NULL), /* upsInputLineBads */ #endif - { "input.phases", 0, 1.0, IETF_OID_UPS_MIB "3.2.0", "", 0, NULL }, /* upsInputNumLines */ + snmp_info_default("input.phases", 0, 1.0, IETF_OID_UPS_MIB "3.2.0", "", 0, NULL), /* upsInputNumLines */ #ifdef DEBUG - { "debug.upsInputLineIndex", 0, 1.0, IETF_OID_UPS_MIB "3.3.1.1.1", "", SU_INPUT_1, NULL }, /* upsInputLineIndex */ - { "debug.[1].upsInputLineIndex", 0, 1.0, IETF_OID_UPS_MIB "3.3.1.1.1", "", SU_INPUT_3, NULL }, - { "debug.[2].upsInputLineIndex", 0, 1.0, IETF_OID_UPS_MIB "3.3.1.1.2", "", SU_INPUT_3, NULL }, - { "debug.[3].upsInputLineIndex", 0, 1.0, IETF_OID_UPS_MIB "3.3.1.1.3", "", SU_INPUT_3, NULL }, + snmp_info_default("debug.upsInputLineIndex", 0, 1.0, IETF_OID_UPS_MIB "3.3.1.1.1", "", SU_INPUT_1, NULL), /* upsInputLineIndex */ + snmp_info_default("debug.[1].upsInputLineIndex", 0, 1.0, IETF_OID_UPS_MIB "3.3.1.1.1", "", SU_INPUT_3, NULL), + snmp_info_default("debug.[2].upsInputLineIndex", 0, 1.0, IETF_OID_UPS_MIB "3.3.1.1.2", "", SU_INPUT_3, NULL), + snmp_info_default("debug.[3].upsInputLineIndex", 0, 1.0, IETF_OID_UPS_MIB "3.3.1.1.3", "", SU_INPUT_3, NULL), #endif - { "input.frequency", 0, 0.1, IETF_OID_UPS_MIB "3.3.1.2.1", "", SU_INPUT_1, NULL }, /* upsInputFrequency */ - { "input.L1.frequency", 0, 0.1, IETF_OID_UPS_MIB "3.3.1.2.1", "", SU_INPUT_3, NULL }, - { "input.L2.frequency", 0, 0.1, IETF_OID_UPS_MIB "3.3.1.2.2", "", SU_INPUT_3, NULL }, - { "input.L3.frequency", 0, 0.1, IETF_OID_UPS_MIB "3.3.1.2.3", "", SU_INPUT_3, NULL }, - { "input.voltage", 0, 1.0, IETF_OID_UPS_MIB "3.3.1.3.1", "", SU_INPUT_1, NULL }, /* upsInputVoltage */ - { "input.L1-N.voltage", 0, 1.0, IETF_OID_UPS_MIB "3.3.1.3.1", "", SU_INPUT_3, NULL }, - { "input.L2-N.voltage", 0, 1.0, IETF_OID_UPS_MIB "3.3.1.3.2", "", SU_INPUT_3, NULL }, - { "input.L3-N.voltage", 0, 1.0, IETF_OID_UPS_MIB "3.3.1.3.3", "", SU_INPUT_3, NULL }, - { "input.current", 0, 0.1, IETF_OID_UPS_MIB "3.3.1.4.1", "", SU_INPUT_1 |SU_FLAG_NEGINVALID, NULL }, /* upsInputCurrent */ - { "input.L1.current", 0, 0.1, IETF_OID_UPS_MIB "3.3.1.4.1", "", SU_INPUT_3, NULL }, - { "input.L2.current", 0, 0.1, IETF_OID_UPS_MIB "3.3.1.4.2", "", SU_INPUT_3, NULL }, - { "input.L3.current", 0, 0.1, IETF_OID_UPS_MIB "3.3.1.4.3", "", SU_INPUT_3, NULL }, - { "input.realpower", 0, 1.0, IETF_OID_UPS_MIB "3.3.1.5.1", "", SU_INPUT_1 | SU_FLAG_NEGINVALID, NULL }, /* upsInputTruePower */ - { "input.L1.realpower", 0, 1.0, IETF_OID_UPS_MIB "3.3.1.5.1", "", SU_INPUT_3, NULL }, - { "input.L2.realpower", 0, 1.0, IETF_OID_UPS_MIB "3.3.1.5.2", "", SU_INPUT_3, NULL }, - { "input.L3.realpower", 0, 1.0, IETF_OID_UPS_MIB "3.3.1.5.3", "", SU_INPUT_3, NULL }, + snmp_info_default("input.frequency", 0, 0.1, IETF_OID_UPS_MIB "3.3.1.2.1", "", SU_INPUT_1, NULL), /* upsInputFrequency */ + snmp_info_default("input.L1.frequency", 0, 0.1, IETF_OID_UPS_MIB "3.3.1.2.1", "", SU_INPUT_3, NULL), + snmp_info_default("input.L2.frequency", 0, 0.1, IETF_OID_UPS_MIB "3.3.1.2.2", "", SU_INPUT_3, NULL), + snmp_info_default("input.L3.frequency", 0, 0.1, IETF_OID_UPS_MIB "3.3.1.2.3", "", SU_INPUT_3, NULL), + snmp_info_default("input.voltage", 0, 1.0, IETF_OID_UPS_MIB "3.3.1.3.1", "", SU_INPUT_1, NULL), /* upsInputVoltage */ + snmp_info_default("input.L1-N.voltage", 0, 1.0, IETF_OID_UPS_MIB "3.3.1.3.1", "", SU_INPUT_3, NULL), + snmp_info_default("input.L2-N.voltage", 0, 1.0, IETF_OID_UPS_MIB "3.3.1.3.2", "", SU_INPUT_3, NULL), + snmp_info_default("input.L3-N.voltage", 0, 1.0, IETF_OID_UPS_MIB "3.3.1.3.3", "", SU_INPUT_3, NULL), + snmp_info_default("input.current", 0, 0.1, IETF_OID_UPS_MIB "3.3.1.4.1", "", SU_INPUT_1 |SU_FLAG_NEGINVALID, NULL), /* upsInputCurrent */ + snmp_info_default("input.L1.current", 0, 0.1, IETF_OID_UPS_MIB "3.3.1.4.1", "", SU_INPUT_3, NULL), + snmp_info_default("input.L2.current", 0, 0.1, IETF_OID_UPS_MIB "3.3.1.4.2", "", SU_INPUT_3, NULL), + snmp_info_default("input.L3.current", 0, 0.1, IETF_OID_UPS_MIB "3.3.1.4.3", "", SU_INPUT_3, NULL), + snmp_info_default("input.realpower", 0, 1.0, IETF_OID_UPS_MIB "3.3.1.5.1", "", SU_INPUT_1 | SU_FLAG_NEGINVALID, NULL), /* upsInputTruePower */ + snmp_info_default("input.L1.realpower", 0, 1.0, IETF_OID_UPS_MIB "3.3.1.5.1", "", SU_INPUT_3, NULL), + snmp_info_default("input.L2.realpower", 0, 1.0, IETF_OID_UPS_MIB "3.3.1.5.2", "", SU_INPUT_3, NULL), + snmp_info_default("input.L3.realpower", 0, 1.0, IETF_OID_UPS_MIB "3.3.1.5.3", "", SU_INPUT_3, NULL), /* Output Group */ - { "ups.status", ST_FLAG_STRING, SU_INFOSIZE, IETF_OID_UPS_MIB "4.1.0", "", SU_STATUS_PWR, ietf_power_source_info }, /* upsOutputSource */ - { "output.frequency", 0, 0.1, IETF_OID_UPS_MIB "4.2.0", "", 0, NULL }, /* upsOutputFrequency */ - { "output.phases", 0, 1.0, IETF_OID_UPS_MIB "4.3.0", "", 0, NULL }, /* upsOutputNumLines */ + snmp_info_default("ups.status", ST_FLAG_STRING, SU_INFOSIZE, IETF_OID_UPS_MIB "4.1.0", "", SU_STATUS_PWR, ietf_power_source_info), /* upsOutputSource */ + snmp_info_default("output.frequency", 0, 0.1, IETF_OID_UPS_MIB "4.2.0", "", 0, NULL), /* upsOutputFrequency */ + snmp_info_default("output.phases", 0, 1.0, IETF_OID_UPS_MIB "4.3.0", "", 0, NULL), /* upsOutputNumLines */ #ifdef DEBUG - { "debug.upsOutputLineIndex", 0, 1.0, IETF_OID_UPS_MIB "4.4.1.1.1", "", SU_OUTPUT_1, NULL }, /* upsOutputLineIndex */ - { "debug.[1].upsOutputLineIndex", 0, 1.0, IETF_OID_UPS_MIB "4.4.1.1.1", "", SU_OUTPUT_3, NULL }, - { "debug.[2].upsOutputLineIndex", 0, 1.0, IETF_OID_UPS_MIB "4.4.1.1.2", "", SU_OUTPUT_3, NULL }, - { "debug.[3].upsOutputLineIndex", 0, 1.0, IETF_OID_UPS_MIB "4.4.1.1.3", "", SU_OUTPUT_3, NULL }, + snmp_info_default("debug.upsOutputLineIndex", 0, 1.0, IETF_OID_UPS_MIB "4.4.1.1.1", "", SU_OUTPUT_1, NULL), /* upsOutputLineIndex */ + snmp_info_default("debug.[1].upsOutputLineIndex", 0, 1.0, IETF_OID_UPS_MIB "4.4.1.1.1", "", SU_OUTPUT_3, NULL), + snmp_info_default("debug.[2].upsOutputLineIndex", 0, 1.0, IETF_OID_UPS_MIB "4.4.1.1.2", "", SU_OUTPUT_3, NULL), + snmp_info_default("debug.[3].upsOutputLineIndex", 0, 1.0, IETF_OID_UPS_MIB "4.4.1.1.3", "", SU_OUTPUT_3, NULL), #endif - { "output.voltage", 0, 1.0, IETF_OID_UPS_MIB "4.4.1.2.1", "", SU_OUTPUT_1, NULL }, /* upsOutputVoltage */ - { "output.L1-N.voltage", 0, 1.0, IETF_OID_UPS_MIB "4.4.1.2.1", "", SU_OUTPUT_3, NULL }, - { "output.L2-N.voltage", 0, 1.0, IETF_OID_UPS_MIB "4.4.1.2.2", "", SU_OUTPUT_3, NULL }, - { "output.L3-N.voltage", 0, 1.0, IETF_OID_UPS_MIB "4.4.1.2.3", "", SU_OUTPUT_3, NULL }, - { "output.current", 0, 0.1, IETF_OID_UPS_MIB "4.4.1.3.1", "", SU_OUTPUT_1 | SU_FLAG_NEGINVALID, NULL }, /* upsOutputCurrent */ - { "output.L1.current", 0, 0.1, IETF_OID_UPS_MIB "4.4.1.3.1", "", SU_OUTPUT_3, NULL }, - { "output.L2.current", 0, 0.1, IETF_OID_UPS_MIB "4.4.1.3.2", "", SU_OUTPUT_3, NULL }, - { "output.L3.current", 0, 0.1, IETF_OID_UPS_MIB "4.4.1.3.3", "", SU_OUTPUT_3, NULL }, - { "output.realpower", 0, 1.0, IETF_OID_UPS_MIB "4.4.1.4.1", "", SU_OUTPUT_1 | SU_FLAG_NEGINVALID, NULL }, /* upsOutputPower */ - { "output.L1.realpower", 0, 1.0, IETF_OID_UPS_MIB "4.4.1.4.1", "", SU_OUTPUT_3, NULL }, - { "output.L2.realpower", 0, 1.0, IETF_OID_UPS_MIB "4.4.1.4.2", "", SU_OUTPUT_3, NULL }, - { "output.L3.realpower", 0, 1.0, IETF_OID_UPS_MIB "4.4.1.4.3", "", SU_OUTPUT_3, NULL }, - { "ups.load", 0, 1.0, IETF_OID_UPS_MIB "4.4.1.5.1", "", SU_OUTPUT_1, NULL }, /* upsOutputPercentLoad */ - { "output.L1.power.percent", 0, 1.0, IETF_OID_UPS_MIB "4.4.1.5.1", "", SU_OUTPUT_3, NULL }, - { "output.L2.power.percent", 0, 1.0, IETF_OID_UPS_MIB "4.4.1.5.2", "", SU_OUTPUT_3, NULL }, - { "output.L3.power.percent", 0, 1.0, IETF_OID_UPS_MIB "4.4.1.5.3", "", SU_OUTPUT_3, NULL }, + snmp_info_default("output.voltage", 0, 1.0, IETF_OID_UPS_MIB "4.4.1.2.1", "", SU_OUTPUT_1, NULL), /* upsOutputVoltage */ + snmp_info_default("output.L1-N.voltage", 0, 1.0, IETF_OID_UPS_MIB "4.4.1.2.1", "", SU_OUTPUT_3, NULL), + snmp_info_default("output.L2-N.voltage", 0, 1.0, IETF_OID_UPS_MIB "4.4.1.2.2", "", SU_OUTPUT_3, NULL), + snmp_info_default("output.L3-N.voltage", 0, 1.0, IETF_OID_UPS_MIB "4.4.1.2.3", "", SU_OUTPUT_3, NULL), + snmp_info_default("output.current", 0, 0.1, IETF_OID_UPS_MIB "4.4.1.3.1", "", SU_OUTPUT_1 | SU_FLAG_NEGINVALID, NULL), /* upsOutputCurrent */ + snmp_info_default("output.L1.current", 0, 0.1, IETF_OID_UPS_MIB "4.4.1.3.1", "", SU_OUTPUT_3, NULL), + snmp_info_default("output.L2.current", 0, 0.1, IETF_OID_UPS_MIB "4.4.1.3.2", "", SU_OUTPUT_3, NULL), + snmp_info_default("output.L3.current", 0, 0.1, IETF_OID_UPS_MIB "4.4.1.3.3", "", SU_OUTPUT_3, NULL), + snmp_info_default("output.realpower", 0, 1.0, IETF_OID_UPS_MIB "4.4.1.4.1", "", SU_OUTPUT_1 | SU_FLAG_NEGINVALID, NULL), /* upsOutputPower */ + snmp_info_default("output.L1.realpower", 0, 1.0, IETF_OID_UPS_MIB "4.4.1.4.1", "", SU_OUTPUT_3, NULL), + snmp_info_default("output.L2.realpower", 0, 1.0, IETF_OID_UPS_MIB "4.4.1.4.2", "", SU_OUTPUT_3, NULL), + snmp_info_default("output.L3.realpower", 0, 1.0, IETF_OID_UPS_MIB "4.4.1.4.3", "", SU_OUTPUT_3, NULL), + snmp_info_default("ups.load", 0, 1.0, IETF_OID_UPS_MIB "4.4.1.5.1", "", SU_OUTPUT_1, NULL), /* upsOutputPercentLoad */ + snmp_info_default("output.L1.power.percent", 0, 1.0, IETF_OID_UPS_MIB "4.4.1.5.1", "", SU_OUTPUT_3, NULL), + snmp_info_default("output.L2.power.percent", 0, 1.0, IETF_OID_UPS_MIB "4.4.1.5.2", "", SU_OUTPUT_3, NULL), + snmp_info_default("output.L3.power.percent", 0, 1.0, IETF_OID_UPS_MIB "4.4.1.5.3", "", SU_OUTPUT_3, NULL), /* Bypass Group */ - { "input.bypass.phases", 0, 1.0, IETF_OID_UPS_MIB "5.2.0", "", SU_FLAG_NEGINVALID, NULL }, /* upsBypassNumLines */ - { "input.bypass.frequency", 0, 0.1, IETF_OID_UPS_MIB "5.1.0", "", SU_BYPASS_1 | SU_BYPASS_3 | SU_FLAG_NEGINVALID, NULL }, /* upsBypassFrequency */ + snmp_info_default("input.bypass.phases", 0, 1.0, IETF_OID_UPS_MIB "5.2.0", "", SU_FLAG_NEGINVALID, NULL), /* upsBypassNumLines */ + snmp_info_default("input.bypass.frequency", 0, 0.1, IETF_OID_UPS_MIB "5.1.0", "", SU_BYPASS_1 | SU_BYPASS_3 | SU_FLAG_NEGINVALID, NULL), /* upsBypassFrequency */ #ifdef DEBUG - { "debug.upsBypassLineIndex", 0, 1.0, IETF_OID_UPS_MIB "5.3.1.1.1", "", SU_BYPASS_1, NULL }, /* upsBypassLineIndex */ - { "debug.[1].upsBypassLineIndex", 0, 1.0, IETF_OID_UPS_MIB "5.3.1.1.1", "", SU_BYPASS_3, NULL }, - { "debug.[2].upsBypassLineIndex", 0, 1.0, IETF_OID_UPS_MIB "5.3.1.1.2", "", SU_BYPASS_3, NULL }, - { "debug.[3].upsBypassLineIndex", 0, 1.0, IETF_OID_UPS_MIB "5.3.1.1.3", "", SU_BYPASS_3, NULL }, + snmp_info_default("debug.upsBypassLineIndex", 0, 1.0, IETF_OID_UPS_MIB "5.3.1.1.1", "", SU_BYPASS_1, NULL), /* upsBypassLineIndex */ + snmp_info_default("debug.[1].upsBypassLineIndex", 0, 1.0, IETF_OID_UPS_MIB "5.3.1.1.1", "", SU_BYPASS_3, NULL), + snmp_info_default("debug.[2].upsBypassLineIndex", 0, 1.0, IETF_OID_UPS_MIB "5.3.1.1.2", "", SU_BYPASS_3, NULL), + snmp_info_default("debug.[3].upsBypassLineIndex", 0, 1.0, IETF_OID_UPS_MIB "5.3.1.1.3", "", SU_BYPASS_3, NULL), #endif - { "input.bypass.voltage", 0, 1.0, IETF_OID_UPS_MIB "5.3.1.2.1", "", SU_BYPASS_1, NULL }, /* upsBypassVoltage */ - { "input.bypass.L1-N.voltage", 0, 1.0, IETF_OID_UPS_MIB "5.3.1.2.1", "", SU_BYPASS_3, NULL }, - { "input.bypass.L2-N.voltage", 0, 1.0, IETF_OID_UPS_MIB "5.3.1.2.2", "", SU_BYPASS_3, NULL }, - { "input.bypass.L3-N.voltage", 0, 1.0, IETF_OID_UPS_MIB "5.3.1.2.3", "", SU_BYPASS_3, NULL }, - { "input.bypass.current", 0, 0.1, IETF_OID_UPS_MIB "5.3.1.3.1", "", SU_BYPASS_1, NULL }, /* upsBypassCurrent */ - { "input.bypass.L1.current", 0, 0.1, IETF_OID_UPS_MIB "5.3.1.3.1", "", SU_BYPASS_3, NULL }, - { "input.bypass.L2.current", 0, 0.1, IETF_OID_UPS_MIB "5.3.1.3.2", "", SU_BYPASS_3, NULL }, - { "input.bypass.L3.current", 0, 0.1, IETF_OID_UPS_MIB "5.3.1.3.3", "", SU_BYPASS_3, NULL }, - { "input.bypass.realpower", 0, 1.0, IETF_OID_UPS_MIB "5.3.1.4.1", "", SU_BYPASS_1, NULL }, /* upsBypassPower */ - { "input.bypass.L1.realpower", 0, 1.0, IETF_OID_UPS_MIB "5.3.1.4.1", "", SU_BYPASS_3, NULL }, - { "input.bypass.L2.realpower", 0, 1.0, IETF_OID_UPS_MIB "5.3.1.4.2", "", SU_BYPASS_3, NULL }, - { "input.bypass.L3.realpower", 0, 1.0, IETF_OID_UPS_MIB "5.3.1.4.3", "", SU_BYPASS_3, NULL }, + snmp_info_default("input.bypass.voltage", 0, 1.0, IETF_OID_UPS_MIB "5.3.1.2.1", "", SU_BYPASS_1, NULL), /* upsBypassVoltage */ + snmp_info_default("input.bypass.L1-N.voltage", 0, 1.0, IETF_OID_UPS_MIB "5.3.1.2.1", "", SU_BYPASS_3, NULL), + snmp_info_default("input.bypass.L2-N.voltage", 0, 1.0, IETF_OID_UPS_MIB "5.3.1.2.2", "", SU_BYPASS_3, NULL), + snmp_info_default("input.bypass.L3-N.voltage", 0, 1.0, IETF_OID_UPS_MIB "5.3.1.2.3", "", SU_BYPASS_3, NULL), + snmp_info_default("input.bypass.current", 0, 0.1, IETF_OID_UPS_MIB "5.3.1.3.1", "", SU_BYPASS_1, NULL), /* upsBypassCurrent */ + snmp_info_default("input.bypass.L1.current", 0, 0.1, IETF_OID_UPS_MIB "5.3.1.3.1", "", SU_BYPASS_3, NULL), + snmp_info_default("input.bypass.L2.current", 0, 0.1, IETF_OID_UPS_MIB "5.3.1.3.2", "", SU_BYPASS_3, NULL), + snmp_info_default("input.bypass.L3.current", 0, 0.1, IETF_OID_UPS_MIB "5.3.1.3.3", "", SU_BYPASS_3, NULL), + snmp_info_default("input.bypass.realpower", 0, 1.0, IETF_OID_UPS_MIB "5.3.1.4.1", "", SU_BYPASS_1, NULL), /* upsBypassPower */ + snmp_info_default("input.bypass.L1.realpower", 0, 1.0, IETF_OID_UPS_MIB "5.3.1.4.1", "", SU_BYPASS_3, NULL), + snmp_info_default("input.bypass.L2.realpower", 0, 1.0, IETF_OID_UPS_MIB "5.3.1.4.2", "", SU_BYPASS_3, NULL), + snmp_info_default("input.bypass.L3.realpower", 0, 1.0, IETF_OID_UPS_MIB "5.3.1.4.3", "", SU_BYPASS_3, NULL), /* Alarm Group */ #ifdef DEBUG - { "debug.upsAlarmsPresent", 0, 1.0, IETF_OID_UPS_MIB "6.1.0", "", 0, NULL }, /* upsAlarmsPresent */ - { "debug.upsAlarmBatteryBad", ST_FLAG_STRING, SU_INFOSIZE, IETF_OID_UPS_MIB "6.3.1", "", 0, NULL }, /* upsAlarmBatteryBad */ - { "debug.upsAlarmOnBattery", ST_FLAG_STRING, SU_INFOSIZE, IETF_OID_UPS_MIB "6.3.2", "", 0, NULL }, /* upsAlarmOnBattery */ - { "debug.upsAlarmLowBattery", ST_FLAG_STRING, SU_INFOSIZE, IETF_OID_UPS_MIB "6.3.3", "", 0, NULL }, /* upsAlarmLowBattery */ - { "debug.upsAlarmDepletedBattery", ST_FLAG_STRING, SU_INFOSIZE, IETF_OID_UPS_MIB "6.3.4", "", 0, NULL }, /* upsAlarmDepletedBattery */ - { "debug.upsAlarmTempBad", ST_FLAG_STRING, SU_INFOSIZE, IETF_OID_UPS_MIB "6.3.5", "", 0, NULL }, /* upsAlarmTempBad */ - { "debug.upsAlarmInputBad", ST_FLAG_STRING, SU_INFOSIZE, IETF_OID_UPS_MIB "6.3.6", "", 0, NULL }, /* upsAlarmInputBad */ - { "debug.upsAlarmOutputBad", ST_FLAG_STRING, SU_INFOSIZE, IETF_OID_UPS_MIB "6.3.7", "", 0, NULL }, /* upsAlarmOutputBad */ + snmp_info_default("debug.upsAlarmsPresent", 0, 1.0, IETF_OID_UPS_MIB "6.1.0", "", 0, NULL), /* upsAlarmsPresent */ + snmp_info_default("debug.upsAlarmBatteryBad", ST_FLAG_STRING, SU_INFOSIZE, IETF_OID_UPS_MIB "6.3.1", "", 0, NULL), /* upsAlarmBatteryBad */ + snmp_info_default("debug.upsAlarmOnBattery", ST_FLAG_STRING, SU_INFOSIZE, IETF_OID_UPS_MIB "6.3.2", "", 0, NULL), /* upsAlarmOnBattery */ + snmp_info_default("debug.upsAlarmLowBattery", ST_FLAG_STRING, SU_INFOSIZE, IETF_OID_UPS_MIB "6.3.3", "", 0, NULL), /* upsAlarmLowBattery */ + snmp_info_default("debug.upsAlarmDepletedBattery", ST_FLAG_STRING, SU_INFOSIZE, IETF_OID_UPS_MIB "6.3.4", "", 0, NULL), /* upsAlarmDepletedBattery */ + snmp_info_default("debug.upsAlarmTempBad", ST_FLAG_STRING, SU_INFOSIZE, IETF_OID_UPS_MIB "6.3.5", "", 0, NULL), /* upsAlarmTempBad */ + snmp_info_default("debug.upsAlarmInputBad", ST_FLAG_STRING, SU_INFOSIZE, IETF_OID_UPS_MIB "6.3.6", "", 0, NULL), /* upsAlarmInputBad */ + snmp_info_default("debug.upsAlarmOutputBad", ST_FLAG_STRING, SU_INFOSIZE, IETF_OID_UPS_MIB "6.3.7", "", 0, NULL), /* upsAlarmOutputBad */ #endif - { "ups.status", ST_FLAG_STRING, SU_INFOSIZE, IETF_OID_UPS_MIB "6.3.8", "", 0, ietf_overload_info }, /* upsAlarmOutputOverload */ + snmp_info_default("ups.status", ST_FLAG_STRING, SU_INFOSIZE, IETF_OID_UPS_MIB "6.3.8", "", 0, ietf_overload_info), /* upsAlarmOutputOverload */ #ifdef DEBUG - { "debug.upsAlarmOnBypass", ST_FLAG_STRING, SU_INFOSIZE, IETF_OID_UPS_MIB "6.3.9", "", 0, NULL }, /* upsAlarmOnBypass */ - { "debug.upsAlarmBypassBad", ST_FLAG_STRING, SU_INFOSIZE, IETF_OID_UPS_MIB "6.3.10", "", 0, NULL }, /* upsAlarmBypassBad */ - { "debug.upsAlarmOutputOffAsRequested", ST_FLAG_STRING, SU_INFOSIZE, IETF_OID_UPS_MIB "6.3.11", "", 0, NULL }, /* upsAlarmOutputOffAsRequested */ - { "debug.upsAlarmUpsOffAsRequested", ST_FLAG_STRING, SU_INFOSIZE, IETF_OID_UPS_MIB "6.3.12", "", 0, NULL }, /* upsAlarmUpsOffAsRequested */ - { "debug.upsAlarmChargerFailed", ST_FLAG_STRING, SU_INFOSIZE, IETF_OID_UPS_MIB "6.3.13", "", 0, NULL }, /* upsAlarmChargerFailed */ - { "debug.upsAlarmUpsOutputOff", ST_FLAG_STRING, SU_INFOSIZE, IETF_OID_UPS_MIB "6.3.14", "", 0, NULL }, /* upsAlarmUpsOutputOff */ - { "debug.upsAlarmUpsSystemOff", ST_FLAG_STRING, SU_INFOSIZE, IETF_OID_UPS_MIB "6.3.15", "", 0, NULL }, /* upsAlarmUpsSystemOff */ - { "debug.upsAlarmFanFailure", ST_FLAG_STRING, SU_INFOSIZE, IETF_OID_UPS_MIB "6.3.16", "", 0, NULL }, /* upsAlarmFanFailure */ - { "debug.upsAlarmFuseFailure", ST_FLAG_STRING, SU_INFOSIZE, IETF_OID_UPS_MIB "6.3.17", "", 0, NULL }, /* upsAlarmFuseFailure */ - { "debug.upsAlarmGeneralFault", ST_FLAG_STRING, SU_INFOSIZE, IETF_OID_UPS_MIB "6.3.18", "", 0, NULL }, /* upsAlarmGeneralFault */ - { "debug.upsAlarmDiagnosticTestFailed", ST_FLAG_STRING, SU_INFOSIZE, IETF_OID_UPS_MIB "6.3.19", "", 0, NULL }, /* upsAlarmDiagnosticTestFailed */ - { "debug.upsAlarmCommunicationsLost", ST_FLAG_STRING, SU_INFOSIZE, IETF_OID_UPS_MIB "6.3.20", "", 0, NULL }, /* upsAlarmCommunicationsLost */ - { "debug.upsAlarmAwaitingPower", ST_FLAG_STRING, SU_INFOSIZE, IETF_OID_UPS_MIB "6.3.21", "", 0, NULL }, /* upsAlarmAwaitingPower */ - { "debug.upsAlarmShutdownPending", ST_FLAG_STRING, SU_INFOSIZE, IETF_OID_UPS_MIB "6.3.22", "", 0, NULL }, /* upsAlarmShutdownPending */ - { "debug.upsAlarmShutdownImminent", ST_FLAG_STRING, SU_INFOSIZE, IETF_OID_UPS_MIB "6.3.23", "", 0, NULL }, /* upsAlarmShutdownImminent */ - { "debug.upsAlarmTestInProgress", ST_FLAG_STRING, SU_INFOSIZE, IETF_OID_UPS_MIB "6.3.24", "", 0, NULL }, /* upsAlarmTestInProgress */ + snmp_info_default("debug.upsAlarmOnBypass", ST_FLAG_STRING, SU_INFOSIZE, IETF_OID_UPS_MIB "6.3.9", "", 0, NULL), /* upsAlarmOnBypass */ + snmp_info_default("debug.upsAlarmBypassBad", ST_FLAG_STRING, SU_INFOSIZE, IETF_OID_UPS_MIB "6.3.10", "", 0, NULL), /* upsAlarmBypassBad */ + snmp_info_default("debug.upsAlarmOutputOffAsRequested", ST_FLAG_STRING, SU_INFOSIZE, IETF_OID_UPS_MIB "6.3.11", "", 0, NULL), /* upsAlarmOutputOffAsRequested */ + snmp_info_default("debug.upsAlarmUpsOffAsRequested", ST_FLAG_STRING, SU_INFOSIZE, IETF_OID_UPS_MIB "6.3.12", "", 0, NULL), /* upsAlarmUpsOffAsRequested */ + snmp_info_default("debug.upsAlarmChargerFailed", ST_FLAG_STRING, SU_INFOSIZE, IETF_OID_UPS_MIB "6.3.13", "", 0, NULL), /* upsAlarmChargerFailed */ + snmp_info_default("debug.upsAlarmUpsOutputOff", ST_FLAG_STRING, SU_INFOSIZE, IETF_OID_UPS_MIB "6.3.14", "", 0, NULL), /* upsAlarmUpsOutputOff */ + snmp_info_default("debug.upsAlarmUpsSystemOff", ST_FLAG_STRING, SU_INFOSIZE, IETF_OID_UPS_MIB "6.3.15", "", 0, NULL), /* upsAlarmUpsSystemOff */ + snmp_info_default("debug.upsAlarmFanFailure", ST_FLAG_STRING, SU_INFOSIZE, IETF_OID_UPS_MIB "6.3.16", "", 0, NULL), /* upsAlarmFanFailure */ + snmp_info_default("debug.upsAlarmFuseFailure", ST_FLAG_STRING, SU_INFOSIZE, IETF_OID_UPS_MIB "6.3.17", "", 0, NULL), /* upsAlarmFuseFailure */ + snmp_info_default("debug.upsAlarmGeneralFault", ST_FLAG_STRING, SU_INFOSIZE, IETF_OID_UPS_MIB "6.3.18", "", 0, NULL), /* upsAlarmGeneralFault */ + snmp_info_default("debug.upsAlarmDiagnosticTestFailed", ST_FLAG_STRING, SU_INFOSIZE, IETF_OID_UPS_MIB "6.3.19", "", 0, NULL), /* upsAlarmDiagnosticTestFailed */ + snmp_info_default("debug.upsAlarmCommunicationsLost", ST_FLAG_STRING, SU_INFOSIZE, IETF_OID_UPS_MIB "6.3.20", "", 0, NULL), /* upsAlarmCommunicationsLost */ + snmp_info_default("debug.upsAlarmAwaitingPower", ST_FLAG_STRING, SU_INFOSIZE, IETF_OID_UPS_MIB "6.3.21", "", 0, NULL), /* upsAlarmAwaitingPower */ + snmp_info_default("debug.upsAlarmShutdownPending", ST_FLAG_STRING, SU_INFOSIZE, IETF_OID_UPS_MIB "6.3.22", "", 0, NULL), /* upsAlarmShutdownPending */ + snmp_info_default("debug.upsAlarmShutdownImminent", ST_FLAG_STRING, SU_INFOSIZE, IETF_OID_UPS_MIB "6.3.23", "", 0, NULL), /* upsAlarmShutdownImminent */ + snmp_info_default("debug.upsAlarmTestInProgress", ST_FLAG_STRING, SU_INFOSIZE, IETF_OID_UPS_MIB "6.3.24", "", 0, NULL), /* upsAlarmTestInProgress */ #endif /* Test Group */ - { "ups.status", ST_FLAG_STRING, SU_INFOSIZE, IETF_OID_UPS_MIB "7.1.0", "", 0, ietf_test_active_info }, /* upsTestId */ - { "test.battery.stop", 0, 1, IETF_OID_UPS_MIB "7.1.0", "0", SU_TYPE_CMD, NULL }, /* upsTestAbortTestInProgress */ - { "test.battery.start", 0, 1, IETF_OID_UPS_MIB "7.1.0", "0", SU_TYPE_CMD, NULL }, /* upsTestGeneralSystemsTest */ - { "test.battery.start.quick", 0, 1, IETF_OID_UPS_MIB "7.1.0", "0", SU_TYPE_CMD, NULL }, /* upsTestQuickBatteryTest */ - { "test.battery.start.deep", 0, 1, IETF_OID_UPS_MIB "7.1.0", "0", SU_TYPE_CMD, NULL }, /* upsTestDeepBatteryCalibration */ + snmp_info_default("ups.status", ST_FLAG_STRING, SU_INFOSIZE, IETF_OID_UPS_MIB "7.1.0", "", 0, ietf_test_active_info), /* upsTestId */ + snmp_info_default("test.battery.stop", 0, 1, IETF_OID_UPS_MIB "7.1.0", "0", SU_TYPE_CMD, NULL), /* upsTestAbortTestInProgress */ + snmp_info_default("test.battery.start", 0, 1, IETF_OID_UPS_MIB "7.1.0", "0", SU_TYPE_CMD, NULL), /* upsTestGeneralSystemsTest */ + snmp_info_default("test.battery.start.quick", 0, 1, IETF_OID_UPS_MIB "7.1.0", "0", SU_TYPE_CMD, NULL), /* upsTestQuickBatteryTest */ + snmp_info_default("test.battery.start.deep", 0, 1, IETF_OID_UPS_MIB "7.1.0", "0", SU_TYPE_CMD, NULL), /* upsTestDeepBatteryCalibration */ #ifdef DEBUG - { "debug.upsTestSpinLock", 0, 1.0, IETF_OID_UPS_MIB "7.2.0", "", 0, NULL }, /* upsTestSpinLock */ + snmp_info_default("debug.upsTestSpinLock", 0, 1.0, IETF_OID_UPS_MIB "7.2.0", "", 0, NULL), /* upsTestSpinLock */ #endif - { "ups.test.result", ST_FLAG_STRING, SU_INFOSIZE, IETF_OID_UPS_MIB "7.3.0", "", 0, ietf_test_result_info }, /* upsTestResultsSummary */ + snmp_info_default("ups.test.result", ST_FLAG_STRING, SU_INFOSIZE, IETF_OID_UPS_MIB "7.3.0", "", 0, ietf_test_result_info), /* upsTestResultsSummary */ #ifdef DEBUG - { "debug.upsTestResultsDetail", ST_FLAG_STRING, SU_INFOSIZE, IETF_OID_UPS_MIB "7.4.0", "", 0, NULL }, /* upsTestResultsDetail */ - { "debug.upsTestStartTime", ST_FLAG_STRING, SU_INFOSIZE, IETF_OID_UPS_MIB "7.5.0", "", 0, NULL }, /* upsTestStartTime */ - { "debug.upsTestElapsedTime", ST_FLAG_STRING, SU_INFOSIZE, IETF_OID_UPS_MIB "7.6.0", "", 0, NULL }, /* upsTestElapsedTime */ + snmp_info_default("debug.upsTestResultsDetail", ST_FLAG_STRING, SU_INFOSIZE, IETF_OID_UPS_MIB "7.4.0", "", 0, NULL), /* upsTestResultsDetail */ + snmp_info_default("debug.upsTestStartTime", ST_FLAG_STRING, SU_INFOSIZE, IETF_OID_UPS_MIB "7.5.0", "", 0, NULL), /* upsTestStartTime */ + snmp_info_default("debug.upsTestElapsedTime", ST_FLAG_STRING, SU_INFOSIZE, IETF_OID_UPS_MIB "7.6.0", "", 0, NULL), /* upsTestElapsedTime */ #endif /* Control Group */ #ifdef DEBUG - { "debug.upsShutdownType", ST_FLAG_STRING, SU_INFOSIZE, IETF_OID_UPS_MIB "8.1.0", "", 0, ietf_shutdown_type_info }, /* upsShutdownType */ + snmp_info_default("debug.upsShutdownType", ST_FLAG_STRING, SU_INFOSIZE, IETF_OID_UPS_MIB "8.1.0", "", 0, ietf_shutdown_type_info), /* upsShutdownType */ #endif - { "ups.timer.shutdown", ST_FLAG_STRING | ST_FLAG_RW, 8, IETF_OID_UPS_MIB "8.2.0", "", 0, NULL }, /* upsShutdownAfterDelay*/ - { "load.off", 0, 1, IETF_OID_UPS_MIB "8.2.0", "0", SU_TYPE_CMD, NULL }, - { "ups.timer.start", ST_FLAG_STRING | ST_FLAG_RW, 8, IETF_OID_UPS_MIB "8.3.0", "", 0, NULL }, /* upsStartupAfterDelay */ - { "load.on", 0, 1, IETF_OID_UPS_MIB "8.3.0", "0", SU_TYPE_CMD, NULL }, - { "ups.timer.reboot", ST_FLAG_STRING | ST_FLAG_RW, 8, IETF_OID_UPS_MIB "8.4.0", "", 0, NULL }, /* upsRebootWithDuration */ - { "ups.start.auto", ST_FLAG_STRING, SU_INFOSIZE, IETF_OID_UPS_MIB "8.5.0", "", 0, ietf_yes_no_info }, /* upsAutoRestart */ + snmp_info_default("ups.timer.shutdown", ST_FLAG_STRING | ST_FLAG_RW, 8, IETF_OID_UPS_MIB "8.2.0", "", 0, NULL), /* upsShutdownAfterDelay*/ + snmp_info_default("load.off", 0, 1, IETF_OID_UPS_MIB "8.2.0", "0", SU_TYPE_CMD, NULL), + snmp_info_default("ups.timer.start", ST_FLAG_STRING | ST_FLAG_RW, 8, IETF_OID_UPS_MIB "8.3.0", "", 0, NULL), /* upsStartupAfterDelay */ + snmp_info_default("load.on", 0, 1, IETF_OID_UPS_MIB "8.3.0", "0", SU_TYPE_CMD, NULL), + snmp_info_default("ups.timer.reboot", ST_FLAG_STRING | ST_FLAG_RW, 8, IETF_OID_UPS_MIB "8.4.0", "", 0, NULL), /* upsRebootWithDuration */ + snmp_info_default("ups.start.auto", ST_FLAG_STRING, SU_INFOSIZE, IETF_OID_UPS_MIB "8.5.0", "", 0, ietf_yes_no_info), /* upsAutoRestart */ /* Configuration Group */ - { "input.voltage.nominal", 0, 1.0, IETF_OID_UPS_MIB "9.1.0", "", SU_FLAG_NEGINVALID, NULL }, /* upsConfigInputVoltage */ - { "input.frequency.nominal", 0, 0.1, IETF_OID_UPS_MIB "9.2.0", "", SU_FLAG_NEGINVALID, NULL }, /* upsConfigInputFreq */ - { "output.voltage.nominal", 0, 1.0, IETF_OID_UPS_MIB "9.3.0", "", 0, NULL }, /* upsConfigOutputVoltage */ - { "output.frequency.nominal", 0, 0.1, IETF_OID_UPS_MIB "9.4.0", "", 0, NULL }, /* upsConfigOutputFreq */ - { "output.power.nominal", 0, 1.0, IETF_OID_UPS_MIB "9.5.0", "", SU_FLAG_NEGINVALID, NULL }, /* upsConfigOutputVA */ - { "output.realpower.nominal", 0, 1.0, IETF_OID_UPS_MIB "9.6.0", "", SU_FLAG_NEGINVALID, NULL }, /* upsConfigOutputPower */ - { "battery.runtime.low", 0, 60.0, IETF_OID_UPS_MIB "9.7.0", "", 0, NULL }, /* upsConfigLowBattTime */ - { "ups.beeper.status", ST_FLAG_STRING, SU_INFOSIZE, IETF_OID_UPS_MIB "9.8.0", "", 0, ietf_beeper_status_info }, /* upsConfigAudibleStatus */ - { "beeper.disable", 0, 1, IETF_OID_UPS_MIB "9.8.0", "1", SU_TYPE_CMD, NULL }, - { "beeper.enable", 0, 1, IETF_OID_UPS_MIB "9.8.0", "2", SU_TYPE_CMD, NULL }, - { "beeper.mute", 0, 1, IETF_OID_UPS_MIB "9.8.0", "3", SU_TYPE_CMD, NULL }, - { "input.transfer.low", 0, 1.0, IETF_OID_UPS_MIB "9.9.0", "", 0, NULL }, /* upsConfigLowVoltageTransferPoint */ - { "input.transfer.high", 0, 1.0, IETF_OID_UPS_MIB "9.10.0", "", 0, NULL }, /* upsConfigHighVoltageTransferPoint */ + snmp_info_default("input.voltage.nominal", 0, 1.0, IETF_OID_UPS_MIB "9.1.0", "", SU_FLAG_NEGINVALID, NULL), /* upsConfigInputVoltage */ + snmp_info_default("input.frequency.nominal", 0, 0.1, IETF_OID_UPS_MIB "9.2.0", "", SU_FLAG_NEGINVALID, NULL), /* upsConfigInputFreq */ + snmp_info_default("output.voltage.nominal", 0, 1.0, IETF_OID_UPS_MIB "9.3.0", "", 0, NULL), /* upsConfigOutputVoltage */ + snmp_info_default("output.frequency.nominal", 0, 0.1, IETF_OID_UPS_MIB "9.4.0", "", 0, NULL), /* upsConfigOutputFreq */ + snmp_info_default("output.power.nominal", 0, 1.0, IETF_OID_UPS_MIB "9.5.0", "", SU_FLAG_NEGINVALID, NULL), /* upsConfigOutputVA */ + snmp_info_default("output.realpower.nominal", 0, 1.0, IETF_OID_UPS_MIB "9.6.0", "", SU_FLAG_NEGINVALID, NULL), /* upsConfigOutputPower */ + snmp_info_default("battery.runtime.low", 0, 60.0, IETF_OID_UPS_MIB "9.7.0", "", 0, NULL), /* upsConfigLowBattTime */ + snmp_info_default("ups.beeper.status", ST_FLAG_STRING, SU_INFOSIZE, IETF_OID_UPS_MIB "9.8.0", "", 0, ietf_beeper_status_info), /* upsConfigAudibleStatus */ + snmp_info_default("beeper.disable", 0, 1, IETF_OID_UPS_MIB "9.8.0", "1", SU_TYPE_CMD, NULL), + snmp_info_default("beeper.enable", 0, 1, IETF_OID_UPS_MIB "9.8.0", "2", SU_TYPE_CMD, NULL), + snmp_info_default("beeper.mute", 0, 1, IETF_OID_UPS_MIB "9.8.0", "3", SU_TYPE_CMD, NULL), + snmp_info_default("input.transfer.low", 0, 1.0, IETF_OID_UPS_MIB "9.9.0", "", 0, NULL), /* upsConfigLowVoltageTransferPoint */ + snmp_info_default("input.transfer.high", 0, 1.0, IETF_OID_UPS_MIB "9.10.0", "", 0, NULL), /* upsConfigHighVoltageTransferPoint */ /* end of structure. */ - { NULL, 0, 0, NULL, NULL, 0, NULL } + snmp_info_sentinel }; /* FIXME: Rename the structure here (or even relocate to new file) diff --git a/drivers/libhid.c b/drivers/libhid.c index 83ecceebce..74b9991973 100644 --- a/drivers/libhid.c +++ b/drivers/libhid.c @@ -233,6 +233,7 @@ static int refresh_report_buffer(reportbuf_t *rbuf, hid_dev_handle_t udev, HIDDa (usb_ctrl_charbufsize)r); if (ret <= 0) { + errno = -ret; return -1; } r = (size_t)ret; diff --git a/drivers/libusb0.c b/drivers/libusb0.c index 0dd46b0139..c713450ba0 100644 --- a/drivers/libusb0.c +++ b/drivers/libusb0.c @@ -95,6 +95,8 @@ void nut_usb_addvars(void) addvar(VAR_VALUE, "usb_set_altinterface", "Force redundant call to usb_set_altinterface() (value=bAlternateSetting; default=0)"); dstate_setinfo("driver.version.usb", "libusb-0.1 (or compat)"); + + upsdebugx(1, "Using USB implementation: %s", dstate_getinfo("driver.version.usb")); } /* From usbutils: workaround libusb (0.1) API goofs: @@ -435,8 +437,9 @@ static int libusb_open(usb_dev_handle **udevp, } fatalx(EXIT_FAILURE, - "Can't claim USB device [%04x:%04x]@%d/%d: %s", + "Can't claim USB device [%04x:%04x]@%d/%d/%d: %s", curDevice->VendorID, curDevice->ProductID, + usb_subdriver.usb_config_index, usb_subdriver.hid_rep_index, usb_subdriver.hid_desc_index, usb_strerror()); @@ -449,8 +452,9 @@ static int libusb_open(usb_dev_handle **udevp, } fatalx(EXIT_FAILURE, - "Can't claim USB device [%04x:%04x]@%d/%d: %s", + "Can't claim USB device [%04x:%04x]@%d/%d/%d: %s", curDevice->VendorID, curDevice->ProductID, + usb_subdriver.usb_config_index, usb_subdriver.hid_rep_index, usb_subdriver.hid_desc_index, usb_strerror()); @@ -508,10 +512,7 @@ static int libusb_open(usb_dev_handle **udevp, /* Note: on some broken UPS's (e.g. Tripp Lite Smart1000LCD), only this second method gives the correct result */ - - /* for now, we always assume configuration 0, interface 0, - altsetting 0, as above. */ - iface = &dev->config[0].interface[usb_subdriver.hid_rep_index].altsetting[0]; + iface = &dev->config[usb_subdriver.usb_config_index].interface[usb_subdriver.hid_rep_index].altsetting[0]; for (i=0; iextralen; i+=iface->extra[i]) { upsdebugx(4, "i=%d, extra[i]=%02x, extra[i+1]=%02x", i, iface->extra[i], iface->extra[i+1]); @@ -904,6 +905,7 @@ usb_communication_subdriver_t usb_subdriver = { libusb_set_report, libusb_get_string, libusb_get_interrupt, + LIBUSB_DEFAULT_CONF_INDEX, LIBUSB_DEFAULT_INTERFACE, LIBUSB_DEFAULT_DESC_INDEX, LIBUSB_DEFAULT_HID_EP_IN, diff --git a/drivers/libusb1.c b/drivers/libusb1.c index 17f4b8f740..c84a28218a 100644 --- a/drivers/libusb1.c +++ b/drivers/libusb1.c @@ -93,6 +93,8 @@ void nut_usb_addvars(void) #else /* no LIBUSB_API_VERSION */ dstate_setinfo("driver.version.usb", "libusb-%u.%u.%u", v->major, v->minor, v->micro); #endif /* LIBUSB_API_VERSION */ + + upsdebugx(1, "Using USB implementation: %s", dstate_getinfo("driver.version.usb")); } /* invoke matcher against device */ @@ -263,14 +265,7 @@ static int nut_libusb_open(libusb_device_handle **udevp, libusb_free_device_list(devlist, 1); fatal_with_errno(EXIT_FAILURE, "Out of memory"); } - if (bus_num > 0) { - sprintf(curDevice->Bus, "%03d", bus_num); - } else { - upsdebugx(1, "%s: invalid libusb bus number %i", - __func__, bus_num); - free(curDevice->Bus); - curDevice->Bus = NULL; - } + sprintf(curDevice->Bus, "%03d", bus_num); device_addr = libusb_get_device_address(device); curDevice->Device = (char *)malloc(4); @@ -418,9 +413,10 @@ static int nut_libusb_open(libusb_device_handle **udevp, * that the device is not what we want. */ upsdebugx(2, "Device matches"); - upsdebugx(2, "Reading first configuration descriptor"); + upsdebugx(2, "Reading configuration descriptor %d of %d", + usb_subdriver.usb_config_index+1, dev_desc.bNumConfigurations); ret = libusb_get_config_descriptor(device, - (uint8_t)usb_subdriver.hid_rep_index, + (uint8_t)usb_subdriver.usb_config_index, &conf_desc); /*ret = libusb_get_active_config_descriptor(device, &conf_desc);*/ if (ret < 0) @@ -497,8 +493,9 @@ static int nut_libusb_open(libusb_device_handle **udevp, libusb_free_config_descriptor(conf_desc); libusb_free_device_list(devlist, 1); fatalx(EXIT_FAILURE, - "Can't claim USB device [%04x:%04x]@%d/%d: %s", + "Can't claim USB device [%04x:%04x]@%d/%d/%d: %s", curDevice->VendorID, curDevice->ProductID, + usb_subdriver.usb_config_index, usb_subdriver.hid_rep_index, usb_subdriver.hid_desc_index, libusb_strerror((enum libusb_error)ret)); @@ -513,8 +510,9 @@ static int nut_libusb_open(libusb_device_handle **udevp, libusb_free_config_descriptor(conf_desc); libusb_free_device_list(devlist, 1); fatalx(EXIT_FAILURE, - "Can't claim USB device [%04x:%04x]@%d/%d: %s", + "Can't claim USB device [%04x:%04x]@%d/%d/%d: %s", curDevice->VendorID, curDevice->ProductID, + usb_subdriver.usb_config_index, usb_subdriver.hid_rep_index, usb_subdriver.hid_desc_index, libusb_strerror((enum libusb_error)ret)); @@ -533,7 +531,10 @@ static int nut_libusb_open(libusb_device_handle **udevp, } if (!conf_desc) { /* ?? this should never happen */ - upsdebugx(2, " Couldn't retrieve descriptors"); + upsdebugx(2, " Couldn't retrieve config descriptor [%04x:%04x]@%d", + curDevice->VendorID, curDevice->ProductID, + usb_subdriver.usb_config_index + ); goto next_device; } @@ -1025,6 +1026,7 @@ usb_communication_subdriver_t usb_subdriver = { nut_libusb_set_report, nut_libusb_get_string, nut_libusb_get_interrupt, + LIBUSB_DEFAULT_CONF_INDEX, LIBUSB_DEFAULT_INTERFACE, LIBUSB_DEFAULT_DESC_INDEX, LIBUSB_DEFAULT_HID_EP_IN, diff --git a/drivers/main.c b/drivers/main.c index 919355fda9..8eb7b08b5c 100644 --- a/drivers/main.c +++ b/drivers/main.c @@ -351,6 +351,31 @@ void storeval(const char *var, char *val) printf("Look in the man page or call this driver with -h for a list of\n"); printf("valid variable names and flags.\n"); + if (!strcmp(progname, "nutdrv_qx")) { + /* First many entries are from nut_usb_addvars() implementations; + * the latter two (about langid) are from nutdrv_qx.c + */ + if (!strcmp(var, "vendor") + || !strcmp(var, "product") + || !strcmp(var, "serial") + || !strcmp(var, "vendorid") + || !strcmp(var, "productid") + || !strcmp(var, "bus") + || !strcmp(var, "device") + || !strcmp(var, "busport") + || !strcmp(var, "usb_set_altinterface") + || !strcmp(var, "allow_duplicates") + || !strcmp(var, "langid_fix") + || !strcmp(var, "noscanlangid") + ) { + printf("\nNOTE: for driver '%s', options like '%s' are only available\n" + "if it was built with USB support. If you are running a custom build of NUT,\n" + "please check results of the `configure` checks, and consider an explicit\n" + "`--with-usb` option. Also make sure that both libusb library and headers\n" + "are installed in your build environment.\n\n", progname, var); + } + } + exit(EXIT_SUCCESS); } @@ -1004,7 +1029,7 @@ static int main_arg(char *var, char *val) * catch commented-away settings, so not checking previous value. */ if (!strcmp(var, "debug_min")) { - int lvl = -1; // typeof common/common.c: int nut_debug_level + int lvl = -1; /* typeof common/common.c: int nut_debug_level */ if ( str_to_int (val, &lvl, 10) && lvl >= 0 ) { nut_debug_level_driver = lvl; } else { @@ -1129,7 +1154,7 @@ static void do_global_args(const char *var, const char *val) * catch commented-away settings, so not checking previous value. */ if (!strcmp(var, "debug_min")) { - int lvl = -1; // typeof common/common.c: int nut_debug_level + int lvl = -1; /* typeof common/common.c: int nut_debug_level */ if ( str_to_int (val, &lvl, 10) && lvl >= 0 ) { nut_debug_level_global = lvl; } else { @@ -1616,9 +1641,64 @@ int main(int argc, char **argv) const char * cmd = NULL; #endif + const char optstring[] = "+a:s:kDFBd:hx:Lqr:u:g:Vi:c:" +#ifndef WIN32 + "P:" +#endif + ; + /* init verbosity from default in common.c (0 probably) */ nut_debug_level_args = nut_debug_level; + /* handle CLI-driven debug level in advance, to trace initialization if needed */ + while ((i = getopt(argc, argv, optstring)) != -1) { + switch (i) { + case 'D': + /* bump right here, may impact reporting of other CLI args */ + nut_debug_level++; + nut_debug_level_args++; + break; + } + } + /* Reset the index, read argv[1] next time (loop below) + * https://pubs.opengroup.org/onlinepubs/9699919799/functions/getopt.html + */ + optind = 1; + + if (foreground < 0) { + /* Guess a default */ + /* Note: only care about CLI-requested debug verbosity here */ + if (nut_debug_level > 0 || dump_data) { + /* Only flop from default - stay foreground with debug on */ + foreground = 1; + } else { + /* Legacy default - stay background and quiet */ + foreground = 0; + } + } else { + /* Follow explicit user -F/-B request */ + upsdebugx (0, + "Debug level is %d, dump data count is %s, " + "but backgrounding mode requested as %s", + nut_debug_level, + dump_data ? "on" : "off", + foreground ? "off" : "on" + ); + } + + { /* scoping */ + char *s = getenv("NUT_DEBUG_LEVEL"); + int l; + if (s && str_to_int(s, &l, 10)) { + if (l > 0 && nut_debug_level_args < 1) { + upslogx(LOG_INFO, "Defaulting debug verbosity to NUT_DEBUG_LEVEL=%d " + "since none was requested by command-line options", l); + nut_debug_level = l; + nut_debug_level_args = l; + } /* else follow -D settings */ + } /* else nothing to bother about */ + } + dstate_setinfo("driver.state", "init.starting"); atexit(exit_cleanup); @@ -1660,11 +1740,7 @@ int main(int argc, char **argv) /* build the driver's extra (-x) variable table */ upsdrv_makevartable(); - while ((i = getopt(argc, argv, "+a:s:kFBDd:hx:Lqr:u:g:Vi:c:" -#ifndef WIN32 - "P:" -#endif - )) != -1) { + while ((i = getopt(argc, argv, optstring)) != -1) { switch (i) { case 'a': if (upsname) @@ -1699,9 +1775,7 @@ int main(int argc, char **argv) foreground = 0; break; case 'D': - /* bump right here, may impact reporting of other CLI args */ - nut_debug_level++; - nut_debug_level_args++; + /* Processed above */ break; case 'd': dump_data = atoi(optarg); @@ -1828,40 +1902,6 @@ int main(int argc, char **argv) } } - if (foreground < 0) { - /* Guess a default */ - /* Note: only care about CLI-requested debug verbosity here */ - if (nut_debug_level > 0 || dump_data) { - /* Only flop from default - stay foreground with debug on */ - foreground = 1; - } else { - /* Legacy default - stay background and quiet */ - foreground = 0; - } - } else { - /* Follow explicit user -F/-B request */ - upsdebugx (0, - "Debug level is %d, dump data count is %s, " - "but backgrounding mode requested as %s", - nut_debug_level, - dump_data ? "on" : "off", - foreground ? "off" : "on" - ); - } - - { /* scoping */ - char *s = getenv("NUT_DEBUG_LEVEL"); - int l; - if (s && str_to_int(s, &l, 10)) { - if (l > 0 && nut_debug_level_args < 1) { - upslogx(LOG_INFO, "Defaulting debug verbosity to NUT_DEBUG_LEVEL=%d " - "since none was requested by command-line options", l); - nut_debug_level = l; - nut_debug_level_args = l; - } /* else follow -D settings */ - } /* else nothing to bother about */ - } - /* Since debug mode dumps from drivers are often posted to mailing list * or issue tracker, as well as viewed locally, it can help to know the * build options involved when troubleshooting (especially when needed @@ -2260,6 +2300,9 @@ int main(int argc, char **argv) /* Use file descriptor, not name, to first check and then manipulate permissions: * https://cwe.mitre.org/data/definitions/367.html * https://wiki.sei.cmu.edu/confluence/display/c/FIO01-C.+Be+careful+using+functions+that+use+file+names+for+identification + * Alas, Unix sockets on most systems can not be open()ed + * so there is no file descriptor to manipulate. + * Fall back to name-based "les secure" operations then. */ TYPE_FD fd = ERROR_FD; @@ -2275,8 +2318,8 @@ int main(int argc, char **argv) if (grp == NULL) { upsdebugx(1, "WARNING: could not resolve " - "group name '%s': %s", - group, strerror(errno) + "group name '%s' (%i): %s", + group, errno, strerror(errno) ); allOk = 0; goto sockname_ownership_finished; @@ -2285,35 +2328,46 @@ int main(int argc, char **argv) mode_t mode; if (INVALID_FD((fd = open(sockname, O_RDWR | O_APPEND)))) { - upsdebugx(1, "WARNING: opening socket file for stat/chown failed: %s", - strerror(errno) + upsdebugx(1, "WARNING: opening socket file for stat/chown failed " + "(%i), which is rather typical for Unix socket handling: %s", + errno, strerror(errno) ); allOk = 0; - /* Can not proceed with ops below */ - goto sockname_ownership_finished; } - if (fstat(fd, &statbuf)) { - upsdebugx(1, "WARNING: stat for chown failed: %s", - strerror(errno) + if ((VALID_FD(fd) && fstat(fd, &statbuf)) + || (INVALID_FD(fd) && stat(sockname, &statbuf)) + ) { + upsdebugx(1, "WARNING: stat for chown of socket file failed (%i): %s", + errno, strerror(errno) ); allOk = 0; + if (INVALID_FD(fd)) { + /* Can not proceed with ops below */ + goto sockname_ownership_finished; + } } else { + /* Maybe open() and some stat() succeeed so far */ + allOk = 1; /* Here we do a portable chgrp() essentially: */ - if (fchown(fd, statbuf.st_uid, grp->gr_gid)) { - upsdebugx(1, "WARNING: chown failed: %s", - strerror(errno) + if ((VALID_FD(fd) && fchown(fd, statbuf.st_uid, grp->gr_gid)) + || (INVALID_FD(fd) && chown(sockname, statbuf.st_uid, grp->gr_gid)) + ) { + upsdebugx(1, "WARNING: chown of socket file failed (%i): %s", + errno, strerror(errno) ); allOk = 0; } } /* Refresh file info */ - if (fstat(fd, &statbuf)) { + if ((VALID_FD(fd) && fstat(fd, &statbuf)) + || (INVALID_FD(fd) && stat(sockname, &statbuf)) + ) { /* Logically we'd fail chown above if file * does not exist or is not accessible */ - upsdebugx(1, "WARNING: stat for chmod failed: %s", - strerror(errno) + upsdebugx(1, "WARNING: stat for chmod of socket file failed (%i): %s", + errno, strerror(errno) ); allOk = 0; } else { @@ -2321,9 +2375,11 @@ int main(int argc, char **argv) mode = statbuf.st_mode; mode |= S_IWGRP; mode |= S_IRGRP; - if (fchmod(fd, mode)) { - upsdebugx(1, "WARNING: chmod failed: %s", - strerror(errno) + if ((VALID_FD(fd) && fchmod(fd, mode)) + || (INVALID_FD(fd) && chmod(sockname, mode)) + ) { + upsdebugx(1, "WARNING: chmod of socket file failed (%i): %s", + errno, strerror(errno) ); allOk = 0; } @@ -2331,13 +2387,10 @@ int main(int argc, char **argv) } sockname_ownership_finished: - if (VALID_FD(fd)) { - close(fd); - fd = ERROR_FD; - } - if (allOk) { - upsdebugx(1, "Group access for this driver successfully fixed"); + upsdebugx(1, "Group access for this driver successfully fixed " + "(using file %s based methods)", + VALID_FD(fd) ? "descriptor" : "name"); } else { upsdebugx(0, "WARNING: Needed to fix group access " "to filesystem socket of this driver, but failed; " @@ -2347,6 +2400,11 @@ int main(int argc, char **argv) "the device: %s", sockname); } + + if (VALID_FD(fd)) { + close(fd); + fd = ERROR_FD; + } #else /* not WIN32 */ upsdebugx(1, "Options for alternate user/group are not implemented on this platform"); #endif /* WIN32 */ diff --git a/drivers/mge-hid.c b/drivers/mge-hid.c index 2ae6f4f2ef..81c3a1298b 100644 --- a/drivers/mge-hid.c +++ b/drivers/mge-hid.c @@ -39,6 +39,17 @@ #include "nut_float.h" #include "timehead.h" +#ifdef WIN32 +# include "wincompat.h" +# ifndef LDOUBLE +# ifdef HAVE_LONG_DOUBLE +# define LDOUBLE long double +# else +# define LDOUBLE double +# endif +# endif +#endif + #define MGE_HID_VERSION "MGE HID 1.46" /* (prev. MGE Office Protection Systems, prev. MGE UPS SYSTEMS) */ diff --git a/drivers/mge-mib.c b/drivers/mge-mib.c index 65fd147254..e4b291ca8f 100644 --- a/drivers/mge-mib.c +++ b/drivers/mge-mib.c @@ -38,105 +38,106 @@ #define MGE_OID_MODEL_NAME MGE_BASE_OID ".1.1.0" static info_lkp_t mge_lowbatt_info[] = { - { 1, "LB", NULL, NULL }, - { 2, "", NULL, NULL }, - { 0, NULL, NULL, NULL } + info_lkp_default(1, "LB"), + info_lkp_default(2, ""), + info_lkp_sentinel }; static info_lkp_t mge_onbatt_info[] = { - { 1, "OB", NULL, NULL }, - { 2, "OL", NULL, NULL }, - { 0, NULL, NULL, NULL } + info_lkp_default(1, "OB"), + info_lkp_default(2, "OL"), + info_lkp_sentinel }; static info_lkp_t mge_bypass_info[] = { - { 1, "BYPASS", NULL, NULL }, - { 2, "", NULL, NULL }, - { 0, NULL, NULL, NULL } + info_lkp_default(1, "BYPASS"), + info_lkp_default(2, ""), + info_lkp_sentinel }; static info_lkp_t mge_boost_info[] = { - { 1, "BOOST", NULL, NULL }, - { 2, "", NULL, NULL }, - { 0, NULL, NULL, NULL } + info_lkp_default(1, "BOOST"), + info_lkp_default(2, ""), + info_lkp_sentinel }; static info_lkp_t mge_trim_info[] = { - { 1, "TRIM", NULL, NULL }, - { 2, "", NULL, NULL }, - { 0, NULL, NULL, NULL } + info_lkp_default(1, "TRIM"), + info_lkp_default(2, ""), + info_lkp_sentinel }; static info_lkp_t mge_overload_info[] = { - { 1, "OVER", NULL, NULL }, - { 2, "", NULL, NULL }, - { 0, NULL, NULL, NULL } + info_lkp_default(1, "OVER"), + info_lkp_default(2, ""), + info_lkp_sentinel }; - static info_lkp_t mge_replacebatt_info[] = { - { 1, "RB", NULL, NULL }, - { 2, "", NULL, NULL }, - { 0, NULL, NULL, NULL } + info_lkp_default(1, "RB"), + info_lkp_default(2, ""), + info_lkp_sentinel }; static info_lkp_t mge_output_util_off_info[] = { - { 1, "OFF", NULL, NULL }, - { 2, "", NULL, NULL }, - { 0, NULL, NULL, NULL } + info_lkp_default(1, "OFF"), + info_lkp_default(2, ""), + info_lkp_sentinel }; static info_lkp_t mge_transfer_reason_info[] = { - { 1, "", NULL, NULL }, - { 2, "input voltage out of range", NULL, NULL }, - { 3, "input frequency out of range", NULL, NULL }, - { 4, "utility off", NULL, NULL }, - { 0, NULL, NULL, NULL } + info_lkp_default(1, ""), + info_lkp_default(2, "input voltage out of range"), + info_lkp_default(3, "input frequency out of range"), + info_lkp_default(4, "utility off"), + info_lkp_sentinel }; static info_lkp_t mge_test_result_info[] = { - { 1, "done and passed", NULL, NULL }, - { 2, "done and warning", NULL, NULL }, - { 3, "done and error", NULL, NULL }, - { 4, "aborted", NULL, NULL }, - { 5, "in progress", NULL, NULL }, - { 6, "no test initiated", NULL, NULL }, - { 0, NULL, NULL, NULL } + info_lkp_default(1, "done and passed"), + info_lkp_default(2, "done and warning"), + info_lkp_default(3, "done and error"), + info_lkp_default(4, "aborted"), + info_lkp_default(5, "in progress"), + info_lkp_default(6, "no test initiated"), + info_lkp_sentinel }; static info_lkp_t mge_beeper_status_info[] = { - { 1, "disabled", NULL, NULL }, - { 2, "enabled", NULL, NULL }, - { 3, "muted", NULL, NULL }, - { 0, NULL, NULL, NULL } + info_lkp_default(1, "disabled"), + info_lkp_default(2, "enabled"), + info_lkp_default(3, "muted"), + info_lkp_sentinel }; static info_lkp_t mge_yes_no_info[] = { - { 1, "yes", NULL, NULL }, - { 2, "no", NULL, NULL }, - { 0, NULL, NULL, NULL } + info_lkp_default(1, "yes"), + info_lkp_default(2, "no"), + info_lkp_sentinel }; /* FIXME: the below may introduce status redundancy, that needs to be * addressed by the driver, as for usbhid-ups! */ static info_lkp_t mge_power_source_info[] = { - { 1, "" /* other */, NULL, NULL }, - { 2, "OFF" /* none */, NULL, NULL }, + info_lkp_default(1, ""), /* other */ + info_lkp_default(2, "OFF"), /* none */ + #if 0 - { 3, "OL" /* normal */, NULL, NULL }, + info_lkp_default(3, "OL"), /* normal */ #endif - { 4, "BYPASS" /* bypass */, NULL, NULL }, - { 5, "OB" /* battery */, NULL, NULL }, - { 6, "BOOST" /* booster */, NULL, NULL }, - { 7, "TRIM" /* reducer */, NULL, NULL }, - { 0, NULL, NULL, NULL } + + info_lkp_default(4, "BYPASS"), /* bypass */ + info_lkp_default(5, "OB"), /* battery */ + info_lkp_default(6, "BOOST"), /* booster */ + info_lkp_default(7, "TRIM"), /* reducer */ + info_lkp_sentinel }; static info_lkp_t mge_ambient_drycontacts_info[] = { - { -1, "unknown", NULL, NULL }, - { 1, "closed", NULL, NULL }, - { 2, "opened", NULL, NULL }, - { 0, NULL, NULL, NULL } + info_lkp_default(-1, "unknown"), + info_lkp_default(1, "closed"), + info_lkp_default(2, "opened"), + info_lkp_sentinel }; /* Parameters default values */ @@ -155,39 +156,39 @@ static info_lkp_t mge_ambient_drycontacts_info[] = { static snmp_info_t mge_mib[] = { /* standard MIB items */ - { "device.description", ST_FLAG_STRING | ST_FLAG_RW, SU_INFOSIZE, ".1.3.6.1.2.1.1.1.0", NULL, SU_FLAG_OK, NULL }, - { "device.contact", ST_FLAG_STRING | ST_FLAG_RW, SU_INFOSIZE, ".1.3.6.1.2.1.1.4.0", NULL, SU_FLAG_OK, NULL }, - { "device.location", ST_FLAG_STRING | ST_FLAG_RW, SU_INFOSIZE, ".1.3.6.1.2.1.1.6.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("device.description", ST_FLAG_STRING | ST_FLAG_RW, SU_INFOSIZE, ".1.3.6.1.2.1.1.1.0", NULL, SU_FLAG_OK, NULL), + snmp_info_default("device.contact", ST_FLAG_STRING | ST_FLAG_RW, SU_INFOSIZE, ".1.3.6.1.2.1.1.4.0", NULL, SU_FLAG_OK, NULL), + snmp_info_default("device.location", ST_FLAG_STRING | ST_FLAG_RW, SU_INFOSIZE, ".1.3.6.1.2.1.1.6.0", NULL, SU_FLAG_OK, NULL), /* UPS page */ - { "ups.mfr", ST_FLAG_STRING, SU_INFOSIZE, NULL, "EATON", SU_FLAG_STATIC | SU_FLAG_ABSENT | SU_FLAG_OK, NULL }, - { "ups.model", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.705.1.1.1.0", "Generic SNMP UPS", SU_FLAG_STATIC | SU_FLAG_OK, NULL }, - { "ups.serial", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.705.1.1.7.0", "", SU_FLAG_STATIC | SU_FLAG_OK, NULL }, - { "ups.firmware", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.705.1.1.4.0", "", SU_FLAG_STATIC | SU_FLAG_OK, NULL }, - { "ups.firmware.aux", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.705.1.12.12.0", "", SU_FLAG_STATIC | SU_FLAG_OK, NULL }, - { "ups.load", 0, 1, ".1.3.6.1.4.1.705.1.7.2.1.4.1", "", SU_OUTPUT_1, NULL }, - { "ups.beeper.status", ST_FLAG_STRING, SU_INFOSIZE, "1.3.6.1.2.1.33.1.9.8.0", "", 0, mge_beeper_status_info }, - { "ups.L1.load", 0, 1, ".1.3.6.1.4.1.705.1.7.2.1.4.1", "", SU_OUTPUT_3, NULL }, - { "ups.L2.load", 0, 1, ".1.3.6.1.4.1.705.1.7.2.1.4.2", "", SU_OUTPUT_3, NULL }, - { "ups.L3.load", 0, 1, ".1.3.6.1.4.1.705.1.7.2.1.4.3", "", SU_OUTPUT_3, NULL }, - { "ups.test.result", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.2.1.33.1.7.3.0", "", 0, mge_test_result_info }, - { "ups.delay.shutdown", ST_FLAG_STRING | ST_FLAG_RW, 6, "1.3.6.1.2.1.33.1.8.2.0", DEFAULT_OFFDELAY, SU_FLAG_ABSENT | SU_FLAG_OK, NULL }, - { "ups.delay.start", ST_FLAG_STRING | ST_FLAG_RW, 6, "1.3.6.1.2.1.33.1.8.3.0", DEFAULT_ONDELAY, SU_FLAG_ABSENT | SU_FLAG_OK, NULL }, - { "ups.timer.shutdown", 0, 1, "1.3.6.1.2.1.33.1.8.2.0", "", SU_FLAG_OK, NULL }, - { "ups.timer.start", 0, 1, "1.3.6.1.2.1.33.1.8.3.0", "", SU_FLAG_OK, NULL }, - { "ups.timer.reboot", 0, 1, "1.3.6.1.2.1.33.1.8.4.0", "", SU_FLAG_OK, NULL }, - { "ups.start.auto", ST_FLAG_RW, 1, "1.3.6.1.2.1.33.1.8.5.0", "", SU_FLAG_OK, mge_yes_no_info }, + snmp_info_default("ups.mfr", ST_FLAG_STRING, SU_INFOSIZE, NULL, "EATON", SU_FLAG_STATIC | SU_FLAG_ABSENT | SU_FLAG_OK, NULL), + snmp_info_default("ups.model", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.705.1.1.1.0", "Generic SNMP UPS", SU_FLAG_STATIC | SU_FLAG_OK, NULL), + snmp_info_default("ups.serial", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.705.1.1.7.0", "", SU_FLAG_STATIC | SU_FLAG_OK, NULL), + snmp_info_default("ups.firmware", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.705.1.1.4.0", "", SU_FLAG_STATIC | SU_FLAG_OK, NULL), + snmp_info_default("ups.firmware.aux", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.705.1.12.12.0", "", SU_FLAG_STATIC | SU_FLAG_OK, NULL), + snmp_info_default("ups.load", 0, 1, ".1.3.6.1.4.1.705.1.7.2.1.4.1", "", SU_OUTPUT_1, NULL), + snmp_info_default("ups.beeper.status", ST_FLAG_STRING, SU_INFOSIZE, "1.3.6.1.2.1.33.1.9.8.0", "", 0, mge_beeper_status_info), + snmp_info_default("ups.L1.load", 0, 1, ".1.3.6.1.4.1.705.1.7.2.1.4.1", "", SU_OUTPUT_3, NULL), + snmp_info_default("ups.L2.load", 0, 1, ".1.3.6.1.4.1.705.1.7.2.1.4.2", "", SU_OUTPUT_3, NULL), + snmp_info_default("ups.L3.load", 0, 1, ".1.3.6.1.4.1.705.1.7.2.1.4.3", "", SU_OUTPUT_3, NULL), + snmp_info_default("ups.test.result", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.2.1.33.1.7.3.0", "", 0, mge_test_result_info), + snmp_info_default("ups.delay.shutdown", ST_FLAG_STRING | ST_FLAG_RW, 6, "1.3.6.1.2.1.33.1.8.2.0", DEFAULT_OFFDELAY, SU_FLAG_ABSENT | SU_FLAG_OK, NULL), + snmp_info_default("ups.delay.start", ST_FLAG_STRING | ST_FLAG_RW, 6, "1.3.6.1.2.1.33.1.8.3.0", DEFAULT_ONDELAY, SU_FLAG_ABSENT | SU_FLAG_OK, NULL), + snmp_info_default("ups.timer.shutdown", 0, 1, "1.3.6.1.2.1.33.1.8.2.0", "", SU_FLAG_OK, NULL), + snmp_info_default("ups.timer.start", 0, 1, "1.3.6.1.2.1.33.1.8.3.0", "", SU_FLAG_OK, NULL), + snmp_info_default("ups.timer.reboot", 0, 1, "1.3.6.1.2.1.33.1.8.4.0", "", SU_FLAG_OK, NULL), + snmp_info_default("ups.start.auto", ST_FLAG_RW, 1, "1.3.6.1.2.1.33.1.8.5.0", "", SU_FLAG_OK, mge_yes_no_info), /* status data */ - { "ups.status", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.705.1.5.11.0", "", SU_FLAG_OK | SU_STATUS_BATT, mge_replacebatt_info }, - { "ups.status", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.705.1.5.14.0", "", SU_FLAG_OK | SU_STATUS_BATT, mge_lowbatt_info }, - { "ups.status", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.705.1.5.16.0", "", SU_FLAG_OK | SU_STATUS_BATT, mge_lowbatt_info }, - { "ups.status", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.705.1.7.3.0", "", SU_FLAG_OK | SU_STATUS_BATT, mge_onbatt_info }, - { "ups.status", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.705.1.7.4.0", "", SU_FLAG_OK | SU_STATUS_BATT, mge_bypass_info }, - { "ups.status", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.705.1.7.7.0", "", SU_FLAG_OK | SU_STATUS_BATT, mge_output_util_off_info }, - { "ups.status", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.705.1.7.8.0", "", SU_FLAG_OK | SU_STATUS_BATT, mge_boost_info }, - { "ups.status", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.705.1.7.10.0", "", SU_FLAG_OK | SU_STATUS_BATT, mge_overload_info }, - { "ups.status", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.705.1.7.12.0", "", SU_FLAG_OK | SU_STATUS_BATT, mge_trim_info }, - { "ups.status", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.2.1.33.1.4.1.0", "", SU_STATUS_PWR | SU_FLAG_OK, mge_power_source_info }, + snmp_info_default("ups.status", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.705.1.5.11.0", "", SU_FLAG_OK | SU_STATUS_BATT, mge_replacebatt_info), + snmp_info_default("ups.status", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.705.1.5.14.0", "", SU_FLAG_OK | SU_STATUS_BATT, mge_lowbatt_info), + snmp_info_default("ups.status", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.705.1.5.16.0", "", SU_FLAG_OK | SU_STATUS_BATT, mge_lowbatt_info), + snmp_info_default("ups.status", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.705.1.7.3.0", "", SU_FLAG_OK | SU_STATUS_BATT, mge_onbatt_info), + snmp_info_default("ups.status", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.705.1.7.4.0", "", SU_FLAG_OK | SU_STATUS_BATT, mge_bypass_info), + snmp_info_default("ups.status", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.705.1.7.7.0", "", SU_FLAG_OK | SU_STATUS_BATT, mge_output_util_off_info), + snmp_info_default("ups.status", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.705.1.7.8.0", "", SU_FLAG_OK | SU_STATUS_BATT, mge_boost_info), + snmp_info_default("ups.status", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.705.1.7.10.0", "", SU_FLAG_OK | SU_STATUS_BATT, mge_overload_info), + snmp_info_default("ups.status", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.705.1.7.12.0", "", SU_FLAG_OK | SU_STATUS_BATT, mge_trim_info), + snmp_info_default("ups.status", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.2.1.33.1.4.1.0", "", SU_STATUS_PWR | SU_FLAG_OK, mge_power_source_info), /* FIXME: Alarms * - upsmgBatteryChargerFault (.1.3.6.1.4.1.705.1.5.15.0), yes (1), no (2) @@ -203,87 +204,89 @@ static snmp_info_t mge_mib[] = { */ /* Input page */ - { "input.phases", 0, 1.0, ".1.3.6.1.4.1.705.1.6.1.0", "", 0, NULL }, - { "input.voltage", 0, 0.1, ".1.3.6.1.4.1.705.1.6.2.1.2.1", "", SU_INPUT_1, NULL }, - { "input.L1-N.voltage", 0, 0.1, ".1.3.6.1.4.1.705.1.6.2.1.2.1", "", SU_INPUT_3, NULL }, - { "input.L2-N.voltage", 0, 0.1, ".1.3.6.1.4.1.705.1.6.2.1.2.2", "", SU_INPUT_3, NULL }, - { "input.L3-N.voltage", 0, 0.1, ".1.3.6.1.4.1.705.1.6.2.1.2.3", "", SU_INPUT_3, NULL }, - { "input.frequency", 0, 0.1, ".1.3.6.1.4.1.705.1.6.2.1.3.1", "", SU_INPUT_1, NULL }, - { "input.L1.frequency", 0, 0.1, ".1.3.6.1.4.1.705.1.6.2.1.3.1", "", SU_INPUT_3, NULL }, - { "input.L2.frequency", 0, 0.1, ".1.3.6.1.4.1.705.1.6.2.1.3.2", "", SU_INPUT_3, NULL }, - { "input.L3.frequency", 0, 0.1, ".1.3.6.1.4.1.705.1.6.2.1.3.3", "", SU_INPUT_3, NULL }, - { "input.voltage.minimum", 0, 0.1, ".1.3.6.1.4.1.705.1.6.2.1.4.1", "", SU_INPUT_1, NULL }, - { "input.L1-N.voltage.minimum", 0, 0.1, ".1.3.6.1.4.1.705.1.6.2.1.4.1", "", SU_INPUT_3, NULL }, - { "input.L2-N.voltage.minimum", 0, 0.1, ".1.3.6.1.4.1.705.1.6.2.1.4.2", "", SU_INPUT_3, NULL }, - { "input.L3-N.voltage.minimum", 0, 0.1, ".1.3.6.1.4.1.705.1.6.2.1.4.3", "", SU_INPUT_3, NULL }, - { "input.voltage.maximum", 0, 0.1, ".1.3.6.1.4.1.705.1.6.2.1.5.1", "", SU_INPUT_1, NULL }, - { "input.L1-N.voltage.maximum", 0, 0.1, ".1.3.6.1.4.1.705.1.6.2.1.5.1", "", SU_INPUT_3, NULL }, - { "input.L2-N.voltage.maximum", 0, 0.1, ".1.3.6.1.4.1.705.1.6.2.1.5.2", "", SU_INPUT_3, NULL }, - { "input.L3-N.voltage.maximum", 0, 0.1, ".1.3.6.1.4.1.705.1.6.2.1.5.3", "", SU_INPUT_3, NULL }, - { "input.current", 0, 0.1, ".1.3.6.1.4.1.705.1.6.2.1.6.1", "", SU_INPUT_1, NULL }, - { "input.L1.current", 0, 0.1, ".1.3.6.1.4.1.705.1.6.2.1.6.1", "", SU_INPUT_3, NULL }, - { "input.L2.current", 0, 0.1, ".1.3.6.1.4.1.705.1.6.2.1.6.2", "", SU_INPUT_3, NULL }, - { "input.L3.current", 0, 0.1, ".1.3.6.1.4.1.705.1.6.2.1.6.3", "", SU_INPUT_3, NULL }, - { "input.transfer.reason", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.705.1.6.4.0", "", SU_FLAG_OK, mge_transfer_reason_info }, + snmp_info_default("input.phases", 0, 1.0, ".1.3.6.1.4.1.705.1.6.1.0", "", 0, NULL), + snmp_info_default("input.voltage", 0, 0.1, ".1.3.6.1.4.1.705.1.6.2.1.2.1", "", SU_INPUT_1, NULL), + snmp_info_default("input.L1-N.voltage", 0, 0.1, ".1.3.6.1.4.1.705.1.6.2.1.2.1", "", SU_INPUT_3, NULL), + snmp_info_default("input.L2-N.voltage", 0, 0.1, ".1.3.6.1.4.1.705.1.6.2.1.2.2", "", SU_INPUT_3, NULL), + snmp_info_default("input.L3-N.voltage", 0, 0.1, ".1.3.6.1.4.1.705.1.6.2.1.2.3", "", SU_INPUT_3, NULL), + snmp_info_default("input.frequency", 0, 0.1, ".1.3.6.1.4.1.705.1.6.2.1.3.1", "", SU_INPUT_1, NULL), + snmp_info_default("input.L1.frequency", 0, 0.1, ".1.3.6.1.4.1.705.1.6.2.1.3.1", "", SU_INPUT_3, NULL), + snmp_info_default("input.L2.frequency", 0, 0.1, ".1.3.6.1.4.1.705.1.6.2.1.3.2", "", SU_INPUT_3, NULL), + snmp_info_default("input.L3.frequency", 0, 0.1, ".1.3.6.1.4.1.705.1.6.2.1.3.3", "", SU_INPUT_3, NULL), + snmp_info_default("input.voltage.minimum", 0, 0.1, ".1.3.6.1.4.1.705.1.6.2.1.4.1", "", SU_INPUT_1, NULL), + snmp_info_default("input.L1-N.voltage.minimum", 0, 0.1, ".1.3.6.1.4.1.705.1.6.2.1.4.1", "", SU_INPUT_3, NULL), + snmp_info_default("input.L2-N.voltage.minimum", 0, 0.1, ".1.3.6.1.4.1.705.1.6.2.1.4.2", "", SU_INPUT_3, NULL), + snmp_info_default("input.L3-N.voltage.minimum", 0, 0.1, ".1.3.6.1.4.1.705.1.6.2.1.4.3", "", SU_INPUT_3, NULL), + snmp_info_default("input.voltage.maximum", 0, 0.1, ".1.3.6.1.4.1.705.1.6.2.1.5.1", "", SU_INPUT_1, NULL), + snmp_info_default("input.L1-N.voltage.maximum", 0, 0.1, ".1.3.6.1.4.1.705.1.6.2.1.5.1", "", SU_INPUT_3, NULL), + snmp_info_default("input.L2-N.voltage.maximum", 0, 0.1, ".1.3.6.1.4.1.705.1.6.2.1.5.2", "", SU_INPUT_3, NULL), + snmp_info_default("input.L3-N.voltage.maximum", 0, 0.1, ".1.3.6.1.4.1.705.1.6.2.1.5.3", "", SU_INPUT_3, NULL), + snmp_info_default("input.current", 0, 0.1, ".1.3.6.1.4.1.705.1.6.2.1.6.1", "", SU_INPUT_1, NULL), + snmp_info_default("input.L1.current", 0, 0.1, ".1.3.6.1.4.1.705.1.6.2.1.6.1", "", SU_INPUT_3, NULL), + snmp_info_default("input.L2.current", 0, 0.1, ".1.3.6.1.4.1.705.1.6.2.1.6.2", "", SU_INPUT_3, NULL), + snmp_info_default("input.L3.current", 0, 0.1, ".1.3.6.1.4.1.705.1.6.2.1.6.3", "", SU_INPUT_3, NULL), + snmp_info_default("input.transfer.reason", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.705.1.6.4.0", "", SU_FLAG_OK, mge_transfer_reason_info), /* Output page */ - { "output.phases", 0, 1.0, ".1.3.6.1.4.1.705.1.7.1.0", "", 0, NULL }, - { "output.voltage", 0, 0.1, ".1.3.6.1.4.1.705.1.7.2.1.2.1", "", SU_OUTPUT_1, NULL }, - { "output.L1-N.voltage", 0, 0.1, ".1.3.6.1.4.1.705.1.7.2.1.2.1", "", SU_OUTPUT_3, NULL }, - { "output.L2-N.voltage", 0, 0.1, ".1.3.6.1.4.1.705.1.7.2.1.2.2", "", SU_OUTPUT_3, NULL }, - { "output.L3-N.voltage", 0, 0.1, ".1.3.6.1.4.1.705.1.7.2.1.2.3", "", SU_OUTPUT_3, NULL }, - { "output.frequency", 0, 0.1, ".1.3.6.1.4.1.705.1.7.2.1.3.1", "", SU_OUTPUT_1, NULL }, - { "output.L1.frequency", 0, 0.1, ".1.3.6.1.4.1.705.1.7.2.1.3.1", "", SU_OUTPUT_3, NULL }, - { "output.L2.frequency", 0, 0.1, ".1.3.6.1.4.1.705.1.7.2.1.3.2", "", SU_OUTPUT_3, NULL }, - { "output.L3.frequency", 0, 0.1, ".1.3.6.1.4.1.705.1.7.2.1.3.3", "", SU_OUTPUT_3, NULL }, - { "output.current", 0, 0.1, ".1.3.6.1.4.1.705.1.7.2.1.5.1", "", SU_OUTPUT_1, NULL }, - { "output.L1.current", 0, 0.1, ".1.3.6.1.4.1.705.1.7.2.1.5.1", "", SU_OUTPUT_3, NULL }, - { "output.L2.current", 0, 0.1, ".1.3.6.1.4.1.705.1.7.2.1.5.2", "", SU_OUTPUT_3, NULL }, - { "output.L3.current", 0, 0.1, ".1.3.6.1.4.1.705.1.7.2.1.5.3", "", SU_OUTPUT_3, NULL }, + snmp_info_default("output.phases", 0, 1.0, ".1.3.6.1.4.1.705.1.7.1.0", "", 0, NULL), + snmp_info_default("output.voltage", 0, 0.1, ".1.3.6.1.4.1.705.1.7.2.1.2.1", "", SU_OUTPUT_1, NULL), + snmp_info_default("output.L1-N.voltage", 0, 0.1, ".1.3.6.1.4.1.705.1.7.2.1.2.1", "", SU_OUTPUT_3, NULL), + snmp_info_default("output.L2-N.voltage", 0, 0.1, ".1.3.6.1.4.1.705.1.7.2.1.2.2", "", SU_OUTPUT_3, NULL), + snmp_info_default("output.L3-N.voltage", 0, 0.1, ".1.3.6.1.4.1.705.1.7.2.1.2.3", "", SU_OUTPUT_3, NULL), + snmp_info_default("output.frequency", 0, 0.1, ".1.3.6.1.4.1.705.1.7.2.1.3.1", "", SU_OUTPUT_1, NULL), + snmp_info_default("output.L1.frequency", 0, 0.1, ".1.3.6.1.4.1.705.1.7.2.1.3.1", "", SU_OUTPUT_3, NULL), + snmp_info_default("output.L2.frequency", 0, 0.1, ".1.3.6.1.4.1.705.1.7.2.1.3.2", "", SU_OUTPUT_3, NULL), + snmp_info_default("output.L3.frequency", 0, 0.1, ".1.3.6.1.4.1.705.1.7.2.1.3.3", "", SU_OUTPUT_3, NULL), + snmp_info_default("output.current", 0, 0.1, ".1.3.6.1.4.1.705.1.7.2.1.5.1", "", SU_OUTPUT_1, NULL), + snmp_info_default("output.L1.current", 0, 0.1, ".1.3.6.1.4.1.705.1.7.2.1.5.1", "", SU_OUTPUT_3, NULL), + snmp_info_default("output.L2.current", 0, 0.1, ".1.3.6.1.4.1.705.1.7.2.1.5.2", "", SU_OUTPUT_3, NULL), + snmp_info_default("output.L3.current", 0, 0.1, ".1.3.6.1.4.1.705.1.7.2.1.5.3", "", SU_OUTPUT_3, NULL), /* Battery page */ - { "battery.charge", 0, 1, ".1.3.6.1.4.1.705.1.5.2.0", "", SU_FLAG_OK, NULL }, - { "battery.runtime", 0, 1, ".1.3.6.1.4.1.705.1.5.1.0", "", SU_FLAG_OK, NULL }, - { "battery.runtime.low", 0, 1, ".1.3.6.1.4.1.705.1.4.7.0", "", SU_FLAG_OK, NULL }, - { "battery.charge.low", ST_FLAG_STRING | ST_FLAG_RW, 2, ".1.3.6.1.4.1.705.1.4.8.0", "", SU_TYPE_INT | SU_FLAG_OK, NULL }, - { "battery.voltage", 0, 0.1, ".1.3.6.1.4.1.705.1.5.5.0", "", SU_FLAG_OK, NULL }, + snmp_info_default("battery.charge", 0, 1, ".1.3.6.1.4.1.705.1.5.2.0", "", SU_FLAG_OK, NULL), + snmp_info_default("battery.runtime", 0, 1, ".1.3.6.1.4.1.705.1.5.1.0", "", SU_FLAG_OK, NULL), + snmp_info_default("battery.runtime.low", 0, 1, ".1.3.6.1.4.1.705.1.4.7.0", "", SU_FLAG_OK, NULL), + snmp_info_default("battery.charge.low", ST_FLAG_STRING | ST_FLAG_RW, 2, ".1.3.6.1.4.1.705.1.4.8.0", "", SU_TYPE_INT | SU_FLAG_OK, NULL), + snmp_info_default("battery.voltage", 0, 0.1, ".1.3.6.1.4.1.705.1.5.5.0", "", SU_FLAG_OK, NULL), /* Ambient page: Environment Sensor (ref 66 846) */ - { "ambient.temperature", 0, 0.1, ".1.3.6.1.4.1.705.1.8.1.0", "", SU_TYPE_INT | SU_FLAG_OK, NULL }, - { "ambient.humidity", 0, 0.1, ".1.3.6.1.4.1.705.1.8.2.0", "", SU_TYPE_INT | SU_FLAG_OK, NULL }, + snmp_info_default("ambient.temperature", 0, 0.1, ".1.3.6.1.4.1.705.1.8.1.0", "", SU_TYPE_INT | SU_FLAG_OK, NULL), + snmp_info_default("ambient.humidity", 0, 0.1, ".1.3.6.1.4.1.705.1.8.2.0", "", SU_TYPE_INT | SU_FLAG_OK, NULL), /* upsmgEnvironmentInput1State.1 */ - { "ambient.contacts.1.status", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.705.1.8.7.1.9.1", "", SU_TYPE_INT | SU_FLAG_OK, mge_ambient_drycontacts_info }, + snmp_info_default("ambient.contacts.1.status", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.705.1.8.7.1.9.1", "", SU_TYPE_INT | SU_FLAG_OK, mge_ambient_drycontacts_info), /* upsmgEnvironmentInput1State.1 */ - { "ambient.contacts.2.status", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.705.1.8.7.1.10.1", "", SU_TYPE_INT | SU_FLAG_OK, mge_ambient_drycontacts_info }, + snmp_info_default("ambient.contacts.2.status", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.705.1.8.7.1.10.1", "", SU_TYPE_INT | SU_FLAG_OK, mge_ambient_drycontacts_info), /* Outlet page */ - { "outlet.id", 0, 1, NULL, "0", SU_FLAG_STATIC | SU_FLAG_ABSENT | SU_FLAG_OK, NULL }, - { "outlet.desc", ST_FLAG_RW | ST_FLAG_STRING, 20, NULL, "Main Outlet", SU_FLAG_STATIC | SU_FLAG_ABSENT | SU_FLAG_OK, NULL }, + snmp_info_default("outlet.id", 0, 1, NULL, "0", SU_FLAG_STATIC | SU_FLAG_ABSENT | SU_FLAG_OK, NULL), + snmp_info_default("outlet.desc", ST_FLAG_RW | ST_FLAG_STRING, 20, NULL, "Main Outlet", SU_FLAG_STATIC | SU_FLAG_ABSENT | SU_FLAG_OK, NULL), /* instant commands. */ - { "test.battery.start", 0, 1, ".1.3.6.1.4.1.705.1.10.4.0", MGE_START_VALUE, SU_TYPE_CMD | SU_FLAG_OK, NULL }, + snmp_info_default("test.battery.start", 0, 1, ".1.3.6.1.4.1.705.1.10.4.0", MGE_START_VALUE, SU_TYPE_CMD | SU_FLAG_OK, NULL), /* Also use IETF OIDs - * { "test.battery.stop", 0, 0, "1.3.6.1.2.1.33.1.7.1.0", "1.3.6.1.2.1.33.1.7.7.2", SU_TYPE_CMD, NULL }, - * { "test.battery.start", 0, 0, "1.3.6.1.2.1.33.1.7.1.0", "1.3.6.1.2.1.33.1.7.7.3", SU_TYPE_CMD, NULL }, - * { "test.battery.start.quick", 0, 0, "1.3.6.1.2.1.33.1.7.1.0", "1.3.6.1.2.1.33.1.7.7.4", SU_TYPE_CMD, NULL }, - * { "test.battery.start.deep", 0, 0, "1.3.6.1.2.1.33.1.7.1.0", "1.3.6.1.2.1.33.1.7.7.5", SU_TYPE_CMD, NULL }, + * snmp_info_default("test.battery.stop", 0, 0, "1.3.6.1.2.1.33.1.7.1.0", "1.3.6.1.2.1.33.1.7.7.2", SU_TYPE_CMD, NULL), + * snmp_info_default("test.battery.start", 0, 0, "1.3.6.1.2.1.33.1.7.1.0", "1.3.6.1.2.1.33.1.7.7.3", SU_TYPE_CMD, NULL), + * snmp_info_default("test.battery.start.quick", 0, 0, "1.3.6.1.2.1.33.1.7.1.0", "1.3.6.1.2.1.33.1.7.7.4", SU_TYPE_CMD, NULL), + * snmp_info_default("test.battery.start.deep", 0, 0, "1.3.6.1.2.1.33.1.7.1.0", "1.3.6.1.2.1.33.1.7.7.5", SU_TYPE_CMD, NULL), */ - /* { "load.off", 0, 1, ".1.3.6.1.4.1.705.1.9.1.1.6.1", MGE_START_VALUE, SU_TYPE_CMD | SU_FLAG_OK, NULL }, - * { "load.on", 0, 1, ".1.3.6.1.4.1.705.1.9.1.1.3.1", MGE_START_VALUE, SU_TYPE_CMD | SU_FLAG_OK, NULL }, - * { "shutdown.return", 0, 1, ".1.3.6.1.4.1.705.1.9.1.1.9.1", MGE_START_VALUE, SU_TYPE_CMD | SU_FLAG_OK, NULL }, + /* snmp_info_default("load.off", 0, 1, ".1.3.6.1.4.1.705.1.9.1.1.6.1", MGE_START_VALUE, SU_TYPE_CMD | SU_FLAG_OK, NULL), + * snmp_info_default("load.on", 0, 1, ".1.3.6.1.4.1.705.1.9.1.1.3.1", MGE_START_VALUE, SU_TYPE_CMD | SU_FLAG_OK, NULL), + * snmp_info_default("shutdown.return", 0, 1, ".1.3.6.1.4.1.705.1.9.1.1.9.1", MGE_START_VALUE, SU_TYPE_CMD | SU_FLAG_OK, NULL), */ /* IETF MIB fallback */ - { "beeper.disable", 0, 1, "1.3.6.1.2.1.33.1.9.8.0", "1", SU_TYPE_CMD, NULL }, - { "beeper.enable", 0, 1, "1.3.6.1.2.1.33.1.9.8.0", "2", SU_TYPE_CMD, NULL }, - { "beeper.mute", 0, 1, "1.3.6.1.2.1.33.1.9.8.0", "3", SU_TYPE_CMD, NULL }, - /*{ "load.off", 0, 1, "1.3.6.1.2.1.33.1.8.2.0", DEFAULT_OFFDELAY, SU_TYPE_CMD, NULL }, - { "load.on", 0, 1, "1.3.6.1.2.1.33.1.8.3.0", DEFAULT_ONDELAY, SU_TYPE_CMD, NULL },*/ - { "load.off.delay", 0, 1, "1.3.6.1.2.1.33.1.8.2.0", NULL, SU_TYPE_CMD, NULL }, - { "load.on.delay", 0, 1, "1.3.6.1.2.1.33.1.8.3.0", NULL, SU_TYPE_CMD, NULL }, + snmp_info_default("beeper.disable", 0, 1, "1.3.6.1.2.1.33.1.9.8.0", "1", SU_TYPE_CMD, NULL), + snmp_info_default("beeper.enable", 0, 1, "1.3.6.1.2.1.33.1.9.8.0", "2", SU_TYPE_CMD, NULL), + snmp_info_default("beeper.mute", 0, 1, "1.3.6.1.2.1.33.1.9.8.0", "3", SU_TYPE_CMD, NULL), +/* + snmp_info_default("load.off", 0, 1, "1.3.6.1.2.1.33.1.8.2.0", DEFAULT_OFFDELAY, SU_TYPE_CMD, NULL), + snmp_info_default("load.on", 0, 1, "1.3.6.1.2.1.33.1.8.3.0", DEFAULT_ONDELAY, SU_TYPE_CMD, NULL), +*/ + snmp_info_default("load.off.delay", 0, 1, "1.3.6.1.2.1.33.1.8.2.0", NULL, SU_TYPE_CMD, NULL), + snmp_info_default("load.on.delay", 0, 1, "1.3.6.1.2.1.33.1.8.3.0", NULL, SU_TYPE_CMD, NULL), /* end of structure. */ - { NULL, 0, 0, NULL, NULL, 0, NULL } + snmp_info_sentinel }; mib2nut_info_t mge = { "mge", MGE_MIB_VERSION, NULL, MGE_OID_MODEL_NAME, mge_mib, MGE_SYSOID, NULL }; diff --git a/drivers/netvision-mib.c b/drivers/netvision-mib.c index 51f4073655..ec9ae86c0b 100644 --- a/drivers/netvision-mib.c +++ b/drivers/netvision-mib.c @@ -39,19 +39,19 @@ /* UPS Battery */ #define NETVISION_OID_BATTERYSTATUS ".1.3.6.1.4.1.4555.1.1.1.1.2.1.0" static info_lkp_t netvision_batt_info[] = { - { 2, "", NULL, NULL }, /* battery normal */ - { 3, "LB", NULL, NULL }, /* battery low */ - { 4, "LB", NULL, NULL }, /* battery depleted */ - { 5, "DISCHRG", NULL, NULL }, /* battery discharging */ - { 6, "RB", NULL, NULL }, /* battery failure */ - { 0, NULL, NULL, NULL } + info_lkp_default(2, ""), /* battery normal */ + info_lkp_default(3, "LB"), /* battery low */ + info_lkp_default(4, "LB"), /* battery depleted */ + info_lkp_default(5, "DISCHRG"), /* battery discharging */ + info_lkp_default(6, "RB"), /* battery failure */ + info_lkp_sentinel }; /* Battery status: upsAlarmOnBattery */ static info_lkp_t netvision_onbatt_info[] = { - { 0, "OL", NULL, NULL }, /* Online */ - { 1, "OB", NULL, NULL }, /* On battery */ - { 0, NULL, NULL, NULL } + info_lkp_default(0, "OL"), /* Online */ + info_lkp_default(1, "OB"), /* On battery */ + info_lkp_sentinel }; #define NETVISION_OID_SECONDSONBATTERY ".1.3.6.1.4.1.4555.1.1.1.1.2.2.0" @@ -101,90 +101,90 @@ static info_lkp_t netvision_onbatt_info[] = { #define NETVISION_OID_CONTROL_SHUTDOWN_DELAY ".1.3.6.1.4.1.4555.1.1.1.1.8.2" static info_lkp_t netvision_output_info[] = { - { 1, "", NULL, NULL }, /* output source other */ - { 2, "", NULL, NULL }, /* output source none */ - { 3, "OL", NULL, NULL }, /* output source normal */ - { 4, "OL BYPASS", NULL, NULL }, /* output source bypass */ - { 5, "OB", NULL, NULL }, /* output source battery */ - { 6, "OL BOOST", NULL, NULL }, /* output source booster */ - { 7, "OL TRIM", NULL, NULL }, /* output source reducer */ - { 8, "OL", NULL, NULL }, /* output source standby */ - { 9, "", NULL, NULL }, /* output source ecomode */ - { 0, NULL, NULL, NULL } + info_lkp_default(1, ""), /* output source other */ + info_lkp_default(2, ""), /* output source none */ + info_lkp_default(3, "OL"), /* output source normal */ + info_lkp_default(4, "OL BYPASS"), /* output source bypass */ + info_lkp_default(5, "OB"), /* output source battery */ + info_lkp_default(6, "OL BOOST"), /* output source booster */ + info_lkp_default(7, "OL TRIM"), /* output source reducer */ + info_lkp_default(8, "OL"), /* output source standby */ + info_lkp_default(9, ""), /* output source ecomode */ + info_lkp_sentinel }; /* Snmp2NUT lookup table */ static snmp_info_t netvision_mib[] = { /* standard MIB items */ - { "device.description", ST_FLAG_STRING | ST_FLAG_RW, SU_INFOSIZE, ".1.3.6.1.2.1.1.1.0", NULL, SU_FLAG_OK, NULL }, - { "device.contact", ST_FLAG_STRING | ST_FLAG_RW, SU_INFOSIZE, ".1.3.6.1.2.1.1.4.0", NULL, SU_FLAG_OK, NULL }, - { "device.location", ST_FLAG_STRING | ST_FLAG_RW, SU_INFOSIZE, ".1.3.6.1.2.1.1.6.0", NULL, SU_FLAG_OK, NULL }, - - { "ups.mfr", ST_FLAG_STRING, SU_INFOSIZE, NETVISION_OID_UPSIDENTAGENTSWVERSION, "SOCOMEC SICON UPS", - SU_FLAG_STATIC | SU_FLAG_OK, NULL }, - { "ups.model", ST_FLAG_STRING, SU_INFOSIZE, NETVISION_OID_UPSIDENTMODEL, - "Generic SNMP UPS", SU_FLAG_STATIC | SU_FLAG_OK, NULL }, - { "ups.serial", ST_FLAG_STRING, SU_INFOSIZE, NETVISION_OID_UPSIDENTUPSSERIALNUMBER, "", - SU_FLAG_STATIC | SU_FLAG_OK, NULL }, - { "ups.firmware.aux", ST_FLAG_STRING, SU_INFOSIZE, NETVISION_OID_UPSIDENTFWVERSION, "", - SU_FLAG_STATIC | SU_FLAG_OK, NULL }, - { "ups.status", ST_FLAG_STRING, SU_INFOSIZE, NETVISION_OID_BATTERYSTATUS, "", - SU_FLAG_OK | SU_STATUS_BATT, &netvision_batt_info[0] }, - { "ups.status", ST_FLAG_STRING, SU_INFOSIZE, NETVISION_OID_OUTPUT_SOURCE, "", - SU_FLAG_OK | SU_STATUS_PWR, &netvision_output_info[0] }, + snmp_info_default("device.description", ST_FLAG_STRING | ST_FLAG_RW, SU_INFOSIZE, ".1.3.6.1.2.1.1.1.0", NULL, SU_FLAG_OK, NULL), + snmp_info_default("device.contact", ST_FLAG_STRING | ST_FLAG_RW, SU_INFOSIZE, ".1.3.6.1.2.1.1.4.0", NULL, SU_FLAG_OK, NULL), + snmp_info_default("device.location", ST_FLAG_STRING | ST_FLAG_RW, SU_INFOSIZE, ".1.3.6.1.2.1.1.6.0", NULL, SU_FLAG_OK, NULL), + + snmp_info_default("ups.mfr", ST_FLAG_STRING, SU_INFOSIZE, NETVISION_OID_UPSIDENTAGENTSWVERSION, "SOCOMEC SICON UPS", + SU_FLAG_STATIC | SU_FLAG_OK, NULL), + snmp_info_default("ups.model", ST_FLAG_STRING, SU_INFOSIZE, NETVISION_OID_UPSIDENTMODEL, + "Generic SNMP UPS", SU_FLAG_STATIC | SU_FLAG_OK, NULL), + snmp_info_default("ups.serial", ST_FLAG_STRING, SU_INFOSIZE, NETVISION_OID_UPSIDENTUPSSERIALNUMBER, "", + SU_FLAG_STATIC | SU_FLAG_OK, NULL), + snmp_info_default("ups.firmware.aux", ST_FLAG_STRING, SU_INFOSIZE, NETVISION_OID_UPSIDENTFWVERSION, "", + SU_FLAG_STATIC | SU_FLAG_OK, NULL), + snmp_info_default("ups.status", ST_FLAG_STRING, SU_INFOSIZE, NETVISION_OID_BATTERYSTATUS, "", + SU_FLAG_OK | SU_STATUS_BATT, &netvision_batt_info[0]), + snmp_info_default("ups.status", ST_FLAG_STRING, SU_INFOSIZE, NETVISION_OID_OUTPUT_SOURCE, "", + SU_FLAG_OK | SU_STATUS_PWR, &netvision_output_info[0]), /* upsAlarmOnBattery */ - { "ups.status", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.4555.1.1.1.1.6.3.2.0", "", - SU_FLAG_OK | SU_STATUS_PWR, &netvision_onbatt_info[0] }, + snmp_info_default("ups.status", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.4555.1.1.1.1.6.3.2.0", "", + SU_FLAG_OK | SU_STATUS_PWR, &netvision_onbatt_info[0]), /* ups load */ - { "ups.load", 0, 1, NETVISION_OID_OUT_LOAD_PCT_P1, 0, SU_INPUT_1, NULL }, + snmp_info_default("ups.load", 0, 1, NETVISION_OID_OUT_LOAD_PCT_P1, 0, SU_INPUT_1, NULL), /*ups input,output voltage, output frquency phase 1 */ - { "input.phases", 0, 1.0, NETVISION_OID_INPUT_NUM_LINES, NULL, 0, NULL }, - { "input.frequency", 0, 0.1, NETVISION_OID_INPUT_FREQ, NULL, SU_FLAG_OK, NULL }, - { "input.voltage", 0, 0.1, NETVISION_OID_IN_VOLTAGE_P1, NULL, SU_INPUT_1, NULL }, - { "input.current", 0, 0.1, NETVISION_OID_IN_CURRENT_P1, NULL, SU_INPUT_1, NULL }, - { "input.L1-N.voltage", 0, 0.1, NETVISION_OID_IN_VOLTAGE_P1, NULL, SU_INPUT_3, NULL }, - { "input.L1.current", 0, 0.1, NETVISION_OID_IN_CURRENT_P1, NULL, SU_INPUT_3, NULL }, - { "input.L2-N.voltage", 0, 0.1, NETVISION_OID_IN_VOLTAGE_P2, NULL, SU_INPUT_3, NULL }, - { "input.L2.current", 0, 0.1, NETVISION_OID_IN_CURRENT_P2, NULL, SU_INPUT_3, NULL }, - { "input.L3-N.voltage", 0, 0.1, NETVISION_OID_IN_VOLTAGE_P3, NULL, SU_INPUT_3, NULL }, - { "input.L3.current", 0, 0.1, NETVISION_OID_IN_CURRENT_P3, NULL, SU_INPUT_3, NULL }, - - { "output.phases", 0, 1.0, NETVISION_OID_OUTPUT_NUM_LINES, NULL, 0, NULL }, - { "output.frequency", 0, 0.1, NETVISION_OID_OUTPUT_FREQ, NULL, SU_FLAG_OK, NULL }, - { "output.voltage", 0, 0.1, NETVISION_OID_OUT_VOLTAGE_P1, NULL, SU_OUTPUT_1, NULL }, - { "output.current", 0, 0.1, NETVISION_OID_OUT_CURRENT_P1, NULL, SU_OUTPUT_1, NULL }, - { "output.load", 0, 1.0, NETVISION_OID_OUT_LOAD_PCT_P1, NULL, SU_OUTPUT_1, NULL }, - { "output.L1-N.voltage", 0, 0.1, NETVISION_OID_OUT_VOLTAGE_P1, NULL, SU_OUTPUT_3, NULL }, - { "output.L1.current", 0, 0.1, NETVISION_OID_OUT_CURRENT_P1, NULL, SU_OUTPUT_3, NULL }, - { "output.L1.power.percent", 0, 1.0, NETVISION_OID_OUT_LOAD_PCT_P1, NULL, SU_OUTPUT_3, NULL }, - { "output.L2-N.voltage", 0, 0.1, NETVISION_OID_OUT_VOLTAGE_P2, NULL, SU_OUTPUT_3, NULL }, - { "output.L2.current", 0, 0.1, NETVISION_OID_OUT_CURRENT_P2, NULL, SU_OUTPUT_3, NULL }, - { "output.L2.power.percent", 0, 1.0, NETVISION_OID_OUT_LOAD_PCT_P2, NULL, SU_OUTPUT_3, NULL }, - { "output.L3-N.voltage", 0, 0.1, NETVISION_OID_OUT_VOLTAGE_P3, NULL, SU_OUTPUT_3, NULL }, - { "output.L3.current", 0, 0.1, NETVISION_OID_OUT_CURRENT_P3, NULL, SU_OUTPUT_3, NULL }, - { "output.L3.power.percent", 0, 1.0, NETVISION_OID_OUT_LOAD_PCT_P3, NULL, SU_OUTPUT_3, NULL }, - - { "input.bypass.phases", 0, 1.0, NETVISION_OID_BYPASS_NUM_LINES, NULL, 0, NULL }, - { "input.bypass.frequency", 0, 0.1, NETVISION_OID_BYPASS_FREQ, NULL, SU_FLAG_OK, NULL }, - { "input.bypass.voltage", 0, 0.1, NETVISION_OID_BY_VOLTAGE_P1, NULL, SU_BYPASS_1, NULL }, - { "input.bypass.current", 0, 0.1, NETVISION_OID_BY_CURRENT_P1, NULL, SU_BYPASS_1, NULL }, - { "input.bypass.L1-N.voltage", 0, 0.1, NETVISION_OID_BY_VOLTAGE_P1, NULL, SU_BYPASS_3, NULL }, - { "input.bypass.L1.current", 0, 0.1, NETVISION_OID_BY_CURRENT_P1, NULL, SU_BYPASS_3, NULL }, - { "input.bypass.L2-N.voltage", 0, 0.1, NETVISION_OID_BY_VOLTAGE_P2, NULL, SU_BYPASS_3, NULL }, - { "input.bypass.L2.current", 0, 0.1, NETVISION_OID_BY_CURRENT_P2, NULL, SU_BYPASS_3, NULL }, - { "input.bypass.L3-N.voltage", 0, 0.1, NETVISION_OID_BY_VOLTAGE_P3, NULL, SU_BYPASS_3, NULL }, - { "input.bypass.L3.current", 0, 0.1, NETVISION_OID_BY_CURRENT_P3, NULL, SU_BYPASS_3, NULL }, + snmp_info_default("input.phases", 0, 1.0, NETVISION_OID_INPUT_NUM_LINES, NULL, 0, NULL), + snmp_info_default("input.frequency", 0, 0.1, NETVISION_OID_INPUT_FREQ, NULL, SU_FLAG_OK, NULL), + snmp_info_default("input.voltage", 0, 0.1, NETVISION_OID_IN_VOLTAGE_P1, NULL, SU_INPUT_1, NULL), + snmp_info_default("input.current", 0, 0.1, NETVISION_OID_IN_CURRENT_P1, NULL, SU_INPUT_1, NULL), + snmp_info_default("input.L1-N.voltage", 0, 0.1, NETVISION_OID_IN_VOLTAGE_P1, NULL, SU_INPUT_3, NULL), + snmp_info_default("input.L1.current", 0, 0.1, NETVISION_OID_IN_CURRENT_P1, NULL, SU_INPUT_3, NULL), + snmp_info_default("input.L2-N.voltage", 0, 0.1, NETVISION_OID_IN_VOLTAGE_P2, NULL, SU_INPUT_3, NULL), + snmp_info_default("input.L2.current", 0, 0.1, NETVISION_OID_IN_CURRENT_P2, NULL, SU_INPUT_3, NULL), + snmp_info_default("input.L3-N.voltage", 0, 0.1, NETVISION_OID_IN_VOLTAGE_P3, NULL, SU_INPUT_3, NULL), + snmp_info_default("input.L3.current", 0, 0.1, NETVISION_OID_IN_CURRENT_P3, NULL, SU_INPUT_3, NULL), + + snmp_info_default("output.phases", 0, 1.0, NETVISION_OID_OUTPUT_NUM_LINES, NULL, 0, NULL), + snmp_info_default("output.frequency", 0, 0.1, NETVISION_OID_OUTPUT_FREQ, NULL, SU_FLAG_OK, NULL), + snmp_info_default("output.voltage", 0, 0.1, NETVISION_OID_OUT_VOLTAGE_P1, NULL, SU_OUTPUT_1, NULL), + snmp_info_default("output.current", 0, 0.1, NETVISION_OID_OUT_CURRENT_P1, NULL, SU_OUTPUT_1, NULL), + snmp_info_default("output.load", 0, 1.0, NETVISION_OID_OUT_LOAD_PCT_P1, NULL, SU_OUTPUT_1, NULL), + snmp_info_default("output.L1-N.voltage", 0, 0.1, NETVISION_OID_OUT_VOLTAGE_P1, NULL, SU_OUTPUT_3, NULL), + snmp_info_default("output.L1.current", 0, 0.1, NETVISION_OID_OUT_CURRENT_P1, NULL, SU_OUTPUT_3, NULL), + snmp_info_default("output.L1.power.percent", 0, 1.0, NETVISION_OID_OUT_LOAD_PCT_P1, NULL, SU_OUTPUT_3, NULL), + snmp_info_default("output.L2-N.voltage", 0, 0.1, NETVISION_OID_OUT_VOLTAGE_P2, NULL, SU_OUTPUT_3, NULL), + snmp_info_default("output.L2.current", 0, 0.1, NETVISION_OID_OUT_CURRENT_P2, NULL, SU_OUTPUT_3, NULL), + snmp_info_default("output.L2.power.percent", 0, 1.0, NETVISION_OID_OUT_LOAD_PCT_P2, NULL, SU_OUTPUT_3, NULL), + snmp_info_default("output.L3-N.voltage", 0, 0.1, NETVISION_OID_OUT_VOLTAGE_P3, NULL, SU_OUTPUT_3, NULL), + snmp_info_default("output.L3.current", 0, 0.1, NETVISION_OID_OUT_CURRENT_P3, NULL, SU_OUTPUT_3, NULL), + snmp_info_default("output.L3.power.percent", 0, 1.0, NETVISION_OID_OUT_LOAD_PCT_P3, NULL, SU_OUTPUT_3, NULL), + + snmp_info_default("input.bypass.phases", 0, 1.0, NETVISION_OID_BYPASS_NUM_LINES, NULL, 0, NULL), + snmp_info_default("input.bypass.frequency", 0, 0.1, NETVISION_OID_BYPASS_FREQ, NULL, SU_FLAG_OK, NULL), + snmp_info_default("input.bypass.voltage", 0, 0.1, NETVISION_OID_BY_VOLTAGE_P1, NULL, SU_BYPASS_1, NULL), + snmp_info_default("input.bypass.current", 0, 0.1, NETVISION_OID_BY_CURRENT_P1, NULL, SU_BYPASS_1, NULL), + snmp_info_default("input.bypass.L1-N.voltage", 0, 0.1, NETVISION_OID_BY_VOLTAGE_P1, NULL, SU_BYPASS_3, NULL), + snmp_info_default("input.bypass.L1.current", 0, 0.1, NETVISION_OID_BY_CURRENT_P1, NULL, SU_BYPASS_3, NULL), + snmp_info_default("input.bypass.L2-N.voltage", 0, 0.1, NETVISION_OID_BY_VOLTAGE_P2, NULL, SU_BYPASS_3, NULL), + snmp_info_default("input.bypass.L2.current", 0, 0.1, NETVISION_OID_BY_CURRENT_P2, NULL, SU_BYPASS_3, NULL), + snmp_info_default("input.bypass.L3-N.voltage", 0, 0.1, NETVISION_OID_BY_VOLTAGE_P3, NULL, SU_BYPASS_3, NULL), + snmp_info_default("input.bypass.L3.current", 0, 0.1, NETVISION_OID_BY_CURRENT_P3, NULL, SU_BYPASS_3, NULL), /* battery info */ - { "battery.charge", 0, 1, NETVISION_OID_BATT_CHARGE, "", SU_FLAG_OK, NULL }, - { "battery.voltage", 0, 0.1, NETVISION_OID_BATT_VOLTS, "", SU_FLAG_OK, NULL }, - { "battery.runtime", 0, 60, NETVISION_OID_BATT_RUNTIME_REMAINING, "", SU_FLAG_OK, NULL }, + snmp_info_default("battery.charge", 0, 1, NETVISION_OID_BATT_CHARGE, "", SU_FLAG_OK, NULL), + snmp_info_default("battery.voltage", 0, 0.1, NETVISION_OID_BATT_VOLTS, "", SU_FLAG_OK, NULL), + snmp_info_default("battery.runtime", 0, 60, NETVISION_OID_BATT_RUNTIME_REMAINING, "", SU_FLAG_OK, NULL), /* end of structure. */ - { NULL, 0, 0, NULL, NULL, 0, NULL } + snmp_info_sentinel }; mib2nut_info_t netvision = { "netvision", NETVISION_MIB_VERSION, NULL, NETVISION_OID_UPSIDENTMODEL, netvision_mib, NETVISION_SYSOID, NULL }; diff --git a/drivers/nut_libusb.h b/drivers/nut_libusb.h index 8b2a644341..376e653037 100644 --- a/drivers/nut_libusb.h +++ b/drivers/nut_libusb.h @@ -37,6 +37,7 @@ * and for libusb headers and 0.1/1.0 mapping */ /* Used in drivers/libusb*.c sources: */ +#define LIBUSB_DEFAULT_CONF_INDEX 0 #define LIBUSB_DEFAULT_INTERFACE 0 #define LIBUSB_DEFAULT_DESC_INDEX 0 #define LIBUSB_DEFAULT_HID_EP_IN 1 @@ -73,6 +74,15 @@ typedef struct usb_communication_subdriver_s { usb_ctrl_charbuf buf, usb_ctrl_charbufsize bufsize, usb_ctrl_timeout_msec timeout); + /* Nearly all devices use a single configuration descriptor, index 0. + * But, it is possible for a device have more than one, check bNumConfigration + * on the device descriptor for the total. + * + * In USB, the descriptor heirarchy is + * device -> configuration(s) -> interface(s) -> endpoint(s) + */ + usb_ctrl_cfgindex usb_config_index; /* index of the device config we use. Almost always 0; see comments above */ + /* Used for Powervar UPS or similar cases to make sure * we use the right interface in the Composite device. * In a few cases our libusb*.c sets the value for specific diff --git a/drivers/nutdrv_qx.c b/drivers/nutdrv_qx.c index 8f5b01d222..177a659d22 100644 --- a/drivers/nutdrv_qx.c +++ b/drivers/nutdrv_qx.c @@ -1836,6 +1836,102 @@ static void *ablerex_subdriver_fun(USBDevice_t *device) return NULL; } +static struct { + bool_t initialized; + bool_t ok; + uint8_t in_endpoint_address; + uint8_t in_bmAttributes; + uint16_t in_wMaxPacketSize; + uint8_t out_endpoint_address; + uint8_t out_bmAttributes; + uint16_t out_wMaxPacketSize; +} armac_endpoint_cache = { .initialized = FALSE, .ok = FALSE }; + +static void load_armac_endpoint_cache(void) +{ +#if WITH_LIBUSB_1_0 + int ret; + struct libusb_device *dev; + struct libusb_config_descriptor *config_descriptor; + bool_t found_in = FALSE; + bool_t found_out = FALSE; +#endif /* WITH_LIBUSB_1_0 */ + + if (armac_endpoint_cache.initialized) { + return; + } + + armac_endpoint_cache.initialized = TRUE; + armac_endpoint_cache.ok = FALSE; + +#if WITH_LIBUSB_1_0 + dev = libusb_get_device(udev); + if (!dev) { + upsdebugx(4, "load_armac_endpoint_cache: unable to libusb_get_device"); + return; + } + + ret = libusb_get_active_config_descriptor(dev, &config_descriptor); + if (ret) { + upsdebugx(4, "load_armac_endpoint_cache: libusb_get_active_config_descriptor error=%d", ret); + libusb_free_config_descriptor(config_descriptor); + return; + } + + if (config_descriptor->bNumInterfaces != 1) { + upsdebugx(4, "load_armac_endpoint_cache: unexpected config_descriptor->bNumInterfaces=%d", config_descriptor->bNumInterfaces); + libusb_free_config_descriptor(config_descriptor); + return; + } else { + /* Here and below, the "else" is for C99-satisfying new variable scoping */ + const struct libusb_interface *interface = &config_descriptor->interface[0]; + + if (interface->num_altsetting != 1) { + upsdebugx(4, "load_armac_endpoint_cache: unexpected interface->num_altsetting=%d", interface->num_altsetting); + libusb_free_config_descriptor(config_descriptor); + return; + } else { + uint8_t i; + const struct libusb_interface_descriptor *interface_descriptor = &interface->altsetting[0]; + + if (interface_descriptor->bNumEndpoints != 2) { + upsdebugx(4, "load_armac_endpoint_cache: unexpected interface_descriptor->bNumEndpoints=%d", interface_descriptor->bNumEndpoints); + libusb_free_config_descriptor(config_descriptor); + return; + } + + for (i = 0; i < interface_descriptor->bNumEndpoints; i++) { + const struct libusb_endpoint_descriptor *endpoint = &interface_descriptor->endpoint[i]; + + if (endpoint->bEndpointAddress & LIBUSB_ENDPOINT_IN) { + found_in = TRUE; + armac_endpoint_cache.in_endpoint_address = endpoint->bEndpointAddress; + armac_endpoint_cache.in_bmAttributes = endpoint->bmAttributes; + armac_endpoint_cache.in_wMaxPacketSize = endpoint->wMaxPacketSize; + } else { + found_out = TRUE; + armac_endpoint_cache.out_endpoint_address = endpoint->bEndpointAddress; + armac_endpoint_cache.out_bmAttributes = endpoint->bmAttributes; + armac_endpoint_cache.out_wMaxPacketSize = endpoint->wMaxPacketSize; + } + } + } + } + + if (found_in || found_out) { + armac_endpoint_cache.ok = TRUE; + + upsdebugx(4, "%s: in_endpoint_address=%02x, in_bmAttributes=%02d, out_endpoint_address=%02d, out_bmAttributes=%02d", + __func__, armac_endpoint_cache.in_endpoint_address, armac_endpoint_cache.in_bmAttributes, + armac_endpoint_cache.out_endpoint_address, armac_endpoint_cache.out_bmAttributes); + } + + libusb_free_config_descriptor(config_descriptor); +#else /* WITH_LIBUSB_1_0 */ + upsdebugx(4, "%s: SKIP: not implemented for libusb-0.1 or serial connections", __func__); +#endif /* !WITH_LIBUSB_1_0 */ +} + /* Armac communication subdriver * * This reproduces a communication protocol used by an old PowerManagerII @@ -1843,13 +1939,16 @@ static void *ablerex_subdriver_fun(USBDevice_t *device) * Richcomm Technologies, Inc. Dec 27 2005 ver 1.1." Maybe other Richcomm UPSes * would work with this - better than with the richcomm_usb driver. */ -#define ARMAC_READ_SIZE 6 +#define ARMAC_READ_SIZE_FOR_CONTROL 6 +#define ARMAC_READ_SIZE_FOR_INTERRUPT 64 static int armac_command(const char *cmd, char *buf, size_t buflen) { - char tmpbuf[ARMAC_READ_SIZE]; + char tmpbuf[ARMAC_READ_SIZE_FOR_INTERRUPT]; int ret = 0; size_t i, bufpos; const size_t cmdlen = strlen(cmd); + bool_t use_interrupt = FALSE; + int read_size = ARMAC_READ_SIZE_FOR_CONTROL; /* UPS ignores (doesn't echo back) unsupported commands which makes * the initialization long. List commands tested to be unsupported: @@ -1863,6 +1962,10 @@ static int armac_command(const char *cmd, char *buf, size_t buflen) NULL }; + if (!armac_endpoint_cache.initialized) { + load_armac_endpoint_cache(); + } + for (i = 0; unsupported[i] != NULL; i++) { if (strcmp(cmd, unsupported[i]) == 0) { upsdebugx(2, @@ -1873,29 +1976,51 @@ static int armac_command(const char *cmd, char *buf, size_t buflen) } upsdebugx(4, "armac command %.*s", (int)strcspn(cmd, "\r"), cmd); - /* Cleanup buffer before sending a new command */ - for (i = 0; i < 10; i++) { - ret = usb_interrupt_read(udev, 0x81, - (usb_ctrl_charbuf)tmpbuf, ARMAC_READ_SIZE, 100); - if (ret != ARMAC_READ_SIZE) { - // Timeout - buffer is clean. - break; +#if WITH_LIBUSB_1_0 + /* Be conservative and do not break old Armac UPSes */ + use_interrupt = armac_endpoint_cache.ok + && armac_endpoint_cache.in_endpoint_address == 0x82 + && armac_endpoint_cache.in_bmAttributes & LIBUSB_TRANSFER_TYPE_INTERRUPT + && armac_endpoint_cache.out_endpoint_address == 0x02 + && armac_endpoint_cache.out_bmAttributes & LIBUSB_TRANSFER_TYPE_INTERRUPT + && armac_endpoint_cache.in_wMaxPacketSize == 64; +#endif /* WITH_LIBUSB_1_0 */ + + if (use_interrupt && cmdlen + 1 < armac_endpoint_cache.in_wMaxPacketSize) { + memset(tmpbuf, 0, sizeof(tmpbuf)); + tmpbuf[0] = 0xa0 + cmdlen; + memcpy(tmpbuf + 1, cmd, cmdlen); + + ret = usb_interrupt_write(udev, + armac_endpoint_cache.out_endpoint_address, + (usb_ctrl_charbuf)tmpbuf, cmdlen + 1, 5000); + + read_size = ARMAC_READ_SIZE_FOR_INTERRUPT; + } else { + /* Cleanup buffer before sending a new command */ + for (i = 0; i < 10; i++) { + ret = usb_interrupt_read(udev, 0x81, + (usb_ctrl_charbuf)tmpbuf, ARMAC_READ_SIZE_FOR_CONTROL, 100); + if (ret != ARMAC_READ_SIZE_FOR_CONTROL) { + /* Timeout - buffer is clean. */ + break; + } + upsdebugx(4, "armac cleanup ret i=%" PRIuSIZE " ret=%d ctrl=%02hhx", i, ret, tmpbuf[0]); } - upsdebugx(4, "armac cleanup ret i=%" PRIuSIZE " ret=%d ctrl=%02hhx", i, ret, tmpbuf[0]); - } - /* Send command to the UPS in 3-byte chunks. Most fit 1 chunk, except for eg. - * parameterized tests. */ - for (i = 0; i < cmdlen;) { - const size_t bytes_to_send = (cmdlen <= (i + 3)) ? (cmdlen - i) : 3; - memset(tmpbuf, 0, sizeof(tmpbuf)); - tmpbuf[0] = 0xa0 + bytes_to_send; - memcpy(tmpbuf + 1, cmd + i, bytes_to_send); - ret = usb_control_msg(udev, - USB_ENDPOINT_OUT + USB_TYPE_CLASS + USB_RECIP_INTERFACE, - 0x09, 0x200, 0, - (usb_ctrl_charbuf)tmpbuf, 4, 5000); - i += bytes_to_send; + /* Send command to the UPS in 3-byte chunks. Most fit 1 chunk, except for eg. + * parameterized tests. */ + for (i = 0; i < cmdlen;) { + const size_t bytes_to_send = (cmdlen <= (i + 3)) ? (cmdlen - i) : 3; + memset(tmpbuf, 0, sizeof(tmpbuf)); + tmpbuf[0] = 0xa0 + bytes_to_send; + memcpy(tmpbuf + 1, cmd + i, bytes_to_send); + ret = usb_control_msg(udev, + USB_ENDPOINT_OUT + USB_TYPE_CLASS + USB_RECIP_INTERFACE, + 0x09, 0x200, 0, + (usb_ctrl_charbuf)tmpbuf, 4, 5000); + i += bytes_to_send; + } } if (ret <= 0) { @@ -1911,17 +2036,17 @@ static int armac_command(const char *cmd, char *buf, size_t buflen) memset(buf, 0, buflen); bufpos = 0; - while (bufpos + ARMAC_READ_SIZE < buflen) { + while (bufpos + read_size + 1 < buflen) { size_t bytes_available; /* Read data in 6-byte chunks */ - ret = usb_interrupt_read(udev, 0x81, - (usb_ctrl_charbuf)tmpbuf, ARMAC_READ_SIZE, 1000); + ret = usb_interrupt_read(udev, use_interrupt ? armac_endpoint_cache.in_endpoint_address : 0x81, + (usb_ctrl_charbuf)tmpbuf, read_size, 1000); /* Any errors here mean that we are unable to read a reply * (which will happen after successfully writing a command * to the UPS) */ - if (ret != ARMAC_READ_SIZE) { + if (ret != read_size) { /* NOTE: If end condition is invalid for particular UPS we might make one * request more and get this error. If bufpos > (say) 10 this could be ignored * and the reply correctly read. */ @@ -1929,7 +2054,7 @@ static int armac_command(const char *cmd, char *buf, size_t buflen) "interrupt read error: %s (%d)", ret ? nut_usb_strerror(ret) : "timeout", ret); - return ret; + return ret < 0 ? ret : (int)bufpos; } upsdebugx(4, @@ -1946,15 +2071,15 @@ static int armac_command(const char *cmd, char *buf, size_t buflen) * Current assumption is that this is number of bytes available on the UPS side * with up to 5 (ret - 1) transferred. */ - bytes_available = (unsigned char)tmpbuf[0] & 0x0f; + bytes_available = (unsigned char)tmpbuf[0] & 0x3f; if (bytes_available == 0) { /* End of transfer */ break; } - if (bytes_available > ARMAC_READ_SIZE - 1) { + if (bytes_available > (unsigned)read_size - 1) { /* Single interrupt transfer has 1 control + 5 data bytes */ - bytes_available = ARMAC_READ_SIZE - 1; + bytes_available = read_size - 1; } /* Copy bytes into the final buffer while detecting end of line - \r */ @@ -1999,7 +2124,7 @@ static int armac_command(const char *cmd, char *buf, size_t buflen) } end_of_message: - if (bufpos + 6 >= buflen) { + if (bufpos + read_size >= buflen) { upsdebugx(2, "Protocol error, too much data read."); return -1; } diff --git a/drivers/nutdrv_qx_ablerex.c b/drivers/nutdrv_qx_ablerex.c index b22ac81eda..2c8a2e8867 100755 --- a/drivers/nutdrv_qx_ablerex.c +++ b/drivers/nutdrv_qx_ablerex.c @@ -33,15 +33,18 @@ static int ablerexQ5Vb = -1; static int ablerex_Q5(item_t *item, char *value, const size_t valuelen) { int Q5_Fout, Q5_Vb, Q5_O_Cur, Q5_Err; -/* - //int Q5_InvW; - int RawValue = 0; - - RawValue = (unsigned char)item->value[0] * 256 + (unsigned char)item->value[1]; +#ifdef ABLEREX_WITH_Q5_InvW + int Q5_InvW; +#endif +#ifdef ABLEREX_WITH_RawValue + int RawValue = ((int)(unsigned char)item->value[0]) * 256 + (unsigned char)item->value[1]; +#endif + +/* // real code below, this is for dev-testing + ablerexQ5Vb = ((int)(unsigned char)buf[7]) * 256 + (unsigned char)buf[8]; + Q5_Vbc = ((int)(unsigned char)buf[9]) * 256 + (unsigned char)buf[10]; */ - //ablerexQ5Vb = (unsigned char)buf[7] * 256 + (unsigned char)buf[8]; - //Q5_Vbc = (unsigned char)buf[9] * 256 + (unsigned char)buf[10]; upsdebugx(2, "Q51: %d %d %d %d %d %d", item->answer[0], item->answer[1], item->answer[2], item->answer[3], item->answer[4], item->answer[5]); upsdebugx(2, "Q52: %d %d %d %d %d %d", item->answer[6], item->answer[7], item->answer[8], item->answer[9], item->answer[10], item->answer[11]); upsdebugx(2, "Q53: %d %d %d %d", item->answer[12], item->answer[13], item->answer[14], item->answer[15]); @@ -49,20 +52,25 @@ static int ablerex_Q5(item_t *item, char *value, const size_t valuelen) { Q5_Fout = (unsigned char)item->answer[1] * 256 + (unsigned char)item->answer[2]; Q5_Vb = (unsigned char)item->answer[7] * 256 + (unsigned char)item->answer[8]; Q5_Vbc = (unsigned char)item->answer[9] * 256 + (unsigned char)item->answer[10]; - //int Q5_InvW = (unsigned char)item->answer[11] * 256 + (unsigned char)item->answer[12]; +#ifdef ABLEREX_WITH_Q5_InvW + Q5_InvW = (unsigned char)item->answer[11] * 256 + (unsigned char)item->answer[12]; +#endif Q5_Err = (unsigned char)item->answer[13] * 256 + (unsigned char)item->answer[14]; Q5_O_Cur = (unsigned char)item->answer[15] * 256 + (unsigned char)item->answer[16]; ablerexQ5Vb = Q5_Vb; upsdebugx(2, "Q5: %.1f %d %.1f", 0.1 * Q5_Fout, Q5_Err, 0.1 * Q5_O_Cur); upsdebugx(2, "Q5Vb: %d Vbc %d", Q5_Vb, Q5_Vbc); +#ifdef ABLEREX_WITH_Q5_InvW + upsdebugx(2, "Q5_InvW: %d", Q5_InvW); +#endif dstate_setinfo("output.frequency", "%.1f", 0.1 * Q5_Fout); dstate_setinfo("ups.alarm", "%d", Q5_Err); dstate_setinfo("output.current", "%.1f", 0.1 * Q5_O_Cur); snprintf(value, valuelen, "%.1f", Q5_Fout * 0.1); -/* +#ifdef ABLEREX_WITH_RawValue switch (item->from) { case 1: @@ -79,10 +87,10 @@ static int ablerex_Q5(item_t *item, char *value, const size_t valuelen) { break; default: - //Don't know what happened + /* Don't know what happened */ return -1; } -*/ +#endif return 0; } @@ -102,7 +110,9 @@ static int ablerex_battery(item_t *item, char *value, const size_t valuelen) { nomBattV = strtod(dstate_getinfo("battery.voltage.nominal"), NULL); upsdebugx(2, "battvoltact1: %.2f", nomBattV); - //return 0; +/* + * //return 0; + */ if (ablerexQ5Vb > 0) { battvoltact = ablerexQ5Vb * nomBattV / 1200; @@ -162,8 +172,10 @@ static int ablerex_battery_charge(double BattIn) } } } else { - //double nomBattV = strtod(dstate_getinfo("battery.voltage.nominal"), NULL); - //double battV = BattIn / (nomBattV / 12); +/* + * //double nomBattV = strtod(dstate_getinfo("battery.voltage.nominal"), NULL); + * //double battV = BattIn / (nomBattV / 12); + */ for (i = 0; offlineC[i] > 0; i++) { if (BattIn >= offlineP[i]) { @@ -190,13 +202,17 @@ static int ablerex_batterycharge(item_t *item, char *value, const size_t valuele nomBattV = strtod(dstate_getinfo("battery.voltage.nominal"), NULL); upsdebugx(2, "battvv1: %.2f", nomBattV); - //return 0; +/* + * //return 0; + */ if (BattV > 3.0) { BattV = BattV / (nomBattV / 12); } BattP = ablerex_battery_charge(BattV); - //dstate_setinfo("battery.charge", "%.0f", BattP); +/* + * //dstate_setinfo("battery.charge", "%.0f", BattP); + */ snprintf(value, valuelen, "%d", BattP); upsdebugx(2, "battcharge: %d", BattP); @@ -370,9 +386,13 @@ static item_t ablerex_qx2nut[] = { /* Ablerex */ { "output.frequency", 0, NULL, "Q5\r", "", 22, '(', "", 1, 18, "%.1f", 0, NULL, NULL, ablerex_Q5 }, { "battery.runtime", 0, NULL, "At\r", "", 0, '(', "", 0, 0, "%d", 0, NULL, NULL, ablerex_At }, - //{ "ups.alarm", 0, NULL, "Q5\r", "", 22, '(', "", 1, 14, "%.0f", 0, QX_FLAG_QUICK_POLL, NULL, ablerex_Q5 }, +/* + * //{ "ups.alarm", 0, NULL, "Q5\r", "", 22, '(', "", 1, 14, "%.0f", 0, QX_FLAG_QUICK_POLL, NULL, ablerex_Q5 }, + */ { "ups.test.result", 0, NULL, "TR\r", "", 0, '#', "", 0, 0, "%s", 0, NULL, NULL, ablerex_TR }, - //{ "output.current", 0, NULL, "Q5\r", "", 22, '(', "", 1, 16, "%.1f", 0, QX_FLAG_QUICK_POLL, NULL, ablerex_Q5 }, +/* + * //{ "output.current", 0, NULL, "Q5\r", "", 22, '(', "", 1, 16, "%.1f", 0, QX_FLAG_QUICK_POLL, NULL, ablerex_Q5 }, + */ /* * > [I\r] diff --git a/drivers/openups-hid.c b/drivers/openups-hid.c index d8be70d4cb..0a9eda9ad0 100644 --- a/drivers/openups-hid.c +++ b/drivers/openups-hid.c @@ -121,7 +121,7 @@ static const unsigned int therm_tbl[] = (unsigned int)0x3CC }; -static const unsigned int therm_tbl_size = sizeof(therm_tbl)/sizeof(therm_tbl[0]); +static const unsigned int therm_tbl_size = SIZEOF_ARRAY(therm_tbl); static const char *openups_charging_fun(double value); static const char *openups_discharging_fun(double value); diff --git a/drivers/optiups.c b/drivers/optiups.c index 35f1005361..b3fe2634f2 100644 --- a/drivers/optiups.c +++ b/drivers/optiups.c @@ -368,7 +368,7 @@ void upsdrv_initinfo(void) optimodel = OPTIMODEL_PS; } - optifill( _initv, sizeof(_initv)/sizeof(_initv[0]) ); + optifill( _initv, SIZEOF_ARRAY(_initv) ); /* Parse out model into longer string -- is this really USEFUL??? */ r = optiquery( "IO" ); @@ -483,11 +483,11 @@ void upsdrv_updateinfo(void) /* read some easy settings */ if ( optimodel == OPTIMODEL_ZINTO ) - optifill( _pollv_zinto, sizeof(_pollv_zinto)/sizeof(_pollv_zinto[0]) ); + optifill( _pollv_zinto, SIZEOF_ARRAY(_pollv_zinto) ); else if ( optimodel == OPTIMODEL_PS ) { short inV, outV, fV; - optifill( _pollv_ps, sizeof(_pollv_ps)/sizeof(_pollv_ps[0]) ); + optifill( _pollv_ps, SIZEOF_ARRAY(_pollv_ps) ); r = optiquery( "NV" ); str_to_short ( _buf, &inV, 10 ); @@ -508,7 +508,7 @@ void upsdrv_updateinfo(void) dstate_setinfo( "output.voltage", "%d", outV ); } else - optifill( _pollv, sizeof(_pollv)/sizeof(_pollv[0]) ); + optifill( _pollv, SIZEOF_ARRAY(_pollv) ); /* Battery voltage is harder */ r = optiquery( "BV" ); diff --git a/drivers/pijuice.c b/drivers/pijuice.c index 1d25376841..3e43bfdf89 100644 --- a/drivers/pijuice.c +++ b/drivers/pijuice.c @@ -53,7 +53,7 @@ * situation. */ #if WITH_LINUX_I2C -#if !HAVE_DECL_I2C_SMBUS_ACCESS +# if !HAVE_DECL_I2C_SMBUS_ACCESS static inline __s32 i2c_smbus_access(int file, char read_write, __u8 command, int size, union i2c_smbus_data *data) { @@ -70,9 +70,9 @@ static inline __s32 i2c_smbus_access(int file, char read_write, __u8 command, err = -errno; return err; } -#endif +# endif -#if !HAVE_DECL_I2C_SMBUS_READ_BYTE_DATA +# if !HAVE_DECL_I2C_SMBUS_READ_BYTE_DATA static inline __s32 i2c_smbus_read_byte_data(int file, __u8 command) { union i2c_smbus_data data; @@ -84,9 +84,9 @@ static inline __s32 i2c_smbus_read_byte_data(int file, __u8 command) else return 0x0FF & data.byte; } -#endif +# endif -#if !HAVE_DECL_I2C_SMBUS_WRITE_BYTE_DATA +# if !HAVE_DECL_I2C_SMBUS_WRITE_BYTE_DATA static inline __s32 i2c_smbus_write_byte_data(int file, __u8 command, __u8 value) { union i2c_smbus_data data; @@ -99,9 +99,9 @@ static inline __s32 i2c_smbus_write_byte_data(int file, __u8 command, __u8 value else return 0x0FF & data.byte; } -#endif +# endif -#if !HAVE_DECL_I2C_SMBUS_READ_WORD_DATA +# if !HAVE_DECL_I2C_SMBUS_READ_WORD_DATA static inline __s32 i2c_smbus_read_word_data(int file, __u8 command) { union i2c_smbus_data data; @@ -113,9 +113,9 @@ static inline __s32 i2c_smbus_read_word_data(int file, __u8 command) else return 0x0FFFF & data.word; } -#endif +# endif -#if !HAVE_DECL_I2C_SMBUS_WRITE_WORD_DATA +# if !HAVE_DECL_I2C_SMBUS_WRITE_WORD_DATA static inline __s32 i2c_smbus_write_word_data(int file, __u8 command, __u16 value) { union i2c_smbus_data data; @@ -128,9 +128,9 @@ static inline __s32 i2c_smbus_write_word_data(int file, __u8 command, __u16 valu else return 0x0FFFF & data.word; } -#endif +# endif -#if !HAVE_DECL_I2C_SMBUS_READ_BLOCK_DATA +# if !HAVE_DECL_I2C_SMBUS_READ_BLOCK_DATA static inline __u8* i2c_smbus_read_i2c_block_data(int file, __u8 command, __u8 length, __u8 *values) { union i2c_smbus_data data; @@ -152,8 +152,8 @@ static inline __u8* i2c_smbus_read_i2c_block_data(int file, __u8 command, __u8 l return values; } -#endif -#endif // if WITH_LINUX_I2C +# endif +#endif /* if WITH_LINUX_I2C */ #define STATUS_CMD 0x40 #define CHARGE_LEVEL_CMD 0x41 diff --git a/drivers/powerp-bin.c b/drivers/powerp-bin.c index 53aba09a68..0c7da014a0 100644 --- a/drivers/powerp-bin.c +++ b/drivers/powerp-bin.c @@ -430,7 +430,7 @@ static ssize_t powpan_status(status_t *status) /* * WRITE D\r * READ #VVL.CTF.....\r - * 01234567890123 + * 01234567890123 */ ret = ser_send_pace(upsfd, UPSDELAY, "D\r"); @@ -545,7 +545,7 @@ static int powpan_updateinfo(void) } /* !OB && !TEST */ - if (!(status.flags[0] & 0x84)) { + if (!(status.flags[0] & 0x84) && status.o_volt) { if (status.o_volt < 0.5 * status.i_volt) { upsdebugx(2, "%s: output voltage too low", __func__); diff --git a/drivers/powerp-txt.c b/drivers/powerp-txt.c index a212aca557..0390a7ca64 100644 --- a/drivers/powerp-txt.c +++ b/drivers/powerp-txt.c @@ -34,13 +34,16 @@ #include "powerp-txt.h" -#define POWERPANEL_TEXT_VERSION "Powerpanel-Text 0.5" +#include + +#define POWERPANEL_TEXT_VERSION "Powerpanel-Text 0.6" typedef struct { float i_volt; float o_volt; int o_load; int b_chrg; + unsigned char has_u_temp; int u_temp; float i_freq; unsigned char flags[2]; @@ -50,8 +53,6 @@ typedef struct { float o_freq; unsigned char has_runtime; int runtime; - int c_unknwn; - float q_unknwn; } status_t; static long ondelay = 1; /* minutes */ @@ -261,6 +262,7 @@ static void powpan_initinfo(void) /* * WRITE P3\r * READ #12.0,002,008.0,00\r + * #12,2x1,12,0,1,8\r (CST135XLU) */ if (powpan_command("P3\r") > 0) { @@ -278,6 +280,7 @@ static void powpan_initinfo(void) /* * WRITE P2\r * READ #1200,0720,120,47,63\r + * #1350,810,120,57,63,11.3\r (CST135XLU) */ if (powpan_command("P2\r") > 0) { @@ -301,6 +304,7 @@ static void powpan_initinfo(void) /* * WRITE P1\r * READ #120,138,088,20\r + * #120,139,100,0,300\r (CST135XLU) */ if (powpan_command("P1\r") > 0) { @@ -381,101 +385,97 @@ static void powpan_initinfo(void) static ssize_t powpan_status(status_t *status) { ssize_t ret; + ssize_t i; + ssize_t valid = 0; + int code = -1; + char value[32]; + ssize_t ofs = 0; + char seen_i_freq = 0; - ser_flush_io(upsfd); + memset(status, 0, sizeof(status_t)); /* * WRITE D\r * READ #I119.0O119.0L000B100T027F060.0S..\r * #I118.0O118.0L029B100F060.0R0218S..\r - * 01234567890123456789012345678901234 - * 0 1 2 3 + * #I118.1O118.1L13B100V27.5F60.0HF60.0R65Q1.4S\x80\x84\xc0\x88\x80W\r (CST135XLU) + * 01234567890123456789012345678901234567890123 + * 0 1 2 3 4 */ - ret = ser_send_pace(upsfd, UPSDELAY, "D\r"); - - if (ret < 0) { - upsdebug_with_errno(3, "send"); - return -1; - } - - if (ret == 0) { - upsdebug_with_errno(3, "send: timeout"); - return -1; - } - - upsdebug_hex(3, "send", "D\r", 2); - - usleep(200000); - - ret = ser_get_buf_len(upsfd, powpan_answer, 35, SER_WAIT_SEC, SER_WAIT_USEC); - - if (ret < 0) { - upsdebug_with_errno(3, "read"); - upsdebug_hex(4, " \\_", powpan_answer, 35); + ret = powpan_command("D\r"); + if (ret <= 0) return -1; - } - if (ret == 0) { - upsdebugx(3, "read: timeout"); - upsdebug_hex(4, " \\_", powpan_answer, 35); + if (powpan_answer[0] != '#') { + upsdebugx(2, "Expected start character '#', but got '%c'", powpan_answer[0]); return -1; } - upsdebug_hex(3, "read", powpan_answer, (size_t)ret); - - ret = sscanf(powpan_answer, "#I%fO%fL%dB%dT%dF%fS%2c\r", - &status->i_volt, &status->o_volt, &status->o_load, - &status->b_chrg, &status->u_temp, &status->i_freq, - status->flags); - - if (ret >= 7) { - status->has_b_volt = 0; - status->has_o_freq = 0; - status->has_runtime = 0; - } else { - - ret = sscanf(powpan_answer, "#I%fO%fL%dB%dF%fR%dS%2c\r", - &status->i_volt, &status->o_volt, &status->o_load, - &status->b_chrg, &status->i_freq, &status->runtime, - status->flags); - - if (ret >= 7) { - status->has_b_volt = 0; - status->has_o_freq = 0; - status->has_runtime = 1; - } - - } - if (ret < 7) { - ret = ser_get_buf_len(upsfd, powpan_answer+35, 23, SER_WAIT_SEC, SER_WAIT_USEC); - - if (ret < 0) { - upsdebug_with_errno(3, "read"); - upsdebug_hex(4, " \\_", powpan_answer+35, 23); - return -1; - } + for (i = 1; i <= ret; i++) { + if (i == ret || isalpha(powpan_answer[i])) { + value[ofs++] = '\0'; + valid++; + + switch (code) { + case 'I': + status->i_volt = strtof(value, NULL); + break; + case 'O': + status->o_volt = strtof(value, NULL); + break; + case 'L': + status->o_load = strtol(value, NULL, 10); + break; + case 'B': + status->b_chrg = strtol(value, NULL, 10); + break; + case 'V': + status->b_volt = strtof(value, NULL); + status->has_b_volt = 1; + break; + case 'T': + status->u_temp = strtol(value, NULL, 10); + status->has_u_temp = 1; + break; + case 'F': + status->i_freq = strtof(value, NULL); + seen_i_freq = 1; + break; + case 'H': + status->o_freq = strtof(value, NULL); + status->has_o_freq = 1; + break; + case 'R': + status->runtime = strtol(value, NULL, 10); + status->has_runtime = 1; + break; + case 'S': + memcpy(&status->flags, value, 2); + break; + default: + /* We didn't really find valid data */ + valid--; + break; + } + + code = powpan_answer[i]; + ofs = 0; + + /* + * Depending on device/firmware, the output frequency is coded as + * either an H, HF, or a second F (seen once transfered to battery) + */ + if (seen_i_freq && code == 'F') + code = 'H'; - if (ret == 0) { - upsdebugx(3, "read: timeout"); - upsdebug_hex(4, " \\_", powpan_answer+35, 23); - return -1; + continue; } - upsdebug_hex(3, "read", powpan_answer, (size_t)ret); - - ret = sscanf(powpan_answer, "#I%fO%fL%dB%dV%fT%dF%fH%fR%dC%dQ%fS%2c\r", - &status->i_volt, &status->o_volt, &status->o_load, - &status->b_chrg, &status->b_volt, &status->u_temp, - &status->i_freq, &status->o_freq, &status->runtime, - &status->c_unknwn, &status->q_unknwn, status->flags); - status->has_b_volt = 1; - status->has_o_freq = 1; - status->has_runtime = 1; - dstate_setinfo("battery.voltage.nominal", "%g", 72.0); - dstate_setinfo("output.voltage.nominal", "%g", 120.0); + value[ofs++] = powpan_answer[i]; } - if (ret < 7) { + /* if we didn't get at least 3 values consider it a failure */ + if (valid < 3) { upsdebugx(4, "Parsing status string failed"); return -1; } @@ -495,10 +495,15 @@ static int powpan_updateinfo(void) dstate_setinfo("output.voltage", "%.1f", status.o_volt); dstate_setinfo("ups.load", "%d", status.o_load); dstate_setinfo("input.frequency", "%.1f", status.i_freq); - dstate_setinfo("ups.temperature", "%d", status.u_temp); + if (status.has_u_temp) { + dstate_setinfo("ups.temperature", "%d", status.u_temp); + } dstate_setinfo("battery.charge", "%d", status.b_chrg); if (status.has_b_volt) { dstate_setinfo("battery.voltage", "%.1f", status.b_volt); + if (status.b_volt > 20.0 && status.b_volt < 28.0) { + dstate_setinfo("battery.voltage.nominal", "%g", 24.0); + } } if (status.has_o_freq) { dstate_setinfo("output.frequency", "%.1f", status.o_freq); @@ -567,6 +572,7 @@ static ssize_t powpan_initups(void) /* * WRITE P4\r * READ #BC1200 ,1.600,000000000000,CYBER POWER + * #CST135XLU,BF01403AAH2,CR7EV2002320,CyberPower Systems Inc.,,, * 01234567890123456789012345678901234567890123456 * 0 1 2 3 4 */ diff --git a/drivers/powervar-hid.c b/drivers/powervar-hid.c old mode 100755 new mode 100644 diff --git a/drivers/raritan-pdu-mib.c b/drivers/raritan-pdu-mib.c index f4e52ac440..49000e1365 100644 --- a/drivers/raritan-pdu-mib.c +++ b/drivers/raritan-pdu-mib.c @@ -25,7 +25,7 @@ #include "raritan-pdu-mib.h" -#define RARITAN_MIB_VERSION "0.8" +#define RARITAN_MIB_VERSION "0.80" /* Raritan MIB * this one uses the same MIB as Eaton Revelation, @@ -39,71 +39,71 @@ #define DO_CYCLE "2" static info_lkp_t raritan_pdu_outlet_status_info[] = { - { -1, "error", NULL, NULL }, - { 0, "off", NULL, NULL }, - { 1, "on", NULL, NULL }, - { 2, "cycling", NULL, NULL }, /* transitional status */ - { 0, NULL, NULL, NULL } + info_lkp_default(-1, "error"), + info_lkp_default(0, "off"), + info_lkp_default(1, "on"), + info_lkp_default(2, "cycling"), /* transitional status */ + info_lkp_sentinel }; /* Snmp2NUT lookup table for Raritan MIB */ static snmp_info_t raritan_mib[] = { /* standard MIB items */ - { "device.description", ST_FLAG_STRING | ST_FLAG_RW, SU_INFOSIZE, ".1.3.6.1.2.1.1.1.0", NULL, SU_FLAG_OK, NULL }, - { "device.contact", ST_FLAG_STRING | ST_FLAG_RW, SU_INFOSIZE, ".1.3.6.1.2.1.1.4.0", NULL, SU_FLAG_OK, NULL }, - { "device.location", ST_FLAG_STRING | ST_FLAG_RW, SU_INFOSIZE, ".1.3.6.1.2.1.1.6.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("device.description", ST_FLAG_STRING | ST_FLAG_RW, SU_INFOSIZE, ".1.3.6.1.2.1.1.1.0", NULL, SU_FLAG_OK, NULL), + snmp_info_default("device.contact", ST_FLAG_STRING | ST_FLAG_RW, SU_INFOSIZE, ".1.3.6.1.2.1.1.4.0", NULL, SU_FLAG_OK, NULL), + snmp_info_default("device.location", ST_FLAG_STRING | ST_FLAG_RW, SU_INFOSIZE, ".1.3.6.1.2.1.1.6.0", NULL, SU_FLAG_OK, NULL), /* Device page */ - { "device.mfr", ST_FLAG_STRING, SU_INFOSIZE, NULL, "Raritan", - SU_FLAG_STATIC | SU_FLAG_ABSENT | SU_FLAG_OK, NULL }, - { "device.model", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.13742.1.1.12.0", - "Generic SNMP PDU", SU_FLAG_STATIC | SU_FLAG_OK, NULL }, - { "device.serial", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.13742.1.1.2.0", "", - SU_FLAG_STATIC | SU_FLAG_OK, NULL }, - { "device.type", ST_FLAG_STRING, SU_INFOSIZE, NULL, "pdu", - SU_FLAG_STATIC | SU_FLAG_ABSENT | SU_FLAG_OK, NULL }, - { "device.macaddr", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.13742.1.1.6.0", "", - SU_FLAG_STATIC | SU_FLAG_OK, NULL }, + snmp_info_default("device.mfr", ST_FLAG_STRING, SU_INFOSIZE, NULL, "Raritan", + SU_FLAG_STATIC | SU_FLAG_ABSENT | SU_FLAG_OK, NULL), + snmp_info_default("device.model", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.13742.1.1.12.0", + "Generic SNMP PDU", SU_FLAG_STATIC | SU_FLAG_OK, NULL), + snmp_info_default("device.serial", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.13742.1.1.2.0", "", + SU_FLAG_STATIC | SU_FLAG_OK, NULL), + snmp_info_default("device.type", ST_FLAG_STRING, SU_INFOSIZE, NULL, "pdu", + SU_FLAG_STATIC | SU_FLAG_ABSENT | SU_FLAG_OK, NULL), + snmp_info_default("device.macaddr", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.13742.1.1.6.0", "", + SU_FLAG_STATIC | SU_FLAG_OK, NULL), /* UPS page */ - { "ups.mfr", ST_FLAG_STRING, SU_INFOSIZE, NULL, "Raritan", - SU_FLAG_STATIC | SU_FLAG_ABSENT | SU_FLAG_OK, NULL }, - { "ups.model", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.13742.1.1.12.0", - "Generic SNMP PDU", SU_FLAG_STATIC | SU_FLAG_OK, NULL }, - { "ups.id", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.13742.1.1.13.0", - "unknown", SU_FLAG_STATIC | SU_FLAG_OK, NULL }, - { "ups.serial", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.13742.1.1.2.0", "", - SU_FLAG_STATIC | SU_FLAG_OK, NULL }, - { "ups.firmware", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.13742.1.1.1.0", "", - SU_FLAG_STATIC | SU_FLAG_OK, NULL }, - { "ups.type", ST_FLAG_STRING, SU_INFOSIZE, NULL, "pdu", - SU_FLAG_STATIC | SU_FLAG_ABSENT | SU_FLAG_OK, NULL }, - { "ups.temperature", 0, 1, ".1.3.6.1.4.1.13742.1.3.1.5.0", NULL, 0, NULL }, + snmp_info_default("ups.mfr", ST_FLAG_STRING, SU_INFOSIZE, NULL, "Raritan", + SU_FLAG_STATIC | SU_FLAG_ABSENT | SU_FLAG_OK, NULL), + snmp_info_default("ups.model", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.13742.1.1.12.0", + "Generic SNMP PDU", SU_FLAG_STATIC | SU_FLAG_OK, NULL), + snmp_info_default("ups.id", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.13742.1.1.13.0", + "unknown", SU_FLAG_STATIC | SU_FLAG_OK, NULL), + snmp_info_default("ups.serial", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.13742.1.1.2.0", "", + SU_FLAG_STATIC | SU_FLAG_OK, NULL), + snmp_info_default("ups.firmware", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.13742.1.1.1.0", "", + SU_FLAG_STATIC | SU_FLAG_OK, NULL), + snmp_info_default("ups.type", ST_FLAG_STRING, SU_INFOSIZE, NULL, "pdu", + SU_FLAG_STATIC | SU_FLAG_ABSENT | SU_FLAG_OK, NULL), + snmp_info_default("ups.temperature", 0, 1, ".1.3.6.1.4.1.13742.1.3.1.5.0", NULL, 0, NULL), /* Outlet page */ - { "outlet.id", 0, 1, NULL, "0", SU_FLAG_STATIC | SU_FLAG_ABSENT | SU_FLAG_OK, NULL }, - { "outlet.desc", ST_FLAG_RW | ST_FLAG_STRING, 20, NULL, "All outlets", - SU_FLAG_STATIC | SU_FLAG_ABSENT | SU_FLAG_OK, NULL }, - { "outlet.count", 0, 1, ".1.3.6.1.4.1.13742.1.2.1.0", "0", 0, NULL }, - { "outlet.current", 0, 0.001, ".1.3.6.1.4.1.13742.1.3.1.1" ".0", NULL, 0, NULL }, - { "outlet.voltage", 0, 0.001, ".1.3.6.1.4.1.13742.1.3.1.2" ".0", NULL, 0, NULL }, - { "outlet.realpower", 0, 1.0, ".1.3.6.1.4.1.13742.1.3.1.3" ".0", NULL, 0, NULL }, - { "outlet.power", 0, 1.0, ".1.3.6.1.4.1.13742.1.3.1.4" ".0", NULL, 0, NULL }, + snmp_info_default("outlet.id", 0, 1, NULL, "0", SU_FLAG_STATIC | SU_FLAG_ABSENT | SU_FLAG_OK, NULL), + snmp_info_default("outlet.desc", ST_FLAG_RW | ST_FLAG_STRING, 20, NULL, "All outlets", + SU_FLAG_STATIC | SU_FLAG_ABSENT | SU_FLAG_OK, NULL), + snmp_info_default("outlet.count", 0, 1, ".1.3.6.1.4.1.13742.1.2.1.0", "0", 0, NULL), + snmp_info_default("outlet.current", 0, 0.001, ".1.3.6.1.4.1.13742.1.3.1.1" ".0", NULL, 0, NULL), + snmp_info_default("outlet.voltage", 0, 0.001, ".1.3.6.1.4.1.13742.1.3.1.2" ".0", NULL, 0, NULL), + snmp_info_default("outlet.realpower", 0, 1.0, ".1.3.6.1.4.1.13742.1.3.1.3" ".0", NULL, 0, NULL), + snmp_info_default("outlet.power", 0, 1.0, ".1.3.6.1.4.1.13742.1.3.1.4" ".0", NULL, 0, NULL), /* outlet template definition * Caution: the index of the data start at 0, while the name is +1 * ie outlet.1 => .0 */ - { "outlet.%i.switchable", 0, 1, ".1.3.6.1.4.1.13742.1.2.2.1.1.%i", "yes", SU_FLAG_STATIC | SU_OUTLET, NULL }, - { "outlet.%i.id", 0, 1, NULL, "%i", SU_FLAG_STATIC | SU_FLAG_ABSENT | SU_FLAG_OK | SU_OUTLET, NULL }, - { "outlet.%i.desc", ST_FLAG_RW | ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.13742.1.2.2.1.2.%i", NULL, SU_OUTLET, NULL }, - { "outlet.%i.status", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.13742.1.2.2.1.3.%i", NULL, SU_FLAG_OK | SU_OUTLET, &raritan_pdu_outlet_status_info[0] }, - { "outlet.%i.current", 0, 0.001, ".1.3.6.1.4.1.13742.1.2.2.1.4.%i", NULL, SU_OUTLET, NULL }, - { "outlet.%i.current.maximum", 0, 0.001, ".1.3.6.1.4.1.13742.1.2.2.1.5.%i", NULL, SU_OUTLET, NULL }, - { "outlet.%i.realpower", 0, 1.0, ".1.3.6.1.4.1.13742.1.2.2.1.7.%i", NULL, SU_OUTLET, NULL }, - { "outlet.%i.voltage", 0, 1.0, ".1.3.6.1.4.1.13742.1.2.2.1.6.%i", NULL, SU_OUTLET, NULL }, - { "outlet.%i.powerfactor", 0, 0.01, ".1.3.6.1.4.1.13742.1.2.2.1.9.%i", NULL, SU_OUTLET, NULL }, - { "outlet.%i.power", 0, 1.0, ".1.3.6.1.4.1.13742.1.2.2.1.8.%i", NULL, SU_OUTLET, NULL }, + snmp_info_default("outlet.%i.switchable", 0, 1, ".1.3.6.1.4.1.13742.1.2.2.1.1.%i", "yes", SU_FLAG_STATIC | SU_OUTLET, NULL), + snmp_info_default("outlet.%i.id", 0, 1, NULL, "%i", SU_FLAG_STATIC | SU_FLAG_ABSENT | SU_FLAG_OK | SU_OUTLET, NULL), + snmp_info_default("outlet.%i.desc", ST_FLAG_RW | ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.13742.1.2.2.1.2.%i", NULL, SU_OUTLET, NULL), + snmp_info_default("outlet.%i.status", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.13742.1.2.2.1.3.%i", NULL, SU_FLAG_OK | SU_OUTLET, &raritan_pdu_outlet_status_info[0]), + snmp_info_default("outlet.%i.current", 0, 0.001, ".1.3.6.1.4.1.13742.1.2.2.1.4.%i", NULL, SU_OUTLET, NULL), + snmp_info_default("outlet.%i.current.maximum", 0, 0.001, ".1.3.6.1.4.1.13742.1.2.2.1.5.%i", NULL, SU_OUTLET, NULL), + snmp_info_default("outlet.%i.realpower", 0, 1.0, ".1.3.6.1.4.1.13742.1.2.2.1.7.%i", NULL, SU_OUTLET, NULL), + snmp_info_default("outlet.%i.voltage", 0, 1.0, ".1.3.6.1.4.1.13742.1.2.2.1.6.%i", NULL, SU_OUTLET, NULL), + snmp_info_default("outlet.%i.powerfactor", 0, 0.01, ".1.3.6.1.4.1.13742.1.2.2.1.9.%i", NULL, SU_OUTLET, NULL), + snmp_info_default("outlet.%i.power", 0, 1.0, ".1.3.6.1.4.1.13742.1.2.2.1.8.%i", NULL, SU_OUTLET, NULL), /* FIXME: * - delay for startup/shutdown sequence @@ -116,15 +116,16 @@ static snmp_info_t raritan_mib[] = { /* instant commands. */ /* Note that load.cycle might be replaced by / mapped on shutdown.reboot */ /* no counterpart found! - { "outlet.load.off", 0, 1, ".1.3.6.1.4.1.13742.1.2.2.1.3.0", DO_OFF, SU_TYPE_CMD, NULL }, - { "outlet.load.on", 0, 1, ".1.3.6.1.4.1.13742.1.2.2.1.3.0", DO_ON, SU_TYPE_CMD, NULL }, - { "outlet.load.cycle", 0, 1, ".1.3.6.1.4.1.13742.1.2.2.1.3.0", DO_CYCLE, SU_TYPE_CMD, NULL }, */ - { "outlet.%i.load.off", 0, 1, ".1.3.6.1.4.1.13742.1.2.2.1.3.%i", DO_OFF, SU_TYPE_CMD | SU_OUTLET, NULL }, - { "outlet.%i.load.on", 0, 1, ".1.3.6.1.4.1.13742.1.2.2.1.3.%i", DO_ON, SU_TYPE_CMD | SU_OUTLET, NULL }, - { "outlet.%i.load.cycle", 0, 1, ".1.3.6.1.4.1.13742.1.2.2.1.3.%i", DO_CYCLE, SU_TYPE_CMD | SU_OUTLET, NULL }, + snmp_info_default("outlet.load.off", 0, 1, ".1.3.6.1.4.1.13742.1.2.2.1.3.0", DO_OFF, SU_TYPE_CMD, NULL), + snmp_info_default("outlet.load.on", 0, 1, ".1.3.6.1.4.1.13742.1.2.2.1.3.0", DO_ON, SU_TYPE_CMD, NULL), + snmp_info_default("outlet.load.cycle", 0, 1, ".1.3.6.1.4.1.13742.1.2.2.1.3.0", DO_CYCLE, SU_TYPE_CMD, NULL), + */ + snmp_info_default("outlet.%i.load.off", 0, 1, ".1.3.6.1.4.1.13742.1.2.2.1.3.%i", DO_OFF, SU_TYPE_CMD | SU_OUTLET, NULL), + snmp_info_default("outlet.%i.load.on", 0, 1, ".1.3.6.1.4.1.13742.1.2.2.1.3.%i", DO_ON, SU_TYPE_CMD | SU_OUTLET, NULL), + snmp_info_default("outlet.%i.load.cycle", 0, 1, ".1.3.6.1.4.1.13742.1.2.2.1.3.%i", DO_CYCLE, SU_TYPE_CMD | SU_OUTLET, NULL), /* end of structure. */ - { NULL, 0, 0, NULL, NULL, 0, NULL } + snmp_info_sentinel }; mib2nut_info_t raritan = { "raritan", RARITAN_MIB_VERSION, NULL, RARITAN_OID_MODEL_NAME, raritan_mib, RARITAN_SYSOID, NULL }; diff --git a/drivers/raritan-px2-mib.c b/drivers/raritan-px2-mib.c index 627105162e..5d9a39ecc5 100644 --- a/drivers/raritan-px2-mib.c +++ b/drivers/raritan-px2-mib.c @@ -6,6 +6,10 @@ * * Based on initial work and data from Opengear * + * NOTE: Many readings allow for PDU ID which is hard-coded to ".1" in + * the mapping tables below at this time. This should be extended to NUT + * support for "daisy-chain" concept which appeared later than this driver. + * * 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 @@ -23,7 +27,7 @@ #include "raritan-px2-mib.h" -#define RARITAN_PX2_MIB_VERSION "0.4" +#define RARITAN_PX2_MIB_VERSION "0.41" #define RARITAN_PX2_MIB_SYSOID ".1.3.6.1.4.1.13742.6" #define RARITAN_PX2_OID_MODEL_NAME ".1.3.6.1.4.1.13742.6.3.2.1.1.3.1" @@ -31,548 +35,557 @@ /* info elements */ /* FIXME: triage between status and alarms, and make it compliant! */ static info_lkp_t raritanpx2_outlet_status_info[] = { - { -1, "unavailable", NULL, NULL }, - { 0, "open", NULL, NULL }, - { 1, "closed", NULL, NULL }, - { 2, "belowLowerCritical", NULL, NULL }, - { 3, "belowLowerWarning", NULL, NULL }, - { 4, "normal", NULL, NULL }, - { 5, "aboveUpperWarning", NULL, NULL }, - { 6, "aboveUpperCritical", NULL, NULL }, - { 7, "on", NULL, NULL }, - { 8, "off", NULL, NULL }, - { 9, "detected", NULL, NULL }, - { 10, "notDetected", NULL, NULL }, - { 11, "alarmed", NULL, NULL }, - { 12, "ok", NULL, NULL }, - { 13, "marginal", NULL, NULL }, - { 14, "fail", NULL, NULL }, - { 15, "yes", NULL, NULL }, - { 16, "no", NULL, NULL }, - { 17, "standby", NULL, NULL }, - { 18, "one", NULL, NULL }, - { 19, "two", NULL, NULL }, - { 20, "inSync", NULL, NULL }, - { 21, "outOfSync", NULL, NULL }, - { 0, "NULL", NULL, NULL } + info_lkp_default(-1, "unavailable"), + info_lkp_default(0, "open"), + info_lkp_default(1, "closed"), + info_lkp_default(2, "belowLowerCritical"), + info_lkp_default(3, "belowLowerWarning"), + info_lkp_default(4, "normal"), + info_lkp_default(5, "aboveUpperWarning"), + info_lkp_default(6, "aboveUpperCritical"), + info_lkp_default(7, "on"), + info_lkp_default(8, "off"), + info_lkp_default(9, "detected"), + info_lkp_default(10, "notDetected"), + info_lkp_default(11, "alarmed"), + info_lkp_default(12, "ok"), + info_lkp_default(13, "marginal"), + info_lkp_default(14, "fail"), + info_lkp_default(15, "yes"), + info_lkp_default(16, "no"), + info_lkp_default(17, "standby"), + info_lkp_default(18, "one"), + info_lkp_default(19, "two"), + info_lkp_default(20, "inSync"), + info_lkp_default(21, "outOfSync"), + info_lkp_default(22, "i1OpenFault"), + info_lkp_default(23, "i1ShortFault"), + info_lkp_default(24, "i2OpenFault"), + info_lkp_default(25, "i2ShortFault"), + info_lkp_default(26, "fault"), + info_lkp_default(27, "warning"), + info_lkp_default(28, "critical"), + info_lkp_default(29, "selfTest"), + info_lkp_default(30, "nonRedundant"), + info_lkp_sentinel }; static info_lkp_t raritanpx2_outlet_switchability_info[] = { - { -1, "yes", NULL, NULL }, - { 1, "yes", NULL, NULL }, - { 2, "no", NULL, NULL }, - { 0, NULL, NULL, NULL } + info_lkp_default(-1, "yes"), + info_lkp_default(1, "yes"), + info_lkp_default(2, "no"), + info_lkp_sentinel }; /* PDU2-MIB Snmp2NUT lookup table */ static snmp_info_t raritan_px2_mib[] = { /* standard MIB items */ - { "device.description", ST_FLAG_STRING | ST_FLAG_RW, SU_INFOSIZE, ".1.3.6.1.2.1.1.1.0", NULL, SU_FLAG_OK, NULL }, - { "device.contact", ST_FLAG_STRING | ST_FLAG_RW, SU_INFOSIZE, ".1.3.6.1.2.1.1.4.0", NULL, SU_FLAG_OK, NULL }, - { "device.location", ST_FLAG_STRING | ST_FLAG_RW, SU_INFOSIZE, ".1.3.6.1.2.1.1.6.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("device.description", ST_FLAG_STRING | ST_FLAG_RW, SU_INFOSIZE, ".1.3.6.1.2.1.1.1.0", NULL, SU_FLAG_OK, NULL), + snmp_info_default("device.contact", ST_FLAG_STRING | ST_FLAG_RW, SU_INFOSIZE, ".1.3.6.1.2.1.1.4.0", NULL, SU_FLAG_OK, NULL), + snmp_info_default("device.location", ST_FLAG_STRING | ST_FLAG_RW, SU_INFOSIZE, ".1.3.6.1.2.1.1.6.0", NULL, SU_FLAG_OK, NULL), /* pduManufacturer.1 = STRING: Raritan */ - { "device.mfr", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.13742.6.3.2.1.1.2.1", - "Raritan", SU_FLAG_STATIC | SU_FLAG_OK, NULL }, + snmp_info_default("device.mfr", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.13742.6.3.2.1.1.2.1", + "Raritan", SU_FLAG_STATIC | SU_FLAG_OK, NULL), /* pduModel.1 = STRING: PX2-5475 */ - { "device.model", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.13742.6.3.2.1.1.3.1", - "Raritan PX2 SNMP PDU device", SU_FLAG_STATIC | SU_FLAG_OK, NULL }, + snmp_info_default("device.model", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.13742.6.3.2.1.1.3.1", + "Raritan PX2 SNMP PDU device", SU_FLAG_STATIC | SU_FLAG_OK, NULL), /* pduSerialNumber.1 = STRING: QFC3950619 */ - { "device.serial", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.13742.6.3.2.1.1.4.1", - NULL, SU_FLAG_STATIC | SU_FLAG_OK, NULL }, - { "device.type", ST_FLAG_STRING, SU_INFOSIZE, NULL, "pdu", SU_FLAG_STATIC | SU_FLAG_ABSENT | SU_FLAG_OK, NULL }, + snmp_info_default("device.serial", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.13742.6.3.2.1.1.4.1", + NULL, SU_FLAG_STATIC | SU_FLAG_OK, NULL), + snmp_info_default("device.type", ST_FLAG_STRING, SU_INFOSIZE, NULL, "pdu", SU_FLAG_STATIC | SU_FLAG_ABSENT | SU_FLAG_OK, NULL), /* pxMACAddress.1 = STRING: 0:d:5d:b:49:0 */ - { "device.macaddr", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.13742.6.3.2.2.1.11.1", - NULL, SU_FLAG_STATIC | SU_FLAG_OK, NULL }, + snmp_info_default("device.macaddr", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.13742.6.3.2.2.1.11.1", + NULL, SU_FLAG_STATIC | SU_FLAG_OK, NULL), /* boardVersion.1.mainController.1 = STRING: 0x01 */ /* FIXME: not compliant! to be RFC'ed */ - { "device.revision", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.13742.6.3.2.3.1.4.1.1.1", "", SU_FLAG_STATIC | SU_FLAG_OK, NULL }, + snmp_info_default("device.revision", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.13742.6.3.2.3.1.4.1.1.1", "", SU_FLAG_STATIC | SU_FLAG_OK, NULL), /* FIXME: move to device collection! */ /* Wrong OID! - * { "ups.mfr.date", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.13742.6.3.2.3.1.6.1.1.1", "", SU_FLAG_OK | SU_FLAG_STATIC, NULL },*/ + * snmp_info_default("ups.mfr.date", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.13742.6.3.2.3.1.6.1.1.1", "", SU_FLAG_OK | SU_FLAG_STATIC, NULL),*/ /* boardFirmwareVersion.1.mainController.1 = STRING: 2.4.3.5-40298 */ - { "ups.firmware", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.13742.6.3.2.3.1.6.1.1.1", "", SU_FLAG_STATIC | SU_FLAG_OK, NULL }, + snmp_info_default("ups.firmware", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.13742.6.3.2.3.1.6.1.1.1", "", SU_FLAG_STATIC | SU_FLAG_OK, NULL), /* pduName.1 = STRING: my PX */ - { "ups.id", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.13742.6.3.2.2.1.13.1", "", SU_FLAG_STATIC | SU_FLAG_OK, NULL }, - { "ups.model", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.13742.6.3.2.1.1.3.1", - "Raritan PX2 SNMP PDU device", SU_FLAG_STATIC | SU_FLAG_OK, NULL }, + snmp_info_default("ups.id", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.13742.6.3.2.2.1.13.1", "", SU_FLAG_STATIC | SU_FLAG_OK, NULL), + snmp_info_default("ups.model", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.13742.6.3.2.1.1.3.1", + "Raritan PX2 SNMP PDU device", SU_FLAG_STATIC | SU_FLAG_OK, NULL), /* Input data: * Units are given in inletSensorUnits.1.1.%i * Value should be scaled by inletSensorDecimalDigits.1.1.%i * For example, if the value is 1 and inletSensorDecimalDigits is 2, then actual value is 0.01. */ /* measurementsInletSensorValue.1.1.rmsCurrent = Gauge32: 10 (A) */ - { "input.load", 0, 0.1, ".1.3.6.1.4.1.13742.6.5.2.3.1.4.1.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("input.load", 0, 0.1, ".1.3.6.1.4.1.13742.6.5.2.3.1.4.1.1.1", NULL, SU_FLAG_OK, NULL), /* measurementsInletSensorValue.1.1.rmsVoltage = Gauge32: 119 (V) */ - { "input.voltage", 0, 1, ".1.3.6.1.4.1.13742.6.5.2.3.1.4.1.1.4", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("input.voltage", 0, 1, ".1.3.6.1.4.1.13742.6.5.2.3.1.4.1.1.4", NULL, SU_FLAG_OK, NULL), /* measurementsInletSensorValue.1.1.activePower = Gauge32: 10 (W) */ - { "input.realpower", 0, 1, ".1.3.6.1.4.1.13742.6.5.2.3.1.4.1.1.5", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("input.realpower", 0, 1, ".1.3.6.1.4.1.13742.6.5.2.3.1.4.1.1.5", NULL, SU_FLAG_OK, NULL), /* measurementsInletSensorValue.1.1.apparentPower = Gauge32: 122 (VA) */ - { "input.power", 0, 1, ".1.3.6.1.4.1.13742.6.5.2.3.1.4.1.1.6", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("input.power", 0, 1, ".1.3.6.1.4.1.13742.6.5.2.3.1.4.1.1.6", NULL, SU_FLAG_OK, NULL), /* measurementsInletSensorValue.1.1.powerFactor = Gauge32: 8 (none) */ /* FIXME: need RFC! */ - { "input.powerfactor", 0, 0.01, ".1.3.6.1.4.1.13742.6.5.2.3.1.4.1.1.7", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("input.powerfactor", 0, 0.01, ".1.3.6.1.4.1.13742.6.5.2.3.1.4.1.1.7", NULL, SU_FLAG_OK, NULL), /* measurementsInletSensorValue.1.1.activeEnergy = Gauge32: 193359 (wattHour) */ - /* { "unmapped.measurementsInletSensorValue", 0, 1, ".1.3.6.1.4.1.13742.6.5.2.3.1.4.1.1.8", NULL, SU_FLAG_OK, NULL }, */ + /* snmp_info_default("unmapped.measurementsInletSensorValue", 0, 1, ".1.3.6.1.4.1.13742.6.5.2.3.1.4.1.1.8", NULL, SU_FLAG_OK, NULL), */ /* inletPlug.1.1 = INTEGER: plugIEC320C20(6) */ /* FIXME: need RFC (input.type | [input.]inlet.type...) and standardization - * { "unmapped.inletPlug", 0, 1, ".1.3.6.1.4.1.13742.6.3.3.3.1.4.1.1", NULL, SU_FLAG_OK, NULL },*/ + * snmp_info_default("unmapped.inletPlug", 0, 1, ".1.3.6.1.4.1.13742.6.3.3.3.1.4.1.1", NULL, SU_FLAG_OK, NULL),*/ /* outletCount.1 = INTEGER: 24 */ - { "outlet.count", 0, 1, ".1.3.6.1.4.1.13742.6.3.2.2.1.4.1", "0", SU_FLAG_STATIC | SU_FLAG_OK, NULL }, + snmp_info_default("outlet.count", 0, 1, ".1.3.6.1.4.1.13742.6.3.2.2.1.4.1", "0", SU_FLAG_STATIC | SU_FLAG_OK, NULL), /* outlet template definition * Indexes start from 1, ie outlet.1 => .1 */ /* Note: the first definition is used to determine the base index (ie 0 or 1) */ /* outletName.1.%i = STRING: */ - { "outlet.%i.desc", ST_FLAG_RW | ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.13742.6.3.5.3.1.3.1.%i", NULL, SU_OUTLET, NULL }, + snmp_info_default("outlet.%i.desc", ST_FLAG_RW | ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.13742.6.3.5.3.1.3.1.%i", NULL, SU_OUTLET, NULL), /* outletSwitchingState.1.%i = INTEGER: on(7) */ - { "outlet.%i.status", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.13742.6.4.1.2.1.3.1.%i", NULL, SU_OUTLET, &raritanpx2_outlet_status_info[0] }, + snmp_info_default("outlet.%i.status", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.13742.6.4.1.2.1.3.1.%i", NULL, SU_OUTLET, &raritanpx2_outlet_status_info[0]), /* outletLabel.1.%i = STRING: 1 */ - { "outlet.%i.id", 0, 1, ".1.3.6.1.4.1.13742.6.3.5.3.1.2.1.%i", "%i", SU_FLAG_STATIC | SU_OUTLET | SU_FLAG_OK, NULL }, + snmp_info_default("outlet.%i.id", 0, 1, ".1.3.6.1.4.1.13742.6.3.5.3.1.2.1.%i", "%i", SU_FLAG_STATIC | SU_OUTLET | SU_FLAG_OK, NULL), /* outletReceptacle.1.1 = INTEGER: receptacleNEMA520R(37) */ /* FIXME: need RFC and standardization - * { "outlet.%i.type", 0, 1, ".1.3.6.1.4.1.13742.6.3.5.3.1.4.1.%i", NULL, SU_OUTLET | SU_FLAG_OK, NULL }, */ + * snmp_info_default("outlet.%i.type", 0, 1, ".1.3.6.1.4.1.13742.6.3.5.3.1.4.1.%i", NULL, SU_OUTLET | SU_FLAG_OK, NULL), */ /* RMS Current (divide by 10). e.g. 5 == 0.5A */ /* measurementsOutletSensorValue.1.%i.rmsCurrent = Gauge32: 10 */ - { "outlet.%i.current", 0, 0.1, ".1.3.6.1.4.1.13742.6.5.4.3.1.4.1.%i.1", NULL, SU_OUTLET | SU_FLAG_OK, NULL }, + snmp_info_default("outlet.%i.current", 0, 0.1, ".1.3.6.1.4.1.13742.6.5.4.3.1.4.1.%i.1", NULL, SU_OUTLET | SU_FLAG_OK, NULL), /* measurementsOutletSensorValue.1.%i.rmsVoltage = Gauge32: 119 */ - { "outlet.%i.voltage", 0, 1, ".1.3.6.1.4.1.13742.6.5.4.3.1.4.1.%i.4", "%i", SU_OUTLET | SU_FLAG_OK, NULL }, + snmp_info_default("outlet.%i.voltage", 0, 1, ".1.3.6.1.4.1.13742.6.5.4.3.1.4.1.%i.4", "%i", SU_OUTLET | SU_FLAG_OK, NULL), /* measurementsOutletSensorValue.1.%i.activePower = Gauge32: 10 */ - { "outlet.%i.power", 0, 1, ".1.3.6.1.4.1.13742.6.5.4.3.1.4.1.%i.5", "%i", SU_OUTLET | SU_FLAG_OK, NULL }, + snmp_info_default("outlet.%i.power", 0, 1, ".1.3.6.1.4.1.13742.6.5.4.3.1.4.1.%i.5", "%i", SU_OUTLET | SU_FLAG_OK, NULL), /* measurementsOutletSensorValue.1.%i.apparentPower = Gauge32: 122 */ - { "outlet.%i.realpower", 0, 1, ".1.3.6.1.4.1.13742.6.5.4.3.1.4.1.%i.6", "%i", SU_OUTLET | SU_FLAG_OK, NULL }, + snmp_info_default("outlet.%i.realpower", 0, 1, ".1.3.6.1.4.1.13742.6.5.4.3.1.4.1.%i.6", "%i", SU_OUTLET | SU_FLAG_OK, NULL), /* measurementsOutletSensorValue.1.%i.powerFactor = Gauge32: 8 */ - { "outlet.%i.powerfactor", 0, 1, ".1.3.6.1.4.1.13742.6.5.4.3.1.4.1.%i.7", "%i", SU_OUTLET | SU_FLAG_OK, NULL }, + snmp_info_default("outlet.%i.powerfactor", 0, 1, ".1.3.6.1.4.1.13742.6.5.4.3.1.4.1.%i.7", "%i", SU_OUTLET | SU_FLAG_OK, NULL), /* measurementsOutletSensorValue.1.1.activeEnergy = Gauge32: 89890 */ /* FIXME: - * { "unmapped.measurementsOutletSensorValue", 0, 1, ".1.3.6.1.4.1.13742.6.5.4.3.1.4.1.1.8", NULL, SU_FLAG_OK, NULL }, */ + * snmp_info_default("unmapped.measurementsOutletSensorValue", 0, 1, ".1.3.6.1.4.1.13742.6.5.4.3.1.4.1.1.8", NULL, SU_FLAG_OK, NULL), */ /* measurementsOutletSensorValue.1.1.onOff = Gauge32: 0 */ /* FIXME: - * { "unmapped.measurementsOutletSensorValue", 0, 1, ".1.3.6.1.4.1.13742.6.5.4.3.1.4.1.1.14", NULL, SU_FLAG_OK, NULL }, */ + * snmp_info_default("unmapped.measurementsOutletSensorValue", 0, 1, ".1.3.6.1.4.1.13742.6.5.4.3.1.4.1.1.14", NULL, SU_FLAG_OK, NULL), */ /* outletSwitchable.1.%i = INTEGER: true(1) */ - { "outlet.%i.switchable", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.13742.6.3.5.3.1.28.1.%i", "no", SU_FLAG_STATIC | SU_OUTLET | SU_FLAG_OK, &raritanpx2_outlet_switchability_info[0] }, + snmp_info_default("outlet.%i.switchable", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.13742.6.3.5.3.1.28.1.%i", "no", SU_FLAG_STATIC | SU_OUTLET | SU_FLAG_OK, &raritanpx2_outlet_switchability_info[0]), /* instant commands. */ /* switchingOperation.1.1 = INTEGER: on(1) */ - { "outlet.%i.load.off", 0, 1, ".1.3.6.1.4.1.13742.6.4.1.2.1.2.1.%i", "0", SU_TYPE_CMD | SU_OUTLET, NULL }, - { "outlet.%i.load.on", 0, 1, ".1.3.6.1.4.1.13742.6.4.1.2.1.2.1.%i", "1", SU_TYPE_CMD | SU_OUTLET, NULL }, - { "outlet.%i.load.cycle", 0, 1, ".1.3.6.1.4.1.13742.6.4.1.2.1.2.1.%i", "2", SU_TYPE_CMD | SU_OUTLET, NULL }, + snmp_info_default("outlet.%i.load.off", 0, 1, ".1.3.6.1.4.1.13742.6.4.1.2.1.2.1.%i", "0", SU_TYPE_CMD | SU_OUTLET, NULL), + snmp_info_default("outlet.%i.load.on", 0, 1, ".1.3.6.1.4.1.13742.6.4.1.2.1.2.1.%i", "1", SU_TYPE_CMD | SU_OUTLET, NULL), + snmp_info_default("outlet.%i.load.cycle", 0, 1, ".1.3.6.1.4.1.13742.6.4.1.2.1.2.1.%i", "2", SU_TYPE_CMD | SU_OUTLET, NULL), #if WITH_UNMAPPED_DATA_POINTS || (defined DEBUG) /* pduCount.0 = INTEGER: 1 */ /* FIXME: part of daisychain support, RFC device.count */ - { "device.count", 0, 1, ".1.3.6.1.4.1.13742.6.3.1.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("device.count", 0, 1, ".1.3.6.1.4.1.13742.6.3.1.0", NULL, SU_FLAG_OK, NULL), #if WITH_UNMAPPED_DATA_POINTS /* pduRatedVoltage.1 = STRING: 100-120V */ - { "unmapped.pduRatedVoltage", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.13742.6.3.2.1.1.5.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduRatedVoltage", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.13742.6.3.2.1.1.5.1", NULL, SU_FLAG_OK, NULL), /* pduRatedCurrent.1 = STRING: 16A */ - { "unmapped.pduRatedCurrent", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.13742.6.3.2.1.1.6.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduRatedCurrent", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.13742.6.3.2.1.1.6.1", NULL, SU_FLAG_OK, NULL), /* pduRatedFrequency.1 = STRING: 50/60Hz */ - { "unmapped.pduRatedFrequency", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.13742.6.3.2.1.1.7.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduRatedFrequency", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.13742.6.3.2.1.1.7.1", NULL, SU_FLAG_OK, NULL), /* pduRatedVA.1 = STRING: 1.6-1.9kVA */ - { "unmapped.pduRatedVA", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.13742.6.3.2.1.1.8.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduRatedVA", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.13742.6.3.2.1.1.8.1", NULL, SU_FLAG_OK, NULL), /* pduImage.1 = STRING: */ - { "unmapped.pduImage", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.13742.6.3.2.1.1.9.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduImage", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.13742.6.3.2.1.1.9.1", NULL, SU_FLAG_OK, NULL), /* inletCount.1 = INTEGER: 1 */ - { "unmapped.inletCount", 0, 1, ".1.3.6.1.4.1.13742.6.3.2.2.1.2.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.inletCount", 0, 1, ".1.3.6.1.4.1.13742.6.3.2.2.1.2.1", NULL, SU_FLAG_OK, NULL), /* overCurrentProtectorCount.1 = INTEGER: 0 */ - { "unmapped.overCurrentProtectorCount", 0, 1, ".1.3.6.1.4.1.13742.6.3.2.2.1.3.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.overCurrentProtectorCount", 0, 1, ".1.3.6.1.4.1.13742.6.3.2.2.1.3.1", NULL, SU_FLAG_OK, NULL), /* inletControllerCount.1 = INTEGER: 0 */ - { "unmapped.inletControllerCount", 0, 1, ".1.3.6.1.4.1.13742.6.3.2.2.1.5.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.inletControllerCount", 0, 1, ".1.3.6.1.4.1.13742.6.3.2.2.1.5.1", NULL, SU_FLAG_OK, NULL), /* outletControllerCount.1 = INTEGER: 6 */ - { "unmapped.outletControllerCount", 0, 1, ".1.3.6.1.4.1.13742.6.3.2.2.1.6.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.outletControllerCount", 0, 1, ".1.3.6.1.4.1.13742.6.3.2.2.1.6.1", NULL, SU_FLAG_OK, NULL), /* externalSensorCount.1 = INTEGER: 16 */ - { "unmapped.externalSensorCount", 0, 1, ".1.3.6.1.4.1.13742.6.3.2.2.1.7.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.externalSensorCount", 0, 1, ".1.3.6.1.4.1.13742.6.3.2.2.1.7.1", NULL, SU_FLAG_OK, NULL), /* pxIPAddress.1 = IpAddress: 192.168.20.188 */ - { "unmapped.pxIPAddress", 0, 1, ".1.3.6.1.4.1.13742.6.3.2.2.1.8.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pxIPAddress", 0, 1, ".1.3.6.1.4.1.13742.6.3.2.2.1.8.1", NULL, SU_FLAG_OK, NULL), /* netmask.1 = IpAddress: 255.255.255.0 */ - { "unmapped.netmask", 0, 1, ".1.3.6.1.4.1.13742.6.3.2.2.1.9.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.netmask", 0, 1, ".1.3.6.1.4.1.13742.6.3.2.2.1.9.1", NULL, SU_FLAG_OK, NULL), /* gateway.1 = IpAddress: 192.168.20.254 */ - { "unmapped.gateway", 0, 1, ".1.3.6.1.4.1.13742.6.3.2.2.1.10.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.gateway", 0, 1, ".1.3.6.1.4.1.13742.6.3.2.2.1.10.1", NULL, SU_FLAG_OK, NULL), /* utcOffset.1 = STRING: -5:00 */ - { "unmapped.utcOffset", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.13742.6.3.2.2.1.12.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.utcOffset", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.13742.6.3.2.2.1.12.1", NULL, SU_FLAG_OK, NULL), /* externalSensorsZCoordinateUnits.1 = INTEGER: rackUnits(0) */ - { "unmapped.externalSensorsZCoordinateUnits", 0, 1, ".1.3.6.1.4.1.13742.6.3.2.2.1.34.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.externalSensorsZCoordinateUnits", 0, 1, ".1.3.6.1.4.1.13742.6.3.2.2.1.34.1", NULL, SU_FLAG_OK, NULL), /* unitDeviceCapabilities.1 = BITS: 00 00 00 00 00 00 */ - { "unmapped.unitDeviceCapabilities", 0, 1, ".1.3.6.1.4.1.13742.6.3.2.2.1.35.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.unitDeviceCapabilities", 0, 1, ".1.3.6.1.4.1.13742.6.3.2.2.1.35.1", NULL, SU_FLAG_OK, NULL), /* outletSequencingDelay.1 = Gauge32: 200 */ - { "unmapped.outletSequencingDelay", 0, 1, ".1.3.6.1.4.1.13742.6.3.2.2.1.36.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.outletSequencingDelay", 0, 1, ".1.3.6.1.4.1.13742.6.3.2.2.1.36.1", NULL, SU_FLAG_OK, NULL), /* globalOutletPowerCyclingPowerOffPeriod.1 = Gauge32: 10 */ - { "unmapped.globalOutletPowerCyclingPowerOffPeriod", 0, 1, ".1.3.6.1.4.1.13742.6.3.2.2.1.37.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.globalOutletPowerCyclingPowerOffPeriod", 0, 1, ".1.3.6.1.4.1.13742.6.3.2.2.1.37.1", NULL, SU_FLAG_OK, NULL), /* globalOutletStateOnStartup.1 = INTEGER: lastKnownState(2) */ - { "unmapped.globalOutletStateOnStartup", 0, 1, ".1.3.6.1.4.1.13742.6.3.2.2.1.38.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.globalOutletStateOnStartup", 0, 1, ".1.3.6.1.4.1.13742.6.3.2.2.1.38.1", NULL, SU_FLAG_OK, NULL), /* outletPowerupSequence.1 = STRING: 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24 */ - { "unmapped.outletPowerupSequence", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.13742.6.3.2.2.1.39.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.outletPowerupSequence", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.13742.6.3.2.2.1.39.1", NULL, SU_FLAG_OK, NULL), /* pduPowerCyclingPowerOffPeriod.1 = Gauge32: 3 */ - { "unmapped.pduPowerCyclingPowerOffPeriod", 0, 1, ".1.3.6.1.4.1.13742.6.3.2.2.1.40.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduPowerCyclingPowerOffPeriod", 0, 1, ".1.3.6.1.4.1.13742.6.3.2.2.1.40.1", NULL, SU_FLAG_OK, NULL), /* pduDaisychainMemberType.1 = INTEGER: standalone(0) */ - { "unmapped.pduDaisychainMemberType", 0, 1, ".1.3.6.1.4.1.13742.6.3.2.2.1.41.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pduDaisychainMemberType", 0, 1, ".1.3.6.1.4.1.13742.6.3.2.2.1.41.1", NULL, SU_FLAG_OK, NULL), /* managedExternalSensorCount.1 = INTEGER: 0 */ - { "unmapped.managedExternalSensorCount", 0, 1, ".1.3.6.1.4.1.13742.6.3.2.2.1.42.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.managedExternalSensorCount", 0, 1, ".1.3.6.1.4.1.13742.6.3.2.2.1.42.1", NULL, SU_FLAG_OK, NULL), /* pxInetAddressType.1 = INTEGER: ipv4(1) */ - { "unmapped.pxInetAddressType", 0, 1, ".1.3.6.1.4.1.13742.6.3.2.2.1.50.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pxInetAddressType", 0, 1, ".1.3.6.1.4.1.13742.6.3.2.2.1.50.1", NULL, SU_FLAG_OK, NULL), /* pxInetIPAddress.1 = Hex-STRING: C0 A8 14 BC */ - { "unmapped.pxInetIPAddress", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.13742.6.3.2.2.1.51.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pxInetIPAddress", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.13742.6.3.2.2.1.51.1", NULL, SU_FLAG_OK, NULL), /* pxInetNetmask.1 = Hex-STRING: FF FF FF 00 */ - { "unmapped.pxInetNetmask", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.13742.6.3.2.2.1.52.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pxInetNetmask", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.13742.6.3.2.2.1.52.1", NULL, SU_FLAG_OK, NULL), /* pxInetGateway.1 = Hex-STRING: C0 A8 14 FE */ - { "unmapped.pxInetGateway", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.13742.6.3.2.2.1.53.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.pxInetGateway", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.13742.6.3.2.2.1.53.1", NULL, SU_FLAG_OK, NULL), /* loadShedding.1 = INTEGER: false(2) */ - { "unmapped.loadShedding", 0, 1, ".1.3.6.1.4.1.13742.6.3.2.2.1.55.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.loadShedding", 0, 1, ".1.3.6.1.4.1.13742.6.3.2.2.1.55.1", NULL, SU_FLAG_OK, NULL), /* serverCount.1 = INTEGER: 8 */ - { "unmapped.serverCount", 0, 1, ".1.3.6.1.4.1.13742.6.3.2.2.1.56.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.serverCount", 0, 1, ".1.3.6.1.4.1.13742.6.3.2.2.1.56.1", NULL, SU_FLAG_OK, NULL), /* inrushGuardDelay.1 = Gauge32: 200 */ - { "unmapped.inrushGuardDelay", 0, 1, ".1.3.6.1.4.1.13742.6.3.2.2.1.57.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.inrushGuardDelay", 0, 1, ".1.3.6.1.4.1.13742.6.3.2.2.1.57.1", NULL, SU_FLAG_OK, NULL), /* cascadedDeviceConnected.1 = INTEGER: false(2) */ - { "unmapped.cascadedDeviceConnected", 0, 1, ".1.3.6.1.4.1.13742.6.3.2.2.1.58.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.cascadedDeviceConnected", 0, 1, ".1.3.6.1.4.1.13742.6.3.2.2.1.58.1", NULL, SU_FLAG_OK, NULL), /* synchronizeWithNTPServer.1 = INTEGER: false(2) */ - { "unmapped.synchronizeWithNTPServer", 0, 1, ".1.3.6.1.4.1.13742.6.3.2.2.1.59.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.synchronizeWithNTPServer", 0, 1, ".1.3.6.1.4.1.13742.6.3.2.2.1.59.1", NULL, SU_FLAG_OK, NULL), /* useDHCPProvidedNTPServer.1 = INTEGER: true(1) */ - { "unmapped.useDHCPProvidedNTPServer", 0, 1, ".1.3.6.1.4.1.13742.6.3.2.2.1.60.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.useDHCPProvidedNTPServer", 0, 1, ".1.3.6.1.4.1.13742.6.3.2.2.1.60.1", NULL, SU_FLAG_OK, NULL), /* firstNTPServerAddressType.1 = INTEGER: unknown(0) */ - { "unmapped.firstNTPServerAddressType", 0, 1, ".1.3.6.1.4.1.13742.6.3.2.2.1.61.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.firstNTPServerAddressType", 0, 1, ".1.3.6.1.4.1.13742.6.3.2.2.1.61.1", NULL, SU_FLAG_OK, NULL), /* firstNTPServerAddress.1 = "" */ - { "unmapped.firstNTPServerAddress", 0, 1, ".1.3.6.1.4.1.13742.6.3.2.2.1.62.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.firstNTPServerAddress", 0, 1, ".1.3.6.1.4.1.13742.6.3.2.2.1.62.1", NULL, SU_FLAG_OK, NULL), /* secondNTPServerAddressType.1 = INTEGER: unknown(0) */ - { "unmapped.secondNTPServerAddressType", 0, 1, ".1.3.6.1.4.1.13742.6.3.2.2.1.63.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.secondNTPServerAddressType", 0, 1, ".1.3.6.1.4.1.13742.6.3.2.2.1.63.1", NULL, SU_FLAG_OK, NULL), /* secondNTPServerAddress.1 = "" */ - { "unmapped.secondNTPServerAddress", 0, 1, ".1.3.6.1.4.1.13742.6.3.2.2.1.64.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.secondNTPServerAddress", 0, 1, ".1.3.6.1.4.1.13742.6.3.2.2.1.64.1", NULL, SU_FLAG_OK, NULL), /* wireCount.1 = INTEGER: 0 */ - { "unmapped.wireCount", 0, 1, ".1.3.6.1.4.1.13742.6.3.2.2.1.65.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.wireCount", 0, 1, ".1.3.6.1.4.1.13742.6.3.2.2.1.65.1", NULL, SU_FLAG_OK, NULL), /* transferSwitchCount.1 = INTEGER: 0 */ - { "unmapped.transferSwitchCount", 0, 1, ".1.3.6.1.4.1.13742.6.3.2.2.1.66.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.transferSwitchCount", 0, 1, ".1.3.6.1.4.1.13742.6.3.2.2.1.66.1", NULL, SU_FLAG_OK, NULL), /* boardVersion.1.outletController.{1-6} = STRING: 60 */ - { "unmapped.boardVersion", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.13742.6.3.2.3.1.4.1.3.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.boardVersion", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.13742.6.3.2.3.1.4.1.3.1", NULL, SU_FLAG_OK, NULL), /* boardFirmwareVersion.1.outletController.{1-6} = STRING: 1F */ - { "unmapped.boardFirmwareVersion", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.13742.6.3.2.3.1.6.1.3.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.boardFirmwareVersion", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.13742.6.3.2.3.1.6.1.3.1", NULL, SU_FLAG_OK, NULL), /* boardFirmwareTimeStamp.1.mainController.1 = Gauge32: 0 */ - { "unmapped.boardFirmwareTimeStamp", 0, 1, ".1.3.6.1.4.1.13742.6.3.2.3.1.8.1.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.boardFirmwareTimeStamp", 0, 1, ".1.3.6.1.4.1.13742.6.3.2.3.1.8.1.1.1", NULL, SU_FLAG_OK, NULL), /* dataLogging.1 = INTEGER: true(1) */ - { "unmapped.dataLogging", 0, 1, ".1.3.6.1.4.1.13742.6.3.2.4.1.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.dataLogging", 0, 1, ".1.3.6.1.4.1.13742.6.3.2.4.1.1.1", NULL, SU_FLAG_OK, NULL), /* measurementPeriod.1 = INTEGER: 1 */ - { "unmapped.measurementPeriod", 0, 1, ".1.3.6.1.4.1.13742.6.3.2.4.1.2.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.measurementPeriod", 0, 1, ".1.3.6.1.4.1.13742.6.3.2.4.1.2.1", NULL, SU_FLAG_OK, NULL), /* measurementsPerLogEntry.1 = INTEGER: 60 */ - { "unmapped.measurementsPerLogEntry", 0, 1, ".1.3.6.1.4.1.13742.6.3.2.4.1.3.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.measurementsPerLogEntry", 0, 1, ".1.3.6.1.4.1.13742.6.3.2.4.1.3.1", NULL, SU_FLAG_OK, NULL), /* logSize.1 = INTEGER: 120 */ - { "unmapped.logSize", 0, 1, ".1.3.6.1.4.1.13742.6.3.2.4.1.4.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.logSize", 0, 1, ".1.3.6.1.4.1.13742.6.3.2.4.1.4.1", NULL, SU_FLAG_OK, NULL), /* dataLoggingEnableForAllSensors.1 = INTEGER: false(2) */ - { "unmapped.dataLoggingEnableForAllSensors", 0, 1, ".1.3.6.1.4.1.13742.6.3.2.4.1.5.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.dataLoggingEnableForAllSensors", 0, 1, ".1.3.6.1.4.1.13742.6.3.2.4.1.5.1", NULL, SU_FLAG_OK, NULL), /* inletLabel.1.1 = STRING: I1 */ - { "unmapped.inletLabel", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.13742.6.3.3.3.1.2.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.inletLabel", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.13742.6.3.3.3.1.2.1.1", NULL, SU_FLAG_OK, NULL), /* inletName.1.1 = STRING: */ - { "unmapped.inletName", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.13742.6.3.3.3.1.3.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.inletName", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.13742.6.3.3.3.1.3.1.1", NULL, SU_FLAG_OK, NULL), /* inletPoleCount.1.1 = INTEGER: 2 */ - { "unmapped.inletPoleCount", 0, 1, ".1.3.6.1.4.1.13742.6.3.3.3.1.5.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.inletPoleCount", 0, 1, ".1.3.6.1.4.1.13742.6.3.3.3.1.5.1.1", NULL, SU_FLAG_OK, NULL), /* inletRatedVoltage.1.1 = STRING: 100-120V */ - { "unmapped.inletRatedVoltage", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.13742.6.3.3.3.1.6.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.inletRatedVoltage", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.13742.6.3.3.3.1.6.1.1", NULL, SU_FLAG_OK, NULL), /* inletRatedCurrent.1.1 = STRING: 16A */ - { "unmapped.inletRatedCurrent", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.13742.6.3.3.3.1.7.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.inletRatedCurrent", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.13742.6.3.3.3.1.7.1.1", NULL, SU_FLAG_OK, NULL), /* inletDeviceCapabilities.1.1 = BITS: 9F 00 00 00 00 00 rmsCurrent(0) rmsVoltage(3) activePower(4) apparentPower(5) powerFactor(6) activeEnergy(7) */ - { "unmapped.inletDeviceCapabilities", 0, 1, ".1.3.6.1.4.1.13742.6.3.3.3.1.10.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.inletDeviceCapabilities", 0, 1, ".1.3.6.1.4.1.13742.6.3.3.3.1.10.1.1", NULL, SU_FLAG_OK, NULL), /* inletPoleCapabilities.1.1 = BITS: 00 00 00 00 00 00 */ - { "unmapped.inletPoleCapabilities", 0, 1, ".1.3.6.1.4.1.13742.6.3.3.3.1.11.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.inletPoleCapabilities", 0, 1, ".1.3.6.1.4.1.13742.6.3.3.3.1.11.1.1", NULL, SU_FLAG_OK, NULL), /* inletPlugDescriptor.1.1 = STRING: IEC 60320 C20 */ - { "unmapped.inletPlugDescriptor", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.13742.6.3.3.3.1.12.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.inletPlugDescriptor", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.13742.6.3.3.3.1.12.1.1", NULL, SU_FLAG_OK, NULL), /* inletSensorLogAvailable.1.1.rmsCurrent = INTEGER: true(1) */ - { "unmapped.inletSensorLogAvailable", 0, 1, ".1.3.6.1.4.1.13742.6.3.3.4.1.4.1.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.inletSensorLogAvailable", 0, 1, ".1.3.6.1.4.1.13742.6.3.3.4.1.4.1.1.1", NULL, SU_FLAG_OK, NULL), /* inletSensorLogAvailable.1.1.rmsVoltage = INTEGER: true(1) */ - { "unmapped.inletSensorLogAvailable", 0, 1, ".1.3.6.1.4.1.13742.6.3.3.4.1.4.1.1.4", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.inletSensorLogAvailable", 0, 1, ".1.3.6.1.4.1.13742.6.3.3.4.1.4.1.1.4", NULL, SU_FLAG_OK, NULL), /* inletSensorLogAvailable.1.1.activePower = INTEGER: true(1) */ - { "unmapped.inletSensorLogAvailable", 0, 1, ".1.3.6.1.4.1.13742.6.3.3.4.1.4.1.1.5", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.inletSensorLogAvailable", 0, 1, ".1.3.6.1.4.1.13742.6.3.3.4.1.4.1.1.5", NULL, SU_FLAG_OK, NULL), /* inletSensorLogAvailable.1.1.apparentPower = INTEGER: true(1) */ - { "unmapped.inletSensorLogAvailable", 0, 1, ".1.3.6.1.4.1.13742.6.3.3.4.1.4.1.1.6", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.inletSensorLogAvailable", 0, 1, ".1.3.6.1.4.1.13742.6.3.3.4.1.4.1.1.6", NULL, SU_FLAG_OK, NULL), /* inletSensorLogAvailable.1.1.powerFactor = INTEGER: true(1) */ - { "unmapped.inletSensorLogAvailable", 0, 1, ".1.3.6.1.4.1.13742.6.3.3.4.1.4.1.1.7", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.inletSensorLogAvailable", 0, 1, ".1.3.6.1.4.1.13742.6.3.3.4.1.4.1.1.7", NULL, SU_FLAG_OK, NULL), /* inletSensorLogAvailable.1.1.activeEnergy = INTEGER: true(1) */ - { "unmapped.inletSensorLogAvailable", 0, 1, ".1.3.6.1.4.1.13742.6.3.3.4.1.4.1.1.8", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.inletSensorLogAvailable", 0, 1, ".1.3.6.1.4.1.13742.6.3.3.4.1.4.1.1.8", NULL, SU_FLAG_OK, NULL), /* inletSensorUnits.1.1.rmsCurrent = INTEGER: amp(2) */ - { "unmapped.inletSensorUnits", 0, 1, ".1.3.6.1.4.1.13742.6.3.3.4.1.6.1.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.inletSensorUnits", 0, 1, ".1.3.6.1.4.1.13742.6.3.3.4.1.6.1.1.1", NULL, SU_FLAG_OK, NULL), /* inletSensorUnits.1.1.rmsVoltage = INTEGER: volt(1) */ - { "unmapped.inletSensorUnits", 0, 1, ".1.3.6.1.4.1.13742.6.3.3.4.1.6.1.1.4", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.inletSensorUnits", 0, 1, ".1.3.6.1.4.1.13742.6.3.3.4.1.6.1.1.4", NULL, SU_FLAG_OK, NULL), /* inletSensorUnits.1.1.activePower = INTEGER: watt(3) */ - { "unmapped.inletSensorUnits", 0, 1, ".1.3.6.1.4.1.13742.6.3.3.4.1.6.1.1.5", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.inletSensorUnits", 0, 1, ".1.3.6.1.4.1.13742.6.3.3.4.1.6.1.1.5", NULL, SU_FLAG_OK, NULL), /* inletSensorUnits.1.1.apparentPower = INTEGER: voltamp(4) */ - { "unmapped.inletSensorUnits", 0, 1, ".1.3.6.1.4.1.13742.6.3.3.4.1.6.1.1.6", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.inletSensorUnits", 0, 1, ".1.3.6.1.4.1.13742.6.3.3.4.1.6.1.1.6", NULL, SU_FLAG_OK, NULL), /* inletSensorUnits.1.1.powerFactor = INTEGER: none(-1) */ - { "unmapped.inletSensorUnits", 0, 1, ".1.3.6.1.4.1.13742.6.3.3.4.1.6.1.1.7", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.inletSensorUnits", 0, 1, ".1.3.6.1.4.1.13742.6.3.3.4.1.6.1.1.7", NULL, SU_FLAG_OK, NULL), /* inletSensorUnits.1.1.activeEnergy = INTEGER: wattHour(5) */ - { "unmapped.inletSensorUnits", 0, 1, ".1.3.6.1.4.1.13742.6.3.3.4.1.6.1.1.8", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.inletSensorUnits", 0, 1, ".1.3.6.1.4.1.13742.6.3.3.4.1.6.1.1.8", NULL, SU_FLAG_OK, NULL), /* inletSensorDecimalDigits.1.1.rmsCurrent = Gauge32: 1 */ - { "unmapped.inletSensorDecimalDigits", 0, 1, ".1.3.6.1.4.1.13742.6.3.3.4.1.7.1.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.inletSensorDecimalDigits", 0, 1, ".1.3.6.1.4.1.13742.6.3.3.4.1.7.1.1.1", NULL, SU_FLAG_OK, NULL), /* inletSensorDecimalDigits.1.1.rmsVoltage = Gauge32: 0 */ - { "unmapped.inletSensorDecimalDigits", 0, 1, ".1.3.6.1.4.1.13742.6.3.3.4.1.7.1.1.4", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.inletSensorDecimalDigits", 0, 1, ".1.3.6.1.4.1.13742.6.3.3.4.1.7.1.1.4", NULL, SU_FLAG_OK, NULL), /* inletSensorDecimalDigits.1.1.activePower = Gauge32: 0 */ - { "unmapped.inletSensorDecimalDigits", 0, 1, ".1.3.6.1.4.1.13742.6.3.3.4.1.7.1.1.5", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.inletSensorDecimalDigits", 0, 1, ".1.3.6.1.4.1.13742.6.3.3.4.1.7.1.1.5", NULL, SU_FLAG_OK, NULL), /* inletSensorDecimalDigits.1.1.apparentPower = Gauge32: 0 */ - { "unmapped.inletSensorDecimalDigits", 0, 1, ".1.3.6.1.4.1.13742.6.3.3.4.1.7.1.1.6", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.inletSensorDecimalDigits", 0, 1, ".1.3.6.1.4.1.13742.6.3.3.4.1.7.1.1.6", NULL, SU_FLAG_OK, NULL), /* inletSensorDecimalDigits.1.1.powerFactor = Gauge32: 2 */ - { "unmapped.inletSensorDecimalDigits", 0, 1, ".1.3.6.1.4.1.13742.6.3.3.4.1.7.1.1.7", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.inletSensorDecimalDigits", 0, 1, ".1.3.6.1.4.1.13742.6.3.3.4.1.7.1.1.7", NULL, SU_FLAG_OK, NULL), /* inletSensorDecimalDigits.1.1.activeEnergy = Gauge32: 0 */ - { "unmapped.inletSensorDecimalDigits", 0, 1, ".1.3.6.1.4.1.13742.6.3.3.4.1.7.1.1.8", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.inletSensorDecimalDigits", 0, 1, ".1.3.6.1.4.1.13742.6.3.3.4.1.7.1.1.8", NULL, SU_FLAG_OK, NULL), /* inletSensorAccuracy.1.1.rmsCurrent = Gauge32: 100 */ - { "unmapped.inletSensorAccuracy", 0, 1, ".1.3.6.1.4.1.13742.6.3.3.4.1.8.1.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.inletSensorAccuracy", 0, 1, ".1.3.6.1.4.1.13742.6.3.3.4.1.8.1.1.1", NULL, SU_FLAG_OK, NULL), /* inletSensorAccuracy.1.1.rmsVoltage = Gauge32: 100 */ - { "unmapped.inletSensorAccuracy", 0, 1, ".1.3.6.1.4.1.13742.6.3.3.4.1.8.1.1.4", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.inletSensorAccuracy", 0, 1, ".1.3.6.1.4.1.13742.6.3.3.4.1.8.1.1.4", NULL, SU_FLAG_OK, NULL), /* inletSensorAccuracy.1.1.activePower = Gauge32: 300 */ - { "unmapped.inletSensorAccuracy", 0, 1, ".1.3.6.1.4.1.13742.6.3.3.4.1.8.1.1.5", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.inletSensorAccuracy", 0, 1, ".1.3.6.1.4.1.13742.6.3.3.4.1.8.1.1.5", NULL, SU_FLAG_OK, NULL), /* inletSensorAccuracy.1.1.apparentPower = Gauge32: 200 */ - { "unmapped.inletSensorAccuracy", 0, 1, ".1.3.6.1.4.1.13742.6.3.3.4.1.8.1.1.6", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.inletSensorAccuracy", 0, 1, ".1.3.6.1.4.1.13742.6.3.3.4.1.8.1.1.6", NULL, SU_FLAG_OK, NULL), /* inletSensorAccuracy.1.1.powerFactor = Gauge32: 500 */ - { "unmapped.inletSensorAccuracy", 0, 1, ".1.3.6.1.4.1.13742.6.3.3.4.1.8.1.1.7", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.inletSensorAccuracy", 0, 1, ".1.3.6.1.4.1.13742.6.3.3.4.1.8.1.1.7", NULL, SU_FLAG_OK, NULL), /* inletSensorAccuracy.1.1.activeEnergy = Gauge32: 100 */ - { "unmapped.inletSensorAccuracy", 0, 1, ".1.3.6.1.4.1.13742.6.3.3.4.1.8.1.1.8", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.inletSensorAccuracy", 0, 1, ".1.3.6.1.4.1.13742.6.3.3.4.1.8.1.1.8", NULL, SU_FLAG_OK, NULL), /* inletSensorResolution.1.1.rmsCurrent = Gauge32: 1 */ - { "unmapped.inletSensorResolution", 0, 1, ".1.3.6.1.4.1.13742.6.3.3.4.1.9.1.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.inletSensorResolution", 0, 1, ".1.3.6.1.4.1.13742.6.3.3.4.1.9.1.1.1", NULL, SU_FLAG_OK, NULL), /* inletSensorResolution.1.1.rmsVoltage = Gauge32: 1 */ - { "unmapped.inletSensorResolution", 0, 1, ".1.3.6.1.4.1.13742.6.3.3.4.1.9.1.1.4", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.inletSensorResolution", 0, 1, ".1.3.6.1.4.1.13742.6.3.3.4.1.9.1.1.4", NULL, SU_FLAG_OK, NULL), /* inletSensorResolution.1.1.activePower = Gauge32: 1 */ - { "unmapped.inletSensorResolution", 0, 1, ".1.3.6.1.4.1.13742.6.3.3.4.1.9.1.1.5", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.inletSensorResolution", 0, 1, ".1.3.6.1.4.1.13742.6.3.3.4.1.9.1.1.5", NULL, SU_FLAG_OK, NULL), /* inletSensorResolution.1.1.apparentPower = Gauge32: 1 */ - { "unmapped.inletSensorResolution", 0, 1, ".1.3.6.1.4.1.13742.6.3.3.4.1.9.1.1.6", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.inletSensorResolution", 0, 1, ".1.3.6.1.4.1.13742.6.3.3.4.1.9.1.1.6", NULL, SU_FLAG_OK, NULL), /* inletSensorResolution.1.1.powerFactor = Gauge32: 1 */ - { "unmapped.inletSensorResolution", 0, 1, ".1.3.6.1.4.1.13742.6.3.3.4.1.9.1.1.7", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.inletSensorResolution", 0, 1, ".1.3.6.1.4.1.13742.6.3.3.4.1.9.1.1.7", NULL, SU_FLAG_OK, NULL), /* inletSensorResolution.1.1.activeEnergy = Gauge32: 1 */ - { "unmapped.inletSensorResolution", 0, 1, ".1.3.6.1.4.1.13742.6.3.3.4.1.9.1.1.8", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.inletSensorResolution", 0, 1, ".1.3.6.1.4.1.13742.6.3.3.4.1.9.1.1.8", NULL, SU_FLAG_OK, NULL), /* inletSensorTolerance.1.1.rmsCurrent = Gauge32: 120 */ - { "unmapped.inletSensorTolerance", 0, 1, ".1.3.6.1.4.1.13742.6.3.3.4.1.10.1.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.inletSensorTolerance", 0, 1, ".1.3.6.1.4.1.13742.6.3.3.4.1.10.1.1.1", NULL, SU_FLAG_OK, NULL), /* inletSensorTolerance.1.1.rmsVoltage = Gauge32: 5 */ - { "unmapped.inletSensorTolerance", 0, 1, ".1.3.6.1.4.1.13742.6.3.3.4.1.10.1.1.4", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.inletSensorTolerance", 0, 1, ".1.3.6.1.4.1.13742.6.3.3.4.1.10.1.1.4", NULL, SU_FLAG_OK, NULL), /* inletSensorTolerance.1.1.activePower = Gauge32: 120 */ - { "unmapped.inletSensorTolerance", 0, 1, ".1.3.6.1.4.1.13742.6.3.3.4.1.10.1.1.5", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.inletSensorTolerance", 0, 1, ".1.3.6.1.4.1.13742.6.3.3.4.1.10.1.1.5", NULL, SU_FLAG_OK, NULL), /* inletSensorTolerance.1.1.apparentPower = Gauge32: 120 */ - { "unmapped.inletSensorTolerance", 0, 1, ".1.3.6.1.4.1.13742.6.3.3.4.1.10.1.1.6", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.inletSensorTolerance", 0, 1, ".1.3.6.1.4.1.13742.6.3.3.4.1.10.1.1.6", NULL, SU_FLAG_OK, NULL), /* inletSensorTolerance.1.1.powerFactor = Gauge32: 50 */ - { "unmapped.inletSensorTolerance", 0, 1, ".1.3.6.1.4.1.13742.6.3.3.4.1.10.1.1.7", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.inletSensorTolerance", 0, 1, ".1.3.6.1.4.1.13742.6.3.3.4.1.10.1.1.7", NULL, SU_FLAG_OK, NULL), /* inletSensorTolerance.1.1.activeEnergy = Gauge32: 120 */ - { "unmapped.inletSensorTolerance", 0, 1, ".1.3.6.1.4.1.13742.6.3.3.4.1.10.1.1.8", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.inletSensorTolerance", 0, 1, ".1.3.6.1.4.1.13742.6.3.3.4.1.10.1.1.8", NULL, SU_FLAG_OK, NULL), /* inletSensorMaximum.1.1.rmsCurrent = Gauge32: 7680 */ - { "unmapped.inletSensorMaximum", 0, 1, ".1.3.6.1.4.1.13742.6.3.3.4.1.11.1.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.inletSensorMaximum", 0, 1, ".1.3.6.1.4.1.13742.6.3.3.4.1.11.1.1.1", NULL, SU_FLAG_OK, NULL), /* inletSensorMaximum.1.1.rmsVoltage = Gauge32: 264 */ - { "unmapped.inletSensorMaximum", 0, 1, ".1.3.6.1.4.1.13742.6.3.3.4.1.11.1.1.4", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.inletSensorMaximum", 0, 1, ".1.3.6.1.4.1.13742.6.3.3.4.1.11.1.1.4", NULL, SU_FLAG_OK, NULL), /* inletSensorMaximum.1.1.activePower = Gauge32: 202752 */ - { "unmapped.inletSensorMaximum", 0, 1, ".1.3.6.1.4.1.13742.6.3.3.4.1.11.1.1.5", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.inletSensorMaximum", 0, 1, ".1.3.6.1.4.1.13742.6.3.3.4.1.11.1.1.5", NULL, SU_FLAG_OK, NULL), /* inletSensorMaximum.1.1.apparentPower = Gauge32: 202752 */ - { "unmapped.inletSensorMaximum", 0, 1, ".1.3.6.1.4.1.13742.6.3.3.4.1.11.1.1.6", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.inletSensorMaximum", 0, 1, ".1.3.6.1.4.1.13742.6.3.3.4.1.11.1.1.6", NULL, SU_FLAG_OK, NULL), /* inletSensorMaximum.1.1.powerFactor = Gauge32: 100 */ - { "unmapped.inletSensorMaximum", 0, 1, ".1.3.6.1.4.1.13742.6.3.3.4.1.11.1.1.7", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.inletSensorMaximum", 0, 1, ".1.3.6.1.4.1.13742.6.3.3.4.1.11.1.1.7", NULL, SU_FLAG_OK, NULL), /* inletSensorMaximum.1.1.activeEnergy = Gauge32: 4294967295 */ - { "unmapped.inletSensorMaximum", 0, 1, ".1.3.6.1.4.1.13742.6.3.3.4.1.11.1.1.8", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.inletSensorMaximum", 0, 1, ".1.3.6.1.4.1.13742.6.3.3.4.1.11.1.1.8", NULL, SU_FLAG_OK, NULL), /* inletSensorMinimum.1.1.rmsCurrent = Gauge32: 0 */ - { "unmapped.inletSensorMinimum", 0, 1, ".1.3.6.1.4.1.13742.6.3.3.4.1.12.1.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.inletSensorMinimum", 0, 1, ".1.3.6.1.4.1.13742.6.3.3.4.1.12.1.1.1", NULL, SU_FLAG_OK, NULL), /* inletSensorMinimum.1.1.rmsVoltage = Gauge32: 0 */ - { "unmapped.inletSensorMinimum", 0, 1, ".1.3.6.1.4.1.13742.6.3.3.4.1.12.1.1.4", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.inletSensorMinimum", 0, 1, ".1.3.6.1.4.1.13742.6.3.3.4.1.12.1.1.4", NULL, SU_FLAG_OK, NULL), /* inletSensorMinimum.1.1.activePower = Gauge32: 0 */ - { "unmapped.inletSensorMinimum", 0, 1, ".1.3.6.1.4.1.13742.6.3.3.4.1.12.1.1.5", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.inletSensorMinimum", 0, 1, ".1.3.6.1.4.1.13742.6.3.3.4.1.12.1.1.5", NULL, SU_FLAG_OK, NULL), /* inletSensorMinimum.1.1.apparentPower = Gauge32: 0 */ - { "unmapped.inletSensorMinimum", 0, 1, ".1.3.6.1.4.1.13742.6.3.3.4.1.12.1.1.6", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.inletSensorMinimum", 0, 1, ".1.3.6.1.4.1.13742.6.3.3.4.1.12.1.1.6", NULL, SU_FLAG_OK, NULL), /* inletSensorMinimum.1.1.powerFactor = Gauge32: 0 */ - { "unmapped.inletSensorMinimum", 0, 1, ".1.3.6.1.4.1.13742.6.3.3.4.1.12.1.1.7", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.inletSensorMinimum", 0, 1, ".1.3.6.1.4.1.13742.6.3.3.4.1.12.1.1.7", NULL, SU_FLAG_OK, NULL), /* inletSensorMinimum.1.1.activeEnergy = Gauge32: 0 */ - { "unmapped.inletSensorMinimum", 0, 1, ".1.3.6.1.4.1.13742.6.3.3.4.1.12.1.1.8", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.inletSensorMinimum", 0, 1, ".1.3.6.1.4.1.13742.6.3.3.4.1.12.1.1.8", NULL, SU_FLAG_OK, NULL), /* inletSensorHysteresis.1.1.rmsCurrent = Gauge32: 10 */ - { "unmapped.inletSensorHysteresis", 0, 1, ".1.3.6.1.4.1.13742.6.3.3.4.1.13.1.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.inletSensorHysteresis", 0, 1, ".1.3.6.1.4.1.13742.6.3.3.4.1.13.1.1.1", NULL, SU_FLAG_OK, NULL), /* inletSensorHysteresis.1.1.rmsVoltage = Gauge32: 2 */ - { "unmapped.inletSensorHysteresis", 0, 1, ".1.3.6.1.4.1.13742.6.3.3.4.1.13.1.1.4", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.inletSensorHysteresis", 0, 1, ".1.3.6.1.4.1.13742.6.3.3.4.1.13.1.1.4", NULL, SU_FLAG_OK, NULL), /* inletSensorHysteresis.1.1.activePower = Gauge32: 0 */ - { "unmapped.inletSensorHysteresis", 0, 1, ".1.3.6.1.4.1.13742.6.3.3.4.1.13.1.1.5", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.inletSensorHysteresis", 0, 1, ".1.3.6.1.4.1.13742.6.3.3.4.1.13.1.1.5", NULL, SU_FLAG_OK, NULL), /* inletSensorHysteresis.1.1.apparentPower = Gauge32: 0 */ - { "unmapped.inletSensorHysteresis", 0, 1, ".1.3.6.1.4.1.13742.6.3.3.4.1.13.1.1.6", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.inletSensorHysteresis", 0, 1, ".1.3.6.1.4.1.13742.6.3.3.4.1.13.1.1.6", NULL, SU_FLAG_OK, NULL), /* inletSensorHysteresis.1.1.powerFactor = Gauge32: 0 */ - { "unmapped.inletSensorHysteresis", 0, 1, ".1.3.6.1.4.1.13742.6.3.3.4.1.13.1.1.7", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.inletSensorHysteresis", 0, 1, ".1.3.6.1.4.1.13742.6.3.3.4.1.13.1.1.7", NULL, SU_FLAG_OK, NULL), /* inletSensorHysteresis.1.1.activeEnergy = Gauge32: 0 */ - { "unmapped.inletSensorHysteresis", 0, 1, ".1.3.6.1.4.1.13742.6.3.3.4.1.13.1.1.8", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.inletSensorHysteresis", 0, 1, ".1.3.6.1.4.1.13742.6.3.3.4.1.13.1.1.8", NULL, SU_FLAG_OK, NULL), /* inletSensorStateChangeDelay.1.1.rmsCurrent = Gauge32: 0 */ - { "unmapped.inletSensorStateChangeDelay", 0, 1, ".1.3.6.1.4.1.13742.6.3.3.4.1.14.1.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.inletSensorStateChangeDelay", 0, 1, ".1.3.6.1.4.1.13742.6.3.3.4.1.14.1.1.1", NULL, SU_FLAG_OK, NULL), /* inletSensorStateChangeDelay.1.1.rmsVoltage = Gauge32: 0 */ - { "unmapped.inletSensorStateChangeDelay", 0, 1, ".1.3.6.1.4.1.13742.6.3.3.4.1.14.1.1.4", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.inletSensorStateChangeDelay", 0, 1, ".1.3.6.1.4.1.13742.6.3.3.4.1.14.1.1.4", NULL, SU_FLAG_OK, NULL), /* inletSensorStateChangeDelay.1.1.activePower = Gauge32: 0 */ - { "unmapped.inletSensorStateChangeDelay", 0, 1, ".1.3.6.1.4.1.13742.6.3.3.4.1.14.1.1.5", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.inletSensorStateChangeDelay", 0, 1, ".1.3.6.1.4.1.13742.6.3.3.4.1.14.1.1.5", NULL, SU_FLAG_OK, NULL), /* inletSensorStateChangeDelay.1.1.apparentPower = Gauge32: 0 */ - { "unmapped.inletSensorStateChangeDelay", 0, 1, ".1.3.6.1.4.1.13742.6.3.3.4.1.14.1.1.6", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.inletSensorStateChangeDelay", 0, 1, ".1.3.6.1.4.1.13742.6.3.3.4.1.14.1.1.6", NULL, SU_FLAG_OK, NULL), /* inletSensorStateChangeDelay.1.1.powerFactor = Gauge32: 0 */ - { "unmapped.inletSensorStateChangeDelay", 0, 1, ".1.3.6.1.4.1.13742.6.3.3.4.1.14.1.1.7", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.inletSensorStateChangeDelay", 0, 1, ".1.3.6.1.4.1.13742.6.3.3.4.1.14.1.1.7", NULL, SU_FLAG_OK, NULL), /* inletSensorStateChangeDelay.1.1.activeEnergy = Gauge32: 0 */ - { "unmapped.inletSensorStateChangeDelay", 0, 1, ".1.3.6.1.4.1.13742.6.3.3.4.1.14.1.1.8", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.inletSensorStateChangeDelay", 0, 1, ".1.3.6.1.4.1.13742.6.3.3.4.1.14.1.1.8", NULL, SU_FLAG_OK, NULL), /* Inlet thresholds */ /* inletSensorLowerCriticalThreshold.1.1.rmsCurrent = Gauge32: 0 */ - { "unmapped.inletSensorLowerCriticalThreshold", 0, 1, ".1.3.6.1.4.1.13742.6.3.3.4.1.21.1.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.inletSensorLowerCriticalThreshold", 0, 1, ".1.3.6.1.4.1.13742.6.3.3.4.1.21.1.1.1", NULL, SU_FLAG_OK, NULL), /* inletSensorLowerCriticalThreshold.1.1.rmsVoltage = Gauge32: 94 */ - { "unmapped.inletSensorLowerCriticalThreshold", 0, 1, ".1.3.6.1.4.1.13742.6.3.3.4.1.21.1.1.4", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.inletSensorLowerCriticalThreshold", 0, 1, ".1.3.6.1.4.1.13742.6.3.3.4.1.21.1.1.4", NULL, SU_FLAG_OK, NULL), /* inletSensorLowerCriticalThreshold.1.1.activePower = Gauge32: 0 */ - { "unmapped.inletSensorLowerCriticalThreshold", 0, 1, ".1.3.6.1.4.1.13742.6.3.3.4.1.21.1.1.5", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.inletSensorLowerCriticalThreshold", 0, 1, ".1.3.6.1.4.1.13742.6.3.3.4.1.21.1.1.5", NULL, SU_FLAG_OK, NULL), /* inletSensorLowerCriticalThreshold.1.1.apparentPower = Gauge32: 0 */ - { "unmapped.inletSensorLowerCriticalThreshold", 0, 1, ".1.3.6.1.4.1.13742.6.3.3.4.1.21.1.1.6", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.inletSensorLowerCriticalThreshold", 0, 1, ".1.3.6.1.4.1.13742.6.3.3.4.1.21.1.1.6", NULL, SU_FLAG_OK, NULL), /* inletSensorLowerCriticalThreshold.1.1.powerFactor = Gauge32: 0 */ - { "unmapped.inletSensorLowerCriticalThreshold", 0, 1, ".1.3.6.1.4.1.13742.6.3.3.4.1.21.1.1.7", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.inletSensorLowerCriticalThreshold", 0, 1, ".1.3.6.1.4.1.13742.6.3.3.4.1.21.1.1.7", NULL, SU_FLAG_OK, NULL), /* inletSensorLowerCriticalThreshold.1.1.activeEnergy = Gauge32: 0 */ - { "unmapped.inletSensorLowerCriticalThreshold", 0, 1, ".1.3.6.1.4.1.13742.6.3.3.4.1.21.1.1.8", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.inletSensorLowerCriticalThreshold", 0, 1, ".1.3.6.1.4.1.13742.6.3.3.4.1.21.1.1.8", NULL, SU_FLAG_OK, NULL), /* inletSensorLowerWarningThreshold.1.1.rmsCurrent = Gauge32: 0 */ - { "unmapped.inletSensorLowerWarningThreshold", 0, 1, ".1.3.6.1.4.1.13742.6.3.3.4.1.22.1.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.inletSensorLowerWarningThreshold", 0, 1, ".1.3.6.1.4.1.13742.6.3.3.4.1.22.1.1.1", NULL, SU_FLAG_OK, NULL), /* inletSensorLowerWarningThreshold.1.1.rmsVoltage = Gauge32: 97 */ - { "unmapped.inletSensorLowerWarningThreshold", 0, 1, ".1.3.6.1.4.1.13742.6.3.3.4.1.22.1.1.4", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.inletSensorLowerWarningThreshold", 0, 1, ".1.3.6.1.4.1.13742.6.3.3.4.1.22.1.1.4", NULL, SU_FLAG_OK, NULL), /* inletSensorLowerWarningThreshold.1.1.activePower = Gauge32: 0 */ - { "unmapped.inletSensorLowerWarningThreshold", 0, 1, ".1.3.6.1.4.1.13742.6.3.3.4.1.22.1.1.5", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.inletSensorLowerWarningThreshold", 0, 1, ".1.3.6.1.4.1.13742.6.3.3.4.1.22.1.1.5", NULL, SU_FLAG_OK, NULL), /* inletSensorLowerWarningThreshold.1.1.apparentPower = Gauge32: 0 */ - { "unmapped.inletSensorLowerWarningThreshold", 0, 1, ".1.3.6.1.4.1.13742.6.3.3.4.1.22.1.1.6", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.inletSensorLowerWarningThreshold", 0, 1, ".1.3.6.1.4.1.13742.6.3.3.4.1.22.1.1.6", NULL, SU_FLAG_OK, NULL), /* inletSensorLowerWarningThreshold.1.1.powerFactor = Gauge32: 0 */ - { "unmapped.inletSensorLowerWarningThreshold", 0, 1, ".1.3.6.1.4.1.13742.6.3.3.4.1.22.1.1.7", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.inletSensorLowerWarningThreshold", 0, 1, ".1.3.6.1.4.1.13742.6.3.3.4.1.22.1.1.7", NULL, SU_FLAG_OK, NULL), /* inletSensorLowerWarningThreshold.1.1.activeEnergy = Gauge32: 0 */ - { "unmapped.inletSensorLowerWarningThreshold", 0, 1, ".1.3.6.1.4.1.13742.6.3.3.4.1.22.1.1.8", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.inletSensorLowerWarningThreshold", 0, 1, ".1.3.6.1.4.1.13742.6.3.3.4.1.22.1.1.8", NULL, SU_FLAG_OK, NULL), /* inletSensorUpperCriticalThreshold.1.1.rmsCurrent = Gauge32: 128 */ - { "unmapped.inletSensorUpperCriticalThreshold", 0, 1, ".1.3.6.1.4.1.13742.6.3.3.4.1.23.1.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.inletSensorUpperCriticalThreshold", 0, 1, ".1.3.6.1.4.1.13742.6.3.3.4.1.23.1.1.1", NULL, SU_FLAG_OK, NULL), /* inletSensorUpperCriticalThreshold.1.1.rmsVoltage = Gauge32: 127 */ - { "unmapped.inletSensorUpperCriticalThreshold", 0, 1, ".1.3.6.1.4.1.13742.6.3.3.4.1.23.1.1.4", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.inletSensorUpperCriticalThreshold", 0, 1, ".1.3.6.1.4.1.13742.6.3.3.4.1.23.1.1.4", NULL, SU_FLAG_OK, NULL), /* inletSensorUpperCriticalThreshold.1.1.activePower = Gauge32: 0 */ - { "unmapped.inletSensorUpperCriticalThreshold", 0, 1, ".1.3.6.1.4.1.13742.6.3.3.4.1.23.1.1.5", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.inletSensorUpperCriticalThreshold", 0, 1, ".1.3.6.1.4.1.13742.6.3.3.4.1.23.1.1.5", NULL, SU_FLAG_OK, NULL), /* inletSensorUpperCriticalThreshold.1.1.apparentPower = Gauge32: 0 */ - { "unmapped.inletSensorUpperCriticalThreshold", 0, 1, ".1.3.6.1.4.1.13742.6.3.3.4.1.23.1.1.6", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.inletSensorUpperCriticalThreshold", 0, 1, ".1.3.6.1.4.1.13742.6.3.3.4.1.23.1.1.6", NULL, SU_FLAG_OK, NULL), /* inletSensorUpperCriticalThreshold.1.1.powerFactor = Gauge32: 0 */ - { "unmapped.inletSensorUpperCriticalThreshold", 0, 1, ".1.3.6.1.4.1.13742.6.3.3.4.1.23.1.1.7", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.inletSensorUpperCriticalThreshold", 0, 1, ".1.3.6.1.4.1.13742.6.3.3.4.1.23.1.1.7", NULL, SU_FLAG_OK, NULL), /* inletSensorUpperCriticalThreshold.1.1.activeEnergy = Gauge32: 0 */ - { "unmapped.inletSensorUpperCriticalThreshold", 0, 1, ".1.3.6.1.4.1.13742.6.3.3.4.1.23.1.1.8", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.inletSensorUpperCriticalThreshold", 0, 1, ".1.3.6.1.4.1.13742.6.3.3.4.1.23.1.1.8", NULL, SU_FLAG_OK, NULL), /* inletSensorUpperWarningThreshold.1.1.rmsCurrent = Gauge32: 104 */ - { "unmapped.inletSensorUpperWarningThreshold", 0, 1, ".1.3.6.1.4.1.13742.6.3.3.4.1.24.1.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.inletSensorUpperWarningThreshold", 0, 1, ".1.3.6.1.4.1.13742.6.3.3.4.1.24.1.1.1", NULL, SU_FLAG_OK, NULL), /* inletSensorUpperWarningThreshold.1.1.rmsVoltage = Gauge32: 124 */ - { "unmapped.inletSensorUpperWarningThreshold", 0, 1, ".1.3.6.1.4.1.13742.6.3.3.4.1.24.1.1.4", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.inletSensorUpperWarningThreshold", 0, 1, ".1.3.6.1.4.1.13742.6.3.3.4.1.24.1.1.4", NULL, SU_FLAG_OK, NULL), /* inletSensorUpperWarningThreshold.1.1.activePower = Gauge32: 0 */ - { "unmapped.inletSensorUpperWarningThreshold", 0, 1, ".1.3.6.1.4.1.13742.6.3.3.4.1.24.1.1.5", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.inletSensorUpperWarningThreshold", 0, 1, ".1.3.6.1.4.1.13742.6.3.3.4.1.24.1.1.5", NULL, SU_FLAG_OK, NULL), /* inletSensorUpperWarningThreshold.1.1.apparentPower = Gauge32: 0 */ - { "unmapped.inletSensorUpperWarningThreshold", 0, 1, ".1.3.6.1.4.1.13742.6.3.3.4.1.24.1.1.6", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.inletSensorUpperWarningThreshold", 0, 1, ".1.3.6.1.4.1.13742.6.3.3.4.1.24.1.1.6", NULL, SU_FLAG_OK, NULL), /* inletSensorUpperWarningThreshold.1.1.powerFactor = Gauge32: 0 */ - { "unmapped.inletSensorUpperWarningThreshold", 0, 1, ".1.3.6.1.4.1.13742.6.3.3.4.1.24.1.1.7", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.inletSensorUpperWarningThreshold", 0, 1, ".1.3.6.1.4.1.13742.6.3.3.4.1.24.1.1.7", NULL, SU_FLAG_OK, NULL), /* inletSensorUpperWarningThreshold.1.1.activeEnergy = Gauge32: 0 */ - { "unmapped.inletSensorUpperWarningThreshold", 0, 1, ".1.3.6.1.4.1.13742.6.3.3.4.1.24.1.1.8", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.inletSensorUpperWarningThreshold", 0, 1, ".1.3.6.1.4.1.13742.6.3.3.4.1.24.1.1.8", NULL, SU_FLAG_OK, NULL), /* inletSensorEnabledThresholds.1.1.rmsCurrent = BITS: 30 upperWarning(2) upperCritical(3) */ - { "unmapped.inletSensorEnabledThresholds", 0, 1, ".1.3.6.1.4.1.13742.6.3.3.4.1.25.1.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.inletSensorEnabledThresholds", 0, 1, ".1.3.6.1.4.1.13742.6.3.3.4.1.25.1.1.1", NULL, SU_FLAG_OK, NULL), /* inletSensorEnabledThresholds.1.1.rmsVoltage = BITS: F0 lowerCritical(0) lowerWarning(1) upperWarning(2) upperCritical(3) */ - { "unmapped.inletSensorEnabledThresholds", 0, 1, ".1.3.6.1.4.1.13742.6.3.3.4.1.25.1.1.4", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.inletSensorEnabledThresholds", 0, 1, ".1.3.6.1.4.1.13742.6.3.3.4.1.25.1.1.4", NULL, SU_FLAG_OK, NULL), /* inletSensorEnabledThresholds.1.1.activePower = BITS: 00 */ - { "unmapped.inletSensorEnabledThresholds", 0, 1, ".1.3.6.1.4.1.13742.6.3.3.4.1.25.1.1.5", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.inletSensorEnabledThresholds", 0, 1, ".1.3.6.1.4.1.13742.6.3.3.4.1.25.1.1.5", NULL, SU_FLAG_OK, NULL), /* inletSensorEnabledThresholds.1.1.apparentPower = BITS: 00 */ - { "unmapped.inletSensorEnabledThresholds", 0, 1, ".1.3.6.1.4.1.13742.6.3.3.4.1.25.1.1.6", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.inletSensorEnabledThresholds", 0, 1, ".1.3.6.1.4.1.13742.6.3.3.4.1.25.1.1.6", NULL, SU_FLAG_OK, NULL), /* inletSensorEnabledThresholds.1.1.powerFactor = BITS: 00 */ - { "unmapped.inletSensorEnabledThresholds", 0, 1, ".1.3.6.1.4.1.13742.6.3.3.4.1.25.1.1.7", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.inletSensorEnabledThresholds", 0, 1, ".1.3.6.1.4.1.13742.6.3.3.4.1.25.1.1.7", NULL, SU_FLAG_OK, NULL), /* inletSensorEnabledThresholds.1.1.activeEnergy = BITS: 00 */ - { "unmapped.inletSensorEnabledThresholds", 0, 1, ".1.3.6.1.4.1.13742.6.3.3.4.1.25.1.1.8", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.inletSensorEnabledThresholds", 0, 1, ".1.3.6.1.4.1.13742.6.3.3.4.1.25.1.1.8", NULL, SU_FLAG_OK, NULL), /* outletPoleCount.1.{1-24} = INTEGER: 2 */ - { "unmapped.outletPoleCount", 0, 1, ".1.3.6.1.4.1.13742.6.3.5.3.1.5.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.outletPoleCount", 0, 1, ".1.3.6.1.4.1.13742.6.3.5.3.1.5.1.1", NULL, SU_FLAG_OK, NULL), /* outletRatedVoltage.1.{1-24} = STRING: 100-120V */ - { "unmapped.outletRatedVoltage", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.13742.6.3.5.3.1.6.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.outletRatedVoltage", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.13742.6.3.5.3.1.6.1.1", NULL, SU_FLAG_OK, NULL), /* outletRatedCurrent.1.{1-24} = STRING: 16A */ - { "unmapped.outletRatedCurrent", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.13742.6.3.5.3.1.7.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.outletRatedCurrent", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.13742.6.3.5.3.1.7.1.1", NULL, SU_FLAG_OK, NULL), /* outletDeviceCapabilities.1.{1-24} = BITS: 9F 04 00 00 00 00 rmsCurrent(0) rmsVoltage(3) activePower(4) apparentPower(5) powerFactor(6) activeEnergy(7) onOff(13) */ - { "unmapped.outletDeviceCapabilities", 0, 1, ".1.3.6.1.4.1.13742.6.3.5.3.1.10.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.outletDeviceCapabilities", 0, 1, ".1.3.6.1.4.1.13742.6.3.5.3.1.10.1.1", NULL, SU_FLAG_OK, NULL), /* outletPowerCyclingPowerOffPeriod.1.{1-24} = Gauge32: 10 */ - { "unmapped.outletPowerCyclingPowerOffPeriod", 0, 1, ".1.3.6.1.4.1.13742.6.3.5.3.1.12.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.outletPowerCyclingPowerOffPeriod", 0, 1, ".1.3.6.1.4.1.13742.6.3.5.3.1.12.1.1", NULL, SU_FLAG_OK, NULL), /* outletStateOnStartup.1.{1-24} = INTEGER: globalOutletStateOnStartup(3) */ - { "unmapped.outletStateOnStartup", 0, 1, ".1.3.6.1.4.1.13742.6.3.5.3.1.13.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.outletStateOnStartup", 0, 1, ".1.3.6.1.4.1.13742.6.3.5.3.1.13.1.1", NULL, SU_FLAG_OK, NULL), /* outletUseGlobalPowerCyclingPowerOffPeriod.1.{1-24} = INTEGER: true(1) */ - { "unmapped.outletUseGlobalPowerCyclingPowerOffPeriod", 0, 1, ".1.3.6.1.4.1.13742.6.3.5.3.1.14.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.outletUseGlobalPowerCyclingPowerOffPeriod", 0, 1, ".1.3.6.1.4.1.13742.6.3.5.3.1.14.1.1", NULL, SU_FLAG_OK, NULL), /* outletReceptacleDescriptor.1.{1-24} = STRING: NEMA 5-20R */ - { "unmapped.outletReceptacleDescriptor", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.13742.6.3.5.3.1.29.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.outletReceptacleDescriptor", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.13742.6.3.5.3.1.29.1.1", NULL, SU_FLAG_OK, NULL), /* outletNonCritical.1.{1-24} = INTEGER: false(2) */ - { "unmapped.outletNonCritical", 0, 1, ".1.3.6.1.4.1.13742.6.3.5.3.1.30.1.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.outletNonCritical", 0, 1, ".1.3.6.1.4.1.13742.6.3.5.3.1.30.1.1", NULL, SU_FLAG_OK, NULL), /* outletSequenceDelay.1.{1-24} = Gauge32: 0 */ - { "unmapped.outletSequenceDelay", 0, 1, ".1.3.6.1.4.1.13742.6.3.5.3.1.32.1.%i", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.outletSequenceDelay", 0, 1, ".1.3.6.1.4.1.13742.6.3.5.3.1.32.1.%i", NULL, SU_FLAG_OK, NULL), /* outletSensorLogAvailable.1.{1-24}.rmsCurrent = INTEGER: true(1) */ - { "unmapped.outletSensorLogAvailable", 0, 1, ".1.3.6.1.4.1.13742.6.3.5.4.1.4.1.%i.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.outletSensorLogAvailable", 0, 1, ".1.3.6.1.4.1.13742.6.3.5.4.1.4.1.%i.1", NULL, SU_FLAG_OK, NULL), /* outletSensorLogAvailable.1.{1-24}.rmsVoltage = INTEGER: true(1) */ - { "unmapped.outletSensorLogAvailable", 0, 1, ".1.3.6.1.4.1.13742.6.3.5.4.1.4.1.%i.4", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.outletSensorLogAvailable", 0, 1, ".1.3.6.1.4.1.13742.6.3.5.4.1.4.1.%i.4", NULL, SU_FLAG_OK, NULL), /* outletSensorLogAvailable.1.{1-24}.activePower = INTEGER: true(1) */ - { "unmapped.outletSensorLogAvailable", 0, 1, ".1.3.6.1.4.1.13742.6.3.5.4.1.4.1.%i.5", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.outletSensorLogAvailable", 0, 1, ".1.3.6.1.4.1.13742.6.3.5.4.1.4.1.%i.5", NULL, SU_FLAG_OK, NULL), /* outletSensorLogAvailable.1.{1-24}.apparentPower = INTEGER: true(1) */ - { "unmapped.outletSensorLogAvailable", 0, 1, ".1.3.6.1.4.1.13742.6.3.5.4.1.4.1.%i.6", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.outletSensorLogAvailable", 0, 1, ".1.3.6.1.4.1.13742.6.3.5.4.1.4.1.%i.6", NULL, SU_FLAG_OK, NULL), /* outletSensorLogAvailable.1.{1-24}.powerFactor = INTEGER: true(1) */ - { "unmapped.outletSensorLogAvailable", 0, 1, ".1.3.6.1.4.1.13742.6.3.5.4.1.4.1.%i.7", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.outletSensorLogAvailable", 0, 1, ".1.3.6.1.4.1.13742.6.3.5.4.1.4.1.%i.7", NULL, SU_FLAG_OK, NULL), /* outletSensorLogAvailable.1.{1-24}.activeEnergy = INTEGER: true(1) */ - { "unmapped.outletSensorLogAvailable", 0, 1, ".1.3.6.1.4.1.13742.6.3.5.4.1.4.1.%i.8", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.outletSensorLogAvailable", 0, 1, ".1.3.6.1.4.1.13742.6.3.5.4.1.4.1.%i.8", NULL, SU_FLAG_OK, NULL), /* outletSensorLogAvailable.1.{1-24}.onOff = INTEGER: true(1) */ - { "unmapped.outletSensorLogAvailable", 0, 1, ".1.3.6.1.4.1.13742.6.3.5.4.1.4.1.%i.14", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.outletSensorLogAvailable", 0, 1, ".1.3.6.1.4.1.13742.6.3.5.4.1.4.1.%i.14", NULL, SU_FLAG_OK, NULL), /* outletSensorUnits.1.{1-24}.rmsCurrent = INTEGER: amp(2) */ - { "unmapped.outletSensorUnits", 0, 1, ".1.3.6.1.4.1.13742.6.3.5.4.1.6.1.%i.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.outletSensorUnits", 0, 1, ".1.3.6.1.4.1.13742.6.3.5.4.1.6.1.%i.1", NULL, SU_FLAG_OK, NULL), /* outletSensorUnits.1.{1-24}.rmsVoltage = INTEGER: volt(1) */ - { "unmapped.outletSensorUnits", 0, 1, ".1.3.6.1.4.1.13742.6.3.5.4.1.6.1.%i.4", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.outletSensorUnits", 0, 1, ".1.3.6.1.4.1.13742.6.3.5.4.1.6.1.%i.4", NULL, SU_FLAG_OK, NULL), /* outletSensorUnits.1.{1-24}.activePower = INTEGER: watt(3) */ - { "unmapped.outletSensorUnits", 0, 1, ".1.3.6.1.4.1.13742.6.3.5.4.1.6.1.%i.5", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.outletSensorUnits", 0, 1, ".1.3.6.1.4.1.13742.6.3.5.4.1.6.1.%i.5", NULL, SU_FLAG_OK, NULL), /* outletSensorUnits.1.{1-24}.apparentPower = INTEGER: voltamp(4) */ - { "unmapped.outletSensorUnits", 0, 1, ".1.3.6.1.4.1.13742.6.3.5.4.1.6.1.%i.6", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.outletSensorUnits", 0, 1, ".1.3.6.1.4.1.13742.6.3.5.4.1.6.1.%i.6", NULL, SU_FLAG_OK, NULL), /* outletSensorUnits.1.{1-24}.powerFactor = INTEGER: none(-1) */ - { "unmapped.outletSensorUnits", 0, 1, ".1.3.6.1.4.1.13742.6.3.5.4.1.6.1.%i.7", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.outletSensorUnits", 0, 1, ".1.3.6.1.4.1.13742.6.3.5.4.1.6.1.%i.7", NULL, SU_FLAG_OK, NULL), /* outletSensorUnits.1.{1-24}.activeEnergy = INTEGER: wattHour(5) */ - { "unmapped.outletSensorUnits", 0, 1, ".1.3.6.1.4.1.13742.6.3.5.4.1.6.1.%i.8", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.outletSensorUnits", 0, 1, ".1.3.6.1.4.1.13742.6.3.5.4.1.6.1.%i.8", NULL, SU_FLAG_OK, NULL), /* outletSensorUnits.1.{1-24}.onOff = INTEGER: none(-1) */ - { "unmapped.outletSensorUnits", 0, 1, ".1.3.6.1.4.1.13742.6.3.5.4.1.6.1.%i.14", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.outletSensorUnits", 0, 1, ".1.3.6.1.4.1.13742.6.3.5.4.1.6.1.%i.14", NULL, SU_FLAG_OK, NULL), /* outletSensorDecimalDigits.1.{1-24}.rmsCurrent = Gauge32: 1 */ - { "unmapped.outletSensorDecimalDigits", 0, 1, ".1.3.6.1.4.1.13742.6.3.5.4.1.7.1.%i.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.outletSensorDecimalDigits", 0, 1, ".1.3.6.1.4.1.13742.6.3.5.4.1.7.1.%i.1", NULL, SU_FLAG_OK, NULL), /* outletSensorDecimalDigits.1.{1-24}.rmsVoltage = Gauge32: 0 */ - { "unmapped.outletSensorDecimalDigits", 0, 1, ".1.3.6.1.4.1.13742.6.3.5.4.1.7.1.%i.4", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.outletSensorDecimalDigits", 0, 1, ".1.3.6.1.4.1.13742.6.3.5.4.1.7.1.%i.4", NULL, SU_FLAG_OK, NULL), /* outletSensorDecimalDigits.1.{1-24}.activePower = Gauge32: 0 */ - { "unmapped.outletSensorDecimalDigits", 0, 1, ".1.3.6.1.4.1.13742.6.3.5.4.1.7.1.%i.5", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.outletSensorDecimalDigits", 0, 1, ".1.3.6.1.4.1.13742.6.3.5.4.1.7.1.%i.5", NULL, SU_FLAG_OK, NULL), /* outletSensorDecimalDigits.1.{1-24}.apparentPower = Gauge32: 0 */ - { "unmapped.outletSensorDecimalDigits", 0, 1, ".1.3.6.1.4.1.13742.6.3.5.4.1.7.1.%i.6", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.outletSensorDecimalDigits", 0, 1, ".1.3.6.1.4.1.13742.6.3.5.4.1.7.1.%i.6", NULL, SU_FLAG_OK, NULL), /* outletSensorDecimalDigits.1.{1-24}.powerFactor = Gauge32: 2 */ - { "unmapped.outletSensorDecimalDigits", 0, 1, ".1.3.6.1.4.1.13742.6.3.5.4.1.7.1.%i.7", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.outletSensorDecimalDigits", 0, 1, ".1.3.6.1.4.1.13742.6.3.5.4.1.7.1.%i.7", NULL, SU_FLAG_OK, NULL), /* outletSensorDecimalDigits.1.{1-24}.activeEnergy = Gauge32: 0 */ - { "unmapped.outletSensorDecimalDigits", 0, 1, ".1.3.6.1.4.1.13742.6.3.5.4.1.7.1.%i.8", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.outletSensorDecimalDigits", 0, 1, ".1.3.6.1.4.1.13742.6.3.5.4.1.7.1.%i.8", NULL, SU_FLAG_OK, NULL), /* outletSensorDecimalDigits.1.{1-24}.onOff = Gauge32: 0 */ - { "unmapped.outletSensorDecimalDigits", 0, 1, ".1.3.6.1.4.1.13742.6.3.5.4.1.7.1.%i.14", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.outletSensorDecimalDigits", 0, 1, ".1.3.6.1.4.1.13742.6.3.5.4.1.7.1.%i.14", NULL, SU_FLAG_OK, NULL), /* outletSensorAccuracy.1.{1-24}.rmsCurrent = Gauge32: 100 */ - { "unmapped.outletSensorAccuracy", 0, 1, ".1.3.6.1.4.1.13742.6.3.5.4.1.8.1.%i.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.outletSensorAccuracy", 0, 1, ".1.3.6.1.4.1.13742.6.3.5.4.1.8.1.%i.1", NULL, SU_FLAG_OK, NULL), /* outletSensorAccuracy.1.{1-24}.rmsVoltage = Gauge32: 100 */ - { "unmapped.outletSensorAccuracy", 0, 1, ".1.3.6.1.4.1.13742.6.3.5.4.1.8.1.%i.4", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.outletSensorAccuracy", 0, 1, ".1.3.6.1.4.1.13742.6.3.5.4.1.8.1.%i.4", NULL, SU_FLAG_OK, NULL), /* outletSensorAccuracy.1.{1-24}.activePower = Gauge32: 300 */ - { "unmapped.outletSensorAccuracy", 0, 1, ".1.3.6.1.4.1.13742.6.3.5.4.1.8.1.%i.5", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.outletSensorAccuracy", 0, 1, ".1.3.6.1.4.1.13742.6.3.5.4.1.8.1.%i.5", NULL, SU_FLAG_OK, NULL), /* outletSensorAccuracy.1.{1-24}.apparentPower = Gauge32: 200 */ - { "unmapped.outletSensorAccuracy", 0, 1, ".1.3.6.1.4.1.13742.6.3.5.4.1.8.1.%i.6", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.outletSensorAccuracy", 0, 1, ".1.3.6.1.4.1.13742.6.3.5.4.1.8.1.%i.6", NULL, SU_FLAG_OK, NULL), /* outletSensorAccuracy.1.{1-24}.powerFactor = Gauge32: 100 */ - { "unmapped.outletSensorAccuracy", 0, 1, ".1.3.6.1.4.1.13742.6.3.5.4.1.8.1.%i.7", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.outletSensorAccuracy", 0, 1, ".1.3.6.1.4.1.13742.6.3.5.4.1.8.1.%i.7", NULL, SU_FLAG_OK, NULL), /* outletSensorAccuracy.1.{1-24}.activeEnergy = Gauge32: 100 */ - { "unmapped.outletSensorAccuracy", 0, 1, ".1.3.6.1.4.1.13742.6.3.5.4.1.8.1.%i.8", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.outletSensorAccuracy", 0, 1, ".1.3.6.1.4.1.13742.6.3.5.4.1.8.1.%i.8", NULL, SU_FLAG_OK, NULL), /* outletSensorAccuracy.1.{1-24}.onOff = Gauge32: 0 */ - { "unmapped.outletSensorAccuracy", 0, 1, ".1.3.6.1.4.1.13742.6.3.5.4.1.8.1.%i.14", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.outletSensorAccuracy", 0, 1, ".1.3.6.1.4.1.13742.6.3.5.4.1.8.1.%i.14", NULL, SU_FLAG_OK, NULL), /* outletSensorResolution.1.{1-24}.rmsCurrent = Gauge32: 1 */ - { "unmapped.outletSensorResolution", 0, 1, ".1.3.6.1.4.1.13742.6.3.5.4.1.9.1.%i.1", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.outletSensorResolution", 0, 1, ".1.3.6.1.4.1.13742.6.3.5.4.1.9.1.%i.1", NULL, SU_FLAG_OK, NULL), /* outletSensorResolution.1.{1-24}.rmsVoltage = Gauge32: 1 */ - { "unmapped.outletSensorResolution", 0, 1, ".1.3.6.1.4.1.13742.6.3.5.4.1.9.1.%i.4", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.outletSensorResolution", 0, 1, ".1.3.6.1.4.1.13742.6.3.5.4.1.9.1.%i.4", NULL, SU_FLAG_OK, NULL), /* outletSensorResolution.1.{1-24}.activePower = Gauge32: 1 */ - { "unmapped.outletSensorResolution", 0, 1, ".1.3.6.1.4.1.13742.6.3.5.4.1.9.1.%i.5", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.outletSensorResolution", 0, 1, ".1.3.6.1.4.1.13742.6.3.5.4.1.9.1.%i.5", NULL, SU_FLAG_OK, NULL), /* outletSensorResolution.1.{1-24}.apparentPower = Gauge32: 1 */ - { "unmapped.outletSensorResolution", 0, 1, ".1.3.6.1.4.1.13742.6.3.5.4.1.9.1.%i.6", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.outletSensorResolution", 0, 1, ".1.3.6.1.4.1.13742.6.3.5.4.1.9.1.%i.6", NULL, SU_FLAG_OK, NULL), /* outletSensorResolution.1.{1-24}.powerFactor = Gauge32: 1 */ - { "unmapped.outletSensorResolution", 0, 1, ".1.3.6.1.4.1.13742.6.3.5.4.1.9.1.%i.7", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.outletSensorResolution", 0, 1, ".1.3.6.1.4.1.13742.6.3.5.4.1.9.1.%i.7", NULL, SU_FLAG_OK, NULL), /* outletSensorResolution.1.{1-24}.activeEnergy = Gauge32: 1 */ - { "unmapped.outletSensorResolution", 0, 1, ".1.3.6.1.4.1.13742.6.3.5.4.1.9.1.%i.8", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.outletSensorResolution", 0, 1, ".1.3.6.1.4.1.13742.6.3.5.4.1.9.1.%i.8", NULL, SU_FLAG_OK, NULL), /* outletSensorResolution.1.{1-24}.onOff = Gauge32: 0 */ - { "unmapped.outletSensorResolution", 0, 1, ".1.3.6.1.4.1.13742.6.3.5.4.1.9.1.%i.14", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("unmapped.outletSensorResolution", 0, 1, ".1.3.6.1.4.1.13742.6.3.5.4.1.9.1.%i.14", NULL, SU_FLAG_OK, NULL), /* end of interesting data * the rest is 18MB of verbose log and satellite data */ @@ -582,7 +595,7 @@ static snmp_info_t raritan_px2_mib[] = { #endif /* DEBUG || WITH_UNMAPPED_DATA_POINTS */ /* end of structure. */ - { NULL, 0, 0, NULL, NULL, 0, NULL } + snmp_info_sentinel }; mib2nut_info_t raritan_px2 = { "raritan-px2", RARITAN_PX2_MIB_VERSION, NULL, RARITAN_PX2_OID_MODEL_NAME, raritan_px2_mib, RARITAN_PX2_MIB_SYSOID, NULL }; diff --git a/drivers/riello.c b/drivers/riello.c index 0f4fc9d064..28c992bfde 100644 --- a/drivers/riello.c +++ b/drivers/riello.c @@ -26,6 +26,9 @@ * Reference of the derivative work: blazer driver */ +#include "config.h" /* must be the first header */ +#include "common.h" /* for upsdebugx() etc */ + #include #include "main.h" @@ -67,14 +70,12 @@ uint16_t riello_calc_CRC(uint8_t type, uint8_t *buff, uint16_t size, uint8_t che size--; CRC_Word = 0x554D; while(size--) { - pom = (CRC_Word ^ *buff) & 0x00ff; - pom = (pom ^ (pom << 4)) & 0x00ff; - /* Thanks to &0xff above, pom is at most 255 -- - * so shifted by 8 bits is still uint16_t range + pom = (CRC_Word ^ *buff) & 0x00ff; + pom = (pom ^ (pom << 4)) & 0x00ff; + /* Thanks to &0x00ff above, pom is at most 255 -- + * so shifted by 8 bits is still uint16_t range: */ - pom = (uint16_t)(pom << 8); - pom ^= (pom << 3); - pom ^= (pom >> 4); + pom = (pom << 8) ^ (pom << 3) ^ (pom >> 4); CRC_Word = (CRC_Word >> 8) ^ pom; buff++; } diff --git a/drivers/riello_ser.c b/drivers/riello_ser.c index 810d9486de..6748fca83a 100644 --- a/drivers/riello_ser.c +++ b/drivers/riello_ser.c @@ -25,6 +25,7 @@ */ #include "config.h" /* must be the first header */ +#include "common.h" /* for upsdebugx() etc */ #include @@ -35,18 +36,19 @@ #include "main.h" #include "serial.h" #include "timehead.h" + /* -// The serial driver has no need for HID structures/code currently -// (maybe there is/was a plan for sharing something between siblings). -// Note that HID is tied to libusb or libshut definitions at the moment. + * // The serial driver has no need for HID structures/code currently + * // (maybe there is/was a plan for sharing something between siblings). + * // Note that HID is tied to libusb or libshut definitions at the moment. #include "hidparser.h" #include "hidtypes.h" -*/ -#include "common.h" /* for upsdebugx() etc */ + */ + #include "riello.h" #define DRIVER_NAME "Riello serial driver" -#define DRIVER_VERSION "0.08" +#define DRIVER_VERSION "0.09" #define DEFAULT_OFFDELAY 5 #define DEFAULT_BOOTDELAY 5 diff --git a/drivers/riello_usb.c b/drivers/riello_usb.c index 23f326c324..e965fd7830 100644 --- a/drivers/riello_usb.c +++ b/drivers/riello_usb.c @@ -34,7 +34,7 @@ #include "riello.h" #define DRIVER_NAME "Riello USB driver" -#define DRIVER_VERSION "0.10" +#define DRIVER_VERSION "0.11" #define DEFAULT_OFFDELAY 5 /*!< seconds (max 0xFF) */ #define DEFAULT_BOOTDELAY 5 /*!< seconds (max 0xFF) */ diff --git a/drivers/sms_ser.c b/drivers/sms_ser.c index 572a114dac..02100634c9 100644 --- a/drivers/sms_ser.c +++ b/drivers/sms_ser.c @@ -54,13 +54,14 @@ upsdrv_info_t upsdrv_info = { void sms_parse_features(uint8_t *rawvalues, SmsData *results) { char tbattery[6]; char frequency[4]; + int i; memset(results->voltageRange, 0, sizeof(results->voltageRange)); memset(results->currentRange, 0, sizeof(results->currentRange)); memset(tbattery, 0, sizeof(tbattery)); memset(frequency, 0, sizeof(frequency)); - for (int i = 1; i < BUFFER_SIZE - 2; i++) { + for (i = 1; i < BUFFER_SIZE - 2; i++) { if (i <= 7) { snprintfcat(results->voltageRange, 14, "%c", rawvalues[i]); } else if (i <= 10) { @@ -79,10 +80,12 @@ void sms_parse_features(uint8_t *rawvalues, SmsData *results) { void sms_parse_information(uint8_t *rawvalues, SmsData *results) { /* Count from 1 to ignore first char and remove 2 from BUFFER_SIZE * to compensate the start and ignore '\r' from end. */ + int i; + memset(results->model, 0, sizeof(results->model)); memset(results->version, 0, sizeof(results->version)); - for (int i = 1; i < BUFFER_SIZE - 2; i++) { + for (i = 1; i < BUFFER_SIZE - 2; i++) { if (i <= 12) { snprintfcat(results->model, 24, "%c", rawvalues[i]); } else { diff --git a/drivers/snmp-ups-helpers.c b/drivers/snmp-ups-helpers.c index b4116ff6f8..7d46d23366 100644 --- a/drivers/snmp-ups-helpers.c +++ b/drivers/snmp-ups-helpers.c @@ -72,8 +72,8 @@ const char *su_usdate_to_isodate_info_fun(void *raw_date) info_lkp_t su_convert_to_iso_date_info[] = { /* array index = FUNMAP_USDATE_TO_ISODATE: */ - { 1, "dummy", su_usdate_to_isodate_info_fun, NULL }, - { 0, NULL, NULL, NULL } + info_lkp_fun_vp2s(1, "dummy", su_usdate_to_isodate_info_fun), + info_lkp_sentinel }; /* Process temperature value according to 'temperature_unit' */ diff --git a/drivers/snmp-ups.c b/drivers/snmp-ups.c index 65a19397dc..9e7e04ca3a 100644 --- a/drivers/snmp-ups.c +++ b/drivers/snmp-ups.c @@ -2174,7 +2174,7 @@ const char *su_find_strval(info_lkp_t *oid2info, void *value) #else NUT_UNUSED_VARIABLE(oid2info); upsdebugx(1, "%s: no mapping function for this OID string value (%s)", __func__, (char*)value); -#endif // WITH_SNMP_LKP_FUN +#endif /* WITH_SNMP_LKP_FUN */ return NULL; } @@ -2194,7 +2194,7 @@ const char *su_find_infoval(info_lkp_t *oid2info, void *raw_value) upsdebugx(2, "%s: got value '%s'", __func__, retvalue); return retvalue; } -#endif // WITH_SNMP_LKP_FUN +#endif /* WITH_SNMP_LKP_FUN */ /* Otherwise, use the simple values mapping */ for (info_lkp = oid2info; (info_lkp != NULL) && @@ -4176,6 +4176,7 @@ void read_mibconf(char *mib) { char fn[SMALLBUF]; PCONF_CTX_t ctx; + int numerrors = 0; upsdebugx(2, "SNMP UPS driver: entering %s(%s)", __func__, mib); @@ -4190,6 +4191,7 @@ void read_mibconf(char *mib) if (pconf_parse_error(&ctx)) { upslogx(LOG_ERR, "Parse error: %s:%d: %s", fn, ctx.linenum, ctx.errmsg); + numerrors++; continue; } @@ -4207,8 +4209,17 @@ void read_mibconf(char *mib) snprintfcat(errmsg, sizeof(errmsg), " %s", ctx.arglist[i]); + numerrors++; upslogx(LOG_WARNING, "%s", errmsg); } } + + /* FIXME: Per legacy behavior, we silently went on. + * Maybe should abort on unusable configs? + */ + if (numerrors) { + upslogx(LOG_ERR, "Encountered %d MIB config errors, those entries were ignored", numerrors); + } + pconf_finish(&ctx); } diff --git a/drivers/snmp-ups.h b/drivers/snmp-ups.h index b2ccd52a43..83a3a25b98 100644 --- a/drivers/snmp-ups.h +++ b/drivers/snmp-ups.h @@ -9,6 +9,7 @@ * 2002-2006 Dmitry Frolov * J.W. Hoogervorst * Niels Baggesen + * 2020-2024 Jim Klimov * * Sponsored by Eaton * and originally by MGE UPS SYSTEMS @@ -126,6 +127,7 @@ typedef int bool_t; /* typedef void (*interpreter)(char *, char *, int); */ +/* Help align with DMF branch codebase until it is merged */ #ifndef WITH_SNMP_LKP_FUN /* Recent addition of fun/nuf hooks in info_lkp_t is not well handled by * all corners of the codebase, e.g. not by DMF. So at least until that @@ -139,6 +141,8 @@ typedef int bool_t; # else # define WITH_SNMP_LKP_FUN 1 # endif +#else +# define WITH_SNMP_LKP_FUN 0 #endif #ifndef WITH_SNMP_LKP_FUN_DUMMY @@ -168,6 +172,32 @@ typedef struct { #endif /* WITH_SNMP_LKP_FUN */ } info_lkp_t; +/* Help align with DMF branch codebase until it is merged */ +#if WITH_SNMP_LKP_FUN +# if (defined WITH_DMFMIB) && (WITH_DMFMIB != 0) +# define info_lkp_default(_1, _2) {_1, _2, NULL, NULL, NULL, NULL} +# define info_lkp_fun_vp2s(_1, _2, _3) {_1, _2, _3, NULL, NULL, NULL} +# define info_lkp_nuf_s2l(_1, _2, _3) {_1, _2, NULL, _3, NULL, NULL} +# define info_lkp_fun_s2l(_1, _2, _3) {_1, _2, NULL, NULL, _3, NULL} +# define info_lkp_nuf_vp2s(_1, _2, _3) {_1, _2, NULL, NULL, NULL, _3} +# else +# define info_lkp_default(_1, _2) {_1, _2, NULL, NULL} +# define info_lkp_fun_vp2s(_1, _2, _3) {_1, _2, _3, NULL} +# define info_lkp_nuf_s2l(_1, _2, _3) {_1, _2, NULL, _3} +/* Without DMF extensions, these methods poorly made do before the role split */ +# define info_lkp_fun_s2l(_1, _2, _3) {_1, _2, NULL, _3} +# define info_lkp_nuf_vp2s(_1, _2, _3) {_1, _2, _3, NULL} +# endif /* WITH_DMFMIB */ +#else +# define info_lkp_default(_1, _2) {_1, _2} +/* Ignore the function pointer where not supported */ +# define info_lkp_fun_vp2s(_1, _2, _3) {_1, _2} +# define info_lkp_nuf_s2l(_1, _2, _3) {_1, _2} +# define info_lkp_fun_s2l(_1, _2, _3) {_1, _2} +# define info_lkp_nuf_vp2s(_1, _2, _3) {_1, _2} +#endif /* WITH_SNMP_LKP_FUN */ +#define info_lkp_sentinel info_lkp_default(0, NULL) + /* Structure containing info about one item that can be requested from UPS and set in INFO. If no interpreter functions is defined, use sprintf with given format string. If unit is not NONE, values @@ -200,6 +230,18 @@ typedef struct { info_lkp_t *oid2info; /* lookup table between OID and NUT values */ } snmp_info_t; +/* Help align with DMF branch codebase until it is merged */ +#if defined WITH_DMF_FUNCTIONS && WITH_DMF_FUNCTIONS +# if defined WITH_DMF_LUA && WITH_DMF_LUA +# define snmp_info_default(_1, _2, _3, _4, _5, _6, _7) {_1, _2, _3, _4, _5, _6, _7, NULL, NULL, NULL} +# else +# define snmp_info_default(_1, _2, _3, _4, _5, _6, _7) {_1, _2, _3, _4, _5, _6, _7, NULL, NULL} +# endif /* WITH_DMF_LUA */ +#else +# define snmp_info_default(_1, _2, _3, _4, _5, _6, _7) {_1, _2, _3, _4, _5, _6, _7} +#endif /* WITH_DMF_FUNCTIONS */ +#define snmp_info_sentinel snmp_info_default(NULL, 0, 0, NULL, NULL, 0, NULL) + /* "flags" bits 0..9 */ #define SU_FLAG_OK (1UL << 0) /* show element to upsd - * internal to snmp driver */ @@ -275,8 +317,8 @@ typedef struct { #define SU_AMBIENT_TEMPLATE (1UL << 26) /* ambient template definition */ /* Reserved slot -- to import from DMF branch codebase: -//#define SU_FLAG_FUNCTION (1UL << 27) -*/ + * //#define SU_FLAG_FUNCTION (1UL << 27) + */ /* status string components * FIXME: these should be removed, since there is no added value. diff --git a/drivers/tripplite_usb.c b/drivers/tripplite_usb.c index f4e2a1560b..5dbc22f0c0 100644 --- a/drivers/tripplite_usb.c +++ b/drivers/tripplite_usb.c @@ -330,7 +330,7 @@ int match_by_unitid(usb_dev_handle *argudev, USBDevice_t *arghd, usb_ctrl_charbu int match_by_unitid(usb_dev_handle *argudev, USBDevice_t *arghd, usb_ctrl_charbuf rdbuf, usb_ctrl_charbufsize rdlen) { char *value = getval("upsid"); - int config_unit_id = 0; + long config_unit_id = 0; ssize_t ret; unsigned char u_msg[] = "U"; unsigned char u_value[9]; @@ -340,10 +340,13 @@ int match_by_unitid(usb_dev_handle *argudev, USBDevice_t *arghd, usb_ctrl_charbu NUT_UNUSED_VARIABLE(rdbuf); NUT_UNUSED_VARIABLE(rdlen); - /* Read ups id from the ups.conf */ - if (value != NULL) { - config_unit_id = atoi(value); - } + /* If upsid is not defined in the config, return 1 (null behavior - match any device), + * otherwise read it from the device and match against what was asked in ups.conf */ + if (value == NULL) { + return 1; + } else { + config_unit_id = atol(value); + } /* Read ups id from the device */ if (tl_model != TRIPP_LITE_OMNIVS && tl_model != TRIPP_LITE_SMART_0004) { @@ -352,14 +355,22 @@ int match_by_unitid(usb_dev_handle *argudev, USBDevice_t *arghd, usb_ctrl_charbu if (ret <= 0) { upslogx(LOG_INFO, "Unit ID not retrieved (not available on all models)"); } else { - unit_id = (int)((unsigned)(u_value[1]) << 8) | (unsigned)(u_value[2]); + /* Translating from two bytes (unsigned chars), so via uint16_t */ + unit_id = (uint16_t)((uint16_t)(u_value[1]) << 8) | (uint16_t)(u_value[2]); + upsdebugx(1, "Retrieved Unit ID: %ld", unit_id); } } - /* Check if the ups ids match */ + /* Check if the ups ids match */ if (config_unit_id == unit_id) { + upsdebugx(1, "Retrieved Unit ID (%ld) matches the configured one (%ld)", + unit_id, config_unit_id); return 1; } else { + upsdebugx(1, "Retrieved Unit ID (%ld) does not match the configured one (%ld). " + "Do you have several compatible UPSes? Otherwise, please check if the ID " + "was set in the previous life of your device (can use upsrw to set another" + "value).", unit_id, config_unit_id); return 0; } } @@ -1601,9 +1612,9 @@ void upsdrv_makevartable(void) MAX_VOLT); addvar(VAR_VALUE, "battery_max", msg); - // allow -x upsid=X + /* allow -x upsid=X */ snprintf(msg, sizeof msg, "UPS ID (Unit ID) (default=%d)", DEFAULT_UPSID); - addvar(VAR_VALUE, "upsid", msg); + addvar(VAR_VALUE, "upsid", msg); #if 0 snprintf(msg, sizeof msg, "Set start delay, in seconds (default=%d).", diff --git a/drivers/tripplitesu.c b/drivers/tripplitesu.c index 1d8461903a..82d98eee88 100644 --- a/drivers/tripplitesu.c +++ b/drivers/tripplitesu.c @@ -424,7 +424,7 @@ static int get_sensitivity(void) { if (do_command(POLL, VOLTAGE_SENSITIVITY, "", response) <= 0) return 0; - for (i = 0; i < sizeof(sensitivity) / sizeof(sensitivity[0]); i++) { + for (i = 0; i < SIZEOF_ARRAY(sensitivity); i++) { if (sensitivity[i].code == atoi(response)) { dstate_setinfo("input.sensitivity", "%s", sensitivity[i].name); @@ -439,7 +439,7 @@ static void set_sensitivity(const char *val) { char parm[20]; unsigned int i; - for (i = 0; i < sizeof(sensitivity) / sizeof(sensitivity[0]); i++) { + for (i = 0; i < SIZEOF_ARRAY(sensitivity); i++) { if (!strcasecmp(val, sensitivity[i].name)) { snprintf(parm, sizeof(parm), "%u", i); do_command(SET, VOLTAGE_SENSITIVITY, parm, NULL); @@ -660,8 +660,7 @@ void upsdrv_initinfo(void) } if (get_sensitivity()) { dstate_setflags("input.sensitivity", ST_FLAG_RW); - for (i = 0; i < sizeof(sensitivity) / sizeof(sensitivity[0]); - i++) + for (i = 0; i < SIZEOF_ARRAY(sensitivity); i++) dstate_addenum("input.sensitivity", "%s", sensitivity[i].name); } @@ -811,8 +810,7 @@ void upsdrv_updateinfo(void) size_t trsize; r = atoi(response); - trsize = sizeof(test_result_names) / - sizeof(test_result_names[0]); + trsize = SIZEOF_ARRAY(test_result_names); if ((r < 0) || (r >= (int) trsize)) r = 0; diff --git a/drivers/upsdrvctl.c b/drivers/upsdrvctl.c index ae42de32b2..1c8b6fd52c 100644 --- a/drivers/upsdrvctl.c +++ b/drivers/upsdrvctl.c @@ -44,6 +44,7 @@ typedef struct { char *port; int sdorder; int maxstartdelay; + int exceeded_timeout; #ifndef WIN32 pid_t pid; #else @@ -55,7 +56,7 @@ typedef struct { static ups_t *upstable = NULL; static int upscount = 0; -static int maxsdorder = 0, testmode = 0, exec_error = 0; +static int maxsdorder = 0, testmode = 0, exec_error = 0, exec_timeout = 0; /* Should we wait for driver (1) or "parallelize" drivers start (0) */ static int waitfordrivers = 1; @@ -164,6 +165,7 @@ void do_upsconf_args(char *arg_upsname, char *var, char *val) tmp->next = NULL; tmp->sdorder = 0; tmp->maxstartdelay = -1; /* use global value by default */ + tmp->exceeded_timeout = 0; if (!strcmp(var, "driver")) tmp->driver = xstrdup(val); @@ -441,8 +443,9 @@ static void stop_driver(const ups_t *ups) #endif if (ret != 0) { upsdebugx(2, "Sending signal to %s failed, driver is finally down or wrongly owned", pidfn); - // While a TERMinated driver cleans up, - // a stuck and KILLed one does not, so: + /* While a TERMinated driver cleans up, + * a stuck and KILLed one does not, so: + */ if (ups->pid == -1) { unlink(pidfn); } @@ -604,7 +607,7 @@ static void forkexec(char *const argv[], const ups_t *ups) upsdebugx(1, "Starting the only driver with explicitly " "requested foregrounding mode, not forking"); } else { - pid_t pid; + pid_t pid, waitret; pid = fork(); @@ -617,7 +620,9 @@ static void forkexec(char *const argv[], const ups_t *ups) /* work around const for this one... */ int *pupid = (int *)&(ups->pid); + int *puexectimeout = (int *)&(ups->exceeded_timeout); *pupid = pid; + *puexectimeout = 0; /* Handle "parallel" drivers startup */ if (waitfordrivers == 0) { @@ -661,13 +666,14 @@ static void forkexec(char *const argv[], const ups_t *ups) alarm((unsigned int)maxstartdelay); } - ret = waitpid(pid, &wstat, 0); + waitret = waitpid(pid, &wstat, 0); alarm(0); - if (ret == -1) { + if (waitret == -1) { upslogx(LOG_WARNING, "Startup timer elapsed, continuing..."); - exec_error++; + exec_timeout++; + *puexectimeout = 1; return; } @@ -677,6 +683,8 @@ static void forkexec(char *const argv[], const ups_t *ups) return; } + /* the rest only work when WIFEXITED is nonzero */ + if (WEXITSTATUS(wstat) != 0) { upslogx(LOG_WARNING, "Driver failed to start" " (exit status=%d)", WEXITSTATUS(wstat)); @@ -684,8 +692,6 @@ static void forkexec(char *const argv[], const ups_t *ups) return; } - /* the rest only work when WIFEXITED is nonzero */ - if (WIFSIGNALED(wstat)) { upslog_with_errno(LOG_WARNING, "Driver died after signal %d", WTERMSIG(wstat)); @@ -700,7 +706,8 @@ static void forkexec(char *const argv[], const ups_t *ups) ret = execv(argv[0], argv); - /* shouldn't get here */ + /* shouldn't get here normally */ + upsdebugx(1, "%s: execv returned %d", __func__, ret); fatal_with_errno(EXIT_FAILURE, "execv"); #else BOOL ret; @@ -711,10 +718,10 @@ static void forkexec(char *const argv[], const ups_t *ups) PROCESS_INFORMATION ProcessInformation; int i = 1; - memset(&StartupInfo,0,sizeof(STARTUPINFO)); + memset(&StartupInfo, 0, sizeof(STARTUPINFO)); /* the command line is made of the driver name followed by args */ - snprintf(commandline,sizeof(commandline),"%s", ups->driver); + snprintf(commandline, sizeof(commandline), "%s", ups->driver); while (argv[i] != NULL) { snprintfcat(commandline, sizeof(commandline), " %s", argv[i]); i++; @@ -738,8 +745,8 @@ static void forkexec(char *const argv[], const ups_t *ups) } /* Wait a bit then look at driver process. - Unlike under Linux, Windows spwan drivers directly. If the driver is alive, all is OK. - An optimization can probably be implemented to prevent waiting so much time when all is OK. + * Unlike under Linux, Windows spawn drivers directly. If the driver is alive, all is OK. + * An optimization can probably be implemented to prevent waiting so much time when all is OK. */ res = WaitForSingleObject(ProcessInformation.hProcess, (ups->maxstartdelay!=-1?ups->maxstartdelay:maxstartdelay)*1000); @@ -752,7 +759,9 @@ static void forkexec(char *const argv[], const ups_t *ups) } else { /* work around const for this one... */ int *pupid = (int *)&(ups->pid); - *pupid = 0; /* Here, just a flag (not "-1" has a meaning) */ + int *puexectimeout = (int *)&(ups->exceeded_timeout); + *pupid = 0; /* For WIN32, just a flag (not "-1" has a meaning) */ + *puexectimeout = 1; } return; @@ -764,7 +773,7 @@ static void start_driver(const ups_t *ups) char *argv[10]; char dfn[SMALLBUF], dbg[SMALLBUF]; int ret, arg = 0; - int initial_exec_error = exec_error, drv_maxretry = maxretry; + int initial_exec_error = exec_error, initial_exec_timeout = exec_timeout, drv_maxretry = maxretry; struct stat fs; upsdebugx(1, "Starting UPS: %s", ups->upsname); @@ -881,6 +890,7 @@ static void start_driver(const ups_t *ups) while (drv_maxretry > 0) { int cur_exec_error = exec_error; + int cur_exec_timeout = exec_timeout; upsdebugx(2, "%i remaining attempts", drv_maxretry); debugcmdline(2, "exec: ", argv); @@ -891,9 +901,10 @@ static void start_driver(const ups_t *ups) } /* driver command succeeded */ - if (cur_exec_error == exec_error) { + if (cur_exec_error == exec_error && cur_exec_timeout == exec_timeout) { drv_maxretry = 0; exec_error = initial_exec_error; + exec_timeout = initial_exec_timeout; } else { /* otherwise, retry if still needed */ @@ -1010,6 +1021,7 @@ static void send_one_driver(void (*command_func)(const ups_t *), const char *arg fatalx(EXIT_FAILURE, "Error: no UPS definitions found in ups.conf!\n"); exec_error = 0; + exec_timeout = 0; while (ups) { if (!strcmp(ups->upsname, arg_upsname)) { command_func(ups); @@ -1032,6 +1044,7 @@ static void send_all_drivers(void (*command_func)(const ups_t *)) fatalx(EXIT_FAILURE, "Error: no UPS definitions found in ups.conf"); exec_error = 0; + exec_timeout = 0; if (command_func != &shutdown_driver) { ups = upstable; @@ -1113,6 +1126,8 @@ static void exit_cleanup(void) } free(driverpath); + + upsdebugx(1, "Completed the job of upsdrvctl tool, clean-up finished, exiting now"); } int main(int argc, char **argv) @@ -1306,8 +1321,97 @@ int main(int argc, char **argv) "(common options should be before a command and UPS name)"); } - if (exec_error) + /* Note that the numeric value here is not precise (it reflects + * the number of "timeouts" which grows with amount of drivers + * and retries. Below we re-check each driver to convert the + * value into some amount of known failures (or succeses). */ + if (exec_timeout) { +#ifndef WIN32 + ups_t *tmp = upstable; +#endif + upsdebugx(1, "upsdrvctl: got some timeouts with preceding operations, revising them now"); +#ifndef WIN32 + while (tmp) { + if (tmp->exceeded_timeout && tmp->pid) { + /* reap zombie if this child died, and + * get info if we know how it went (or + * still goes) */ + int wstat; + pid_t waitret = waitpid(tmp->pid, &wstat, WNOHANG); + + upsdebugx(1, + "Driver [%s] PID %" PRIdMAX " initially exceeded " + "maxstartdelay but now waitpid() returns %" PRIdMAX + " and status bits 0x%.*X", + tmp->upsname, (intmax_t)tmp->pid, + (intmax_t)waitret, (int)(2*sizeof(wstat)), wstat); + + if (waitret == tmp->pid) { + upsdebugx(1, + "Driver [%s] PID %" PRIdMAX " initially exceeded " + "maxstartdelay but has finished by now", + tmp->upsname, (intmax_t)tmp->pid); + tmp->exceeded_timeout = 0; + } else + if (waitret == 0) { + /* Special behavior for WNOHANG */ + upslogx(LOG_WARNING, + "Driver [%s] PID %" PRIdMAX " initially exceeded " + "maxstartdelay and is still starting", + tmp->upsname, (intmax_t)tmp->pid); + /* TOTHINK: Should this "timeout" cause an error + * exit code, if this is the only problem? + * Maybe as a special case - if this is the only + * driver (dedicated starter) vs. start-all? + * if (argc != (lastarg + 1)) ... + * or if (upscount == 1) ... + */ + exec_error++; + } else + if (waitret == -1) { + upslog_with_errno(LOG_WARNING, + "Driver [%s] PID %" PRIdMAX " initially exceeded " + "maxstartdelay and we got an error asking it again", + tmp->upsname, (intmax_t)tmp->pid); + exec_error++; + } else + if (WIFEXITED(wstat) == 0) { + upslogx(LOG_WARNING, + "Driver [%s] PID %" PRIdMAX " initially exceeded " + "maxstartdelay and has exited abnormally by now", + tmp->upsname, (intmax_t)tmp->pid); + exec_error++; + } else + /* the rest only work when WIFEXITED is nonzero */ + if (WEXITSTATUS(wstat) != 0) { + upslogx(LOG_WARNING, + "Driver [%s] PID %" PRIdMAX " initially exceeded " + "maxstartdelay and has failed to start by now " + "(exit status=%d)", + tmp->upsname, (intmax_t)tmp->pid, WEXITSTATUS(wstat)); + exec_error++; + } else + if (WIFSIGNALED(wstat)) { + upslog_with_errno(LOG_WARNING, + "Driver [%s] PID %" PRIdMAX " initially exceeded " + "maxstartdelay and has died after signal %d by now", + tmp->upsname, (intmax_t)tmp->pid, WTERMSIG(wstat)); + exec_error++; + } + } + + tmp = tmp->next; + } +#else /* WIN32 */ + /* TOTHINK: Is there something we can do on the platform? */ + exec_error++; +#endif /* WIN32 */ + } + + if (exec_error) { + upsdebugx(1, "upsdrvctl: got some errors with preceding operations, exiting with failure now"); exit(EXIT_FAILURE); + } if (command == &start_driver && upscount > 0 @@ -1316,7 +1420,7 @@ int main(int argc, char **argv) /* Note: for a single started driver, we just * exec() it and should not even get here */ - upsdebugx(1, "upsdrvctl was asked for explicit foregrounding - " + upsdebugx(1, "upsdrvctl: was asked for explicit foregrounding - " "not exiting now (driver startup was completed)"); /* raise exit_flag upon SIGTERM, Ctrl+C, etc. */ @@ -1404,5 +1508,6 @@ int main(int argc, char **argv) } } + upsdebugx(1, "upsdrvctl: successfully finished"); exit(EXIT_SUCCESS); } diff --git a/drivers/upsdrvquery.c b/drivers/upsdrvquery.c index 05f54564ce..0936631ab5 100644 --- a/drivers/upsdrvquery.c +++ b/drivers/upsdrvquery.c @@ -89,14 +89,14 @@ udq_pipe_conn_t *upsdrvquery_connect(const char *sockfn) { } conn->sockfd = CreateFile( - sockfn, // pipe name - GENERIC_READ | // read and write access + sockfn, /* pipe name */ + GENERIC_READ | /* read and write access */ GENERIC_WRITE, - 0, // no sharing - NULL, // default security attributes FIXME - OPEN_EXISTING, // opens existing pipe - FILE_FLAG_OVERLAPPED, // enable async IO - NULL); // no template file + 0, /* no sharing */ + NULL, /* default security attributes FIXME */ + OPEN_EXISTING, /* opens existing pipe */ + FILE_FLAG_OVERLAPPED, /* enable async IO */ + NULL); /* no template file */ if (conn->sockfd == INVALID_HANDLE_VALUE) { upslog_with_errno(LOG_ERR, "CreateFile : %d\n", GetLastError()); @@ -417,7 +417,7 @@ ssize_t upsdrvquery_prepare(udq_pipe_conn_t *conn, struct timeval tv) { tv.tv_usec -= (suseconds_t)(difftimeval(now, start)); while (tv.tv_usec < 0) { tv.tv_sec--; - tv.tv_usec = 1000000 + tv.tv_usec; // Note it is negative + 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__); diff --git a/drivers/usb-common.h b/drivers/usb-common.h index d1de6d23d5..4f151ee8ac 100644 --- a/drivers/usb-common.h +++ b/drivers/usb-common.h @@ -122,6 +122,10 @@ #define USB_CTRL_MSGVALUE_MIN 0 #define USB_CTRL_MSGVALUE_MAX UINT16_MAX + typedef uint8_t usb_ctrl_cfgindex; + #define USB_CTRL_CFGINDEX_MIN 0 + #define USB_CTRL_CFGINDEX_MAX UINT8_MAX + typedef uint16_t usb_ctrl_repindex; #define USB_CTRL_REPINDEX_MIN 0 #define USB_CTRL_REPINDEX_MAX UINT16_MAX @@ -411,6 +415,10 @@ #define USB_CTRL_MSGVALUE_MIN INT_MIN #define USB_CTRL_MSGVALUE_MAX INT_MAX + typedef uint8_t usb_ctrl_cfgindex; + #define USB_CTRL_CFGINDEX_MIN 0 + #define USB_CTRL_CFGINDEX_MAX UINT8_MAX + typedef int usb_ctrl_repindex; #define USB_CTRL_REPINDEX_MIN INT_MIN #define USB_CTRL_REPINDEX_MAX INT_MAX diff --git a/drivers/usbhid-ups.c b/drivers/usbhid-ups.c index 585b618982..4775d38fe8 100644 --- a/drivers/usbhid-ups.c +++ b/drivers/usbhid-ups.c @@ -145,8 +145,10 @@ hid_dev_handle_t udev = HID_DEV_HANDLE_CLOSED; * CyberPower UT series sometime need a bit of help deciding their online status. * This quirk is to enable the special handling of OL & DISCHRG at the same time * as being OB (on battery power/no mains power). Enabled by device config flag. + * NOTE: Also known by legacy alias "onlinedischarge", deprecated but tolerated + * since NUT v2.8.2. */ -static int onlinedischarge = 0; +static int onlinedischarge_onbattery = 0; /** * Some UPS models (e.g. APC were seen to do so) report OL & DISCHRG when they @@ -155,6 +157,44 @@ static int onlinedischarge = 0; */ static int onlinedischarge_calibration = 0; +/** + * If/when an UPS reports OL & DISCHRG and we do not use any other special + * settings (e.g. they do not match the actual device capabilities/behaviors), + * the driver logs messages about the unexpected situation - on every cycle + * if must be. This setting allows to throttle frequency of such messages. + * A value of 0 is small enough to log on every processing cycle (old noisy + * de-facto default before NUT v2.8.2 which this throttle alleviates). + * A value of -1 (any negative passed via configuration) disables repeated + * messages completely. + * Default (-2) below is not final: if this throttle variable is *not* set + * in the driver configuration section, and... + * - If the device reports a battery.charge, the driver would default to + * only repeat reports about OL & DISCHRG when this charge changes from + * what it was when the previous report was made, independent of time; + * - Otherwise 30 sec. + * If both the throttle is set and battery.charge is reported (and changes + * over time), then hitting either trigger allows the message to be logged. + */ +static int onlinedischarge_log_throttle_sec = -2; +/** + * When did we last emit the message? + */ +static time_t onlinedischarge_log_throttle_timestamp = 0; +/** + * Last known battery charge (rounded to whole percent units) + * as of when we last actually logged about OL & DISCHRG. + * Gets reset to -1 whenever this condition is not present. + */ +static int onlinedischarge_log_throttle_charge = -1; +/** + * If battery.charge is served and equals or exceeds this value, + * suppress logging about OL & DISCHRG if battery.charge varied + * since last logged message. Defaults to 100% as some devices + * only report this state combo when fully charged (probably + * they try to prolong battery life by not over-charging it). + */ +static int onlinedischarge_log_throttle_hovercharge = 100; + /* support functions */ static hid_info_t *find_nut_info(const char *varname); static hid_info_t *find_hid_info(const HIDData_t *hiddata); @@ -944,11 +984,20 @@ void upsdrv_makevartable(void) addvar(VAR_FLAG, "pollonly", "Don't use interrupt pipe, only use polling"); addvar(VAR_FLAG, "onlinedischarge", - "Set to treat discharging while online as being offline"); + "Set to treat discharging while online as being offline/on-battery (DEPRECATED, use onlinedischarge_onbattery)"); + + addvar(VAR_FLAG, "onlinedischarge_onbattery", + "Set to treat discharging while online as being offline/on-battery"); addvar(VAR_FLAG, "onlinedischarge_calibration", "Set to treat discharging while online as doing calibration"); + addvar(VAR_VALUE, "onlinedischarge_log_throttle_sec", + "Set to throttle log messages about discharging while online (only so often)"); + + addvar(VAR_VALUE, "onlinedischarge_log_throttle_hovercharge", + "Set to throttle log messages about discharging while online (only if battery.charge is under this value)"); + addvar(VAR_FLAG, "disable_fix_report_desc", "Set to disable fix-ups for broken USB encoding, etc. which we apply by default on certain vendors/products"); @@ -1254,15 +1303,35 @@ void upsdrv_initups(void) interrupt_only = 1; } - /* Activate Cyberpower tweaks */ - if (testvar("onlinedischarge")) { - onlinedischarge = 1; + /* Activate Cyberpower/APC tweaks */ + if (testvar("onlinedischarge") || testvar("onlinedischarge_onbattery")) { + onlinedischarge_onbattery = 1; } if (testvar("onlinedischarge_calibration")) { onlinedischarge_calibration = 1; } + val = getval("onlinedischarge_log_throttle_sec"); + if (val) { + int ipv = atoi(val); + if (ipv == 0 && strcmp("0", val)) { + onlinedischarge_log_throttle_sec = 30; + upslogx(LOG_WARNING, + "Warning: invalid value for " + "onlinedischarge_log_throttle_sec: %s, " + "defaulting to %d", + val, onlinedischarge_log_throttle_sec); + } else { + if (ipv < 0) { + /* Has a specific meaning: user said be quiet */ + onlinedischarge_log_throttle_sec = -1; + } else { + onlinedischarge_log_throttle_sec = ipv; + } + } + } + if (testvar("disable_fix_report_desc")) { disable_fix_report_desc = 1; } @@ -1880,32 +1949,145 @@ static void ups_status_set(void) status_set("CAL"); /* calibration */ } + if ((!(ups_status & STATUS(DISCHRG))) && ( + onlinedischarge_log_throttle_timestamp != 0 + || onlinedischarge_log_throttle_charge != -1 + )) { + upsdebugx(1, + "%s: seems that UPS [%s] was in OL+DISCHRG state, " + "but no longer is now.", + __func__, upsname); + onlinedischarge_log_throttle_timestamp = 0; + onlinedischarge_log_throttle_charge = -1; + } + if (!(ups_status & STATUS(ONLINE))) { status_set("OB"); /* on battery */ } else if ((ups_status & STATUS(DISCHRG))) { + int do_logmsg = 0, current_charge = 0; + /* if online but discharging */ if (onlinedischarge_calibration) { /* if we treat OL+DISCHRG as calibrating */ status_set("CAL"); /* calibration */ } - if (onlinedischarge) { + if (onlinedischarge_onbattery) { /* if we treat OL+DISCHRG as being offline */ status_set("OB"); /* on battery */ } - if (!onlinedischarge && !onlinedischarge_calibration) { + if (!onlinedischarge_onbattery && !onlinedischarge_calibration) { + /* Some situation not managed by end-user's hints */ if (!(ups_status & STATUS(CALIB))) { - /* if in OL+DISCHRG unknowingly, warn user */ - upslogx(LOG_WARNING, "%s: seems that UPS [%s] is in OL+DISCHRG state now. " - "Is it calibrating (perhaps you want to set 'onlinedischarge_calibration' option)? " - "Note that some UPS models (e.g. CyberPower UT series) emit OL+DISCHRG when " - "in fact offline/on-battery (perhaps you want to set 'onlinedischarge' option).", - __func__, upsname); + /* if in OL+DISCHRG unknowingly, warn user, + * unless we throttle it this time - see below */ + do_logmsg = 1; } - /* if we're calibrating */ + /* if we're presumably calibrating */ status_set("OL"); /* on line */ } + + if (do_logmsg) { + /* Any throttling to apply? */ + const char *s; + + /* First disable, then enable if OK for noise*/ + do_logmsg = 0; + + /* Time or not, did the charge change since last log? */ + if ((s = dstate_getinfo("battery.charge"))) { + /* NOTE: "0" may mean a conversion error: */ + current_charge = atoi(s); + if (current_charge > 0 + && current_charge != onlinedischarge_log_throttle_charge + ) { + /* Charge has changed, but is it + * now low enough to worry? */ + if (onlinedischarge_log_throttle_hovercharge + < onlinedischarge_log_throttle_charge + ) { + upsdebugx(3, "%s: current " + "battery.charge=%d is under " + "onlinedischarge_log_throttle_charge=%d", + __func__, current_charge, + onlinedischarge_log_throttle_charge); + do_logmsg = 1; + } else { + /* All seems OK, don't spam log + * unless running at a really + * high debug verbosity */ + upsdebugx(5, "%s: current " + "battery.charge=%d " + "is okay compared to " + "onlinedischarge_log_throttle_charge=%d", + __func__, current_charge, + onlinedischarge_log_throttle_charge); + } + } + } else { + /* Should we default the time throttle? */ + if (onlinedischarge_log_throttle_sec == -2) { + onlinedischarge_log_throttle_sec = 30; + /* Report once, so almost loud */ + upsdebugx(1, "%s: seems battery.charge " + "is not served by this device " + "or subdriver; defaulting " + "onlinedischarge_log_throttle_sec " + "to %d", + __func__, + onlinedischarge_log_throttle_sec); + } + } + + /* Do we track and honor time since last log? */ + if (onlinedischarge_log_throttle_timestamp > 0 + && onlinedischarge_log_throttle_sec >= 0 + ) { + time_t now; + time(&now); + + if ((now - onlinedischarge_log_throttle_timestamp) + >= onlinedischarge_log_throttle_sec + ) { + /* Enough time elapsed */ + do_logmsg = 1; + } + } + } + + if (do_logmsg) { + char msg_charge[LARGEBUF]; + msg_charge[0] = '\0'; + + /* Remember when we last logged this message */ + time(&onlinedischarge_log_throttle_timestamp); + + if (current_charge > 0 + && current_charge != onlinedischarge_log_throttle_charge + ) { + /* Charge has changed, report and remember this */ + if (onlinedischarge_log_throttle_charge < 0) { + /* First sequential message like this */ + snprintf(msg_charge, sizeof(msg_charge), + "Battery charge is currently %d. ", + current_charge); + } else { + snprintf(msg_charge, sizeof(msg_charge), + "Battery charge changed from %d to %d " + "since last such report. ", + onlinedischarge_log_throttle_charge, + current_charge); + } + onlinedischarge_log_throttle_charge = current_charge; + } + + upslogx(LOG_WARNING, "%s: seems that UPS [%s] is in OL+DISCHRG state now. %s" + "Is it calibrating (perhaps you want to set 'onlinedischarge_calibration' option)? " + "Note that some UPS models (e.g. CyberPower UT series) emit OL+DISCHRG when " + "in fact offline/on-battery (perhaps you want to set 'onlinedischarge_onbattery' option).", + __func__, upsname, msg_charge); + } } else if ((ups_status & STATUS(ONLINE))) { /* if simply online */ status_set("OL"); diff --git a/drivers/xppc-mib.c b/drivers/xppc-mib.c index cfbc450b89..95dbdc3b43 100644 --- a/drivers/xppc-mib.c +++ b/drivers/xppc-mib.c @@ -24,25 +24,25 @@ #include "xppc-mib.h" -#define XPPC_MIB_VERSION "0.4" +#define XPPC_MIB_VERSION "0.40" #define XPPC_SYSOID ".1.3.6.1.4.1.935" /* To create a value lookup structure (as needed on the 2nd line of the example * below), use the following kind of declaration, outside of the present snmp_info_t[]: * static info_lkp_t xpcc_onbatt_info[] = { - * { 1, "OB", NULL, NULL }, - * { 2, "OL", NULL, NULL }, - * { 0, NULL, NULL, NULL } + * info_lkp_default(1, "OB"), + * info_lkp_default(2, "OL"), + * info_lkp_sentinel * }; */ /* upsBaseBatteryStatus */ static info_lkp_t xpcc_onbatt_info[] = { - { 1, "", NULL, NULL }, /* unknown */ - { 2, "", NULL, NULL }, /* batteryNormal */ - { 3, "LB", NULL, NULL }, /* batteryLow */ - { 0, NULL, NULL, NULL } + info_lkp_default(1, ""), /* unknown */ + info_lkp_default(2, ""), /* batteryNormal */ + info_lkp_default(3, "LB"), /* batteryLow */ + info_lkp_sentinel }; /* @@ -59,23 +59,23 @@ upsBaseOutputStatus OBJECT-TYPE onBuck(9) } */ static info_lkp_t xpcc_power_info[] = { - { 1, "", NULL, NULL }, /* unknown */ - { 2, "OL", NULL, NULL }, /* onLine */ - { 3, "OB", NULL, NULL }, /* onBattery */ - { 4, "OL BOOST", NULL, NULL }, /* onBoost */ - { 5, "OFF", NULL, NULL }, /* sleeping */ - { 6, "BYPASS", NULL, NULL }, /* onBypass */ - { 7, "", NULL, NULL }, /* rebooting */ - { 8, "OFF", NULL, NULL }, /* standBy */ - { 9, "OL TRIM", NULL, NULL }, /* onBuck */ - { 0, NULL, NULL, NULL } + info_lkp_default(1, ""), /* unknown */ + info_lkp_default(2, "OL"), /* onLine */ + info_lkp_default(3, "OB"), /* onBattery */ + info_lkp_default(4, "OL BOOST"), /* onBoost */ + info_lkp_default(5, "OFF"), /* sleeping */ + info_lkp_default(6, "BYPASS"), /* onBypass */ + info_lkp_default(7, ""), /* rebooting */ + info_lkp_default(8, "OFF"), /* standBy */ + info_lkp_default(9, "OL TRIM"), /* onBuck */ + info_lkp_sentinel }; /* XPPC Snmp2NUT lookup table */ static snmp_info_t xppc_mib[] = { /* Data format: - * { info_type, info_flags, info_len, OID, dfl, flags, oid2info, setvar }, + * snmp_info_default(info_type, info_flags, info_len, OID, dfl, flags, oid2info, setvar), * * info_type: NUT INFO_ or CMD_ element name * info_flags: flags to set in addinfo @@ -87,47 +87,47 @@ static snmp_info_t xppc_mib[] = { * oid2info: lookup table between OID and NUT values * * Example: - * { "input.voltage", 0, 0.1, ".1.3.6.1.4.1.705.1.6.2.1.2.1", "", SU_INPUT_1, NULL }, - * { "ups.status", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.705.1.7.3.0", "", SU_FLAG_OK | SU_STATUS_BATT, xpcc_onbatt_info }, + * snmp_info_default("input.voltage", 0, 0.1, ".1.3.6.1.4.1.705.1.6.2.1.2.1", "", SU_INPUT_1, NULL), + * snmp_info_default("ups.status", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.705.1.7.3.0", "", SU_FLAG_OK | SU_STATUS_BATT, xpcc_onbatt_info), * * To create a value lookup structure (as needed on the 2nd line), use the * following kind of declaration, outside of the present snmp_info_t[]: * static info_lkp_t xpcc_onbatt_info[] = { - * { 1, "OB" }, - * { 2, "OL" }, - * { 0, NULL } + * info_lkp_default(1, "OB"), + * info_lkp_default(2, "OL"), + * info_lkp_sentinel * }; */ /* standard MIB items */ - { "device.description", ST_FLAG_STRING | ST_FLAG_RW, SU_INFOSIZE, ".1.3.6.1.2.1.1.1.0", NULL, SU_FLAG_OK, NULL }, - { "device.contact", ST_FLAG_STRING | ST_FLAG_RW, SU_INFOSIZE, ".1.3.6.1.2.1.1.4.0", NULL, SU_FLAG_OK, NULL }, - { "device.location", ST_FLAG_STRING | ST_FLAG_RW, SU_INFOSIZE, ".1.3.6.1.2.1.1.6.0", NULL, SU_FLAG_OK, NULL }, + snmp_info_default("device.description", ST_FLAG_STRING | ST_FLAG_RW, SU_INFOSIZE, ".1.3.6.1.2.1.1.1.0", NULL, SU_FLAG_OK, NULL), + snmp_info_default("device.contact", ST_FLAG_STRING | ST_FLAG_RW, SU_INFOSIZE, ".1.3.6.1.2.1.1.4.0", NULL, SU_FLAG_OK, NULL), + snmp_info_default("device.location", ST_FLAG_STRING | ST_FLAG_RW, SU_INFOSIZE, ".1.3.6.1.2.1.1.6.0", NULL, SU_FLAG_OK, NULL), - { "ups.mfr", ST_FLAG_STRING, SU_INFOSIZE, NULL, "Tripp Lite / Phoenixtec", - SU_FLAG_STATIC | SU_FLAG_ABSENT | SU_FLAG_OK, NULL }, + snmp_info_default("ups.mfr", ST_FLAG_STRING, SU_INFOSIZE, NULL, "Tripp Lite / Phoenixtec", + SU_FLAG_STATIC | SU_FLAG_ABSENT | SU_FLAG_OK, NULL), /* upsBaseIdentModel.0 = STRING: "Intelligent" */ - { "ups.model", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.935.1.1.1.1.1.1.0", "Generic Phoenixtec SNMP device", SU_FLAG_OK, NULL }, + snmp_info_default("ups.model", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.935.1.1.1.1.1.1.0", "Generic Phoenixtec SNMP device", SU_FLAG_OK, NULL), /* upsBaseBatteryStatus.0 = INTEGER: batteryNormal(2) */ - { "ups.status", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.935.1.1.1.2.1.1.0", "", SU_STATUS_BATT | SU_TYPE_INT | SU_FLAG_OK, xpcc_onbatt_info }, + snmp_info_default("ups.status", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.935.1.1.1.2.1.1.0", "", SU_STATUS_BATT | SU_TYPE_INT | SU_FLAG_OK, xpcc_onbatt_info), /* upsSmartBatteryCapacity.0 = INTEGER: 100 */ - { "battery.charge", 0, 1, ".1.3.6.1.4.1.935.1.1.1.2.2.1.0", NULL, SU_TYPE_INT | SU_FLAG_OK, NULL }, + snmp_info_default("battery.charge", 0, 1, ".1.3.6.1.4.1.935.1.1.1.2.2.1.0", NULL, SU_TYPE_INT | SU_FLAG_OK, NULL), /* upsSmartBatteryTemperature.0 = INTEGER: 260 */ - { "ups.temperature", 0, 0.1, ".1.3.6.1.4.1.935.1.1.1.2.2.3.0", NULL, SU_TYPE_INT | SU_FLAG_OK, NULL }, + snmp_info_default("ups.temperature", 0, 0.1, ".1.3.6.1.4.1.935.1.1.1.2.2.3.0", NULL, SU_TYPE_INT | SU_FLAG_OK, NULL), /* upsSmartInputLineVoltage.0 = INTEGER: 1998 */ - { "input.voltage", 0, 0.1, ".1.3.6.1.4.1.935.1.1.1.3.2.1.0", NULL, SU_TYPE_INT | SU_FLAG_OK, NULL }, + snmp_info_default("input.voltage", 0, 0.1, ".1.3.6.1.4.1.935.1.1.1.3.2.1.0", NULL, SU_TYPE_INT | SU_FLAG_OK, NULL), /* upsBaseOutputStatus.0 = INTEGER: onLine(2) */ - { "ups.status", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.935.1.1.1.4.1.1.0", "", SU_TYPE_INT | SU_STATUS_PWR, xpcc_power_info }, + snmp_info_default("ups.status", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.935.1.1.1.4.1.1.0", "", SU_TYPE_INT | SU_STATUS_PWR, xpcc_power_info), /* upsSmartOutputVoltage.0 = INTEGER: 2309 */ - { "output.voltage", 0, 0.1, ".1.3.6.1.4.1.935.1.1.1.4.2.1.0", NULL, SU_TYPE_INT | SU_FLAG_OK, NULL }, + snmp_info_default("output.voltage", 0, 0.1, ".1.3.6.1.4.1.935.1.1.1.4.2.1.0", NULL, SU_TYPE_INT | SU_FLAG_OK, NULL), /* upsSmartOutputFrequency.0 = INTEGER: 500 */ - { "output.frequency", 0, 0.1, ".1.3.6.1.4.1.935.1.1.1.4.2.2.0", NULL, SU_TYPE_INT | SU_FLAG_OK, NULL }, + snmp_info_default("output.frequency", 0, 0.1, ".1.3.6.1.4.1.935.1.1.1.4.2.2.0", NULL, SU_TYPE_INT | SU_FLAG_OK, NULL), /* upsSmartOutputLoad.0 = INTEGER: 7 */ - { "ups.load", 0, 1, ".1.3.6.1.4.1.935.1.1.1.4.2.3.0", NULL, SU_TYPE_INT | SU_FLAG_OK, NULL }, + snmp_info_default("ups.load", 0, 1, ".1.3.6.1.4.1.935.1.1.1.4.2.3.0", NULL, SU_TYPE_INT | SU_FLAG_OK, NULL), /* end of structure. */ - { NULL, 0, 0, NULL, NULL, 0, NULL } + snmp_info_sentinel }; mib2nut_info_t xppc = { "xppc", XPPC_MIB_VERSION, NULL, NULL, xppc_mib, XPPC_SYSOID, NULL }; diff --git a/include/Makefile.am b/include/Makefile.am index e9bcdd88f6..90c2dbc54b 100644 --- a/include/Makefile.am +++ b/include/Makefile.am @@ -1,5 +1,17 @@ +# Network UPS Tools: include + +# Export certain values for ccache which NUT ci_build.sh can customize, +# to facilitate developer iteration re-runs of "make" later. +# At least GNU and BSD make implementations are okay with this syntax. +@NUT_AM_MAKE_CAN_EXPORT@export CCACHE_NAMESPACE=@CCACHE_NAMESPACE@ +@NUT_AM_MAKE_CAN_EXPORT@export CCACHE_BASEDIR=@CCACHE_BASEDIR@ +@NUT_AM_MAKE_CAN_EXPORT@export CCACHE_DIR=@CCACHE_DIR@ +@NUT_AM_MAKE_CAN_EXPORT@export CCACHE_PATH=@CCACHE_PATH@ +@NUT_AM_MAKE_CAN_EXPORT@export PATH=@PATH_DURING_CONFIGURE@ + dist_noinst_HEADERS = attribute.h common.h extstate.h proto.h \ state.h str.h timehead.h upsconf.h nut_float.h nut_stdint.h nut_platform.h \ + nutstream.hpp nutwriter.hpp nutipc.hpp nutconf.hpp \ wincompat.h # Optionally deliverable as part of NUT public API: diff --git a/include/common.h b/include/common.h index 7f4a1a5638..407b8425aa 100644 --- a/include/common.h +++ b/include/common.h @@ -171,6 +171,8 @@ typedef struct serial_handler_s { #define INVALID_FD_SOCK(a) (!VALID_FD_SOCK(a)) #define INVALID_FD(a) (!VALID_FD(a)) +#define SIZEOF_ARRAY(a) (sizeof(a) / sizeof(a[0])) + extern const char *UPS_VERSION; /* Use in code to notify the developers and quiesce the compiler that diff --git a/include/nutconf.hpp b/include/nutconf.hpp new file mode 100644 index 0000000000..086db17e23 --- /dev/null +++ b/include/nutconf.hpp @@ -0,0 +1,1133 @@ +/* + nutconf.hpp - Nut configuration file manipulation API + + Copyright (C) + 2012 Emilien Kia + + 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 +*/ + +#ifndef NUTCONF_H_SEEN +#define NUTCONF_H_SEEN 1 + +#include "nutstream.hpp" + +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +/* See include/common.h for details behind this */ +#ifndef NUT_UNUSED_VARIABLE +#define NUT_UNUSED_VARIABLE(x) (void)(x) +#endif + +#ifdef __cplusplus + +namespace nut +{ + +class NutParser; +class NutConfigParser; +class DefaultConfigParser; +class GenericConfigParser; + + +/** + * Helper to specify if a configuration variable is set or not. + * In addition of its value. + */ +template +class Settable +{ +protected: + Type _value; + bool _set; +public: + Settable():_set(false){} + Settable(const Settable& val):_value(val._value), _set(val._set){} + Settable(const Type& val):_value(val), _set(true){} + + /* Avoid implicit copy/move operator declarations */ + Settable(Settable&&) = default; + Settable& operator=(const Settable&) = default; + Settable& operator=(Settable&&) = default; + + bool set()const{return _set;} + void clear(){_set = false;} + + operator const Type&()const{return _value;} + operator Type&(){return _value;} + + const Type& operator *()const{return _value;} + Type& operator *(){return _value;} + + Settable& operator=(const Type& val){_value = val; _set = true; return *this;} + + bool operator==(const Settable& val)const + { + if(!set() && !val.set()) + return false; + else + return (set() && val.set() && _value==val._value); + } + + bool operator==(const Type& val)const + { + if(!set()) + return false; + else + return _value == val; + } + +}; + + +/** + * \brief Serialisable interface + * + * Classes that implement this interface provide way to serialize + * and deserialize instances to/from streams. + */ +class Serialisable +{ +protected: + + /** Formal constructor */ + Serialisable() {} + +public: + + /** + * \brief Deserializer + * + * \param istream Input stream + * + * \retval true in case of success + * \retval false in case of read error + */ + virtual bool parseFrom(NutStream & istream) = 0; + + /** + * \brief Serializer + * + * \param ostream Output stream + * + * \retval true in case of success + * \retval false in case of write error + */ + virtual bool writeTo(NutStream & ostream) const = 0; + + /** Destructor */ + virtual ~Serialisable(); + +}; // end of class Serialisable + + +/** + * NUT config parser. + */ +class NutParser +{ +public: + enum ParsingOption + { + OPTION_DEFAULT = 0, + /** Colon character is considered as string character and not as specific token. + Useful for IPv6 addresses */ + OPTION_IGNORE_COLON = 1 + }; + + NutParser(const char* buffer = nullptr, unsigned int options = OPTION_DEFAULT); + NutParser(const std::string& buffer, unsigned int options = OPTION_DEFAULT); + + virtual ~NutParser(); + + /** Parsing configuration functions + * \{ */ + void setOptions(unsigned int options){_options = options;} + unsigned int getOptions()const{return _options;} + void setOptions(unsigned int options, bool set = true); + void unsetOptions(unsigned int options){setOptions(options, false);} + bool hasOptions(unsigned int options)const{return (_options&options) == options;} + /** \} */ + + struct Token + { + enum TokenType { + TOKEN_UNKNOWN = -1, + TOKEN_NONE = 0, + TOKEN_STRING = 1, + TOKEN_QUOTED_STRING, + TOKEN_COMMENT, + TOKEN_BRACKET_OPEN, + TOKEN_BRACKET_CLOSE, + TOKEN_EQUAL, + TOKEN_COLON, + TOKEN_EOL + } type; + std::string str; + + Token():type(TOKEN_NONE),str(){} + Token(TokenType type_arg, const std::string& str_arg=""):type(type_arg),str(str_arg){} + Token(TokenType type_arg, char c):type(type_arg),str(1, c){} + Token(const Token& tok):type(tok.type),str(tok.str){} + + /* Avoid implicit copy/move operator declarations */ + Token(Token&&) = default; + Token& operator=(const Token&) = default; + Token& operator=(Token&&) = default; + + bool is(TokenType type_arg)const{return this->type==type_arg;} + + bool operator==(const Token& tok)const{return tok.type==type && tok.str==str;} + + operator bool()const{return type!=TOKEN_UNKNOWN && type!=TOKEN_NONE;} + }; + + /** Parsing functions + * \{ */ + std::string parseCHARS(); + std::string parseSTRCHARS(); + Token parseToken(); + std::list parseLine(); + /** \} */ + +#ifndef UNITEST_MODE +protected: +#endif /* UNITEST_MODE */ + size_t getPos()const; + void setPos(size_t pos); + char charAt(size_t pos)const; + + void pushPos(); + size_t popPos(); + void rewind(); + + void back(); + + char get(); + char peek(); + +private: + unsigned int _options; + + std::string _buffer; + size_t _pos; + std::vector _stack; +}; + + +typedef std::list ConfigParamList; + +struct GenericConfigSectionEntry +{ + std::string name; + ConfigParamList values; + // std::string comment; + +}; + +struct GenericConfigSection +{ + /** Section entries map */ + typedef std::map EntryMap; + + std::string name; + // std::string comment; + EntryMap entries; + + const GenericConfigSectionEntry& operator [] (const std::string& varname)const{return entries.find(varname)->second;} + GenericConfigSectionEntry& operator [] (const std::string& varname){return entries[varname];} + + bool empty()const; + void clear(); +}; + +class BaseConfiguration +{ + friend class GenericConfigParser; +public: + virtual ~BaseConfiguration(); +protected: + virtual void setGenericConfigSection(const GenericConfigSection& section) = 0; +}; + +class NutConfigParser : public NutParser +{ +public: + virtual void parseConfig(); + + /* Declared for cleaner overrides; arg ignored in current class */ + virtual void parseConfig(BaseConfiguration* config); + +protected: + NutConfigParser(const char* buffer = nullptr, unsigned int options = OPTION_DEFAULT); + NutConfigParser(const std::string& buffer, unsigned int options = OPTION_DEFAULT); + + virtual void onParseBegin()=0; + virtual void onParseComment(const std::string& comment)=0; + virtual void onParseSectionName(const std::string& sectionName, const std::string& comment = "")=0; + virtual void onParseDirective(const std::string& directiveName, char sep = 0, const ConfigParamList& values = ConfigParamList(), const std::string& comment = "")=0; + virtual void onParseEnd()=0; +}; + +class DefaultConfigParser : public NutConfigParser +{ +public: + DefaultConfigParser(const char* buffer = nullptr); + DefaultConfigParser(const std::string& buffer); + +protected: + virtual void onParseSection(const GenericConfigSection& section)=0; + + virtual void onParseBegin() override; + virtual void onParseComment(const std::string& comment) override; + virtual void onParseSectionName(const std::string& sectionName, const std::string& comment = "") override; + virtual void onParseDirective(const std::string& directiveName, char sep = 0, const ConfigParamList& values = ConfigParamList(), const std::string& comment = "") override; + virtual void onParseEnd() override; + + GenericConfigSection _section; ///> Currently parsed section +}; + + +class GenericConfigParser : public DefaultConfigParser +{ +public: + GenericConfigParser(const char* buffer = nullptr); + GenericConfigParser(const std::string& buffer); + + virtual void parseConfig(BaseConfiguration* config) override; + +protected: + virtual void onParseSection(const GenericConfigSection& section) override; + + BaseConfiguration* _config; +}; + + +class GenericConfiguration : public BaseConfiguration, public Serialisable +{ +public: + /** Sections map */ + typedef std::map SectionMap; + + GenericConfiguration(){} + + virtual ~GenericConfiguration() override; + + void parseFromString(const std::string& str); + + /** Serialisable interface implementation \{ */ + bool parseFrom(NutStream & istream) override; + bool writeTo(NutStream & ostream) const override; + /** \} */ + + // FIXME Let be public or set it as protected with public accessors ? + SectionMap sections; + + const GenericConfigSection& operator[](const std::string& secname)const{return sections.find(secname)->second;} + GenericConfigSection& operator[](const std::string& secname){return sections[secname];} + + +protected: + virtual void setGenericConfigSection(const GenericConfigSection& section) override; + + /** + * \brief Configuration parameters getter + * + * \param[in] section Section name + * \param[in] entry Entry name + * \param[out] params Configuration parameters + * + * \retval true if the entry was found + * \retval false otherwise + */ + bool get(const std::string & section, const std::string & entry, ConfigParamList & params) const; + + /** + * \brief Global scope configuration parameters getter + * + * \param[in] entry Entry name + * \param[out] params Configuration parameters + * + * \retval true if the entry was found + * \retval false otherwise + */ + inline bool get(const std::string & entry, ConfigParamList & params) const + { + return get("", entry, params); + } + + /** + * \brief Configuration parameters setter + * + * The section and entry are created unless they already exist. + * + * \param[in] section Section name + * \param[in] entry Entry name + * \param[in] params Configuration parameters + */ + void set(const std::string & section, const std::string & entry, const ConfigParamList & params); + + /** + * \brief Global scope configuration parameters setter + * + * The entry is created unless it already exists. + * + * \param[in] entry Entry name + * \param[in] params Configuration parameters + */ + inline void set(const std::string & entry, const ConfigParamList & params) + { + set("", entry, params); + } + + /** + * \brief Add configuration parameters + * + * The section and entry are created unless they already exist. + * Current parameters are kept, the provided are added to the list end. + * + * \param[in] section Section name + * \param[in] entry Entry name + * \param[in] params Configuration parameters + */ + void add(const std::string & section, const std::string & entry, const ConfigParamList & params); + + /** + * \brief Add global scope configuration parameters + * + * The entry is created unless they already exists. + * Current parameters are kept, the provided are added to the list end. + * + * \param[in] entry Entry name + * \param[in] params Configuration parameters + */ + inline void add(const std::string & entry, const ConfigParamList & params) + { + add("", entry, params); + } + + /** + * \brief Configuration parameters removal + * + * Removes the entry, only. + * Does nothing if the section or the entry don't exist. + * + * \param section Section name + * \param entry Entry name + */ + void remove(const std::string & section, const std::string & entry); + + /** + * \brief Global scope configuration parameters removal + * + * Removes the entry, only. + * Does nothing if the entry don't exist. + * + * \param entry Entry name + */ + inline void remove(const std::string & entry) + { + remove("", entry); + } + + /** + * \brief Configuration section removal + * + * Removes entire section (if exists). + * + * \param section Section name + */ + void removeSection(const std::string & section); + + /** Global scope configuration removal */ + inline void removeGlobal() + { + removeSection(""); + } + + /** + * \brief Configuration string getter + * + * Empty string is returned if the section or entry doesn't exist. + * + * \param section Section name + * \param entry Entry name + * + * \return Configuration parameter as string + */ + std::string getStr( + const std::string & section, + const std::string & entry) const; + + /** + * \brief Global scope configuration string getter + * + * Empty string is returned if the entry doesn't exist. + * + * \param entry Entry name + * + * \return Configuration parameter as string + */ + inline std::string getStr(const std::string & entry) const + { + return getStr("", entry); + } + + /** + * \brief Configuration string setter + * + * \param section Section name + * \param entry Entry name + * \param value Parameter value + */ + void setStr( + const std::string & section, + const std::string & entry, + const std::string & value); + + /** + * \brief Global scope configuration string setter + * + * \param entry Entry name + * \param value Parameter value + */ + inline void setStr( + const std::string & entry, + const std::string & value) + { + setStr("", entry, value); + } + + /** + * \brief Configuration number getter + * + * \param section Section name + * \param entry Entry name + * \param val Default value + * + * \return Configuration parameter as number (or the default if not defined) + */ + long long int getInt( + const std::string & section, + const std::string & entry, + long long int val = 0) const; + + /** + * \brief Global scope configuration number getter + * + * \param entry Entry name + * \param val Default value + * + * \return Configuration parameter as number (or the default if not defined) + */ + inline long long int getInt(const std::string & entry, long long int val = 0) const + { + return getInt("", entry, val); + } + + /** + * \brief Configuration number setter + * + * \param section Section name + * \param entry Entry name + * \param val Default value + */ + void setInt( + const std::string & section, + const std::string & entry, + long long int val); + + /** + * \brief Global scope configuration number setter + * + * \param entry Entry name + * \param val Default value + */ + inline void setInt( + const std::string & entry, + long long int val) + { + setInt("", entry, val); + } + + /** + * \brief Cast numeric type with range check + * + * Throws an exception on cast error. + * + * \param number Number + * \param min Minimum + * \param max Maximum + * + * \return \c number which was cast to target type + */ + template + static T range_cast(long long int number, long long int min, long long int max) +#if (defined __cplusplus) && (__cplusplus < 201100) + throw(std::range_error) +#endif + { + if (number < min) + { + std::stringstream e; + e << "Failed to range-cast " << number << " (underflows " << min << ')'; + + throw std::range_error(e.str()); + } + + if (number > max) + { + std::stringstream e; + e << "Failed to range-cast " << number << " (overflows " << max << ')'; + + throw std::range_error(e.str()); + } + + return static_cast(number); + } + + /** + * \brief Resolve string as Boolean value + * + * \param str String + * + * \retval true IFF the string expresses a known true value + * \retval false otherwise + */ + static bool str2bool(const std::string & str); + + /** + * \brief Convert Boolean value to string + * + * \param val Boolean value + * + * \return \c val as string + */ + static const std::string & bool2str(bool val); + +}; // end of class GenericConfiguration + + + +class UpsmonConfiguration : public Serialisable +{ +public: + UpsmonConfiguration(); + void parseFromString(const std::string& str); + + Settable runAsUser, shutdownCmd, notifyCmd, powerDownFlag; + Settable minSupplies, poolFreq, poolFreqAlert, hotSync; + Settable deadTime, rbWarnTime, noCommWarnTime, finalDelay; + + enum NotifyFlag { + NOTIFY_IGNORE = 0, + NOTIFY_SYSLOG = 1, + NOTIFY_WALL = 1 << 1, + NOTIFY_EXEC = 1 << 2 + }; + + enum NotifyType { + NOTIFY_ONLINE, + NOTIFY_ONBATT, + NOTIFY_LOWBATT, + NOTIFY_FSD, + NOTIFY_COMMOK, + NOTIFY_COMMBAD, + NOTIFY_SHUTDOWN, + NOTIFY_REPLBATT, + NOTIFY_NOCOMM, + NOTIFY_NOPARENT, + NOTIFY_TYPE_MAX + }; + + static NotifyFlag NotifyFlagFromString(const std::string& str); + static NotifyType NotifyTypeFromString(const std::string& str); + + Settable notifyFlags[NOTIFY_TYPE_MAX]; + Settable notifyMessages[NOTIFY_TYPE_MAX]; + + struct Monitor { + std::string upsname, hostname; + uint16_t port; + unsigned int powerValue; + std::string username, password; + bool isMaster; + }; + + std::list monitors; + + /** Serialisable interface implementation \{ */ + bool parseFrom(NutStream & istream) override; + bool writeTo(NutStream & ostream) const override; + /** \} */ + +}; // end of class UpsmonConfiguration + + + +class UpsmonConfigParser : public NutConfigParser +{ +public: + UpsmonConfigParser(const char* buffer = nullptr); + UpsmonConfigParser(const std::string& buffer); + + void parseUpsmonConfig(UpsmonConfiguration* config); +protected: + virtual void onParseBegin() override; + virtual void onParseComment(const std::string& comment) override; + virtual void onParseSectionName(const std::string& sectionName, const std::string& comment = "") override; + virtual void onParseDirective(const std::string& directiveName, char sep = 0, const ConfigParamList& values = ConfigParamList(), const std::string& comment = "") override; + virtual void onParseEnd() override; + + UpsmonConfiguration* _config; +}; + + +class NutConfiguration: public Serialisable +{ +public: + NutConfiguration(); + void parseFromString(const std::string& str); + + enum NutMode { + MODE_UNKNOWN = -1, + MODE_NONE = 0, + MODE_STANDALONE, + MODE_NETSERVER, + MODE_NETCLIENT, + MODE_CONTROLLED, + MODE_MANUAL, + }; + + Settable mode; + + static NutMode NutModeFromString(const std::string& str); + + /** Serialisable interface implementation \{ */ + bool parseFrom(NutStream & istream) override; + bool writeTo(NutStream & ostream) const override; + /** \} */ +}; + + +class NutConfConfigParser : public NutConfigParser +{ +public: + NutConfConfigParser(const char* buffer = nullptr); + NutConfConfigParser(const std::string& buffer); + + void parseNutConfConfig(NutConfiguration* config); +protected: + virtual void onParseBegin() override; + virtual void onParseComment(const std::string& comment) override; + virtual void onParseSectionName(const std::string& sectionName, const std::string& comment = "") override; + virtual void onParseDirective(const std::string& directiveName, char sep = 0, const ConfigParamList& values = ConfigParamList(), const std::string& comment = "") override; + virtual void onParseEnd() override; + + NutConfiguration* _config; +}; + + +class UpsdConfiguration : public Serialisable +{ +public: + UpsdConfiguration(); + void parseFromString(const std::string& str); + + Settable maxAge, maxConn; + Settable statePath, certFile; + + struct Listen + { + std::string address; + Settable port; + + inline bool operator==(const Listen& listen)const + { + return address == listen.address && port == listen.port; + } + }; + std::list listens; + + /** Serialisable interface implementation \{ */ + bool parseFrom(NutStream & istream) override; + bool writeTo(NutStream & ostream) const override; + /** \} */ +}; + + + + +class UpsdConfigParser : public NutConfigParser +{ +public: + UpsdConfigParser(const char* buffer = nullptr); + UpsdConfigParser(const std::string& buffer); + + void parseUpsdConfig(UpsdConfiguration* config); +protected: + virtual void onParseBegin() override; + virtual void onParseComment(const std::string& comment) override; + virtual void onParseSectionName(const std::string& sectionName, const std::string& comment = "") override; + virtual void onParseDirective(const std::string& directiveName, char sep = 0, const ConfigParamList& values = ConfigParamList(), const std::string& comment = "") override; + virtual void onParseEnd() override; + + UpsdConfiguration* _config; +}; + + +/** UPS configuration */ +class UpsConfiguration : public GenericConfiguration +{ +public: + /** Global configuration attributes getters and setters \{ */ + + inline std::string getChroot() const { return getStr("chroot"); } + inline std::string getDriverPath() const { return getStr("driverpath"); } + inline std::string getUser() const { return getStr("user"); } + + inline long long int getMaxStartDelay() const { return getInt("maxstartdelay"); } + inline long long int getPollInterval() const { return getInt("pollinterval", 5); } // TODO: check the default + + inline void setChroot(const std::string & path) { setStr("chroot", path); } + inline void setDriverPath(const std::string & path) { setStr("driverpath", path); } + inline void setUser(const std::string & user) { setStr("user", user); } + + inline void setMaxStartDelay(long long int delay) { setInt("maxstartdelay", delay); } + inline void setPollInterval(long long int interval) { setInt("pollinterval", interval); } + + /** \} */ + + /** Generic = getter */ + inline std::string getKey(const std::string & ups, const std::string & key) const { return getStr(ups, key); } + + /** Generic = setter */ + inline void setKey(const std::string & ups, const std::string & key, const std::string & val) { + setStr(ups, key, val); + } + + /** UPS-specific configuration attributes getters and setters \{ */ + inline std::string getDriver(const std::string & ups) const { return getStr(ups, "driver"); } + inline std::string getDescription(const std::string & ups) const { return getStr(ups, "desc"); } + inline std::string getCP(const std::string & ups) const { return getStr(ups, "CP"); } + inline std::string getCS(const std::string & ups) const { return getStr(ups, "CS"); } + inline std::string getID(const std::string & ups) const { return getStr(ups, "ID"); } + inline std::string getLB(const std::string & ups) const { return getStr(ups, "LB"); } + inline std::string getLowBatt(const std::string & ups) const { return getStr(ups, "LowBatt"); } + inline std::string getOL(const std::string & ups) const { return getStr(ups, "OL"); } + inline std::string getSD(const std::string & ups) const { return getStr(ups, "SD"); } + inline std::string getAuthPassword(const std::string & ups) const { return getStr(ups, "authPassword"); } + inline std::string getAuthProtocol(const std::string & ups) const { return getStr(ups, "authProtocol"); } + inline std::string getAuthType(const std::string & ups) const { return getStr(ups, "authtype"); } + inline std::string getAWD(const std::string & ups) const { return getStr(ups, "awd"); } + inline std::string getBatText(const std::string & ups) const { return getStr(ups, "battext"); } + inline std::string getBus(const std::string & ups) const { return getStr(ups, "bus"); } + inline std::string getCommunity(const std::string & ups) const { return getStr(ups, "community"); } + inline std::string getFRUID(const std::string & ups) const { return getStr(ups, "fruid"); } + inline std::string getLoadStatus(const std::string & ups) const { return getStr(ups, "load.status"); } + inline std::string getLogin(const std::string & ups) const { return getStr(ups, "login"); } + inline std::string getLowbatt(const std::string & ups) const { return getStr(ups, "lowbatt"); } + inline std::string getManufacturer(const std::string & ups) const { return getStr(ups, "manufacturer"); } + inline std::string getMethodOfFlowControl(const std::string & ups) const { return getStr(ups, "methodOfFlowControl"); } + inline std::string getMIBs(const std::string & ups) const { return getStr(ups, "mibs"); } + inline std::string getModel(const std::string & ups) const { return getStr(ups, "model"); } + inline std::string getModelName(const std::string & ups) const { return getStr(ups, "modelname"); } + inline std::string getNotification(const std::string & ups) const { return getStr(ups, "notification"); } + inline std::string getOldMAC(const std::string & ups) const { return getStr(ups, "oldmac"); } + inline std::string getPassword(const std::string & ups) const { return getStr(ups, "password"); } + inline std::string getPort(const std::string & ups) const { return getStr(ups, "port"); } + inline std::string getPrefix(const std::string & ups) const { return getStr(ups, "prefix"); } + inline std::string getPrivPassword(const std::string & ups) const { return getStr(ups, "privPassword"); } + inline std::string getPrivProtocol(const std::string & ups) const { return getStr(ups, "privProtocol"); } + inline std::string getProduct(const std::string & ups) const { return getStr(ups, "product"); } + inline std::string getProductID(const std::string & ups) const { return getStr(ups, "productid"); } + inline std::string getProtocol(const std::string & ups) const { return getStr(ups, "protocol"); } + inline std::string getRuntimeCal(const std::string & ups) const { return getStr(ups, "runtimecal"); } + inline std::string getSDType(const std::string & ups) const { return getStr(ups, "sdtype"); } + inline std::string getSecLevel(const std::string & ups) const { return getStr(ups, "secLevel"); } + inline std::string getSecName(const std::string & ups) const { return getStr(ups, "secName"); } + inline std::string getSensorID(const std::string & ups) const { return getStr(ups, "sensorid"); } + inline std::string getSerial(const std::string & ups) const { return getStr(ups, "serial"); } + inline std::string getSerialNumber(const std::string & ups) const { return getStr(ups, "serialnumber"); } + inline std::string getShutdownArguments(const std::string & ups) const { return getStr(ups, "shutdownArguments"); } + inline std::string getSNMPversion(const std::string & ups) const { return getStr(ups, "snmp_version"); } + inline std::string getSubdriver(const std::string & ups) const { return getStr(ups, "subdriver"); } + inline std::string getType(const std::string & ups) const { return getStr(ups, "type"); } + inline std::string getUPStype(const std::string & ups) const { return getStr(ups, "upstype"); } + inline std::string getUSD(const std::string & ups) const { return getStr(ups, "usd"); } + inline std::string getUsername(const std::string & ups) const { return getStr(ups, "username"); } + inline std::string getValidationSequence(const std::string & ups) const { return getStr(ups, "validationSequence"); } + inline std::string getVendor(const std::string & ups) const { return getStr(ups, "vendor"); } + inline std::string getVendorID(const std::string & ups) const { return getStr(ups, "vendorid"); } + inline std::string getWUGrace(const std::string & ups) const { return getStr(ups, "wugrace"); } + + + inline long long int getSDOrder(const std::string & ups) const { return getInt(ups, "sdorder"); } // TODO: Is that a number? + inline long long int getMaxStartDelay(const std::string & ups) const { return getInt(ups, "maxstartdelay"); } + inline long long int getAdvOrder(const std::string & ups) const { return getInt(ups, "advorder"); } // CHECKME + inline long long int getBatteryPercentage(const std::string & ups) const { return getInt(ups, "batteryPercentage"); } // CHECKME + inline long long int getOffDelay(const std::string & ups) const { return getInt(ups, "OffDelay"); } // CHECKME + inline long long int getOnDelay(const std::string & ups) const { return getInt(ups, "OnDelay"); } // CHECKME + inline long long int getBattVoltMult(const std::string & ups) const { return getInt(ups, "battvoltmult"); } // CHECKME + inline long long int getBaudRate(const std::string & ups) const { return getInt(ups, "baud_rate"); } // CHECKME + inline long long int getBaudrate(const std::string & ups) const { return getInt(ups, "baudrate"); } // CHECKME + inline long long int getCablePower(const std::string & ups) const { return getInt(ups, "cablepower"); } // CHECKME + inline long long int getChargeTime(const std::string & ups) const { return getInt(ups, "chargetime"); } // CHECKME + inline long long int getDaysOff(const std::string & ups) const { return getInt(ups, "daysoff"); } // CHECKME + inline long long int getDaySweek(const std::string & ups) const { return getInt(ups, "daysweek"); } // CHECKME + inline long long int getFrequency(const std::string & ups) const { return getInt(ups, "frequency"); } // CHECKME + inline long long int getHourOff(const std::string & ups) const { return getInt(ups, "houroff"); } // CHECKME + inline long long int getHourOn(const std::string & ups) const { return getInt(ups, "houron"); } // CHECKME + inline long long int getIdleLoad(const std::string & ups) const { return getInt(ups, "idleload"); } // CHECKME + inline long long int getInputTimeout(const std::string & ups) const { return getInt(ups, "input_timeout"); } // CHECKME + inline long long int getLineVoltage(const std::string & ups) const { return getInt(ups, "linevoltage"); } // CHECKME + inline long long int getLoadpercentage(const std::string & ups) const { return getInt(ups, "loadPercentage"); } // CHECKME + inline long long int getMaxLoad(const std::string & ups) const { return getInt(ups, "max_load"); } // CHECKME + inline long long int getMFR(const std::string & ups) const { return getInt(ups, "mfr"); } // CHECKME + inline long long int getMinCharge(const std::string & ups) const { return getInt(ups, "mincharge"); } // CHECKME + inline long long int getMinRuntime(const std::string & ups) const { return getInt(ups, "minruntime"); } // CHECKME + inline long long int getNomBattVolt(const std::string & ups) const { return getInt(ups, "nombattvolt"); } // CHECKME + inline long long int getNumOfBytesFromUPS(const std::string & ups) const { return getInt(ups, "numOfBytesFromUPS"); } // CHECKME + inline long long int getOffdelay(const std::string & ups) const { return getInt(ups, "offdelay"); } // CHECKME + inline long long int getOndelay(const std::string & ups) const { return getInt(ups, "ondelay"); } // CHECKME + inline long long int getOutputPace(const std::string & ups) const { return getInt(ups, "output_pace"); } // CHECKME + inline long long int getPollFreq(const std::string & ups) const { return getInt(ups, "pollfreq"); } // CHECKME + inline long long int getPowerUp(const std::string & ups) const { return getInt(ups, "powerup"); } // CHECKME + inline long long int getPrgShut(const std::string & ups) const { return getInt(ups, "prgshut"); } // CHECKME + inline long long int getRebootDelay(const std::string & ups) const { return getInt(ups, "rebootdelay"); } // CHECKME + inline long long int getSDtime(const std::string & ups) const { return getInt(ups, "sdtime"); } // CHECKME + inline long long int getShutdownDelay(const std::string & ups) const { return getInt(ups, "shutdown_delay"); } // CHECKME + inline long long int getStartDelay(const std::string & ups) const { return getInt(ups, "startdelay"); } // CHECKME + inline long long int getTestTime(const std::string & ups) const { return getInt(ups, "testtime"); } // CHECKME + inline long long int getTimeout(const std::string & ups) const { return getInt(ups, "timeout"); } // CHECKME + inline long long int getUPSdelayShutdown(const std::string & ups) const { return getInt(ups, "ups.delay.shutdown"); } // CHECKME + inline long long int getUPSdelayStart(const std::string & ups) const { return getInt(ups, "ups.delay.start"); } // CHECKME + inline long long int getVoltage(const std::string & ups) const { return getInt(ups, "voltage"); } // CHECKME + inline long long int getWait(const std::string & ups) const { return getInt(ups, "wait"); } // CHECKME + + inline bool getNolock(const std::string & ups) const { return str2bool(getStr(ups, "nolock")); } + inline bool getCable(const std::string & ups) const { return str2bool(getStr(ups, "cable")); } + inline bool getDumbTerm(const std::string & ups) const { return str2bool(getStr(ups, "dumbterm")); } + inline bool getExplore(const std::string & ups) const { return str2bool(getStr(ups, "explore")); } + inline bool getFakeLowBatt(const std::string & ups) const { return str2bool(getStr(ups, "fake_lowbatt")); } + inline bool getFlash(const std::string & ups) const { return str2bool(getStr(ups, "flash")); } + inline bool getFullUpdate(const std::string & ups) const { return str2bool(getStr(ups, "full_update")); } + inline bool getLangIDfix(const std::string & ups) const { return str2bool(getStr(ups, "langid_fix")); } + inline bool getLoadOff(const std::string & ups) const { return str2bool(getStr(ups, "load.off")); } + inline bool getLoadOn(const std::string & ups) const { return str2bool(getStr(ups, "load.on")); } + inline bool getNoHang(const std::string & ups) const { return str2bool(getStr(ups, "nohang")); } + inline bool getNoRating(const std::string & ups) const { return str2bool(getStr(ups, "norating")); } + inline bool getNoTransferOIDs(const std::string & ups) const { return str2bool(getStr(ups, "notransferoids")); } + inline bool getNoVendor(const std::string & ups) const { return str2bool(getStr(ups, "novendor")); } + inline bool getNoWarnNoImp(const std::string & ups) const { return str2bool(getStr(ups, "nowarn_noimp")); } + inline bool getPollOnly(const std::string & ups) const { return str2bool(getStr(ups, "pollonly")); } + inline bool getSilent(const std::string & ups) const { return str2bool(getStr(ups, "silent")); } + inline bool getStatusOnly(const std::string & ups) const { return str2bool(getStr(ups, "status_only")); } + inline bool getSubscribe(const std::string & ups) const { return str2bool(getStr(ups, "subscribe")); } + inline bool getUseCRLF(const std::string & ups) const { return str2bool(getStr(ups, "use_crlf")); } + inline bool getUsePreLF(const std::string & ups) const { return str2bool(getStr(ups, "use_pre_lf")); } + + + inline void setDriver(const std::string & ups, const std::string & driver) { setStr(ups, "driver", driver); } + inline void setDescription(const std::string & ups, const std::string & desc) { setStr(ups, "desc", desc); } + inline void setLowBatt(const std::string & ups, const std::string & lowbatt) { setStr(ups, "LowBatt", lowbatt); } + inline void setOL(const std::string & ups, const std::string & ol) { setStr(ups, "OL", ol); } + inline void setSD(const std::string & ups, const std::string & sd) { setStr(ups, "SD", sd); } + inline void setAuthPassword(const std::string & ups, const std::string & auth_passwd) { setStr(ups, "authPassword", auth_passwd); } + inline void setAuthProtocol(const std::string & ups, const std::string & auth_proto) { setStr(ups, "authProtocol", auth_proto); } + inline void setAuthType(const std::string & ups, const std::string & authtype) { setStr(ups, "authtype", authtype); } + inline void setAWD(const std::string & ups, const std::string & awd) { setStr(ups, "awd", awd); } + inline void setBatText(const std::string & ups, const std::string & battext) { setStr(ups, "battext", battext); } + inline void setBus(const std::string & ups, const std::string & bus) { setStr(ups, "bus", bus); } + inline void setCommunity(const std::string & ups, const std::string & community) { setStr(ups, "community", community); } + inline void setFRUID(const std::string & ups, const std::string & fruid) { setStr(ups, "fruid", fruid); } + inline void setLoadStatus(const std::string & ups, const std::string & load_status) { setStr(ups, "load.status", load_status); } + inline void setLogin(const std::string & ups, const std::string & login) { setStr(ups, "login", login); } + inline void setLowbatt(const std::string & ups, const std::string & lowbatt) { setStr(ups, "lowbatt", lowbatt); } + inline void setManufacturer(const std::string & ups, const std::string & manufacturer) { setStr(ups, "manufacturer", manufacturer); } + inline void setMethodOfFlowControl(const std::string & ups, const std::string & method) { setStr(ups, "methodOfFlowControl", method); } + inline void setMIBs(const std::string & ups, const std::string & mibs) { setStr(ups, "mibs", mibs); } + inline void setModel(const std::string & ups, const std::string & model) { setStr(ups, "model", model); } + inline void setModelName(const std::string & ups, const std::string & modelname) { setStr(ups, "modelname", modelname); } + inline void setNotification(const std::string & ups, const std::string & notification) { setStr(ups, "notification", notification); } + inline void setOldMAC(const std::string & ups, const std::string & oldmac) { setStr(ups, "oldmac", oldmac); } + inline void setPassword(const std::string & ups, const std::string & password) { setStr(ups, "password", password); } + inline void setPort(const std::string & ups, const std::string & port) { setStr(ups, "port", port); } + inline void setPrefix(const std::string & ups, const std::string & prefix) { setStr(ups, "prefix", prefix); } + inline void setPrivPassword(const std::string & ups, const std::string & priv_passwd) { setStr(ups, "privPassword", priv_passwd); } + inline void setPrivProtocol(const std::string & ups, const std::string & priv_proto) { setStr(ups, "privProtocol", priv_proto); } + inline void setProduct(const std::string & ups, const std::string & product) { setStr(ups, "product", product); } + inline void setProductID(const std::string & ups, const std::string & productid) { setStr(ups, "productid", productid); } + inline void setProtocol(const std::string & ups, const std::string & protocol) { setStr(ups, "protocol", protocol); } + inline void setRuntimeCal(const std::string & ups, const std::string & runtimecal) { setStr(ups, "runtimecal", runtimecal); } + inline void setSDtype(const std::string & ups, const std::string & sdtype) { setStr(ups, "sdtype", sdtype); } + inline void setSecLevel(const std::string & ups, const std::string & sec_level) { setStr(ups, "secLevel", sec_level); } + inline void setSecName(const std::string & ups, const std::string & sec_name) { setStr(ups, "secName", sec_name); } + inline void setSensorID(const std::string & ups, const std::string & sensorid) { setStr(ups, "sensorid", sensorid); } + inline void setSerial(const std::string & ups, const std::string & serial) { setStr(ups, "serial", serial); } + inline void setSerialNumber(const std::string & ups, const std::string & serialnumber) { setStr(ups, "serialnumber", serialnumber); } + inline void setShutdownArguments(const std::string & ups, const std::string & sd_args) { setStr(ups, "shutdownArguments", sd_args); } + inline void setSNMPversion(const std::string & ups, const std::string & snmp_version) { setStr(ups, "snmp_version", snmp_version); } + inline void setSubdriver(const std::string & ups, const std::string & subdriver) { setStr(ups, "subdriver", subdriver); } + inline void setType(const std::string & ups, const std::string & type) { setStr(ups, "type", type); } + inline void setUPStype(const std::string & ups, const std::string & upstype) { setStr(ups, "upstype", upstype); } + inline void setUSD(const std::string & ups, const std::string & usd) { setStr(ups, "usd", usd); } + inline void setUsername(const std::string & ups, const std::string & username) { setStr(ups, "username", username); } + inline void setValidationSequence(const std::string & ups, const std::string & valid_seq) { setStr(ups, "validationSequence", valid_seq); } + inline void setVendor(const std::string & ups, const std::string & vendor) { setStr(ups, "vendor", vendor); } + inline void setVendorID(const std::string & ups, const std::string & vendorid) { setStr(ups, "vendorid", vendorid); } + inline void setWUGrace(const std::string & ups, const std::string & wugrace) { setStr(ups, "wugrace", wugrace); } + + inline void setSDOrder(const std::string & ups, long long int ord) { setInt(ups, "sdorder", ord); } + inline void setMaxStartDelay(const std::string & ups, long long int delay) { setInt(ups, "maxstartdelay", delay); } + inline void setADVorder(const std::string & ups, long long int advorder) { setInt(ups, "advorder", advorder); } // CHECKME + inline void setBatteryPercentage(const std::string & ups, long long int batt) { setInt(ups, "batteryPercentage", batt); } // CHECKME + inline void setOffDelay(const std::string & ups, long long int offdelay) { setInt(ups, "OffDelay", offdelay); } // CHECKME + inline void setOnDelay(const std::string & ups, long long int ondelay) { setInt(ups, "OnDelay", ondelay); } // CHECKME + inline void setBattVoltMult(const std::string & ups, long long int mult) { setInt(ups, "battvoltmult", mult); } // CHECKME + inline void setBaudRate(const std::string & ups, long long int baud_rate) { setInt(ups, "baud_rate", baud_rate); } // CHECKME + inline void setBaudrate(const std::string & ups, long long int baudrate) { setInt(ups, "baudrate", baudrate); } // CHECKME + inline void setCablePower(const std::string & ups, long long int cablepower) { setInt(ups, "cablepower", cablepower); } // CHECKME + inline void setChargeTime(const std::string & ups, long long int chargetime) { setInt(ups, "chargetime", chargetime); } // CHECKME + inline void setDaysOff(const std::string & ups, long long int daysoff) { setInt(ups, "daysoff", daysoff); } // CHECKME + inline void setDaysWeek(const std::string & ups, long long int daysweek) { setInt(ups, "daysweek", daysweek); } // CHECKME + inline void setFrequency(const std::string & ups, long long int frequency) { setInt(ups, "frequency", frequency); } // CHECKME + inline void setHourOff(const std::string & ups, long long int houroff) { setInt(ups, "houroff", houroff); } // CHECKME + inline void setHourOn(const std::string & ups, long long int houron) { setInt(ups, "houron", houron); } // CHECKME + inline void setIdleLoad(const std::string & ups, long long int idleload) { setInt(ups, "idleload", idleload); } // CHECKME + inline void setInputTimeout(const std::string & ups, long long int timeout) { setInt(ups, "input_timeout", timeout); } // CHECKME + inline void setLineVoltage(const std::string & ups, long long int linevoltage) { setInt(ups, "linevoltage", linevoltage); } // CHECKME + inline void setLoadpercentage(const std::string & ups, long long int load) { setInt(ups, "loadPercentage", load); } // CHECKME + inline void setMaxLoad(const std::string & ups, long long int max_load) { setInt(ups, "max_load", max_load); } // CHECKME + inline void setMFR(const std::string & ups, long long int mfr) { setInt(ups, "mfr", mfr); } // CHECKME + inline void setMinCharge(const std::string & ups, long long int mincharge) { setInt(ups, "mincharge", mincharge); } // CHECKME + inline void setMinRuntime(const std::string & ups, long long int minruntime) { setInt(ups, "minruntime", minruntime); } // CHECKME + inline void setNomBattVolt(const std::string & ups, long long int nombattvolt) { setInt(ups, "nombattvolt", nombattvolt); } // CHECKME + inline void setNumOfBytesFromUPS(const std::string & ups, long long int bytes) { setInt(ups, "numOfBytesFromUPS", bytes); } // CHECKME + inline void setOffdelay(const std::string & ups, long long int offdelay) { setInt(ups, "offdelay", offdelay); } // CHECKME + inline void setOndelay(const std::string & ups, long long int ondelay) { setInt(ups, "ondelay", ondelay); } // CHECKME + inline void setOutputPace(const std::string & ups, long long int output_pace) { setInt(ups, "output_pace", output_pace); } // CHECKME + inline void setPollFreq(const std::string & ups, long long int pollfreq) { setInt(ups, "pollfreq", pollfreq); } // CHECKME + inline void setPowerUp(const std::string & ups, long long int powerup) { setInt(ups, "powerup", powerup); } // CHECKME + inline void setPrgShut(const std::string & ups, long long int prgshut) { setInt(ups, "prgshut", prgshut); } // CHECKME + inline void setRebootDelay(const std::string & ups, long long int delay) { setInt(ups, "rebootdelay", delay); } // CHECKME + inline void setSDtime(const std::string & ups, long long int sdtime) { setInt(ups, "sdtime", sdtime); } // CHECKME + inline void setShutdownDelay(const std::string & ups, long long int delay) { setInt(ups, "shutdown_delay", delay); } // CHECKME + inline void setStartDelay(const std::string & ups, long long int delay) { setInt(ups, "startdelay", delay); } // CHECKME + inline void setTestTime(const std::string & ups, long long int testtime) { setInt(ups, "testtime", testtime); } // CHECKME + inline void setTimeout(const std::string & ups, long long int timeout) { setInt(ups, "timeout", timeout); } // CHECKME + inline void setUPSdelayShutdown(const std::string & ups, long long int delay) { setInt(ups, "ups.delay.shutdown", delay); } // CHECKME + inline void setUPSdelayStart(const std::string & ups, long long int delay) { setInt(ups, "ups.delay.start", delay); } // CHECKME + inline void setVoltage(const std::string & ups, long long int voltage) { setInt(ups, "voltage", voltage); } // CHECKME + inline void setWait(const std::string & ups, long long int wait) { setInt(ups, "wait", wait); } // CHECKME + + inline void setNolock(const std::string & ups, bool set = true) { setStr(ups, "nolock", bool2str(set)); } + inline void setCable(const std::string & ups, bool set = true) { setStr(ups, "cable", bool2str(set)); } + inline void setDumbTerm(const std::string & ups, bool set = true) { setStr(ups, "dumbterm", bool2str(set)); } + inline void setExplore(const std::string & ups, bool set = true) { setStr(ups, "explore", bool2str(set)); } + inline void setFakeLowBatt(const std::string & ups, bool set = true) { setStr(ups, "fake_lowbatt", bool2str(set)); } + inline void setFlash(const std::string & ups, bool set = true) { setStr(ups, "flash", bool2str(set)); } + inline void setFullUpdate(const std::string & ups, bool set = true) { setStr(ups, "full_update", bool2str(set)); } + inline void setLangIDfix(const std::string & ups, bool set = true) { setStr(ups, "langid_fix", bool2str(set)); } + inline void setLoadOff(const std::string & ups, bool set = true) { setStr(ups, "load.off", bool2str(set)); } + inline void setLoadOn(const std::string & ups, bool set = true) { setStr(ups, "load.on", bool2str(set)); } + inline void setNoHang(const std::string & ups, bool set = true) { setStr(ups, "nohang", bool2str(set)); } + inline void setNoRating(const std::string & ups, bool set = true) { setStr(ups, "norating", bool2str(set)); } + inline void setNoTransferOIDs(const std::string & ups, bool set = true) { setStr(ups, "notransferoids", bool2str(set)); } + inline void setNoVendor(const std::string & ups, bool set = true) { setStr(ups, "novendor", bool2str(set)); } + inline void setNoWarnNoImp(const std::string & ups, bool set = true) { setStr(ups, "nowarn_noimp", bool2str(set)); } + inline void setPollOnly(const std::string & ups, bool set = true) { setStr(ups, "pollonly", bool2str(set)); } + inline void setSilent(const std::string & ups, bool set = true) { setStr(ups, "silent", bool2str(set)); } + inline void setStatusOnly(const std::string & ups, bool set = true) { setStr(ups, "status_only", bool2str(set)); } + inline void setSubscribe(const std::string & ups, bool set = true) { setStr(ups, "subscribe", bool2str(set)); } + inline void setUseCRLF(const std::string & ups, bool set = true) { setStr(ups, "use_crlf", bool2str(set)); } + inline void setUsePreLF(const std::string & ups, bool set = true) { setStr(ups, "use_pre_lf", bool2str(set)); } + + /** \} */ + + virtual ~UpsConfiguration() override; +}; // end of class UpsConfiguration + + +/** upsd users configuration */ +class UpsdUsersConfiguration : public GenericConfiguration +{ +public: + /** upsmon mode */ + typedef enum { + UPSMON_UNDEF = 0, /**< Unknown mode */ + UPSMON_MASTER, /**< Master mode */ + UPSMON_SLAVE, /**< Slave mode */ + } upsmon_mode_t; + + /** User-specific configuration attributes getters and setters \{ */ + + inline std::string getPassword(const std::string & user) const { return getStr(user, "password"); } + + inline ConfigParamList getActions(const std::string & user) const + { + ConfigParamList actions; + get(user, "actions", actions); + return actions; + } + + inline ConfigParamList getInstantCommands(const std::string & user) const + { + ConfigParamList cmds; + get(user, "instcmds", cmds); + return cmds; + } + + upsmon_mode_t getUpsmonMode() const; + + inline void setPassword(const std::string & user, const std::string & passwd) { setStr(user, "password", passwd); } + + inline void setActions(const std::string & user, const ConfigParamList & actions) { set(user, "actions", actions); } + inline void setInstantCommands(const std::string & user, const ConfigParamList & cmds) { set(user, "instcmds", cmds); } + + inline void addActions(const std::string & user, const ConfigParamList & actions) { add(user, "actions", actions); } + inline void addInstantCommands(const std::string & user, const ConfigParamList & cmds) { add(user, "instcmds", cmds); } + + /** + * \brief upsmon mode setter + * + * Note that the UPSMON_UNDEF mode isn't allowed as parameter + * (logically, if you set something, it shall be defined...) + * + * \param mode Mode + */ + void setUpsmonMode(upsmon_mode_t mode); + + /** \} */ + + /** Serialisable interface implementation overload \{ */ + bool parseFrom(NutStream & istream) override; + bool writeTo(NutStream & ostream) const override; + /** \} */ + +}; // end of class UpsdUsersConfiguration + +} /* namespace nut */ +#endif /* __cplusplus */ +#endif /* NUTCONF_H_SEEN */ diff --git a/include/nutipc.hpp b/include/nutipc.hpp new file mode 100644 index 0000000000..d668363b3c --- /dev/null +++ b/include/nutipc.hpp @@ -0,0 +1,850 @@ +/* + nutipc.hpp - NUT IPC + + Copyright (C) 2012 Eaton + + Author: Vaclav Krpec + + 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 +*/ + +#ifndef NUT_NUTIPC_HPP +#define NUT_NUTIPC_HPP + +#include +#include +#include + +#include +#include +#include +#include + +extern "C" { +#include +#include +#include + +#ifndef WIN32 +# include +#else +# include +#endif + +#ifdef HAVE_PTHREAD +# include +#endif +} + +/* See include/common.h for details behind this */ +#ifndef NUT_UNUSED_VARIABLE +#define NUT_UNUSED_VARIABLE(x) (void)(x) +#endif + +namespace nut { + +/** + * Process-related information + */ +class Process { + private: + + /** The type yields no instances */ + Process() {} + + public: + + /** Get current process ID */ + static pid_t getPID() +#if (defined __cplusplus) && (__cplusplus < 201100) + throw() +#endif + ; + + /** Get parent process ID */ + static pid_t getPPID() +#if (defined __cplusplus) && (__cplusplus < 201100) + throw() +#endif + ; + + /** + * Process main routine functor prototype + */ + class Main { + protected: + + /** Formal constructor */ + Main() {} + virtual ~Main(); + + public: + + /* Avoid implicit copy/move operator declarations */ + Main(Main&&) = default; + Main& operator=(const Main&) = default; + //Main& operator=(Main&&) = default; + + /** Routine */ + virtual int operator () () = 0; + + }; // end of class Main + + /** + * Child process + */ + template + class Child { + private: + + pid_t m_pid; /**< Child PID */ + bool m_exited; /**< Exited flag */ + int m_exit_code; /**< Exit code */ + + public: + + /** + * \brief Constructor of child process + * + * The constructor calls \c ::fork to create another child process. + * The child executes \ref m_main functor instance operator \c (). + * When the functor's \c () operator returns, the returned value + * shall be used as the child exit code (and the child will exit). + * + * \param main Child process main routine + */ + Child(M main) +#if (defined __cplusplus) && (__cplusplus < 201100) + throw(std::runtime_error) +#endif + ; + + /** Child PID */ + inline pid_t getPID() const { return m_pid; } + + /** + * \brief Wait for child process to exit + * + * The method blocks as long as the child runs. + * It returns the child's exit code. + * It throws an exception if executed twice + * (or on other illogical usage). + * + * \return Child process exit code + */ + int wait() +#if (defined __cplusplus) && (__cplusplus < 201100) + throw(std::logic_error) +#endif + ; + + /** + * \brief Child exit code getter + * + * \return Child exit code + */ + inline int exitCode() { + return wait(); + } + + /** + * \brief Destructor + * + * The destructor shall wait for the child process + * (unless already exited). + */ + ~Child() { + wait(); + } + + }; // end of class Child + + /** + * External command executor + */ + class Executor: public Main { + public: + + /** Command line arguments list */ + typedef std::list Arguments; + + private: + + std::string m_bin; + Arguments m_args; + + public: + + /** + * \brief Constructor + * + * The binary path may be omitted; the implementation shall perform + * the actions shell would do to search for the binary (i.e. check \c PATH + * environment variable); + * + * Note that even option switches are command line arguments; + * e.g. "tail -n 20" command has 2 arguments: "-n" and "20". + * + * \brief bin Binary to be executed + * \brief args Command-line arguments to the binary + */ + Executor(const std::string & bin, const Arguments & args): + m_bin(bin), m_args(args) {} + + /** + * \brief Constructor + * + * This constructor form splits the command string specified + * to the binary and its cmd-line arguments for the caller (by spaces). + * + * Note however, that the command must be a binary execution; if you want + * to run a shell command, you must execute the shell, explicitly; e.g: + * "/bin/sh -c ''" shall probably be what you want. + * + * \param command Command to be executed + */ + Executor(const std::string & command); + + /** Execution of the binary */ + int operator () () +#if (defined __cplusplus) && (__cplusplus < 201100) + throw(std::runtime_error) +#endif + override; + }; // end of class Executor + + /** + * External command execution + */ + class Execution: public Child { + public: + + /** + * Constructor + * + * The binary path may be omitted; the implementation shall perform + * the actions shell would do to search for the binary (i.e. check \c PATH + * environment variable); + * + * \brief binary Binary to be executed + * \brief arguments Command-line arguments to the binary + */ + Execution(const std::string & binary, const Executor::Arguments & arguments): + Child(Executor(binary, arguments)) {} + + /** + * Constructor + * + * This form of the constructor splits the command string specified + * to the binary and its cmd-line arguments for the caller (by spaces). + * + * Note however, that the command must be a binary execution; if you want + * to run a shell command, you must execute the shell, explicitly; e.g: + * "/bin/sh -c ''" shall probably be what you want. + * + * \param command Command to be executed + */ + Execution(const std::string & command): Child(Executor(command)) {} + + }; // end of class Execution + + /** + * \brief Execute command and wait for exit code + * + * \param binary Binary to be executed + * \param arguments Command-line arguments to the binary + * + * \return Exit code + */ + static inline int execute(const std::string & binary, const Executor::Arguments & arguments) { + Execution child(binary, arguments); + + return child.wait(); + } + + /** + * \brief Execute command and wait for exit code + * + * \param command Command to be executed + * + * \return Exit code + */ + static inline int execute(const std::string & command) { + Execution child(command); + + return child.wait(); + } + +}; // end of class Process + + +template +Process::Child::Child(M main) +#if (defined __cplusplus) && (__cplusplus < 201100) + throw(std::runtime_error) +#endif + : + m_pid(0), + m_exited(false), + m_exit_code(0) +{ +#ifdef WIN32 + NUT_UNUSED_VARIABLE(main); + + /* FIXME: Implement (for NUT processes) via pipes? + * See e.g. upsdrvctl implementation. */ + std::stringstream e; + + e << "Can't fork: not implemented on this platform yet"; + + throw std::logic_error(e.str()); +#else + m_pid = ::fork(); + + if (!m_pid) + ::exit(main()); +#endif +} + + +template +int Process::Child::wait() +#if (defined __cplusplus) && (__cplusplus < 201100) + throw(std::logic_error) +#endif +{ +#ifdef WIN32 + /* FIXME: Implement (for NUT processes) via pipes? + * See e.g. upsdrvctl implementation. */ + std::stringstream e; + + e << "Can't wait for PID " << m_pid << + ": not implemented on this platform yet"; + + throw std::logic_error(e.str()); +#else + if (m_exited) + return m_exit_code; + + pid_t wpid = ::waitpid(m_pid, &m_exit_code, 0); + + if (-1 == wpid) { + int erno = errno; + + std::stringstream e; + + e << "Failed to wait for process " << m_pid << ": "; + e << erno << ": " << strerror(erno); + + throw std::logic_error(e.str()); + } + + m_exited = true; + m_exit_code = WEXITSTATUS(m_exit_code); + + return m_exit_code; +#endif +} + + +/** + * POSIX signal + * + * For portability reasons, only mostly common subset of POSIX.1-2001 signals are supported. + */ +class Signal { + public: + + /** Signals */ + typedef enum { +#ifndef WIN32 + HUP = SIGHUP, /** Hangup */ + INT = SIGINT, /** Interrupt */ + QUIT = SIGQUIT, /** Quit */ + ILL = SIGILL, /** Illegal Instruction */ + TRAP = SIGTRAP, /** Trace/breakpoint trap */ + ABORT = SIGABRT, /** Abort */ + BUS = SIGBUS, /** Bus error (bad memory access) */ + FPE = SIGFPE, /** Floating point exception */ + KILL = SIGKILL, /** Kill (unmaskable) */ + SEGV = SIGSEGV, /** Invalid memory reference */ + PIPE = SIGPIPE, /** Broken pipe */ + ALARM = SIGALRM, /** Alarm */ + TERM = SIGTERM, /** Termination */ + USER1 = SIGUSR1, /** User-defined signal 1 */ + USER2 = SIGUSR2, /** User-defined signal 2 */ + CHILD = SIGCHLD, /** Child stopped or terminated */ + CONT = SIGCONT, /** Continue if stopped */ + STOP = SIGSTOP, /** Stop process (unmaskable) */ + TSTOP = SIGTSTP, /** Stop typed at TTY */ + TTYIN = SIGTTIN, /** TTY input for background process */ + TTYOUT = SIGTTOU, /** TTY output for background process */ + PROF = SIGPROF, /** Profiling timer expired */ + SYS = SIGSYS, /** Bad argument to routine */ + URG = SIGURG, /** Urgent condition on socket */ + VTALRM = SIGVTALRM, /** Virtual alarm clock */ + XCPU = SIGXCPU, /** CPU time limit exceeded */ + XFSZ = SIGXFSZ, /** File size limit exceeded */ +#endif + } enum_t; // end of typedef enum + + /** Signal list */ + typedef std::list List; + + /** + * \brief Signal handler + * + * Signal handler interface. + */ + class Handler { + protected: + + /** Formal constructor */ + Handler() {} + + public: + + /** + * \brief Signal handler routine + * + * \param signal Signal + */ + virtual void operator () (enum_t signal) = 0; + + /** Formal destructor */ + virtual ~Handler(); + + }; // end of class Handler + + private: + + /** Formal constructor */ + Signal() {} + + public: + + /** Signal handler thread handle */ + template + class HandlerThread { + friend class Signal; + + private: + + /** Control commands */ + typedef enum { + HT_QUIT = 0, /**< Shutdown the thread */ + HT_SIGNAL = 1, /**< Signal obtained */ + } command_t; + + /** Communication pipe */ + static int s_comm_pipe[2]; + + /** POSIX thread */ + pthread_t m_impl; + + /** + * \brief Signal handler thread main routine + * + * The function synchronously read commands from the communication pipe. + * It processes control commands on its own (e.g. the quit command). + * It passes all signals to signal handler instance of \ref H + * Which must implement the \ref Signal::Handler interface. + * The handler is instantiated in scope of the routine. + * It closes the communication pipe read end in reaction to + * \ref HT_QUIT command. + * + * \param comm_pipe_read_end Communication pipe read end + * + * \retval N/A (the function never returns) + */ + static void * main(void * comm_pipe_read_end); + + /** + * \brief Signal handler routine + * + * The actual signal handler routine executed by the OS when the process + * obtains signal to be handled. + * The function simply writes the signal number to the signal handler + * thread communication pipe (as parameter of the \ref HT_SIGNAL command). + * The signal handling itself (whatever necessary) shall be done + * by the dedicated thread (to avoid possible re-entrance issues). + * + * Note that \c ::write is required to be an async-signal-safe function by + * POSIX.1-2004; also note that up to \c PIPE_BUF bytes are written atomically + * as required by IEEE Std 1003.1, 2004 Edition,\c PIPE_BUF being typically + * hundreds of bytes at least (POSIX requires 512B, Linux provides whole 4KiB + * page). + * + * \param signal Signal + */ + static void signalNotifier(int signal); + + public: + + /** + * \brief Constructor + * + * At most one thread per handler instance may be created. + * This limitation is both due sanity reasons (it wouldn't + * make much sense to handle the same signal by multiple threads) + * and because of the signal handler routine only has access + * to one communication pipe write end (the static member). + * This is actually the only technical reason of having the class + * template (so that every instance has its own static comm. queue). + * However, for different handler classes, multiple handling threads + * may be created (if it makes sense) since these will be different + * template instances and therefore will use different static + * communication pipes. + * If more than 1 instance creation is attempted, an exception is thrown. + * + * \param siglist List of signals that shall be handled by the thread + */ + HandlerThread(const Signal::List & siglist) +#if (defined __cplusplus) && (__cplusplus < 201100) + throw(std::logic_error, std::runtime_error) +#endif + ; + + /** + * \brief Terminate the thread + * + * The method sends the signal handler thread the \ref QUIT signal. + * It blocks until the thread is joined. + * Closes the communication pipe write end. + */ + void quit() +#if (defined __cplusplus) && (__cplusplus < 201100) + throw(std::runtime_error) +#endif + ; + + /** + * \brief Destructor + * + * Forces the signal handler thread termination (unless already down). + */ + ~HandlerThread() +#if (defined __cplusplus) && (__cplusplus < 201100) + throw(std::runtime_error) +#endif + ; + + }; // end of HandlerThread + + /** + * \brief Send signal to a process + * + * An exception is thrown if the signal isn't implemented. + * + * \param signame Signal name + * \param pid Process ID + * + * \retval 0 in case of success + * \retval EPERM if the process doesn't have permission to send the signal + * \retval ESRCH if the process (group) identified doesn't exist + */ + static int send(enum_t signame, pid_t pid) +#if (defined __cplusplus) && (__cplusplus < 201100) + throw(std::logic_error) +#endif + ; + + /** + * \brief Send signal to a process identified via PID file + * + * An exception is thrown if the signal isn't implemented + * or PID file read fails. + * + * \param signame Signal name + * \param pid_file File containing process PID + * + * \retval 0 in case of success + * \retval EPERM if the process doesn't have permission to send the signal + * \retval ESRCH if the process (group) identified doesn't exist + */ + static int send(enum_t signame, const std::string & pid_file); + +}; // end of class Signal + + +/** Initialization of the communication pipes */ +template +int Signal::HandlerThread::s_comm_pipe[2] = { -1, -1 }; + + +template +void * Signal::HandlerThread::main(void * comm_pipe_read_end) { + int rfd = *(reinterpret_cast(comm_pipe_read_end)); + + H handler; + + for (;;) { + fd_set rfds; + FD_ZERO(&rfds); + FD_SET(rfd, &rfds); + + // Poll on signal pipe + // Note that direct blocking read could be also used; + // however, select allows timeout specification + // which might come handy... + int fdno = ::select(FD_SETSIZE, &rfds, nullptr, nullptr, nullptr); + + // TBD: Die or recover on error? + if (-1 == fdno) { + std::stringstream e; + + e << "Poll on communication pipe read end "; + e << rfd << " failed: " << errno; + + throw std::runtime_error(e.str()); + } + + assert(1 == fdno); + assert(FD_ISSET(rfd, &rfds)); + + // Read command + int word; + + ssize_t read_out = ::read(rfd, &word, sizeof(word)); + + // TBD: again, how should we treat read error? + if (-1 == read_out) { + std::stringstream e; + + e << "Failed to read command from the command pipe: "; + e << errno; + + throw std::runtime_error(e.str()); + } + + assert(sizeof(word) == read_out); + + command_t command = static_cast(word); + + switch (command) { + case HT_QUIT: + // Close comm. pipe read end + ::close(rfd); + + // Terminate thread + ::pthread_exit(nullptr); + + case HT_SIGNAL: + // Read signal number + read_out = ::read(rfd, &word, sizeof(word)); + + // TBD: again, how should we treat read error? + if (-1 == read_out) { + std::stringstream e; + + e << "Failed to read signal number "; + e << "from the command pipe: " << errno; + + throw std::runtime_error(e.str()); + } + + assert(sizeof(word) == read_out); + + Signal::enum_t sig = static_cast(word); + + // Handle signal + handler(sig); + } + } + + // Pro-forma exception + throw std::logic_error("INTERNAL ERROR: Unreachable code reached"); +} + + +/** + * \brief Write command to command pipe + * + * \param fh Pipe writing end (file handle) + * \param cmd Command + * \param cmd_size Command size + * + * \retval 0 on success + * \retval errno on error + */ +int sigPipeWriteCmd(int fh, void * cmd, size_t cmd_size) +#if (defined __cplusplus) && (__cplusplus < 201100) + throw(std::runtime_error) +#endif + ; + + +template +void Signal::HandlerThread::signalNotifier(int signal) { + int sig[2] = { + static_cast(Signal::HandlerThread::HT_SIGNAL), + }; + + sig[1] = signal; + + // TBD: The return value is silently ignored. + // Either the write should've succeeded or the handling + // thread is already coming down... + sigPipeWriteCmd(s_comm_pipe[1], sig, sizeof(sig)); +} + + +template +Signal::HandlerThread::HandlerThread(const Signal::List & siglist) +#if (defined __cplusplus) && (__cplusplus < 201100) + throw(std::logic_error, std::runtime_error) +#endif +{ +#ifdef WIN32 + NUT_UNUSED_VARIABLE(siglist); + + /* FIXME: Implement (for NUT processes) via pipes? + * See e.g. upsdrvctl implementation. */ + std::stringstream e; + + e << "Can't prepare signal handling thread: not implemented on this platform yet"; + + throw std::logic_error(e.str()); +#else + // At most one instance per process allowed + if (-1 != s_comm_pipe[1]) + throw std::logic_error( + "Attempt to start a duplicate of signal handling thread detected"); + + // Create communication pipe + if (::pipe(s_comm_pipe)) { + std::stringstream e; + + e << "Failed to create communication pipe: " << errno; + + throw std::runtime_error(e.str()); + } + + // Start the thread + int status = ::pthread_create(&m_impl, nullptr, &main, s_comm_pipe); + + if (status) { + std::stringstream e; + + e << "Failed to start the thread: " << status; + + throw std::runtime_error(e.str()); + } + + // Register signals + Signal::List::const_iterator sig = siglist.begin(); + + for (; sig != siglist.end(); ++sig) { + struct sigaction action; + + ::memset(&action, 0, sizeof(action)); +# ifdef sigemptyset + // no :: here because macro + sigemptyset(&action.sa_mask); +# else + ::sigemptyset(&action.sa_mask); +# endif + + action.sa_handler = &signalNotifier; + + int signo = static_cast(*sig); + + // TBD: We might want to save the old handlers... + status = ::sigaction(signo, &action, nullptr); + + if (status) { + std::stringstream e; + + e << "Failed to register signal handler for signal "; + e << signo << ": " << errno; + + throw std::runtime_error(e.str()); + } + } +#endif +} + + +template +void Signal::HandlerThread::quit() +#if (defined __cplusplus) && (__cplusplus < 201100) + throw(std::runtime_error) +#endif +{ + static int quit = static_cast(Signal::HandlerThread::HT_QUIT); + + sigPipeWriteCmd(s_comm_pipe[1], &quit, sizeof(quit)); + + int status = ::pthread_join(m_impl, nullptr); + + if (status) { + std::stringstream e; + + e << "Failed to joint signal handling thread: " << status; + + throw std::runtime_error(e.str()); + } + + if (::close(s_comm_pipe[1])) { + std::stringstream e; + + e << "Failed to close communication pipe: " << errno; + + throw std::runtime_error(e.str()); + } + + s_comm_pipe[1] = -1; +} + + +template +Signal::HandlerThread::~HandlerThread() +#if (defined __cplusplus) && (__cplusplus < 201100) + throw(std::runtime_error) +#endif +{ + // Stop the thread unless already stopped + if (-1 != s_comm_pipe[1]) + quit(); +} + + +/** NUT-specific signal handling */ +class NutSignal: public Signal { + public: + + /** + * \brief Send signal to a NUT process + * + * The function assembles process-specific PID file name and path + * and calls \ref Signal::send. + * + * An exception is thrown if the signal isn't implemented + * or PID file read fails. + * + * \param signame Signal name + * \param process File containing process PID + * + * \retval 0 in case of success + * \retval EPERM if the process doesn't have permission to send the signal + * \retval ESRCH if the process (group) identified doesn't exist + */ + static int send(enum_t signame, const std::string & process); + +}; // end of class NutSignal + +} // end of namespace nut + +#endif /* end of #ifndef NUT_NUTIPC_H */ diff --git a/include/nutstream.hpp b/include/nutstream.hpp new file mode 100644 index 0000000000..13c9cf76ed --- /dev/null +++ b/include/nutstream.hpp @@ -0,0 +1,1371 @@ +/* + nutstream.hpp - NUT stream + + Copyright (C) + 2012 Vaclav Krpec + + 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 +*/ + +#ifndef nut_nutstream_h +#define nut_nutstream_h + +#ifdef __cplusplus + +#include +#include +#include +#include +#include + +extern "C" { +#include +#include +#include +#ifndef WIN32 +# include +#else +# if HAVE_WINSOCK2_H +# include +# endif +# if HAVE_WS2TCPIP_H +# include +# endif +/* Using a private implementation in nutstream.cpp + * similar to nutclient.cpp; do not call wincompat.h! + * FIXME: refactor to reuse the C++ adaptation? + */ +#endif +} + +/* See include/common.h for details behind this */ +#ifndef NUT_UNUSED_VARIABLE +#define NUT_UNUSED_VARIABLE(x) (void)(x) +#endif + +namespace nut +{ + +/** + * \brief Data stream interface + * + * The interface provides character-based streamed I/O. + */ +class NutStream { + public: + + /** Data store status */ + typedef enum { + NUTS_OK = 0, /** Operation successful */ + NUTS_EOF, /** End of stream reached */ + NUTS_ERROR, /** Error occurred */ + } status_t; + + protected: + + /** Formal constructor */ + NutStream() {} + + public: + + /** + * \brief Get one character from current position + * + * The method provides character from current position + * in the data store. + * The position is not shifted (see \ref readChar for + * current character consumption). + * + * The operation is synchronous (the call blocks if necessary). + * + * \param[out] ch Character + * + * \retval NUTS_OK on success, + * \retval NUTS_EOF on end of stream, + * \retval NUTS_ERROR on read error + */ + virtual status_t getChar(char & ch) = 0; + + /** + * \brief Consume current character + * + * The method shifts position in the stream. + * It shall never block (if the position gets + * past-the-end of currently available data, + * subsequent call to \ref getChar will block). + */ + virtual void readChar() = 0; + + /** + * \brief Read characters from the stream till EoF + * + * The method may be used to synchronously read + * whole (rest of) stream. + * Note that implementation may block flow. + * + * \retval NUTS_OK on success, + * \retval NUTS_ERROR on read error + */ + virtual status_t getString(std::string & str) = 0; + + /** + * \brief Put one character to the stream end + * + * \param[in] ch Character + * + * \retval NUTS_OK on success, + * \retval NUTS_ERROR on write error + */ + virtual status_t putChar(char ch) = 0; + + /** + * \brief Put string to the stream end + * + * \param[in] str String + * + * \retval NUTS_OK on success, + * \retval NUTS_ERROR on write error + */ + virtual status_t putString(const std::string & str) = 0; + + /** + * \brief Put data to the stream end + * + * The difference between \ref putString and this method + * is that it is able to serialize also data containing + * null characters. + * + * \param[in] data Data + * + * \retval NUTS_OK on success, + * \retval NUTS_ERROR on write error + */ + virtual status_t putData(const std::string & data) = 0; + + /** + * \brief Flush output buffers for the stream being written + * + * \param[out] err_code Error code + * \param[out] err_msg Error message + * + * \retval true if flush succeeded + * \retval false if flush failed + */ + virtual bool flush(int & err_code, std::string & err_msg) +#if (defined __cplusplus) && (__cplusplus < 201100) + throw() +#endif + = 0; + + /** + * \brief Flush output buffers for the stream being written + * + * \retval true if flush succeeded + * \retval false if flush failed + */ + virtual bool flush() +#if (defined __cplusplus) && (__cplusplus < 201100) + throw() +#endif + = 0; + + /** Flush output buffers for the file (or throw exception) */ + virtual void flushx() +#if (defined __cplusplus) && (__cplusplus < 201100) + throw(std::runtime_error) +#endif + = 0; + + /** Formal destructor */ + virtual ~NutStream(); + +}; // end of class NutStream + + +/** Memory stream */ +class NutMemory: public NutStream { + private: + + /** Implementation */ + std::string m_impl; + + /** Position in implementation */ + size_t m_pos; + + public: + + /** Constructor */ + NutMemory(): m_pos(0) {} + + /** + * \brief Constructor + * + * \param str Init value + */ + NutMemory(const std::string & str): m_impl(str), m_pos(0) {} + + // NutStream interface implementation + status_t getChar(char & ch) override; + void readChar() override; + status_t getString(std::string & str) override; + status_t putChar(char ch) override; + status_t putString(const std::string & str) override; + status_t putData(const std::string & data) override; + + // No-op for this class: + inline bool flush (int & err_code, std::string & err_msg) override { + NUT_UNUSED_VARIABLE(err_code); + NUT_UNUSED_VARIABLE(err_msg); + return true; + } + inline bool flush() override {return true;} + inline void flushx() override {} +}; // end of class NutMemory + + +/** File stream */ +class NutFile: public NutStream { + public: + + /** Access mode */ + typedef enum { + /** Read-only, initial pos. is at the beginning */ + READ_ONLY = 0, + + /** Write-only, with creation, clears the file if exists */ + WRITE_ONLY, + + /** Read-write, initial pos. is at the beginning */ + READ_WRITE, + + /** As previous, but with creation, clears the file if exists */ + READ_WRITE_CLEAR, + + /** Read & write to end, with creation, init. pos: beginning/end for r/w */ + READ_APPEND, + + /** Write only, with creation, initial position is at the end */ + APPEND_ONLY, + } access_t; + + /** Unnamed temp. file constructor flag */ + typedef enum { + ANONYMOUS, /** Anonymous temp. file flag */ + } anonymous_t; + + private: + + /** Temporary files directory */ + static const std::string m_tmp_dir; + + /** File name */ + const std::string m_name; + + /** Implementation */ + FILE *m_impl; + + /** Current character cache */ + char m_current_ch; + + /** Current character cache status */ + bool m_current_ch_valid; + + /** + * \brief Convert enum access_t mode values to strings + * for standard library methods + * + * Throws an exception on unexpected input (should never + * happen with proper enum usage). + * + * \return Non-null "const char *" string + */ + const char *strAccessMode(access_t mode) +#if (defined __cplusplus) && (__cplusplus < 201100) + throw(std::runtime_error) +#endif + ; + + public: + + /** Constructor + * + * \param[in] name File name + */ + NutFile(const std::string & name): + m_name(name), + m_impl(nullptr), + m_current_ch('\0'), + m_current_ch_valid(false) {} + + /** + * \brief Temporary file constructor (with open) + * + * Anonymous temp. file (with automatic destruction) will be created. + */ + NutFile(anonymous_t); + + /** + * \brief Detected temporary path name getter + * + * \return Path name + */ + inline static const std::string & tmp_dir() { + return m_tmp_dir; + } + + /** + * \brief OS-dependent path separator character(s) + * + * \return Path separator + */ + inline static const std::string & path_sep() { + static std::string pathsep = +#ifdef WIN32 + "\\"; +#else + "/"; +#endif + return pathsep; + } + + /** + * \brief File name getter + * + * \return File name + */ + inline const std::string & name() const { + return m_name; + } + + /** + * \brief Check whether file exists + * + * \param[out] err_code Error code + * \param[out] err_msg Error message + * + * \retval true IFF the file exists + * \retval false otherwise + */ + bool exists(int & err_code, std::string & err_msg) const +#if (defined __cplusplus) && (__cplusplus < 201100) + throw() +#endif + ; + + /** + * \brief Check whether file exists + * + * \retval true IFF the file exists + * \retval false otherwise + */ + inline bool exists() const +#if (defined __cplusplus) && (__cplusplus < 201100) + throw() +#endif + { + int ec; + std::string em; + + return exists(ec, em); + } + + /** + * \brief Check whether file exists (or throw exception) + * + * \retval true IFF the file exists + * \retval false otherwise + */ + inline bool existsx() const +#if (defined __cplusplus) && (__cplusplus < 201100) + throw(std::runtime_error) +#endif + { + int ec; + std::string em; + + if (exists(ec, em)) + return true; + + if (ENOENT == ec || ENOTDIR == ec) + return false; + + std::stringstream e; + e << "Failed to check file " << m_name << " existence: " << ec << ": " << em; + + throw std::runtime_error(e.str()); + } + + /** + * \brief Open file + * + * \param[in] mode File open mode + * \param[out] err_code Error code + * \param[out] err-msg Error message + * + * \retval true if open succeeded + * \retval false if open failed + */ + bool open(access_t mode, int & err_code, std::string & err_msg) +#if (defined __cplusplus) && (__cplusplus < 201100) + throw() +#endif + ; + + /** + * \brief Open file + * + * \param[in] mode File open mode (read-only by default) + * + * \retval true if open succeeded + * \retval false if open failed + */ + inline bool open(access_t mode = READ_ONLY) { + int ec; + std::string em; + + return open(mode, ec, em); + } + + /** + * \brief Open file (or throw exception) + * + * \param[in] mode File open mode (read-only by default) + * + * \retval true if open succeeded + * \retval false if open failed + */ + inline void openx(access_t mode = READ_ONLY) +#if (defined __cplusplus) && (__cplusplus < 201100) + throw(std::runtime_error) +#endif + { + int ec; + std::string em; + + if (open(mode, ec, em)) + return; + + std::stringstream e; + e << "Failed to open file " << m_name << ": " + << ec << ": " << em; + + throw std::runtime_error(e.str()); + } + + /** + * \brief Flush output buffers for the file + * + * \param[out] err_code Error code + * \param[out] err_msg Error message + * + * \retval true if flush succeeded + * \retval false if flush failed + */ + bool flush(int & err_code, std::string & err_msg) override +#if (defined __cplusplus) && (__cplusplus < 201100) + throw() +#endif + ; + + /** + * \brief Flush output buffers for the file + * + * \retval true if flush succeeded + * \retval false if flush failed + */ + inline bool flush() override +#if (defined __cplusplus) && (__cplusplus < 201100) + throw() +#endif + { + int ec; + std::string em; + + return flush(ec, em); + } + + /** Flush output buffers for the file (or throw exception) */ + inline void flushx() override +#if (defined __cplusplus) && (__cplusplus < 201100) + throw(std::runtime_error) +#endif + { + int ec; + std::string em; + + if (flush(ec, em)) + return; + + std::stringstream e; + e << "Failed to flush file " << m_name << ": " << ec << ": " << em; + + throw std::runtime_error(e.str()); + } + + /** + * \brief Close file + * + * \param[out] err_code Error code + * \param[out] err_msg Error message + * + * \retval true if close succeeded + * \retval false if close failed + */ + bool close(int & err_code, std::string & err_msg) +#if (defined __cplusplus) && (__cplusplus < 201100) + throw() +#endif + ; + + /** + * \brief Close file + * + * \retval true if close succeeded + * \retval false if close failed + */ + inline bool close() +#if (defined __cplusplus) && (__cplusplus < 201100) + throw() +#endif + { + int ec; + std::string em; + + return close(ec, em); + } + + /** Close file (or throw exception) */ + inline void closex() +#if (defined __cplusplus) && (__cplusplus < 201100) + throw(std::runtime_error) +#endif + { + int ec; + std::string em; + + if (close(ec, em)) + return; + + std::stringstream e; + e << "Failed to close file " << m_name << ": " << ec << ": " << em; + + throw std::runtime_error(e.str()); + } + + /** + * \brief Remove file + * + * \param[out] err_code Error code + * \param[out] err-msg Error message + * + * \retval true if \c unlink succeeded + * \retval false if \c unlink failed + */ + bool remove(int & err_code, std::string & err_msg) +#if (defined __cplusplus) && (__cplusplus < 201100) + throw() +#endif + ; + + /** + * \brief Remove file + * + * \retval true if \c unlink succeeded + * \retval false if \c unlink failed + */ + inline bool remove() +#if (defined __cplusplus) && (__cplusplus < 201100) + throw() +#endif + { + int ec; + std::string em; + + return remove(ec, em); + } + + /** Remove file (or throw exception) */ + inline void removex() +#if (defined __cplusplus) && (__cplusplus < 201100) + throw(std::runtime_error) +#endif + { + int ec; + std::string em; + + if (remove(ec, em)) + return; + + std::stringstream e; + e << "Failed to remove file " << m_name << ": " << ec << ": " << em; + + throw std::runtime_error(e.str()); + } + + /** + * \brief Constructor (with open) + * + * Opens the file, throws exception on open error. + * + * \param[in] name File name + * \param[in] mode File open mode + */ + NutFile(const std::string & name, access_t mode); + + /** + * \brief Temporary file constructor (with open) + * + * Opens file in \ref m_tmp_dir. + * Throws exception on open error. + * Note that for temporary files, non-creation modes + * don't make sense (and will result in throwing an exception). + * + * \param[in] name File name + * \param[in] mode File open mode (r/w by default) + */ + NutFile(access_t mode = READ_WRITE_CLEAR); + + // NutStream interface implementation + status_t getChar(char & ch) +#if (defined __cplusplus) && (__cplusplus < 201100) + throw() +#endif + override; + + void readChar() +#if (defined __cplusplus) && (__cplusplus < 201100) + throw() +#endif + override; + + status_t getString(std::string & str) +#if (defined __cplusplus) && (__cplusplus < 201100) + throw() +#endif + override; + + status_t putChar(char ch) +#if (defined __cplusplus) && (__cplusplus < 201100) + throw() +#endif + override; + + status_t putString(const std::string & str) +#if (defined __cplusplus) && (__cplusplus < 201100) + throw() +#endif + override; + + status_t putData(const std::string & data) +#if (defined __cplusplus) && (__cplusplus < 201100) + throw() +#endif + override; + + /** Destructor (closes the file) */ + ~NutFile() override; + + private: + + /** + * \brief Copy constructor + * + * TODO: Copying is forbidden (for now). + * If required, it may be enabled, using fdup. + * + * \param orig Original file + */ + NutFile(const NutFile & orig) +#if (defined __cplusplus) && (__cplusplus >= 201100) + __attribute__((noreturn)) +#endif + { + NUT_UNUSED_VARIABLE(orig); + throw std::logic_error("NOT IMPLEMENTED"); + } + + /** + * \brief Assignment + * + * TODO: Assignment is forbidden (for now). + * See copy constructor for implementation notes + * (and don't forget to destroy left value, properly). + * + * \param rval Right value + */ + NutFile & operator = (const NutFile & rval) +#if (defined __cplusplus) && (__cplusplus >= 201100) + __attribute__((noreturn)) +#endif + { + NUT_UNUSED_VARIABLE(rval); + throw std::logic_error("NOT IMPLEMENTED"); + } + +}; // end of class NutFile + + +/** Socket stream */ +class NutSocket: public NutStream { + public: + + /** Socket domain */ + typedef enum { + NUTSOCKD_UNIX = AF_UNIX, /** Unix */ + NUTSOCKD_INETv4 = AF_INET, /** IPv4 */ + NUTSOCKD_INETv6 = AF_INET6, /** IPv6 */ + NUTSOCKD_UNDEFINED = -1 + } domain_t; + + /** Socket type */ + typedef enum { + NUTSOCKT_STREAM = SOCK_STREAM, /** Stream */ + NUTSOCKT_DGRAM = SOCK_DGRAM, /** Datagram */ + NUTSOCKT_UNDEFINED = -1 + } type_t; + + /** Socket protocol */ + typedef enum { + NUTSOCKP_IMPLICIT = 0, /** Implicit protocol for chosen type */ + } proto_t; + + /** Socket address */ + class Address { + friend class NutSocket; + + private: + + /** Implementation */ + struct sockaddr *m_sock_addr; + + /** Length */ + socklen_t m_length; + + /** + * \brief Invalid address constructor + * + * Invalid address may be produced e.g. by failed DNS resolving. + */ + Address(): m_sock_addr(nullptr), m_length(0) {} + + /** + * \brief Initialize UNIX socket address + * + * \param addr UNIX socket address + * \param path Pathname + */ + static void init_unix(Address & addr, const std::string & path); + + /** + * \brief Initialize IPv4 address + * + * \param addr IPv4 address + * \param qb Byte quadruplet (MSB is at index 0) + * \param port Port number + */ + static void init_ipv4(Address & addr, const std::vector & qb, uint16_t port); + + /** + * \brief Initialize IPv6 address + * + * \param addr IPv6 address + * \param hb 16 bytes of the address (MSB is at index 0) + * \param port Port number + */ + static void init_ipv6(Address & addr, const std::vector & hb, uint16_t port); + + public: + + /** + * \brief Check address validity + * + * \retval true if the address is valid + * \retval false otherwise + */ + inline bool valid() +#if (defined __cplusplus) && (__cplusplus < 201100) + throw() +#endif + { + return nullptr != m_sock_addr; + } + + /** + * \brief UNIX socket address constructor + * + * \param path Pathname + */ + Address(const std::string & path) { + init_unix(*this, path); + } + + /** + * \brief IPv4 address constructor + * + * \param msb Most significant byte + * \param msb2 Second most significant byte + * \param lsb2 Second least significant byte + * \param lsb Least significant byte + * \param port Port number + */ + Address(unsigned char msb, + unsigned char msb2, + unsigned char lsb2, + unsigned char lsb, + uint16_t port); + + /** + * \brief IP address constructor + * + * Creates either IPv4 or IPv6 address (depending on + * how many bytes are provided via the \c bytes argument). + * Throws an exception if the byte-count is invalid. + * + * \param bytes 4 or 16 address bytes (MSB is at index 0) + * \param port Port number + */ + Address(const std::vector & bytes, uint16_t port) +#if (defined __cplusplus) && (__cplusplus < 201100) + throw(std::logic_error) +#endif + ; + + /** + * \brief Copy constructor + * + * \param orig Original address + */ + Address(const Address & orig); + + /** + * \brief Stringifisation + * + * \return String representation of the address + */ + std::string str() const; + + /** Stringification */ + inline operator std::string() const { + return str(); + } + + /** Destructor */ + ~Address(); + + }; // end of class Address + + /** Flag for socket constructor of accepted connection */ + typedef enum { + ACCEPT /** Accept flag */ + } accept_flag_t; + + private: + + /** Socket implementation */ + int m_impl; + domain_t m_domain; + type_t m_type; + + /** Current character cache */ + char m_current_ch; + + /** Current character cache status */ + bool m_current_ch_valid; + + /** + * \brief Accept client connection on a listen socket + * + * \param[out] sock Socket + * \param[in] listen_sock Listen socket + * \param[out] err_code Error code + * \param[out] err_msg Error message + * + * \retval true on success + * \retval false otherwise + */ + static bool accept( + NutSocket & sock, + const NutSocket & listen_sock, + int & err_code, + std::string & err_msg) +#if (defined __cplusplus) && (__cplusplus < 201100) + throw(std::logic_error) +#endif + ; + + /** + * \brief Accept client connection on a listen socket + * + * \param[out] sock Socket + * \param[in] listen_sock Listen socket + * + * \retval true on success + * \retval false otherwise + */ + inline static bool accept( + NutSocket & sock, + const NutSocket & listen_sock) +#if (defined __cplusplus) && (__cplusplus < 201100) + throw(std::logic_error) +#endif + { + int ec; + std::string em; + + return accept(sock, listen_sock, ec, em); + } + + /** + * \brief Accept client connection (or throw exception) + * + * \param[out] sock Socket + * \param[in] listen_sock Listen socket + */ + inline static void acceptx( + NutSocket & sock, + const NutSocket & listen_sock) +#if (defined __cplusplus) && (__cplusplus < 201100) + throw(std::logic_error, std::runtime_error) +#endif + { + int ec; + std::string em; + + if (accept(sock, listen_sock, ec, em)) + return; + + std::stringstream e; + e << "Failed to accept connection: " << ec << ": " << em; + + throw std::runtime_error(e.str()); + } + + public: + + /** + * \brief Socket valid check + * + * \retval true if the socket is initialized + * \retval false otherwise + */ + inline bool valid() +#if (defined __cplusplus) && (__cplusplus < 201100) + throw() +#endif + { + return -1 != m_impl; + } + + /** + * \brief Constructor + * + * \param dom Socket domain + * \param type Socket type + * \param proto Socket protocol + */ + NutSocket( + domain_t dom = NUTSOCKD_INETv4, + type_t type = NUTSOCKT_STREAM, + proto_t proto = NUTSOCKP_IMPLICIT); + + /** + * \brief Accepted client socket constructor + * + * Accepts connection on a listen socket. + * If the argument isn't a listen socket, exception is thrown. + * The call will block until either there's an incoming connection + * or the listening socket is closed or there's an error. + * + * \param listen_sock Listening socket + */ + NutSocket(accept_flag_t, const NutSocket & listen_sock, int & err_code, std::string & err_msg): + m_impl(-1), + m_domain(NUTSOCKD_UNDEFINED), + m_type(NUTSOCKT_UNDEFINED), + m_current_ch('\0'), + m_current_ch_valid(false) + { + accept(*this, listen_sock, err_code, err_msg); + } + + /** + * \brief Accepted client socket constructor + * + * Accepts connection on a listen socket. + * + * \param listen_sock Listening socket + */ + NutSocket(accept_flag_t, const NutSocket & listen_sock): + m_impl(-1), + m_domain(NUTSOCKD_UNDEFINED), + m_type(NUTSOCKT_UNDEFINED), + m_current_ch('\0'), + m_current_ch_valid(false) + { + accept(*this, listen_sock); + } + + /** + * \brief Bind socket to an address + * + * \param[in] addr Socket address + * \param[out] err_code Error code + * \param[out] err_msg Error message + * + * \retval true on success + * \retval false on error + */ + bool bind(const Address & addr, int & err_code, std::string & err_msg) +#if (defined __cplusplus) && (__cplusplus < 201100) + throw() +#endif + ; + + /** + * \brief Bind socket to an address + * + * \param addr Socket address + * + * \retval true on success + * \retval false on error + */ + inline bool bind(const Address & addr) +#if (defined __cplusplus) && (__cplusplus < 201100) + throw() +#endif + { + int ec; + std::string em; + + return bind(addr, ec, em); + } + + /** + * \brief Bind socket to an address (or throw exception) + * + * \param addr Socket address + */ + inline void bindx(const Address & addr) +#if (defined __cplusplus) && (__cplusplus < 201100) + throw(std::runtime_error) +#endif + { + int ec; + std::string em; + + if (bind(addr, ec, em)) + return; + + std::stringstream e; + e << "Failed to bind socket to address " << addr.str() << ": " << ec << ": " << em; + + throw std::runtime_error(e.str()); + } + + /** + * \brief Listen on a socket + * + * The function sets TCP listen socket. + * + * \param[in] backlog Limit of pending connections + * \param[out] err_code Error code + * \param[out] err_msg Error message + * + * \retval true on success + * \retval false on error + */ + bool listen(int backlog, int & err_code, std::string & err_msg) +#if (defined __cplusplus) && (__cplusplus < 201100) + throw() +#endif + ; + + /** + * \brief Listen on socket + * + * \param[in] backlog Limit of pending connections + * + * \retval true on success + * \retval false on error + */ + inline bool listen(int backlog) +#if (defined __cplusplus) && (__cplusplus < 201100) + throw() +#endif + { + int ec; + std::string em; + + return listen(backlog, ec, em); + } + + /** + * \brief Listen on socket (or throw an exception) + * + * \param[in] backlog Limit of pending connections + */ + inline void listenx(int backlog) +#if (defined __cplusplus) && (__cplusplus < 201100) + throw(std::runtime_error) +#endif + { + int ec; + std::string em; + + if (listen(backlog, ec, em)) + return; + + std::stringstream e; + e << "Failed to listen on socket: " << ec << ": " << em; + + throw std::runtime_error(e.str()); + } + + /** + * \brief Connect to a listen socket + * + * \param[in] addr Remote address + * \param[out] err_code Error code + * \param[out] err_msg Error message + * + * \retval true on success + * \retval false on error + */ + bool connect(const Address & addr, int & err_code, std::string & err_msg) +#if (defined __cplusplus) && (__cplusplus < 201100) + throw() +#endif + ; + + /** + * \brief Connect to a listen socket + * + * \param[in] addr Remote address + * + * \retval true on success + * \retval false on error + */ + inline bool connect(const Address & addr) +#if (defined __cplusplus) && (__cplusplus < 201100) + throw() +#endif + { + int ec; + std::string em; + + return connect(addr, ec, em); + } + + /** + * \brief Connect to a listen socket (or throw an exception) + * + * \param[in] addr Remote address + */ + inline void connectx(const Address & addr) +#if (defined __cplusplus) && (__cplusplus < 201100) + throw(std::runtime_error) +#endif + { + int ec; + std::string em; + + if (connect(addr, ec, em)) + return; + + std::stringstream e; + e << "Failed to connect socket: " << ec << ": " << em; + + throw std::runtime_error(e.str()); + } + + /** + * \brief Flush output data into socket + * + * \param[out] err_code Error code + * \param[out] err-msg Error message + * + * \retval true if flush succeeded + * \retval false if flush failed + */ + bool flush(int & err_code, std::string & err_msg) +#if (defined __cplusplus) && (__cplusplus < 201100) + throw() +#endif + override; + + /** + * \brief Flush output data into socket + * + * \retval true if flush succeeded + * \retval false if flush failed + */ + inline bool flush() override +#if (defined __cplusplus) && (__cplusplus < 201100) + throw() +#endif + { + int ec; + std::string em; + + return flush(ec, em); + } + + /** Flush output data into socket (or throw exception) */ + inline void flushx() override +#if (defined __cplusplus) && (__cplusplus < 201100) + throw(std::runtime_error) +#endif + { + int ec; + std::string em; + + if (flush(ec, em)) + return; + + std::stringstream e; + e << "Failed to flush socket " << m_impl << ": " << ec << ": " << em; + + throw std::runtime_error(e.str()); + } + + /** + * \brief Close socket + * + * \param[out] err_code Error code + * \param[out] err-msg Error message + * + * \retval true if close succeeded + * \retval false if close failed + */ + bool close(int & err_code, std::string & err_msg) +#if (defined __cplusplus) && (__cplusplus < 201100) + throw() +#endif + ; + + /** + * \brief Close socket + * + * \retval true if close succeeded + * \retval false if close failed + */ + inline bool close() +#if (defined __cplusplus) && (__cplusplus < 201100) + throw() +#endif + { + int ec; + std::string em; + + return close(ec, em); + } + + /** Close socket (or throw exception) */ + inline void closex() +#if (defined __cplusplus) && (__cplusplus < 201100) + throw(std::runtime_error) +#endif + { + int ec; + std::string em; + + if (close(ec, em)) + return; + + std::stringstream e; + e << "Failed to close socket " << m_impl << ": " << ec << ": " << em; + + throw std::runtime_error(e.str()); + } + + // NutStream interface implementation + status_t getChar(char & ch) +#if (defined __cplusplus) && (__cplusplus < 201100) + throw() +#endif + override; + + void readChar() +#if (defined __cplusplus) && (__cplusplus < 201100) + throw() +#endif + override; + + status_t getString(std::string & str) +#if (defined __cplusplus) && (__cplusplus < 201100) + throw() +#endif + override; + + status_t putChar(char ch) +#if (defined __cplusplus) && (__cplusplus < 201100) + throw() +#endif + override; + + status_t putString(const std::string & str) +#if (defined __cplusplus) && (__cplusplus < 201100) + throw() +#endif + override; + + + inline status_t putData(const std::string & data) override { + return putString(data); // no difference on sockets + } + + /** Destructor (closes socket if necessary) */ + ~NutSocket() override; + + private: + + /** + * \brief Copy constructor + * + * TODO: Copying is forbidden (for now). + * If required, it may be enabled, using dup. + * + * \param orig Original file + */ + NutSocket(const NutSocket & orig) +#if (defined __cplusplus) && (__cplusplus >= 201100) + __attribute__((noreturn)) +#endif + { + NUT_UNUSED_VARIABLE(orig); + throw std::logic_error("NOT IMPLEMENTED"); + } + + /** + * \brief Assignment + * + * TODO: Assignment is forbidden (for now). + * See copy constructor for implementation notes + * (and don't forget to destroy left value, properly). + * + * \param rval Right value + */ + NutSocket & operator = (const NutSocket & rval) { + NUT_UNUSED_VARIABLE(rval); + throw std::logic_error("NOT IMPLEMENTED"); + } + +}; // end of class NutSocket + +} // end of namespace nut + +#endif /* __cplusplus */ + +#endif /* end of #ifndef nut_nutstream_h */ diff --git a/include/nutwriter.hpp b/include/nutwriter.hpp new file mode 100644 index 0000000000..b04c44acbb --- /dev/null +++ b/include/nutwriter.hpp @@ -0,0 +1,410 @@ +/* + nutwriter.hpp - NUT writer + + Copyright (C) + 2012 Vaclav Krpec + + 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 +*/ + +#ifndef nut_nutwriter_h +#define nut_nutwriter_h + +#ifdef __cplusplus + +#include "nutstream.hpp" +#include "nutconf.hpp" + +#include + + +namespace nut +{ + +/** + * \brief NUT stream writer + */ +class NutWriter { + public: + + /** NUT writer status */ + typedef enum { + NUTW_OK = 0, /** Writing successful */ + NUTW_ERROR, /** Writing failed */ + } status_t; // end of typedef enum */ + + protected: + + /** EoL separator */ + static const std::string & eol; + + /** Output stream (by reference) */ + NutStream & m_output_stream; + + public: + + /** + * \brief Constructor + * + * Creates the writer. + * The \c ostream parameter provides the writer reference + * to an existing output stream; note that the stream + * must exist throughout whole the writer's life. + * + * TBD: + * The stream might actually be passed either by value + * (\c NutStream implementations would have to support + * copying, though, which is not implemented at the moment) + * or using reference counting mechanism (smart pointers etc). + * The latter is perhaps a better choice (if the stream existence + * dependency is a considerable issue). + * + * \param ostream Output stream + */ + NutWriter(NutStream & ostream): m_output_stream(ostream) {} + + /** + * \brief Write to output stream + * + * The method writes the provided string to the output stream. + * + * \retval NUTW_OK on success + * \retval NUTW_ERROR otherwise + */ + inline status_t write(const std::string & str) { + NutStream::status_t status = m_output_stream.putString(str); + + return NutStream::NUTS_OK == status ? NUTW_OK : NUTW_ERROR; + } + + /** + * \brief Write to output stream + * + * The method writes the provided string to the output stream. + * An exception is thrown on error. + */ + inline void writex(const std::string & str) { + NutStream::status_t status = m_output_stream.putString(str); + + if (NutStream::NUTS_OK != status) { + std::stringstream e; + e << "Failed to write to output stream: " << status; + + throw std::runtime_error(e.str()); + } + } + + protected: + + /** + * \brief Write (prefixed) lines + * + * The method splits string to lines (by EoL) and prefix them + * with specified string upon writing. + * + * \param str String (multi-line) + * \param pref Prefix + * + * \retval NUTW_OK on success + * \retval NUTW_ERROR otherwise + */ + status_t writeEachLine(const std::string & str, const std::string & pref); + +}; // end of class NutWriter + + +/** + * \brief NUT configuration writer interface + */ +class NutConfigWriter: public NutWriter { + protected: + + /** Formal constructor */ + NutConfigWriter(NutStream & ostream): NutWriter(ostream) {} + + public: + + /** + * \brief Write comment + * + * \param str Comment string + * + * \retval NUTW_OK on success + * \retval NUTW_ERROR otherwise + */ + virtual status_t writeComment(const std::string & str) = 0; + + /** + * \brief Write section name + * + * \param name Section name + * + * \retval NUTW_OK on success + * \retval NUTW_ERROR otherwise + */ + virtual status_t writeSectionName(const std::string & name) = 0; + + /** + * \brief Write directive + * + * \param str Directive string + * + * \retval NUTW_OK on success + * \retval NUTW_ERROR otherwise + */ + virtual status_t writeDirective(const std::string & str) = 0; + + /** Virtual destructor */ + virtual ~NutConfigWriter(); + +}; // end of class NutConfigWriter + + +/** + * \brief NUT section-less configuration writer specialization + * + * Partial implementation of \ref NutConfigWriter for section-less + * configuration files. + */ +class SectionlessConfigWriter: public NutConfigWriter { + protected: + + /** + * \brief Constructor + * + * \param ostream Output stream + */ + SectionlessConfigWriter(NutStream & ostream): NutConfigWriter(ostream) {} + + public: + + // Partial \ref NutConfigWriter interface implementation + status_t writeDirective(const std::string & str) override; + status_t writeComment(const std::string & str) override; + + private: + + // Section name writing is forbidden (no sections) + status_t writeSectionName(const std::string & name) override; + +}; // end of class SectionlessConfigWriter + + +/** + * \brief \c nut.conf configuration file serializer + */ +class NutConfConfigWriter: public SectionlessConfigWriter { + public: + + /** + * \brief Constructor + * + * \param ostream Output stream + */ + NutConfConfigWriter(NutStream & ostream): SectionlessConfigWriter(ostream) {} + + /** + * \brief Serialize configuration container + * + * \param config Configuration + * + * \retval NUTW_OK on success + * \retval NUTW_ERROR otherwise + */ + status_t writeConfig(const NutConfiguration & config); + + /* Ensure an out-of-line method to avoid "weak-vtables" warning */ + virtual ~NutConfConfigWriter() override; +}; // end of class NutConfConfigWriter + + +/** + * \brief \c upsmon.conf configuration file serializer + */ +class UpsmonConfigWriter: public SectionlessConfigWriter { + public: + + /** + * \brief Constructor + * + * \param ostream Output stream + */ + UpsmonConfigWriter(NutStream & ostream): SectionlessConfigWriter(ostream) {} + + /** + * \brief Serialize configuration container + * + * \param config Configuration + * + * \retval NUTW_OK on success + * \retval NUTW_ERROR otherwise + */ + status_t writeConfig(const UpsmonConfiguration & config); + + /* Ensure an out-of-line method to avoid "weak-vtables" warning */ + virtual ~UpsmonConfigWriter() override; +}; // end of class UpsmonConfigWriter + + +/** + * \brief \c upsd.conf configuration file serializer + */ +class UpsdConfigWriter: public SectionlessConfigWriter { + public: + + /** + * \brief Constructor + * + * \param ostream Output stream + */ + UpsdConfigWriter(NutStream & ostream): SectionlessConfigWriter(ostream) {} + + /** + * \brief Serialize configuration container + * + * \param config Configuration + * + * \retval NUTW_OK on success + * \retval NUTW_ERROR otherwise + */ + status_t writeConfig(const UpsdConfiguration & config); + + /* Ensure an out-of-line method to avoid "weak-vtables" warning */ + virtual ~UpsdConfigWriter() override; +}; // end of class UpsdConfigWriter + + +/** + * \brief NUT default configuration writer ancestor + * + * Implements the \ref NutConfigWriter interface + * and adds \c writeSection prototype to be implemented + * by descendants. + */ +class DefaultConfigWriter: public NutConfigWriter { + protected: + + /** + * \brief Constructor + * + * \param ostream Output stream + */ + DefaultConfigWriter(NutStream & ostream): NutConfigWriter(ostream) {} + + public: + + // \ref NutConfigWriter interface implementation + status_t writeComment(const std::string & str) override; + status_t writeSectionName(const std::string & name) override; + status_t writeDirective(const std::string & str) override; + + /** + * \brief Write configuration section + * + * Serialize generic configuration section. + * + * \param section Configuration section + * + * \retval NUTW_OK on success + * \retval NUTW_ERROR otherwise + */ + virtual status_t writeSection(const GenericConfigSection & section) = 0; + +}; // end of class DefaultConfigWriter + + +/** + * \brief NUT generic configuration writer + * + * Base configuration file serializer. + * Implements the \ref DefaultConfigWriter \c writeSection method + * and adds \c writeConfig routine for configuration file serialization. + */ +class GenericConfigWriter: public DefaultConfigWriter { + protected: + + /** Default indentation of the key/value pair in section entry */ + static const std::string s_default_section_entry_indent; + + /** Default separator of the key/value pair in section entry */ + static const std::string s_default_section_entry_separator; + + /** + * \brief Section entry serializer + * + * \param entry Section entry + * \param indent Indentation + * \param kv_sep Key/value separator + * + * \retval NUTW_OK on success + * \retval NUTW_ERROR otherwise + */ + status_t writeSectionEntry( + const GenericConfigSectionEntry & entry, + const std::string & indent = s_default_section_entry_indent, + const std::string & kv_sep = s_default_section_entry_separator); + + public: + + /** + * \brief Constructor + * + * \param ostream Output stream + */ + GenericConfigWriter(NutStream & ostream): DefaultConfigWriter(ostream) {} + + // Section serializer implementation + status_t writeSection(const GenericConfigSection & section) override; + + /** + * \brief Base configuration serializer + * + * \param config Base configuration + * + * \retval NUTW_OK on success + * \retval NUTW_ERROR otherwise + */ + status_t writeConfig(const GenericConfiguration & config); + +}; // end of class GenericConfigWriter + + +/** + * \brief NUT upsd.users configuration file writer + * + * upsd.users configuration file serializer. + * Overloads the generic section serializer because of the upsmon section, + * which contains an anomalous upsmon (master|slave) directive. + */ +class UpsdUsersConfigWriter: public GenericConfigWriter { + public: + + /** + * \brief Constructor + * + * \param ostream Output stream + */ + UpsdUsersConfigWriter(NutStream & ostream): GenericConfigWriter(ostream) {} + + // Section serializer overload + status_t writeSection(const GenericConfigSection & section) override; + +}; // end of class UpsdUsersConfigWriter + +} // end of namespace nut + +#endif /* __cplusplus */ + +#endif /* end of #ifndef nut_nutwriter_h */ diff --git a/include/proto.h b/include/proto.h index 8c7ef1ae00..f88dd61f1c 100644 --- a/include/proto.h +++ b/include/proto.h @@ -64,6 +64,12 @@ extern "C" { # endif #endif +#ifdef __cplusplus +/* *INDENT-OFF* */ +extern "C" { +/* *INDENT-ON* */ +#endif + #if !defined (HAVE_SNPRINTF) || defined (__Lynx__) int snprintf (char *str, size_t count, const char *fmt, ...) __attribute__ ((__format__ (__printf__, 3, 4))); diff --git a/lib/Makefile.am b/lib/Makefile.am index 5e1478dfe8..7d272d8de6 100644 --- a/lib/Makefile.am +++ b/lib/Makefile.am @@ -1,4 +1,14 @@ # Network UPS Tools: lib + +# Export certain values for ccache which NUT ci_build.sh can customize, +# to facilitate developer iteration re-runs of "make" later. +# At least GNU and BSD make implementations are okay with this syntax. +@NUT_AM_MAKE_CAN_EXPORT@export CCACHE_NAMESPACE=@CCACHE_NAMESPACE@ +@NUT_AM_MAKE_CAN_EXPORT@export CCACHE_BASEDIR=@CCACHE_BASEDIR@ +@NUT_AM_MAKE_CAN_EXPORT@export CCACHE_DIR=@CCACHE_DIR@ +@NUT_AM_MAKE_CAN_EXPORT@export CCACHE_PATH=@CCACHE_PATH@ +@NUT_AM_MAKE_CAN_EXPORT@export PATH=@PATH_DURING_CONFIGURE@ + EXTRA_DIST = README.adoc if WITH_DEV diff --git a/lib/libnutclientstub.pc.in b/lib/libnutclientstub.pc.in index b730a63054..0f8921b9f8 100644 --- a/lib/libnutclientstub.pc.in +++ b/lib/libnutclientstub.pc.in @@ -7,7 +7,7 @@ statepath=@STATEPATH@ nutuser=@RUN_AS_USER@ Name: libnutclientstub -Description: Stub for UPS monitoring with Network UPS Tools +Description: Stub for UPS monitoring with Network UPS Tools (primarily for C++ tests) Version: @PACKAGE_VERSION@ Libs: -L${libdir} -lnutclientstub Cflags: -I${includedir} diff --git a/m4/ax_c_pragmas.m4 b/m4/ax_c_pragmas.m4 index 09e5ec0763..f2cf78f676 100644 --- a/m4/ax_c_pragmas.m4 +++ b/m4/ax_c_pragmas.m4 @@ -161,6 +161,21 @@ dnl ### [CFLAGS="${CFLAGS_SAVED} -Werror=pragmas -Werror=unknown-warning" AC_DEFINE([HAVE_PRAGMA_GCC_DIAGNOSTIC_IGNORED_UNUSED_FUNCTION], 1, [define if your compiler has #pragma GCC diagnostic ignored "-Wunused-function"]) ]) + AC_CACHE_CHECK([for pragma GCC diagnostic ignored "-Wdeprecated-declarations"], + [ax_cv__pragma__gcc__diags_ignored_deprecated_declarations], + [AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM([[void func(void) { +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" +} +]], [])], + [ax_cv__pragma__gcc__diags_ignored_deprecated_declarations=yes], + [ax_cv__pragma__gcc__diags_ignored_deprecated_declarations=no] + )] + ) + AS_IF([test "$ax_cv__pragma__gcc__diags_ignored_deprecated_declarations" = "yes"],[ + AC_DEFINE([HAVE_PRAGMA_GCC_DIAGNOSTIC_IGNORED_DEPRECATED_DECLARATIONS], 1, [define if your compiler has #pragma GCC diagnostic ignored "-Wdeprecated-declarations"]) + ]) + AC_CACHE_CHECK([for pragma GCC diagnostic ignored "-Wformat-nonliteral"], [ax_cv__pragma__gcc__diags_ignored_format_nonliteral], [AC_COMPILE_IFELSE( diff --git a/m4/nut_check_asciidoc.m4 b/m4/nut_check_asciidoc.m4 index 6ae8e20236..4d5da5805c 100644 --- a/m4/nut_check_asciidoc.m4 +++ b/m4/nut_check_asciidoc.m4 @@ -15,9 +15,13 @@ AC_DEFUN([NUT_CHECK_ASCIIDOC], [ if test -z "${nut_have_asciidoc_seen}"; then nut_have_asciidoc_seen=yes - # Note: this is for both asciidoc and a2x at this time - ASCIIDOC_MIN_VERSION="8.6.3" - # Note: this is checked in the configure script if PDF is of interest at all + dnl # Note: this is typically same for both asciidoc and a2x: + dnl # most systems nowadays (2023) have both at 8.6.3 or newer. + dnl # Slackware 15 has asciidoc-8.1.0 and a2x-1.0.0 served in + dnl # a side-project repository... + ASCIIDOC_MIN_VERSION="8.1.0" + A2X_MIN_VERSION="1.0.0" + dnl # Note: this is checked in the configure script if PDF is of interest at all DBLATEX_MIN_VERSION="0.2.5" AC_PATH_PROGS([ASCIIDOC], [asciidoc]) @@ -88,8 +92,8 @@ if test -z "${nut_have_asciidoc_seen}"; then nut_have_asciidoc="no" ]) - AC_MSG_CHECKING([if a2x version can build manpages (minimum required ${ASCIIDOC_MIN_VERSION})]) - AX_COMPARE_VERSION([${A2X_VERSION}], [ge], [${ASCIIDOC_MIN_VERSION}], [ + AC_MSG_CHECKING([if a2x version can build manpages (minimum required ${A2X_MIN_VERSION})]) + AX_COMPARE_VERSION([${A2X_VERSION}], [ge], [${A2X_MIN_VERSION}], [ AC_MSG_RESULT(yes) ], [ AC_MSG_RESULT(no) diff --git a/m4/nut_check_aspell.m4 b/m4/nut_check_aspell.m4 index 4fb7feaa9f..dbccd27878 100644 --- a/m4/nut_check_aspell.m4 +++ b/m4/nut_check_aspell.m4 @@ -35,6 +35,13 @@ if test -z "${nut_have_aspell_seen}"; then ASPELL_VERSION_MINMAJ="`echo "${ASPELL_VERSION}" | sed 's,\.@<:@0-9@:>@@<:@0-9@:>@*$,,'`" + dnl FIXME: Some systems have more complicated layouts, e.g. + dnl /usr/lib/amd64/aspell-0.60/tex-filter.so + dnl /usr/lib/aspell-0.60/tex-filter.so + dnl which require matching of the `aspell` binary architecture + dnl with the module. We currently avoid the hassle thanks to a + dnl fallback to built-in paths below if this initial guesswork + dnl failed. This may need some more-direct addressing later. AC_MSG_CHECKING([for aspell "lib" filtering resources directory]) ASPELL_BINDIR="`dirname "$ASPELL"`" if test -d "${ASPELL_BINDIR}/../lib" ; then @@ -97,22 +104,58 @@ if test -z "${nut_have_aspell_seen}"; then AC_MSG_RESULT([${ASPELL_FILTER_TEX_PATH}]) fi - AM_CONDITIONAL([HAVE_ASPELL_FILTER_LIB_PATH], [test -d "$ASPELL_FILTER_LIB_PATH"]) - AC_SUBST(ASPELL_FILTER_LIB_PATH) - AM_CONDITIONAL([HAVE_ASPELL_FILTER_SHARE_PATH], [test -d "$ASPELL_FILTER_SHARE_PATH"]) - AC_SUBST(ASPELL_FILTER_SHARE_PATH) - AM_CONDITIONAL([HAVE_ASPELL_FILTER_TEX_PATH], [test -d "$ASPELL_FILTER_TEX_PATH"]) - AC_SUBST(ASPELL_FILTER_TEX_PATH) AC_MSG_CHECKING([if aspell version can do our documentation spell checks (minimum required ${ASPELL_MIN_VERSION})]) AX_COMPARE_VERSION([${ASPELL_VERSION}], [ge], [${ASPELL_MIN_VERSION}], [ AC_MSG_RESULT(yes) - nut_have_aspell="yes" + AC_MSG_CHECKING([if detected aspell configuration works]) + dnl Roughly following docs/Makefile.am setup for "make spellcheck": + ASPELL_NUT_TEXMODE_ARGS="-t" + AS_IF([test -n "$ASPELL_FILTER_TEX_PATH" -a -d "$ASPELL_FILTER_TEX_PATH"], [ASPELL_NUT_TEXMODE_ARGS="--filter-path='${ASPELL_FILTER_TEX_PATH}' ${ASPELL_NUT_TEXMODE_ARGS}"]) + ASPELL_NUT_COMMON_ARGS="-d en -a" + dnl Using "eval" to handle quotes, in case of funny paths + out0="`LANG=C; LC_ALL=C; export LANG; export LC_ALL; exec -- 2>&1; set -x; echo test | eval ${ASPELL} ${ASPELL_NUT_TEXMODE_ARGS} ${ASPELL_NUT_COMMON_ARGS}`"; res0=$? + AS_IF([test x"$res0" != x0], [ + AC_MSG_NOTICE([FAILED CMD: ${ASPELL} ${ASPELL_NUT_TEXMODE_ARGS} ${ASPELL_NUT_COMMON_ARGS}]) + AC_MSG_NOTICE([aspell result ($res0) and output: $out0]) + ]) + AS_CASE([$out0], + [*ELFCLASS*|*"wrong ELF class"*], [ + dnl Retry without the filter path, we must have caught a wrong one + dnl and *most* platforms do serve a trustworthy built-in after all: + AC_MSG_RESULT(no) + AC_MSG_CHECKING([if detected aspell configuration works with built-in paths (tweaked one finds wrong binary modules)]) + ASPELL_NUT_TEXMODE_ARGS="-t" + out0="`LANG=C; LC_ALL=C; export LANG; export LC_ALL; exec -- 2>&1; set -x; echo test | eval ${ASPELL} ${ASPELL_NUT_TEXMODE_ARGS} ${ASPELL_NUT_COMMON_ARGS}`"; res0=$? + AS_IF([test x"$res0" = x0], [ASPELL_FILTER_TEX_PATH=""], [ + AC_MSG_NOTICE([FAILED CMD: ${ASPELL} ${ASPELL_NUT_TEXMODE_ARGS} ${ASPELL_NUT_COMMON_ARGS}]) + AC_MSG_NOTICE([aspell result ($res0) and output: $out0]) + ]) + ] + ) + out1="`echo test | eval ${ASPELL} ${ASPELL_NUT_TEXMODE_ARGS} ${ASPELL_NUT_COMMON_ARGS} | grep test`"; res1=$? + out2="`echo qwer | eval ${ASPELL} ${ASPELL_NUT_TEXMODE_ARGS} ${ASPELL_NUT_COMMON_ARGS} | grep qwer`"; res2=$? + AS_IF([test x"$out1" = x -a x"$out2" != x], [ + AC_MSG_RESULT(yes) + nut_have_aspell="yes" + ], [ + AC_MSG_RESULT(no) + AC_MSG_NOTICE([aspell result ($res1) for 'test' (should be empty): $out1]) + AC_MSG_NOTICE([aspell result ($res2) for 'qwer' (should have suggestions): $out2]) + nut_have_aspell="no" + ]) ], [ AC_MSG_RESULT(no) nut_have_aspell="no" ]) + AM_CONDITIONAL([HAVE_ASPELL_FILTER_LIB_PATH], [test -d "$ASPELL_FILTER_LIB_PATH"]) + AC_SUBST(ASPELL_FILTER_LIB_PATH) + AM_CONDITIONAL([HAVE_ASPELL_FILTER_SHARE_PATH], [test -d "$ASPELL_FILTER_SHARE_PATH"]) + AC_SUBST(ASPELL_FILTER_SHARE_PATH) + AM_CONDITIONAL([HAVE_ASPELL_FILTER_TEX_PATH], [test -d "$ASPELL_FILTER_TEX_PATH"]) + AC_SUBST(ASPELL_FILTER_TEX_PATH) + dnl Notes: we also keep HAVE_ASPELL for implicit targets, such as dnl addition to "make check" target dnl ### AM_CONDITIONAL([HAVE_ASPELL], [test -n "$ASPELL"]) diff --git a/m4/nut_check_headers_windows.m4 b/m4/nut_check_headers_windows.m4 index e58a2d9a4b..ce0286d045 100644 --- a/m4/nut_check_headers_windows.m4 +++ b/m4/nut_check_headers_windows.m4 @@ -41,7 +41,7 @@ AC_DEFUN([NUT_CHECK_HEADER_WINDOWS], [ nut_cv_header_windows_h="yes" ],[ nut_cv_header_windows_h="no" - CFLAGS="$SAVED_CFLAGS" + CFLAGS="$SAVED_CFLAGS" ]) ]) AC_LANG_POP([C]) @@ -52,6 +52,7 @@ AC_DEFUN([NUT_CHECK_HEADER_WINDOWS], [ [Define to 1 if you have the windows.h header file.]) ;; esac + AM_CONDITIONAL(HAVE_WINDOWS_H, test "x$nut_cv_header_windows_h" = xyes) ]) @@ -124,6 +125,7 @@ AC_DEFUN([NUT_CHECK_HEADER_WINSOCK], [ [Define to 1 if you have the winsock.h header file.]) ;; esac + AM_CONDITIONAL(HAVE_WINSOCK_H, test "x$nut_cv_header_winsock_h" = xyes) ]) @@ -163,6 +165,7 @@ AC_DEFUN([NUT_CHECK_HEADER_WINSOCK2], [ [Define to 1 if you have the winsock2.h header file.]) ;; esac + AM_CONDITIONAL(HAVE_WINSOCK2_H, test "x$nut_cv_header_winsock2_h" = xyes) ]) @@ -203,4 +206,5 @@ AC_DEFUN([NUT_CHECK_HEADER_WS2TCPIP], [ [Define to 1 if you have the ws2tcpip.h header file.]) ;; esac + AM_CONDITIONAL(HAVE_WS2TCPIP_H, test "x$nut_cv_header_ws2tcpip_h" = xyes) ]) diff --git a/m4/nut_check_libgd.m4 b/m4/nut_check_libgd.m4 index b6f58efcb1..a8c7de5d17 100644 --- a/m4/nut_check_libgd.m4 +++ b/m4/nut_check_libgd.m4 @@ -127,9 +127,17 @@ if test -z "${nut_have_libgd_seen}"; then AC_MSG_CHECKING([with gdlib.pc Libs.private]) LDFLAGS="$LDFLAGS $_LIBS_PRIVATE" unset ac_cv_search_gdImagePng - AC_SEARCH_LIBS(gdImagePng, gd, [], [nut_have_libgd=no]) + AC_SEARCH_LIBS(gdImagePng, gd, [nut_have_libgd=yes], [nut_have_libgd=no]) ]) unset _LIBS_PRIVATE + dnl At least mingw 32-bit builds of the DLL seem to not + dnl tell the linker how to get from GD to PNG lib + AS_IF([test x"$nut_have_libgd" = xno], [ + AC_MSG_CHECKING([with explicit -lpng in the loop]) + LDFLAGS="$LDFLAGS -lgd" + unset ac_cv_search_gdImagePng + AC_SEARCH_LIBS(gdImagePng, png png16, [nut_have_libgd=yes], [nut_have_libgd=no]) + ]) ]) ]) diff --git a/m4/nut_check_python.m4 b/m4/nut_check_python.m4 index 995a3e7c97..b44a5cd5bb 100644 --- a/m4/nut_check_python.m4 +++ b/m4/nut_check_python.m4 @@ -116,17 +116,17 @@ AC_DEFUN([NUT_CHECK_PYTHON], AM_CONDITIONAL([HAVE_PYTHON], [test -n "${PYTHON}" && test "${PYTHON}" != "no"]) AS_IF([test -n "${PYTHON}" && test "${PYTHON}" != "no"], [ export PYTHON - AC_MSG_CHECKING([python site-packages location]) - PYTHON_SITE_PACKAGES="`${PYTHON} -c 'import site; print(site.getsitepackages().pop(0))'`" - AS_CASE(["$PYTHON_SITE_PACKAGES"], - [*:*], [ - dnl Note: on Windows MSYS2 this embeds "C:/msys64/mingw..." into the string [nut#1584] - PYTHON_SITE_PACKAGES="`cd "$PYTHON_SITE_PACKAGES" && pwd`" - ] - ) - AC_MSG_RESULT([${PYTHON_SITE_PACKAGES}]) + AC_CACHE_CHECK([python site-packages location], [nut_cv_PYTHON_SITE_PACKAGES], [ + nut_cv_PYTHON_SITE_PACKAGES="`${PYTHON} -c 'import site; print(site.getsitepackages().pop(0))'`" + AS_CASE(["$nut_cv_PYTHON_SITE_PACKAGES"], + [*:*], [ + dnl Note: on Windows MSYS2 this embeds "C:/msys64/mingw..." into the string [nut#1584] + nut_cv_PYTHON_SITE_PACKAGES="`cd "$nut_cv_PYTHON_SITE_PACKAGES" && pwd`" + ] + ) + ]) ]) - AC_SUBST([PYTHON_SITE_PACKAGES], [${PYTHON_SITE_PACKAGES}]) + AC_SUBST([PYTHON_SITE_PACKAGES], [${nut_cv_PYTHON_SITE_PACKAGES}]) AM_CONDITIONAL([HAVE_PYTHON_SITE_PACKAGES], [test x"${PYTHON_SITE_PACKAGES}" != "x"]) ]) ]) @@ -228,17 +228,17 @@ AC_DEFUN([NUT_CHECK_PYTHON2], AM_CONDITIONAL([HAVE_PYTHON2], [test -n "${PYTHON2}" && test "${PYTHON2}" != "no"]) AS_IF([test -n "${PYTHON2}" && test "${PYTHON2}" != "no"], [ export PYTHON2 - AC_MSG_CHECKING([python2 site-packages location]) - PYTHON2_SITE_PACKAGES="`${PYTHON2} -c 'import site; print(site.getsitepackages().pop(0))'`" - AS_CASE(["$PYTHON2_SITE_PACKAGES"], - [*:*], [ - dnl Note: on Windows MSYS2 this embeds "C:/msys64/mingw..." into the string [nut#1584] - PYTHON2_SITE_PACKAGES="`cd "$PYTHON2_SITE_PACKAGES" && pwd`" - ] - ) - AC_MSG_RESULT([${PYTHON2_SITE_PACKAGES}]) + AC_CACHE_CHECK([python2 site-packages location], [nut_cv_PYTHON2_SITE_PACKAGES], [ + nut_cv_PYTHON2_SITE_PACKAGES="`${PYTHON2} -c 'import site; print(site.getsitepackages().pop(0))'`" + AS_CASE(["$nut_cv_PYTHON2_SITE_PACKAGES"], + [*:*], [ + dnl Note: on Windows MSYS2 this embeds "C:/msys64/mingw..." into the string [nut#1584] + nut_cv_PYTHON2_SITE_PACKAGES="`cd "$nut_cv_PYTHON2_SITE_PACKAGES" && pwd`" + ] + ) + ]) ]) - AC_SUBST([PYTHON2_SITE_PACKAGES], [${PYTHON2_SITE_PACKAGES}]) + AC_SUBST([PYTHON2_SITE_PACKAGES], [${nut_cv_PYTHON2_SITE_PACKAGES}]) AM_CONDITIONAL([HAVE_PYTHON2_SITE_PACKAGES], [test x"${PYTHON2_SITE_PACKAGES}" != "x"]) ]) ]) @@ -285,7 +285,7 @@ AC_DEFUN([NUT_CHECK_PYTHON3], [PYTHON3=""]) ]) AS_IF([test x"${PYTHON3}" = x], [ - AC_CHECK_PROGS([PYTHON3], [python3 python3.10 python-3.10 python3.9 python-3.9 python3.7 python-3.7 python3.6 python-3.6 python3.5 python-3.5 python], [_python3_runtime]) + AC_CHECK_PROGS([PYTHON3], [python3 python3.14 python-3.14 python3.13 python-3.13 python3.12 python-3.12 python3.11 python-3.11 python3.10 python-3.10 python3.9 python-3.9 python3.7 python-3.7 python3.6 python-3.6 python3.5 python-3.5 python], [_python3_runtime]) ]) ], [no], [PYTHON3="no"], @@ -340,17 +340,17 @@ AC_DEFUN([NUT_CHECK_PYTHON3], AM_CONDITIONAL([HAVE_PYTHON3], [test -n "${PYTHON3}" && test "${PYTHON3}" != "no"]) AS_IF([test -n "${PYTHON3}" && test "${PYTHON3}" != "no"], [ export PYTHON3 - AC_MSG_CHECKING([python3 site-packages location]) - PYTHON3_SITE_PACKAGES="`${PYTHON3} -c 'import site; print(site.getsitepackages().pop(0))'`" - AS_CASE(["$PYTHON3_SITE_PACKAGES"], - [*:*], [ - dnl Note: on Windows MSYS2 this embeds "C:/msys64/mingw..." into the string [nut#1584] - PYTHON3_SITE_PACKAGES="`cd "$PYTHON3_SITE_PACKAGES" && pwd`" - ] - ) - AC_MSG_RESULT([${PYTHON3_SITE_PACKAGES}]) + AC_CACHE_CHECK([python3 site-packages location], [nut_cv_PYTHON3_SITE_PACKAGES], [ + nut_cv_PYTHON3_SITE_PACKAGES="`${PYTHON3} -c 'import site; print(site.getsitepackages().pop(0))'`" + AS_CASE(["$nut_cv_PYTHON3_SITE_PACKAGES"], + [*:*], [ + dnl Note: on Windows MSYS2 this embeds "C:/msys64/mingw..." into the string [nut#1584] + nut_cv_PYTHON3_SITE_PACKAGES="`cd "$nut_cv_PYTHON3_SITE_PACKAGES" && pwd`" + ] + ) + ]) ]) - AC_SUBST([PYTHON3_SITE_PACKAGES], [${PYTHON3_SITE_PACKAGES}]) + AC_SUBST([PYTHON3_SITE_PACKAGES], [${nut_cv_PYTHON3_SITE_PACKAGES}]) AM_CONDITIONAL([HAVE_PYTHON3_SITE_PACKAGES], [test x"${PYTHON3_SITE_PACKAGES}" != "x"]) ]) ]) diff --git a/m4/nut_compiler_family.m4 b/m4/nut_compiler_family.m4 index f47b1ae995..361a77a444 100644 --- a/m4/nut_compiler_family.m4 +++ b/m4/nut_compiler_family.m4 @@ -178,19 +178,21 @@ dnl # confuse the compiler assumptions - along with its provided headers)... dnl # ideally; in practice however cppunit, net-snmp and some system include dnl # files do cause grief to picky compiler settings (more so from third dnl # party packages shipped via /usr/local/... namespace): - AS_IF([test "x$CLANGCC" = xyes -o "x$GCC" = xyes], [ -dnl # CFLAGS="-isystem /usr/include $CFLAGS" - AS_IF([test -d /usr/local/include], - [CFLAGS="-isystem /usr/local/include $CFLAGS"]) - AS_IF([test -d /usr/pkg/include], - [CFLAGS="-isystem /usr/pkg/include $CFLAGS"]) - ]) - AS_IF([test "x$CLANGXX" = xyes -o "x$GXX" = xyes], [ -dnl # CXXFLAGS="-isystem /usr/include $CXXFLAGS" - AS_IF([test -d /usr/local/include], - [CXXFLAGS="-isystem /usr/local/include $CXXFLAGS"]) - AS_IF([test -d /usr/pkg/include], - [CXXFLAGS="-isystem /usr/pkg/include $CXXFLAGS"]) + AS_IF([test "x$cross_compiling" != xyes], [ + AS_IF([test "x$CLANGCC" = xyes -o "x$GCC" = xyes], [ +dnl # CFLAGS="-isystem /usr/include $CFLAGS" + AS_IF([test -d /usr/local/include], + [CFLAGS="-isystem /usr/local/include $CFLAGS"]) + AS_IF([test -d /usr/pkg/include], + [CFLAGS="-isystem /usr/pkg/include $CFLAGS"]) + ]) + AS_IF([test "x$CLANGXX" = xyes -o "x$GXX" = xyes], [ +dnl # CXXFLAGS="-isystem /usr/include $CXXFLAGS" + AS_IF([test -d /usr/local/include], + [CXXFLAGS="-isystem /usr/local/include $CXXFLAGS"]) + AS_IF([test -d /usr/pkg/include], + [CXXFLAGS="-isystem /usr/pkg/include $CXXFLAGS"]) + ]) ]) dnl # Default to avoid noisy warnings on older compilers @@ -205,7 +207,7 @@ dnl # Some distributions and platforms also have problems dnl # building in "strict C" mode, so for the GNU-compatible dnl # compilers we default to the GNU C/C++ dialects. AS_IF([test "x$GCC" = xyes -o "x$CLANGCC" = xyes], - [AS_CASE(["${CFLAGS}"], [-std=*], [], + [AS_CASE(["${CFLAGS}"], [*"-std="*|*"-ansi"*], [], [AC_LANG_PUSH([C]) AX_CHECK_COMPILE_FLAG([-std=gnu99], [AC_MSG_NOTICE([Defaulting C standard support to GNU C99 on a GCC or CLANG compatible compiler]) @@ -218,7 +220,7 @@ dnl # compilers we default to the GNU C/C++ dialects. dnl # Note: this might upset some very old compilers dnl # but then by default we wouldn't build C++ parts AS_IF([test "x$GCC" = xyes -o "x$CLANGCC" = xyes], - [AS_CASE(["${CXXFLAGS}"], [-std=*], [], + [AS_CASE(["${CXXFLAGS}"], [*"-std="*|*"-ansi"*], [], [AC_LANG_PUSH([C++]) AX_CHECK_COMPILE_FLAG([-std=gnu++11], [AC_MSG_NOTICE([Defaulting C++ standard support to GNU C++11 on a GCC or CLANG compatible compiler]) @@ -244,7 +246,7 @@ dnl # Some distributions and platforms also have problems dnl # building in "strict C" mode, so for the GNU-compatible dnl # compilers we default to the GNU C/C++ dialects. AS_IF([test "x$GCC" = xyes -o "x$CLANGCC" = xyes], - [AS_CASE(["${CFLAGS}"], [*-std=*], [], + [AS_CASE(["${CFLAGS}"], [*"-std="*|*"-ansi"*], [], [AC_LANG_PUSH([C]) AX_CHECK_COMPILE_FLAG([-std=gnu99], [AC_MSG_NOTICE([Defaulting C standard support to GNU C99 on a GCC or CLANG compatible compiler]) @@ -257,7 +259,7 @@ dnl # compilers we default to the GNU C/C++ dialects. dnl # Note: this might upset some very old compilers dnl # but then by default we wouldn't build C++ parts AS_IF([test "x$GCC" = xyes -o "x$CLANGCC" = xyes], - [AS_CASE(["${CXXFLAGS}"], [*-std=*], [], + [AS_CASE(["${CXXFLAGS}"], [*"-std="*|*"-ansi"*], [], [AC_LANG_PUSH([C++]) AX_CHECK_COMPILE_FLAG([-std=gnu++11], [AC_MSG_NOTICE([Defaulting C++ standard support to GNU C++11 on a GCC or CLANG compatible compiler]) diff --git a/m4/nut_report_feature.m4 b/m4/nut_report_feature.m4 index dd2666cd58..02ff814033 100644 --- a/m4/nut_report_feature.m4 +++ b/m4/nut_report_feature.m4 @@ -129,6 +129,23 @@ AC_DEFUN([NUT_REPORT_COMPILERS], echo "NUT Compiler settings:" echo "----------------------" echo "" + if test x"${nut_with_debuginfo_C}" = x"yes" -o x"${nut_with_debuginfo_CXX}" = x"yes" ; then + printf 'NOTE: Settings for ' + if test x"${nut_with_debuginfo_C}" = x"yes" ; then + printf 'C ' + fi + if test x"${nut_with_debuginfo_C}${nut_with_debuginfo_CXX}" = x"yesyes" ; then + printf 'and ' + fi + if test x"${nut_with_debuginfo_CXX}" = x"yes" ; then + printf 'C++ ' + fi + printf 'compiler' + if test x"${nut_with_debuginfo_C}${nut_with_debuginfo_CXX}" = x"yesyes" ; then + printf 's' + fi + printf ' are adjusted for debugging (and minimal optimizations)\n\n' + fi printf '* CC \t: %s\n' "$CC" printf '* CFLAGS \t: %s\n' "$CFLAGS" printf '* CXX \t: %s\n' "$CXX" diff --git a/scripts/Aix/nut.init.in b/scripts/Aix/nut.init.in index 937e67f9dc..f8bd09444b 100755 --- a/scripts/Aix/nut.init.in +++ b/scripts/Aix/nut.init.in @@ -40,6 +40,9 @@ NUTUSER="@RUN_AS_USER@" NUTGROUP="@RUN_AS_GROUP@" NUT_VAR_LOCK="/var/locks/ups" +NUT_QUIET_INIT_UPSNOTIFY=true +export NUT_QUIET_INIT_UPSNOTIFY + if [ -f "$CONFIG" ] ; then . "$CONFIG" diff --git a/scripts/HP-UX/nut-drvctl.sh b/scripts/HP-UX/nut-drvctl.sh index 9f7286e11b..f153909f15 100755 --- a/scripts/HP-UX/nut-drvctl.sh +++ b/scripts/HP-UX/nut-drvctl.sh @@ -24,6 +24,9 @@ umask 022 PATH=/usr/sbin:/usr/bin:/sbin export PATH +NUT_QUIET_INIT_UPSNOTIFY=true +export NUT_QUIET_INIT_UPSNOTIFY + WHAT='NUT UPS driver (Network UPS Tools -- http://www.exploits.org/nut)' WHAT_PATH=/opt/nut/bin/upsdrvctl WHAT_CONFIG=/etc/rc.config.d/nut-drvctl diff --git a/scripts/HP-UX/nut-upsd.sh b/scripts/HP-UX/nut-upsd.sh index 454cfe8732..d5dcd36a3a 100755 --- a/scripts/HP-UX/nut-upsd.sh +++ b/scripts/HP-UX/nut-upsd.sh @@ -24,6 +24,9 @@ umask 022 PATH=/usr/sbin:/usr/bin:/sbin export PATH +NUT_QUIET_INIT_UPSNOTIFY=true +export NUT_QUIET_INIT_UPSNOTIFY + WHAT='NUT UPS daemon (Network UPS Tools -- http://www.exploits.org/nut)' WHAT_PATH=/opt/nut/sbin/upsd WHAT_CONFIG=/etc/rc.config.d/nut-upsd diff --git a/scripts/HP-UX/nut-upsmon.sh b/scripts/HP-UX/nut-upsmon.sh index 2c7fc95bef..88746431cb 100755 --- a/scripts/HP-UX/nut-upsmon.sh +++ b/scripts/HP-UX/nut-upsmon.sh @@ -24,6 +24,9 @@ umask 022 PATH=/usr/sbin:/usr/bin:/sbin export PATH +NUT_QUIET_INIT_UPSNOTIFY=true +export NUT_QUIET_INIT_UPSNOTIFY + WHAT='NUT UPS monitor (Network UPS Tools -- http://www.exploits.org/nut)' WHAT_PATH=/opt/nut/sbin/upsmon WHAT_CONFIG=/etc/rc.config.d/nut-upsmon diff --git a/scripts/Makefile.am b/scripts/Makefile.am index 6113a2b3f5..f0f59aa877 100644 --- a/scripts/Makefile.am +++ b/scripts/Makefile.am @@ -1,4 +1,7 @@ -EXTRA_DIST = README \ +# Network UPS Tools: scripts (root) + +EXTRA_DIST = \ + README.adoc \ avahi/nut.service.in \ HP-UX/nut-drvctl \ HP-UX/nut-drvctl.sh \ @@ -11,7 +14,7 @@ EXTRA_DIST = README \ misc/osd-notify \ perl/Nut.pm \ RedHat/halt.patch \ - RedHat/README \ + RedHat/README.adoc \ RedHat/ups.in \ RedHat/upsd.in \ RedHat/upsmon.in \ @@ -20,9 +23,35 @@ EXTRA_DIST = README \ subdriver/gen-snmp-subdriver.sh \ upower/95-upower-hid.hwdb \ upower/95-upower-hid.rules \ + usb_resetter/README.adoc \ + usb_resetter/nut-driver.service \ Windows/halt.c \ Windows/Makefile -SUBDIRS = augeas devd hotplug python systemd udev ufw Solaris Windows upsdrvsvcctl +SUBDIRS = augeas devd hotplug installer python systemd udev ufw Solaris Windows upsdrvsvcctl + +SPELLCHECK_SRC = README.adoc RedHat/README.adoc usb_resetter/README.adoc + +# NOTE: Due to portability, we do not use a GNU percent-wildcard extension. +# We also have to export some variables that may be tainted by relative +# paths when parsing the other makefile (e.g. MKDIR_P that may be defined +# via expanded $(top_builddir)/install_sh): +#%-spellchecked: % Makefile.am $(top_srcdir)/docs/Makefile.am $(abs_srcdir)/$(NUT_SPELL_DICT) +# +$(MAKE) -s -f $(top_builddir)/docs/Makefile MKDIR_P="$(MKDIR_P)" builddir="$(builddir)" srcdir="$(srcdir)" top_builddir="$(top_builddir)" top_srcdir="$(top_srcdir)" SPELLCHECK_SRC_ONE="$<" SPELLCHECK_SRCDIR="$(srcdir)" SPELLCHECK_BUILDDIR="$(builddir)" $@ + +# NOTE: Portable suffix rules do not allow prerequisites, so we shim them here +# by a wildcard target in case the make implementation can put the two together. +*-spellchecked: Makefile.am $(top_srcdir)/docs/Makefile.am $(abs_srcdir)/$(NUT_SPELL_DICT) + +.sample.sample-spellchecked: + +$(MAKE) -s -f $(top_builddir)/docs/Makefile MKDIR_P="$(MKDIR_P)" builddir="$(builddir)" srcdir="$(srcdir)" top_builddir="$(top_builddir)" top_srcdir="$(top_srcdir)" SPELLCHECK_SRC_ONE="$<" SPELLCHECK_SRCDIR="$(srcdir)" SPELLCHECK_BUILDDIR="$(builddir)" $@ + +.in.in-spellchecked: + +$(MAKE) -s -f $(top_builddir)/docs/Makefile MKDIR_P="$(MKDIR_P)" builddir="$(builddir)" srcdir="$(srcdir)" top_builddir="$(top_builddir)" top_srcdir="$(top_srcdir)" SPELLCHECK_SRC_ONE="$<" SPELLCHECK_SRCDIR="$(srcdir)" SPELLCHECK_BUILDDIR="$(builddir)" $@ + +spellcheck spellcheck-interactive spellcheck-sortdict: + +$(MAKE) -f $(top_builddir)/docs/Makefile MKDIR_P="$(MKDIR_P)" builddir="$(builddir)" srcdir="$(srcdir)" top_builddir="$(top_builddir)" top_srcdir="$(top_srcdir)" SPELLCHECK_SRC="$(SPELLCHECK_SRC)" SPELLCHECK_SRCDIR="$(srcdir)" SPELLCHECK_BUILDDIR="$(builddir)" $@ + +CLEANFILES = *-spellchecked RedHat/*-spellchecked usb_resetter/*-spellchecked MAINTAINERCLEANFILES = Makefile.in .dirstamp diff --git a/scripts/README b/scripts/README deleted file mode 100644 index f31e10312c..0000000000 --- a/scripts/README +++ /dev/null @@ -1,12 +0,0 @@ -These directories hold various scripts: -- example startup and shutdown scripts for various operating systems and -distributions, -- hotplug and udev integration for on the fly privileges settings (Linux only), -- UPower (previously DeviceKit-power) rules file, -- Python Client module and application, -- Perl client module, -- Augeas support lenses and modules for NUT, -- systemd support files. - -They have either been contributed by users of the software, or by the NUT Team -itself. diff --git a/scripts/README.adoc b/scripts/README.adoc new file mode 100644 index 0000000000..8125b1771c --- /dev/null +++ b/scripts/README.adoc @@ -0,0 +1,25 @@ +NUT contributed and integration scripts +======================================= + +These directories hold various scripts and resources needed for systems +integration, and other non-core functionality, which were contributed +over time by the NUT Team, side projects and/or general community members +(users of the software), including: + +- example startup and shutdown scripts for various operating systems and + distributions, +- `hotplug` and `udev` integration for on the fly privileges settings + (Linux only), +- `UPower` (previously `DeviceKit-power`) rules file, +- Python Client module and application, +- Perl client module, +- Augeas support lenses and modules for NUT, +- support to run NUT components as service unit instances: + * shared `nut-driver-enumerator` and `upsdrvsvcctl` logic, + * `systemd` support files, + * SMF (Solaris/illumos Service Management Framework) support files, +- init-scripts and/or packaging elements for several Unix operating systems, +- Windows build helpers and information, +- software-driven USB reset suggestions and helpers (for stuck devices), +- `logrotate` integration, +- and many others. diff --git a/scripts/RedHat/README b/scripts/RedHat/README deleted file mode 100644 index d6023d1295..0000000000 --- a/scripts/RedHat/README +++ /dev/null @@ -1,3 +0,0 @@ -Install ups in /etc/rc.d/init.d - -/etc/sysconfig/ups is used only to store the POWERDOWNFLAG variable diff --git a/scripts/RedHat/README.adoc b/scripts/RedHat/README.adoc new file mode 100644 index 0000000000..8de3b7be46 --- /dev/null +++ b/scripts/RedHat/README.adoc @@ -0,0 +1,6 @@ +NUT integration files for older RedHat based Linux distributions +================================================================ + +Install `ups` in `/etc/rc.d/init.d` + +The `/etc/sysconfig/ups` is used only to store the `POWERDOWNFLAG` variable diff --git a/scripts/RedHat/upsd.in b/scripts/RedHat/upsd.in index f44e7fdae0..c5063209b8 100644 --- a/scripts/RedHat/upsd.in +++ b/scripts/RedHat/upsd.in @@ -53,6 +53,9 @@ fi # if there are no config file, bail out [ -f "$UPSDCONF" ] && [ -f "$UPSCONF" ] || exit 0 +NUT_QUIET_INIT_UPSNOTIFY=true +export NUT_QUIET_INIT_UPSNOTIFY + runcmd() { echo -n "$1 " shift diff --git a/scripts/RedHat/upsmon.in b/scripts/RedHat/upsmon.in index a57d1229e8..9cee760500 100644 --- a/scripts/RedHat/upsmon.in +++ b/scripts/RedHat/upsmon.in @@ -32,6 +32,9 @@ if [ -n "$NUT_SBINDIR" -a -d "$NUT_SBINDIR" ]; then PATH="$NUT_SBINDIR:$PATH" fi +NUT_QUIET_INIT_UPSNOTIFY=true +export NUT_QUIET_INIT_UPSNOTIFY + # See how we are called. case "$1" in start) diff --git a/scripts/Solaris/Makefile.am b/scripts/Solaris/Makefile.am index 678b4eb8e6..3f01ec6034 100644 --- a/scripts/Solaris/Makefile.am +++ b/scripts/Solaris/Makefile.am @@ -1,4 +1,6 @@ -EXTRA_DIST = makelocal.sh precheck.py.in preproto.pl.in README +# Network UPS Tools: scripts/Solaris + +EXTRA_DIST = makelocal.sh precheck.py.in preproto.pl.in README.adoc PROTOTYPE_DIR = $(DESTDIR)@prefix@ SOLARIS_CHECK_TARGETS = PYTHON = @PYTHON@ @@ -89,4 +91,28 @@ check-local-solaris-smf: $(SOLARIS_SMF_MANIFESTS) /usr/sbin/svccfg validate "$$F" || RES=$$? ; \ done; exit $$RES +SPELLCHECK_SRC = README.adoc + +# NOTE: Due to portability, we do not use a GNU percent-wildcard extension. +# We also have to export some variables that may be tainted by relative +# paths when parsing the other makefile (e.g. MKDIR_P that may be defined +# via expanded $(top_builddir)/install_sh): +#%-spellchecked: % Makefile.am $(top_srcdir)/docs/Makefile.am $(abs_srcdir)/$(NUT_SPELL_DICT) +# +$(MAKE) -s -f $(top_builddir)/docs/Makefile $(AM_MAKEFLAGS) MKDIR_P="$(MKDIR_P)" builddir="$(builddir)" srcdir="$(srcdir)" top_builddir="$(top_builddir)" top_srcdir="$(top_srcdir)" SPELLCHECK_SRC_ONE="$<" SPELLCHECK_SRCDIR="$(srcdir)" SPELLCHECK_BUILDDIR="$(builddir)" $@ + +# NOTE: Portable suffix rules do not allow prerequisites, so we shim them here +# by a wildcard target in case the make implementation can put the two together. +*-spellchecked: Makefile.am $(top_srcdir)/docs/Makefile.am $(abs_srcdir)/$(NUT_SPELL_DICT) + +.sample.sample-spellchecked: + +$(MAKE) -s -f $(top_builddir)/docs/Makefile $(AM_MAKEFLAGS) MKDIR_P="$(MKDIR_P)" builddir="$(builddir)" srcdir="$(srcdir)" top_builddir="$(top_builddir)" top_srcdir="$(top_srcdir)" SPELLCHECK_SRC_ONE="$<" SPELLCHECK_SRCDIR="$(srcdir)" SPELLCHECK_BUILDDIR="$(builddir)" $@ + +.in.in-spellchecked: + +$(MAKE) -s -f $(top_builddir)/docs/Makefile $(AM_MAKEFLAGS) MKDIR_P="$(MKDIR_P)" builddir="$(builddir)" srcdir="$(srcdir)" top_builddir="$(top_builddir)" top_srcdir="$(top_srcdir)" SPELLCHECK_SRC_ONE="$<" SPELLCHECK_SRCDIR="$(srcdir)" SPELLCHECK_BUILDDIR="$(builddir)" $@ + +spellcheck spellcheck-interactive spellcheck-sortdict: + +$(MAKE) -f $(top_builddir)/docs/Makefile $(AM_MAKEFLAGS) MKDIR_P="$(MKDIR_P)" builddir="$(builddir)" srcdir="$(srcdir)" top_builddir="$(top_builddir)" top_srcdir="$(top_srcdir)" SPELLCHECK_SRC="$(SPELLCHECK_SRC)" SPELLCHECK_SRCDIR="$(srcdir)" SPELLCHECK_BUILDDIR="$(builddir)" $@ + +CLEANFILES = *-spellchecked + MAINTAINERCLEANFILES = Makefile.in .dirstamp diff --git a/scripts/Solaris/README b/scripts/Solaris/README deleted file mode 100644 index adb305efdc..0000000000 --- a/scripts/Solaris/README +++ /dev/null @@ -1,38 +0,0 @@ -This directory contains init-scripts and SMF manifests and methods -for integration of NUT services with Solaris and descendant OSes. - -This also includes the nut-driver-enumerator.sh (service and implementation -method) and upsdrvsvcctl (tool) to manage NUT drivers as service instances, -which are stored in ../upsdrvsvcctl/ subdirectory (portable codebase shared -with Linux systemd). - -The default implementation (runs once) can be enabled with: - - svcadm enable nut-driver-enumerator:default - -Note that at the moment there is no out-of-the-box integration for triggering -a restart/refresh of the nut-driver-enumerator SMF service at the very instant -when the `ups.conf` file is modified, like there is with systemd path unit type. -Due to this, the systems administrator is expected to either invoke -`svcadm refresh nut-driver-enumerator` after changing the NUT configuration -or wait until the daemonized mode, if enabled, picks up the change (should do -so within a minute by default). However, a DTrace script or a tool like -https://github.com/emcrisostomo/fswatch wrapped into a service might be used -for equivalent effect. - -Alternatively, but somewhat more expensively, the same `nut-driver-enumerator.sh` -script can be executed in a loop as the payload of the SMF service to keep -inspecting the configuration and apply changes to the running system. It is -not a common use-case to keep changing device setups, so this solution is not -enforced by default ;) although a service variant is provided... - -Note that only one of these can be enabled at the same time: - - svcadm disable nut-driver-enumerator:default - svcadm enable nut-driver-enumerator:daemon - -Init-script solution contributed by numerous authors -SMF solution contributed by Jim Klimov - -For special notes about USB-connected device monitoring with NUT under Solaris -and related operating systems, see docs/solaris-usb.txt diff --git a/scripts/Solaris/README.adoc b/scripts/Solaris/README.adoc new file mode 100644 index 0000000000..ffb84adcd5 --- /dev/null +++ b/scripts/Solaris/README.adoc @@ -0,0 +1,69 @@ +Solaris/illumos helper scripts and resources +============================================ + +Overview +-------- + +This directory contains init-scripts and SMF manifests and methods for better +integration of NUT services with Solaris and descendant operating systems, +covering SVR4 packaging with init scripts and/or SMF services (as called from +`make package` in the source root). + +NOTE: IPS (`pkg(5)`) packaging is not currently provided here, but is a concern +of particular distributions. See for example the OpenIndiana userland recipe at +https://github.com/OpenIndiana/oi-userland/tree/oi/hipster/components/sysutils/nut + +This also includes the `nut-driver-enumerator.sh` (service and implementation +method) and `upsdrvsvcctl` (tool) to manage NUT drivers as service instances, +which are stored in `../upsdrvsvcctl/` subdirectory (portable codebase shared +with Linux systemd). + +SMF integration +--------------- + +The default implementation (which runs once per invocation) can be enabled +with: +---- +:; svcadm enable nut-driver-enumerator:default +---- + +Note that at the moment there is no out-of-the-box integration for triggering +a restart/refresh of the `nut-driver-enumerator` SMF service at the very instant +when the `ups.conf` file is modified, like there is with systemd path unit type. +Due to this, the systems administrator is expected to either invoke +`svcadm refresh nut-driver-enumerator` after changing the NUT configuration, +or wait until the daemonized mode, if enabled, picks up the change (should do +so within a minute by default). However, a DTrace script or a tool like +https://github.com/emcrisostomo/fswatch wrapped into a service might be used +for equivalent effect. + +Alternatively, but in a potentially more computationally expensive fashion, the +same `nut-driver-enumerator.sh` script can be executed in a loop as the payload +of the SMF service to keep inspecting the configuration regularly and so apply +changes to the running system. It is not a common use-case to keep changing +device setups, so this solution is not enforced by default ;) although an SMF +service variant for this is provided... + +Note that only one of these implementations can be enabled at the same time: +---- +:; svcadm disable nut-driver-enumerator:default +:; svcadm enable nut-driver-enumerator:daemon +---- + +Other +----- + +For special notes about USB-connected device monitoring with NUT under Solaris +and related operating systems, see also `docs/solaris-usb.txt`. The example +`reset-ups-usb-solaris.sh.sample` script can be used to reset USB connections +if a driver (or UPS controller) gets stuck -- but it needs to be adapted to +*your* system first. + +Credits +------- + +* Init-script solution and SVR4 packaging contributed by numerous authors + over the years + +* SMF solution and OpenIndiana packaging contributed by Jim Klimov + diff --git a/scripts/Solaris/nut-driver-enumerator.xml.in b/scripts/Solaris/nut-driver-enumerator.xml.in index 55723c0326..f935b8c066 100644 --- a/scripts/Solaris/nut-driver-enumerator.xml.in +++ b/scripts/Solaris/nut-driver-enumerator.xml.in @@ -9,7 +9,7 @@ - + @@ -128,7 +128,7 @@ - + diff --git a/scripts/Solaris/svc-nut-monitor.in b/scripts/Solaris/svc-nut-monitor.in index c33b216a08..9e4129df1f 100755 --- a/scripts/Solaris/svc-nut-monitor.in +++ b/scripts/Solaris/svc-nut-monitor.in @@ -21,6 +21,10 @@ CONFIG="@CONFPATH@/nut.conf" NUTUSER="@RUN_AS_USER@" NUTGROUP="@RUN_AS_GROUP@" +# We anticipate some tighter integration with SMF later: +#NUT_QUIET_INIT_UPSNOTIFY=true +#export NUT_QUIET_INIT_UPSNOTIFY + if [ -f "$CONFIG" ] ; then . "$CONFIG" fi diff --git a/scripts/Solaris/svc-nut-server.in b/scripts/Solaris/svc-nut-server.in index 1419da7ec9..867c75fd0c 100755 --- a/scripts/Solaris/svc-nut-server.in +++ b/scripts/Solaris/svc-nut-server.in @@ -31,6 +31,10 @@ NUTGROUP="`svcprop -p nut/NUTGROUP $SMF_FMRI`" \ && [ -n "$NUTGROUP" ] \ || NUTGROUP="@RUN_AS_GROUP@" +# We anticipate some tighter integration with SMF later: +#NUT_QUIET_INIT_UPSNOTIFY=true +#export NUT_QUIET_INIT_UPSNOTIFY + if [ -f "$CONFIG" ] ; then . "$CONFIG" fi diff --git a/scripts/Solaris8/S99upsmon b/scripts/Solaris8/S99upsmon index 06ba753f4a..5030c9f798 100755 --- a/scripts/Solaris8/S99upsmon +++ b/scripts/Solaris8/S99upsmon @@ -11,6 +11,9 @@ export PATH UPSDPATH=/usr/local/ups/sbin +NUT_QUIET_INIT_UPSNOTIFY=true +export NUT_QUIET_INIT_UPSNOTIFY + # See how we are called. case "$1" in 'start') @@ -19,7 +22,7 @@ case "$1" in $UPSDPATH/upsmon >/dev/console 2>&1 touch /var/lock/subsys/upsmon fi - ;; + ;; 'stop') echo "NUT Stopping UPS monitor " /usr/bin/pkill -x upsmon diff --git a/scripts/Windows/DriverInstaller/README.txt b/scripts/Windows/DriverInstaller/README.adoc similarity index 83% rename from scripts/Windows/DriverInstaller/README.txt rename to scripts/Windows/DriverInstaller/README.adoc index a8984d5ca5..4e60a1ff93 100644 --- a/scripts/Windows/DriverInstaller/README.txt +++ b/scripts/Windows/DriverInstaller/README.adoc @@ -3,6 +3,8 @@ To easily compile `wdi-simple.exe`, unzip a copy of `libwdi` on your disk. Then set it up to be able to build following http://sourceforge.net/apps/mediawiki/libwdi/index.php?title=Install +NOTE: Modern development may be at https://github.com/pbatard/libwdi + Then copy `wdi-simple.c` and `nutscan-usb.h` into the "examples" subdirectory of libwdi directory. diff --git a/scripts/Windows/DriverInstaller/wdi-simple.c b/scripts/Windows/DriverInstaller/wdi-simple.c index ef83b9ac39..31d50b5e67 100644 --- a/scripts/Windows/DriverInstaller/wdi-simple.c +++ b/scripts/Windows/DriverInstaller/wdi-simple.c @@ -45,7 +45,9 @@ int __cdecl main(int argc, char** argv) struct wdi_options_install_driver oid = { 0 }; int c, r; int opt_silent = 0, opt_extract = 0, log_level = WDI_LOG_LEVEL_WARNING; -// int opt_silent = 0, opt_extract = 0, log_level = WDI_LOG_LEVEL_DEBUG; +/* + int opt_silent = 0, opt_extract = 0, log_level = WDI_LOG_LEVEL_DEBUG; +*/ char *inf_name = INF_NAME; char *ext_dir = DEFAULT_DIR; bool matching_device_found; @@ -55,7 +57,9 @@ int __cdecl main(int argc, char** argv) ocl.list_hubs = true; ocl.trim_whitespaces = true; opd.driver_type = WDI_LIBUSB0; -// opd.driver_type = WDI_WINUSB; +/* + opd.driver_type = WDI_WINUSB; +*/ wdi_set_log_level(log_level); @@ -63,7 +67,7 @@ int __cdecl main(int argc, char** argv) oprintf("-------------------------\n\n"); oprintf("Searching for known UPS...\n"); - // Try to match against a plugged device + /* Try to match against a plugged device */ matching_device_found = false; if (wdi_create_list(&ldev, &ocl) == WDI_SUCCESS) { r = WDI_SUCCESS; @@ -78,10 +82,14 @@ int __cdecl main(int argc, char** argv) dev.driver = NULL; dev.device_id = NULL; dev.hardware_id = NULL; -// oprintf("NUT device : vid : %0X - pid : %0X\n",dev.vid, dev.pid); +/* + oprintf("NUT device : vid : %0X - pid : %0X\n",dev.vid, dev.pid); +*/ for (ldev = ldev_start; (ldev != NULL) && (r == WDI_SUCCESS); ldev = ldev->next) { -// oprintf("trying vid : %0X - pid : %0X\n",ldev->vid, ldev->pid); +/* + oprintf("trying vid : %0X - pid : %0X\n",ldev->vid, ldev->pid); +*/ if ( (ldev->vid == dev.vid) && (ldev->pid == dev.pid) && (ldev->mi == dev.mi) ) { oprintf("Found UPS : vendor ID = %0X - Product ID = %0X\n",ldev->vid, ldev->pid, ldev->mi); dev.hardware_id = ldev->hardware_id; @@ -112,7 +120,7 @@ int __cdecl main(int argc, char** argv) } } - // No plugged USB device matches + /* No plugged USB device matches */ if (!matching_device_found) { oprintf("No known UPS device found.\nTry installing libUSB manually.\nHit enter to continue\n"); getc(stdin); diff --git a/scripts/Windows/Installer/.gitignore b/scripts/Windows/Installer/.gitignore index 5466afe66c..c3ce80fccc 100644 --- a/scripts/Windows/Installer/.gitignore +++ b/scripts/Windows/Installer/.gitignore @@ -1,4 +1,5 @@ NUT-Installer.msi NUT-Installer.wixobj NUT-Installer.wixpdb +NUT-Installer.xml log.txt diff --git a/scripts/Windows/Installer/NUT-Installer.xml b/scripts/Windows/Installer/NUT-Installer.xml.in similarity index 99% rename from scripts/Windows/Installer/NUT-Installer.xml rename to scripts/Windows/Installer/NUT-Installer.xml.in index 62661d9413..7348d6ac31 100644 --- a/scripts/Windows/Installer/NUT-Installer.xml +++ b/scripts/Windows/Installer/NUT-Installer.xml.in @@ -1,7 +1,7 @@ - - + + diff --git a/scripts/Windows/Installer/README.adoc b/scripts/Windows/Installer/README.adoc new file mode 100644 index 0000000000..fdf377fedd --- /dev/null +++ b/scripts/Windows/Installer/README.adoc @@ -0,0 +1,130 @@ +NUT for Windows Installer +========================= + +This component aims to provide an integrated installer for NUT on Windows, +including registration as the preferred handler of certain USB vendor and +product identifiers. + +Various waves of the NUT for Windows effort happened over the decades, with +the latest one being integration of the platform-specific source code which +was previously available in side projects, into the main Network UPS Tools +project and its continuous-integration builds, between NUT v2.8.0 and v2.8.1 +releases (over 2022-2023 time frame). + +NOTE: This document aims to revive institutional knowledge about producing +a NUT for Windows installer file. Currently builds of NUT for Windows are +quite possible, they can result in preparation of a tarball of an installed +directory tree which is immediately usable on Windows. However, separate +steps may be needed for USB specifically (so that NUT drivers and not the +default "HID Battery" handler can attach to the device) and for OS Service +integration. It is assumed that the installer would handle these rituals. + +Prerequisites for building NUT for Windows +------------------------------------------ + +Please see the documentation provided with the NUT sources about prerequisites +needed for semi-native builds (on Windows using MinGW x64 and MSYS2 projects) +and cross-builds (on Linux with mingw64 packages): + +* linkdoc:/docs/config-prereqs.txt +* linkdoc:/scripts/Windows/README.adoc + +With these dependencies in place, the common NUT `ci_build.sh` script can be +used to wrap the typical configuration, build and installation procedures. +Similar results can be of course achieved by direct use of the `configure` +script, which may be the way to go particularly for customized builds. + +See also `scripts/Windows/build-mingw-nut.sh` for the cross-build wrapper +details. + +Prerequisites for building the installer +---------------------------------------- + +NUT for Windows uses the WiX Toolset to codify and implement the installer: + +* https://wixtoolset.org/ +* https://wixtoolset.org/docs/intro/ +* https://wixtoolset.org/docs/tools/wixexe/ +* https://wixtoolset.org/docs/tools/heat/ +* link:https://wixtoolset.org/docs/v3/overview/candle/[candle.exe] and + link:https://wixtoolset.org/docs/v3/overview/light/[light.exe] tools + were used in current scripts (dating from 2013) but were obsoleted + after WiX v3 and became part of `wix.exe` according to + https://wixtoolset.org/docs/fourthree/ update notes +* https://github.com/wixtoolset/ +* https://github.com/wixtoolset/wix/ + +The toolset in turn requires the .NET framework (and the related NuGet tool) +which is available on Windows and Linux platforms, at least. In case of the +latter (for cross-builds) note that many of the newer distribution releases +should include dotnet packages in their repositories; for earlier releases +a Microsoft repository can be added -- as detailed in their documentation: + +* https://learn.microsoft.com/en-us/dotnet/core/install/linux +* https://dotnet.microsoft.com/en-us/download +* https://www.nuget.org/downloads + +For example, on Ubuntu the installation can be performed like this: +---- +:; sudo apt-get update && \ + sudo apt-get install -y dotnet-sdk-7.0 nuget +---- + +NOTE: For installation on Ubuntu 20.04 and older, where an additional +package repository is required, please see instructions at +https://learn.microsoft.com/en-us/dotnet/core/install/linux-ubuntu-2004 + +Subsequent installation of the toolset on either platform would be: +---- +:; dotnet tool install --global wix +---- + +Maintaining the recipes and building the installer artifact +----------------------------------------------------------- + +NOTE: To be investigated, modernized and completed per +https://github.com/networkupstools/nut/issues/1485 + +Files were not touched considerably since 2013 (or earlier?) and would +likely need deeper investigation and update to be useful. Findings so far: + +- Directory `scripts/Windows/DriverInstaller` contains a helper + program (currently named `wdi-simple`) for driver installation + +- Directory `scripts/Windows/Installer` (with this document) contains + the batch file script to call WiX tools (currently geared for WiX v3 + or older) and the XML file which describes the installer actions and + the file/directory structures it would deliver. + * It would be helpful to find how to generate the filesystem structure + (names, `GUID`s, what else?) based on the prototype area prepared by + `make install DESTDIR=...` during a NUT build. It does not have to + be part of *every* build (e.g. we can want this separated by driver + types to allow end-users to install just a subset of NUT, similar + to how this happens with multi-package approach on Unix/Linux) but + an automated process which makes maintenance easier would be great: + let a human sort where different filenames are categorized, and let + automation discover that some installed files are not mentioned or + some listed files are not present. + +- Directory `scripts/Windows/Installer/ImageFiles` contains various + resources used by the installer, including apparently `Others/` for + third-party files and `emptyDir` as a target for NUT `make install`? + * This may be moderately compatible with what the Makefile driven + installation does with current codebase -- especially how it pulls + third-party library DLL files into the prototype install area. + +- The `scripts/Windows/wininit.c` program provides a rough equivalent + to POSIX init scripts, to wrap various NUT daemons as a single unit. + Its git history saw several re-architecting decisions, so if there + are any concerns if the current version does "the right thing", we + have some precedent ideas to look at. To a lesser extent, similar + code might have appeared and disappeared in the Windows-branch code + of daemons like `upsd` and `upsmon` before it condensed in this one. + +The batch file and the XML manifest currently list a few libraries from +msys/mingw (as of back when this was coded). Current Makefile recipes +take a more active approach by walking the dynamic dependencies of the +built NUT binaries to copy those from the build environment. + +The batch file takes care to pass sample configuration and documentation +files through `unix2dos` -- keep this in mind for new implementations. diff --git a/scripts/Windows/Makefile.am b/scripts/Windows/Makefile.am index 1224cc8a00..52e4d927f8 100644 --- a/scripts/Windows/Makefile.am +++ b/scripts/Windows/Makefile.am @@ -1,33 +1,97 @@ -# Network UPS Tools: script/Windows +# Network UPS Tools: scripts/Windows AM_CFLAGS = -I$(top_srcdir)/include ../include/nut_version.h: FORCE - (cd ../include/ && $(MAKE) $(AM_MAKEFLAGS) nut_version.h) + +cd ../include/ && $(MAKE) $(AM_MAKEFLAGS) nut_version.h -EXTRA_DIST = winevent.mc build-mingw-nut.sh README +EXTRA_DIST = \ + winevent.mc \ + build-mingw-nut.sh \ + build-mingw-prereqs.sh \ + dllldd.sh \ + README.adoc \ + DriverInstaller/wdi-simple.c \ + DriverInstaller/README.adoc \ + Installer/README.adoc \ + Installer/BuildInstaller.bat \ + Installer/NUT-Installer.xml.in \ + Installer/ImageFiles/icons/completi.ico \ + Installer/ImageFiles/icons/info.ico \ + Installer/ImageFiles/icons/custicon.ico \ + Installer/ImageFiles/icons/Up.ico \ + Installer/ImageFiles/icons/exclamic.ico \ + Installer/ImageFiles/icons/powernut_Stop.ico \ + Installer/ImageFiles/icons/repairic.ico \ + Installer/ImageFiles/icons/New.ico \ + Installer/ImageFiles/icons/removico.ico \ + Installer/ImageFiles/icons/powernut_logo.ico \ + Installer/ImageFiles/icons/insticon.ico \ + Installer/ImageFiles/Images/NUT_wix_vertical.bmp \ + Installer/ImageFiles/Images/NUT_wix_horizontal.bmp \ + Installer/ImageFiles/Others/StopService.bat \ + Installer/ImageFiles/Others/StartService.bat \ + Installer/ImageFiles/emptyDir/man1/temp.txt \ + Installer/ImageFiles/emptyDir/cgi-bin/temp.txt \ + Installer/ImageFiles/emptyDir/pkgconfig/temp.txt \ + Installer/ImageFiles/emptyDir/include/temp.txt \ + Installer/ImageFiles/emptyDir/html/temp.txt \ + Installer/ImageFiles/emptyDir/man3/temp.txt \ + Installer/ImageFiles/emptyDir/run/temp.txt + +CLEANFILES = *-spellchecked */*-spellchecked + +bin_PROGRAMS = FORCE: if HAVE_MINGW_RESGEN +# Avoid "Using $< in a non-suffix rule context is a GNUmake idiom" by $? winevent.rc winevent.h: winevent.mc - $(WINDMC) $< + $(WINDMC) $? winevent.o: winevent.rc winevent.h $(WINDRES) winevent.rc winevent.o wininit.$(OBJEXT): winevent.h -bin_PROGRAMS = nut halt +# Some binutils packages (e.g. on Slackware 15) include windres and windmc +# tools, even though they do not deliver the rest of files such as windows.h +# that would be needed for actual builds targeting Windows. +if HAVE_WINDOWS +bin_PROGRAMS += nut halt nut_SOURCES = wininit.c nut_LDADD = ../../common/libcommon.la winevent.o halt_SOURCES = halt.c +endif HAVE_WINDOWS -CLEANFILES = winevent.rc winevent.o winevent.h +CLEANFILES += winevent.rc winevent.o winevent.h endif HAVE_MINGW_RESGEN +SPELLCHECK_SRC = README.adoc DriverInstaller/README.adoc Installer/README.adoc + +# NOTE: Due to portability, we do not use a GNU percent-wildcard extension. +# We also have to export some variables that may be tainted by relative +# paths when parsing the other makefile (e.g. MKDIR_P that may be defined +# via expanded $(top_builddir)/install_sh): +#%-spellchecked: % Makefile.am $(top_srcdir)/docs/Makefile.am $(abs_srcdir)/$(NUT_SPELL_DICT) +# +$(MAKE) -s -f $(top_builddir)/docs/Makefile $(AM_MAKEFLAGS) MKDIR_P="$(MKDIR_P)" builddir="$(builddir)" srcdir="$(srcdir)" top_builddir="$(top_builddir)" top_srcdir="$(top_srcdir)" SPELLCHECK_SRC_ONE="$<" SPELLCHECK_SRCDIR="$(srcdir)" SPELLCHECK_BUILDDIR="$(builddir)" $@ + +# NOTE: Portable suffix rules do not allow prerequisites, so we shim them here +# by a wildcard target in case the make implementation can put the two together. +*-spellchecked: Makefile.am $(top_srcdir)/docs/Makefile.am $(abs_srcdir)/$(NUT_SPELL_DICT) + +.sample.sample-spellchecked: + +$(MAKE) -s -f $(top_builddir)/docs/Makefile $(AM_MAKEFLAGS) MKDIR_P="$(MKDIR_P)" builddir="$(builddir)" srcdir="$(srcdir)" top_builddir="$(top_builddir)" top_srcdir="$(top_srcdir)" SPELLCHECK_SRC_ONE="$<" SPELLCHECK_SRCDIR="$(srcdir)" SPELLCHECK_BUILDDIR="$(builddir)" $@ + +.in.in-spellchecked: + +$(MAKE) -s -f $(top_builddir)/docs/Makefile $(AM_MAKEFLAGS) MKDIR_P="$(MKDIR_P)" builddir="$(builddir)" srcdir="$(srcdir)" top_builddir="$(top_builddir)" top_srcdir="$(top_srcdir)" SPELLCHECK_SRC_ONE="$<" SPELLCHECK_SRCDIR="$(srcdir)" SPELLCHECK_BUILDDIR="$(builddir)" $@ + +spellcheck spellcheck-interactive spellcheck-sortdict: + +$(MAKE) -f $(top_builddir)/docs/Makefile $(AM_MAKEFLAGS) MKDIR_P="$(MKDIR_P)" builddir="$(builddir)" srcdir="$(srcdir)" top_builddir="$(top_builddir)" top_srcdir="$(top_srcdir)" SPELLCHECK_SRC="$(SPELLCHECK_SRC)" SPELLCHECK_SRCDIR="$(srcdir)" SPELLCHECK_BUILDDIR="$(builddir)" $@ + MAINTAINERCLEANFILES = Makefile.in .dirstamp diff --git a/scripts/Windows/README b/scripts/Windows/README.adoc similarity index 99% rename from scripts/Windows/README rename to scripts/Windows/README.adoc index 80ebb908e3..a3ad9e67a0 100644 --- a/scripts/Windows/README +++ b/scripts/Windows/README.adoc @@ -8,7 +8,7 @@ NUT is now also available for the Microsoft Windows platform. This methodology (and Windows support in general) are currently experimental, so pull requests are welcome to tie up some loose ends (add more prerequisites, -test and fix programs, re-enable some code just commented away by ifdefs...) +test and fix programs, re-enable some code just commented away by `ifdef`s...) NOTE: It is possible to prepare a Windows machine with tools and prerequisites for building NUT natively, as detailed in `docs/config-prereqs.txt` and easily @@ -98,6 +98,7 @@ or (it can help to open two terminals and copy one ARCH into each and then the lines below into both of them; be sure to use separate directory trees for the unpacked build workspaces) + - for either-ARCH build environment further set: ------ :; export HOST_FLAG="--host=$ARCH" @@ -549,7 +550,7 @@ NOTE: Ability to `make docs` here relies on presence of `xmlto` program. In NUT CI workers prepared according to `docs/config-prereqs.txt` this should be among dependencies for `asciidoc`; beware that with prerequisites it has quite a large installation footprint. Alternately check PR #69, or consult -the makefiles for current `install` target definition to run its job without +the Makefiles for current `install` target definition to run its job without `install-docs` part (example posted below). #:; ( cd "$DLDIR" && git clone -b fix-mingw-cross https://github.com/jimklimov/neon neon-git ) @@ -728,7 +729,7 @@ BUILD_TYPE=cross-windows-mingw-64 ./ci_build.sh * an existing source tarball (can be fetched from NUT website): :; export SOURCEMODE=stable - ### Optionally: export VER_OPT=2.8.0 + ### Optionally: export VER_OPT=2.8.1 :; cd scripts/Windows/ :; ./build-mingw-nut.sh diff --git a/scripts/Windows/build-mingw-nut.sh b/scripts/Windows/build-mingw-nut.sh index b557ace3c6..a39765fb00 100755 --- a/scripts/Windows/build-mingw-nut.sh +++ b/scripts/Windows/build-mingw-nut.sh @@ -1,4 +1,7 @@ #!/bin/bash + +# NOTE: bash syntax (non-POSIX script) is used below! +# # script to cross compile NUT for Windows from Linux using MinGW-w64 # http://mingw-w64.sourceforge.net/ @@ -10,14 +13,18 @@ SCRIPTDIR="`cd "$SCRIPTDIR" && pwd`" DLLLDD_SOURCED=true . "${SCRIPTDIR}/dllldd.sh" # default to update source then build -WINDIR=$(pwd) -TOP_DIR=$WINDIR/../.. -BUILD_DIR=$WINDIR/nut_build -INSTALL_DIR=$WINDIR/nut_install + +# These paths are somewhat related: +[ -n "${WINDIR-}" ] || WINDIR="$(pwd)" +[ -n "${TOP_DIR-}" ] || TOP_DIR="$WINDIR/../.." + +# These may be located elsewhere: +[ -n "${BUILD_DIR-}" ] || BUILD_DIR="$WINDIR/nut_build" +[ -n "${INSTALL_DIR-}" ] || INSTALL_DIR="$WINDIR/nut_install" # This should match the tarball and directory name, # if a stable version is used: -[ -n "$VER_OPT" ] || VER_OPT=2.8.0 +[ -n "$VER_OPT" ] || VER_OPT=2.8.1 DEBUG=true # default to 32bits build @@ -30,19 +37,19 @@ fi [ -n "$SOURCEMODE" ] || SOURCEMODE="out-of-tree" -rm -rf $BUILD_DIR $INSTALL_DIR +rm -rf "$BUILD_DIR" "$INSTALL_DIR" CONFIGURE_SCRIPT="./configure" case "$SOURCEMODE" in stable) # FIXME # 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 https://www.networkupstools.org/source/$VER_OPT_SHORT/nut-$VER_OPT.tar.gz + if [ ! -s "nut-$VER_OPT.tar.gz" ] ; then + 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 - mv nut-$VER_OPT $BUILD_DIR + rm -rf "nut-$VER_OPT" + tar -xzf "nut-$VER_OPT.tar.gz" + mv "nut-$VER_OPT" "$BUILD_DIR" ;; dist) # In-place version (no download) @@ -52,8 +59,8 @@ dist) make dist SRC_ARCHIVE=$(ls -1 nut-?.?.?*.tar.gz | sort -n | tail -1) cd scripts/Windows - tar -xzf ../../$SRC_ARCHIVE - mv nut-?.?.?* $BUILD_DIR + tar -xzf "../../$SRC_ARCHIVE" + mv nut-?.?.?* "$BUILD_DIR" ;; out-of-tree) CONFIGURE_SCRIPT="../../../configure" @@ -65,11 +72,11 @@ out-of-tree) make distclean fi cd scripts/Windows - mkdir -p $BUILD_DIR + mkdir -p "$BUILD_DIR" ;; esac -cd $BUILD_DIR || exit +cd "$BUILD_DIR" || exit if [ -z "$INSTALL_WIN_BUNDLE" ]; then echo "NOTE: You might want to export INSTALL_WIN_BUNDLE=true to use main NUT Makefile" @@ -111,7 +118,7 @@ if [ "$cmd" == "all64" ] || [ "$cmd" == "b64" ] || [ "$cmd" == "all32" ] || [ "$ # location is passed to `make install` as DESTDIR below. $CONFIGURE_SCRIPT $HOST_FLAG $BUILD_FLAG --prefix=/ \ $KEEP_NUT_REPORT_FEATURE_FLAG \ - PKG_CONFIG_PATH=${ARCH_PREFIX}/lib/pkgconfig \ + PKG_CONFIG_PATH="${ARCH_PREFIX}/lib/pkgconfig" \ --without-pkg-config --with-all=auto \ --without-systemdsystemunitdir \ --with-pynut=app \ @@ -144,24 +151,29 @@ if [ "$cmd" == "all64" ] || [ "$cmd" == "b64" ] || [ "$cmd" == "all32" ] || [ "$ # (maybe even do "cp -pf" if some system dislikes "ln"); also # on a modern Windows one could go to their installed "sbin" to # mklink .\libupsclient-3.dll ..\bin\libupsclient-3.dll - (cd $INSTALL_DIR/bin && ln libupsclient*.dll ../sbin/) - (cd $INSTALL_DIR/bin && ln libupsclient*.dll ../cgi-bin/) || true + (cd "$INSTALL_DIR/bin" && ln libupsclient*.dll ../sbin/) + (cd "$INSTALL_DIR/cgi-bin" && ln ../bin/libupsclient*.dll ./) \ + || echo "NOTE: FAILED to process OPTIONAL cgi-bin directory; was NUT CGI enabled?" >&2 + + echo "NOTE: Adding third-party dependency libraries for each installed program" >&2 + echo " Do not worry about lack of libnut* and libups* in system locations" >&2 # Cover dependencies for nut-scanner (not pre-linked) # Note: lib*snmp*.dll not listed below, it is # statically linked into binaries that use it - (cd $INSTALL_DIR/bin && cp -pf ${ARCH_PREFIX}/bin/{libgnurx,libusb,libltdl}*.dll .) || true - (cd $INSTALL_DIR/bin && cp -pf ${ARCH_PREFIX}/lib/libwinpthread*.dll .) || true + (cd "$INSTALL_DIR/bin" && cp -pf "${ARCH_PREFIX}/bin"/{libgnurx,libusb,libltdl}*.dll .) || true + (cd "$INSTALL_DIR/bin" && cp -pf "${ARCH_PREFIX}/lib"/libwinpthread*.dll .) || true # Steam-roll over all executables/libs we have here and copy # over resolved dependencies from the cross-build environment: - (cd $INSTALL_DIR && { dllldddir . | while read D ; do cp -pf "$D" ./bin/ ; done ; } ) || true + (cd "$INSTALL_DIR" && { dllldddir . | while read D ; do cp -pf "$D" ./bin/ ; done ; } ) || true # Hardlink libraries for sbin (alternative: all bins in one dir): - (cd $INSTALL_DIR/sbin && { DESTDIR="$INSTALL_DIR" dllldddir . | while read D ; do ln -f ../bin/"`basename "$D"`" ./ ; done ; } ) || true + (cd "$INSTALL_DIR/sbin" && { DESTDIR="$INSTALL_DIR" dllldddir . | while read D ; do ln -f ../bin/"`basename "$D"`" ./ ; done ; } ) || true # Hardlink libraries for cgi-bin if present: - (cd $INSTALL_DIR/cgi-bin && { DESTDIR="$INSTALL_DIR" dllldddir . | while read D ; do ln -f ../bin/"`basename "$D"`" ./ ; done ; } ) || true + (cd "$INSTALL_DIR/cgi-bin" && { DESTDIR="$INSTALL_DIR" dllldddir . | while read D ; do ln -f ../bin/"`basename "$D"`" ./ ; done ; } ) \ + || echo "NOTE: FAILED to process OPTIONAL cgi-bin directory; was NUT CGI enabled?" >&2 fi echo "$0: install phase complete ($?)" >&2 diff --git a/scripts/Windows/build-mingw-prereqs.sh b/scripts/Windows/build-mingw-prereqs.sh index 6f6fa4cb77..90e0a9a8d5 100755 --- a/scripts/Windows/build-mingw-prereqs.sh +++ b/scripts/Windows/build-mingw-prereqs.sh @@ -1,9 +1,9 @@ #!/bin/sh -# Copyright (C) 2022 by Jim Klimov +# Copyright (C) 2022-2023 by Jim Klimov # Licensed same as NUT # -# Helper automating the nuances from NUT::scripts/Windows/README +# Helper automating the nuances from NUT::scripts/Windows/README.adoc # to provide prerequisites needed in semi-native or cross-builds. # # NOTE: Currently constrained to providing net-snmp under MSYS2. diff --git a/scripts/augeas/Makefile.am b/scripts/augeas/Makefile.am index b93033ee5b..dc5e924dee 100644 --- a/scripts/augeas/Makefile.am +++ b/scripts/augeas/Makefile.am @@ -1,7 +1,12 @@ +# Network UPS Tools: scripts/augeas EXTRA_DIST = gen-nutupsconf-aug.py.in nutupsconf.aug.tpl \ README.adoc tests/test_nut.aug +# Note: spellchecking is currently ensured by docs/Makefile.am +# due to inclusion into docs/developer-guide.txt, and the heading +# level may be also dictated by that. + PYTHON = @PYTHON@ # only call the script to generate Augeas ups.conf lens upon "make dist", diff --git a/scripts/augeas/README.adoc b/scripts/augeas/README.adoc index 9919ab798b..d70eada59f 100644 --- a/scripts/augeas/README.adoc +++ b/scripts/augeas/README.adoc @@ -12,11 +12,14 @@ In order to address this point, NUT now provides configuration tools and manipulation abstraction, to anybody who want to manipulate NUT configuration, through Augeas lenses and modules. -From link:http://augeas.net[Augeas homepage]: - -"Augeas is a configuration editing tool. It parses configuration files in their -native formats and transforms them into a tree. Configuration changes are made -by manipulating this tree and saving it back into native config files." +.From link:http://augeas.net[Augeas homepage]: +[quote] +____ +_Augeas is a configuration editing tool. It parses configuration files +in their native formats and transforms them into a tree. Configuration +changes are made by manipulating this tree and saving it back into +native config files._ +____ In other words, Augeas is the dreamed Registry, with all the advantages (such as a uniform interface and tools), and the added bonus of being @@ -39,11 +42,11 @@ are welcome). As an example, on Debian and derivatives, do the following: - $ apt-get install augeas-lenses augeas-tools + :; apt-get install augeas-lenses augeas-tools And optionally: - $ apt-get install libaugeas0 libaugeas-dev python-augeas + :; apt-get install libaugeas0 libaugeas-dev python-augeas On RedHat and derivatives, you have to install the packages 'augeas' and 'augeas-libs'. @@ -53,23 +56,23 @@ On RedHat and derivatives, you have to install the packages 'augeas' and NUT lenses and modules for Augeas ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -These are the *.aug files in the present directory. +These are the `*.aug` files in the present directory. You can either install the files to the right location on your system, -generally in '/usr/share/augeas/lenses/', or use these from NUT -source directory ('nut/scripts/augeas'). The latter is to be preferred for +generally in `/usr/share/augeas/lenses/`, or use these from NUT +source directory (`nut/scripts/augeas`). The latter is to be preferred for the time being. Create a test sandbox --------------------- -NOTE: for now, it's easier to include an existing /etc/nut/ directory. +NOTE: For now, it is easier to include an existing `/etc/nut/` directory. - $ export AUGEAS_ROOT=./augeas-sandbox - $ mkdir $AUGEAS_ROOT - $ sudo cp -pr /etc/nut $AUGEAS_ROOT - $ sudo chown -R $(id -nu):$(id -ng) $AUGEAS_ROOT + :; export AUGEAS_ROOT=./augeas-sandbox + :; mkdir $AUGEAS_ROOT + :; sudo cp -pr /etc/nut $AUGEAS_ROOT + :; sudo chown -R $(id -nu):$(id -ng) $AUGEAS_ROOT Start testing and using @@ -89,13 +92,13 @@ Shell Start an augeas shell using: - $ augtool -b + :; augtool -b -NOTE: if you have not installed NUT lenses, add '-I/path/to/nut/scripts/augeas'. +NOTE: If you have not installed NUT lenses, add `-I/path/to/nut/scripts/augeas`. From there, you can perform different actions like: -- list existing nut related files: +- list existing NUT-related files: augtool> ls /files/etc/nut/ nut.conf/ = (none) @@ -104,7 +107,7 @@ From there, you can perform different actions like: ups.conf/ = (none) upsd.conf/ = (none + -or using: +or using the matcher: + augtool> match /files/etc/nut/* /files/etc/nut/nut.conf = (none) @@ -112,21 +115,26 @@ or using: /files/etc/nut/upsmon.conf = (none) /files/etc/nut/ups.conf = (none) /files/etc/nut/upsd.conf = (none) - -NOTE: if you don't see anything, you may search for error messages by using: + +[NOTE] +====== +If you don't see anything, you may search for error messages by using: + augtool> ls /augeas/files/etc/nut/*/errors + and + augtool> get /augeas/files/etc/nut/ups.conf/error/message /augeas/files/etc/nut/ups.conf/error/message = Permission denied +====== -- create a new device entry (in ups.conf), called 'augtest': +- create a new device entry (in `ups.conf`), called `augtest`: augtool> set /files/etc/nut/ups.conf/augtest/driver dummy-ups augtool> set /files/etc/nut/ups.conf/augtest/port auto augtool> save -- list the devices using the 'usbhid-ups' driver: +- list the devices currently using the `usbhid-ups` driver: augtool> match /files/etc/nut/ups.conf/*/driver dummy-ups @@ -134,15 +142,15 @@ and C ~ -A library is available for C programs, along with pkg-config support. +A library is available for C programs, along with `pkg-config` support. You can get the compilation and link flags using the following code -in your configure script or Makefile: +in your program's `configure` script or `Makefile`: CFLAGS="`pkg-config --silence-errors --cflags augeas`" LDFLAGS="`pkg-config --silence-errors --libs augeas`" -Here is an code sample using this library for NUT configuration: +Here is a code sample using this library for NUT configuration: -------------------------------------------------------------------------------- augeas *a = aug_init(NULL, NULL, AUG_NONE); diff --git a/scripts/augeas/nutupsdconf.aug.in b/scripts/augeas/nutupsdconf.aug.in index 1592048387..09924cfe94 100644 --- a/scripts/augeas/nutupsdconf.aug.in +++ b/scripts/augeas/nutupsdconf.aug.in @@ -41,6 +41,7 @@ let path = word let upsd_maxage = [ opt_spc . key "MAXAGE" . sep_spc . store num . eol ] let upsd_trackingdelay = [ opt_spc . key "TRACKINGDELAY" . sep_spc . store num . eol ] let upsd_allow_no_device = [ opt_spc . key "ALLOW_NO_DEVICE" . sep_spc . store num . eol ] +let upsd_allow_not_all_listeners = [ opt_spc . key "ALLOW_NOT_ALL_LISTENERS" . sep_spc . store num . eol ] let upsd_statepath = [ opt_spc . key "STATEPATH" . sep_spc . store path . eol ] let upsd_listen = [ opt_spc . key "LISTEN" . sep_spc . [ label "interface" . store ip ] @@ -53,6 +54,7 @@ let upsd_certfile = [ opt_spc . key "CERTFILE" . sep_spc . store path . eol ] * MAXAGE seconds * TRACKINGDELAY seconds * ALLOW_NO_DEVICE Boolean + * ALLOW_NOT_ALL_LISTENERS Boolean * STATEPATH path * LISTEN interface port * Multiple lines each with one LISTEN address (or host name) and an optional @@ -65,7 +67,7 @@ let upsd_certfile = [ opt_spc . key "CERTFILE" . sep_spc . store path . eol ] * LISTEN 2001:0db8:1234:08d3:1319:8a2e:0370:7344 * *************************************************************************) -let upsd_other = upsd_maxage | upsd_trackingdelay | upsd_allow_no_device | upsd_statepath | upsd_listen_list | upsd_maxconn | upsd_certfile +let upsd_other = upsd_maxage | upsd_trackingdelay | upsd_allow_no_device | upsd_allow_not_all_listeners | upsd_statepath | upsd_listen_list | upsd_maxconn | upsd_certfile let upsd_lns = (upsd_other|comment|empty)* diff --git a/scripts/devd/.gitignore b/scripts/devd/.gitignore index 4c6801b08f..acf3d44dd3 100644 --- a/scripts/devd/.gitignore +++ b/scripts/devd/.gitignore @@ -1 +1,2 @@ nut-usb.conf* +nut-usb.quirks diff --git a/scripts/devd/Makefile.am b/scripts/devd/Makefile.am index 72a9031aab..e3a9967c2b 100644 --- a/scripts/devd/Makefile.am +++ b/scripts/devd/Makefile.am @@ -1,3 +1,4 @@ +# Network UPS Tools: scripts/devd if WITH_DEVD devdconfdir = $(devddir) @@ -7,7 +8,11 @@ if WITH_USB endif endif -EXTRA_DIST = README +if WITH_FREEBSD_QUIRKS_DIR + freebsdquirks_DATA = nut-usb.quirks +endif + +EXTRA_DIST = README.adoc MAINTAINERCLEANFILES = Makefile.in .dirstamp @@ -21,6 +26,31 @@ DISTCLEANFILES = nut-usb.conf # GENERATED_USB_OS_FILES): MAINTAINERCLEANFILES += nut-usb.conf.in MAINTAINERCLEANFILES += nut-usb.conf.in.AUTOGEN_WITHOUT +MAINTAINERCLEANFILES += nut-usb.quirks # Part of dist tarball, regardless of use for current build: -EXTRA_DIST += nut-usb.conf.in +EXTRA_DIST += nut-usb.conf.in nut-usb.quirks + +SPELLCHECK_SRC = README.adoc + +# NOTE: Due to portability, we do not use a GNU percent-wildcard extension. +# We also have to export some variables that may be tainted by relative +# paths when parsing the other makefile (e.g. MKDIR_P that may be defined +# via expanded $(top_builddir)/install_sh): +#%-spellchecked: % Makefile.am $(top_srcdir)/docs/Makefile.am $(abs_srcdir)/$(NUT_SPELL_DICT) +# +$(MAKE) -s -f $(top_builddir)/docs/Makefile $(AM_MAKEFLAGS) MKDIR_P="$(MKDIR_P)" builddir="$(builddir)" srcdir="$(srcdir)" top_builddir="$(top_builddir)" top_srcdir="$(top_srcdir)" SPELLCHECK_SRC_ONE="$<" SPELLCHECK_SRCDIR="$(srcdir)" SPELLCHECK_BUILDDIR="$(builddir)" $@ + +# NOTE: Portable suffix rules do not allow prerequisites, so we shim them here +# by a wildcard target in case the make implementation can put the two together. +*-spellchecked: Makefile.am $(top_srcdir)/docs/Makefile.am $(abs_srcdir)/$(NUT_SPELL_DICT) + +.sample.sample-spellchecked: + +$(MAKE) -s -f $(top_builddir)/docs/Makefile $(AM_MAKEFLAGS) MKDIR_P="$(MKDIR_P)" builddir="$(builddir)" srcdir="$(srcdir)" top_builddir="$(top_builddir)" top_srcdir="$(top_srcdir)" SPELLCHECK_SRC_ONE="$<" SPELLCHECK_SRCDIR="$(srcdir)" SPELLCHECK_BUILDDIR="$(builddir)" $@ + +.in.in-spellchecked: + +$(MAKE) -s -f $(top_builddir)/docs/Makefile $(AM_MAKEFLAGS) MKDIR_P="$(MKDIR_P)" builddir="$(builddir)" srcdir="$(srcdir)" top_builddir="$(top_builddir)" top_srcdir="$(top_srcdir)" SPELLCHECK_SRC_ONE="$<" SPELLCHECK_SRCDIR="$(srcdir)" SPELLCHECK_BUILDDIR="$(builddir)" $@ + +spellcheck spellcheck-interactive spellcheck-sortdict: + +$(MAKE) -f $(top_builddir)/docs/Makefile $(AM_MAKEFLAGS) MKDIR_P="$(MKDIR_P)" builddir="$(builddir)" srcdir="$(srcdir)" top_builddir="$(top_builddir)" top_srcdir="$(top_srcdir)" SPELLCHECK_SRC="$(SPELLCHECK_SRC)" SPELLCHECK_SRCDIR="$(srcdir)" SPELLCHECK_BUILDDIR="$(builddir)" $@ + +CLEANFILES = *-spellchecked diff --git a/scripts/devd/README b/scripts/devd/README deleted file mode 100644 index 71381dce49..0000000000 --- a/scripts/devd/README +++ /dev/null @@ -1,12 +0,0 @@ -On FreeBSD, devd has a similar role to udev on Linux. - -The devd.conf file defines actions to perform when devices are plugged in. - -The tools/nut-usbinfo.pl script generates nut-usb.conf.in by processing USB -macros in all of the drivers. In this case, the defined action for each -matching UPS is to change the permissions such that the NUT drivers can -access the devices without requiring root privileges. You may need to -restart devd and re-plug in the UPS to trigger the actions. - -The format of this configuration file should work with devd on FreeBSD 9.0 -and 9.1, at the very least. diff --git a/scripts/devd/README.adoc b/scripts/devd/README.adoc new file mode 100644 index 0000000000..baefb3a9fa --- /dev/null +++ b/scripts/devd/README.adoc @@ -0,0 +1,20 @@ +NUT USB integration resources for FreeBSD devd +============================================== + +On FreeBSD, the `devd` subsystem has a similar role to `udev` on Linux. + +NOTE: Some FreeBSD based systems rely on "quirks" instead. + +The `devd.conf` file defines actions to perform when devices are plugged in. + +The `tools/nut-usbinfo.pl` script (under NUT source tree root) generates +the `nut-usb.conf.in` here by processing USB macros in all of the drivers. +In this case, the defined action for each matching UPS is to change the +permissions such that the NUT drivers can access the USB device nodes +without requiring root privileges. + +You may need to restart `devd` and re-plug in the UPS (or reboot) after +installation of the file in order to trigger the actions. + +The format of this configuration file should work with `devd` on FreeBSD 9.0 +and 9.1, at the very least. diff --git a/scripts/hotplug/Makefile.am b/scripts/hotplug/Makefile.am index 6595084913..8888492885 100644 --- a/scripts/hotplug/Makefile.am +++ b/scripts/hotplug/Makefile.am @@ -1,4 +1,6 @@ -EXTRA_DIST = README +# Network UPS Tools: scripts/hotplug + +EXTRA_DIST = README.adoc if WITH_HOTPLUG hotplugusbdir = $(hotplugdir)/usb @@ -20,3 +22,27 @@ DISTCLEANFILES = libhidups # (technically, generated by tools/nut-usbinfo.pl script among # GENERATED_USB_OS_FILES): MAINTAINERCLEANFILES += libhid.usermap + +SPELLCHECK_SRC = README.adoc + +# NOTE: Due to portability, we do not use a GNU percent-wildcard extension. +# We also have to export some variables that may be tainted by relative +# paths when parsing the other makefile (e.g. MKDIR_P that may be defined +# via expanded $(top_builddir)/install_sh): +#%-spellchecked: % Makefile.am $(top_srcdir)/docs/Makefile.am $(abs_srcdir)/$(NUT_SPELL_DICT) +# +$(MAKE) -s -f $(top_builddir)/docs/Makefile $(AM_MAKEFLAGS) MKDIR_P="$(MKDIR_P)" builddir="$(builddir)" srcdir="$(srcdir)" top_builddir="$(top_builddir)" top_srcdir="$(top_srcdir)" SPELLCHECK_SRC_ONE="$<" SPELLCHECK_SRCDIR="$(srcdir)" SPELLCHECK_BUILDDIR="$(builddir)" $@ + +# NOTE: Portable suffix rules do not allow prerequisites, so we shim them here +# by a wildcard target in case the make implementation can put the two together. +*-spellchecked: Makefile.am $(top_srcdir)/docs/Makefile.am $(abs_srcdir)/$(NUT_SPELL_DICT) + +.sample.sample-spellchecked: + +$(MAKE) -s -f $(top_builddir)/docs/Makefile $(AM_MAKEFLAGS) MKDIR_P="$(MKDIR_P)" builddir="$(builddir)" srcdir="$(srcdir)" top_builddir="$(top_builddir)" top_srcdir="$(top_srcdir)" SPELLCHECK_SRC_ONE="$<" SPELLCHECK_SRCDIR="$(srcdir)" SPELLCHECK_BUILDDIR="$(builddir)" $@ + +.in.in-spellchecked: + +$(MAKE) -s -f $(top_builddir)/docs/Makefile $(AM_MAKEFLAGS) MKDIR_P="$(MKDIR_P)" builddir="$(builddir)" srcdir="$(srcdir)" top_builddir="$(top_builddir)" top_srcdir="$(top_srcdir)" SPELLCHECK_SRC_ONE="$<" SPELLCHECK_SRCDIR="$(srcdir)" SPELLCHECK_BUILDDIR="$(builddir)" $@ + +spellcheck spellcheck-interactive spellcheck-sortdict: + +$(MAKE) -f $(top_builddir)/docs/Makefile $(AM_MAKEFLAGS) MKDIR_P="$(MKDIR_P)" builddir="$(builddir)" srcdir="$(srcdir)" top_builddir="$(top_builddir)" top_srcdir="$(top_srcdir)" SPELLCHECK_SRC="$(SPELLCHECK_SRC)" SPELLCHECK_SRCDIR="$(srcdir)" SPELLCHECK_BUILDDIR="$(builddir)" $@ + +CLEANFILES = *-spellchecked diff --git a/scripts/hotplug/README b/scripts/hotplug/README deleted file mode 100644 index aa036e72a9..0000000000 --- a/scripts/hotplug/README +++ /dev/null @@ -1,38 +0,0 @@ -Desc: Hotplug script for NUT USB drivers -File: scripts/hotplug/README -Date: 8 January 2007 -Auth: Arnaud Quette - -This document introduces Linux Hotplug script for NUT USB -drivers (usbhid-ups, bcmxcp_usb and tripplite_usb). - -These are needed, on older Linux systems, to ensure the right -privileges are set on the usb files (i.e. allowing nut user -to read AND write to the UPS device). - -Alternative ------------ - -For newer 2.6 kernels with the udev mechanism, you should use the -scripts in scripts/udev instead of this one. - -Installation ------------- - -For most users, these files will be automatically installed in -/etc/hotplug upon "make install", if that directory exists. -You can specify an alternate directory by running: - - ./configure --with-hotplug-dir=DIR - -Manual installation -------------------- -These scripts can be used with Linux 2.4 to 2.6.13. - -- possibly change libhidups to match NUT user -- copy libhidups and libhid.usermap to /etc/hotplug/usb/ -- make libhidups executable with: - chmod a+x /etc/hotplug/usb/libhidups -- call update-usb.usermap or equivalent if needed - -You can then plug your UPS, and start NUT. diff --git a/scripts/hotplug/README.adoc b/scripts/hotplug/README.adoc new file mode 100644 index 0000000000..a53b6dac46 --- /dev/null +++ b/scripts/hotplug/README.adoc @@ -0,0 +1,46 @@ +Hotplug script for NUT USB drivers +================================== +Arnaud Quette +v1.0, 8 January 2007 (start date) + +This document introduces Linux Hotplug script for NUT USB +drivers (`usbhid-ups`, `bcmxcp_usb` and `tripplite_usb`). + +These are needed, on older Linux systems, to ensure the right +privileges are set on the USB device node files (i.e. allowing +`nut` user to read AND write to the UPS device). + + +Alternative +----------- + +For newer 2.6 kernels with the `udev` mechanism, you should use +the scripts in `scripts/udev` instead of this one. + + +Installation +------------ + +For most users, these files will be automatically installed in +`/etc/hotplug` upon `make install`, if that directory exists. + +You can specify an alternate directory by running: +---- +:; ./configure --with-hotplug-dir=DIR +---- + + +Manual installation +------------------- + +These scripts can be used with Linux 2.4 to 2.6.13. + +- possibly change `libhidups` to match NUT user +- copy `libhidups` and `libhid.usermap` to `/etc/hotplug/usb/` +- make `libhidups` executable with: +---- +:; chmod a+x /etc/hotplug/usb/libhidups +---- +- call `update-usb.usermap` or equivalent if needed + +You can then plug your UPS, and start NUT. diff --git a/scripts/installer/Makefile.am b/scripts/installer/Makefile.am new file mode 100644 index 0000000000..ae236cf88b --- /dev/null +++ b/scripts/installer/Makefile.am @@ -0,0 +1,57 @@ +# Network UPS Tools: scripts/installer + +EXTRA_DIST = \ + README.adoc \ + make_package.sh \ + version.sh \ + install.sh \ + uninstall-lsnw.sh \ + uninstall-ipp \ + nutconf-dummy \ + common_EN/license.txt \ + common_EN/install.res \ + common/solaris_init \ + common/ipp-shutdown-daemon.sh \ + common/README_ipp-os-shutdown.adoc \ + common/ipp-status \ + common/ipp.conf \ + common/ipp-wrapper \ + common/ipp-event.sh \ + common/string.sh \ + common/ipp-host-shutdown.sample \ + common/shutdown \ + common/ipp-notifier.sh \ + common/ipp-os-shutdown \ + common/init \ + common/aix_init \ + aix/ipp-os-shutdown.conf.sample \ + aix/aix_init \ + hpux/ipp-os-shutdown.conf.sample \ + solcmn/solaris_init \ + solcmn/ipp-os-shutdown.conf.sample + +SPELLCHECK_SRC = README.adoc common/README_ipp-os-shutdown.adoc + +# NOTE: Due to portability, we do not use a GNU percent-wildcard extension. +# We also have to export some variables that may be tainted by relative +# paths when parsing the other makefile (e.g. MKDIR_P that may be defined +# via expanded $(top_builddir)/install_sh): +#%-spellchecked: % Makefile.am $(top_srcdir)/docs/Makefile.am $(abs_srcdir)/$(NUT_SPELL_DICT) +# +$(MAKE) -s -f $(top_builddir)/docs/Makefile $(AM_MAKEFLAGS) MKDIR_P="$(MKDIR_P)" builddir="$(builddir)" srcdir="$(srcdir)" top_builddir="$(top_builddir)" top_srcdir="$(top_srcdir)" SPELLCHECK_SRC_ONE="$<" SPELLCHECK_SRCDIR="$(srcdir)" SPELLCHECK_BUILDDIR="$(builddir)" $@ + +# NOTE: Portable suffix rules do not allow prerequisites, so we shim them here +# by a wildcard target in case the make implementation can put the two together. +*-spellchecked: Makefile.am $(top_srcdir)/docs/Makefile.am $(abs_srcdir)/$(NUT_SPELL_DICT) + +.sample.sample-spellchecked: + +$(MAKE) -s -f $(top_builddir)/docs/Makefile $(AM_MAKEFLAGS) MKDIR_P="$(MKDIR_P)" builddir="$(builddir)" srcdir="$(srcdir)" top_builddir="$(top_builddir)" top_srcdir="$(top_srcdir)" SPELLCHECK_SRC_ONE="$<" SPELLCHECK_SRCDIR="$(srcdir)" SPELLCHECK_BUILDDIR="$(builddir)" $@ + +.in.in-spellchecked: + +$(MAKE) -s -f $(top_builddir)/docs/Makefile $(AM_MAKEFLAGS) MKDIR_P="$(MKDIR_P)" builddir="$(builddir)" srcdir="$(srcdir)" top_builddir="$(top_builddir)" top_srcdir="$(top_srcdir)" SPELLCHECK_SRC_ONE="$<" SPELLCHECK_SRCDIR="$(srcdir)" SPELLCHECK_BUILDDIR="$(builddir)" $@ + +spellcheck spellcheck-interactive spellcheck-sortdict: + +$(MAKE) -f $(top_builddir)/docs/Makefile $(AM_MAKEFLAGS) MKDIR_P="$(MKDIR_P)" builddir="$(builddir)" srcdir="$(srcdir)" top_builddir="$(top_builddir)" top_srcdir="$(top_srcdir)" SPELLCHECK_SRC="$(SPELLCHECK_SRC)" SPELLCHECK_SRCDIR="$(srcdir)" SPELLCHECK_BUILDDIR="$(builddir)" $@ + +CLEANFILES = *-spellchecked + +MAINTAINERCLEANFILES = Makefile.in .dirstamp diff --git a/scripts/installer/README.adoc b/scripts/installer/README.adoc new file mode 100644 index 0000000000..7c94a8be24 --- /dev/null +++ b/scripts/installer/README.adoc @@ -0,0 +1,29 @@ +NUT Installer (command-line) +============================ + +This directory contains scripts and data used for NUT packaging +marketed earlier as Eaton IPSS Unix (or IPP for Unix, or UPP), +a freely available download. Most of the work was done on behalf +of Eaton by Frederic Bohe, Vaclav Krpec, Arnaud Quette and Jim Klimov. + +This includes the package (tarball) creation script which relies on +presence of third-party library binaries in a `$ARCH/libs` directory, +and init-scripts from NUT source tree (originally expected as a "nut" +subdirectory), as well as an interactive installer script to set up +the package on a target deployment covering package (re-)installation, +initial device discovery, password setup, etc., and helper scripts +for status overview and shutdown handling. + +The installer relies on "nutconf" tool (emulating dummy script for +tests provided here), which is part of NUT sources. + +Note that heavy use of `LD_LIBRARY_PATH` in these scripts may become +counterproductive when the package is installed on a system that is +too many versions away from the intended target (e.g. mixing up the +symbols during dynamic linking), so while this contribution here is +published "as is", more work would be needed to make it useful in +modern environments. Helper scripts should be quickly useful though. + +Developed (pre-?)2013-2018 by Eaton; contributed to NUT 2022 by Eaton + +Maintained since 2024 by Jim Klimov diff --git a/scripts/installer/aix/aix_init b/scripts/installer/aix/aix_init new file mode 100755 index 0000000000..1ff2104499 --- /dev/null +++ b/scripts/installer/aix/aix_init @@ -0,0 +1,223 @@ +#! /bin/sh +# +# ups: Starts and stops the Network UPS Tools 2.6.5 built for IPP - Unix 1.40-4 on AIX +# Customizations copyright (c) 2015-2017, by Eaton (R) Corporation. All rights reserved. +# +# chkconfig: - 26 74 +# description: Network UPS Tools is a collection of programs which provide a common \ +# interface for monitoring and administering UPS hardware. +# processname: upsd +# config: /usr/local/ups/etc +# config: /etc/rc.ups +# +### BEGIN INIT INFO +# Provides: ups +# Required-Start: $syslog $network $named +# Required-Stop: $local_fs +# Default-Stop: 0 1 6 +# Short-Description: Starts the Network UPS tools +# Description: Network UPS Tools is a collection of programs which provide a common \ +# interface for monitoring and administering UPS hardware. +### END INIT INFO + +NUT_DIR="/usr/local/ups" +NUT_RUN_DIR="/var/run/nut" +NUT_LOCK_FILE="/var/locks/ups" +NUT_CFG_DIR="" +for D in "$NUT_DIR/etc" "/etc/nut" "/etc/ups" ; do + if [ -d "$D" ] && [ -f "$D/ups.conf" ] && [ -f "$D/ipp.conf" ] ; then + NUT_CFG_DIR="$D" + break + fi +done +unset D +CONFIG_IPP="$NUT_CFG_DIR/ipp.conf" +CONFIG_NUT="$NUT_CFG_DIR/nut.conf" + +# Source /etc/profile to get proper env. settings +#. /etc/profile + +# Note: $NUT_DIR/xbin holds the wrappers to run NUT binaries with co-bundled +# third party libs and hopefully without conflicts induced for the OS binaries +PATH="$NUT_DIR/xbin:$NUT_DIR/sbin:$NUT_DIR/bin:$PATH" +export PATH + +# Do not normally mangle the LD_LIBRARY_PATH - it can impact system tools too +#LD_LIBRARY_PATH="$NUT_DIR/lib:/usr/lib:/lib:$LD_LIBRARY_PATH" +#export LD_LIBRARY_PATH + + +success() { + echo OK +} + +failure() { + echo FAILED + return 1 +} + +# Resolve what processes should run +SERVER="no" +CLIENT="no" + +if [ -f "$CONFIG_NUT" ]; then + . "$CONFIG_NUT" + + case $MODE in + standalone|netserver) + SERVER="yes" + ;; + esac + + rpm -q nut-client >/dev/null 2>&1 && CLIENT="yes" +fi + +SHUTDOWN_TIMER=-1 +if [ -f "$CONFIG_IPP" ]; then + . "$CONFIG_IPP" +fi + +do_start() { + if [ "$SERVER" = "yes" ]; then + echo "Starting UPS driver controller: \c" + ( upsdrvctl start >/dev/null 2>&1 && success || failure ) || \ + RETVAL=$? + + echo "Starting upsd: \c" + ( upsd $UPSD_OPTIONS >/dev/null 2>&1 && success || failure ) || \ + RETVAL=$? + + echo "Cancel pending UPS powercycle, if any: \c" + if [ -x "${NUT_DIR}/init" ]; then + ( "${NUT_DIR}/init" > /dev/null 2>&1 && success || failure ) || \ + true #RETVAL=$? + fi + fi + + if [ "$CLIENT" = "yes" ]; then + echo "Starting UPS monitor: \c" + if [ "$SHUTDOWN_TIMER" -gt -1 ]; then + # This host wants early shutdown support, must be root + ( upsmon -p >/dev/null 2>&1 && success || failure ) || \ + RETVAL=$? + else + ( upsmon >/dev/null 2>&1 && success || failure ) || \ + RETVAL=$? + fi + fi + + [ "$RETVAL" = 0 ] && touch "${NUT_LOCK_FILE}" +} + +do_stop() { + if test -e "${NUT_RUN_DIR}/upsmon.pid" ; then + echo "Stopping UPS monitor: \c" + PID="`cat "${NUT_RUN_DIR}/upsmon.pid"`" + ( kill $PID && success || failure ) || \ + RETVAL=$? + rm "${NUT_RUN_DIR}/upsmon.pid" + fi + + if [ "$SERVER" = "yes" ]; then + if test -e "${NUT_RUN_DIR}/upsd.pid" ; then + echo "Stopping upsd: \c" + PID="`cat "${NUT_RUN_DIR}/upsd.pid"`" + ( kill -9 $PID && success || failure ) || \ + RETVAL=$? + rm "${NUT_RUN_DIR}/upsd.pid" + fi + + echo "Shutting down UPS driver controller: \c" + ( upsdrvctl stop > /dev/null 2>&1 && success || failure ) || \ + RETVAL=$? + fi + [ "$RETVAL" = 0 ] && rm -f "${NUT_LOCK_FILE}" +} + +do_restart() { + do_stop + waitmore=5 + while [ -n "`ls ${NUT_RUN_DIR}/`" -a "$waitmore" -ge 1 ] + do + sleep 1 + waitmore="`expr $waitmore - 1`" + done + do_start +} + +do_reload() { + # FIXME: upsd and upsmon always return 0 + # => can't tell if reload was successful + if [ "$SERVER" = "yes" ]; then + echo "Reloading upsd" + upsd -c reload || \ + RETVAL=$? + fi + + echo "Reloading upsmon" + upsmon -c reload || \ + RETVAL=$? +} + +RETVAL=0 +# See how we are called. +case "$1" in + start) + do_start ;; + + stop) + do_stop ;; + + restart) + do_restart ;; + + try-restart) + [ -f "${NUT_LOCK_FILE}" ] && do_restart || true + ;; + + reload) + do_reload ;; + + force-reload) + do_restart ;; + + status) + RETVAL_UPSD=0 + if [ "$SERVER" = "yes" ]; then + RETVAL_UPSD=1 + if test -f "${NUT_LOCK_FILE}" -o -s "${NUT_RUN_DIR}/upsd.pid" ; then + PID_UPSD="`cat "${NUT_RUN_DIR}/upsd.pid"`" && \ + test -n "$PID_UPSD" && \ + test -d "/proc/${PID_UPSD}" && \ + echo "upsd is running with PID $PID_UPSD" && \ + RETVAL_UPSD=0 + fi + if [ "$RETVAL_UPSD" != 0 ]; then + echo "upsd is NOT running!" >&2 + RETVAL=1 + fi + fi + + RETVAL_UPSMON=1 + if test -s "${NUT_RUN_DIR}/upsmon.pid" ; then + PID_UPSMON="`cat "${NUT_RUN_DIR}/upsmon.pid"`" && \ + test -n "$PID_UPSMON" && \ + test -d "/proc/${PID_UPSMON}" && \ + echo "upsmon is running with PID $PID_UPSMON" && \ + RETVAL_UPSMON=0 + elif rpm -q nut-client >/dev/null 2>&1; then : # default error remains in place - package present, service not running + else + RETVAL_UPSMON=0 + fi + if [ "$RETVAL_UPSMON" != 0 ]; then + echo "upsmon isn't running" >&2 + RETVAL=1 + fi + ;; + + *) + echo "Usage: $0 {start|stop|restart|try-restart|reload|force-reload|status}" + RETVAL=3 +esac + +exit $RETVAL diff --git a/scripts/installer/aix/ipp-os-shutdown.conf.sample b/scripts/installer/aix/ipp-os-shutdown.conf.sample new file mode 100644 index 0000000000..e0b25944d3 --- /dev/null +++ b/scripts/installer/aix/ipp-os-shutdown.conf.sample @@ -0,0 +1,33 @@ +# +# ipp-os-shutdown.conf +# +# Settings that specify typical shutdown commands for various supported OSes +# Version for AIX +# + +# The program which executes an OS shutdown, maybe including flags that +# disable its interactive mode +CMD_SHUTDOWN="/usr/sbin/shutdown" + +# Depending on OS and hardware support, "poweroff" option may tell the +# host's power source units to cut off their power to the motherboard, +# and "halt" may sit forever at the "OS is stopped" prompt or equivalent. +# NOTE: Yes, according to AIX man pages, the letters are not matched +# with the tag-words: "-p" leaves the machine halted and powered-on, +# and "-h" tries to kill power in the end. +SDFLAG_POWEROFF="-h" +SDFLAG_REBOOT="-r" +SDFLAG_HALT="-p" + +# The flag for quick stop (shorter service stop timeouts and fewer/no +# logs, or outright go to kill remaining processes) +SDFLAG_UNGRACEFUL="-F" + +# Trigger a shutdown without delay +SDFLAG_INSTANT="+0" + +## Filename to store the PID of a pending shutdown +## If this file is absent, the shutdown can not be canceled (killed) +## If the "${SHUTDOWN_PIDFILE}.irreversible" exists and points to running PID +## then the new shutdown can not be queued (caller must cancel old one first) +SHUTDOWN_PIDFILE="/var/run/nut/shutdown.pid" diff --git a/scripts/installer/common/README_ipp-os-shutdown.adoc b/scripts/installer/common/README_ipp-os-shutdown.adoc new file mode 100644 index 0000000000..c565cf9d75 --- /dev/null +++ b/scripts/installer/common/README_ipp-os-shutdown.adoc @@ -0,0 +1,254 @@ += README for the ipp-os-shutdown and early shutdown features in IPP - UNIX + +== General information + +This version of IPP - Unix includes enhanced scripts and configuration +which enable to configure "early shutdown" functionality on chosen hosts. +This allows selected systems to power themselves off after a certain +time that less than `$MINSUPPLIES` power sources are protected by UPSes +that are fully "ONLINE". + +In order for this to happen, a new configuration variable was introduced +in `ipp.conf` file, the `SHUTDOWN_TIMER` which allows to specify the +number of minutes that the power protection is insufficient, after which +the irreversible shutdown of this host begins. Default value for this +variable is `-1` which retains the standard behavior of staying up as +long as possible, and shutting down only when the UPS sends an alert +that too little battery runtime remains (as configured by default or +customized by `shutdown_duration` option for the `netxml-ups` driver). + +[NOTE] +NOTE: If this feature is used, it is recommended to specify the timeout +for an early-shutdown feature of at least 5 minutes (`SHUTDOWN_TIMER=5`). +Reason: When an NMC in the UPS is rebooted, it can announce dummy values +about the UPS and battery status for some time, while it is collecting +real data from the UPS hardware, and this data can cause a protected host +to begin an early shutdown needlessly. A sufficiently long `SHUTDOWN_TIMER` +value allows the host to receive real data from the UPS and so to cancel +the pending shutdown (if the battery is indeed well charged and the UPS +is really online). + +Another added option is `POWERDOWNFLAG_USER` which may be pre-set to +`enforce` or `forbid` to enable or disable UPS power-cycling at the +end of the shutdown procedure. Generally it does not need to be pre-set +in the `ipp.conf` file as the script relies on the `POWERDOWNFLAG` file +managed by `upsmon` (this in turn depends on whether `upsmon` triggered +the shutdown due to an alarm, such as low-battery condition, or just +the delayed early shutdown was used as scheduled by "notification"). +However it is possible to configure a specific behavior on this host, +e.g. to be sure to avoid power-cycling when early shutdown hosts are +shutting down due to whatever powerfail-driven reason. + +These options should be configured by an administrator of the particular +host in the `/usr/local/ups/etc/ipp.conf` file. + +When UPS events are processed by `upsmon` with its configured `NOTIFYCMD` +(the packaged `ipp-notifier.sh` script, enhanced for this delivery) it +has an ability to detect how many UPSes are `ONLINE` and how many are +required by the `MINSUPPLIES` setting. UPSes whose state is currently +`unknown` are not considered, in order to avoid erroneous shutdowns +while the communications are just starting up. If the protection is +deemed insufficient, the new `ipp-os-shutdown` script is launched, +which can invoke a customized copy of `ipp-host-shutdown.sample` script +for host-specific procedures (such as clusterware shutdown). + +The `ipp-os-shutdown` script has several roles: + +* it manages the delayed shutdown (which can be canceled before the timer +expires, and can not be aborted after the timer expires - so it proceeds +to the end) +* it wraps the call to a customized shutdown script, if one is configured +and detected +* it detects whether the UPSes should be told to power-cycle or not, +based on the `killpower` flag-file from `upsmon`, a setting in `ipp.conf` +file, or an explicit request from the caller of this shutdown script +* in the end it detects whether the UPSes came back online, so the host +should try to `reboot` rather than `poweroff` (unless a specific action +was requested by the caller of this shutdown script) and calls the OS +shutdown program to complete this activity +* the same script (with an option of zero delay) is configured as the +`SHUTDOWNCMD` in `upsmon.conf` so the same logic is executed in all +the different supported shutdown scenarios. + +It is recommended to configure certain `SHUTDOWN_TIMER` values for the +hosts which should shut down early and leave more battery runtime power +remaining for the more important hosts. Note that if the external power +returns after the early-shutdown hosts have powered off, they will stay +down until an administrator boots them. However, if the external power +becomes sufficient again during the shutdown procedure (checked between +cluster-ware shutdown and the OS shutdown steps) then a reboot of the +host is requested instead of a power-off. + +It is recommended to configure `SHUTDOWN_TIMER=-1` (default) on those +more important hosts which should stay up as long as possible and only +shut down if all required UPSes have posted a low-battery status or +forced-shutdown command. These hosts would by default schedule delayed +UPS power-cycling. To be on the safe side, sufficient `shutdown_duration` +seconds should be configured in their `netxml-ups` driver blocks in the +`/usr/local/ups/etc/ups.conf` file on the host. + +If the customer elects to use the early shutdown strategy for all hosts, +the `POWERDOWNFLAG_USER=enforce` should be configured in the hosts with +the highest `SHUTDOWN_TIMER` value so they would cause UPS power-cycling. +Do not forget to define sufficient `DELAY` value for the OS shutdown to +complete before the UPS turns itself off. The UPS would turn on the load +automatically after some time, when external power is back and it has +charged the battery sufficiently (configurable in the Network Management +web-interface for the UPS). + +== Installation + +* Install the package as usual + +- Un-compress the `ipp-*.tar.gz` archive for your OS + +- Change into the resulting `ipp-*` subdirectory + +- (optional) If a complete re-installation is desired (including removal +of old configuration files so they do not conflict with the new delivery), +please also execute `IPP_WIPE_OLD_CONFIG=yes; export IPP_WIPE_OLD_CONFIG` +in the shell before running the installation script + +- Launch the `install.sh` script and follow the installer instructions + +* Configure the early shutdown timer + +You can later change the early shutdown timer, for the cluster nodes, +by editing `/usr/local/ups/etc/ipp.conf`, and set `SHUTDOWN_TIMER` to +a suitable value (in minutes). + +* Configure clusterware shutdown command + +You can configure the variable `SHUTDOWNSCRIPT_CUSTOM` in `ipp.conf` to +point at a custom complementary shutdown script with a shutdown routine +required by this particular host, which will be called by the master +powerfail shutdown script (`/usr/local/ups/sbin/ipp-os-shutdown`). +This variable is not set by default. + +* Configure operating system shutdown command and options + +Optionally, modify the operating system shutdown command and type. +To modify the shutdown command or specific option for the various types +of shutdown), edit the file `/usr/local/ups/etc/ipp-os-shutdown.conf` +and set or adapt the variables: + +- `CMD_SHUTDOWN` to point at the shutdown command. This may include +the basic mandatory option options, such as the non-interactive flag +(`-y`) on some OS such as HP-UX or Solaris, +- `SDFLAG_*` to point at the right option for poweroff, reboot or halt. + +Note that depending on the OS and hardware features, there may be no +difference between "halt" (stop the OS and keep the hardware running) +and a "poweroff" (halt and instruct the server's PSU to cut the power +going to the motherboard -- if that is supported; might be unavailable +in e.g. virtualized environments or older hardware). + +To modify the default shutdown option to halt or reboot, edit the file +`/usr/local/ups/etc/ipp.conf` and set `SDFLAG_POWERSTATE_DEFAULT` to +either `$SDFLAG_HALT` (halt) or `$SDFLAG_REBOOT` (reboot). + +* (optionally) Configure UPS power-cycling + +If the customer elects to use the early shutdown strategy for all hosts, +the `POWERDOWNFLAG_USER=enforce` should be configured in the `ipp.conf` +file on hosts with the highest `SHUTDOWN_TIMER` value so they would cause +UPS power-cycling explicitly. By default, it may be enabled or forbidden +depending on the cause of shutdown. + +Make sure to define a sufficient `DELAY` value (in seconds) as well, for +the OS shutdown to complete safely before the UPS(es) power is cut. + + +== Testing + +The following points about this delivery were verified on AIX 7.1 and +Solaris 11. It was tested: + +- to be installable (and runnable via init-script) + +- to work as a `SHUTDOWNCMD` handler, including interaction with the +killpower flag-file maintained by `upsmon` (with the default setting +of `SHUTDOWN_TIMER=-1` in the `ipp.conf` file) + +- to report progress of the powerfail shutdown onto the system consoles +(with `wall`) and into the `syslog` (note: default syslog priority from +IPP - Unix is `user.notice` which may be ignored by default `syslog` +configuration, check with `/etc/syslog.conf` or equivalent in your OS). + +- to execute early shutdown when `SHUTDOWN_TIMER=5` (after 5 minutes +ONBATT) is defined manually in the `ipp.conf` file + +- to cancel shutdown if power returns back before timeout expires + +- to not cancel shutdown if power returns back after timeout expires +and shutdown routine has started (and reported to be irreversible) + +- to report that the shutdown is in irreversible stage, as reaction +to CTRL+C during console-run invocations like `ipp-os-shutdown -t now` + +- to execute custom shutdown script if it is found, and to skip it +if not available + +- to power-off the protected host if power remains lost at the moment +when we are about to proceed to `/sbin/shutdown` + +- to reboot the host if power is already back when we are about to +proceed to `/sbin/shutdown` + +- to set the `netxml-ups` driver argument `shutdown_timer` during +installation to a value which matches the chosen `SHUTDOWN_TIMER` +(if it is non-negative) so the selected ONBATT timeout is shown in +the Eaton NMC Web-GUI + +- to implement numerous fixes and improvements in the `install.sh` +script, including integration of new settings for early shutdown +and UPS power-cycling strategy + + +=== A few important notes helpful during testing + +* currently running IPP - Unix processes, UPS states and the pending +shutdown status can be queried with the following command: + +---- +:; ps -ef | grep -v grep | egrep 'ipp|ups|nut|shut|sleep' ; \ + ls -la /usr/local/ups/etc/killpower ; \ + /usr/local/ups/bin/ipp-status; \ + /usr/local/ups/sbin/ipp-os-shutdown -s; date +---- + +* a pending shutdown that is not yet irreversible can be aborted +manually with: + +---- +:; /usr/local/ups/sbin/ipp-os-shutdown -c +---- + +* the administrator can create a special file to abort the script +just before proceeding to irreversible shutdown; this is automated +in the `ipp-os-shutdown` script (undocumented option): + +---- +:; /usr/local/ups/sbin/ipp-os-shutdown block +---- + +Do not forget to remove this file when testing is completed to +allow actual shutdowns to happen: + +---- +:; /usr/local/ups/sbin/ipp-os-shutdown unblock +---- + +* also note that if the host is booted with an administrative +action while the remaining UPS battery runtime is under the +threshold set with `shutdown_duration`, an emergency powerfail +can be triggered by the `netxml-ups` driver as soon as IPP - Unix +services are initialized, even if the battery state is "CHARGING". + +To avoid such shutdowns, an administrator can log in and quickly +create the special file described above (temporarily). + +The recommended procedure is to wait for the hosts to boot up in +due time, when the batteries are charged enough to survive another +power failure (if one occurs) at least for as long as it takes to +shut down the server gracefully. diff --git a/scripts/installer/common/aix_init b/scripts/installer/common/aix_init new file mode 100755 index 0000000000..e4ae5af425 --- /dev/null +++ b/scripts/installer/common/aix_init @@ -0,0 +1,183 @@ +#! /bin/sh +# +# ups: Starts the Network UPS Tools for IPP - Unix +# Customizations copyright (c) 2015, by Eaton (R) Corporation. All rights reserved. +# +# chkconfig: - 26 74 +# description: Network UPS Tools is a collection of programs which provide a common \ +# interface for monitoring and administering UPS hardware. +# processname: upsd +# config: /usr/local/ups/etc +# config: /etc/rc.ups +# +### BEGIN INIT INFO +# Provides: ups +# Required-Start: $syslog $network $named +# Required-Stop: $local_fs +# Default-Stop: 0 1 6 +# Short-Description: Starts the Network UPS tools +# Description: Network UPS Tools is a collection of programs which provide a common \ +# interface for monitoring and administering UPS hardware. +### END INIT INFO + +NUT_DIR="/usr/local/ups" + +# Source /etc/profile to get proper env. settings +. /etc/profile + +LD_LIBRARY_PATH="${NUT_DIR}/lib:$LD_LIBRARY_PATH" +export LD_LIBRARY_PATH + +success() { + echo OK +} + +failure() { + echo FAILED + return 1 +} + +# Resolve what processes should run +SERVER="no" +CLIENT="no" + +if [ -f ${NUT_DIR}/etc/nut.conf ]; then + . ${NUT_DIR}/etc/nut.conf + + case $MODE in + standalone|netserver) + SERVER="yes" + ;; + esac + + rpm -q nut-client >/dev/null 2>&1 && CLIENT="yes" +fi + +SHUTDOWN_TIMER=-1 +if [ -f ${NUT_DIR}/etc/ipp.conf ]; then + . ${NUT_DIR}/etc/ipp.conf +fi + +do_start() { + if [ "$SERVER" = "yes" ]; then + echo "Starting UPS driver controller: \c" + ( ${NUT_DIR}/sbin/upsdrvctl start >/dev/null 2>&1 && success || failure ) || \ + RETVAL=$? + + echo "Starting upsd: \c" + ( ${NUT_DIR}/sbin/upsd $UPSD_OPTIONS >/dev/null 2>&1 && success || failure ) || \ + RETVAL=$? + + if [ -x ${NUT_DIR}/init ]; then + ( ${NUT_DIR}/init > /dev/null 2>&1 && success || failure ) || \ + RETVAL=$? + fi + fi + + if [ "$CLIENT" = "yes" ]; then + echo "Starting UPS monitor: \c" + if [ "$SHUTDOWN_TIMER" -gt -1 ]; then + # This host wants early shutdown support, must be root + ( ${NUT_DIR}/sbin/upsmon -p >/dev/null 2>&1 && success || failure ) || \ + RETVAL=$? + else + ( ${NUT_DIR}/sbin/upsmon >/dev/null 2>&1 && success || failure ) || \ + RETVAL=$? + fi + fi + + [ "$RETVAL" = 0 ] && touch /var/locks/ups +} + +do_stop() { + if test -e /var/run/nut/upsmon.pid; then + echo "Stopping UPS monitor: \c" + PID=`cat /var/run/nut/upsmon.pid` + ( kill $PID && success || failure ) || \ + RETVAL=$? + rm /var/run/nut/upsmon.pid + fi + + if [ "$SERVER" = "yes" ]; then + if test -e /var/run/nut/upsd.pid; then + echo "Stopping upsd: \c" + PID=`cat /var/run/nut/upsd.pid` + ( kill -9 $PID && success || failure ) || \ + RETVAL=$? + rm /var/run/nut/upsd.pid + fi + + echo "Shutting down UPS driver controller: \c" + ( ${NUT_DIR}/sbin/upsdrvctl stop > /dev/null 2>&1 && success || failure ) || \ + RETVAL=$? + fi + [ "$RETVAL" = 0 ] && rm -f /var/locks/ups +} + +do_restart() { + do_stop + waitmore=5 + while [ -n "$(ls /var/run/nut/)" -a $waitmore -ge 1 ] + do + sleep 1 + waitmore=$((waitmore-1)) + done + do_start +} + +do_reload() { + # FIXME: upsd and upsmon always return 0 + # => can't tell if reload was successful + if [ "$SERVER" = "yes" ]; then + echo "Reloading upsd" + ${NUT_DIR}/sbin/upsd -c reload || \ + RETVAL=$? + fi + + echo "Reloading upsmon" + ${NUT_DIR}/sbin/upsmon -c reload || \ + RETVAL=$? +} + +RETVAL=0 +# See how we are called. +case "$1" in + start) + do_start ;; + + stop) + do_stop ;; + + restart) + do_restart ;; + + try-restart) + [ -f /var/locks/ups ] && do_restart || true + ;; + + reload) + do_reload ;; + + force-reload) + do_restart ;; + + status) + if [ "$SERVER" = "yes" ]; then + if test -f /var/locks/ups; then + echo "upsd is running with PID" `cat /var/run/nut/upsd.pid` + fi + fi + + if test -e /var/run/nut/upsmon.pid; then + echo "upsmon is running with PID" `cat /var/run/nut/upsmon.pid` + elif rpm -q nut-client >/dev/null 2>&1; then + echo "upsmon isn't running" + fi + ;; + + *) + echo "Usage: $0 {start|stop|restart|try-restart|reload|force-reload|status}" + RETVAL=3 +esac + +exit $RETVAL diff --git a/scripts/installer/common/init b/scripts/installer/common/init new file mode 100755 index 0000000000..04e1f08cce --- /dev/null +++ b/scripts/installer/common/init @@ -0,0 +1,80 @@ +#!/bin/sh +# init +# +# Copyright (c) 2013-2017, by Eaton (R) Corporation. All rights reserved. +# +# A shell script to command UPSes to disable delayed power off of outlet +# groups, which could have ben requested as part of the emergency shutdown +# driven by IPP - Unix (NUT); called from nut init-script +# +# Requires configuration from ipp.conf, or otherwise default to the values below +# Also requires matching features to be available in the UPSes and their drivers +# +# TODO remaining per IPSSUNIX-29: +# * Mismatch against the `shutdown` script: during shutdown we set +# `load.on.delay` and `load.off.delay` via `upscmd` for the UPS itself, +# as well as `upsrw` the similar settings for outlet groups, but during +# the `init` we reset to `-1` only the outlet group settings and not +# those of the UPS itself +# * The script acts on ALL UPSes configured on this system (`upsc -l`), +# rather than those MONITORed as feeding a non-zero amount +# power-sources in `upsmon.conf` +# * The username is hardcoded as `admin` rather than taken from config +# * Maybe we do not try every possible instcmd for UPS poweroff/reboot - +# revise against upsrw and upscmd for NETXML and SNMP drivers at least + +NUT_DIR="/usr/local/ups" +NUT_CFG_DIR="" +for D in "$NUT_DIR/etc" "/etc/nut" "/etc/ups" ; do + if [ -d "$D" ] && [ -f "$D/ups.conf" ] && [ -f "$D/ipp.conf" ] ; then + NUT_CFG_DIR="$D" + break + fi +done +unset D +CONFIG_IPP="$NUT_CFG_DIR/ipp.conf" + +# Note: $NUT_DIR/xbin holds the wrappers to run NUT binaries with co-bundled +# third party libs and hopefully without conflicts induced for the OS binaries +PATH="$NUT_DIR/xbin:$NUT_DIR/sbin:$NUT_DIR/bin:$PATH" +export PATH + +# Search for binaries under current PATH normally, no hardcoding +NUT_UPSC="upsc" +NUT_UPSCMD="upscmd" +NUT_UPSRW="upsrw" +#NUT_UPSC="$NUT_DIR/xbin/upsc" +#NUT_UPSCMD="$NUT_DIR/xbin/upscmd" +#NUT_UPSRW="$NUT_DIR/xbin/upsrw" + +# Do not normally mangle the LD_LIBRARY_PATH - it can impact system tools too +#LD_LIBRARY_PATH="$NUT_DIR/lib:/usr/lib:/lib:$LD_LIBRARY_PATH" +#export LD_LIBRARY_PATH + +# Include IPP ipp.conf (may overwrite the above default values!) to +# get shutdown delay and admin password +if [ -f "$CONFIG_IPP" ] ; then + . "$CONFIG_IPP" +fi + +if [ "$IPP_DEBUG" = yes ] ; then + # Keep entries with the same log as shutdown + exec >> /var/tmp/ipp-shutdown.log 2>&1 + echo "`date`: Started booting: $0 $*" >&2 + set >&2 + set -x +fi + +[ "$POWERDOWNFLAG_USER" = "forbid" ] && exit 0 + +# TODO: Here we want to refine the list to only MONITORed UPSes that power us? +# Convert to parsing of "ipp-status -p" which reports all needed details +upslist="`"$NUT_UPSC" -l`" +echo "$upslist" +for u in $upslist; do + echo "Disabling poweroff for UPS outlet-groups on '$u' ..." + for o in 3 2 1 ; do + "$NUT_UPSRW" -s "outlet.$o.delay.shutdown=-1" \ + -u admin -p "$PASSWORD" "$u" + done +done diff --git a/scripts/installer/common/ipp-event.sh b/scripts/installer/common/ipp-event.sh new file mode 100644 index 0000000000..3a04844616 --- /dev/null +++ b/scripts/installer/common/ipp-event.sh @@ -0,0 +1,53 @@ +#THIS IS WORK IN PROGRESS, THIS IS NOT FUNCTIONAL +exit + +#!/bin/sh +# ipp-event +# +# Copyright (c) 2013-2017, by Eaton (R) Corporation. All rights reserved. +# +# A shell script to manage event from IPP - Unix (NUT) +# It needs ipp.conf file. +# + +NUT_DIR="/usr/local/ups" + +NUT_CFG_DIR="" +for D in "$NUT_DIR/etc" "/etc/nut" "/etc/ups" ; do + if [ -d "$D" ] && [ -f "$D/ups.conf" ] && [ -f "$D/ipp.conf" ] ; then + NUT_CFG_DIR="$D" + break + fi +done +unset D +CONFIG_IPP="$NUT_CFG_DIR/ipp.conf" + +# Note: $NUT_DIR/xbin holds the wrappers to run NUT binaries with co-bundled +# third party libs and hopefully without conflicts induced for the OS binaries +PATH="$NUT_DIR/xbin:$NUT_DIR/sbin:$NUT_DIR/bin:$PATH" +export PATH + +# Search for binaries under current PATH normally, no hardcoding. Scripts: +CMD_NOTIFIER="ipp-notifier.sh" +DAEMON="ipp-shutdown-daemon.sh" +#CMD_NOTIFIER="$NUT_DIR/bin/ipp-notifier.sh" +#DAEMON="$NUT_DIR/bin/ipp-shutdown-daemon.sh" + +if [ -f "$CONFIG_IPP" ] ; then + . "$CONFIG_IPP" +fi + +#call notifier script +$CMD_NOTIFIER "$*" & + +PROC="`ps -ef | grep "$DAEMON" | awk -F" " '{print $2}'`" +case "$1" in + ONBATT) + if [ $PROC = "" ];then + $DAEMON & + fi + ;; + ONLINE) + kill -9 $PROC + ;; +esac diff --git a/scripts/installer/common/ipp-host-shutdown.sample b/scripts/installer/common/ipp-host-shutdown.sample new file mode 100644 index 0000000000..497cbadc92 --- /dev/null +++ b/scripts/installer/common/ipp-host-shutdown.sample @@ -0,0 +1,80 @@ +#!/bin/sh +# +# Script for custom emergency powerfail shutdown of a host to do actions that +# were not implemented as part of normal OS shutdown routine for some reason. +# Must run as root or with sufficient privileges to execute the actions. +# Can print to >&3 some shell lines that would be sourced by the main script. +# Copyright (c) 2013-2015, by Eaton (R) Corporation. All rights reserved. +# +# Note: This file (ipp-host-shutdown.sample) is delivered by the package and +# will be overwritten in case of upgrades. It is an example implementation of +# a host-specific shutdown routine; make a copy, preferably with a name unique +# to a host-role in your deployment, and reference it from `ipp.conf` with the +# `SHUTDOWNSCRIPT_CUSTOM` variable. + +# Notification configuration is normally exported by `ipp-os-shutdown` +#CONSOLE_NOTIF=1 +#SYSLOG_NOTIF=1 +#CMD_WALL="wall" +#CMD_SYSLOG="logger" + +[ -z "${DefaultSubject-}" ] && \ + DefaultSubject="Intelligent Power Protector (IPP) Emergency Shutdown" +[ -z "${MessageCustomShutdownStarting_s-}" ] && \ + MessageCustomShutdownStarting_s="Initiating custom shutdown for %s..." +[ -z "${MessageCustomShutdownCompleted_s-}" ] && \ + MessageCustomShutdownCompleted_s="Custom shutdown for %s is completed" +[ -z "${MessageIrreversibleTrap-}" ] && \ + MessageIrreversibleTrap="Sorry, the powerfail shutdown is now irreversible, you should not abort it!" + +# String with current timestamp (for logging) +ldate="" +get_ldate() { + ldate="`date +\"%y-%m-%d - %H:%M:%S\"`" && return 0 + # Optional first argument can contain the default value + if [ -n "$1" ] ; then ldate="$1" ; else ldate="`date`"; fi +} + +logmsg() { + # The argument string is wrapped with formalities and + # logged into echo > stdout, syslog and wall + echo "${ldate}: $*" + if [ "$CONSOLE_NOTIF" -eq 1 -a -n "$CMD_WALL" ]; then + echo "${DefaultSubject}\n$* at ${ldate}" | $CMD_WALL 2>/dev/null + fi + if [ "$SYSLOG_NOTIF" -eq 1 -a -n "$CMD_SYSLOG" ]; then + $CMD_SYSLOG -t eaton-ipp "$*" 2>/dev/null + fi +} + +# The custom shutdown routine if clusterware is present +if [ -x /etc/init.d/NONEXISTENT/clusterware ]; then + get_ldate + logmsg $(printf "$MessageCustomShutdownStarting_s" "clusterware") + + trap 'echo "$MessageIrreversibleTrap">&2' 1 2 3 15 + + # Launch the cluster shutdown command + /etc/init.d/NONEXISTENT/clusterware stop + + # Sleep after/during(?) cluster shutdown + # This cycle allows to keep ignoring CTRL+C and equivalents + # (a single sleep is indeed broken out of despite our traps) + N=300 + while [ $N -gt 0 ]; do + N="`expr $N - 1`" + sleep 1 + done + + # By default, after clusterware stop there's nothing fragile left + # so we can ask for fast shutdown + [ -z "${SDFLAG_COMMONOPTIONS-}" ] && \ + echo 'SDFLAG_COMMONOPTIONS="$SDFLAG_UNGRACEFUL"' >&3 + + get_ldate + logmsg $(printf "$MessageCustomShutdownCompleted_s" "clusterware") + + trap '-' 1 2 3 15 +fi + +exit 0 diff --git a/scripts/installer/common/ipp-notifier.sh b/scripts/installer/common/ipp-notifier.sh new file mode 100644 index 0000000000..1612c08716 --- /dev/null +++ b/scripts/installer/common/ipp-notifier.sh @@ -0,0 +1,177 @@ +#!/bin/sh +# ipp-notifier +# +# Copyright (c) 2013-2017, by Eaton (R) Corporation. All rights reserved. +# +# A shell script to send e-mail from IPP - Unix (NUT) +# Sends an email messages to one user to notify of a power event. +# +# Requires configuration from ipp.conf, or otherwise default to the values below +# +# MC2 Sync: +# mc2/scripts/lang/eng.lbl (msg) +# mc2/scripts/libs/labels.js (ldate, nodeName, Default{Subject,Message} +# +# TODO per IPSSUNIX-36: +# * There is no error-checking, e.g. a `mailx` command can break due to +# unknown parameters (say, `smtp-use-starttls` is not known in Solaris) +# * The two codepaths for email are a) local delivery with no "@" in +# recipient, or b) Full delivery using a remote relay, with account +# and password, etc. - assuming all variables for this are configured. +# There is no codepath for delivery to remote account via local relay. + +NUT_DIR="/usr/local/ups" +NUT_CFG_DIR="" +for D in "$NUT_DIR/etc" "/etc/nut" "/etc/ups" ; do + if [ -d "$D" ] && [ -f "$D/ups.conf" ] && [ -f "$D/ipp.conf" ] ; then + NUT_CFG_DIR="$D" + break + fi +done +unset D +CONFIG_IPP="$NUT_CFG_DIR/ipp.conf" + +PATH="$PATH:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin:/usr/ucb:/usr/ccs/bin:/usr/xpg4/bin:/usr/xpg6/bin" +# Note: $NUT_DIR/xbin holds the wrappers to run NUT binaries with co-bundled +# third party libs and hopefully without conflicts induced for the OS binaries +# Use them first! +PATH="$NUT_DIR/xbin:$NUT_DIR/sbin:$NUT_DIR/bin:$PATH" +export PATH + +# Search for binaries under current PATH normally, no hardcoding. Scripts: +NUT_IPP_OS_SHUTDOWN="ipp-os-shutdown" +NUT_IPPSTATUS="ipp-status" +#NUT_IPP_OS_SHUTDOWN="$NUT_DIR/sbin/ipp-os-shutdown" +#NUT_IPPSTATUS="$NUT_DIR/bin/ipp-status" + +# Set default values +# Notification configuration +MAIL_NOTIF=1 +CONSOLE_NOTIF=1 +SYSLOG_NOTIF=1 +# Mail configuration (simple (Lansafe) version) +To_User="root" + +# NOTE: for systems with role-based access and equivalents, or +# group-suid for /sbin/shutdown, etc. it may also be possible +# to allow "ipp" directly to use the command - in this case +# set SHUTDOWN_NEEDS_ROOT=0 in the $CONFIG_IPP file. +SHUTDOWN_NEEDS_ROOT=1 +SHUTDOWN_TIMER=-1 + +# Commands +CMD_WALL="wall" +CMD_MAIL="mailx -n" +CMD_SYSLOG="logger" + +# Create the message parts +ldate="`date +\"%y-%m-%d - %H:%M:%S\"`" +nodeName="$UPSNAME@`hostname`" +DefaultSubject="Intelligent Power Protector (IPP) Alarms" +DefaultMessage="Alarm from ${nodeName}:\n\n\t${ldate} - $*" +NeedRootMessage="WARNING: ipp-notifier.sh must run as root to request/cancel OS shutdown\nConsider changing the NUT init script to start 'upsmon -p' so you can use SHUTDOWN_TIMER>=0" +#...or change upsmon.conf to contain "RUN_AS_USER root" + +# Include IPP ipp.conf (may overwrite the above default values!) +if [ -f "$CONFIG_IPP" ] ; then + . "$CONFIG_IPP" +fi + +if [ "$SHUTDOWN_NEEDS_ROOT" = 1 ] && [ "$SHUTDOWN_TIMER" -gt -1 ] 2>/dev/null ; +then + who="`whoami 2>/dev/null`" + if [ "$who" != 'root' ]; then +#work around in case no whoami is present + who="`id -u 2>/dev/null`" + if [ "$who" != '0' ]; then + who="`id 2>/dev/null | grep -w '0' | grep -w root`" + if [ -z "$who" ]; then + DefaultMessage="$DefaultMessage\n$NeedRootMessage" + fi + fi + fi +fi + +if [ "$IPP_DEBUG" = yes ] ; then + exec >> /var/tmp/ipp-notifier.log 2>&1 + echo "`date`: Started: $0 $*" >&2 + set >&2 + set -x +fi + +# Console notification +if [ "$CONSOLE_NOTIF" -eq 1 ]; +then + echo "$DefaultSubject\n\n$DefaultMessage" | $CMD_WALL +fi + +# Mail notification +OTHER_OPT="" + +if [ "$MAIL_NOTIF" -eq 1 ]; +then + echo "$To_User" | grep "@" + if [ $? -eq 1 ] + then + # Simple (Lansafe / local) version + env MAILRC=/dev/null echo "$DefaultMessage" | $CMD_MAIL -s "$DefaultSubject" $To_User + else + # GMail need starttls + echo "$SMTP_Server" | grep "gmail.com" + if [ $? -eq 0 ]; then + OTHER_OPT="-S smtp-use-starttls" + fi + + env MAILRC=/dev/null echo -e "$DefaultMessage" | $CMD_MAIL -s "$DefaultSubject" \ + -S from="$SMTP_User" \ + -S smtp="smtp://$SMTP_Server" \ + -S smtp-auth-user="$SMTP_User" \ + -S smtp-auth-password="$SMTP_Password" \ + -S smtp-auth=login \ + -S ssl-verify=ignore $OTHER_OPT \ + $To_User + fi +fi + +# System log notification +if [ "$SYSLOG_NOTIF" -eq 1 ]; +then + $CMD_SYSLOG -t eaton-ipp "$*" +fi + +# Scheduled shutdown - request or cancel based on this variable and on +# the UPS state (amount of ONLINE sources under the MINSUPPLIES or not?) +if [ "$SHUTDOWN_TIMER" -gt -1 ] 2>/dev/null; then + # Note this status check clears any invalid PIDfiles + SD_STATUS="`${NUT_IPP_OS_SHUTDOWN} status`" + SD_STATE=$? + ${NUT_IPPSTATUS} -q + if [ $? -eq 1 ] ; then + if [ "$SD_STATE" = 0 ]; then + ${NUT_IPP_OS_SHUTDOWN} & + sleep 5 # Let the script begin its work and PIDfiles + ${NUT_IPP_OS_SHUTDOWN} status + SD_STATE=$? + if [ "$SD_STATE" -gt 0 ]; then + echo "Shutdown delayed by ${SHUTDOWN_TIMER}m was requested at ${ldate}" + echo "${DefaultSubject}\nPowerfail-shutdown delayed by ${SHUTDOWN_TIMER}m was requested at ${ldate}" | $CMD_WALL 2>/dev/null + else # Nothing pending nor irreversible + echo "FAILED TO REQUEST a Shutdown delayed by ${SHUTDOWN_TIMER}m at ${ldate}" + echo "${DefaultSubject}\nFAILED TO REQUEST a Powerfail-shutdown delayed by ${SHUTDOWN_TIMER}m at ${ldate}" | $CMD_WALL 2>/dev/null + fi + else + echo "Shutdown request already running" + fi + else + if [ "$SD_STATE" = 1 ]; then + # Cancel any pending not-irreversible shutdown + if ${NUT_IPP_OS_SHUTDOWN} -c ; then + echo "Shutdown request canceled" + echo "${DefaultSubject}\nPowerfail-shutdown request canceled at ${ldate}" | $CMD_WALL 2>/dev/null + else + echo "Could not cancel Shutdown request" + echo "${DefaultSubject}\nPowerfail-shutdown request NOT CANCELED at ${ldate}" | $CMD_WALL 2>/dev/null + fi + fi + fi +fi diff --git a/scripts/installer/common/ipp-os-shutdown b/scripts/installer/common/ipp-os-shutdown new file mode 100755 index 0000000000..db596fe343 --- /dev/null +++ b/scripts/installer/common/ipp-os-shutdown @@ -0,0 +1,423 @@ +#!/bin/sh +# +# ipp-os-shutdown +# +# Copyright (c) 2015-2017, by Eaton (R) Corporation. All rights reserved. +# +# A shell script to manage the emergency shutdown driven by IPP - Unix +# (NUT) in a way that can be customized more easily; called from upsmon +# +# Requires configuration from ipp.conf and upsmon.conf, or otherwise defaults +# to the values below +# + +usage() { + echo "Usage: $0 [-t timespec | +mins] [-h|-p|-r] [-k|-K]" + echo "Usage: $0 -c | cancel" + echo "Usage: $0 -s | status" + echo "Usage: $0 --help" + echo " -t timespec 0+ minutes to delay before proceeding or 'now'==0" + echo " +minutes 0+ minutes to delay before proceeding" + echo " -h | -p | -r Passed to the OS shutdown command (halt/poweroff/reboot)" + echo " -k | -K Enforce or forbid calls to request UPS powercycling" + echo " Otherwise rely on KILLPOWER file as managed by upsmon" + echo " -c = cancel Cancel a pending shutdown, if any" + echo " -s = status Return simple status (string and code) of pending shutdown" +} + +# +# Global variables +# +NUT_DIR="/usr/local/ups" +NUT_RUN_DIR="/var/run/nut" +NUT_CFG_DIR="" +for D in "$NUT_DIR/etc" "/etc/nut" "/etc/ups" ; do + if [ -d "$D" ] && [ -f "$D/ups.conf" ] && [ -f "$D/ipp.conf" ] ; then + NUT_CFG_DIR="$D" + break + fi +done +unset D +CONFIG_IPP="$NUT_CFG_DIR/ipp.conf" +CONFIG_UPSMON="$NUT_CFG_DIR/upsmon.conf" +POWERDOWNFLAG="$NUT_CFG_DIR/killpower" +if [ ! -w "$NUT_CFG_DIR" ] ; then + echo "WARNING: Configuration directory $NUT_CFG_DIR is not writable by this user," + echo " it may be a problem to save the 'killpower' flag file when needed." +fi >&2 + +# Note: $NUT_DIR/xbin holds the wrappers to run NUT binaries with co-bundled +# third party libs and hopefully without conflicts induced for the OS binaries +PATH="$NUT_DIR/xbin:$NUT_DIR/sbin:$NUT_DIR/bin:$PATH" +export PATH + +# Search for binaries under current PATH normally, no hardcoding +NUT_UPSC="upsc" +NUT_UPSCMD="upscmd" +NUT_UPSRW="upsrw" +NUT_UPSMON="upsmon" +#NUT_UPSC="$NUT_DIR/xbin/upsc" +#NUT_UPSCMD="$NUT_DIR/xbin/upscmd" +#NUT_UPSRW="$NUT_DIR/xbin/upsrw" +#NUT_UPSMON="$NUT_DIR/xbin/upsmon" + +# Scripts: +NUT_IPPSTATUS="ipp-status" +NUT_UPS_SHUTDOWN="shutdown" +#NUT_IPPSTATUS="$NUT_DIR/bin/ipp-status" +#NUT_UPS_SHUTDOWN="$NUT_DIR/shutdown" + +# If present and executable, it is called for individual host's additional +# shutdown routines. +SHUTDOWNSCRIPT_CUSTOM="" + +# Store the optional -k/-K request to "enforce" or "forbid" powercycling +# May be overridden by the ipp.conf, though intended for CLI usage. +POWERDOWNFLAG_USER="" + +SHUTDOWN_PIDFILE="${NUT_RUN_DIR}/shutdown.pid" +SHUTDOWN_TIMER=-1 + +# Set default values +# Notification configuration +CONSOLE_NOTIF=1 +SYSLOG_NOTIF=1 +CMD_WALL="wall" +CMD_SYSLOG="logger" + +#################### THE OS SHUTDOWN PROGRAM SETTINGS ################## +# The following flags may be OS-dependent and so overridden in the +# config file below. Depending on OS and hardware support, "poweroff" +# may tell the powersources to cut the power, and "halt" may sit +# forever at the "OS is stopped" prompt or equivalent. +SDFLAG_POWEROFF="-h" +SDFLAG_REBOOT="-r" +SDFLAG_HALT="-p" + +# The flag for quick stop (shorter service stop timeouts and fewer/no +# logs, or outright go to kill remaining processes) +SDFLAG_UNGRACEFUL="-F" + +# Trigger a shutdown without delay (zero delay) +SDFLAG_INSTANT="+0" + +# The program which executes an OS shutdown, maybe including flags that +# disable its interactive mode +CMD_SHUTDOWN="/usr/sbin/shutdown" + +# Customize the shutdown command by setting the SDFLAG variables above here: +CONFIG_SHUTDOWN="$NUT_DIR/etc/ipp-os-shutdown.conf" +######################################################################## + +# Potentially localizable message strings; those with s in the name contain +# an argument processed as a string via printf; otherwise echo'ed directly +DefaultSubject="Intelligent Power Protector (IPP) Emergency Shutdown" +MessageIrreversible="Beginning irreversible stage of the powerfail shutdown" +MessageIrreversibleTrap="Sorry, the powerfail shutdown is now irreversible, you should not abort it!" +MessageTimerAbortedTrap="Delayed powerfail shutdown timer was successfully aborted before it expired" +MessageShutdownIsDelayed_s="Powerfail shutdown was scheduled as delayed: sleeping for %s seconds" +MessageShutdownNotDelayed="Powerfail: shutting down without delay" +MessageCancelingPIDS_s="Canceling delayed powerfail shutdown PID: %s" +MessageCannotCancelNone="Nothing scheduled, nothing to cancel" +MessageCannotCancelIrrev="Scheduled shutdown is already irreversible, can not cancel it" +MessageCannotQueueAnother="Shutdown already pending, cancel it first to queue another one" +MessageCustomShutdownStarting_s="Initiating custom shutdown for %s..." +MessageCustomShutdownCompleted_s="Custom shutdown for %s is completed" +MessageKillpowerFileExists_s="the POWERDOWNFLAG file '%s' exists" +MessageKillpowerFileAbsent_s="the POWERDOWNFLAG file '%s' does not exist" +MessageKillpowerArgumentExists_s="the POWERDOWNFLAG_USER setting is '%s'" +MessageKillpowerArgumentAbsent="the POWERDOWNFLAG_USER setting is empty, relying on POWERDOWNFLAG file (if any)" +MessageUPSpowercycleCommandingPoweroff_s="Commanding the UPSes to power off and back on after a delay (%s), and powering this host off unconditionally" +MessageUPSpowercycleCommanding_s="Commanding the UPSes to power off and back on after a delay (%s), but still proceeding to OS shutdown to the explicit host power-state requested originally" +MessageUPSpowercycleNotCommanding="NOT commanding the UPSes to power-cycle; inspecting external power status at this moment" +MessageExtPowerIsBackRebooting="External power is back, rebooting host rather than halting it" +MessageExtPowerIsBack="External power is back, but we are still proceeding to OS shutdown to the explicit host power-state requested originally" +MessageExtPowerNotBack="External power is not back, proceeding to OS shutdown to the host power-state requested originally" +MessageRunningCmd_s="Proceeding to execute: '%s'" +ORIG_PARAM_STR="$*" + +# Include definitions for shutdown flags before ipp.conf, so the latter +# can e.g. predefine the $SDFLAG_POWERSTATE_DEFAULT value by name. +if [ -f "$CONFIG_SHUTDOWN" ]; then + . "$CONFIG_SHUTDOWN" +fi + +# Include IPP ipp.conf (may overwrite the above default values!) +if [ -f "$CONFIG_IPP" ]; then + . "$CONFIG_IPP" +fi + +# If nothing was set/guessed - use this value: +[ -z "${SDFLAG_POWERSTATE_DEFAULT-}" ] && \ + SDFLAG_POWERSTATE_DEFAULT="$SDFLAG_POWEROFF" + +# Default is to do whatever shutdown strategy the OS prefers and maybe +# customize below (e.g. do fast shutdown if clusterware is present and +# was stopped); override in config file to e.g. " " (space) to disable +# this behavior and use the one configured value. +[ -z "${SDFLAG_COMMONOPTIONS-}" ] && \ + SDFLAG_COMMONOPTIONS="" + +# When we go into irreversible state, rename the existing PIDfile into this +# (or create a new one if existing file disappeared) +SHUTDOWN_PIDFILE_IRREVERSIBLE="${SHUTDOWN_PIDFILE}.irreversible" + +# String with current timestamp (for logging) +ldate="" +get_ldate() { + ldate="`date +\"%y-%m-%d - %H:%M:%S\"`" && return 0 + # Optional first argument can contain the default value + if [ -n "$1" ] ; then ldate="$1" ; else ldate="`date`"; fi +} + +logmsg() { + # The argument string is wrapped with formalities and + # logged into echo > stdout, syslog and wall + echo "${ldate}: $*" + if [ "$CONSOLE_NOTIF" -eq 1 -a -n "$CMD_WALL" ]; then + echo "${DefaultSubject}\n$* at ${ldate}" | $CMD_WALL 2>/dev/null + fi + if [ "$SYSLOG_NOTIF" -eq 1 -a -n "$CMD_SYSLOG" ]; then + $CMD_SYSLOG -t eaton-ipp "$*" 2>/dev/null + fi +} + +check_pid() { + # Returns: PID in $1 is running = 0; not running = 1; syntax errors = 2 + [ -n "$1" ] && [ "$1" -gt 0 ] || return 2 + [ -d "/proc/$1" ] && return 0 + ( (ps -ef || ps -xawwu ) | grep -v grep | egrep "`basename $0`|shutdown" | \ + awk '{print $2}' | grep -w "$1" ) 2>/dev/null && return 0 + return 1 +} + +check_pids_atleastone() { + # Checks all args as PID numbers; if any one is running return 0 + for P in "$@"; do + check_pid "$P" && return 0 + done + return 1 +} + +check_pidfile() { + # First line of PIDFILE ($1) should contain one or more PIDs + # Check if file exists, and any pointed PID is running - then return 0 + # No PID is running - return 1 + # No file / bad filename / other errors - then return 2 + if [ -n "$1" ] && [ -s "$1" ] && [ -r "$1" ]; then + PIDS="`head -1 "$1"`" && [ -n "$PIDS" ] || return 2 + check_pids_atleastone $PIDS || return 1 + return 0 + fi + return 2 +} + +check_shutting_down() { + # IF THE PIDFILE DID NOT PASS A TEST, IT IS REMOVED TO REDUCE CONFUSION + # If the SHUTDOWN_PIDFILE_IRREVERSIBLE exists and points to a running + # process return 2 + # If the SHUTDOWN_PIDFILE exists and the PID pointed by it is running + # return 1 - this means we can cancel it (can not queue new one) + # If neither file exists nor points to a running process return 0 - + # this means we can schedule a shutdown / have nothing to cancel + check_pidfile "$SHUTDOWN_PIDFILE_IRREVERSIBLE" && return 2 + rm -f "$SHUTDOWN_PIDFILE_IRREVERSIBLE" + check_pidfile "$SHUTDOWN_PIDFILE" && return 1 + rm -f "$SHUTDOWN_PIDFILE" + return 0 +} + +cancel_shutdown() { + # If the SHUTDOWN_PIDFILE exists and the PID pointed by it is running + # then kill that PID and remove the SHUTDOWN_PIDFILE + check_shutting_down + case "$?" in + 0) echo "$MessageCannotCancelNone"; return 0 ;; + 1) + PIDS="`head -1 "$SHUTDOWN_PIDFILE"`" && [ -n "$PIDS" ] || return 1 + get_ldate + logmsg $(printf "${MessageCancelingPIDS_s}\n" "$PIDS") + kill -9 $PIDS + rm -f "$SHUTDOWN_PIDFILE" "$SHUTDOWN_PIDFILE_IRREVERSIBLE" + return 0 ;; + 2) echo "$MessageCannotCancelIrrev"; return 2 ;; + esac +} + +# Start with an empty value, so in the end if it remains empty +# we can apply the default; otherwise - it is user's request. +SDFLAG_POWERSTATE="" +while [ "$#" -gt 0 ]; do + case "$1" in + -t) case "$2" in + now) SHUTDOWN_TIMER=0 ;; + [0-9]) [ "$2" -gt -1 ] && SHUTDOWN_TIMER="$2" || \ + echo "Bad time parameter '$1 $2', ignoring" >&2 ;; + *) echo "Bad time parameter '$1 $2', ignoring" >&2 ;; + esac + shift ;; + +0) SHUTDOWN_TIMER="0" ;; + +[1-9]*) N="`echo "$1" | sed 's,^\+,,'`" && N="`expr 0 + "$N"`" && \ + [ "$N" -gt -1 ] && SHUTDOWN_TIMER="$N" || \ + echo "Bad time parameter '$1', ignoring" >&2 ;; + --help|help) usage; exit 0 ;; + -h|--halt) SDFLAG_POWERSTATE="$SDFLAG_HALT" ;; + -r|--reboot) SDFLAG_POWERSTATE="$SDFLAG_REBOOT" ;; + -p|--poweroff) SDFLAG_POWERSTATE="$SDFLAG_POWEROFF" ;; + -s|status) + check_shutting_down + RES=$? + case "$RES" in + 0) echo "not-pending" ;; + 1) echo "pending" ;; + 2) echo "irreversible" ;; + esac + exit $RES ;; + -c|cancel) cancel_shutdown ; exit $? ;; + -k) POWERDOWNFLAG_USER="enforce" ;; + -K) POWERDOWNFLAG_USER="forbid" ;; + -l|block) # Undocumented - for dev. purposes + touch "${SHUTDOWN_PIDFILE}.disable" ; exit $? ;; + -L|unblock) # Undocumented - for dev. purposes + rm -f "${SHUTDOWN_PIDFILE}.disable" ; exit $? ;; + *) echo "Bad parameter '$1', ignoring" >&2 ;; + esac + shift +done + +check_shutting_down +RES=$? +case "$RES" in + 1) echo "$MessageCannotQueueAnother"; exit $RES ;; + 2) echo "$MessageCannotCancelIrrev"; exit $RES ;; +esac + +if [ -f "$CONFIG_UPSMON" ]; then + _VAR="`egrep '^[ \t]*POWERDOWNFLAG ' "$CONFIG_UPSMON" | sed 's,^[ \t]*POWERDOWNFLAG ,,'`" + _VAR="$(echo "$_VAR" | sed -e 's,^"\(.*\)"$,\1,g' -e "s,^\'\(.*\)\'$,\1,g")" + if [ $? = 0 ] && [ -n "$_VAR" ]; then + POWERDOWNFLAG="$_VAR" + echo "Detected setting of POWERDOWNFLAG file as '$POWERDOWNFLAG'" + fi +fi + +DATE_START_DELAY="`date`" +get_ldate "$DATE_START_DELAY" +( echo "$$"; echo "$DATE_START_DELAY" ) > "$SHUTDOWN_PIDFILE" + +CONSOLE_NOTIF=1 SYSLOG_NOTIF=1 logmsg \ + "$0 $ORIG_PARAM_STR was called to commit a powerfail shutdown. Current UPS state:" \ + "`$NUT_IPPSTATUS`" + +# Clean up when this script is exited in any manner +trap '_R=$?; rm -f "$SHUTDOWN_PIDFILE" "$SHUTDOWN_PIDFILE_IRREVERSIBLE" "$SHUTDOWN_PIDFILE.custom"; exit ${_R}' 0 + +# schedule the shutdown delayed for $SHUTDOWN_TIMER minutes +if [ "$SHUTDOWN_TIMER" -gt -1 ] 2>/dev/null; then + if [ "$SHUTDOWN_TIMER" -eq 0 ]; then + echo "$MessageShutdownNotDelayed" + else + SHUTDOWN_TIMER_SEC="`expr $SHUTDOWN_TIMER \* 60`" \ + || SHUTDOWN_TIMER_SEC="120" + logmsg $(printf "${MessageShutdownIsDelayed_s}\n" "${SHUTDOWN_TIMER_SEC}") + echo "+ ${SHUTDOWN_TIMER_SEC}" >> "$SHUTDOWN_PIDFILE" + trap 'get_ldate; logmsg "$MessageTimerAbortedTrap">&2 ; exit 0' 1 2 3 15 + /usr/bin/sleep ${SHUTDOWN_TIMER_SEC} + fi +fi + +if [ -f "${SHUTDOWN_PIDFILE}.disable" ]; then + logmsg "Development hook: '${SHUTDOWN_PIDFILE}.disable' exists, so not doing the actual shutdown" + exit 0 +fi + +cd / + +DATE_START_IRREV="`date`" +get_ldate "$DATE_START_IRREV" +CONSOLE_NOTIF=1 SYSLOG_NOTIF=1 logmsg "${MessageIrreversible}" +trap 'echo "$MessageIrreversibleTrap">&2' 1 2 3 15 +(echo "$$"; echo "$DATE_START_DELAY"; echo "+ $SHUTDOWN_TIMER_SEC"; echo "$DATE_START_IRREV" ) \ + > "${SHUTDOWN_PIDFILE_IRREVERSIBLE}" \ + && rm -f "${SHUTDOWN_PIDFILE}" + +# The custom shutdown routine if clusterware is present +if [ -n "${SHUTDOWNSCRIPT_CUSTOM-}" ] && \ + [ -x "${SHUTDOWNSCRIPT_CUSTOM}" ] && \ + [ -s "${SHUTDOWNSCRIPT_CUSTOM}" ] \ +; then + export MessageCustomShutdownStarting_s MessageCustomShutdownCompleted_s + export MessageIrreversibleTrap DefaultSubject + export CONSOLE_NOTIF CMD_WALL SYSLOG_NOTIF CMD_SYSLOG + export SDFLAG_COMMONOPTIONS SDFLAG_UNGRACEFUL + get_ldate + logmsg $(printf "$MessageCustomShutdownStarting_s" "$SHUTDOWNSCRIPT_CUSTOM") + rm -f "$SHUTDOWN_PIDFILE.custom" + touch "$SHUTDOWN_PIDFILE.custom" + chmod 600 "$SHUTDOWN_PIDFILE.custom" + "$SHUTDOWNSCRIPT_CUSTOM" 3>"$SHUTDOWN_PIDFILE.custom" + get_ldate + logmsg $(printf "$MessageCustomShutdownCompleted_s" "$SHUTDOWNSCRIPT_CUSTOM") + # Some variables for this script could be modified in the custom one + [ -s "$SHUTDOWN_PIDFILE.custom" ] && . "$SHUTDOWN_PIDFILE.custom" + rm -f "$SHUTDOWN_PIDFILE.custom" +fi + +# Did the power return to sufficient amount of UPSes while we were stopping? +# NOTE: If we are the host which commands UPSes to power-cycle, we should +# still request the powercycle and halt/poweroff ourselves. +# This file is wiped during UPSMON startup so should not interfere needlessly. +# We expect the /usr/local/ups tree to be still available +POWERDOWNFLAG_UPSMON=no +if [ -s "$POWERDOWNFLAG" ] || "$NUT_UPSMON" -K ; then + POWERDOWNFLAG_UPSMON=yes +fi +get_ldate +if [ x"$POWERDOWNFLAG_UPSMON" = xyes ] ; then + logmsg $(printf "$MessageKillpowerFileExists_s" "$POWERDOWNFLAG") +else + logmsg $(printf "$MessageKillpowerFileAbsent_s" "$POWERDOWNFLAG") +fi +if [ -n "$POWERDOWNFLAG_USER" ] ; then + logmsg $(printf "$MessageKillpowerArgumentExists_s" "$POWERDOWNFLAG_USER") +else + logmsg "$MessageKillpowerArgumentAbsent" +fi + +if [ x"$POWERDOWNFLAG_UPSMON" = xyes -o "$POWERDOWNFLAG_USER" = "enforce" ] && \ + [ "$POWERDOWNFLAG_USER" != "forbid" ] \ +; then + # We will cut our (dev-assumed) power, so should poweroff to be safe... + if [ -z "${SDFLAG_POWERSTATE-}" ] ; then + CONSOLE_NOTIF=1 SYSLOG_NOTIF=1 logmsg $(printf "$MessageUPSpowercycleCommandingPoweroff_s" "$DELAY") + SDFLAG_POWERSTATE="$SDFLAG_POWEROFF" + else + CONSOLE_NOTIF=1 SYSLOG_NOTIF=1 logmsg $(printf "$MessageUPSpowercycleCommanding_s" "$DELAY") + fi + POWERDOWNFLAG_USER=enforce "$NUT_UPS_SHUTDOWN" +else + logmsg "$MessageUPSpowercycleNotCommanding" + "$NUT_IPPSTATUS" -q + if [ $? -eq 0 ] ; then + if [ -z "${SDFLAG_POWERSTATE-}" ] ; then + CONSOLE_NOTIF=1 SYSLOG_NOTIF=1 logmsg "$MessageExtPowerIsBackRebooting" + SDFLAG_POWERSTATE="$SDFLAG_REBOOT" + else + CONSOLE_NOTIF=1 SYSLOG_NOTIF=1 logmsg "$MessageExtPowerIsBack" + fi + else + logmsg "$MessageExtPowerNotBack" + fi +fi + +# By default, we continue with instant shutdown without waiting any more +[ -z "${SDFLAG_COMMONOPTIONS-}" ] && \ + SDFLAG_COMMONOPTIONS="$SDFLAG_INSTANT" + +[ -z "${SDFLAG_POWERSTATE-}" ] && \ + SDFLAG_POWERSTATE="$SDFLAG_POWERSTATE_DEFAULT" + +get_ldate +CONSOLE_NOTIF=1 SYSLOG_NOTIF=1 logmsg $(printf "$MessageRunningCmd_s" "$CMD_SHUTDOWN $SDFLAG_POWERSTATE $SDFLAG_COMMONOPTIONS") +# Launch the operating system shutdown command +$CMD_SHUTDOWN $SDFLAG_POWERSTATE $SDFLAG_COMMONOPTIONS diff --git a/scripts/installer/common/ipp-shutdown-daemon.sh b/scripts/installer/common/ipp-shutdown-daemon.sh new file mode 100644 index 0000000000..3f9c027457 --- /dev/null +++ b/scripts/installer/common/ipp-shutdown-daemon.sh @@ -0,0 +1,41 @@ +#THIS IS WORK IN PROGRESS, THIS IS NOT FUNCTIONAL. +exit + +#!/bin/sh +# ipp-shutdown-daemon +# +# Copyright (c) 2013-2017, by Eaton (R) Corporation. All rights reserved. +# +# A shell script to detect shutdown from NMC cards IPP - Unix (NUT) +# It needs ipp.conf file. +# + +NUT_DIR="/usr/local/ups" +NUT_CFG_DIR="" +for D in "$NUT_DIR/etc" "/etc/nut" "/etc/ups" ; do + if [ -d "$D" ] && [ -f "$D/ups.conf" ] && [ -f "$D/ipp.conf" ] ; then + NUT_CFG_DIR="$D" + break + fi +done +unset D +CONFIG_IPP="$NUT_CFG_DIR/ipp.conf" + +# Note: $NUT_DIR/xbin holds the wrappers to run NUT binaries with co-bundled +# third party libs and hopefully without conflicts induced for the OS binaries +PATH="$NUT_DIR/xbin:$NUT_DIR/sbin:$NUT_DIR/bin:$PATH" +export PATH + +# Search for binaries under current PATH normally, no hardcoding +NUT_UPSC="upsc" +#NUT_UPSC="$NUT_DIR/xbin/upsc" + +if [ -f "$CONFIG_IPP" ] ; then + . "$CONFIG_IPP" +fi + +# Convert to parsing of "ipp-status -p" which reports all needed details +for dev in `$NUT_UPSC -l 2>/dev/null`; do + shutdown="`$NUT_UPSC "$dev"@localhost ups.timer.shutdown 2>/dev/null`" + reboot="`$NUT_UPSC "$dev"@localhost ups.timer.reboot 2>/dev/null`" +done diff --git a/scripts/installer/common/ipp-status b/scripts/installer/common/ipp-status new file mode 100755 index 0000000000..b7f15a5811 --- /dev/null +++ b/scripts/installer/common/ipp-status @@ -0,0 +1,520 @@ +#!/bin/sh +# ipp-status +# +# Copyright (c) 2013-2017, by Eaton (R) Corporation. All rights reserved. +# +# A shell script to request UPS status (power state, runtime remaining) +# with upsc and aggregate the results as a table and an exit-status that +# can be inspected to see if the system is reliably protected or should +# better go into shut-down. Uses configuration variables of upsmon.conf. + +# +# Global variables +# +NUT_DIR="/usr/local/ups" +NUT_CFG_DIR="" +for D in "$NUT_DIR/etc" "/etc/nut" "/etc/ups" ; do + if [ -d "$D" ] && [ -f "$D/ups.conf" ] && [ -f "$D/ipp.conf" ] ; then + NUT_CFG_DIR="$D" + break + fi +done +unset D +CONFIG_UPSMON="$NUT_CFG_DIR/upsmon.conf" +CONFIG_IPP="$NUT_CFG_DIR/ipp.conf" + +# Do not normally mangle the LD_LIBRARY_PATH - it can impact system tools too +#LD_LIBRARY_PATH="$NUT_DIR/lib:/usr/lib:/lib:$LD_LIBRARY_PATH" +#export LD_LIBRARY_PATH + +# Note: $NUT_DIR/xbin holds the wrappers to run NUT binaries with co-bundled +# third party libs and hopefully without conflicts induced for the OS binaries +PATH="$NUT_DIR/xbin:$NUT_DIR/sbin:$NUT_DIR/bin:$PATH" +export PATH + +# Search for binaries under current PATH normally, no hardcoding +NUT_UPSC="upsc" +#NUT_UPSC="$NUT_DIR/xbin/upsc" + +# Flag for support (or not) of early-shutdown on this host +SHUTDOWN_TIMER=-1 + +# Include IPP ipp.conf (may overwrite the above default values!) +if [ -f "$CONFIG_IPP" ] ; then + . "$CONFIG_IPP" +fi + +# +# We need capable awk +# +awk="awk" + +# On Solaris, the default awk is a simple implementation +# lacking certain functions (most notably the match builtin function). +# Luckily, nawk is present to save the day... +test "`uname -s`" = "SunOS" && awk="nawk" + + +# +# Default settings +# + +overall_status_enabled="yes" +overall_status_mode="verbose" +devices_status_enabled="yes" +devices_formatted="yes" + + +# +# Get devices info, mixing config and runtime info +# Note that some other scripts may be parsing this via "ipp-status -d", +# so only append fields in the end as this evolves +# +get_devices_info() { + for dev in `$awk '/^MONITOR / { print $2 }' "$CONFIG_UPSMON"`; do + status="`$NUT_UPSC "$dev" ups.status 2>/dev/null`" + runtime="`$NUT_UPSC "$dev" battery.runtime 2>/dev/null`" + batterypct="`$NUT_UPSC "$dev" battery.charge 2>/dev/null`" + supplies="`get_pwr_value "$dev" | egrep '^[0-9]*$'`" + upsmon_ms="`get_ms_value "$dev" | egrep 'master|slave'`" + + echo "$dev:$status:$runtime:$batterypct:$supplies:$upsmon_ms" + done +} + + +# +# Get minimum of required power supplies +# +get_min_supplies() { + $awk '/^[ \t]*MINSUPPLIES/ { print $2 }' \ + "$CONFIG_UPSMON" 2>/dev/null +} + + +# +# Get a UPS power value (count of this host's power sources fed by UPS=="$1") +# +get_pwr_value() { + $awk '/^[ \t]*MONITOR/ { + if (match($2, /'"$1"'(@.*)?/)) + print $3; + }' "$CONFIG_UPSMON" 2>/dev/null +} + +# +# Get a UPS master/slave value (influences shutdown sequence and poweroffs) +# +get_ms_value() { + $awk '/^[ \t]*MONITOR/ { + if (match($2, /'"$1"'(@.*)?/)) + print $NF; + }' "$CONFIG_UPSMON" 2>/dev/null + # NF: This is last field in MONITOR line. Or 6th. Currently... +} + +# +# Overall status resolution - parsing helpers +# +parse_protectors_knowngood() { + # Lists the UPSes which are known to this host and have stable power + # (no regard to how many sources of this host they actually feed) + onbattery_sdtimer="$1" # set to yes to trigger a shutdown timer + # when UPS are on battery + $awk -v ob_sdtimer="${onbattery_sdtimer}" -F: ' + { + status = $2; + + # UPS on bypass does not protect anything + if (match(status, /^OL BYPASS/)) + ; + + # Other online states are OK + else if (match(status, /^OL/)) + print $1; + + # UPS on exhausted battery does not protect anything + else if (match(status, /^OB LB/)) + ; + + # - NOK when onbattery_sdtimer = yes + # - OK otherwise + else if (match(status, /^OB/)) + if (match(ob_sdtimer, /^yes/)) + ; + else + print $1; + } + ' | sort | uniq +} + +parse_protectors_unknown() { + # Lists the UPSes which are known to this host but have unknown power + # state (e.g. communications not established, driver died, initially + # WAITing for data after driver startup, etc.) - without regard as to + # how many sources of this host they actually feed + $awk -F: ' + { + status = $2; + + # Do not cause immediate shutdown if UPS is not accessible + # (driver or connection failure) + if (status == "") + print $1; + + # Do not cause immediate shutdown when waiting for UPS data + else if (match(status, /WAIT/)) + print $1; + } + ' | sort | uniq +} + +# +# Overall status resolution - primary logic +# +overall_status() { + devices_info="$1" + onbattery_sdtimer="$2" # set to yes to trigger a shutdown timer + # when UPS are on battery + + # Get non-low battery UPSes (still protecting the system) + protectors="`echo "$devices_info" | parse_protectors_knowngood "${onbattery_sdtimer}"`" + protectors_unknown="`echo "$devices_info" | parse_protectors_unknown`" + + # Get total powervalue of protecting UPSes + protectors_pwr_value=0 + protectors_unknown_pwr_value=0 + not_protectors=0 + + for ups in $protectors; do + pwr_value="`get_pwr_value "$ups"`" + + test -n "$pwr_value" || pwr_value=1 + + if test "$pwr_value" -eq 0 ; then + not_protectors="`expr $not_protectors + 1`" + else + protectors_pwr_value="`expr $protectors_pwr_value + $pwr_value`" + fi + done + + for ups in $protectors_unknown; do + pwr_value="`get_pwr_value "$ups"`" + + test -n "$pwr_value" || pwr_value=1 + + if test "$pwr_value" -eq 0 ; then + not_protectors="`expr $not_protectors + 1`" + else + protectors_unknown_pwr_value="`expr $protectors_unknown_pwr_value + $pwr_value`" + fi + done + + # Resolve system protection status + overall_status_str="protected" + + min_supplies="`get_min_supplies`" \ + && test -n "$min_supplies" \ + && test "$min_supplies" -ge 0 \ + || min_supplies=1 + # Zero is a resonable value - monitoring station that doesn't shut down + + min_supplies_eff="$min_supplies" + if test "$protectors_unknown_pwr_value" -gt 0; then + min_supplies_eff="`expr $min_supplies - $protectors_unknown_pwr_value`" + test "$min_supplies_eff" -ge 0 || min_supplies_eff=0 + fi + + if test "$protectors_pwr_value" -lt "$min_supplies_eff"; then + overall_status_str="unprotected" + fi + + # Overall status indication by exit code + if test "$overall_status_mode" = "silent"; then + test "$overall_status_str" = "unprotected" && exit 1 + exit 0 + + # Short form of overall status + elif test "$overall_status_mode" = "short"; then + echo "$overall_status_str" + + # Verbose form of overall status + elif test "$overall_status_str" = "unprotected"; then + cat </dev/null ; then + echo "Also, $not_protectors device(s) that do not feed this host are known and monitored" + fi + + case "$onbattery_sdtimer" in + [Yy][Ee][Ss]) + if test "$min_supplies_eff" != "$min_supplies" ; then + echo "WARNING: Some UPSes are not available, but we ignored them since onbattery_sdtimer=yes" >&2 + fi ;; + esac + + test "$overall_status_str" = "unprotected" && return 1 + return 0 +} + + +# +# Devices status resolution +# +devices_status() { + devices_info="$1" + + # No UPS devices found + if test -z "$devices_info"; then + cat < t) { + sig = "-"; + t = -t; + } + + ss = t % 60; + t = int(t / 60); + mm = t % 60; + h = int(t / 60); + + if (length(ss) < 2 && (0 != mm || 0 != h)) + ss = "0" ss; + + t = ss; + + if (0 != mm || 0 != h) { + if (length(mm) < 2 && 0 != h) + mm = "0" mm; + + t = mm ":" t; + + if (0 != h) + t = h ":" t; + } + + return sig t; + } + + BEGIN { + external_settings(); + + id_width = 20; + status_width = 15; + runt_width = 10; + chrg_width = 8; + sources_width = 8; + upsmonms_width= 7; + format_str = "%-" id_width "s%-" status_width "s%" runt_width "s%" chrg_width "s%" sources_width "s %-" upsmonms_width "s\n"; + + if (devices_formatted) { + printf("\nDevices status:\n\n"); + printf(format_str, "Identifier", "Status", " Runtime", "Charge%", "Sources", "UPSMon"); + printf(format_str, "----------", "------", "--------", "-------", "-------", "------"); + } + } + + { + id = $1; + status = $2 + runtime = $3; + charge = $4; + sources = $5; + upsmon_ms = $6; + + # Resolve basic status + if (status == "") + status_str = "unknown"; + else if (match(status, /WAIT/)) + status_str = "unknown"; + else if (match(status, /^OL BYPASS/)) + status_str = "on bypass"; + else if (match(status, /^OL/)) + status_str = "online"; + else if (match(status, /^OB LB/)) + status_str = "low battery"; + else if (match(status, /^OB/)) + status_str = "on battery"; + else if (match(status, /OFF/)) + status_str = "off"; + else if (match(status, /FSD/)) + status_str = "forced shutdown"; + else + status_str = "\"" status "\""; + + # Resolve status modifications + if (match(status, /OVER/)) + status_str = status_str " (OVERLOADED)"; + else if (match(status, /TRIM/) || match(status, /BOOST/)) + status_str = status_str " (improving mains)"; + + if (devices_formatted) { + if (runtime != "") + runtime = t2h_mm_ss(runtime); + else + runtime = "unknown"; + + printf(format_str, id, status_str, runtime, charge, sources, upsmon_ms); + } + else { + if (runtime != "") + runtime = int(runtime); + else + runtime = "unknown"; + + print id ":" status_str ":" runtime ":" charge ":" sources ":" upsmon_ms; + } + } + ' +} + + +# +# Usage +# +usage() { + this="`basename $0`" + + cat <&2 + +# Process options +set -- $options + +while test "$1" != "--"; do + case "$1" in + -h) + # Print usage + usage_and_exit 0 + ;; + + -S) + # Don't show overall status + overall_status_enabled="no" + ;; + + -s) + # Short overall status indication + overall_status_mode="short" + ;; + + -q) + # Silent overall status indication + overall_status_mode="silent" + devices_status_enabled="no" + ;; + + -D) + # Don't show devices status + devices_status_enabled="no" + ;; + + -d) + # Devices status shall not be formatted + devices_formatted="no" + ;; + + -p) + # Devices status shall not be formatted + devices_formatted="no" + # Don't show overall status + overall_status_enabled="no" + ;; + esac + + # Next option + shift +done + +# Shift the final "--" +shift + + +# +# Main +# + +onbattery_sdtimer="no" +if test "$SHUTDOWN_TIMER" -gt -1 2>/dev/null ; then + onbattery_sdtimer="yes" +fi + +# Get devices info +devices_info="`get_devices_info`" + +# Overall status +if test "$overall_status_enabled" = "yes"; then + overall_status "$devices_info" "$onbattery_sdtimer" +fi + +# Devices status +if test "$devices_status_enabled" = "yes"; then + devices_status "$devices_info" +fi diff --git a/scripts/installer/common/ipp-wrapper b/scripts/installer/common/ipp-wrapper new file mode 100755 index 0000000000..8e393d9d46 --- /dev/null +++ b/scripts/installer/common/ipp-wrapper @@ -0,0 +1,49 @@ +#!/bin/sh +# ipp-wrapper +# +# Copyright (c) 2017, by Eaton (R) Corporation. All rights reserved. +# +# A shell script to manipulate the environment variables needed for +# IPP-Unix programs to dynamically link with their bundled libraries. + +# +# Global variables +# +NUT_DIR="/usr/local/ups" +NUT_BIN_DIR="$NUT_DIR/bin" +NUT_SBIN_DIR="$NUT_DIR/sbin" +NUT_LIB_DIR="$NUT_DIR/lib" + +PROGNAME="`basename $0`" + +if [ "$PROGNAME" = "ipp-wrapper" ]; then + echo "This is a wrapper to call other programs; do not call it directly!" >&2 + exit 0 +fi + +# Use potentially external /bin/test (/bin/[) for the last time... +PROGTYPE="" +if [ -x "$NUT_BIN_DIR/$PROGNAME" ]; then + PROGTYPE="bin" +else + if [ -x "$NUT_SBIN_DIR/$PROGNAME" ]; then + PROGTYPE="sbin" + fi +fi + +# Do not run any other external program after this point, as it may +# fail expecting different shared libraries. +LD_LIBRARY_PATH="$NUT_LIB_DIR:/usr/lib:/lib:$LD_LIBRARY_PATH" +export LD_LIBRARY_PATH + +case "$PROGTYPE" in +bin) + exec "$NUT_BIN_DIR/$PROGNAME" "$@" + ;; +sbin) + exec "$NUT_SBIN_DIR/$PROGNAME" "$@" + ;; +esac + +echo "FATAL: Program named '$PROGNAME' not found among IPP-Unix binaries" >&2 +exit 1 diff --git a/scripts/installer/common/ipp.conf b/scripts/installer/common/ipp.conf new file mode 100644 index 0000000000..5965375e4f --- /dev/null +++ b/scripts/installer/common/ipp.conf @@ -0,0 +1,58 @@ +# Eaton - Intelligent Power Protector - Unix + +## Note that some OS-specific options needed for `ipp-os-shutdown` +## are provided in their own `ipp-os-shutdown.conf` file. + +## Notification configuration +## Set to 1 to enable, 0 to disable +MAIL_NOTIF=1 +CONSOLE_NOTIF=1 +SYSLOG_NOTIF=1 + +## Mail notification configuration +## Simple local version (default) +To_User="root" + +## Advanced (actual emailing) version: +#SMTP_Server="domain.something" + +## or better, the secured version +#SMTP_Server="domain.something:port" +#SMTP_User="user@domain" +#SMTP_Password="******" +#To_User="recipient@domain" + +## You may also adapt the following variables to point at your preferred command: +#CMD_WALL="wall -n" +#CMD_MAIL="mailx -n" +#CMD_SYSLOG="logger" + +## Set to non-negative minutes to enable early shutdowns via ipp-notify.sh +## Needs upsmon running as 'root', or 'ipp' privileged to call /sbin/shutdown +SHUTDOWN_TIMER=-1 + +## If you manage to let ipp manage shutdowns directly and not run upsmon as +## root all the time, you don't want notifications about non-root usage. +## In that case, set SHUTDOWN_NEEDS_ROOT=0 by uncommenting the next line: +#SHUTDOWN_NEEDS_ROOT=0 + +## This is used in early shutdown script to "enforce" or "forbid" powercycling +## the UPS as part of emergency powerfail processing. The value is to be set +## with command-line options (-k|-K) but a default can be set in `ipp.conf`. +# POWERDOWNFLAG_USER="forbid" + +## This is used in the `ipp-os-shutdown` script, and the OS-dependent values +## for symbols SDFLAG_POWEROFF, SDFLAG_REBOOT and SDFLAG_HALT are defined in +## its `ipp-os-shutdown.conf` which is included before this `ipp.conf` file. +## There are a few ways we end up with some final SDFLAG_POWERSTATE for the +## OS shutdown invocation (the final step in `ipp-os-shutdown` script): +## * a state requested by user via CLI (-h, -p, -r) +## * guessed along with UPS powercycling or external-power-returned decisions +## * using SDFLAG_POWERSTATE_DEFAULT +## The default fall-back action is to power-off, unless another value is +## defined here in `ipp.conf` explicitly: +#SDFLAG_POWERSTATE_DEFAULT="$SDFLAG_POWEROFF" + +# Custom shutdown script for the AIX clusterware +SHUTDOWNSCRIPT_CUSTOM="/usr/local/ups/sbin/AIX_Clusterware_shutdown" + diff --git a/scripts/installer/common/shutdown b/scripts/installer/common/shutdown new file mode 100755 index 0000000000..bcd7493c49 --- /dev/null +++ b/scripts/installer/common/shutdown @@ -0,0 +1,97 @@ +#!/bin/sh +# shutdown +# +# Copyright (c) 2013-2017, by Eaton (R) Corporation. All rights reserved. +# +# A shell script to command UPSes to power off and back on as part of +# the emergency shutdown driven by IPP - Unix (NUT); called from upsmon +# +# Requires configuration from ipp.conf, or otherwise default to the values below +# Also requires matching features to be available in the UPSes and their drivers +# +# TODO remaining per IPSSUNIX-25: +# * The script acts on ALL UPSes configured on this system (`upsc -l`), +# rather than those MONITORed as feeding a non-zero amount +# power-sources in `upsmon.conf` +# * Consider the KILLPOWER flag-file (maybe this host should not power +# off any UPS at all?) +# * The username is hardcoded as `admin` rather than taken from config +# * Maybe we do not try every possible instcmd for UPS poweroff/reboot - +# revise against upsrw and upscmd for NETXML and SNMP drivers at least +# + +NUT_DIR="/usr/local/ups" +NUT_CFG_DIR="" +for D in "$NUT_DIR/etc" "/etc/nut" "/etc/ups" ; do + if [ -d "$D" ] && [ -f "$D/ups.conf" ] && [ -f "$D/ipp.conf" ] ; then + NUT_CFG_DIR="$D" + break + fi +done +unset D +CONFIG_IPP="$NUT_CFG_DIR/ipp.conf" + +# Note: $NUT_DIR/xbin holds the wrappers to run NUT binaries with co-bundled +# third party libs and hopefully without conflicts induced for the OS binaries +PATH="$NUT_DIR/xbin:$NUT_DIR/sbin:$NUT_DIR/bin:$PATH" +export PATH + +# Search for binaries under current PATH normally, no hardcoding +NUT_UPSC="upsc" +NUT_UPSCMD="upscmd" +NUT_UPSRW="upsrw" +#NUT_UPSC="$NUT_DIR/xbin/upsc" +#NUT_UPSCMD="$NUT_DIR/xbin/upscmd" +#NUT_UPSRW="$NUT_DIR/xbin/upsrw" + +# Do not normally mangle the LD_LIBRARY_PATH - it can impact system tools too +#LD_LIBRARY_PATH="$NUT_DIR/lib:/usr/lib:/lib:$LD_LIBRARY_PATH" +#export LD_LIBRARY_PATH + +# This can be set by `ipp-os-shutdown` script, including via '-k' flag +CALLER_POWERDOWNFLAG_USER="${POWERDOWNFLAG_USER-}" + +# Include IPP ipp.conf (may overwrite the above default values!) to +# get shutdown delay and admin password +if [ -f "$CONFIG_IPP" ] ; then + . "$CONFIG_IPP" +fi + +if [ "$IPP_DEBUG" = yes ] ; then + exec >> /var/tmp/ipp-shutdown.log 2>&1 + echo "`date`: Started shutting down: $0 $*" >&2 + set >&2 + set -x +fi + +# If config forbids powercycling, and the caller does not require it, +# then do not do it +[ "$CALLER_POWERDOWNFLAG_USER" != "enforce" ] && \ + [ "$POWERDOWNFLAG_USER" = "forbid" ] && exit 0 + +# We need a number here, otherwise the UPS stays off +# TODO: Consider "shutdown_duration" if netxml_ups is set up? +# TODO: Do this per ups (move into the loop below then)? +if test -n "$DELAY" && test "$DELAY" -ge 0 ; then true; else DELAY=120; fi + +DELAYON="`expr $DELAY + 10`" + +# TODO: Here we want to refine the list to only MONITORed UPSes that power us +# and/or take into account the killpower flag-file (upsmon master vs slave +# and/or `upsmon -k` status) +# Convert to parsing of "ipp-status -p" which reports all needed details +upslist="`"$NUT_UPSC" -l`" +echo "$upslist" +# NOTE: not all UPSes and not all drivers support all possible instcmd's +# so we try as many as possible +for u in $upslist; do + echo "Configuring poweroff-poweron for UPS '$u' ..." + "$NUT_UPSCMD" -u admin -p "$PASSWORD" "$u" load.on.delay "$DELAYON" + "$NUT_UPSCMD" -u admin -p "$PASSWORD" "$u" load.off.delay "$DELAY" + for o in 3 2 1 ; do + "$NUT_UPSRW" -s "outlet.$o.delay.start"="$DELAYON" \ + -u admin -p "$PASSWORD" "$u" + "$NUT_UPSRW" -s "outlet.$o.delay.shutdown"="$DELAY" \ + -u admin -p "$PASSWORD" "$u" + done +done diff --git a/scripts/installer/common/solaris_init b/scripts/installer/common/solaris_init new file mode 100755 index 0000000000..23ce5d0fa0 --- /dev/null +++ b/scripts/installer/common/solaris_init @@ -0,0 +1,73 @@ +#!/sbin/sh + +#init.d script to start nut services for IPP - Unix on Solaris +# Customizations copyright (c) 2015, by Eaton (R) Corporation. All rights reserved. + +NUT_DIR="/usr/local/ups" + +LD_LIBRARY_PATH="$NUT_DIR/lib" +export LD_LIBRARY_PATH + +SHUTDOWN_TIMER=-1 +if [ -f ${NUT_DIR}/etc/ipp.conf ]; then + . ${NUT_DIR}/etc/ipp.conf +fi + +ups_stop () { + pkill -n upsmon + pkill -n upsd + "$NUT_DIR"/bin/upsdrvctl stop > /dev/null 2>&1 +} + +ups_start () { + echo "in ups start function" + "$NUT_DIR"/bin/upsdrvctl start #> /dev/null 2>&1 + "$NUT_DIR"/sbin/upsd #> /dev/null 2>&1 + if [ "$SHUTDOWN_TIMER" -gt -1 ]; then + # This host wants early shutdown support, must be root + ${NUT_DIR}/sbin/upsmon -p #> /dev/null 2>&1 + else + ${NUT_DIR}/sbin/upsmon #> /dev/null 2>&1 + fi + "$NUT_DIR"/init #> /dev/null 2>&1 +} + +case $1 in +'start') + ups_start + ;; + +'stop') + ups_stop + ;; + +'restart') + ups_stop + while pgrep upsd > /dev/null + do + sleep 1 + done + while pgrep upsmon > /dev/null + do + sleep 1 + done + while pgrep netxml-ups > /dev/null + do + sleep 1 + done + while pgrep snmp-ups > /dev/null + do + sleep 1 + done + ups_start + ;; + +*) + echo "" + echo "Usage: '$0' {start | stop | restart }" + echo "" + exit 64 + ;; + +esac +exit $? diff --git a/scripts/installer/common/string.sh b/scripts/installer/common/string.sh new file mode 100644 index 0000000000..523fd4284e --- /dev/null +++ b/scripts/installer/common/string.sh @@ -0,0 +1,145 @@ +initDefines() { +i=1 +ERR_ROOT="$i";i="`expr $i + 1`" +ERR_UNKNOWN_SYS_STR1="$i";i="`expr $i + 1`" +ERR_UNKNOWN_SYS_STR2="$i";i="`expr $i + 1`" +ERR_UNKNOWN_SYS_STR3="$i";i="`expr $i + 1`" +CS_ERR_NO_SERIAL="$i";i="`expr $i + 1`" +CS_ERR_NO_NUM="$i";i="`expr $i + 1`" +WELCOME_STR1="$i";i="`expr $i + 1`" +WELCOME_STR2="$i";i="`expr $i + 1`" +WELCOME_STR3="$i";i="`expr $i + 1`" +INSTALL_INTRO_STR1="$i";i="`expr $i + 1`" +INSTALL_INTRO_STR2="$i";i="`expr $i + 1`" +INSTALL_INTRO_STR3="$i";i="`expr $i + 1`" +INSTALL_INTRO_STR4="$i";i="`expr $i + 1`" +STR_VERSION="$i";i="`expr $i + 1`" +DEFAULT_PATH_STR="$i";i="`expr $i + 1`" +LICENSE_AGREEMENT_1="$i";i="`expr $i + 1`" +LICENSE_AGREEMENT_2="$i";i="`expr $i + 1`" +LICENSE_AGREEMENT_3="$i";i="`expr $i + 1`" +LICENSE_AGREEMENT_4="$i";i="`expr $i + 1`" +LICENSE_AGREEMENT_5="$i";i="`expr $i + 1`" +ERR_LIC_AGREE="$i";i="`expr $i + 1`" +SUCCESS_INSTALL="$i";i="`expr $i + 1`" +UNSUCCESS_INSTALL="$i";i="`expr $i + 1`" +INSTALL_PACKAGE="$i";i="`expr $i + 1`" +REMOVE_PACKAGE="$i";i="`expr $i + 1`" +INSTALL_ERROR="$i";i="`expr $i + 1`" +CS_SEPARATOR_1="$i";i="`expr $i + 1`" +CS_WELCOME_1="$i";i="`expr $i + 1`" +# UPS server Configuration +CS_SERVER_1="$i";i="`expr $i + 1`" +CS_SERVER_2="$i";i="`expr $i + 1`" +CS_SERVER_3="$i";i="`expr $i + 1`" +CS_SERVER_4="$i";i="`expr $i + 1`" +CS_SERVER_5="$i";i="`expr $i + 1`" +CS_SERVER_6="$i";i="`expr $i + 1`" +CS_SERVER_7="$i";i="`expr $i + 1`" +CS_SERVER_8="$i";i="`expr $i + 1`" +# Select UPS Password +CS_PASSWORD_1="$i";i="`expr $i + 1`" +CS_PASSWORD_2="$i";i="`expr $i + 1`" +CS_PASSWORD_3="$i";i="`expr $i + 1`" +CS_PASSWORD_4="$i";i="`expr $i + 1`" +#Please review your configuration +CS_REVIEW_1="$i";i="`expr $i + 1`" +CS_REVIEW_2="$i";i="`expr $i + 1`" +CS_REVIEW_3="$i";i="`expr $i + 1`" +CS_REVIEW_4="$i";i="`expr $i + 1`" +CS_REVIEW_5="$i";i="`expr $i + 1`" +CS_REVIEW_6="$i";i="`expr $i + 1`" +CS_REVIEW_7="$i";i="`expr $i + 1`" +CS_REVIEW_8="$i";i="`expr $i + 1`" +CS_REVIEW_9="$i";i="`expr $i + 1`" +CS_REVIEW_10="$i";i="`expr $i + 1`" +CS_CONNECTIVITY_1="$i";i="`expr $i + 1`" +CS_CONNECTIVITY_2="$i";i="`expr $i + 1`" +CS_CONNECTIVITY_3="$i";i="`expr $i + 1`" +CS_CONNECTIVITY_4="$i";i="`expr $i + 1`" +CS_CONNECTIVITY_5="$i";i="`expr $i + 1`" +# Verify Detection +CS_ASK_SERIAL_1="$i";i="`expr $i + 1`" +CS_ASK_SERIAL_2="$i";i="`expr $i + 1`" +CS_ASK_SERIAL_3="$i";i="`expr $i + 1`" +CS_ASK_SERIAL_4="$i";i="`expr $i + 1`" +CS_ASK_SERIAL_5="$i";i="`expr $i + 1`" +CS_ASK_SERIAL_6="$i";i="`expr $i + 1`" +# Choose serial device +CS_SERIAL_1="$i";i="`expr $i + 1`" +CS_SERIAL_3="$i";i="`expr $i + 1`" +CS_SERIAL_4="$i";i="`expr $i + 1`" +# Manually choose serial device +CS_MANUAL_SERIAL_1="$i";i="`expr $i + 1`" +CS_MANUAL_SERIAL_2="$i";i="`expr $i + 1`" +CS_MANUAL_SERIAL_3="$i";i="`expr $i + 1`" +CS_MANUAL_SERIAL_ERR="$i";i="`expr $i + 1`" +# SNMP Configuration +CS_SNMP_1="$i";i="`expr $i + 1`" +CS_SNMP_2="$i";i="`expr $i + 1`" +CS_SNMP_3="$i";i="`expr $i + 1`" +CS_SNMP_4="$i";i="`expr $i + 1`" +CS_SNMP_5="$i";i="`expr $i + 1`" +CS_SNMP_6="$i";i="`expr $i + 1`" +CS_SNMP_7="$i";i="`expr $i + 1`" +CS_SNMP_8="$i";i="`expr $i + 1`" +#0. Go back +CS_SNMP_9="$i";i="`expr $i + 1`" +#Scan for more UPS +CS_SNMP_10="$i";i="`expr $i + 1`" +#Starting UPP service +CS_START_SERVICE="$i";i="`expr $i + 1`" +#LanSafe installation detected. Proceeding to uninstallation. +CS_REMOVE_LS="$i";i="`expr $i + 1`" +CS_REMOVE_NS="$i";i="`expr $i + 1`" +CS_REMOVE_OLDIPP="$i";i="`expr $i + 1`" +CS_SHUTOFF_ENABLE_1="$i";i="`expr $i + 1`" +CS_SHUTOFF_ENABLE_2="$i";i="`expr $i + 1`" +CS_SHUTOFF_DELAY_1="$i";i="`expr $i + 1`" +CS_SHUTOFF_DELAY_2="$i";i="`expr $i + 1`" +CS_SHUTOFF_DELAY_3="$i";i="`expr $i + 1`" +CS_MANAGE_1="$i";i="`expr $i + 1`" +CS_MANAGE_2="$i";i="`expr $i + 1`" +CS_MANAGE_3="$i";i="`expr $i + 1`" +CS_MANAGE_4="$i";i="`expr $i + 1`" +CS_NETWORK_1="$i";i="`expr $i + 1`" +CS_NETWORK_2="$i";i="`expr $i + 1`" +CS_NETWORK_3="$i";i="`expr $i + 1`" +CS_NETWORK_4="$i";i="`expr $i + 1`" +CS_NETWORK_5="$i";i="`expr $i + 1`" +CS_ANOTHER_UPS_1="$i";i="`expr $i + 1`" +CS_ANOTHER_UPS_2="$i";i="`expr $i + 1`" +CS_ANOTHER_UPS_3="$i";i="`expr $i + 1`" +CS_ANOTHER_UPS_4="$i";i="`expr $i + 1`" +CS_ANOTHER_UPS_5="$i";i="`expr $i + 1`" +CS_ANOTHER_UPS_6="$i";i="`expr $i + 1`" +CS_MINSUP_1="$i";i="`expr $i + 1`" +CS_MINSUP_2="$i";i="`expr $i + 1`" +CS_REMOVE_UPS_1="$i";i="`expr $i + 1`" +CS_REMOVE_UPS_2="$i";i="`expr $i + 1`" +CS_NMC_LOGIN_1="$i";i="`expr $i + 1`" +CS_NMC_LOGIN_2="$i";i="`expr $i + 1`" +CS_NMC_LOGIN_3="$i";i="`expr $i + 1`" +CS_NMC_LOGIN_4="$i";i="`expr $i + 1`" +CS_ERR_PASSWORDS_DIFFER="$i";i="`expr $i + 1`" +CS_CLIENT_SD_DURATION_1="$i";i="`expr $i + 1`" +CS_CLIENT_SD_DURATION_2="$i";i="`expr $i + 1`" +CS_XML_MANU_AUTO_1="$i";i="`expr $i + 1`" +CS_XML_MANU_AUTO_2="$i";i="`expr $i + 1`" +CS_XML_MANU_AUTO_3="$i";i="`expr $i + 1`" +CS_XML_MANU_AUTO_4="$i";i="`expr $i + 1`" +CS_XML_MANU_AUTO_5="$i";i="`expr $i + 1`" +CS_XML_MANU_AUTO_6="$i";i="`expr $i + 1`" +CS_XML_MANU_1="$i";i="`expr $i + 1`" +CS_XML_MANU_2="$i";i="`expr $i + 1`" +CS_STATIC_POWERCYCLE_1="$i";i="`expr $i + 1`" +CS_STATIC_POWERCYCLE_2="$i";i="`expr $i + 1`" +CS_ERR_BADSTRING="$i";i="`expr $i + 1`" +CS_ESDTIMER_1="$i";i="`expr $i + 1`" +CS_ESDTIMER_2="$i";i="`expr $i + 1`" +} + +necho() { + lineStr="`head -$1 $installres |tail -1`" + echo "$lineStr""$2""$3""$4""$5""$6""$7""$8""$9" +} diff --git a/scripts/installer/common_EN/install.res b/scripts/installer/common_EN/install.res new file mode 100644 index 0000000000..9f52fc8ef0 --- /dev/null +++ b/scripts/installer/common_EN/install.res @@ -0,0 +1,126 @@ +You must be root to install IPP - Unix. +Unable to determine your system. +Please specify your system like, "\"./install.sh \"" +Valid systems are SOLINT SOLARI HPUX AIX6 +No serial device detected. Press Enter to continue. +This is not a number, please enter a valid number. +Welcome to IPP - Unix! +To install IPP - Unix, press y and then press +and fill in the configuration items as they are presented to you. +NOTE: If you already have IPP - Unix installed and you +do not wish to re-install it, select (N)o to stop +IPP - Unix installation. + Continue IPP - Unix installation? (y/n) +Version +The install path name for this software is: +License Agreement: +Do you accept all terms of the preceding license Agreement? +If you do not accept the terms, then the Setup will close. +To install IPP - Unix, you must accept this agreement. +Do you accept all terms of the preceding license Agreement? (y/n) +Install failed! +IPP - Unix was successfully installed on your system. +WARNING: IPP - Unix was NOT successfully installed on your system. +Installing package. +Removing old package. +Installation error, please see install.log. +=============================================================================== + IPP - Unix configuration - Select installation option: + IPP - Unix UPS Server Configuration +We will scan your network to find available IPP - Unix UPS Server. Please enter the first IP to scan (e.g. 192.168.0.0) then the last IP to scan (e.g. 192.168.0.255) or nothing if you want to scan only one address. + Enter first IP to scan : + Enter last IP to scan : +Scanning... +No IPP - Unix UPS Server available ! Press Enter to continue. + Please choose the UPS protecting this machine: + 0. Go back + Select UPS Manager Password +The UPS manager password is used to secure the shut-off of UPS. +Please enter the IPP - Unix UPS Server password, this cannot be empty (characters will not appear when typed): +Re-enter the IPP - Unix UPS Server password (characters will not appear): + Please review your configuration +Managing UPS for local use only +Managing UPS and allow remote clients +Connecting to remote IPP - Unix UPS Servers +Configured UPS devices: +Minimum number of supplies needed: +Early shutdown timeout, minutes (-1 for disabled feature): +UPS Shutoff delay, seconds: +UPS Shutoff and power-cycling enforcement (empty for auto): +Is this correct ? (y/n) + How is your UPS connected to this host ? + 1. Serial Connection (COM port) + 2. Network adapter + 0. Go back + Enter selection 0-2: + Verify Detection +Do you want Setup to automatically look for a serially connected UPS? + 1. Yes + 2. No + 0. Go back + Enter selection 0-2: + Choose serial device + 0. Go back + Enter selection: + Manually choose serial device +Please enter the device name (in the form /dev/name) of the serial port on which the UPS is connected (Make sure "ipp" user and/or "ipp" group have read/write access to the entered /dev file). + Enter device name (/dev/name): +No serial UPS found on this device. Press Enter to continue. + Network Configuration +We are scanning your network to find available network UPS. + Enter first IP to scan : + Enter last IP to scan : +Please enter the community name of your SNMP device (note that you have to enter a read/write community name to change UPS settings and allow shut-off of the UPS.) +Scanning... +No network UPS available ! Press Enter to continue. +Please choose the UPS protecting this machine: + 0. Go back +Scan for more UPS +Starting IPP - Unix service. +LanSafe installation detected. Proceeding to uninstallation. +Netwatch installation detected. Proceeding to uninstallation. +Older IPP-Unix installation detected. Proceeding to uninstallation with its method script first. + Shut-off UPS +Do you want your UPS to be shut-off after a system shut-down due to power failure ? (y/n) + Enter Power Failure Settings +Shutting down the operating system and programs on this computer takes (in second): +Shutting down the operating system and programs on this computer takes (in second) - Note that this value may be ignored if you have set-up a greater value on your device: +Do you want to directly manage an UPS (via serial link or network) or connect to a remote IPP - Unix UPS Server ? + 1. Direct management + 2. Connect to remote IPP - Unix UPS Server + Enter selection: + Network connectivity +Do you want this IPP for Unix instance to be reachable over the network as an UPS Server for the power device(s) it manages (i.e. allow IPP - Unix clients to connect to it) ? + 1. No remote access + 2. Act as a server for managed UPS + Enter selection: + Currently configured UPS + 1. Continue with this configuration + 2. Add another UPS + 3. Remove an UPS + 0. Go back + Enter selection: + Minimum supplies required +Give the number of power supplies that must be receiving power to keep this system running (minimum 1): + Enter the number of the UPS you wish to remove +No such UPS + Network device login/password +Enter login for network device: +Enter password for network device (characters will not appear): +Re-enter password for network device (characters will not appear): +Passwords are different, please try again. + Power Failure Settings +Note that the shutdown duration (the time left for your system to shutdown before the UPS shuts-off) is set on the IPP - Unix UPS Server side. Push Enter key to continue... + Automatic or manual network device setup +Do you want to scan your network for available devices or directly enter an IP address ? + 1. Scan network + 2. Enter IP + 0. Go back + Enter selection: + Network device IP +Please enter your network device IP: +Do you want to "enforce" or "forbid" this host to always power-cycle the UPS as part of powerfail shutdown, or should it depend on other setup and run-time situation? +Please enter "enforce" ("e"), "forbid" ("f") or "auto" (empty line); if unsure - default to "auto": +Unexpected string was entered, please try again. +Do you want to enable early shutdown timer ("-1" or empty for usual late shutdown to maximize uptime, 0 or more for minutes (recommended 5+ minutes then) spent ONBATT with less than MINSUPPLIES power sources known protected, before beginning to shut down)? +Please enter a number of minutes for early shutdown timer (either "-1", or 0 or more); if unsure - default to "-1": diff --git a/scripts/installer/common_EN/license.txt b/scripts/installer/common_EN/license.txt new file mode 100644 index 0000000000..2817e194c0 --- /dev/null +++ b/scripts/installer/common_EN/license.txt @@ -0,0 +1,636 @@ + + Eaton Corporation + + END-USER LICENSE AGREEMENT + + +Revised: June, 2008 + + +IMPORTANT, READ CAREFULLY. THIS EATON CORPORATION END USER +LICENSE AGREEMENT (THE "AGREEMENT") IS A BINDING CONTRACT +BETWEEN YOU, THE END-USER (THE "LICENSEE") AND EATON +CORPORATION ("EATON" OR "LICENSOR"). EXCEPT TO THE EXTENT +YOU ARE BOUND BY A WRITTEN AGREEMENT SIGNED BY BOTH YOU AND +EATON REGARDING THE USE AND LICENSE OF THIS SOFTWARE +PRODUCT, BY INSTALLING OR USING THIS SOFTWARE PRODUCT, YOU, +THE LICENSEE, ARE AGREEING TO BE BOUND BY THE TERMS, +CONDITIONS AND LIMITATIONS OF THIS AGREEMENT, WHICH +INCLUDES, BUT IS NOT LIMITED TO, THE SOFTWARE USAGE LICENSE, +THE DISCLAIMER OF WARRANTY AND LIMITED WARRANTY, AND +LIMITATION OF EATON LIABILITY. + +READ THE TERMS AND CONDITIONS OF THIS AGREEMENT CAREFULLY +BEFORE INSTALLING OR USING THE SOFTWARE. IF YOU DO NOT +AGREE TO THE TERMS, CONDITIONS AND LIMITATIONS OF THIS +AGREEMENT, PROMPTLY DELETE THE LICENSE FILE MEDIA, THE +ENTIRE MEDIA PACKAGE AND SOFTWARE FROM YOUR COMPUTER AND +RETURN THE LICENSE FILE DISKETTE(S), THE ENTIRE DISK PACKAGE +AND ALL OTHER ITEMS (INCLUDING DOCUMENTATION AND PACKAGING) +WITHIN 30 DAYS OF RECEIPT OF THE SOFTWARE TO THE PLACE FROM +WHICH YOU OBTAINED IT FOR A FULL REFUND. + +EACH EATON LICENSED PRODUCT INCORPORATES ADDITIONAL TERMS, +CONDITIONS, AND LIMITATIONS THAT ARE IDENTIFIED AS EXHIBITS +TO THIS AGREEMENT (SOME OR ALL OF WHICH ARE ATTACHED AND +INCORPORATED HEREIN). NOTWITHSTANDING THE ATTACHED +EXHIBITS, LICENSOR MAY LICENSE ADDITIONAL PRODUCTS TO +LICENSEE SUBJECT TO THE ADDITIONAL EXHIBITS, A LISTING OF +WHICH IS AS FOLLOWS: "EXHIBIT A" APPLIES TOEATON PRODUCTS. + + + +---------------------------------- +1.0 Definitions +---------------------------------- + + +1.1 Documentation. Documentation means the user guides and +manuals for the installation and use of the Software, +whether provided in CD-ROM, hard copy, or other form. + + + +1.2 License Fee. License Fee means the fee paid to Eaton +for each specific license to use the Software granted +hereunder as may be identified in an Order Form received and +accepted by Eaton. + + + +1.3 License File. License File means a component of the +Software that enables one or more other components of the +Software and may also specify the location of the Designated +Device and the Licensee. The License File also specifies +certain limitations on the use of the enabled components of +the Software and the purposes for, and extent to, which the +enabled components of the Software may be used. Certain +components of the Software may be licensed hereunder without +a License File. For reference purposes, the components of +the Software enabled by a particular License File correlate +to Eaton part numbers as may be reflected on the License +File or on one or more Order Forms or License Certificate. + + + +1.4 Licensed Key. License Key means a key provided to +Licensee by Eaton to enable functionality of the Software. + + + +1.5 Order Form. Order Form means (i) the document in hard +or electronic copy by which particular Software or Technical +Support Services is ordered by or for Licensee and by which +Eaton is advised of the location of the Designated Device +and (ii) any order confirmation that may be issued by Eaton +acknowledging receipt of, or accepting, an order by Licensee +for particular Software or Technical Support Services. + + + +1.6 Software. Software means the computer software +programs for which Licensee is granted a license hereunder, +the License Files necessary to enable those programs, the +Documentation therefore and, to the extent Licensee either +purchases an Update or is entitled to receive Updates in +connection with certain Technical Support Services purchased +pursuant to Section 3.2, Updates thereto. All computer +programs are licensed hereunder in object code (machine- +readable) form only except that certain "toolkit" software +programs may include limited portions in source code (human- +readable) form. + + + +1.7 Technical Support (Maintenance) Services. Technical +Support (Maintenance) Services means: (i) services provided +to Licensee under an Support Agreement pursuant to Eaton's +Support Services Policies, Terms and Conditions ("Support +Services Policy") in effect on the date the Software is +delivered to Licensee or as changed from time to time by +Eaton, and may include if available for the Eaton Licensed +Product (ii) Training Services provided pursuant to Eaton's +Training policies in effect on the date such services are +ordered by or for Licensee. + + + +1.8 Update. Update means: (a) supplemental programs, if +and when developed and distributed by Eaton, that may +contain bug fixes or improved program functions for the +Software; and (b) a subsequent release of the Software, if +and when developed by Eaton, which Eaton generally makes +available for licensees that have an Support Agreement and +to which Licensee is entitled under the Support Services +Policy by virtue of having purchased such services. An +Update does not include any release, new version, option, or +future product, which Eaton licenses separately. + + +------------------------------------ +2.0 Software License +------------------------------------ + + +2.1 Ownership. Licensee owns the magnetic or other +physical media upon which the Software is originally or +subsequently recorded or fixed, but Eaton or Eaton Licensors +retains all title, copyright and other proprietary rights +in, and ownership of, the Software regardless of the media +upon which the original or any copy may be recorded or +fixed. Licensee does not acquire any rights, express or +implied, other than those expressly granted in this +Agreement. Eaton grants to Licensee a non-exclusive, non- +assignable license to use the Software in conjunction with +the operation of Eaton products or other products described +by Eaton in the Documentation. Licensee will use Licensed +Keys provided per the limitations set forth in the Order +Form Licensee will not, nor will Licensee suffer or permit +others to, modify, adapt, translate, reverse engineer, +decompile, or disassemble the Software or any component +thereof (including the Documentation), or create derivative +works based on the Software (including the Documentation), +except to the extent such forgoing restriction is prohibited +by applicable law. + + + +2.2 Copy Restrictions. Copyright laws and international +treaties protect the Software, including the Documentation. +Unauthorized copying of the Software, the Documentation or +any part thereof, is expressly prohibited. Subject to these +restrictions, Licensee may make a reasonable number of +copies of the Software solely for backup or archival +purposes, and may make a limited number of copies of the +Documentation for use by Licensee in connection with its +authorized use of the Software. Licensee will number and +account for all such copies. All titles, trademarks, and +copyright and restricted rights notices included in the +Software and Documentation will be reproduced in such +copies. + + + +2.3 Transfer and Assignment Restrictions. Licensee will +not voluntarily sell or involuntarily assign, lease, +sublicense, encumber, or otherwise transfer its interest in +this Agreement or in the Software, or Documentation in whole +or in part, or allow any other person (except Licensee's +bona fide employees) or entity, including any parent or +subsidiary of Licensee or other subsidiary of Licensee's +parent, to use the Software without the written consent of +Eaton. Any dissolution, merger, consolidation, or other +reorganization of Licensee, or the sale or other transfer of +a controlling percentage of the capital stock of Licensee +shall be deemed a voluntary assignment. + + + +2.4 Verification. At Eaton's written request, not more +frequently than annually, Licensee will furnish Eaton with a +signed certification verifying that the Software is being +used in accordance with the provisions of this Agreement. +Eaton may audit Licensee's use of the Software. Any such +audit will be conducted during regular business hours at +Licensee's facilities and will not unreasonably interfere +with Licensee's business activities. If an audit reveals +that Licensee is using Software contrary to the terms and +limitations of this License Agreement then Licensee will be +invoiced for additional license fees consistent with +Licensee's actual use of the Software in accordance with +Eaton's then current price list for the Software and the +cost of the audit, which amount will be immediately due and +payable. This assessment of additional fees will be without +prejudice to any other remedies Eaton may have for breach of +this Agreement, including without limitation termination +under Section 3.2. + + +------------------------------ +3.0 Termination +------------------------------ + +3.1 Termination by Licensee. Licensee may terminate the +license granted hereunder at any time upon delivery of +written notice to Eaton. Termination will not relieve +Licensee of its obligations specified in Section 3.3 below. + + + +3.2 Termination by Eaton. This Agreement and the license +granted hereunder automatically terminates if Licensee +breaches any provision of this Agreement including but not +limited to the failure to pay in full the License Fee or +Technical Support (Maintenance) fee when due. + + + +3.3 Effect of Termination. Immediately upon termination of +this Agreement or the license granted hereunder, Licensee +will cease using the Software, will delete the Software, +including the License File(s), from its computers and will +either return to Eaton or destroy the Software, including +the License File(s), Documentation, packaging and all copies +thereof. If Licensee elects to destroy the Software then +Licensee will certify in writing to Eaton the destruction of +the Software. Termination of this Agreement and return or +destruction of the Software will not limit either party from +pursuing other remedies available to it, including +injunctive relief, nor will such termination relieve +Licensee's obligation to pay all fees and expenses that have +accrued or are otherwise owed by Licensee under this +Agreement or any Order Form received and accepted by Eaton. +The parties' rights and obligations under the following +sections of this Agreement will survive termination of this +Agreement: Article 1.0, Article 2.1, Section 2.2, Section +2.3, Section 2.4 Article 3.0, Article 4.0 and Article 5.0. + + + +------------------------------------------------------------ +4.0 Infringement, Indemnity and Remedies +------------------------------------------------------------ + + +4.1 Infringement Indemnity. Subject to the limitations in +Articles 4 and 5 of this Agreement, Eaton will defend and +indemnify Licensee against a third party claim (an +"Indemnified Claim") that the Software infringes any patent +and/or copyright enforceable in the United States of America +or misappropriates any trade secret (as the terms +"misappropriation" and "trade secret" are defined in the +Uniform Trade Secrets Act) protected under the laws of any +of the United States, provided that: (i) Licensee notifies +Eaton in writing within 30 days of the claim; (ii) Eaton has +sole control of the defense and all related settlement +negotiations; and (iii) Licensee provides Eaton with the +assistance, information and authority necessary to perform +Eaton's obligations under this Section. For any +intellectual property claim for which a defense is not +provided in this Section 4.1, Eaton, in its sole discretion, +may elect to treat such intellectual property claim as an +Indemnified Claim as defined in this Section 4.1. Eaton +will have no liability for any claim of infringement based +on use of a superseded or altered release of Software if the +infringement would have been avoided by the use of a current +unaltered release of the Software which was obtainable by +Licensee from Eaton. + +Eaton will have no obligation to any Licensee for any +Indemnified Claims relating to allegations of copyright +infringement which arise outside the geographical boundaries +of the United States, Canada, Japan, or the European Union +("Included Jurisdictions"), or any Indemnified Claims +relating to allegations of trade secret misappropriation +which arise outside the geographical boundaries of the +United States. + +If the Software is held, or is believed by Eaton, to +infringe, then Eaton will have the option, at its expense, +to: (i) modify the Software to be noninfringing; or (ii) +obtain for Licensee a license to continue using the +Software. If, in Eaton's sole discretion, it is not +economically or commercially reasonable to perform either of +the above options then Eaton may terminate the license for +the infringing Software and refund to Licensee the License +Fee paid to Eaton for the infringing Software. This Section +4.1 states Eaton's entire liability and Licensee's sole and +exclusive remedy for infringement of intellectual property +rights. + + + + + +4.2 Limited Warranties and Disclaimers. + + 4.2.1 Limited Media Warranty. Eaton warrants for a +period of ninety (90) days following delivery of the +Software that the CD-ROMs, diskettes, or other media upon +which the Software is delivered are free from defects in +materials and workmanship under normal use. + + + + 4.2.2 Limited Software Warranty. Eaton warrants +for a period of ninety (90) days following delivery of the +Software that the Software will perform substantially in +accordance with the Documentation. + + + + 4.2.3 Limited Maintenance Support Services +Warranty. Eaton warrants for a period of ninety (90) days +following performance of the service that its Maintenance +Support Services will be performed consistent with generally +accepted industry standards. + + + + 4.2.4 Exclusive Remedy. For any breach of the +warranties contained in this Section 4.0, Licensee's +exclusive remedy, and Eaton's entire liability will be: + + + + 4.2.4.1 For Software. Eaton will use commercially +reasonable efforts to provide maintenance modifications or +fixes with respect to any such material defect in a +reasonably timely manner. If Eaton is unable to make the +Software operate as warranted, then Licensee may, within +thirty (30) days after Eaton's failure to cure or fix the +defect, elect to terminate the license granted hereunder and +recover the License Fee paid to Eaton with respect to the +defective Software; + + + + 4.2.4.2 For Maintenance Support Services. The +reperformance of the services, or if Eaton is unable to +perform the services as warranted, Licensee will be entitled +to recover the fees paid to Eaton for the unsatisfactory +service. + + + + 4.2.4.3 For Media. The replacement of the defective +media returned within ninety (90) days of delivery of the +Software. + +4.3 Disclaimer of All Other Warranties. NOTWITHSTANDING +ADDITIONAL WARRANTIES PROVIDED PURSUANT TO LICENSOR'S +EXHIBITS AND AMENDMENTS INCLUDED HEREIN, THE WARRANTIES +ABOVE IN THIS SECTION 4.2 ARE EXCLUSIVE AND ARE IN LIEU OF +ALL OTHER WARRANTIES, WHETHER EXPRESS OR IMPLIED, INCLUDING +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A +PARTICULAR PURPOSE. NO ORAL OR WRITTEN INFORMATION OR +ADVICE GIVEN BY EATON, ITS DEALERS, DISTRIBUTORS OR AGENTS +OR EMPLOYEES WILL CREATE A WARRANTY OR IN ANY WAY INCREASE +THE SCOPE OF THE WARRANTIES GIVEN IN THIS SECTION, AND +LICENSEE MAY NOT RELY ON ANY SUCH INFORMATION OR ADVICE. +This software will work with other manufacturers' UPS +systems. Reference will be made to those manufacturers by +their trade names, trademarks, and models. + +Eaton does not warrant that the Software will meet +Licensee's requirements, that the Software will operate in +combinations other than as specified in the Documentation, +that the operation of the Software will be uninterrupted or +error-free or that Software errors will be corrected. +Preproduction releases (including Alpha and Beta site +releases) of Software and Technical Support Services related +thereto are distributed "AS IS". + + +---------------------------------------- +5.0 General Provisions +---------------------------------------- + + +5.1 Update Policy. Eaton may from time to time, but has no +obligation to, create Updates of the Software or components +thereof. Subject to the Support Services Policy in effect +at the time Licensee orders Technical Support (Maintenance) +Services, Eaton will make such Updates available to Licensee +provided Licensee has entered into a Support Agreement, and +is not in breach of this Agreement at the time of the +release of the Update. + + + +5.2 Liability Limitation. NOTWITHSTANDING ANY PROVISION OF +THIS AGREEMENT TO THE CONTRARY, EXCEPT FOR LICENSEE'S +VIOLATION OF THE ARTICLE 2.0 OF EACH EXHIBIT ENTITLED +"SOFTWARE LICENSE AND LIMITATION", IN NO EVENT WILL EITHER +PARTY, NOR ANYONE ELSE WHO HAS BEEN INVOLVED IN THE +CREATION, PRODUCTION OR DELIVERY OF THE SOFTWARE, INCLUDING +EATON LICENSORS, BE LIABLE FOR ANY INDIRECT, INCIDENTAL, +SPECIAL, PUNITIVE OR CONSEQUENTIAL DAMAGES, OR DAMAGES FOR +LOSS OF PROFITS, REVENUE, DATA OR USE, INCURRED BY EITHER +PARTY OR ANY THIRD PARTY, WHETHER IN AN ACTION IN CONTRACT +OR TORT, EVEN IF SUCH PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. EATON'S LIABILITY FOR DAMAGES +AND EXPENSES HEREUNDER OR RELATING HERETO (WHETHER IN AN +ACTION IN CONTRACT OR TORT) WILL IN NO EVENT EXCEED THE +AMOUNT OF LICENSE FEES PAID TO EATON WITH RESPECT TO THIS +AGREEMENT, AND IF SUCH DAMAGES RESULT FROM LICENSEE'S USE OF +PARTICULAR LICENSE FILES OR TECHNICAL SUPPORT SERVICES THEN +SUCH LIABILITY WILL BE LIMITED TO LICENSE FEES PAID TO EATON +FOR THE RELEVANT SOFTWARE OR SERVICES GIVING RISE TO THE +LIABILITY. BECAUSE SOME STATES AND JURISDICTIONS DO NOT +ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY, PORTIONS OF +THE ABOVE, THE LIMITATION MAY NOT APPLY TO YOU. + +THE PROVISIONS OF THIS AGREEMENT ALLOCATE THE RISKS BETWEEN +EATON AND LICENSEE. EATON' PRICING REFLECTS THIS ALLOCATION +OF RISK AND THE LIMITATION OF LIABILITY SPECIFIED HEREIN. + + + +5.3 Notices. All notices required to be sent hereunder +will be in writing and will be deemed to have been given +when mailed by first class mail to the address shown on the +relevant Order Form (if to Licensee) or to the Eaton address +shown on the relevant Order Form (if to Eaton). + + + +5.4 Severability. If any provision of this Agreement is +held to be invalid or unenforceable, the remaining +provisions of this Agreement will remain in full force. + + + +5.5 Waiver. The waiver by either party of any default or +breach of this Agreement will not constitute a waiver of any +other or subsequent default or breach. Except for actions +for nonpayment or breach of Eaton's proprietary rights in +the Software, no action, regardless of form, arising from or +relating to this Agreement may be brought by either party +more than two years after the cause of action has accrued. + + + +5.6 Entire Agreement. This Agreement (together with any +Exhibit and information from the Order Forms and License +Files necessary to identify the Software that is the subject +of this Agreement or further specific restrictions +applicable to such Software) constitutes the complete +agreement between the parties and supersedes all prior or +contemporaneous agreements or representations, written or +oral, concerning the subject matter of this Agreement. This +Agreement may not be modified or amended except in a writing +signed by a duly authorized representative of each party. +No other act, document, usage or custom will be deemed to +amend or modify this Agreement. It is expressly agreed that +the terms of this Agreement, the attached Exhibit, and any +Order Form issued by Eaton will supersede the terms in any +Order Form or other purchasing document submitted by +Licensee; and the pre-printed terms of any Licensee Order +Form or other purchasing document are expressly rejected. +Certain components of the Software may also be subject to a +paper or electronic license agreement delivered by or on +behalf of Eaton concurrently herewith, the terms of which +will be supplemental hereto to the extent not inconsistent +herewith. If a copy of this Agreement in a language other +than English is included with the Software or Documentation, +it is included for convenience and the English language +version of this Agreement will control. + + + +5.7 Heirs, Successors, and Assigns. Each and all of the +covenants, terms, provisions and agreements herein contained +will be binding upon and inure to the benefit of the parties +hereto and, to the extent permitted by this Agreement, their +respective heirs, legal representatives, successors and +assigns. + + + +5.8 Export Restrictions. Licensee agrees to comply fully +with all relevant export laws and regulations of the United +States (the "Export Laws") to assure that neither the +Software nor any direct product thereof are (I) exported, +directly or indirectly, in violation of Export Laws; or (ii) +are intended to be used for any purposes prohibited by the +Export Laws. Without limiting the foregoing Licensee will +not export or re-export the Software: (i) to any country to +which the U.S. has embargoed or restricted the export of +goods or services, which currently include, but are not +limited to Cuba, Iran, Iraq, Libya, North Korea, Sudan and +Syria, or to any national of any such country, wherever +located, who intends to transmit or transport the Software +back to such country; (ii) to any end user who Licensee +knows or has reason to know will utilize the Software in the +design, development or production of nuclear, chemical or +biological weapons; or (iii) to any end-user who has been +prohibited from participating in U.S. export transactions by +any federal agency of the U.S. government. + + + +5.9 U.S. Government Restricted Rights. The Software is a +"commercial item" as that term is defined at 48 CFR 2.101 +(October 1995), consisting of "commercial computer software" +and "commercial computer software documentation", as such +terms are used in 48 CFR 12.212 (September 1995), and is +provided to the U.S. Government only as a commercial end +item. Consistent with 48 CFR 12.212 and 48 CFR 227.7202-1 +through 227.7202-4 (June 1995), all U.S. Government End +Users acquire the Software with only those rights set forth +herein. Contractor/ manufacturer is Eaton Corporation, 8609 +Six Forks Road, Raleigh, North Carolina 27615. + + + +5.10 Third Party Intellectual Property Right Notices. The +Software may contain components that are owned by third +parties ("Eaton Licensors") and are incorporated into, or +embedded in, the Software pursuant to license arrangements +between Eaton and such third parties. Use of the Eaton +Licensor components embedded in the Software is subject to: +(i) this Agreement or (ii) the Eaton Licensors end user +license agreement (EULA) if provided with the installation +of the Software (a copy of which is available from Eaton +upon request). In addition, License agrees that the +embedded components may not be used in any other fashion or +for any other purpose other than as provided under this +Agreement or the EULA. Copyright and other proprietary +rights notices of Eaton and Eaton Licensors are contained in +the Software, and Licensee will not modify, delete, or +obfuscate any such notices. + + + +5.11 Confidentiality. The Software, including the +Documentation, the terms and pricing under this Agreement, +and any other information that may be marked as confidential +is confidential and proprietary information of Eaton +("Confidential Information"). Results of any benchmark or +general performance or feature evaluation tests on the +Software run by Licensee may not be disclosed outside of +Licensee's organization without the prior written consent of +Eaton. Licensee will hold the Confidential Information in +strict confidence during the term of this Agreement and +until such Confidential Information falls within the public +domain. Licensee will take reasonable steps to ensure that +its employees and agents also comply with the strict +confidentiality obligations of this Section. Licensee +acknowledges that confidential aspects of the Software +(including any source code) is a trade secret of Eaton, the +disclosure of which would cause substantial harm to Eaton +that could not be remedied by the payment of damages alone. +Accordingly, Eaton will be entitled to preliminary and +permanent injunctive and other equitable relief for any +breach of this Section 5.11. + + + +5.12 Note on JAVA Support. The Software may contain support +for programs written in JAVA. JAVA technology is not fault +tolerant and is not designed, manufactured, or intended for +use or resale as online control equipment in hazardous +environments requiring fail-safe performance, such as in the +operation of nuclear facilities, aircraft navigation or +communications systems, air traffic control, direct life +support machines, or weapons systems, in which the failure +of JAVA technology could lead directly to death, personal +injury, or severe physical or environmental damage. EATON +DISCLAIMS ALL DAMAGES INCLUDING DIRECT, INDIRECT AND +CONSEQUENTIAL DAMAGES RELATING TO THE FAILURE OF ANY +SOFTWARE INCLUDING JAVA PROGRAMS AND/OR JAVA TECHNOLOGY. + + + +5.13 Eaton. Through its Eaton Solution Providers Program +Eaton may make available for licensing from independent +third party vendors ("Program Vendors") certain computer +software products ("Program Products"). Licensing and use +of Program Products are subject to the terms and limitations +of separate license agreements with each such Program +Vendor, which license agreements must be viewed and accepted +prior to, or concurrently with, the down-loading or +installation of the Program Product. Eaton makes no +representation or warranty with respect to any Program +Products. + + + +5.14 Governing Law. This Exhibit and the Agreement will be +interpreted and enforced in accordance with the laws of the +State of Ohio or Pennsylvania, without regard to choice of +law principles. + + + +5.15 Jurisdiction and Arbitration All disputes, claims or +controversies arising out of or relating to this Exhibit or +the Agreement that are not resolved by the parties' good +faith attempt to negotiate a resolution will be submitted to +final and binding arbitration before JAMS/Endispute, or its +successor, in Norfolk County Massachusetts, USA, pursuant to +the United States Arbitration Act, 9 U.S.C. Sec. 1 et seq. +The arbitration will be conducted in accordance with the +provisions of JAMS/Endispute's Streamlined Arbitration Rules +and Procedures in effect at the time of filing of the demand +for arbitration. The parties will cooperate with +JAMS/Endispute and each other in selecting a single +arbitrator who will be a former judge or justice with +substantial experiences in resolving business disputes with +particular experience in resolving disputes involving +computer software. The costs of arbitration will be shared +equally by the parties. The provisions of this Section may +be enforced by any court of competent jurisdiction. The +arbitrator will not be empowered to award damages in excess +of, or inconsistent with, the liability limitations +contained in this Exhibit or the Agreement; however, the +prevailing party will be entitled to an award of all costs, +fees and expenses, including expert witness fees and +attorneys fees, to be paid by the party against whom +enforcement is ordered . + + + +Eaton Corporation EULA June, 2008 + diff --git a/scripts/installer/hpux/ipp-os-shutdown.conf.sample b/scripts/installer/hpux/ipp-os-shutdown.conf.sample new file mode 100644 index 0000000000..6fefc8e5d5 --- /dev/null +++ b/scripts/installer/hpux/ipp-os-shutdown.conf.sample @@ -0,0 +1,42 @@ +# +# ipp-os-shutdown.conf +# +# Settings that specify typical shutdown commands for various supported OSes +# Version for HP-UX +# +# See http://docstore.mik.ua/manuals/hp-ux/en/5991-1247B/ch05s09.html +# and http://docstore.mik.ua/manuals/hp-ux/en/5991-1247B/ch05s01.html#bgbjeidh + +# +# By default HPUX shutdown leaves the box halted and running, so requesting +# delayed UPS powercycling may be critical for proper shutdowns. +# +# To enable actual powerdown on chosen server models, you may need to +# run `acpiconfig enable softpowerdown` from the UEFI shell and reboot +# the HPUX partition. See more details in HP docs about your server model. +# + +# The program which executes an OS shutdown, maybe including flags that +# disable its interactive mode +CMD_SHUTDOWN="/usr/sbin/shutdown -y" +#CMD_SHUTDOWN="/sbin/shutdown -y" + +# Depending on OS and hardware support, "poweroff" option may tell the +# host's power source units to cut off their power to the motherboard, +# and "halt" may sit forever at the "OS is stopped" prompt or equivalent. +SDFLAG_POWEROFF="-h" +SDFLAG_REBOOT="-r" +SDFLAG_HALT="-R -H" # Reconfigure+Hold + +# The flag for quick stop (shorter service stop timeouts and fewer/no +# logs, or outright go to kill remaining processes) +SDFLAG_UNGRACEFUL="now" + +# Trigger a shutdown without delay +SDFLAG_INSTANT="now" + +## Filename to store the PID of a pending shutdown +## If this file is absent, the shutdown can not be canceled (killed) +## If the "${SHUTDOWN_PIDFILE}.irreversible" exists and points to running PID +## then the new shutdown can not be queued (caller must cancel old one first) +SHUTDOWN_PIDFILE="/var/run/nut/shutdown.pid" diff --git a/scripts/installer/install.sh b/scripts/installer/install.sh new file mode 100755 index 0000000000..f1ed69c4e5 --- /dev/null +++ b/scripts/installer/install.sh @@ -0,0 +1,1912 @@ +#!/bin/sh +# install.sh +# Copyright (c) 2013-2016, by Eaton (R) Corporation. All rights reserved. +# A shell script which installs IPP - Unix +# It installs the native package then runs NUT configuration tools +# to create an initial configuration and finally run the service. +. ./version.sh + +PATH="$PATH:/bin:/usr/bin:/sbin:/usr/sbin:/usr/ucb:/usr/ccs/bin:/usr/xpg4/bin:/usr/xpg6/bin" +export PATH + + +NUT_PACKAGE_SOLARI="NUT_solaris_sparc_package2.6.5.local" +NUT_PACKAGE_SOLINT="NUT_solaris_i386_package2.6.5.local" + +COMMON_DIR="common" +LOG_FILE=install.log +[ x"${IPP_DEBUG-}" = xyes ] || IPP_DEBUG=no +[ x"${IPP_WIPE_OLD_CONFIG-}" = xyes ] || IPP_WIPE_OLD_CONFIG=no + +#configuration data +C_MODE="standalone" +C_HOSTNAME="localhost" +C_DEVICE="" +C_OPTION="" +C_NUM_DEV=0 +C_PASSWORD="" +# Number of seconds for late emergency shutdown, goes into netxml-ups +# to get alerts from the UPS when battery runs low, *and* becomes the +# DELAY setting in ipp.conf used to power-cycle the UPSes in the end. +C_SHUTDOWN_DURATION="120" +# Number of minutes spent ONBATT for early-shutdown, goes into ipp.conf +# This logically matches the netxml-ups "shutdown_timer" parameter +# which is exclusive to this one driver and does not always work. +C_SHUTDOWN_TIMER="-1" +C_MINSUPPLIES=1 +C_COMMUNITY="public" +C_NUM_NETWORK_DEVICE=0 +# empty for automatic, "forbid" or "enforce" for once-and-for-all +C_POWERDOWNFLAG_USER="" + +FIRST_IP="" +LAST_IP="" +NUT_PORT="3493" + +ADMIN_FILE="/tmp/ipp_admin_file" + +cd "`dirname $0`" + +. "$COMMON_DIR/string.sh" + +get_parameters() { + case $1 in + English) + lang=EN + ;; +# Japanese) +# lang=JP +# ;; + SOLARI) + SYSTEM=$1 + ;; + SOLINT) + SYSTEM=$1 + ;; + HPUX) + SYSTEM=$1 + ;; + AIX) + SYSTEM=$1 + ;; + esac +} + +check_locale_language() { + set `locale` >/dev/null 2>&1 + case $1 in + LANG=en_US) + lang=EN + ;; + LANG=C) + lang=EN + ;; + esac +} + +compute_SYSTEM () { + set `uname -a` + case "$1" in + SunOS) + case "$3" in + 5.*) + case "$5" in + i86pc) + SYSTEM=SOLINT + ;; + *) + SYSTEM=SOLARI + ;; + esac + ;; + *) + SYSTEM="Unknown System" + ;; + esac + ;; + HP-UX) + SYSTEM=HPUX + ;; + AIX) + case "$4" in + 6) + SYSTEM=AIX + ;; + 7) + SYSTEM=AIX + ;; + *) + SYSTEM="This AIX version is not supported" + ;; + esac + ;; + *) + SYSTEM="Unknown System" + ;; + esac + + compute_system +} + +compute_system () { + case "$SYSTEM" in + SOLINT) + system=solint + COMMON_DIR_SYS=solcmn + ;; + SOLARI) + system=solari + COMMON_DIR_SYS=solcmn + ;; + HPUX) + system=hpux + COMMON_DIR_SYS="$system" + ;; + AIX) + system=aix + COMMON_DIR_SYS="$system" + ;; + *) + echo + necho $ERR_UNKNOWN_SYS_STR1 + necho $ERR_UNKNOWN_SYS_STR2 +# echo "Valid systems are tagged SOLINT SOLARI HPUX AIX" + necho $ERR_UNKNOWN_SYS_STR3 + echo + necho $INSTALL_ERROR + exit 1 + ;; + esac +} + +read_def () { + default="$2" + + if [ "$2" = "" ]; then + necho "$1" + else + necho "$1" "[" "$2" "]" + fi + + read answer + if [ -z "$answer" ]; then + answer="$default" + fi +} + +read_def_silent () { + default="$2" + + necho $1 + stty -echo + read answer + stty echo + if [ -z "$answer" ]; then + answer="$default" + fi +} + +create_admin_file () { + echo basedir=default > "$ADMIN_FILE" + echo runlevel=quit >> "$ADMIN_FILE" + echo conflict=nocheck >> "$ADMIN_FILE" + echo setuid=nocheck >> "$ADMIN_FILE" + echo action=nocheck >> "$ADMIN_FILE" + echo partial=nocheck >> "$ADMIN_FILE" + echo instance=overwrite >> "$ADMIN_FILE" + echo idepend=quit >> "$ADMIN_FILE" + echo rdepend=quit >> "$ADMIN_FILE" + echo space=quit >> "$ADMIN_FILE" +} + +install_files () { + echo + case "$LOG_FILE" in + /*) ;; + *) LOG_FILE="`pwd`/$LOG_FILE" ;; + esac + rm -f "$LOG_FILE" > /dev/null 2>&1 + touch "$LOG_FILE" + + echo "NOTE: progress of this script's interpretation (and errors) will be logged into" + echo " $LOG_FILE" + echo " You should attach it to support calls should any problems arise" + exec 2>"$LOG_FILE" + echo "Started at `date` as: $0 $*" >&2 + set >&2 + set -x + + . ./uninstall-lsnw.sh + # Check if Lansafe is installed + detect_lansafe + if [ $? -eq 0 ]; then + necho $CS_REMOVE_LS + # Proceed to uninstallation + uninstall_lansafe + fi + + # Check if Netwatch is installed + detect_netwatch + if [ $? -eq 0 ]; then + necho $CS_REMOVE_NW + # Proceed to uninstallation + uninstall_netwatch + fi + + # Clean-up previous installation + remove_profile_settings + if [ -d "/var/state/ups" ]; then + rm -rf "/var/state/ups" + fi + if [ -d "/var/run/nut" ]; then + rm -rf "/var/run/nut" + fi + if [ -d "$instpath/etc" ]; then + cp -prf "$instpath/etc" "$instpath/etc.bak-$$" + if [ x"${IPP_WIPE_OLD_CONFIG}" = xyes ]; then + echo "Removing old configs because IPP_WIPE_OLD_CONFIG=yes" + rm -rf "$instpath/etc" + fi + fi + if [ -d "$instpath/xbin" ]; then + rm -rf "$instpath/xbin" + fi + if [ -x "$instpath/bin/uninstall-ipp" ]; then + necho $CS_REMOVE_OLDIPP + "$instpath/bin/uninstall-ipp" || true + fi + if [ -e "$instpath/bin/ipp-wrapper" ]; then + rm -f "$instpath/bin/ipp-wrapper" || true + fi + + case "$system" in + solari) + necho $REMOVE_PACKAGE | tee -a "$LOG_FILE" + + create_admin_file + + pkgrm -n -a "$ADMIN_FILE" NUT >> "$LOG_FILE" 2>&1 + necho $INSTALL_PACKAGE | tee -a "$LOG_FILE" + pkgadd -a "$ADMIN_FILE" -n \ + -d "$systemdir/$NUT_PACKAGE_SOLARI" NUT \ + >> "$LOG_FILE" 2>&1 + res=$? + if [ ! $res = 0 ]; then + necho $INSTALL_ERROR + exit 1 + fi + rm -f "$ADMIN_FILE" + # Modified initscript, to run upsmon as full root, + # for optional early-shutdown support + if [ -s "$COMMON_DIR_SYS/solaris_init" ]; then + cp -f "$COMMON_DIR_SYS/solaris_init" "$instpath/nut" + res=$? + if [ ! $res = 0 ]; then + necho $INSTALL_ERROR + exit 1 + fi + fi + chown root:ipp "$instpath/nut" >> "$LOG_FILE" 2>&1 && \ + chmod 755 "$instpath/nut" >> "$LOG_FILE" 2>&1 + res=$? + if [ ! $res = 0 ]; then + necho $INSTALL_ERROR + exit 1 + fi + rm -f /etc/init.d/nut /etc/rc3.d/K100nut /etc/rc3.d/S100nut /etc/rc3.d/S99nut /etc/rc0.d/K60nut + ln -s "../../$instpath/nut" /etc/init.d/nut && \ + ln -s "../init.d/nut" /etc/rc3.d/S99nut && \ + ln -s "../init.d/nut" /etc/rc0.d/K60nut + res=$? + if [ ! $res = 0 ]; then + necho $INSTALL_ERROR + exit 1 + fi + ;; + solint) + necho $REMOVE_PACKAGE | tee -a "$LOG_FILE" + + create_admin_file + + pkgrm -n -a "$ADMIN_FILE" NUT >> "$LOG_FILE" 2>&1 + necho $INSTALL_PACKAGE | tee -a "$LOG_FILE" + pkgadd -a "$ADMIN_FILE" -n \ + -d "$systemdir/$NUT_PACKAGE_SOLINT" NUT \ + >> "$LOG_FILE" 2>&1 + res=$? + if [ ! $res = 0 ]; then + necho $INSTALL_ERROR + exit 1 + fi + rm -f "$ADMIN_FILE" + # Modified initscript, to run upsmon as full root, + # for optional early-shutdown support + if [ -s "$COMMON_DIR_SYS/solaris_init" ]; then + cp -f "$COMMON_DIR_SYS/solaris_init" "$instpath/nut" + res=$? + if [ ! $res = 0 ]; then + necho $INSTALL_ERROR + exit 1 + fi + fi + chown root:ipp "$instpath/nut" >> "$LOG_FILE" 2>&1 && \ + chmod 755 "$instpath/nut" >> "$LOG_FILE" 2>&1 + res=$? + if [ ! $res = 0 ]; then + necho $INSTALL_ERROR + exit 1 + fi + rm -f /etc/init.d/nut /etc/rc3.d/K100nut /etc/rc3.d/S100nut /etc/rc3.d/S99nut /etc/rc0.d/K60nut + ln -s "../../$instpath/nut" /etc/init.d/nut && \ + ln -s "../init.d/nut" /etc/rc3.d/S99nut && \ + ln -s "../init.d/nut" /etc/rc0.d/K60nut + res=$? + if [ ! $res = 0 ]; then + necho $INSTALL_ERROR + exit 1 + fi + ;; + hpux) + cd "$systemdir" + rm -f nut.depot.tar > /dev/null 2>&1 + rm -Rf nut.depot > /dev/null 2>&1 + gunzip nut.depot.tar.gz >> "../$LOG_FILE" 2>&1 + res=$? + if [ ! $res = 0 ]; then + cd .. + necho $INSTALL_ERROR + exit 1 + fi + tar xvf nut.depot.tar >> "../$LOG_FILE" 2>&1 + res=$? + if [ ! $res = 0 ]; then + cd .. + necho $INSTALL_ERROR + exit 1 + fi + cd .. + necho $REMOVE_PACKAGE | tee -a "$LOG_FILE" + remove_hpux_upsmon_esd_support + swremove NUT >> "$LOG_FILE" 2>&1 + necho $INSTALL_PACKAGE | tee -a "$LOG_FILE" + swinstall -s "`pwd`/$systemdir/nut.depot/" NUT \ + >> "$LOG_FILE" 2>&1 + res=$? + if [ ! $res = 0 ]; then + necho $INSTALL_ERROR + exit 1 + fi + add_hpux_upsmon_esd_support + ;; + aix) + necho $REMOVE_PACKAGE | tee -a "$LOG_FILE" + rm -rf "$instpath/share/man" >> "$LOG_FILE" 2>&1 + rpm -e nut >> "$LOG_FILE" 2>&1 + rpm -e nut-client >> "$LOG_FILE" 2>&1 + necho $INSTALL_PACKAGE | tee -a "$LOG_FILE" + rpm -i --nodeps `ls "$systemdir"/nut-*.aix6.1.ppc.rpm | grep -v 'nut-client'` \ + >> "$LOG_FILE" 2>&1 + res=$? + if [ ! $res = 0 ]; then + necho $INSTALL_ERROR + exit 1 + fi + rpm -i --nodeps "$systemdir/"nut-client-*.aix6.1.ppc.rpm \ + >> "$LOG_FILE" 2>&1 + res=$? + if [ ! $res = 0 ]; then + necho $INSTALL_ERROR + exit 1 + fi + # Modified initscript, to run upsmon as full root, + # for optional early-shutdown support + if [ -s "$COMMON_DIR_SYS/aix_init" ]; then + cp -f "$COMMON_DIR_SYS/aix_init" /etc/rc.d/init.d/ups + res=$? + chown root:ipp "/etc/rc.d/init.d/ups" >> "$LOG_FILE" 2>&1 + chmod 755 "/etc/rc.d/init.d/ups" >> "$LOG_FILE" 2>&1 + if [ ! $res = 0 ]; then + necho $INSTALL_ERROR + exit 1 + fi + fi + if [ ! -d "$instpath/share/man" ]; then + for N in 1 3 5 8 ; do + mkdir -p "$instpath/share/man/man$N" && \ + ( cd "$instpath/share/man/man$N" && { \ + ln -s ../../../man/man$N/*.$N . + ln -s ../../doc/nut-*/docs/man/*.$N . 2>/dev/null + } ; ) + done >> "$LOG_FILE" 2>&1 + fi + ;; + + *) + necho $INSTALL_ERROR + exit 1 + ;; + esac + + #ipp-wrapper goes first of custom files, to symlink against just + # the packaged binaries - an action which we do first of all + mkdir "$instpath/xbin" >> "$LOG_FILE" 2>&1 + chown root:ipp "$instpath/xbin" >> "$LOG_FILE" 2>&1 + chmod 755 "$instpath/xbin" >> "$LOG_FILE" 2>&1 + ( cd "$instpath/bin" && for F in * ; do + if [ -f "$F" ] && [ ! -d "$F" ] && [ -x "$F" ] ; then + ln -s "../bin/ipp-wrapper" "../xbin/$F" + fi + done ) + ( cd "$instpath/sbin" && for F in * ; do + if [ -f "$F" ] && [ ! -d "$F" ] && [ -x "$F" ] && [ ! -x "../xbin/$F" ] ; then + ln -s "../bin/ipp-wrapper" "../xbin/$F" + fi + done ) + cp "$COMMON_DIR/ipp-wrapper" "$instpath/bin" >> "$LOG_FILE" 2>&1 + chown root:ipp "$instpath/bin/ipp-wrapper" >> "$LOG_FILE" 2>&1 + chmod 755 "$instpath/bin/ipp-wrapper" >> "$LOG_FILE" 2>&1 + + #install additional libraries + cp "$systemdir/libs/"* "$instpath/lib" >> "$LOG_FILE" 2>&1 + chown root:ipp "$instpath/lib/*" >> "$LOG_FILE" 2>&1 + + #powercycle-setting scripts + cp "$COMMON_DIR/init" "$instpath" >> "$LOG_FILE" 2>&1 + chown root:ipp "$instpath/init" >> "$LOG_FILE" 2>&1 + chmod 744 "$instpath/init" >> "$LOG_FILE" 2>&1 + cp "$COMMON_DIR/shutdown" "$instpath" >> "$LOG_FILE" 2>&1 + chown root:ipp "$instpath/shutdown" >> "$LOG_FILE" 2>&1 + chmod 744 "$instpath/shutdown" >> "$LOG_FILE" 2>&1 + + #OS shutdown script + cp "$COMMON_DIR/ipp-os-shutdown" "$instpath/sbin" >> "$LOG_FILE" 2>&1 + chown root:ipp "$instpath/sbin/ipp-os-shutdown" >> "$LOG_FILE" 2>&1 + chmod 744 "$instpath/sbin/ipp-os-shutdown" >> "$LOG_FILE" 2>&1 + + # Config file with parameters for the shutdown program + cp -f "$COMMON_DIR_SYS/ipp-os-shutdown.conf.sample" "$instpath/etc" + if [ ! -s "$instpath/etc/ipp-os-shutdown.conf" ]; then + cp -f "$instpath/etc/ipp-os-shutdown.conf.sample" \ + "$instpath/etc/ipp-os-shutdown.conf" >> "$LOG_FILE" 2>&1 + fi + chown root:ipp "$instpath/etc/ipp-os-shutdown.conf" >> "$LOG_FILE" 2>&1 + chmod 640 "$instpath/etc/ipp-os-shutdown.conf" >> "$LOG_FILE" 2>&1 + + #custom shutdown procedure script + cp "$COMMON_DIR/ipp-host-shutdown.sample" "$instpath/sbin" >> "$LOG_FILE" 2>&1 + chown root:ipp "$instpath/sbin/ipp-host-shutdown.sample" >> "$LOG_FILE" 2>&1 + chmod 644 "$instpath/sbin/ipp-host-shutdown.sample" >> "$LOG_FILE" 2>&1 + + #notifier script + cp "$COMMON_DIR/ipp-notifier.sh" "$instpath/bin" >> "$LOG_FILE" 2>&1 + chown root:ipp "$instpath/bin/ipp-notifier.sh" >> "$LOG_FILE" 2>&1 + chmod 754 "$instpath/bin/ipp-notifier.sh" >> "$LOG_FILE" 2>&1 + + #sensitive config file, including passwords + cp -f "$COMMON_DIR/ipp.conf" "$instpath/etc/ipp.conf.sample" >> "$LOG_FILE" 2>&1 + if [ ! -s "$instpath/etc/ipp.conf" ]; then + cp -f "$instpath/etc/ipp.conf.sample" "$instpath/etc/ipp.conf" >> "$LOG_FILE" 2>&1 + fi + chown root:ipp "$instpath/etc/ipp.conf" >> "$LOG_FILE" 2>&1 + chmod 640 "$instpath/etc/ipp.conf" >> "$LOG_FILE" 2>&1 + + #uninstall-ipp + cp uninstall-ipp "$instpath/bin" >> "$LOG_FILE" 2>&1 + chown root:ipp "$instpath/bin/uninstall-ipp" >> "$LOG_FILE" 2>&1 + chmod 744 "$instpath/bin/uninstall-ipp" >> "$LOG_FILE" 2>&1 + cp "$COMMON_DIR/string.sh" "$instpath/share" >> "$LOG_FILE" 2>&1 + chown root:ipp "$instpath/share/string.sh" >> "$LOG_FILE" 2>&1 + chmod 644 "$instpath/share/string.sh" >> "$LOG_FILE" 2>&1 + cp "$COMMON_DIR"_$lang/install.res "$instpath/share" >> "$LOG_FILE" 2>&1 + chown root:ipp "$instpath/share/install.res" >> "$LOG_FILE" 2>&1 + chmod 644 "$instpath/share/install.res" >> "$LOG_FILE" 2>&1 + + #ipp-status + cp "$COMMON_DIR/ipp-status" "$instpath/bin" >> "$LOG_FILE" 2>&1 + chown root:ipp "$instpath/bin/ipp-status" >> "$LOG_FILE" 2>&1 + chmod 755 "$instpath/bin/ipp-status" >> "$LOG_FILE" 2>&1 + +} + +####################### +# Configuration screens + +initial_configure () { + + conf_ok="" + while [ -z "$conf_ok" ]; do + C_NUM_DEV=0 + choose_mode + if [ $? = 1 ]; then + review_conf + fi + done + + # Make sure configuration files are not world readable + chown ipp:ipp "$instpath/etc/ups.conf" >> "$LOG_FILE" 2>&1 + chmod 640 "$instpath/etc/ups.conf" >> "$LOG_FILE" 2>&1 + + chown ipp:ipp "$instpath/etc/upsd.conf" >> "$LOG_FILE" 2>&1 + chmod 640 "$instpath/etc/upsd.conf" >> "$LOG_FILE" 2>&1 + + chown ipp:ipp "$instpath/etc/nut.conf" >> "$LOG_FILE" 2>&1 + chmod 640 "$instpath/etc/nut.conf" >> "$LOG_FILE" 2>&1 + + chown ipp:ipp "$instpath/etc/upsmon.conf" >> "$LOG_FILE" 2>&1 + chmod 640 "$instpath/etc/upsmon.conf" >> "$LOG_FILE" 2>&1 + + chown ipp:ipp "$instpath/etc/upsd.users" >> "$LOG_FILE" 2>&1 + chmod 640 "$instpath/etc/upsd.users" >> "$LOG_FILE" 2>&1 + + # Report the SHUTDOWNSCRIPT_CUSTOM value or that it is missing + _VAR="`egrep '^[ \t]*SHUTDOWNSCRIPT_CUSTOM=' "$instpath/etc/ipp.conf" 2>/dev/null`" || CC_SHUTDOWNSCRIPT_CUSTOM="" + if [ -n "${_VAR}" ] ; then + _VAR="`echo "${_VAR}" | sed 's,^[ \t]*SHUTDOWNSCRIPT_CUSTOM=,,'`" + _VAR="`echo "${_VAR}" | sed -e 's,^"\(.*\)"$,\1,g' -e "s,^\'\(.*\)\'$,\1,g"`" + case "${_VAR}" in + *NUT_DIR*) _VAR1="`egrep '^[^\#]*NUT_DIR=' "$instpath/etc/ipp.conf" 2>/dev/null`" \ + && [ -n "${_VAR1}" ] && _VAR1="`eval $_VAR1 && echo "$NUT_DIR"`" && [ -n "${_VAR1}" ] \ + && _VAR2="`NUT_DIR="${_VAR1}" ; eval echo "${_VAR}"`" \ + && [ -n "${_VAR2}" ] && _VAR="${_VAR2}" ;; + esac + if [ -n "${_VAR}" ] && [ -s "${_VAR}" ] && [ -x "${_VAR}" ]; then + echo "INFO: Your ipp.conf contains SHUTDOWNSCRIPT_CUSTOM='${_VAR}' which points to an executable file" + else + echo "WARNING: Your ipp.conf contains SHUTDOWNSCRIPT_CUSTOM='${_VAR}' which points to a missing or not executable file" + fi + else + echo "WARNING: Your ipp.conf does not have a SHUTDOWNSCRIPT_CUSTOM set, you might want one" + fi + unset _VAR _VAR1 _VAR2 +} + +choose_network() { + necho $CS_SEPARATOR_1 + necho $CS_NETWORK_1 + necho $CS_SEPARATOR_1 + echo + necho $CS_NETWORK_2 + echo + necho $CS_NETWORK_3 + necho $CS_NETWORK_4 + read_def $CS_NETWORK_5 "1" + case "$answer" in + [2]) + C_MODE="netserver" + ;; + *) + C_MODE="standalone" + ;; + esac +} + +display_device () { + DISP_COUNTER=1 + + while [ "$DISP_COUNTER" -le "$C_NUM_DEV" ]; do + eval TMP=\$C_DEVICE"$DISP_COUNTER" +# DEV_TYPE="`printf "${DISP_COUNTER}- $TMP" | awk -F' ' '{print \$2}'`" + DEV_CONF="`echo "$TMP" | awk -F' ' '{print \$3}'`" + echo " " "$DISP_COUNTER". "$DEV_TYPE" "$DEV_CONF" + DISP_COUNTER="`expr $DISP_COUNTER + 1`" + done +} + +remove_ups () { + if [ "$answer" -lt 1 ]; then + necho $CS_REMOVE_UPS_2 + return + fi + if [ "$answer" -gt "$C_NUM_DEV" ]; then + necho $CS_REMOVE_UPS_2 + return + fi + + OLD_NUM_DEV="$C_NUM_DEV" + C_NUM_DEV="`expr $C_NUM_DEV - 1`" + if [ "$C_NUM_DEV" -ne 0 ]; then + eval C_DEVICE$answer=\${C_DEVICE$OLD_NUM_DEV} + eval C_OPTION$answer=\${C_OPTION$OLD_NUM_DEV} + + fi +} + +#return 0 to go back +#return 1 to continue the configuration +#retuen 2 to add another UPS +manage_ups () { + if [ "$C_NUM_DEV" = 0 ]; then + return 0 + fi + + necho $CS_SEPARATOR_1 + necho $CS_ANOTHER_UPS_1 + necho $CS_SEPARATOR_1 + echo + display_device + echo + necho $CS_ANOTHER_UPS_2 + necho $CS_ANOTHER_UPS_3 + necho $CS_ANOTHER_UPS_4 + necho $CS_ANOTHER_UPS_5 + read_def $CS_ANOTHER_UPS_6 "1" + + case "$answer" in + [2]) + return 2 + ;; + [3]) + read_def $CS_REMOVE_UPS_1 "" + remove_ups + ret="" + manage_ups + ret=$? + return $ret + ;; + [0]) + return 0 + ;; + *) + return 1 + ;; + esac +} + +choose_mode() { + necho $CS_SEPARATOR_1 + necho $CS_WELCOME_1 + necho $CS_SEPARATOR_1 + echo + necho $CS_MANAGE_1 + echo + necho $CS_MANAGE_2 + necho $CS_MANAGE_3 + read_def $CS_MANAGE_4 "1" + case "$answer" in + [2]) + necho $CS_SEPARATOR_1 + necho $CS_CLIENT_SD_DURATION_1 + necho $CS_SEPARATOR_1 + echo + necho $CS_CLIENT_SD_DURATION_2 + read TMP + + choose_esd_timer + + C_MODE="netclient" + ret=2 + while [ $ret = 2 ]; do + choose_server + manage_ups + ret=$? + done + ;; + *) + choose_shutdown_duration + choose_esd_timer + choose_network + ret=2 + while [ $ret = 2 ]; do + choose_connectivity + manage_ups + ret=$? + done + + if [ $ret = 1 ]; then + ret="" + choose_password + ret=$? + fi + + if [ $C_NUM_DEV -gt 0 ]; then + ret="" + choose_static_powercycle + ret=$? + fi + ;; + esac + + if [ $ret = 1 ]; then + if [ $C_NUM_DEV -gt 1 ]; then + ret="" + choose_minsupplies + ret=$? + fi + fi + + return $ret +} + +choose_static_powercycle() { + necho $CS_SEPARATOR_1 + necho $CS_STATIC_POWERCYCLE_1 + necho $CS_SEPARATOR_1 + + answer="x" + while [ "$answer" != "" ] && [ "$answer" != "forbid" ] && [ "$answer" != "enforce" ]; do + read_def $CS_STATIC_POWERCYCLE_2 "$C_POWERDOWNFLAG_USER" + #Check if this is a valid answer + case "$answer" in + [Ff]|[Ff][Oo][Rr][Bb][Ii][Dd]|[Nn]|[Nn][Oo]) + answer="forbid" ;; + [Ee]|[Ee][Nn][Ff][Oo][Rr][Cc][Ee]|[Yy]|[Yy][Ee][Ss]) + answer="enforce" ;; + ""|[Aa][Uu][Tt][Oo]) + answer="" ;; + *) + necho $CS_ERR_BADSTRING + answer="x" ;; + esac + done + + C_POWERDOWNFLAG_USER="$answer" + return 1 +} + +choose_esd_timer() { + necho $CS_SEPARATOR_1 + necho $CS_ESDTIMER_1 + necho $CS_SEPARATOR_1 + + answer="" + while [ "$answer" = "" ]; do + read_def $CS_ESDTIMER_2 "$C_SHUTDOWN_TIMER" + #Check if this is a valid number + if [ "$answer" = "" ]; then answer="-1"; fi + if echo "$answer" | egrep '^\-*[0-9]+$' > /dev/null 2>&1 ; then + #this is a number + if [ $answer -lt 0 ]; then + answer="-1" + fi + else + necho $CS_ERR_NO_NUM + answer="" + fi + done + + C_SHUTDOWN_TIMER="$answer" + + return 1 +} + +choose_minsupplies() { + necho $CS_SEPARATOR_1 + necho $CS_MINSUP_1 + necho $CS_SEPARATOR_1 + + answer="" + while [ "$answer" = "" ]; do + read_def $CS_MINSUP_2 $C_NUM_DEV + #Check if this is a valid number + if echo "$answer" | egrep '^[0-9]+$' > /dev/null 2>&1 ; then + #this is a number + if [ $answer -lt 1 ]; then + answer="" + fi + else + necho $CS_ERR_NO_NUM + answer="" + fi + done; + + C_MINSUPPLIES="$answer" + if [ "$answer" -gt "$C_NUM_DEV" ]; then + C_MINSUPPLIES="$C_NUM_DEV" + fi + + return 1 +} + +choose_connectivity() { + ret="0" + while [ $ret = "0" ]; do + necho $CS_SEPARATOR_1 + necho $CS_CONNECTIVITY_1 + necho $CS_SEPARATOR_1 + echo + necho $CS_CONNECTIVITY_2 + necho $CS_CONNECTIVITY_3 + necho $CS_CONNECTIVITY_4 + read_def $CS_CONNECTIVITY_5 "1" + case "$answer" in + [0]) + return 0 + ;; + [2]) +#TODO + choose_xml_manual_or_auto + ret=$? + ;; + *) + choose_ask_scan_serial + ret=$? + ;; + esac + done + return $ret +} + +choose_ask_scan_serial() { + ret="0" + while [ $ret = "0" ]; do + necho $CS_SEPARATOR_1 + necho $CS_ASK_SERIAL_1 + necho $CS_SEPARATOR_1 + echo + necho $CS_ASK_SERIAL_2 + echo + necho $CS_ASK_SERIAL_3 + necho $CS_ASK_SERIAL_4 + necho $CS_ASK_SERIAL_5 + read_def $CS_ASK_SERIAL_6 "1" + case "$answer" in + [0]) + return 0 + ;; + [2]) + choose_manual_serial + ret=$? + ;; + *) + choose_serial + ret=$? + ;; + esac + done + return $ret +} + +choose_serial() { + serial_list="`$NUTCONF --scan-serial auto 2>> "$LOG_FILE"`" + if [ x"$serial_list" = x"" ]; then + echo + read_def $CS_ERR_NO_SERIAL "" + echo + return 0 + fi + + necho $CS_SEPARATOR_1 + necho $CS_SERIAL_1 + necho $CS_SEPARATOR_1 + echo + + OLD1_IFS="$IFS" + IFS=" +" + + i="1" + for s in $serial_list; do + DEV_NAME="`echo "$s" | awk -F' ' '{print \$3}'`" + echo " $i. $DEV_NAME" + i="`expr $i + 1`" + done + + IFS="$OLD1_IFS" + + necho $CS_SERIAL_3 + read_def $CS_SERIAL_4 "1" + case "$answer" in + [0]) + return 0 + ;; + *) + OLD1_IFS="$IFS" + IFS=" +" + + C_NUM_DEV="`expr $C_NUM_DEV + 1`" + i="1" + for s in $serial_list; do + if [ "$i" = "$answer" ]; then + eval C_DEVICE$C_NUM_DEV=\"$s\" + eval C_OPTION$C_NUM_DEV=\"\" + break; + fi + i="`expr $i + 1`" + done + IFS="$OLD1_IFS" + ;; + esac + + return 1 +} + +choose_manual_serial () { + necho $CS_SEPARATOR_1 + necho $CS_MANUAL_SERIAL_1 + necho $CS_SEPARATOR_1 + echo + necho $CS_MANUAL_SERIAL_2 + read_def $CS_MANUAL_SERIAL_3 "" + + DEV="`$NUTCONF --scan-serial $answer 2>> "$LOG_FILE"`" + + if [ "$DEV" = "" ]; then + read_def $CS_MANUAL_SERIAL_ERR "" + return 0; + fi + + C_NUM_DEV="`expr $C_NUM_DEV + 1`" + eval C_DEVICE$C_NUM_DEV=$DEV + + return 1 +} + +choose_xml_manual_or_auto() { + necho $CS_SEPARATOR_1 + necho $CS_XML_MANU_AUTO_1 + necho $CS_SEPARATOR_1 + echo + necho $CS_XML_MANU_AUTO_2 + echo + necho $CS_XML_MANU_AUTO_3 + necho $CS_XML_MANU_AUTO_4 + necho $CS_XML_MANU_AUTO_5 + + read_def $CS_XML_MANU_AUTO_6 "1" + case "$answer" in + [2]) + choose_xml_manual + return $? + ;; + [0]) + return 0 + ;; + *) + choose_xml + return $? + esac +} + +choose_xml_manual() { + necho $CS_SEPARATOR_1 + necho $CS_XML_MANU_1 + necho $CS_SEPARATOR_1 + echo + read_def $CS_XML_MANU_2 "" + + if [ x"$answer" = x"" ]; then + return 0 + fi + + C_NUM_DEV="`expr $C_NUM_DEV + 1`" + eval C_DEVICE$C_NUM_DEV=\"XML netxml-ups http://$answer\" + + nmc_login + return 1 +} + +choose_xml() { + necho $CS_SEPARATOR_1 + necho $CS_SNMP_1 + necho $CS_SEPARATOR_1 + echo + necho $CS_SNMP_2 + echo + necho $CS_SNMP_6 + echo + + LIST_XML="`$NUTCONF --scan-xml-http 2>> "$LOG_FILE"`" + if [ "$LIST_XML" = "" ]; then + read_def $CS_SNMP_7 "" + choose_snmp + return $? + fi + + LIST_XML="`echo "$LIST_XML" | sort`" + + echo + + OLD1_IFS="$IFS" + IFS=" +" + + i="1" + for s in $LIST_XML; do + #FIXME: If there is a comma in the description, the description + #will be shown up to this comma only. + IP_ADDR="`echo "$s" | awk -F' ' '{print \$3}' | sed 's/http:\/\///g'`" + #DESC="`echo "$s" | awk -F\" '{print $6}' | sed -e "s/^.*\"\(.*\)\".*$/\1/"`" + echo " $i. $IP_ADDR" + i="`expr $i + 1`" + done + IFS="$OLD1_IFS" + + # Ask to scan for more UPS + printf " $i. " + necho $CS_SNMP_10 + necho $CS_SNMP_9 + + read_def $CS_SNMP_8 "1" + case "$answer" in + "$i") + choose_snmp + return $? + ;; + [0]) + return 0 + ;; + *) + OLD1_IFS="$IFS" + IFS=" +" + + C_NUM_DEV="`expr $C_NUM_DEV + 1`" + i="1" + for s in $LIST_XML; do + if [ "$i" = "$answer" ]; then + eval C_DEVICE$C_NUM_DEV=\"$s\" + nmc_login + IFS=$OLD1_IFS + return 1; + fi + i="`expr $i + 1`" + done + IFS="$OLD1_IFS" + C_NUM_DEV="`expr $C_NUM_DEV - 1`" + ;; + esac + + return 0 +} + +choose_snmp() { + necho $CS_SEPARATOR_1 + necho $CS_SNMP_1 + necho $CS_SEPARATOR_1 + echo + necho $CS_SNMP_2 + echo + read_def $CS_SNMP_3 $FIRST_IP + FIRST_IP="$answer" + if [ "$answer" = "" ]; then + return 0 + fi + read_def $CS_SNMP_4 $LAST_IP + LAST_IP="$answer" + if [ "$answer" = "" ]; then + LAST_IP="$FIRST_IP" + fi + + echo + read_def $CS_SNMP_5 $C_COMMUNITY + C_COMMUNITY="$answer" + + echo + necho $CS_SNMP_6 + echo + + list="`$NUTCONF --scan-snmp "$FIRST_IP" "$LAST_IP" community="$C_COMMUNITY" 2>> "$LOG_FILE"`" + + list="`echo "$list" | sort`" + echo + + filter_snmp_list + + if [ "$LIST_SNMP" = "" ]; then + read_def $CS_SNMP_7 "" + return 0 + fi + + OLD1_IFS="$IFS" + IFS=" +" + + i="1" + for s in $LIST_SNMP; do + #FIXME: If there is a comma in the description, the description + #will be shown up to this comma only. + IP_ADDR="`echo "$s" | awk -F' ' '{print \$3}'`" + #DESC="`echo "$s" | awk -F\" '{print $6}' | sed -e "s/^.*\"\(.*\)\".*$/\1/"`" + echo " $i. $IP_ADDR" + i="`expr $i + 1`" + done + IFS="$OLD1_IFS" + + necho $CS_SNMP_9 + + read_def $CS_SNMP_8 "1" + case "$answer" in + [0]) + return 0 + ;; + *) + OLD1_IFS="$IFS" + IFS=" +" + + C_NUM_DEV="`expr $C_NUM_DEV + 1`" + i="1" + for s in $LIST_SNMP; do + if [ "$i" = "$answer" ]; then + eval C_DEVICE$C_NUM_DEV=\"$s\" + eval C_OPTION$C_NUM_DEV=\"community=$C_COMMUNITY\" + IFS="$OLD1_IFS" + return 1 + fi + i="`expr $i + 1`" + done + IFS="$OLD1_IFS" + C_NUM_DEV="`expr $C_NUM_DEV - 1`" + ;; + esac + + return 0 +} + +#Remove XML devices from the SNMP list +filter_snmp_list() { + LIST_SNMP="" + OLD1_IFS="$IFS" + IFS=" +" + for s in $list; do + IP_SNMP="`echo "$s" | awk -F' ' '{print \$3}'`" + TO_ADD="$s" + for x in $LIST_XML; do + IP_XML="`echo "$x" | awk -F' ' '{print \$3}' | sed 's/http:\/\///g'`" + if [ "$IP_SNMP" = "$IP_XML" ]; then + TO_ADD="" + break + fi + done + if [ ! "$TO_ADD" = "" ]; then + LIST_SNMP="`echo "$LIST_SNMP";echo "$TO_ADD"`" + fi + done + IFS="$OLD1_IFS" +} + + +#only used in netclient mode +choose_server() { + necho $CS_SEPARATOR_1 + necho $CS_SERVER_1 + necho $CS_SEPARATOR_1 + echo + necho $CS_SERVER_2 + echo + read_def $CS_SERVER_3 "" + FIRST_IP="$answer" + if [ x"$answer" = x"" ]; then + return 0 + fi + read_def $CS_SERVER_4 "" + LAST_IP="$answer" + if [ x"$answer" = x"" ]; then + LAST_IP=$FIRST_IP + fi + + echo + necho $CS_SERVER_5 + echo + + list="`$NUTCONF --scan-nut "$FIRST_IP" "$LAST_IP" "$NUT_PORT" 2>> "$LOG_FILE"`" +#TODO parse scan results + if [ "$list" = "" ]; then + read_def $CS_SERVER_6 "" + return 0 + fi + + echo + + OLD1_IFS="$IFS" + IFS=" +" + + i="1" + for s in $list; do + UPS="`echo "$s" | awk -F' ' '{print \$3}'`" + echo " $i. $UPS" + i="`expr $i + 1`" + done + IFS="$OLD1_IFS" + + necho $CS_SERVER_8 + + read_def $CS_SERVER_7 "1" + case "$answer" in + [0]) + return 0 + ;; + *) + echo "$C_NUM_DEV" + C_NUM_DEV="`expr $C_NUM_DEV + 1`" + echo "$C_NUM_DEV" + i="1" + OLD1_IFS="$IFS" + IFS=" +" + for s in $list; do + if [ "$i" = "$answer" ]; then + eval C_DEVICE$C_NUM_DEV=\"$s\" + eval C_OPTION$C_NUM_DEV=\"\" + break + fi + i="`expr $i + 1`" + done + IFS="$OLD1_IFS" + ;; + esac + + return 1 +} + +choose_password() { + necho $CS_SEPARATOR_1 + necho $CS_PASSWORD_1 + necho $CS_SEPARATOR_1 + + answer="" + PASS1="1" + while [ ! "$answer" = "$PASS1" ] || [ -z "$answer" ]; do + read_def_silent $CS_PASSWORD_3 "" + PASS1="$answer" + read_def_silent $CS_PASSWORD_4 "" + if [ ! "$answer" = "$PASS1" ]; then + echo + necho $CS_ERR_PASSWORDS_DIFFER + echo + fi + done + C_PASSWORD="$answer" + + return 1 +} + +get_networked_device() { + NDEV=0 + C_NUM_NETWORK_DEVICE=0 + + while [ "$NDEV" -lt "$C_NUM_DEV" ]; do + NDEV="`expr $NDEV + 1`" + eval TMP=\$C_DEVICE"$NDEV" + DRIVER="`echo "$TMP" | awk -F' ' '{print \$2}'`" + if [ "$DRIVER" = "netxml-ups" ]; then + C_NUM_NETWORK_DEVICE="`expr $C_NUM_NETWORK_DEVICE + 1`" + fi + done +} + +nmc_login() { + necho $CS_SEPARATOR_1 + necho $CS_NMC_LOGIN_1 + necho $CS_SEPARATOR_1 + echo + read_def $CS_NMC_LOGIN_2 "admin" + NMC_LOGIN="$answer" + answer="" + PASS1="1" + while [ ! "$answer" = "$PASS1" ]; do + read_def_silent $CS_NMC_LOGIN_3 "" + PASS1="$answer" + read_def_silent $CS_NMC_LOGIN_4 "" + if [ ! "$answer" = "$PASS1" ]; then + echo + necho $CS_ERR_PASSWORDS_DIFFER + echo + fi + done + ESD_NETXML_OPTION="" + if [ "$C_SHUTDOWN_TIMER" -gt 0 ] 2>/dev/null; then + # Note the leading space is included if value is set + # Also note this is a cosmetic setting for NMC web-gui + # to display the value, discrepancies that creep in + # during later system administration are not sync'ed. + ESD_NETXML_OPTION=" shutdown_timer=`expr $C_SHUTDOWN_TIMER \* 60`" || \ + ESD_NETXML_OPTION="" + fi + if [ "$C_SHUTDOWN_TIMER" -eq 0 ] 2>/dev/null; then + # Some value >0 must be set to be picked up; for this + # choice of "1 sec" the NMC Web-GUI shows "0 min" anyway + ESD_NETXML_OPTION=" shutdown_timer=1" + fi + eval C_OPTION$C_NUM_DEV=\"login=$NMC_LOGIN password=$answer subscribe=yes$ESD_NETXML_OPTION shutdown_duration=$C_SHUTDOWN_DURATION\" +} + +choose_shutdown_duration() { + necho $CS_SEPARATOR_1 + necho $CS_SHUTOFF_DELAY_1 + necho $CS_SEPARATOR_1 + echo + answer="" + while [ "$answer" = "" ]; do + read_def $CS_SHUTOFF_DELAY_3 "$C_SHUTDOWN_DURATION" + #Check if this is a valid number + if echo "$answer" | egrep '^[0-9]+$' > /dev/null 2>&1; then + #this is a number, do nothing + sleep 0 + else + necho $CS_ERR_NO_NUM + answer="" + fi + done; + C_SHUTDOWN_DURATION="$answer" + + return 1 +} + +set_shutdown_command_legacy() { + SHUTDOWN_CMD="$instpath/shutdown;/usr/sbin/shutdown" + + case "$system" in + solari) + $NUTCONF --set-shutdowncmd "$SHUTDOWN_CMD -y -g 0 -i 5" 2>> "$LOG_FILE" + ;; + solint) + $NUTCONF --set-shutdowncmd "$SHUTDOWN_CMD -y -g 0 -i 5" 2>> "$LOG_FILE" + ;; + hpux) + $NUTCONF --set-shutdowncmd "cd /;$SHUTDOWN_CMD -y -h now" 2>> "$LOG_FILE" + ;; + aix) + $NUTCONF --set-shutdowncmd "$SHUTDOWN_CMD -h +0" 2>> "$LOG_FILE" + ;; + *) + ;; + esac +} + +set_shutdown_command() { + if [ -x "$instpath/sbin/ipp-os-shutdown" ]; then + # The new common logic is available, use it + $NUTCONF --set-shutdowncmd "$instpath/sbin/ipp-os-shutdown -t now" 2>> "$LOG_FILE" + else + # Use old OS-specific snippets + set_shutdown_command_legacy + fi + + $NUTCONF --set-powerdownflag "$instpath/etc/killpower" 2>> "$LOG_FILE" +} + +set_notify() { + # Events messages (mc2/scripts/lang/eng.lbl) + # '/Event/UPS.PowerSummary.PresentStatus.ACPresent/1' + $NUTCONF --set-notifymsg ONLINE "The system is powered by the utility" 2>> "$LOG_FILE" # "UPS %s on line power" + # '/Event/UPS.PowerSummary.PresentStatus.ACPresent/0' + $NUTCONF --set-notifymsg ONBATT "The system is powered by the UPS battery" 2>> "$LOG_FILE" #"UPS %s on battery" + # '/Event/UPS.PowerSummary.PresentStatus.BelowRemainingCapacityLimit/1' + $NUTCONF --set-notifymsg LOWBATT "Low battery alarm" 2>> "$LOG_FILE" # "UPS %s battery is low" + # ? + $NUTCONF --set-notifymsg FSD "UPS %s: forced shutdown in progress" 2>> "$LOG_FILE" + # '/Event/System.CommunicationLost/0' + $NUTCONF --set-notifymsg COMMOK "Communication with device is restored" 2>> "$LOG_FILE" # "Communications with UPS %s established" + # '/Event/System.CommunicationLost/1' + $NUTCONF --set-notifymsg COMMBAD "Communication with device has failed" 2>> "$LOG_FILE" # "Communications with UPS %s lost" + # ? + $NUTCONF --set-notifymsg SHUTDOWN "Auto logout and shutdown proceeding" 2>> "$LOG_FILE" + # '/Event/UPS.PowerSummary.PresentStatus.NeedReplacement/1' + $NUTCONF --set-notifymsg REPLBATT "Battery fault" 2>> "$LOG_FILE" # "UPS %s battery needs to be replaced" + $NUTCONF --set-notifymsg NOCOMM "UPS %s is unavailable" 2>> "$LOG_FILE" + $NUTCONF --set-notifymsg NOPARENT "Shutdown failure" 2>> "$LOG_FILE" # "upsmon parent process died - shutdown impossible" + + # Enable mail notification + $NUTCONF --set-notifycmd "$instpath/bin/ipp-notifier.sh" 2>> "$LOG_FILE" + + $NUTCONF --set-notifyflags ONLINE EXEC 2>> "$LOG_FILE" + $NUTCONF --set-notifyflags ONBATT EXEC 2>> "$LOG_FILE" + $NUTCONF --set-notifyflags LOWBATT EXEC 2>> "$LOG_FILE" + $NUTCONF --set-notifyflags FSD EXEC 2>> "$LOG_FILE" + $NUTCONF --set-notifyflags COMMOK EXEC 2>> "$LOG_FILE" + $NUTCONF --set-notifyflags COMMBAD EXEC 2>> "$LOG_FILE" + $NUTCONF --set-notifyflags SHUTDOWN EXEC 2>> "$LOG_FILE" + $NUTCONF --set-notifyflags REPLBATT EXEC 2>> "$LOG_FILE" + $NUTCONF --set-notifyflags NOCOMM EXEC 2>> "$LOG_FILE" + $NUTCONF --set-notifyflags NOPARENT EXEC 2>> "$LOG_FILE" +} + +set_ippconf_value() { + # Replaces a value in the installed ipp.conf which is an assignment + # of "$1='$2'" and which is not a comment (optional whitespace may + # be prepended in the present line, but will be removed in the end) + egrep -v '^[ \t]*('"$1"')=' "$instpath/etc/ipp.conf" \ + > "$instpath/etc/ipp.conf.tmp" && \ + echo "$1='$2'" >> "$instpath/etc/ipp.conf.tmp" && \ + cat "$instpath/etc/ipp.conf.tmp" > "$instpath/etc/ipp.conf" + res=$? + rm -f "$instpath/etc/ipp.conf.tmp" + return $res +} + +set_shutdown_duration() { + set_ippconf_value DELAY "$C_SHUTDOWN_DURATION" + set_ippconf_value PASSWORD "$C_PASSWORD" +} + +set_minsupplies() { + $NUTCONF --set-minsupplies "$C_MINSUPPLIES" 2>> "$LOG_FILE" +} + +set_debug_flag() { + # Keep an old value if it was set + egrep '^[ \t]*IPP_DEBUG=' "$instpath/etc/ipp.conf" >/dev/null || \ + echo "IPP_DEBUG='$IPP_DEBUG'" >> "$instpath/etc/ipp.conf" +} + +set_esd_timer() { + set_ippconf_value SHUTDOWN_TIMER "$C_SHUTDOWN_TIMER" +} + +set_host_os_flavour() { + set_ippconf_value HOST_OS_FLAVOUR "$system" +} + +set_static_powercycle() { + # Generally this variable should be left empty and the powercycling + # would be enabled or diabled based on killpower flag. However in some + # cases a user may want to enforce the setting (e.g. last ESD host). + set_ippconf_value POWERDOWNFLAG_USER "$C_POWERDOWNFLAG_USER" +} + +review_conf() { + display_conf + + read_def $CS_REVIEW_10 "n" + case "$answer" in + [yY]) + conf_ok="ok" + + $NUTCONF --set-mode "$C_MODE" 2>> "$LOG_FILE" + + case "$C_MODE" in + netclient) + apply_conf_client + ;; + netserver) + apply_conf_server + ;; + standalone) + apply_conf_standalone + ;; + esac + + set_minsupplies + set_shutdown_command + set_notify + set_shutdown_duration + set_esd_timer + set_static_powercycle + set_debug_flag + + ;; + + *) + ;; + esac + +} + +display_conf() { + necho $CS_SEPARATOR_1 + necho $CS_REVIEW_1 + necho $CS_SEPARATOR_1 + echo + if [ "$C_MODE" = "standalone" ]; then + necho $CS_REVIEW_2 + fi + if [ "$C_MODE" = "netserver" ]; then + necho $CS_REVIEW_3 + fi + if [ "$C_MODE" = "netclient" ]; then + necho $CS_REVIEW_4 + fi + echo + necho $CS_REVIEW_5 + display_device + echo + if [ "$C_NUM_DEV" -gt 1 ]; then + necho $CS_REVIEW_6 " " $C_MINSUPPLIES + fi + + necho $CS_REVIEW_7 " " $C_SHUTDOWN_TIMER + echo + + necho $CS_REVIEW_8 " " $C_SHUTDOWN_DURATION + echo + + necho $CS_REVIEW_9 " " $C_POWERDOWNFLAG_USER + echo + +} + +apply_conf_client() { + NDEV=1 + $NUTCONF --set-user upsmon=slave password=upsmon 2>> "$LOG_FILE" + + eval TMP=\$C_DEVICE$NDEV + DEV="`echo "$TMP" | awk -F' ' '{print \$3}'`" + UPS="`echo "$DEV" | awk -F'@' '{print \$1}'`" + HOST="`echo "$DEV"| awk -F'@' '{print \$2}'`" + # TODO: Here we assume that one UPS powers one input of the server + # Logically this can mismatch our setting of MINSUPPLIES if the user + # (later) specifies real powersource counts, and topology is not 1:1 + $NUTCONF --set-monitor "${UPS}" "$HOST" 1 upsmon upsmon slave 2>> "$LOG_FILE" + + while [ "$NDEV" -lt "$C_NUM_DEV" ]; do + NDEV="`expr $NDEV + 1`" + eval TMP=\$C_DEVICE$NDEV + DEV="`echo "$TMP" | awk -F' ' '{print \$3}'`" + UPS="`echo "$DEV" | awk -F'@' '{print \$1}'`" + HOST="`echo "$DEV"| awk -F'@' '{print \$2}'`" + $NUTCONF --add-monitor "${UPS}" "$HOST" 1 upsmon upsmon slave 2>> "$LOG_FILE" + done +} + +split_device () { + eval TMP=\$C_DEVICE$NDEV + ID="`echo "$TMP" | awk -F' ' '{print \$1}'`" + DRIVER="`echo "$TMP" | awk -F' ' '{print \$2}'`" + PORT="`echo "$TMP" | awk -F' ' '{print \$3}'`" +} + +setup_tty () { + local TTY="$1" > "$LOG_FILE" 2>&1 + + chmod 666 "$TTY" > "$LOG_FILE" 2>&1 + chown ipp:ipp "$TTY" > "$LOG_FILE" 2>&1 +} + +set_device_monitor_user () { + NDEV=1 + + split_device + + eval TMP=\$C_OPTION$NDEV + $NUTCONF --set-device "${ID}$NDEV" "$DRIVER" "$PORT" $TMP 2>> "$LOG_FILE" + $NUTCONF --set-monitor "${ID}$NDEV" localhost 1 upsmon upsmon master 2>> "$LOG_FILE" + + echo "$PORT" | grep '^/dev/tty' >/dev/null && setup_tty "$PORT" + + while [ "$NDEV" -lt "$C_NUM_DEV" ]; do + NDEV="`expr $NDEV + 1`" + split_device + eval TMP=\$C_OPTION$NDEV + $NUTCONF --add-device "${ID}$NDEV" "$DRIVER" "$PORT" $TMP 2>> "$LOG_FILE" + $NUTCONF --add-monitor "${ID}$NDEV" localhost 1 upsmon upsmon master 2>> "$LOG_FILE" + + echo "$PORT" | grep '^/dev/tty' >/dev/null && setup_tty "$PORT" + done + + $NUTCONF --set-user admin password="$C_PASSWORD" actions=SET instcmds=all 2>> "$LOG_FILE" + $NUTCONF --add-user upsmon=master password=upsmon 2>> "$LOG_FILE" +} + +apply_conf_server() { + $NUTCONF --set-listen 0.0.0.0 2>> "$LOG_FILE" + + set_device_monitor_user +} + +apply_conf_standalone () { + $NUTCONF --set-listen 127.0.0.1 2>> "$LOG_FILE" + + set_device_monitor_user +} + +start_service () { + necho $CS_START_SERVICE + stop_service + case "$system" in + solari) + /etc/init.d/nut start >> "$LOG_FILE" 2>&1 + ;; + solint) + /etc/init.d/nut start >> "$LOG_FILE" 2>&1 + ;; + hpux) + /sbin/init.d/nut-drvctl start >> "$LOG_FILE" 2>&1 + /sbin/init.d/nut-upsd start >> "$LOG_FILE" 2>&1 + /sbin/init.d/nut-upsmon start >> "$LOG_FILE" 2>&1 + ;; + aix) + /etc/rc.d/init.d/ups start >> "$LOG_FILE" 2>&1 + ;; + *) + ;; + esac +} + +stop_service () { + case $system in + solari) + /etc/init.d/nut stop >> "$LOG_FILE" 2>&1 + ;; + solint) + /etc/init.d/nut stop >> "$LOG_FILE" 2>&1 + ;; + hpux) + /sbin/init.d/nut-drvctl stop >> "$LOG_FILE" 2>&1 + /sbin/init.d/nut-upsd stop >> "$LOG_FILE" 2>&1 + /sbin/init.d/nut-upsmon stop >> "$LOG_FILE" 2>&1 + ;; + aix) + /etc/rc.d/init.d/ups stop >> "$LOG_FILE" 2>&1 + ;; + *) + ;; + esac +} + +add_hpux_upsmon_esd_support () { + if [ -f /etc/rc.config.d/nut-upsmon ]; then + cat >>/etc/rc.config.d/nut-upsmon < /tmp/nut-upsmon.tmp.$$ + + mv /tmp/nut-upsmon.tmp.$$ /etc/rc.config.d/nut-upsmon + fi +} + +add_profile_settings () { + if [ -f /etc/profile ]; then + cat >>/etc/profile < /tmp/profile.tmp.$$ + + mv /tmp/profile.tmp.$$ /etc/profile + fi +} + +main () { +# Setup some globals +instpath=/usr/local/ups +#skip_install=true +#skip_license=true +#skip_service=true +#skip_config=true +ret=TRUE + +# Must check parameters + lang="" + SYSTEM="" + + if [ "$1" != "" ] ; then + get_parameters $1 + fi + + if [ "$2" != "" ] ; then + get_parameters $2 + fi + + if [ "$3" != "" ] ; then + get_parameters $3 + fi + +# Get language locale + if [ "$lang" = "" ]; then + check_locale_language + if [ -z "$lang" ]; then + lang=EN + fi + fi + +# Initialize resource strings. + installres="$COMMON_DIR"_$lang/install.res + licenseres="$COMMON_DIR"_$lang/license.txt + initDefines + + compute_SYSTEM + + systemdir="$system" + NUTCONF="$systemdir/nutconf" + + who="`whoami 2>/dev/null`" + if [ "$who" != 'root' ]; then +#work around in case no whoami is present + who="`id -u 2>/dev/null`" + if [ "$who" != '0' ]; then + who="`id 2>/dev/null | grep -w '0' | grep -w root`" + if [ -z "$who" ]; then + necho $ERR_ROOT + exit 1 + fi + fi + fi + +# Say hello +# we'll install vanilla IPP unix. + clear + echo + echo + echo "-----------------------------------------------------------------" + echo + + echo " EATON" + echo +# echo "Welcome to IPP Unix!" + necho $WELCOME_STR1 + +# echo " `pwd`/$0 Version 5.0.0" + lineStr="`head "-$STR_VERSION" $installres |tail -1`" + #echo " `pwd`/$0 $lineStr $lineStr1" + echo " $lineStr $IPP_VERSION" + + echo +# echo " To install IPP - Unix, select (y)" +# echo "and fill in the configuration items as they are presented to you." + necho $WELCOME_STR2 + necho $WELCOME_STR3 + echo +# echo "The default install path name for this software is: $instpath" + lineStr="`head -$DEFAULT_PATH_STR $installres |tail -1`" + echo " $lineStr" + echo " $instpath" + echo + echo "-----------------------------------------------------------------" + echo +# echo "NOTE: If you already have LanSafe for Unix installed and you" +# echo " do not wish to re-install it, select (N)o to stop" +# echo " LanSafe for Unix installation." + + necho $INSTALL_INTRO_STR1 + necho $INSTALL_INTRO_STR2 + necho $INSTALL_INTRO_STR3 + echo + echo + +# read_def " Continue IPP - Unix installation? (y/n) [y] " "y" + read_def $INSTALL_INTRO_STR4 "y" + case "$answer" in + [yY]|[yY][eE][sS]) + ;; + *) + exit 0 + ;; + esac + + if [ x"$system" = x"Unknown System" ] + then + echo +# echo " Unable to determine your system." + lineStr="`head -$ERR_UNKNOWN_SYS_STR1 $installres |tail -1`" + echo " $lineStr" + exit 0 + fi # end-of "if system = Unknown system" + + echo + echo + +# License Agreement + if [ -z "$skip_license" ]; then + echo " " + more $licenseres + echo " " + necho $LICENSE_AGREEMENT_1 + echo + necho $LICENSE_AGREEMENT_2 + necho $LICENSE_AGREEMENT_3 + necho $LICENSE_AGREEMENT_4 + echo + + read_def $LICENSE_AGREEMENT_5 "n" + + case "$answer" in + [yY]|[yY][eE][sS]) + ;; + *) + necho $ERR_LIC_AGREE + exit 1 + ;; + esac + fi + + stop_service + + # Install files + if [ -z "$skip_install" ]; then + install_files + set_host_os_flavour + fi + + echo + echo + + # Build initial configuration + if [ -z "$skip_config" ]; then + PATH="$PATH:/usr/local/ups/xbin:/usr/local/ups/bin" + export PATH +# LD_LIBRARY_PATH="$instpath/lib:/usr/local/lib:$LD_LIBRARY_PATH" +# export LD_LIBRARY_PATH + initial_configure + fi + + # Add IPP - Unix specific env. settings + add_profile_settings + + # Start service + if [ -z "$skip_service" ]; then + start_service + fi + +# Say goodbye + if [ "$conf_ok" = "ok" ]; then + echo "---------------------------------------------------------------" +# echo " IPP - Unix was successfully installed on your system. " + lineStr="`head -$SUCCESS_INSTALL $installres |tail -1`" + echo " $lineStr" + echo "---------------------------------------------------------------" + else + echo "-----------------------------------------------------------------------------" +# echo " WARNING: IPP - Unix was NOT successfully installed on your system. " + lineStr="`head -$UNSUCCESS_INSTALL $installres |tail -1`" + echo " $lineStr" + echo "-----------------------------------------------------------------------------" + echo +# necho $INSTALL_ERROR + exit 1 + fi +} + +main $1 $2 $3 + diff --git a/scripts/installer/make_package.sh b/scripts/installer/make_package.sh new file mode 100755 index 0000000000..acccf35314 --- /dev/null +++ b/scripts/installer/make_package.sh @@ -0,0 +1,52 @@ +#!/bin/bash + +# make_package.sh +# Copyright (c) 2013-2015, by Eaton (R) Corporation. All rights reserved. +# Unlike what the name implies, this script prepares tarballs for each +# supported platform, including a separately prepared platform package +# with compiled NUT and adds third-party libs and Eaton IPP - Unix +# scripts for better taste ;) + +. ./version.sh || exit $? + +rm -Rf package +mkdir package + +git pull --all +# [ $? = 0 ] && git merge upstream/master || exit $? + +NAME="ipp-solaris-$IPP_VERSION.sparc" +mkdir "package/$NAME" +FILE_LIST="`find . -type f -name '*' | egrep -v '.svn|.git|./nutconf-dummy|./make_package.sh|nut/|(un|)install.log|package/|aix|hpux|solint'`" +cp --parents -r $FILE_LIST "package/$NAME" +cd package +tar cpvf "$NAME.tar" "$NAME" +gzip -9 "$NAME.tar" +cd .. + +NAME="ipp-solaris-$IPP_VERSION.x86" +mkdir "package/$NAME" +FILE_LIST="`find . -type f -name '*' | egrep -v '.svn|.git|./nutconf-dummy|./make_package.sh|nut/|(un|)install.log|package/|aix|hpux|solari/'`" +cp --parents -r $FILE_LIST "package/$NAME" +cd package +tar cpvf "$NAME.tar" "$NAME" +gzip -9 "$NAME.tar" +cd .. + +NAME="ipp-hpux-$IPP_VERSION.parisc" +mkdir "package/$NAME" +FILE_LIST="`find . -type f -name '*' | egrep -v '.svn|.git|./nutconf-dummy|./make_package.sh|nut/|(un|)install.log|package/|aix|solint|solari/|solcmn/'`" +cp --parents -r $FILE_LIST "package/$NAME" +cd package +tar cpvf "$NAME.tar" "$NAME" +gzip -9 "$NAME.tar" +cd .. + +NAME="ipp-aix-$IPP_VERSION.powerpc" +mkdir "package/$NAME" +FILE_LIST="`find . -type f -name '*' | egrep -v '.svn|.git|./nutconf-dummy|./make_package.sh|nut/|(un|)install.log|package/|hpux|solint|solari/|solcmn/'`" +cp --parents -r $FILE_LIST "package/$NAME" +cd package +tar cpvf "$NAME.tar" "$NAME" +gzip -9 "$NAME.tar" +cd .. diff --git a/scripts/installer/nut b/scripts/installer/nut new file mode 120000 index 0000000000..c25bddb6dd --- /dev/null +++ b/scripts/installer/nut @@ -0,0 +1 @@ +../.. \ No newline at end of file diff --git a/scripts/installer/nutconf-dummy b/scripts/installer/nutconf-dummy new file mode 100755 index 0000000000..23304714fa --- /dev/null +++ b/scripts/installer/nutconf-dummy @@ -0,0 +1,101 @@ +#!/bin/sh +# Script to fake nutconf, for integration purpose + +# FIXME: to be completed! + +# there must be at least 1 option! +if [ $# -lt 1 ] ; then + echo "Error: no options provided!"; + exit 1; +fi + +case $1 in + --system) + ;; + --mode) + #standalone,netserver,netclient,controlled,manual,none + ;; + --is-configured) + # return "yes" / "no" + retval 0 / 1 if nut is configured or not + ;; + # --scan-?options?) + # FIXME: call nutscan?? + --scan-snmp) + echo "SNMP:driver=\"snmp-ups\",port=\"166.99.224.106\",desc=\"Evolution\",mibs=\"mge\",community=\"public\"" + echo "SNMP:driver=\"snmp-ups\",port=\"166.99.224.155\",desc=\"Eaton ePDU AM 1P IN:IEC309 32A OUT:20xC13, 4xC19\",mibs=\"eaton_epdu\",community=\"public\"" + echo "SNMP:driver=\"snmp-ups\",port=\"166.99.224.111\",desc=\"Eaton 5P\",mibs=\"mge\",community=\"public\"" + echo "SNMP:driver=\"snmp-ups\",port=\"166.99.224.149\",desc=\"PW104MA0UC34\",mibs=\"aphel_revelation\",community=\"public\"" + ;; + --restart) + # FIXME: restart NUT services after configuration + ;; + --reload) + # FIXME: reload NUT services after configuration + ;; + --get-devices) + #get the list of devices name + ;; + --get-device) + # FIXME: + ;; + --set-device) + # FIXME: [=] [[=]] + ;; + --new-device) + # FIXME: [] + ;; + --del-devices) + # FIXME: + ;; + --del-device) + # FIXME: []: either remove a field or the entire device entry + ;; + --get-users) + # FIXME: + ;; + --get-user) + # FIXME: + ;; + --set-user) + # FIXME: [=] + ;; + --new-user) + # FIXME: ... needs completion with upsmon master slave/instcmd/set + ;; + --del-user) + # FIXME: + ;; + # --?generic-{s,g}etter? + # FIXME: set or get a global or local param (need discussion) + # upsd.conf/maxage, statepath, listen, maxconn, certfile + # ups.conf/chroot, driverpath, maxstartdelay, pollinterval, user + # ups.conf/drivers specific (see scripts/augeas/) + # --?security-option?: I let M speak about the best way to configure NSS / OpenSSL + + --get-monitors) + # FIXME:get the list of monitored systems (names only, but may also use a verbose flag to display details) + ;; + --get-monitor) + # FIXME:: details... + ;; + --set-monitor) + # FIXME:TBD + ;; + --new-monitor) + # FIXME:TBD + ;; + --get-notifycmds) + # FIXME: + ;; + --get-notifycmd) + # FIXME: + ;; + *) + echo "nutconf Unknown option ($1)"; + #exit 1; +esac + + + + + diff --git a/scripts/installer/solcmn/ipp-os-shutdown.conf.sample b/scripts/installer/solcmn/ipp-os-shutdown.conf.sample new file mode 100644 index 0000000000..75944b8977 --- /dev/null +++ b/scripts/installer/solcmn/ipp-os-shutdown.conf.sample @@ -0,0 +1,33 @@ +# +# ipp-os-shutdown.conf +# +# Settings that specify typical shutdown commands for various supported OSes +# Version for Solaris (x86, SPARC) +# + +# The program which executes an OS shutdown, maybe including flags that +# disable its interactive mode +CMD_SHUTDOWN="/usr/sbin/shutdown -y" + +# Depending on OS and hardware support, "poweroff" option may tell the +# host's power source units to cut off their power to the motherboard, +# and "halt" may sit forever at the "OS is stopped" prompt or equivalent. +SDFLAG_POWEROFF="-i 5" +SDFLAG_REBOOT="-i 6" +SDFLAG_HALT="-i 0" + +# The flag for quick stop (shorter service stop timeouts and fewer/no +# logs, or outright go to kill remaining processes) +# NOTE: In Solaris, there are very ungraceful options for `poweroff`, +# `halt` and `reboot` programs - but they are not exposed in `shutdown`. +SDFLAG_UNGRACEFUL="-g 0" + +# Trigger a shutdown without delay +SDFLAG_INSTANT="-g 0" + +## Filename to store the PID of a pending shutdown +## If this file is absent, the shutdown can not be canceled (killed) +## If the "${SHUTDOWN_PIDFILE}.irreversible" exists and points to running PID +## then the new shutdown can not be queued (caller must cancel old one first) +SHUTDOWN_PIDFILE="/var/state/ups/shutdown.pid" + diff --git a/scripts/installer/solcmn/solaris_init b/scripts/installer/solcmn/solaris_init new file mode 100755 index 0000000000..83dc573699 --- /dev/null +++ b/scripts/installer/solcmn/solaris_init @@ -0,0 +1,99 @@ +#!/sbin/sh + +# ups: Starts and stops the Network UPS Tools 2.6.5 built for IPP - Unix 1.40-4 on Solaris +# Customizations copyright (c) 2015-2017, by Eaton (R) Corporation. All rights reserved. + +NUT_DIR="/usr/local/ups" +NUT_RUN_DIR="/var/state/ups" +NUT_LOCK_FILE="/var/locks/ups" +NUT_CFG_DIR="" +for D in "$NUT_DIR/etc" "/etc/nut" "/etc/ups" ; do + if [ -d "$D" ] && [ -f "$D/ups.conf" ] && [ -f "$D/ipp.conf" ] ; then + NUT_CFG_DIR="$D" + break + fi +done +unset D +CONFIG_IPP="$NUT_CFG_DIR/ipp.conf" + +# Note: $NUT_DIR/xbin holds the wrappers to run NUT binaries with co-bundled +# third party libs and hopefully without conflicts induced for the OS binaries +PATH="$NUT_DIR/xbin:$NUT_DIR/sbin:$NUT_DIR/bin:$PATH" +export PATH + +# Do not normally mangle the LD_LIBRARY_PATH - it can impact system tools too +#LD_LIBRARY_PATH="$NUT_DIR/lib:/usr/lib:/lib:$LD_LIBRARY_PATH" +#export LD_LIBRARY_PATH + +SHUTDOWN_TIMER=-1 +if [ -f "$CONFIG_IPP" ]; then + . "$CONFIG_IPP" +fi + +ups_stop () { + echo "in ups stop function" + pkill -n upsmon + pkill -n upsd + upsdrvctl stop > /dev/null 2>&1 + towait=5 + while \ + pgrep netxml-ups > /dev/null || \ + pgrep snmp-ups > /dev/null || \ + pgrep upsd > /dev/null || \ + pgrep upsmon > /dev/null \ + ; do + sleep 1 + towait="`expr $towait - 1`" + if [ "$towait" -le 0 ] ; then + echo "warning: some daemons did not die" + break + fi + done + # If the user changed ups.conf definitions and then asks for + # a NUT restart, the old instance of a driver might not die + # with obsolete knowledge of upsdrvctl + LIST="`ls -1 ${NUT_RUN_DIR}/*.pid | grep -v /shutdown.pid 2>/dev/null`" + if [ -n "$LIST" ]; then + echo "in ups stop function: killing some left-over daemons:" + echo "$LIST" + kill -15 `cat $LIST` > /dev/null 2>&1 + sleep 5 + fi +} + +ups_start () { + echo "in ups start function" + upsdrvctl start #> /dev/null 2>&1 + upsd #> /dev/null 2>&1 + if [ "$SHUTDOWN_TIMER" -gt -1 ]; then + # This host wants early shutdown support, must be root + upsmon -p #> /dev/null 2>&1 + else + upsmon #> /dev/null 2>&1 + fi + "$NUT_DIR"/init #> /dev/null 2>&1 +} + +case $1 in +'start') + ups_start + ;; + +'stop') + ups_stop + ;; + +'restart') + ups_stop + ups_start + ;; + +*) + echo "" + echo "Usage: '$0' {start | stop | restart }" + echo "" + exit 64 + ;; + +esac +exit $? diff --git a/scripts/installer/uninstall-ipp b/scripts/installer/uninstall-ipp new file mode 100755 index 0000000000..3e6f1d4fc9 --- /dev/null +++ b/scripts/installer/uninstall-ipp @@ -0,0 +1,363 @@ +#!/bin/sh +# uninstall.sh +# Copyright (c) 2013-2016, by Eaton (R) Corporation. All rights reserved. +# A shell script which uninstalls IPP - Unix +# It stops daemons and removes the native package +# +PATH="$PATH:/bin:/usr/bin:/sbin:/usr/sbin:/usr/ucb:/usr/ccs/bin:/usr/xpg4/bin:/usr/xpg6/bin" +export PATH + + +NUT_PACKAGE_SOLARI="NUT_solaris_sparc_package2.6.5.local" +NUT_PACKAGE_SOLINT="NUT_solaris_i386_package2.6.5.local" + +cd "`dirname "$0"`" + +#configuration data +C_MODE="standalone" +C_HOSTNAME="localhost" +C_CONNECTIVITY="serial" +C_DEVICE="" +C_PASSWORD="" + +# /dev/tty user & group used on the supported systems +case "`uname -s`" in + "SunOS") + TTY_OWNER="root:root" + ;; + "AIX") + TTY_OWNER="root:system" + ;; + "HP-UX") + TTY_OWNER="bin:bin" + ;; + *) + # Safe fallback for unsupported systems + TTY_OWNER="root:root" + ;; +esac + +DO_UNINSTALL="" + +ADMIN_FILE="/tmp/ipp_admin_file" + +UNINSTALL_TMP="/tmp" +LOG_FILE="$UNINSTALL_TMP/uninstall.log" + +get_parameters() { + case "$1" in + English) + lang=EN + ;; +# Japanese) +# lang=JP +# ;; + SOLARI) + SYSTEM="$1" + ;; + SOLINT) + SYSTEM="$1" + ;; + HPUX) + SYSTEM="$1" + ;; + AIX) + SYSTEM="$1" + ;; + DO_UNINSTALL) + DO_UNINSTALL="OK" + ;; + esac +} + +check_locale_language() { + set `locale` >/dev/null 2>&1 + case "$1" in + LANG=en_US) + lang=EN + ;; + LANG=C) + lang=EN + ;; + esac +} + +compute_SYSTEM () { + set `uname -a` + case "$1" in + SunOS) + case "$3" in + 5.*) + case "$5" in + i86pc) + SYSTEM=SOLINT + ;; + *) + SYSTEM=SOLARI + ;; + esac + ;; + *) + SYSTEM="Unknown System" + ;; + esac + ;; + HP-UX) + SYSTEM=HPUX + ;; + AIX) + case "$4" in + 6) + SYSTEM=AIX + ;; + 7) + SYSTEM=AIX + ;; + *) + SYSTEM="This AIX version is not supported" + ;; + esac + ;; + *) + SYSTEM="Unknown System" + ;; + esac + + compute_system +} + +compute_system () { + case "$SYSTEM" in + SOLINT) + system=solint + ;; + SOLARI) + system=solari + ;; + HPUX) + system=hpux + ;; + AIX) + system=aix + ;; + *) + echo + echo "Please specify your system like './install.sh '" + echo "Valid systems are SOLINT SOLARI HPUX AIX" + echo + exit 1 + ;; + esac +} + +create_admin_file () { + echo basedir=default > "$ADMIN_FILE" + echo runlevel=quit >> "$ADMIN_FILE" + echo conflict=nocheck >> "$ADMIN_FILE" + echo setuid=nocheck >> "$ADMIN_FILE" + echo action=nocheck >> "$ADMIN_FILE" + echo partial=nocheck >> "$ADMIN_FILE" + echo instance=unique >> "$ADMIN_FILE" + echo idepend=quit >> "$ADMIN_FILE" + echo rdepend=quit >> "$ADMIN_FILE" + echo space=quit >> "$ADMIN_FILE" +} + +restore_ttys () { + for tty in `find /dev/tty* -user ipp`; do + chown "$TTY_OWNER" "$tty" + chmod 622 "$tty" + done +} + +killall_ps () { + kill -9 `ps -e | awk "/ $1\$/ { print \$1; }"` +} + +killall_nut () { + killall_ps upsd >/dev/null 2>/dev/null + killall_ps upsmon >/dev/null 2>/dev/null + killall_ps bcmxcp >/dev/null 2>/dev/null + killall_ps mge-shut >/dev/null 2>/dev/null + killall_ps snmp-ups >/dev/null 2>/dev/null +} + +uninstall_files () { + rm -f "$LOG_FILE" > /dev/null 2>&1 + touch "$LOG_FILE" + + echo + echo "`date`: Uninstalling IPP - Unix" | tee -a "$LOG_FILE" + echo + + case "$system" in + solari) + /etc/init.d/nut stop >> "$LOG_FILE" 2>&1 + + sleep 5 + killall_nut + + create_admin_file + restore_ttys + + pkgrm -n -a "$ADMIN_FILE" NUT >> "$LOG_FILE" 2>&1 + rm -f "$ADMIN_FILE" + #uninstall additional libraries + ;; + solint) + /etc/init.d/nut stop >> "$LOG_FILE" 2>&1 + + sleep 5 + killall_nut + + create_admin_file + restore_ttys + + pkgrm -n -a "$ADMIN_FILE" NUT >> "$LOG_FILE" 2>&1 + rm -f "$ADMIN_FILE" + #uninstall additional libraries + + ;; + hpux) + /sbin/init.d/nut-drvctl stop >> "$LOG_FILE" 2>&1 + /sbin/init.d/nut-upsd stop >> "$LOG_FILE" 2>&1 + /sbin/init.d/nut-upsmon stop >> "$LOG_FILE" 2>&1 + + sleep 5 + killall_nut + + restore_ttys + + swremove NUT >> "$LOG_FILE" 2>&1 + #uninstall additional libraries + ;; + aix) + /etc/rc.d/init.d/ups stop >> "$LOG_FILE" 2>&1 + + sleep 5 + killall_nut + + restore_ttys + + rm -rf "$instpath/share/man" >> "$LOG_FILE" 2>&1 + + rpm -e nut >> "$LOG_FILE" 2>&1 + rpm -e nut-client >> "$LOG_FILE" 2>&1 + #uninstall additional libraries + ;; + + *) + echo "Installation error, please see $LOG_FILE." + exit 1 + ;; + esac + + rm -f "$instpath/bin/uninstall"* >> "$LOG_FILE" 2>&1 + + rm -f "$instpath/init" >> "$LOG_FILE" 2>&1 + rm -f "$instpath/shutdown" >> "$LOG_FILE" 2>&1 + rm -f "$instpath/sbin/ipp-os-shutdown" >> "$LOG_FILE" 2>&1 + rm -f "$instpath/sbin/ipp-host-shutdown.sample" >> "$LOG_FILE" 2>&1 + + rm -f "$instpath/bin/ipp-notifier.sh" >> "$LOG_FILE" 2>&1 + rm -f "$instpath/bin/ipp-status" >> "$LOG_FILE" 2>&1 + + rm -f "$instpath/share/string.sh" >> "$LOG_FILE" 2>&1 + rm -f "$instpath/share/install.res" >> "$LOG_FILE" 2>&1 + + rm -f "$instpath/etc/ipp.conf.sample" >> "$LOG_FILE" 2>&1 + + rm -Rf "$instpath/lib" >> "$LOG_FILE" 2>&1 + + rm -Rf "$instpath/xbin" >> "$LOG_FILE" 2>&1 + rm -f "$instpath/bin/ipp-wrapper" >> "$LOG_FILE" 2>&1 +} + +remove_profile_settings () { + if /usr/bin/test -e /etc/profile; then + awk ' + BEGIN { + echo = 1; + } + + /^##### IPP - Unix settings begin #####$/ { + echo = 0; + } + + /^##### IPP - Unix settings end #####$/ { + echo = 1; + next; + } + + { + if (echo) print $0; + } + ' /etc/profile > /tmp/profile.tmp.$$ + + mv /tmp/profile.tmp.$$ /etc/profile + fi +} + +main () { +# Setup some globals + instpath=/usr/local/ups + ret=TRUE + +# Must check parameters + SYSTEM="" + lang="" + + if [ "$1" != "" ] ; then + get_parameters $1 + fi + + if [ "$2" != "" ] ; then + get_parameters $2 + fi + + if [ "$3" != "" ] ; then + get_parameters $3 + fi + + if [ ! "$DO_UNINSTALL" = "OK" ];then + cp -f "$instpath/bin/uninstall-ipp" "$UNINSTALL_TMP" + chmod 744 "$UNINSTALL_TMP/uninstall-ipp" + exec "$UNINSTALL_TMP/uninstall-ipp" DO_UNINSTALL $1 $2 $3 + exit + fi + + compute_SYSTEM + +# Get language locale + if [ "$lang" = "" ]; then + check_locale_language + if [ -z "$lang" ]; then + lang=EN + fi + fi + + who="`whoami 2>/dev/null`" + if [ "$who" != 'root' ]; then + #work around in case no whoami is present + who="`id -u 2>/dev/null`" + if [ "$who" != '0' ]; then + who="`id 2>/dev/null | grep -w '0' | grep -w root`" + if [ -z "$who" ]; then + echo "You must be root to uninstall IPP - Unix." + exit 1 + fi + fi + fi + + uninstall_files + remove_profile_settings + +# Say goodbye + echo "---------------------------------------------------------------" + echo " IPP - Unix was successfully uninstalled from your system." + echo "---------------------------------------------------------------" + +} + +main $1 $2 $3 + diff --git a/scripts/installer/uninstall-lsnw.sh b/scripts/installer/uninstall-lsnw.sh new file mode 100755 index 0000000000..22f190f3e6 --- /dev/null +++ b/scripts/installer/uninstall-lsnw.sh @@ -0,0 +1,146 @@ +#!/bin/sh +# Script to detect and uninstall Lansafe / Netwatch + +# AQU notes: +# - default install path: /usr/Powerware/LanSafe (for all systems) +# - may be expanded to PSP + +OS_NAME="`uname -s`" + +detect_psp() +{ + case $OS_NAME in + HP-UX) + PSP_INITSCRIPT_FN="/sbin/init.d/ls.init" + ;; + AIX) + PSP_INITSCRIPT_FN="`grep psp /etc/inittab 2>/dev/null | cut -d':' -f4 | cut -d' ' -f1`" + ;; + SunOS) + PSP_INITSCRIPT_FN="/etc/init.d/ls.init" + ;; + *) + #echo "$OS_NAME is not managed!" + return 1 + ;; + esac +} + +detect_lansafe() +{ + case $OS_NAME in + HP-UX) + LS_INITSCRIPT_FN="/sbin/init.d/ls.init" + ;; + AIX) + LS_INITSCRIPT_FN="`grep LanSafe /etc/inittab 2>/dev/null | cut -d':' -f4 | sed 's/&//'`" + ;; + SunOS) + LS_INITSCRIPT_FN="/etc/init.d/ls.init" + ;; + *) + #echo "$OS_NAME is not managed!" + return 1 + ;; + esac + + if [ -n "$LS_INITSCRIPT_FN" -a -f "$LS_INITSCRIPT_FN" ] ; then + + LS_INSTPATH="`grep instpath $LS_INITSCRIPT_FN | head -n1 | cut -d'=' -f2`" + if [ -z "$LS_INSTPATH" ] ; then + return 1 + #else + #echo "LanSafe installation detected." + fi + else + return 1 + fi + + # Lansafe is installed + return 0 +} + +uninstall_lansafe() +{ + #echo "LanSafe installation detected. Proceeding to uninstallation." + #echo "Calling $LS_INSTPATH/uninstall.sh" + + # Actual Lansafe uninstallation + echo "y" | $LS_INSTPATH/uninstall.sh 2>&1 1> install.log +} + + +detect_netwatch() +{ + case $OS_NAME in + HP-UX) + NW_INITSCRIPT_FN="/sbin/init.d/netwatch.init" + ;; + AIX) + NW_INITSCRIPT_FN="`grep netwatch /etc/inittab 2>/dev/null | cut -d':' -f4 | cut -d' ' -f1`" + ;; + SunOS) + NW_INITSCRIPT_FN="/etc/init.d/netwatch.init" + ;; + *) + #echo "$OS_NAME is not managed!" + return 1 + ;; + esac + + if [ -n "$NW_INITSCRIPT_FN" -a -f "$NW_INITSCRIPT_FN" ] ; then + + NW_INSTPATH="`grep INSTALL_PATH $NW_INITSCRIPT_FN | head -n1 | cut -d'=' -f2 | sed 's/\"//g'`" + if [ -z "$NW_INSTPATH" ] ; then + return 1 + #else + #echo "Netwatch installation detected." + fi + else + return 1 + fi + + # Netwatch is installed + return 0 +} + +uninstall_netwatch() +{ + #echo "Netwatch installation detected. Proceeding to uninstallation." + #echo "Calling $NW_INSTPATH/uninstall.sh" + + # Actual Netwatch uninstallation + $NW_INSTPATH/uninstall.sh silent 2>&1 1> install.log + + # Workaround for buggy uninstall of Netwatch + case $OS_NAME in + HP-UX) + rm -f /sbin/*.d/*netwatch* + ;; + AIX) + cat /etc/inittab | grep -v netwatch > /etc/inittab.upp + mv /etc/inittab.upp /etc/inittab + ;; + SunOS) + rm -f /etc/*.d/*netwatch* + ;; + esac +} + +# Main entry point +# Check if Lansafe is installed +detect_lansafe +if [ $? -eq 0 ]; then + # Proceed to uninstallation + uninstall_lansafe +fi + +# Check if Netwatch is installed +detect_netwatch +if [ $? -eq 0 ]; then + # Proceed to uninstallation + uninstall_netwatch +fi + +#exit $RETVAL + diff --git a/scripts/installer/version.sh b/scripts/installer/version.sh new file mode 100644 index 0000000000..ad5b4af248 --- /dev/null +++ b/scripts/installer/version.sh @@ -0,0 +1 @@ +IPP_VERSION="1.40-5" diff --git a/scripts/python/Makefile.am b/scripts/python/Makefile.am index 68a31489dd..56eeaa97f4 100644 --- a/scripts/python/Makefile.am +++ b/scripts/python/Makefile.am @@ -1,5 +1,7 @@ # Network UPS Tools: scripts/python +SUBDIRS = module + # Recognize settings from configure.ac (for make install handling) nut_with_nut_monitor = @nut_with_nut_monitor@ nut_with_nut_monitor_dir = @nut_with_nut_monitor_dir@ @@ -48,13 +50,13 @@ NUT_MONITOR_PY3QT5_GENERATED_SCRIPT = \ app/NUT-Monitor-py3qt5 NUT_MONITOR_COMMON = \ - README \ + README.adoc \ app/nut-monitor.appdata.xml \ app/icons/48x48/nut-monitor.png \ app/icons/64x64/nut-monitor.png \ app/icons/256x256/nut-monitor.png \ app/icons/scalable/nut-monitor.svg \ - app/README \ + app/README.adoc \ app/screenshots/nut-monitor-1.png \ app/screenshots/nut-monitor-2.png \ app/screenshots/nut-monitor-3.png \ @@ -68,7 +70,7 @@ NUT_MONITOR_COMMON = \ app/locale/ru/LC_MESSAGES/NUT-Monitor.mo PYNUT_COMMON = \ - module/README + module/README.adoc # Note: we both distribute and install the generated *.mo translation files # so they are listed above and not in NUT_MONITOR_COMMON_TEMPLATE @@ -79,6 +81,7 @@ NUT_MONITOR_COMMON_TEMPLATE = \ app/locale/ru/ru.po PYNUT_TEMPLATE = \ + module/setup.py.in \ module/PyNUT.py.in \ module/test_nutclient.py.in @@ -188,8 +191,37 @@ endif ################################################################# +SPELLCHECK_SRC = \ + README.adoc \ + app/README.adoc \ + module/README.adoc + +# NOTE: Due to portability, we do not use a GNU percent-wildcard extension. +# We also have to export some variables that may be tainted by relative +# paths when parsing the other makefile (e.g. MKDIR_P that may be defined +# via expanded $(top_builddir)/install_sh): +#%-spellchecked: % Makefile.am $(top_srcdir)/docs/Makefile.am $(abs_srcdir)/$(NUT_SPELL_DICT) +# +$(MAKE) -s -f $(top_builddir)/docs/Makefile $(AM_MAKEFLAGS) MKDIR_P="$(MKDIR_P)" builddir="$(builddir)" srcdir="$(srcdir)" top_builddir="$(top_builddir)" top_srcdir="$(top_srcdir)" SPELLCHECK_SRC_ONE="$<" SPELLCHECK_SRCDIR="$(srcdir)" SPELLCHECK_BUILDDIR="$(builddir)" $@ + +# NOTE: Portable suffix rules do not allow prerequisites, so we shim them here +# by a wildcard target in case the make implementation can put the two together. +*-spellchecked: Makefile.am $(top_srcdir)/docs/Makefile.am $(abs_srcdir)/$(NUT_SPELL_DICT) + +.sample.sample-spellchecked: + +$(MAKE) -s -f $(top_builddir)/docs/Makefile $(AM_MAKEFLAGS) MKDIR_P="$(MKDIR_P)" builddir="$(builddir)" srcdir="$(srcdir)" top_builddir="$(top_builddir)" top_srcdir="$(top_srcdir)" SPELLCHECK_SRC_ONE="$<" SPELLCHECK_SRCDIR="$(srcdir)" SPELLCHECK_BUILDDIR="$(builddir)" $@ + +.in.in-spellchecked: + +$(MAKE) -s -f $(top_builddir)/docs/Makefile $(AM_MAKEFLAGS) MKDIR_P="$(MKDIR_P)" builddir="$(builddir)" srcdir="$(srcdir)" top_builddir="$(top_builddir)" top_srcdir="$(top_srcdir)" SPELLCHECK_SRC_ONE="$<" SPELLCHECK_SRCDIR="$(srcdir)" SPELLCHECK_BUILDDIR="$(builddir)" $@ + +spellcheck spellcheck-interactive spellcheck-sortdict: + +$(MAKE) -f $(top_builddir)/docs/Makefile $(AM_MAKEFLAGS) MKDIR_P="$(MKDIR_P)" builddir="$(builddir)" srcdir="$(srcdir)" top_builddir="$(top_builddir)" top_srcdir="$(top_srcdir)" SPELLCHECK_SRC="$(SPELLCHECK_SRC)" SPELLCHECK_SRCDIR="$(srcdir)" SPELLCHECK_BUILDDIR="$(builddir)" $@ + +CLEANFILES = *-spellchecked */*-spellchecked + +################################################################# + MAINTAINERCLEANFILES = Makefile.in .dirstamp clean-local: $(AM_V_at)rm -rf *.pyc __pycache__ */*.pyc */__pycache__ */*/*.pyc */*/__pycache__ - $(AM_V_at)rm -f NUT-Monitor + $(AM_V_at)rm -f NUT-Monitor module/setup.py diff --git a/scripts/python/README b/scripts/python/README deleted file mode 100644 index 4c18bedb36..0000000000 --- a/scripts/python/README +++ /dev/null @@ -1,50 +0,0 @@ -Python NUT Client files ------------------------ - -This directory contains various NUT Client related Python scripts, written -by David Goncalves, and released under GPL v3. - -module -~~~~~~ - -This directory contains PyNUT.py, which is a Python abstraction class to -access NUT data server(s). You can use it in Python programs to access NUT's -upsd data server in a simple way, without having to know the NUT protocol. - -The same module should work for Python 2 and Python 3. - -To import it on Python programs you have to use the following (case sensitive): - - import PyNUT - -This module provides a 'PyNUTClient' class that can be used to connect and -get data from an upsd data server. - -To install the PyNUT module on Debian/Ubuntu, copy it to: -/usr/share/python-support/python-pynut/ - -For quick tests, just make sure its directory is exported in `PYTHONPATH` -environment variable. - -This directory also contains test_nutclient.py, which is a PyNUT test program. -For this to be fully functional, you will need to adapt the login, password and -upsname to fit your configuration. A NUT data server should be running for the -test program to verify connection and protocol support. - -For one practical example, you can research `tests/NIT/nit.sh` in NUT sources. - -app -~~~ - -This directory contains the NUT-Monitor application, which uses the -PyNUT class, along with its resources. - -To install it, you will either need to keep the files together, or to install: -- Depending on the Python version(s) your system has, put NUT-Monitor-py2gtk2 - or NUT-Monitor-py3qt5 to /usr/bin/, /usr/X11R6/bin/ or something like that - (optionally making a simple NUT-Monitor symlink to the preferred version), -- ui/*.glade (for NUT-Monitor-py2gtk2) or ui/*.ui (for NUT-Monitor-py3qt5) - to /usr/share/nut-monitor/, -- nut-monitor.png to something like /usr/share/pixmaps/ -- finally, nut-monitor-py2gtk2.desktop and/or nut-monitor-py3qt5.desktop - (optionally symlinked as nut-monitor.desktop) to /usr/share/applications/ diff --git a/scripts/python/README.adoc b/scripts/python/README.adoc new file mode 100644 index 0000000000..72e268063b --- /dev/null +++ b/scripts/python/README.adoc @@ -0,0 +1,61 @@ +Python NUT Client files +----------------------- + +This directory contains various NUT Client related Python scripts, written +by David Goncalves, and released under GPL v3. + +module +~~~~~~ + +This directory contains `PyNUT.py`, which is a Python abstraction class to +access NUT data server(s). You can use it in Python programs to access NUT's +`upsd` data server in a simple way, without having to know the NUT protocol. + +The same module should work for Python 2 and Python 3. + +To import it into Python programs you have to use the following line (case +sensitive): + + import PyNUT + +This module provides a `PyNUTClient` class that can be used to connect and +get data from an `upsd` data server. + +To install the `PyNUT` module on Debian/Ubuntu, copy it to: +`/usr/share/python-support/python-pynut/` + +For quick tests, just make sure its directory is exported in `PYTHONPATH` +environment variable. + +This directory also contains `test_nutclient.py`, which is a `PyNUT` test program +and it also serves as a code example. For this to be fully functional, you will +need to adapt the login, password and upsname to fit your configuration. +A NUT data server should be running for the test program to verify connection +and protocol support. + +For one practical example, you can research `tests/NIT/nit.sh` in NUT sources. + +app +~~~ + +This directory contains the `NUT-Monitor` UI application, which uses the +`PyNUT` class, along with its own resources. + +There are two closely related separate implementations, for Python 2 with GTK2 +and for Python 3 with Qt5. Both can be installed at the same time, if your +distribution has not yet outlawed the obsolete Python 2 interpreters. + +To install it, you will either need to keep the files together, or to install: + +- Depending on the Python version(s) your system has, put `NUT-Monitor-py2gtk2` + and/or `NUT-Monitor-py3qt5` to `/usr/bin/`, `/usr/X11R6/bin/` or something + like that (optionally making a simple `NUT-Monitor` symlink to the preferred + implementation version or using the provided wrapper script), +- `ui/*.glade` (for `NUT-Monitor-py2gtk2`) or `ui/*.ui` (for `NUT-Monitor-py3qt5`) + files to `/usr/share/nut-monitor/`, +- `nut-monitor.png` to something like `/usr/share/pixmaps/`, +- finally, `nut-monitor-py2gtk2.desktop` and/or `nut-monitor-py3qt5.desktop` + (optionally symlinked as `nut-monitor.desktop`) to `/usr/share/applications/` + +The `PyNUT` module can be kept nearby, or must be installed as a "site" or "vendor" +provided script into your Python modules location. See the wrapper script for more technical details. diff --git a/scripts/python/app/NUT-Monitor b/scripts/python/app/NUT-Monitor index cab270f574..11c5a07e3b 100755 --- a/scripts/python/app/NUT-Monitor +++ b/scripts/python/app/NUT-Monitor @@ -5,7 +5,7 @@ # a single simple call. # # Copyright (C): -# 2022 Jim Klimov +# 2022-2023 Jim Klimov # # License: GPLv2+ @@ -14,8 +14,8 @@ PREFER_PY2=true # Detect which variant of NUT-Monitor we can run on the local system: -PYTHON_PY2GTK2="`head -1 "$0"-py2gtk2 | sed 's,^#!,,'`" || PYTHON_PY2GTK2="" -PYTHON_PY3QT5="`head -1 "$0"-py3qt5 | sed 's,^#!,,'`" || PYTHON_PY3QT5="" +[ -s "$0"-py2gtk2 -a -x "$0"-py2gtk2 ] && PYTHON_PY2GTK2="`head -1 "$0"-py2gtk2 | sed 's,^#!,,'`" || PYTHON_PY2GTK2="" +[ -s "$0"-py3qt5 -a -x "$0"-py3qt5 ] && PYTHON_PY3QT5="`head -1 "$0"-py3qt5 | sed 's,^#!,,'`" || PYTHON_PY3QT5="" SCRIPTDIR="`dirname "$0"`" && SCRIPTDIR="`cd "$SCRIPTDIR" && pwd`" || SCRIPTDIR="./" if [ -n "$PYTHON_PY2GTK2" ] \ @@ -52,14 +52,14 @@ if [ -n "$PYTHON_PY2GTK2" ] && [ -n "$PYTHON_PY3QT5" ] ; then if $PREFER_PY2 ; then exec "$0"-py2gtk2 "$@" else - exec "$0"-py3qt3 "$@" + exec "$0"-py3qt5 "$@" fi else if [ -n "$PYTHON_PY2GTK2" ] ; then exec "$0"-py2gtk2 "$@" fi - if [ -n "$PYTHON_PY3QT3" ] ; then - exec "$0"-py3qt3 "$@" + if [ -n "$PYTHON_PY3QT5" ] ; then + exec "$0"-py3qt5 "$@" fi fi diff --git a/scripts/python/app/NUT-Monitor-py2gtk2.in b/scripts/python/app/NUT-Monitor-py2gtk2.in index 5c16aa3a77..652132f1c8 100755 --- a/scripts/python/app/NUT-Monitor-py2gtk2.in +++ b/scripts/python/app/NUT-Monitor-py2gtk2.in @@ -75,6 +75,9 @@ class interface : ( cmd_opts, args ) = opt_parser.parse_args() + # FIXME: tell the system to not guess and definitively use + # the `nut-monitor-py2gtk2.desktop` for windowing resources: + # g_set_prgname('nut-monitor-py2gtk2') self.__glade_file = os.path.join( os.path.dirname( sys.argv[0] ), "ui/gui-1.3.glade" ) diff --git a/scripts/python/app/NUT-Monitor-py3qt5.in b/scripts/python/app/NUT-Monitor-py3qt5.in index d78f4160a4..a149ddaf31 100755 --- a/scripts/python/app/NUT-Monitor-py3qt5.in +++ b/scripts/python/app/NUT-Monitor-py3qt5.in @@ -29,6 +29,9 @@ # # 2022-02-20 Luke Dashjr - Version 2.0 # Port to Python 3 with PyQt5. +# +# 2023-11-27 Laurent Bigonville - Version 2.0.1 +# Set the DesktopFileName import PyQt5.uic @@ -80,6 +83,10 @@ class interface : self.__app = QApplication( argv ) + try: + self.__app.setDesktopFileName("nut-monitor-py3qt5") + except Exception as ex: + pass self.__ui_file = self.__find_res_file( 'ui', "window1.ui" ) diff --git a/scripts/python/app/README b/scripts/python/app/README.adoc similarity index 92% rename from scripts/python/app/README rename to scripts/python/app/README.adoc index 2f8482211b..f2d31afb96 100644 --- a/scripts/python/app/README +++ b/scripts/python/app/README.adoc @@ -12,19 +12,22 @@ uses the python-pynut class (available at http://www.lestat.st), delivered as PyNUT in the NUT source tree. Refer to your OS packaging and/or install custom modules with `pip` (or `pip3`) -to get required dependencies (GTK + GObject or QT5). +to get required dependencies (GTK + GObject or Qt5). Path to PyNUT module -------------------- For quick tests (e.g. during development), you can run the clients like this: -```` + +---- :; PYTHONPATH=../module/ python2 ./NUT-Monitor-py2gtk2.in -```` +---- + or: -```` + +---- :; PYTHONPATH=../module/ python3 ./NUT-Monitor-py3qt5.in -```` +---- Localization ------------ @@ -50,7 +53,7 @@ image::screenshots/nut-monitor-1.png[Example of device status overview] image::screenshots/nut-monitor-2.png[Example report of device variables] -image::screenshots/nut-monitor-3.png[Example modification of a writeable variable] +image::screenshots/nut-monitor-3.png[Example modification of a writable variable] Kudos ----- @@ -58,7 +61,7 @@ Kudos NUT-Monitor and PyNUT (for Python 2 syntax) were originally authored by David Goncalves -NUT-Monitor was converted to Python 3 + QT5 by Luke Dashjr +NUT-Monitor was converted to Python 3 + Qt5 by Luke Dashjr PyNUT was extended, and two variants of NUT-Monitor converged and wrapped for Python 2+3 dual support by Jim Klimov diff --git a/scripts/python/module/.gitignore b/scripts/python/module/.gitignore index 4f98b981bd..7606bf7f7f 100644 --- a/scripts/python/module/.gitignore +++ b/scripts/python/module/.gitignore @@ -1,2 +1,12 @@ /PyNUT.py /test_nutclient.py +/setup.py +/PyNUTClient +/PyNUTClient.egg-info +/build +/dist +/src +/.tox +/README.txt +/.pypi-* +/LICENSE-GPL3 diff --git a/scripts/python/module/MANIFEST.in b/scripts/python/module/MANIFEST.in new file mode 100644 index 0000000000..5488969592 --- /dev/null +++ b/scripts/python/module/MANIFEST.in @@ -0,0 +1 @@ +include tox.ini diff --git a/scripts/python/module/Makefile.am b/scripts/python/module/Makefile.am new file mode 100644 index 0000000000..fc46eab0ad --- /dev/null +++ b/scripts/python/module/Makefile.am @@ -0,0 +1,159 @@ +# Network UPS Tools: scripts/python/module (PyNUTClient) + +# See also: .github/workflows/PyNUTClient.yml +# Note: this Makefile is focused on PyPI publication +# The usual autotools stuff including clean-up is in parent dir +# (to allow easier mixing of the module and app, if/when desired) + +# Non-maintainers can at most generate the source layout for python setuptools +# (having only shell scripting as a prerequisite suffices for that) +all: PyNUTClient + +check-local: + @echo "You may want to set up a NUT data server and run 'make tox' here: `pwd`" + +# NOT tying into "make check" because a lot of stars must align for this test: +tox: dist .pypi-tools-tox + tox + +EXTRA_DIST = tox.ini MANIFEST.in + +NUT_SOURCE_GITREV_NUMERIC = @NUT_SOURCE_GITREV_NUMERIC@ +PYTHON = @PYTHON@ + +GENERATED_DIST = dist build *.egg-info +GENERATED_SRC = PyNUTClient README.txt LICENSE-GPL3 + +# These are normally generated by a NUT build, but if we want to iterate +# specifically PyNUTClient packaging - `make veryclean dist` should do it here: +GENERATED_PY = test_nutclient.py PyNUT.py setup.py + +# (Re-)generate files normally made by `configure` from .in templates +# No touch-files here, intended for manual use in developer iterations +py-in: $(GENERATED_PY) +redist: clean py-in dist + +$(GENERATED_DIST): .pypi-dist + +# NOTE: We only clean .pypi-tools* in MAINTAINERCLEANFILES to avoid regular +# re-detection of the probably unchanging environment! +clean-local: + rm -rf $(GENERATED_SRC) $(GENERATED_DIST) + rm -f .pypi-src .pypi-dist* + +veryclean: clean + rm -f $(GENERATED_PY) + +# Python test envs take a while to populate, so maybe better not clean +# them too enthusiastically. Can revise (move to "clean-local") later, +# if this choice proves a problem. +distclean-local: + rm -rf .tox + rm -f $(GENERATED_PY) + +MAINTAINERCLEANFILES = Makefile.in .dirstamp .pypi-tools* + +PyNUTClient: .pypi-src + +# Tagged releases should only have three blocks of digits separated by dots +upload publish: + +@echo " PYPI Checking upload type for module version '$(NUT_SOURCE_GITREV_NUMERIC)'" ; \ + case x"`echo "$(NUT_SOURCE_GITREV_NUMERIC)" | tr -d '[0-9]'`" in \ + x..) echo " PYPI ...release"; $(MAKE) $(AM_MAKEFLAGS) upload-pypi ;; \ + x*) echo " PYPI ...testing"; $(MAKE) $(AM_MAKEFLAGS) upload-testpypi ;; \ + esac + +# README.txt is also a part of module standard expectations +.pypi-src: test_nutclient.py.in PyNUT.py.in setup.py.in README.adoc Makefile $(top_srcdir)/LICENSE-GPL3 + @echo " PYPI Generate PyPI module source" + @rm -rf $(GENERATED_SRC) "$@" + @mkdir -p PyNUTClient + @for S in "$(srcdir)"/*.py.in ; do \ + B="`basename "$${S}" .in`" ; \ + if test x"$${B}" = xsetup.py ; then \ + if ! test -s "$${B}" ; then \ + sed -e "s/[@]NUT_SOURCE_GITREV_NUMERIC[@]/$(NUT_SOURCE_GITREV_NUMERIC)/" < "$(srcdir)/$${B}.in" > "$${B}" || exit ; \ + fi ; \ + continue; \ + fi; \ + if test -s "$${B}" ; then \ + cp -pf "$${B}" PyNUTClient/ || exit ; \ + continue; \ + fi ; \ + sed -e "s,[@]PYTHON[@],@PYTHON@," < "$(srcdir)/$${B}.in" > "PyNUTClient/$${B}" || exit ; \ + if test -x "$(srcdir)/$${B}.in" ; then chmod +x "PyNUTClient/$${B}"; fi ; \ + done ; \ + cp -pf "$(srcdir)/README.adoc" README.txt || exit ; \ + cp -pf "$(top_srcdir)/LICENSE-GPL3" . || exit ; \ + echo "from . import PyNUT" > PyNUTClient/__init__.py || exit + @touch "$@" + +.pypi-tools-python: + @echo " PYPI Checking that PYTHON variable is defined and usable: $(PYTHON)" + @test -n "$(PYTHON)" && command -v $(PYTHON) + @touch "$@" + +.pypi-tools-dist-wheel: .pypi-tools-python + @echo " PYPI Prepare PyPI tools to generate a distribution (wheel)" + @$(PYTHON) -m pip install wheel + @touch "$@" + +.pypi-tools-dist-build: .pypi-tools-python + @echo " PYPI Prepare PyPI tools to generate a distribution (build)" + @$(PYTHON) -m pip install build + @touch "$@" + +.pypi-tools-tox: .pypi-tools-python + @echo " PYPI Prepare Python multi-environment testing tools (tox)" + @$(PYTHON) -m pip install tox + @touch "$@" + +# Install via OS packaging or pip? +# https://twine.readthedocs.io/en/stable/ +.pypi-tools-upload: .pypi-tools-python + @echo " PYPI Prepare PyPI tools and resources to upload a distribution (twine)" + @$(PYTHON) -m pip install twine + @command -v twine + @test -s $(HOME)/.pypirc + @touch "$@" + +# Using pypa/setuptools +.pypi-dist: .pypi-src + +@$(MAKE) $(AM_MAKEFLAGS) .pypi-dist-pip-build || \ + $(MAKE) $(AM_MAKEFLAGS) .pypi-dist-obsolete || \ + $(MAKE) $(AM_MAKEFLAGS) .pypi-dist-pip-wheel + @touch "$@" + +# The most modern approach as of 2023 +.pypi-dist-pip-build: .pypi-tools-dist-build .pypi-src + @echo " PYPI Generate PyPI module distribution (using 'build' module)" + @rm -rf $(GENERATED_DIST) "$@" + @$(PYTHON) -m build --skip-dependency-check --no-isolation + @touch "$@" + +# Using "setup.py" directly causes warnings about its deprecation +# While "pip" distribution generator also uses it internally, +# it "knows what it's doing" and goes quietly about its work :) +# Does not support "sdis" though. Oh well. +.pypi-dist-pip-wheel: .pypi-tools-dist-wheel .pypi-src + @echo " PYPI Generate PyPI module distribution (using 'pip wheel')" + @rm -rf $(GENERATED_DIST) "$@" + @$(PYTHON) -m pip wheel --no-deps -w dist . + @touch "$@" + +.pypi-dist-obsolete: .pypi-tools-dist-wheel .pypi-src + @echo " PYPI Generate PyPI module distribution (using setup.py directly)" + @rm -rf $(GENERATED_DIST) "$@" + @$(PYTHON) setup.py sdist bdist_wheel + @touch "$@" + +# These need $HOME/.pypirc prepared with credentials (API tokens) from +# https://pypi.org/manage/account/ and https://test.pypi.org/manage/account/ +# TODO: .asc/.sig files for releases? +upload-pypi: .pypi-dist .pypi-tools-upload + @echo " PYPI Upload PyPI module distribution to production/release PyPI repository" + @twine upload dist/* + +upload-testpypi: .pypi-dist .pypi-tools-upload + @echo " PYPI Upload PyPI module distribution to testing/staging PyPI repository" + @twine upload -r testpypi dist/* diff --git a/scripts/python/module/README b/scripts/python/module/README.adoc similarity index 88% rename from scripts/python/module/README rename to scripts/python/module/README.adoc index b9ae10a0ee..18b1d84ddd 100644 --- a/scripts/python/module/README +++ b/scripts/python/module/README.adoc @@ -1,19 +1,20 @@ Introduction ============ -The project was originally started in 2008 David Goncalves -at https://www.lestat.st/informatique/projets/pynut and was soon added -to the main NUT codebase and evolved there. - The PyNUT module provides an abstraction class `PyNUTClient` written in Python, which allows to connect to a NUT (Network UPS Tools) server and execute different commands without an application developer needing to -know the NUT communication protocol. +know the NUT communication protocol. It also includes a small self-test +application as a consumer of the module. + +The project was originally started in 2008 by David Goncalves +at https://www.lestat.st/informatique/projets/pynut and was soon added to +the main NUT codebase and further evolved there. -That class was born from another project the original author had -- a -graphical application to monitor and manage the UPSes connected to a -NUT server. It is now known as `NUT-Monitor` and is also provided along -with NT sources. +The `PyNUTClient` class was born from another project the original author +had -- a graphical application to monitor and manage the UPSes connected +to a NUT server. It is now known as `NUT-Monitor` and is also provided +along with NUT sources. With that GUI application being written in Python too, it was decided to split the project in two parts (the PyNUT class + GUI application, @@ -21,6 +22,10 @@ serving as model + view) in order to keep the two parts independent. That class was subsequently renamed to `PyNUTClient` since version 1.1 of the original project, allowing to develop other classes nearby later. +It is published to PyPI repository as +link:https://pypi.org/project/PyNUTClient/[PyNUTClient] +and so should be installable with `pip` tooling. + Currently the module is regularly tested to work with Python interpreter versions 2.7, 3.4, 3.5 and 3.7. @@ -94,7 +99,7 @@ Although the original project was written in French, for the reasons of general distribution with NUT, all of its code is commented in English. While this file contains the description from https://www.lestat.st/informatique/projets/pynut the class `PyNUTClient` is compatible with the Python module PyDOC, so you can -type `pydoc PyNUT` to obtain succint documentation on your current version of +type `pydoc PyNUT` to obtain succinct documentation on your current version of the module. For more examples see the provided test script and the NUT-Monitor application @@ -121,7 +126,7 @@ ver ~~~ Sends the `VER` command to the NUT data server and returns its self-reported -identification such as version, product or distribution it may be bunded with. +identification such as version, product or distribution it may be bundled with. Note that the NUT client interactions should not rely on reported versions, but follow the protocol as defined. @@ -163,7 +168,7 @@ evaluates the server response. ----- import PyNUT - ups = PyNUT.PyNUTClient( host='serveur', login='upsadmin', password='upspass' ) + ups = PyNUT.PyNUTClient( host='server', login='upsadmin', password='upspass' ) result = ups.CheckUPSAvailable( ups='ups1' ) print( result ) @@ -183,7 +188,7 @@ of "variable"-"current value" pairs. ----- import PyNUT - ups = PyNUT.PyNUTClient( host='serveur', login='upsadmin', password='upspass' ) + ups = PyNUT.PyNUTClient( host='server', login='upsadmin', password='upspass' ) result = ups.GetRWVars( ups='ups1' ) print( result ) @@ -208,7 +213,7 @@ pairs. ----- import PyNUT - ups = PyNUT.PyNUTClient( host='serveur', login='upsadmin', password='upspass' ) + ups = PyNUT.PyNUTClient( host='server', login='upsadmin', password='upspass' ) result = ups.GetRWVars( ups='ups1' ) print( result ) @@ -236,7 +241,7 @@ Returns the list of UPSes represented by the NUT server, as a dictionary of ----- import PyNUT - ups = PyNUT.PyNUTClient( host='serveur', login='upsadmin', password='upspass' ) + ups = PyNUT.PyNUTClient( host='server', login='upsadmin', password='upspass' ) result = ups.GetUPSList() print( result ) @@ -260,7 +265,7 @@ methods. ----- import PyNUT - ups = PyNUT.PyNUTClient( host='serveur', login='upsadmin', password='upspass' ) + ups = PyNUT.PyNUTClient( host='Serveur', login='upsadmin', password='upspass' ) result = ups.GetUPSNames() print( result ) @@ -278,7 +283,7 @@ of "variable"-"current value" pairs. ----- import PyNUT - ups = PyNUT.PyNUTClient( host='serveur', login='upsadmin', password='upspass' ) + ups = PyNUT.PyNUTClient( host='Serveur', login='upsadmin', password='upspass' ) result = ups.GetUPSVars( ups='UPS1' ) print( result ) @@ -351,7 +356,7 @@ in case of failure. ----- import PyNUT - ups = PyNUT.PyNUTClient( host='serveur', login='upsadmin', password='upspass' ) + ups = PyNUT.PyNUTClient( host='Serveur', login='upsadmin', password='upspass' ) result = ups.RunUPSCommand( ups='UPS1', command='test.panel.start' ) print( result ) @@ -376,7 +381,7 @@ in case of failure. ----- import PyNUT - ups = PyNUT.PyNUTClient( host='serveur', login='upsadmin', password='upspass' ) + ups = PyNUT.PyNUTClient( host='Serveur', login='upsadmin', password='upspass' ) result = ups.SetRWVar( ups='UPS1', var='battery.date', value='06/17/08' ) print( result ) diff --git a/scripts/python/module/setup.py.in b/scripts/python/module/setup.py.in new file mode 100644 index 0000000000..18f956d20c --- /dev/null +++ b/scripts/python/module/setup.py.in @@ -0,0 +1,46 @@ +""" +The setup.py file for PyNUTClient +""" +# Based on https://medium.com/@VersuS_/automate-pypi-releases-with-github-actions-4c5a9cfe947d +# See also .github/workflows/PyNUTClient.yml for active packaging steps + +from setuptools import setup, find_packages +import codecs +import os + +here = os.path.abspath(os.path.dirname(__file__)) + +# README.txt appears from README.adoc during package or CI build +with codecs.open(os.path.join(here, "README.txt"), encoding="utf-8") as fh: + long_description = "\n" + fh.read() + +setup( + name = "PyNUTClient", + version = '@NUT_SOURCE_GITREV_NUMERIC@', + author = "The Network UPS Tools project", + license_files = ('LICENSE-GPL3',), + author_email = "jimklimov+nut@gmail.com", + description = "Python client bindings for NUT", + url = "https://github.com/networkupstools/nut/tree/master/scripts/python/module", + long_description_content_type = "text/plain", # NOTE: No asciidoc so far, see https://packaging.python.org/en/latest/specifications/core-metadata/ + long_description = long_description, + packages = find_packages(), + #py_modules = ['PyNUT'], + package_dir = {'PyNUT': 'PyNUTClient'}, + #data_files = [('', ['tox.ini'])], + #scripts = ['PyNUTClient/test_nutclient.py', 'PyNUTClient/__init__.py'], + python_requires = '>=2.6', + # install_requires = ['telnetlib'], # NOTE: telnetlib.py is part of Python core for tested 2.x and 3.x versions, not something 'pip' can download + keywords = ['pypi', 'cicd', 'python', 'nut', 'Network UPS Tools'], + classifiers = [ + "Development Status :: 5 - Production/Stable", + "Intended Audience :: Developers", + "Programming Language :: Python :: 2.6", + "Programming Language :: Python :: 2.7", + "Programming Language :: Python :: 3", + "Operating System :: Unix", + "Operating System :: MacOS :: MacOS X", + "Operating System :: Microsoft :: Windows" + ] +) + diff --git a/scripts/python/module/tox.ini b/scripts/python/module/tox.ini new file mode 100644 index 0000000000..f24499a631 --- /dev/null +++ b/scripts/python/module/tox.ini @@ -0,0 +1,27 @@ +# Configuration for Python test environment manager +# https://tox.wiki/en/latest/user_guide.html +# +# Note that to run `test_nutclient.py` you must prepare a running NUT data +# server (upsd) with a connected driver. You can use a dummy-ups driver for +# that, see e.g. NUT tests/NIT/nit.sh for how the test beds are prepared. +# Further you may need to export `NUT_HOST` and `NUT_PORT` (if not default), +# and a `NUT_USER` and `NUT_PASS` for tests with logged-in session behaviors. +# Then just run `tox` (may have to `pip install tox` first though). + +[tox] +envlist = + py2{6,7} + py3{5,5,6,7,8,9,10,11,12,13} + +[testenv] +setenv = + PYTHONPATH = {toxinidir}:{toxinidir}/PyNUTClient + +# On my system, some but not all Python versions complained about lack of +# "distutils.cmd" etc. in the prepared virtual environments. Can this help? +commands_pre = + python -m pip install -U pip + +commands = + python PyNUTClient/test_nutclient.py + #py.test --basetemp={envtmpdir} diff --git a/scripts/subdriver/gen-snmp-subdriver.sh b/scripts/subdriver/gen-snmp-subdriver.sh index 4683aff9a5..0fba35e5d8 100755 --- a/scripts/subdriver/gen-snmp-subdriver.sh +++ b/scripts/subdriver/gen-snmp-subdriver.sh @@ -3,14 +3,14 @@ # an auxiliary script to produce a "stub" snmp-ups subdriver from # SNMP data from a real agent or from dump files # -# Version: 0.15 +# Version: 0.16 # # See also: docs/snmp-subdrivers.txt # # Copyright (C) # 2011 - 2012 Arnaud Quette # 2015 - 2022 Eaton (author: Arnaud Quette ) -# 2011 - 2022 Jim Klimov +# 2011 - 2024 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 @@ -206,16 +206,16 @@ generate_C() { #include "${HFILE}" - #define ${UDRIVER}_MIB_VERSION "0.1" + #define ${UDRIVER}_MIB_VERSION "0.01" #define ${UDRIVER}_SYSOID "${DEVICE_SYSOID}" /* To create a value lookup structure (as needed on the 2nd line of the example * below), use the following kind of declaration, outside of the present snmp_info_t[]: * static info_lkp_t onbatt_info[] = { - * { 1, "OB" }, - * { 2, "OL" }, - * { 0, NULL } + * info_lkp_default(1, "OB"), + * info_lkp_default(2, "OL"), + * info_lkp_sentinel * }; */ @@ -223,7 +223,7 @@ generate_C() { static snmp_info_t ${LDRIVER}_mib[] = { /* Data format: - * { info_type, info_flags, info_len, OID, dfl, flags, oid2info }, + * snmp_info_default(info_type, info_flags, info_len, OID, dfl, flags, oid2info), * * info_type: NUT INFO_ or CMD_ element name * info_flags: flags to set in addinfo @@ -234,15 +234,15 @@ generate_C() { * oid2info: lookup table between OID and NUT values * * Example: - * { "input.voltage", 0, 0.1, ".1.3.6.1.4.1.705.1.6.2.1.2.1", "", SU_INPUT_1, NULL }, - * { "ups.status", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.705.1.7.3.0", "", SU_FLAG_OK | SU_STATUS_BATT, onbatt_info }, + * snmp_info_default("input.voltage", 0, 0.1, ".1.3.6.1.4.1.705.1.6.2.1.2.1", "", SU_INPUT_1, NULL), + * snmp_info_default("ups.status", ST_FLAG_STRING, SU_INFOSIZE, ".1.3.6.1.4.1.705.1.7.3.0", "", SU_FLAG_OK | SU_STATUS_BATT, onbatt_info), * * To create a value lookup structure (as needed on the 2nd line), use the * following kind of declaration, outside of the present snmp_info_t[]: * static info_lkp_t onbatt_info[] = { - * { 1, "OB" }, - * { 2, "OL" }, - * { 0, NULL } + * info_lkp_default(1, "OB"), + * info_lkp_default(2, "OL"), + * info_lkp_sentinel * }; */ @@ -253,9 +253,9 @@ generate_C() { # Same file, indented text (TABs not stripped): cat >> "$CFILE" <> "${CFILE}" # append footer (TABs not stripped): @@ -287,7 +287,7 @@ EOF #endif /* if WITH_UNMAPPED_DATA_POINTS */ /* end of structure. */ - { NULL, 0, 0, NULL, NULL, 0, NULL } + snmp_info_sentinel }; mib2nut_info_t ${LDRIVER} = { "${LDRIVER}", ${UDRIVER}_MIB_VERSION, NULL, NULL, ${LDRIVER}_mib, ${UDRIVER}_DEVICE_SYSOID }; diff --git a/scripts/systemd/.gitignore b/scripts/systemd/.gitignore index 45a6b841a8..a39ac8db55 100644 --- a/scripts/systemd/.gitignore +++ b/scripts/systemd/.gitignore @@ -9,3 +9,6 @@ /nutshutdown /nut-driver-enumerator.service /nut-driver-enumerator.path +/nut-driver-enumerator-daemon-activator.path +/nut-driver-enumerator-daemon-activator.service +/nut-driver-enumerator-daemon.service diff --git a/scripts/systemd/Makefile.am b/scripts/systemd/Makefile.am index dafdd5ae99..7a0f37f7b9 100644 --- a/scripts/systemd/Makefile.am +++ b/scripts/systemd/Makefile.am @@ -1,10 +1,15 @@ -EXTRA_DIST = README +# Network UPS Tools: scripts/systemd + +EXTRA_DIST = README.adoc if HAVE_SYSTEMD systemdsystemunit_DATA = \ nut-driver-enumerator.service \ nut-driver-enumerator.path \ + nut-driver-enumerator-daemon-activator.path \ + nut-driver-enumerator-daemon-activator.service \ + nut-driver-enumerator-daemon.service \ nut-driver@.service \ nut-monitor.service \ nut-server.service \ @@ -26,11 +31,38 @@ else EXTRA_DIST += \ nut-driver@.service.in nut-monitor.service.in \ nut-server.service.in nutshutdown.in nut-driver.target nut.target \ - nut-driver-enumerator.path.in nut-driver-enumerator.service.in + nut-driver-enumerator.path.in nut-driver-enumerator.service.in \ + nut-driver-enumerator-daemon-activator.path.in \ + nut-driver-enumerator-daemon-activator.service.in \ + nut-driver-enumerator-daemon.service.in # NOTE: Do not EXTRA_DIST nut-common-tmpfiles.conf.in - it is generated per build endif +SPELLCHECK_SRC = README.adoc + +# NOTE: Due to portability, we do not use a GNU percent-wildcard extension. +# We also have to export some variables that may be tainted by relative +# paths when parsing the other makefile (e.g. MKDIR_P that may be defined +# via expanded $(top_builddir)/install_sh): +#%-spellchecked: % Makefile.am $(top_srcdir)/docs/Makefile.am $(abs_srcdir)/$(NUT_SPELL_DICT) +# +$(MAKE) -s -f $(top_builddir)/docs/Makefile $(AM_MAKEFLAGS) MKDIR_P="$(MKDIR_P)" builddir="$(builddir)" srcdir="$(srcdir)" top_builddir="$(top_builddir)" top_srcdir="$(top_srcdir)" SPELLCHECK_SRC_ONE="$<" SPELLCHECK_SRCDIR="$(srcdir)" SPELLCHECK_BUILDDIR="$(builddir)" $@ + +# NOTE: Portable suffix rules do not allow prerequisites, so we shim them here +# by a wildcard target in case the make implementation can put the two together. +*-spellchecked: Makefile.am $(top_srcdir)/docs/Makefile.am $(abs_srcdir)/$(NUT_SPELL_DICT) + +.sample.sample-spellchecked: + +$(MAKE) -s -f $(top_builddir)/docs/Makefile $(AM_MAKEFLAGS) MKDIR_P="$(MKDIR_P)" builddir="$(builddir)" srcdir="$(srcdir)" top_builddir="$(top_builddir)" top_srcdir="$(top_srcdir)" SPELLCHECK_SRC_ONE="$<" SPELLCHECK_SRCDIR="$(srcdir)" SPELLCHECK_BUILDDIR="$(builddir)" $@ + +.in.in-spellchecked: + +$(MAKE) -s -f $(top_builddir)/docs/Makefile $(AM_MAKEFLAGS) MKDIR_P="$(MKDIR_P)" builddir="$(builddir)" srcdir="$(srcdir)" top_builddir="$(top_builddir)" top_srcdir="$(top_srcdir)" SPELLCHECK_SRC_ONE="$<" SPELLCHECK_SRCDIR="$(srcdir)" SPELLCHECK_BUILDDIR="$(builddir)" $@ + +spellcheck spellcheck-interactive spellcheck-sortdict: + +$(MAKE) -f $(top_builddir)/docs/Makefile $(AM_MAKEFLAGS) MKDIR_P="$(MKDIR_P)" builddir="$(builddir)" srcdir="$(srcdir)" top_builddir="$(top_builddir)" top_srcdir="$(top_srcdir)" SPELLCHECK_SRC="$(SPELLCHECK_SRC)" SPELLCHECK_SRCDIR="$(srcdir)" SPELLCHECK_BUILDDIR="$(builddir)" $@ + +CLEANFILES = *-spellchecked + MAINTAINERCLEANFILES = Makefile.in .dirstamp # Generated by autogen.sh and needed to run the configure script: diff --git a/scripts/systemd/README b/scripts/systemd/README deleted file mode 100644 index 5b3ee5812e..0000000000 --- a/scripts/systemd/README +++ /dev/null @@ -1,12 +0,0 @@ -This directory contains the NUT support files for systemd, the System and -Service Manager. - -These files are automatically installed, upon detection (at configure time) -of a systemd enabled system. - -This also uses the nut-driver-enumerator.sh (service and implementation -method) and upsdrvsvcctl (tool) to manage NUT drivers as service instances -located in ../upsdrvsvcctl/ source subdirectory. - -Contributed by Michal Hlavinka -Updated 2016-2018 by Michal Hrusecky and Jim Klimov diff --git a/scripts/systemd/README.adoc b/scripts/systemd/README.adoc new file mode 100644 index 0000000000..8c66601dce --- /dev/null +++ b/scripts/systemd/README.adoc @@ -0,0 +1,34 @@ +NUT resources for systemd integration +===================================== + +Overview +-------- + +This directory contains the NUT support files for `systemd`, the System and +Service Manager used in many Linux distributions. + +These files are automatically installed, upon detection (at `configure` time) +of a systemd enabled target system, or if corresponding configuration options +were requested. + +This also uses the `nut-driver-enumerator.sh` (service and implementation +method) and `upsdrvsvcctl` (tool) to manage NUT drivers as service instances +located in `../upsdrvsvcctl/` source subdirectory. + +Two service bundles are provided for this: + +* a set of `nut-driver-enumerator-daemon*` units starts the script as a + daemon to regularly inspect and apply the NUT configuration to OS service + unit wrappings (mainly intended for monitoring systems with a dynamic + set of monitored power devices, or for systems where filesystem events + monitoring is not a clockwork-reliable mechanism to 100% rely on); +* the other `nut-driver-enumerator.*` units run the script once per triggering + of the service (usually during boot-up; configuration file changes can be + detected and propagated by systemd most of the time). + +Credits +------- + +* Contributed by Michal Hlavinka +* Updated 2016-2018 by Michal Hrusecky and Jim Klimov +* Maintained since 2020 by Jim Klimov diff --git a/scripts/systemd/nut-driver-enumerator-daemon-activator.path.in b/scripts/systemd/nut-driver-enumerator-daemon-activator.path.in new file mode 100644 index 0000000000..615ce9fe57 --- /dev/null +++ b/scripts/systemd/nut-driver-enumerator-daemon-activator.path.in @@ -0,0 +1,21 @@ +# Network UPS Tools (NUT) systemd integration +# Copyright (C) 2011-2023 by NUT contirbutors +# Distributed under the terms of GPLv2+ +# See https://networkupstools.org/ +# and https://github.com/networkupstools/nut/ + +[Unit] +# Trigger restart of nut-driver-enumerator-daemon-activator.service +# whenever ups.conf is edited, which would cause reload-or-restart +# of the nut-driver-enumerator-daemon.service for actual reconfig. +Description=Network UPS Tools - Trigger restart of nut-driver-enumerator-daemon.service whenever ups.conf is edited +Conflicts=nut-driver-enumerator.service nut-driver-enumerator.path +After=local-fs.target +Before=nut-driver.target +PartOf=nut.target + +[Path] +PathModified=@CONFPATH@/ups.conf + +[Install] +WantedBy=nut.target diff --git a/scripts/systemd/nut-driver-enumerator-daemon-activator.service.in b/scripts/systemd/nut-driver-enumerator-daemon-activator.service.in new file mode 100644 index 0000000000..86944fc3ff --- /dev/null +++ b/scripts/systemd/nut-driver-enumerator-daemon-activator.service.in @@ -0,0 +1,33 @@ +# Network UPS Tools (NUT) systemd integration +# Copyright (C) 2011-2023 by NUT contirbutors +# Distributed under the terms of GPLv2+ +# See https://networkupstools.org/ +# and https://github.com/networkupstools/nut/ + +[Unit] +# This unit starts via nut-driver-enumerator-daemon-activator.path +# activation due to changes in ups.conf file, and triggers a reload +# of the nut-driver-enumerator-daemon.service so that one quickly +# re-processes the new configuration state. +# NOTE: This unit is intentionally not installed as PartOf/WantedBy +# anything, as it is only meant to be triggered by the path unit. +Description=Network UPS Tools - enumeration of configure-file devices into systemd unit instances (FS event-based activator for daemonized mode) +Conflicts=nut-driver-enumerator.service nut-driver-enumerator.path +After=local-fs.target +#Before=nut-driver.target +#PartOf=nut.target + +[Service] +### Script needs privileges to restart units +#User=@RUN_AS_USER@ +#Group=@RUN_AS_GROUP@ +User=root +Type=oneshot +# Non-blocking systemd message posting should not take long, +# or should be aborted and retried if it does (system bugs) +TimeoutStartSec=10s +ExecStart=/bin/systemctl reload-or-restart --no-block nut-driver-enumerator-daemon.service + +[Install] +### No install, see comment above +#WantedBy=nut.target diff --git a/scripts/systemd/nut-driver-enumerator-daemon.service.in b/scripts/systemd/nut-driver-enumerator-daemon.service.in new file mode 100644 index 0000000000..af13ab4e29 --- /dev/null +++ b/scripts/systemd/nut-driver-enumerator-daemon.service.in @@ -0,0 +1,35 @@ +# Network UPS Tools (NUT) systemd integration +# Copyright (C) 2011-2023 by NUT contirbutors +# Distributed under the terms of GPLv2+ +# See https://networkupstools.org/ +# and https://github.com/networkupstools/nut/ + +[Unit] +# This unit starts early in system lifecycle to set up nut-driver instances +# and stays running as a loop to pick up any subsequent changes maybe more +# reliably than the filesystem notification processing would allow. +# End-user may also restart this unit after editing ups.conf to automatically +# un-register or add new instances as appropriate. +Description=Network UPS Tools - enumeration of configure-file devices into systemd unit instances (daemonized mode) +Conflicts=nut-driver-enumerator.service nut-driver-enumerator.path +After=local-fs.target +Before=nut-driver.target +PartOf=nut.target + +[Service] +### Script needs privileges to restart units +#User=@RUN_AS_USER@ +#Group=@RUN_AS_GROUP@ +User=root +# it is expected that this process has to fork the daemon before systemd +# starts follow-up units; it should not be a problem for those +Type=forking +Restart=always +Environment=REPORT_RESTART_42=no +ExecStart=@NUT_LIBEXECDIR@/nut-driver-enumerator.sh --daemon-after +# Note: this is an async event, actual reconfiguration may take some time to +# complete after this signal. +ExecReload=/bin/kill -HUP $MAINPID + +[Install] +WantedBy=nut.target diff --git a/scripts/systemd/nut-driver-enumerator.path.in b/scripts/systemd/nut-driver-enumerator.path.in index 620e1545f3..09b9fdddb4 100644 --- a/scripts/systemd/nut-driver-enumerator.path.in +++ b/scripts/systemd/nut-driver-enumerator.path.in @@ -1,10 +1,17 @@ -# Trigger restart of nut-driver-enumerator.service whenever ups.conf is edited # Network UPS Tools (NUT) systemd integration # Copyright (C) 2011-2023 by NUT contirbutors # Distributed under the terms of GPLv2+ # See https://networkupstools.org/ # and https://github.com/networkupstools/nut/ +[Unit] +# Trigger restart of nut-driver-enumerator.service whenever ups.conf is edited +Description=Network UPS Tools - Trigger restart of nut-driver-enumerator.service whenever ups.conf is edited +Conflicts=nut-driver-enumerator-daemon.service nut-driver-enumerator-daemon-activator.path nut-driver-enumerator-daemon-activator.service +After=local-fs.target +Before=nut-driver.target +PartOf=nut.target + [Path] PathModified=@CONFPATH@/ups.conf diff --git a/scripts/systemd/nut-driver-enumerator.service.in b/scripts/systemd/nut-driver-enumerator.service.in index 4e0a4709be..bab6feec95 100644 --- a/scripts/systemd/nut-driver-enumerator.service.in +++ b/scripts/systemd/nut-driver-enumerator.service.in @@ -9,6 +9,7 @@ # End-user may also restart this unit after editing ups.conf to automatically # un-register or add new instances as appropriate. Description=Network UPS Tools - enumeration of configure-file devices into systemd unit instances +Conflicts=nut-driver-enumerator-daemon.service nut-driver-enumerator-daemon-activator.path nut-driver-enumerator-daemon-activator.service After=local-fs.target Before=nut-driver.target PartOf=nut.target diff --git a/scripts/udev/Makefile.am b/scripts/udev/Makefile.am index f84e4c1fe5..e0576d952c 100644 --- a/scripts/udev/Makefile.am +++ b/scripts/udev/Makefile.am @@ -1,3 +1,4 @@ +# Network UPS Tools: scripts/udev if WITH_UDEV udevrulesdir = $(udevdir)/rules.d @@ -10,7 +11,7 @@ if WITH_IPMI endif endif -EXTRA_DIST = README +EXTRA_DIST = README.adoc 62-nut-usbups.rules: nut-usbups.rules cp nut-usbups.rules $@ @@ -34,3 +35,27 @@ MAINTAINERCLEANFILES += nut-usbups.rules.in nut-usbups.rules.in.AUTOGEN_WITHOUT # Part of dist tarball, regardless of use for current build: EXTRA_DIST += nut-usbups.rules.in + +SPELLCHECK_SRC = README.adoc + +# NOTE: Due to portability, we do not use a GNU percent-wildcard extension. +# We also have to export some variables that may be tainted by relative +# paths when parsing the other makefile (e.g. MKDIR_P that may be defined +# via expanded $(top_builddir)/install_sh): +#%-spellchecked: % Makefile.am $(top_srcdir)/docs/Makefile.am $(abs_srcdir)/$(NUT_SPELL_DICT) +# +$(MAKE) -s -f $(top_builddir)/docs/Makefile $(AM_MAKEFILE) MKDIR_P="$(MKDIR_P)" builddir="$(builddir)" srcdir="$(srcdir)" top_builddir="$(top_builddir)" top_srcdir="$(top_srcdir)" SPELLCHECK_SRC_ONE="$<" SPELLCHECK_SRCDIR="$(srcdir)" SPELLCHECK_BUILDDIR="$(builddir)" $@ + +# NOTE: Portable suffix rules do not allow prerequisites, so we shim them here +# by a wildcard target in case the make implementation can put the two together. +*-spellchecked: Makefile.am $(top_srcdir)/docs/Makefile.am $(abs_srcdir)/$(NUT_SPELL_DICT) + +.sample.sample-spellchecked: + +$(MAKE) -s -f $(top_builddir)/docs/Makefile $(AM_MAKEFILE) MKDIR_P="$(MKDIR_P)" builddir="$(builddir)" srcdir="$(srcdir)" top_builddir="$(top_builddir)" top_srcdir="$(top_srcdir)" SPELLCHECK_SRC_ONE="$<" SPELLCHECK_SRCDIR="$(srcdir)" SPELLCHECK_BUILDDIR="$(builddir)" $@ + +.in.in-spellchecked: + +$(MAKE) -s -f $(top_builddir)/docs/Makefile $(AM_MAKEFILE) MKDIR_P="$(MKDIR_P)" builddir="$(builddir)" srcdir="$(srcdir)" top_builddir="$(top_builddir)" top_srcdir="$(top_srcdir)" SPELLCHECK_SRC_ONE="$<" SPELLCHECK_SRCDIR="$(srcdir)" SPELLCHECK_BUILDDIR="$(builddir)" $@ + +spellcheck spellcheck-interactive spellcheck-sortdict: + +$(MAKE) -f $(top_builddir)/docs/Makefile $(AM_MAKEFILE) MKDIR_P="$(MKDIR_P)" builddir="$(builddir)" srcdir="$(srcdir)" top_builddir="$(top_builddir)" top_srcdir="$(top_srcdir)" SPELLCHECK_SRC="$(SPELLCHECK_SRC)" SPELLCHECK_SRCDIR="$(srcdir)" SPELLCHECK_BUILDDIR="$(builddir)" $@ + +CLEANFILES += *-spellchecked diff --git a/scripts/udev/README b/scripts/udev/README deleted file mode 100644 index c94f834779..0000000000 --- a/scripts/udev/README +++ /dev/null @@ -1,46 +0,0 @@ -Desc: Udev script for NUT USB and IPMI drivers -File: scripts/udev/README -Date: 31 July 2014 -Auth: Arnaud Quette - -This document introduces the Linux udev script for NUT USB -drivers (usbhid-ups, bcmxcp_usb, tripplite_usb, ...) and IPMI driver -(nut-ipmipsu). - -These are needed on Linux systems running udev (recommended -as of kernel 2.6.3, and mandatory as of 2.6.14 and higher). - -This script ensure that the right privileges are set on the -USB and IPMI devices files to allow the NUT driver to operate (ie -allowing the nut user to read AND write to the device). - -Note that the old style hotplug files, available in the -scripts/hotplug directory, are not needed if your kernel supports -udev. - -Installation ------------- - -For most users, these files will be automatically installed in -/etc/udev (or /lib/udev) upon "make install", if that directory -exists and if the feature (USB and / or IPMI) has been enabled -at configure time. You can specify an alternate directory with: - - ./configure --with-udev-dir=DIR - -Manual installation -------------------- - -To install them manually, copy the rules file(s) to /etc/udev/rules.d -(or /lib/udev/rules.d on newer systems) using the command(s): - - :; cp -f nut-usbups.rules /etc/udev/rules.d/62-nut-usbups.rules - :; cp -f nut-ipmipsu.rules /etc/udev/rules.d/52-nut-ipmipsu.rules - -You will need to refresh the bus to avoid a reboot for these rules to be -active. You can do so using: - - :; udevadm trigger --subsystem-match=usb_device - -For USB devices, you can then plug your UPS USB cord, or unplug / replug -it to refresh the device permission, and start NUT. diff --git a/scripts/udev/README.adoc b/scripts/udev/README.adoc new file mode 100644 index 0000000000..62b503b003 --- /dev/null +++ b/scripts/udev/README.adoc @@ -0,0 +1,49 @@ +Udev script for NUT USB and IPMI drivers +======================================== +Arnaud Quette +v1.0, 31 July 2014 (start date) + +This document introduces the Linux `udev` script for NUT USB drivers +(`usbhid-ups`, `nutdrv_qx`, `bcmxcp_usb`, `tripplite_usb`, ...) and +IPMI driver (`nut-ipmipsu`). + +These are needed on Linux systems running `udev` (recommended as of Linux +kernel 2.6.3, and mandatory as of 2.6.14 and higher). + +This script ensures that the right privileges are set on the USB and IPMI +device nodes to allow the NUT driver to operate (i.e. allowing the `nut` +user to read AND write to the hardware device). + +Note that the old style `hotplug` files, available in the `scripts/hotplug` +directory, are not needed anymore if your kernel supports `udev`. + +Installation +------------ + +For most users, these files will be automatically installed in `/etc/udev` +(or `/lib/udev`) upon `make install`, if that directory exists and if the +feature (USB and/or IPMI driver support) has been enabled at `configure` time. + +You can specify an alternate directory with: +---- +:; ./configure --with-udev-dir=DIR +---- + +Manual installation +------------------- + +To install them manually, copy the rules file(s) to `/etc/udev/rules.d` +(or `/lib/udev/rules.d` on newer systems) using the following command(s): +---- +:; cp -f nut-usbups.rules /etc/udev/rules.d/62-nut-usbups.rules +:; cp -f nut-ipmipsu.rules /etc/udev/rules.d/52-nut-ipmipsu.rules +---- + +You will need to refresh the bus to avoid a reboot for these rules to be +active. You can do so using: +---- +:; udevadm trigger --subsystem-match=usb_device +---- + +For USB devices, you can then plug your UPS USB cord, or unplug/re-plug +it to refresh the device permission, and start NUT. diff --git a/scripts/ufw/Makefile.am b/scripts/ufw/Makefile.am index eb6476c94c..24cc6e15bb 100644 --- a/scripts/ufw/Makefile.am +++ b/scripts/ufw/Makefile.am @@ -1,4 +1,10 @@ +# Network UPS Tools: scripts/ufw + EXTRA_DIST = README.adoc nut.ufw.profile.in +# Note: spellchecking is currently ensured by docs/Makefile.am +# due to inclusion into docs/security.txt, and the heading level +# is also dictated by that. + MAINTAINERCLEANFILES = Makefile.in .dirstamp CLEANFILES = *-spellchecked README diff --git a/scripts/upower/95-upower-hid.hwdb b/scripts/upower/95-upower-hid.hwdb index c8e6356607..ba554bde30 100644 --- a/scripts/upower/95-upower-hid.hwdb +++ b/scripts/upower/95-upower-hid.hwdb @@ -38,6 +38,7 @@ usb:v047CpFFFF* # ST Microelectronics usb:v0483pA113* +usb:v0483pA430* UPOWER_BATTERY_TYPE=ups UPOWER_VENDOR=ST Microelectronics diff --git a/scripts/upsdrvsvcctl/Makefile.am b/scripts/upsdrvsvcctl/Makefile.am index 77313cae94..4cb4ad69d2 100644 --- a/scripts/upsdrvsvcctl/Makefile.am +++ b/scripts/upsdrvsvcctl/Makefile.am @@ -1,4 +1,6 @@ -EXTRA_DIST = README +# Network UPS Tools: scripts/upsdrvsvcctl + +EXTRA_DIST = README.adoc if HAVE_SYSTEMD EXTRA_DIST += nut-driver-enumerator.sh upsdrvsvcctl @@ -10,4 +12,28 @@ endif EXTRA_DIST += nut-driver-enumerator.sh.in upsdrvsvcctl.in +SPELLCHECK_SRC = README.adoc + +# NOTE: Due to portability, we do not use a GNU percent-wildcard extension. +# We also have to export some variables that may be tainted by relative +# paths when parsing the other makefile (e.g. MKDIR_P that may be defined +# via expanded $(top_builddir)/install_sh): +#%-spellchecked: % Makefile.am $(top_srcdir)/docs/Makefile.am $(abs_srcdir)/$(NUT_SPELL_DICT) +# +$(MAKE) -s -f $(top_builddir)/docs/Makefile $(AM_MAKEFLAGS) MKDIR_P="$(MKDIR_P)" builddir="$(builddir)" srcdir="$(srcdir)" top_builddir="$(top_builddir)" top_srcdir="$(top_srcdir)" SPELLCHECK_SRC_ONE="$<" SPELLCHECK_SRCDIR="$(srcdir)" SPELLCHECK_BUILDDIR="$(builddir)" $@ + +# NOTE: Portable suffix rules do not allow prerequisites, so we shim them here +# by a wildcard target in case the make implementation can put the two together. +*-spellchecked: Makefile.am $(top_srcdir)/docs/Makefile.am $(abs_srcdir)/$(NUT_SPELL_DICT) + +.sample.sample-spellchecked: + +$(MAKE) -s -f $(top_builddir)/docs/Makefile $(AM_MAKEFLAGS) MKDIR_P="$(MKDIR_P)" builddir="$(builddir)" srcdir="$(srcdir)" top_builddir="$(top_builddir)" top_srcdir="$(top_srcdir)" SPELLCHECK_SRC_ONE="$<" SPELLCHECK_SRCDIR="$(srcdir)" SPELLCHECK_BUILDDIR="$(builddir)" $@ + +.in.in-spellchecked: + +$(MAKE) -s -f $(top_builddir)/docs/Makefile $(AM_MAKEFLAGS) MKDIR_P="$(MKDIR_P)" builddir="$(builddir)" srcdir="$(srcdir)" top_builddir="$(top_builddir)" top_srcdir="$(top_srcdir)" SPELLCHECK_SRC_ONE="$<" SPELLCHECK_SRCDIR="$(srcdir)" SPELLCHECK_BUILDDIR="$(builddir)" $@ + +spellcheck spellcheck-interactive spellcheck-sortdict: + +$(MAKE) -f $(top_builddir)/docs/Makefile $(AM_MAKEFLAGS) MKDIR_P="$(MKDIR_P)" builddir="$(builddir)" srcdir="$(srcdir)" top_builddir="$(top_builddir)" top_srcdir="$(top_srcdir)" SPELLCHECK_SRC="$(SPELLCHECK_SRC)" SPELLCHECK_SRCDIR="$(srcdir)" SPELLCHECK_BUILDDIR="$(builddir)" $@ + +CLEANFILES = *-spellchecked + MAINTAINERCLEANFILES = Makefile.in .dirstamp diff --git a/scripts/upsdrvsvcctl/README b/scripts/upsdrvsvcctl/README deleted file mode 100644 index b2a9db64a8..0000000000 --- a/scripts/upsdrvsvcctl/README +++ /dev/null @@ -1,11 +0,0 @@ -This directory contains the shared NUT support files for Linux systemd (the -System and Service Manager) and Solaris SMF (Service Management Framework). -It includes the nut-driver-enumerator.sh (service and implementation method) -and upsdrvsvcctl (tool) to manage NUT drivers as service instances. - -These files are automatically installed into SBINDIR/upsdrvsvcctl and -LIBEXECDIR/nut-driver-enumerator.sh, upon detection (at configure time) -of a systemd or SMF enabled system, with Makefiles of the ../systemd/ and -../Solaris/ source directories respectively. - -Contributed 2016-2018 by Jim Klimov diff --git a/scripts/upsdrvsvcctl/README.adoc b/scripts/upsdrvsvcctl/README.adoc new file mode 100644 index 0000000000..cd596428ad --- /dev/null +++ b/scripts/upsdrvsvcctl/README.adoc @@ -0,0 +1,16 @@ +Shared resources for NUT service unit integrations +================================================== + +This directory contains the shared NUT support files for Linux systemd (the +System and Service Manager) and Solaris SMF (Service Management Framework). +It includes the `nut-driver-enumerator.sh` (service and implementation method) +and `upsdrvsvcctl` (tool) to manage NUT drivers as service instances. + +These files are automatically installed into `SBINDIR/upsdrvsvcctl` and +`LIBEXECDIR/nut-driver-enumerator.sh`, upon detection (at `configure` time) +of a systemd or SMF enabled system, with Makefiles of the `../systemd/` and +`../Solaris/` source directories respectively. + +Contributed 2016-2018 by Jim Klimov + +Maintained since 2020 by Jim Klimov diff --git a/scripts/upsdrvsvcctl/nut-driver-enumerator.sh.in b/scripts/upsdrvsvcctl/nut-driver-enumerator.sh.in old mode 100755 new mode 100644 index 56a5004c82..7b13dc4eec --- a/scripts/upsdrvsvcctl/nut-driver-enumerator.sh.in +++ b/scripts/upsdrvsvcctl/nut-driver-enumerator.sh.in @@ -1,15 +1,19 @@ #!/bin/sh +# BIG NOTE: Not bash, not any other predetermined shell implementation # # NOTE: This script is intentionally written with portable shell constructs # with the aim and hope to work in different interpreters, so it is a # bit dumber and less efficient than could be achieved with the more -# featured shells in the spectrum. +# featured shells in the spectrum. Also, to minimize the in-memory and +# debug-console traffics, tests for (non-)emptiness of anticipated large +# strings are not done by `test -n/-z`, but by counting the size of the +# string (zero or not). # NOTE ALSO: The configuration parser in this script is not meant to be a # reference or 100% compliant with what the binary code uses; its aim # is to just pick out some strings relevant for tracking config changes. # # Copyright (C) 2016-2020 Eaton -# Copyright (C) 2020-2023 Jim Klimov +# Copyright (C) 2020-2024 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 @@ -188,6 +192,9 @@ hook_listInstances_raw="" hook_validInstanceName="" hook_validFullUnitName="" hook_validInstanceSuffixName="" +hook_getSavedDeviceName="" +hook_findSavedDeviceName="" +hook_setSavedDeviceName="" hook_getSavedMD5="" hook_setSavedMD5="" hook_restart_upsd="" @@ -203,6 +210,9 @@ case "${SERVICE_FRAMEWORK-}" in hook_validInstanceName="smf_validInstanceName" hook_validFullUnitName="smf_validFullUnitName" hook_validInstanceSuffixName="smf_validInstanceSuffixName" + hook_getSavedDeviceName="smf_getSavedDeviceName" + hook_findSavedDeviceName="smf_findSavedDeviceName" + hook_setSavedDeviceName="smf_setSavedDeviceName" hook_getSavedMD5="smf_getSavedMD5" hook_setSavedMD5="smf_setSavedMD5" hook_restart_upsd="smf_restart_upsd" @@ -217,6 +227,9 @@ case "${SERVICE_FRAMEWORK-}" in hook_validInstanceName="systemd_validInstanceName" hook_validFullUnitName="systemd_validFullUnitName" hook_validInstanceSuffixName="systemd_validInstanceSuffixName" + hook_getSavedDeviceName="systemd_getSavedDeviceName" + hook_findSavedDeviceName="systemd_findSavedDeviceName" + hook_setSavedDeviceName="systemd_setSavedDeviceName" hook_getSavedMD5="systemd_getSavedMD5" hook_setSavedMD5="systemd_setSavedMD5" hook_restart_upsd="systemd_restart_upsd" @@ -231,6 +244,9 @@ case "${SERVICE_FRAMEWORK-}" in hook_validInstanceName="selftest_NOOP" hook_validFullUnitName="selftest_NOOP" hook_validInstanceSuffixName="selftest_NOOP" + hook_getSavedDeviceName="selftest_NOOP" + hook_findSavedDeviceName="selftest_NOOP" + hook_setSavedDeviceName="selftest_NOOP" hook_getSavedMD5="selftest_NOOP" hook_setSavedMD5="selftest_NOOP" hook_restart_upsd="selftest_NOOP" @@ -252,7 +268,7 @@ selftest_NOOP() { } common_isFiled() { - [ -n "$UPSLIST_FILE" ] && \ + [ "${#UPSLIST_FILE}" != 0 ] && \ for UPSF in $UPSLIST_FILE ; do [ "$1" = "$UPSF" ] && return 0 [ "`$hook_validInstanceName "$UPSF"`" = "$1" ] && return 0 @@ -261,7 +277,7 @@ common_isFiled() { } common_isRegistered() { - [ -n "$UPSLIST_SVCS" ] && \ + [ "${#UPSLIST_SVCS}" != 0 ] && \ for UPSS in $UPSLIST_SVCS ; do [ "$1" = "$UPSS" ] && return 0 [ "`$hook_validInstanceName "$1"`" = "$UPSS" ] && return 0 @@ -280,8 +296,8 @@ upslist_equals() { # Trivial case 0: one string is empty, another is not # Note: `echo '' | wc -l` == "1" not "0"! - [ -n "$1" -a -z "$2" ] && return 1 - [ -z "$1" -a -n "$2" ] && return 1 + [ "${#1}" != 0 -a "${#2}" = 0 ] && return 1 + [ "${#1}" = 0 -a "${#2}" != 0 ] && return 1 # Trivial case 1: equal strings [ "$1" = "$2" ] && return 0 @@ -290,22 +306,22 @@ upslist_equals() { _TMP_DEV_SVC="" for _DEV in $1 ; do - DEVINST="`$hook_validInstanceName "$_DEV"`" + DEVINST="`$hook_validInstanceName "${_DEV}"`" for _SVC in $2 ; do - [ "$_DEV" = "$_SVC" ] \ - || [ "$DEVINST" = "$_SVC" ] \ - && { [ -z "$_TMP_DEV_SVC" ] \ - && _TMP_DEV_SVC="$_DEV = $_SVC" \ - || _TMP_DEV_SVC="$_TMP_DEV_SVC -$_DEV = $_SVC" ; } + [ "${_DEV}" = "${_SVC}" ] \ + || [ "$DEVINST" = "${_SVC}" ] \ + && { [ "${#_TMP_DEV_SVC}" = 0 ] \ + && _TMP_DEV_SVC="${_DEV} = ${_SVC}" \ + || _TMP_DEV_SVC="${_TMP_DEV_SVC} +${_DEV} = ${_SVC}" ; } done done # Input was not empty; did anything in output fit? - [ -z "$_TMP_DEV_SVC" ] && return 1 + [ "${#_TMP_DEV_SVC}" = 0 ] && return 1 # Exit code : is the built mapping as long as the source list(s)? - [ "`echo "$1" | wc -l`" = "`echo "$_TMP_DEV_SVC" | wc -l`" ] + [ "`echo "$1" | wc -l`" = "`echo "${_TMP_DEV_SVC}" | wc -l`" ] } upssvcconf_checksum_unchanged() { @@ -321,28 +337,72 @@ upslist_checksums_unchanged() { # configuration section from the file and the stashed configuration in # a service instance. Prints a list of mismatching service names that # should get reconfigured. - [ -z "$1" -o -z "$2" ] && return 1 + [ "${#1}" = 0 -o "${#2}" = 0 ] && return 1 _TMP_SVC="" for _DEV in $1 ; do - DEVINST="`$hook_validInstanceName "$_DEV"`" + DEVINST="`$hook_validInstanceName "${_DEV}"`" for _SVC in $2 ; do - if [ "$_DEV" = "$_SVC" ] \ - || [ "$DEVINST" = "$_SVC" ] \ + if [ "${_DEV}" = "${_SVC}" ] \ + || [ "$DEVINST" = "${_SVC}" ] \ ; then - upssvcconf_checksum_unchanged "$_DEV" "$_SVC" || \ - { [ -z "$_TMP_SVC" ] \ - && _TMP_SVC="$_SVC" \ - || _TMP_SVC="$_TMP_SVC -$_SVC" ; } + upssvcconf_checksum_unchanged "${_DEV}" "${_SVC}" || \ + { [ "${#_TMP_SVC}" = 0 ] \ + && _TMP_SVC="${_SVC}" \ + || _TMP_SVC="${_TMP_SVC} +${_SVC}" ; } fi done done - [ -z "$_TMP_SVC" ] && return 0 - echo "$_TMP_SVC" + [ "${#_TMP_SVC}" = 0 ] && return 0 + echo "${_TMP_SVC}" return 1 } +upslist_savednames_find_missing() { + # Verify that all existing service units have a saved DEVICE name + # Report those that do not have a value there (any value) so we can + # amend those quickly after an upgrade. Otherwise we trust these. + + # Get full instance names from system and from props + SVCINSTS="`$hook_listInstances_raw`" && [ "${#SVCINSTS}" != 0 ] || return 1 + # If no props were found, (over)write them all + SVCINST_PROPS="`$hook_findSavedDeviceName`" && [ "${#SVCINST_PROPS}" != 0 ] \ + || { echo $SVCINSTS ; return 2; } + + # Find services which do not have saved names in props + for SVCINST in $SVCINSTS ; do + echo "$SVCINST_PROPS" | grep -E "^${SVCINST_PROPS}\t"'$' >/dev/null || echo "$SVCINST" + done +} + +upslist_savednames_find_mismatch() { + # TODO: Make use of this to fsck the enumerator configs + # + # Verify that all existing service units have a saved DEVICE name + # and that such name does match the unit instance's name (original + # or MD5 normalized version). If something does not match, returns + # the unit name so it can be redefined by caller. This does not + # inspect whether such DEVICE is defined in NUT configuration. + # This situation might occur in some errors, but the likely case + # is updating from versions that did not track this info yet (but + # upslist_savednames_find_missing() should have handled those). + + # Get full instance names from system and from props + SVCINSTS="`$hook_listInstances_raw`" && [ "${#SVCINSTS}" != 0 ] || return 1 + SVCINST_PROPS="`$hook_findSavedDeviceName`" && [ "${#SVCINST_PROPS}" != 0 ] || return 2 + + # Find services whose props exist but services do not + echo "$SVCINST_PROPS" | while read SVCINST_PROP DEVNAME_PROP ; do + echo "$SVCINSTS" | grep -E "^${SVCINST_PROP}"'$' >/dev/null || echo "$SVCINST_PROP" + done + + # Find services which do not have saved names in props + for SVCINST in $SVCINSTS ; do + echo "$SVCINST_PROPS" | grep -E "^${SVCINST_PROP}\t"'$' >/dev/null || echo "$SVCINST" + done +} + upsconf_getSection_content() { # "$1" = name of ups.conf section to display in whole, from whatever # comes on stdin (file or a pre-made normalized variable) @@ -387,16 +447,16 @@ upsconf_getSection_content() { *) ;; # Fall through to add the line to contents of existing section esac if [ "$CURR_SECTION" = "$1" ]; then - if [ -n "$SECTION_CONTENT" ]; then + if [ "${#SECTION_CONTENT}" = 0 ]; then + SECTION_CONTENT="$LINE" + else SECTION_CONTENT="$SECTION_CONTENT $LINE" - else - SECTION_CONTENT="$LINE" fi fi done - if [ -n "$SECTION_CONTENT" ]; then + if [ "${#SECTION_CONTENT}" != 0 ]; then echo "$SECTION_CONTENT" fi @@ -406,7 +466,9 @@ $LINE" upsconf_getSection() { # Use the whole output of normalization parser - upslist_normalizeFile_once || return # Propagate errors upwards + if [ x"${AVOID_REPARSE}" != xyes ] ; then + upslist_normalizeFile_once || return # Propagate errors upwards + fi upsconf_getSection_content "$@" << EOF ${UPSCONF_DATA} EOF @@ -418,7 +480,9 @@ upsconf_getSection_MD5() { upsconf_getSection_SDP() { # Use the section-driver-port subset - upslist_normalizeFile_once || return # Propagate errors upwards + if [ x"${AVOID_REPARSE}" != xyes ] ; then + upslist_normalizeFile_once || return # Propagate errors upwards + fi upsconf_getSection_content "$@" << EOF ${UPSCONF_DATA_SDP} EOF @@ -444,7 +508,7 @@ upsconf_getValue() { VALUE="" LINE="`echo "$SECTION_CONTENT" | grep -E '(^'"$1"'=|^'"$1"'$)'`" \ - && VALUE="$(echo "$LINE" | sed -e "s,^$1=,," -e 's,^\"\(.*\)\"$,\1,' -e "s,^'\(.*\)'$,\1,")" \ + && VALUE="$(echo "$LINE" | sed -e "s,^$1=,," -e 's,^\"\(.*\)\"$,\1,' -e "s,^'\(.*\)'\$,\1,")" \ || RES_L=$? [ "$RES_L" = 0 ] || { RES="$RES_L" ; echo "ERROR: Section [$CURR_SECTION] or key '$1' in it was not found in the '$UPSCONF' file" >&2 ; } @@ -555,7 +619,7 @@ upsconf_getDriverMedia() { upsconf_getMedia() { _DRVMED="`upsconf_getDriverMedia "$1"`" || return - echo "$_DRVMED" | tail -n +2 + echo "${_DRVMED}" | tail -n +2 return 0 } @@ -565,27 +629,27 @@ upsconf_debug() { _MED="`upsconf_getMedia "$1"`" _MD5="`upsconf_getSection_MD5 "$1"`" NAME_MD5="`calc_md5 "$1"`" - echo "INST: ${NAME_MD5}~[$1]: DRV='$_DRV' PORT='$_PRT' MEDIA='$_MED' SECTIONMD5='$_MD5'" + echo "INST: ${NAME_MD5}~[$1]: DRV='${_DRV}' PORT='${_PRT}' MEDIA='${_MED}' SECTIONMD5='${_MD5}'" } calc_md5() { # Tries several ways to produce an MD5 of the "$1" argument - _MD5="`echo "$1" | md5sum 2>/dev/null | awk '{print $1}'`" && [ -n "$_MD5" ] || \ - { _MD5="`echo "$1" | openssl dgst -md5 2>/dev/null | awk '{print $NF}'`" && [ -n "$_MD5" ]; } || \ + _MD5="`echo "$1" | md5sum 2>/dev/null | awk '{print $1}'`" && [ -n "${_MD5}" ] || \ + { _MD5="`echo "$1" | openssl dgst -md5 2>/dev/null | awk '{print $NF}'`" && [ -n "${_MD5}" ]; } || \ return 1 - echo "$_MD5" + echo "${_MD5}" } calc_md5_file() { # Tries several ways to produce an MD5 of the file named by "$1" argument [ -s "$1" ] || return 2 - _MD5="`md5sum 2>/dev/null < "$1" | awk '{print $1}'`" && [ -n "$_MD5" ] || \ - { _MD5="`openssl dgst -md5 2>/dev/null < "$1" | awk '{print $NF}'`" && [ -n "$_MD5" ]; } || \ + _MD5="`md5sum 2>/dev/null < "$1" | awk '{print $1}'`" && [ -n "${_MD5}" ] || \ + { _MD5="`openssl dgst -md5 2>/dev/null < "$1" | awk '{print $NF}'`" && [ -n "${_MD5}" ]; } || \ return 1 - echo "$_MD5" + echo "${_MD5}" } smf_validFullUnitName() { @@ -606,15 +670,21 @@ smf_validInstanceSuffixName() { smf_registerInstance() { DEVICE="$1" SVCINST="$1" + if /usr/bin/svcs "nut-driver:$SVCINST" >/dev/null 2>&1 ; then + smf_unregisterInstance "$SVCINST" + fi /usr/sbin/svccfg -s nut-driver add "$DEVICE" || \ - { SVCINST="`smf_validInstanceName "$1"`" && \ + { SVCINST="`smf_validInstanceName "$1"`" || return + if /usr/bin/svcs "nut-driver:$SVCINST" >/dev/null 2>&1 ; then + smf_unregisterInstance "$SVCINST" + fi /usr/sbin/svccfg -s nut-driver add "$SVCINST" || return ; } echo "Added instance: 'nut-driver:$SVCINST' for NUT configuration section '$DEVICE'" >&2 DEPSVC="" DEPREQ="" _MED="`upsconf_getMedia "$DEVICE"`" - case "$_MED" in + case "${_MED}" in usb) DEPSVC="$DEPSVC_USB_SMF" DEPREQ="$DEPREQ_USB_SMF" ;; @@ -626,7 +696,7 @@ smf_registerInstance() { DEPREQ="$DEPREQ_NET_FULL_SMF" ;; serial) ;; '') ;; - *) echo "WARNING: Unexpected NUT media type ignored: '$_MED'" >&2 ;; + *) echo "WARNING: Unexpected NUT media type ignored: '${_MED}'" >&2 ;; esac TARGET_FMRI="nut-driver:$SVCINST" @@ -645,6 +715,8 @@ smf_registerInstance() { fi smf_setSavedMD5 "$SVCINST" "`upsconf_getSection_MD5 "$DEVICE"`" + # Save original device (config section) name to speed up some searches + smf_setSavedDeviceName "$SVCINST" "$DEVICE" /usr/sbin/svcadm refresh "${TARGET_FMRI}" || return if [ "$AUTO_START" = yes ] ; then @@ -666,7 +738,8 @@ smf_listInstances_raw() { /usr/bin/svcs -a -H -o fmri | grep -E '/nut-driver:' } smf_listInstances() { - smf_listInstances_raw | sed 's/^.*://' | sort -n + # Chop twice, in case there is a leading "svc:/...." + smf_listInstances_raw | sed -e 's/^.*://' -e 's/^.*://' | sort -n } smf_getSavedMD5() { # Query service instance $1 @@ -682,26 +755,81 @@ smf_getSavedMD5() { fi # Note: lookups for GLOBAL cause each service instance to show up - /usr/bin/svcprop -p "$PG/$PROP" "$TARGET_FMRI" | head -1 | awk '{print $NF}' + /usr/bin/svcprop -p "$PG/$PROP" "$TARGET_FMRI" 2>/dev/null | head -1 | awk '{print $NF}' } -smf_setSavedMD5() { - # Save checksum value $2 into service instance $1 - PG="nut-driver-enumerator-generated-checksum" - PROP="SECTION_CHECKSUM" +smf_findSavedDeviceName() { + # Returns long service FMRI which has DEVICE=="$1" + # For empty "$1" returns a list of all recorded "FMRIDEVICE" + if [ -z "$1" ]; then + /usr/bin/svcprop -p "nut-driver-enumerator-generated-devicename/DEVICE" \ + 'svc:/system/power/nut-driver:*' 2>/dev/null \ + | sed 's|^\(svc:/[^:]*:[^/:]*\)/:properties/nut-driver-enumerator-generated-devicename/DEVICE astring \(.*\)$|\1\t\2|' + else + /usr/bin/svcprop -p "nut-driver-enumerator-generated-devicename/DEVICE" \ + "svc:/system/power/nut-driver:$1" 2>/dev/null \ + | sed 's|^\(svc:/[^:]*:[^/:]*\)/:prop.*$|\1|' + fi +} +smf_getSavedDeviceName() { + # Query service instance $1 + PG="nut-driver-enumerator-generated-devicename" + PROP="DEVICE" if [ -n "$1" ]; then TARGET_FMRI="nut-driver:$1" else # Global section - TARGET_FMRI="nut-driver" - PROP="SECTION_CHECKSUM_GLOBAL" + echo "" + return 0 fi - /usr/sbin/svccfg -s "$TARGET_FMRI" delprop "$PG" || true - /usr/sbin/svccfg -s "$TARGET_FMRI" addpg "$PG" application && \ - /usr/sbin/svccfg -s "$TARGET_FMRI" setprop "$PG/$PROP" = astring: "$2" - [ $? = 0 ] && echo "OK" || { echo "FAILED to stash the checksum">&2 ; return 1 ; } - /usr/sbin/svcadm refresh "${TARGET_FMRI}" || return + # Note: lookups for GLOBAL cause each service instance to show up + /usr/bin/svcprop -p "$PG/$PROP" "$TARGET_FMRI" 2>/dev/null | head -1 | awk '{print $NF}' +} +smf_setSavedUniq() { + # Save data value $5 of type $4 into service FMRI $1 + # under (scrapped and) newly created property group $2 + # and property name $3 + __TARGET_FMRI="$1" + __PG="$2" + __PROP="$3" + __TYPE="$4" + case "${__TYPE}" in + *:) ;; + *) __TYPE="${__TYPE}:" ;; + esac + __VAL="$5" + /usr/sbin/svccfg -s "${__TARGET_FMRI}" delprop "${__PG}" 2>/dev/null || true + /usr/sbin/svccfg -s "${__TARGET_FMRI}" addpg "${__PG}" application && \ + /usr/sbin/svccfg -s "${__TARGET_FMRI}" setprop "${__PG}/${__PROP}" = "${__TYPE}" "${__VAL}" + [ $? = 0 ] && echo "OK" || { echo "FAILED to stash the service property ${__PG}/${__PROP}">&2 ; return 1 ; } + + case "${__TARGET_FMRI}" in + svc:/*:*) ;; # A service instance by full FMRI, refresh + svc:/*/nut-driver|nut-driver) return 0 ;; # A base non-instance service item for nut-driver (known multi-instance only) + svc:/*) ;; # A base non-instance service item (not nut-driver) + *:*) ;; # A service instance by short FMRI, refresh + *) ;; # A base non-instance service item (not nut-driver) + esac + /usr/sbin/svcadm refresh "${__TARGET_FMRI}" || return +} +smf_setSavedMD5() { + # Save checksum value $2 into service instance $1 + _PG="nut-driver-enumerator-generated-checksum" + _PROP="SECTION_CHECKSUM" + + if [ -n "$1" ]; then + _TARGET_FMRI="nut-driver:$1" + else + # Global section + _TARGET_FMRI="nut-driver" + _PROP="SECTION_CHECKSUM_GLOBAL" + fi + smf_setSavedUniq "${_TARGET_FMRI}" "${_PG}" "${_PROP}" astring "$2" +} +smf_setSavedDeviceName() { + [ -n "$1" ] || return # No-op for global section + smf_setSavedUniq "nut-driver:$1" "nut-driver-enumerator-generated-devicename" "DEVICE" astring "$2" } smf_restart_upsd() { echo "Reloading or restarting NUT data server to make sure it knows new configuration..." @@ -743,7 +871,7 @@ systemd_registerInstance() { DEPSVC="" DEPREQ="" _MED="`upsconf_getMedia "$DEVICE"`" - case "$_MED" in + case "${_MED}" in usb) DEPSVC="$DEPSVC_USB_SYSTEMD" DEPREQ="$DEPREQ_USB_SYSTEMD" ;; @@ -755,7 +883,7 @@ systemd_registerInstance() { DEPREQ="$DEPREQ_NET_FULL_SYSTEMD" ;; serial) ;; '') ;; - *) echo "WARNING: Unexpected NUT media type ignored: '$_MED'" >&2 ;; + *) echo "WARNING: Unexpected NUT media type ignored: '${_MED}'" >&2 ;; esac if [ -n "$DEPSVC" ]; then [ -n "$DEPREQ" ] || DEPREQ="#Wants" @@ -773,6 +901,7 @@ EOF fi systemd_setSavedMD5 "$SVCINST" "`upsconf_getSection_MD5 "$DEVICE"`" + systemd_setSavedDeviceName "$SVCINST" "$DEVICE" if [ "$AUTO_START" = yes ] ; then systemd_refreshSupervizor || echo "WARNING: Somehow managed to fail systemd_refreshSupervizor()" >&2 @@ -803,16 +932,53 @@ systemd_getSavedMD5() { # Query service instance $1 or global section PROP="SECTION_CHECKSUM" [ -n "$1" ] || PROP="SECTION_CHECKSUM_GLOBAL" - [ -s "${SYSTEMD_CONFPATH}/nut-driver@$1.service.d/nut-driver-enumerator-generated-checksum.conf" ] \ - && grep "Environment='$PROP=" "${SYSTEMD_CONFPATH}/nut-driver@$1.service.d/nut-driver-enumerator-generated-checksum.conf" | sed -e "s,^Environment='$PROP=,," -e "s,'\$,," \ - || { echo "Did not find '${SYSTEMD_CONFPATH}/nut-driver@$1.service.d/nut-driver-enumerator-generated-checksum.conf' with a $PROP" ; return 1; } + PROPFILE="${SYSTEMD_CONFPATH}/nut-driver@$1.service.d/nut-driver-enumerator-generated-checksum.conf" + [ -s "${PROPFILE}" ] \ + && grep "Environment='$PROP=" "${PROPFILE}" | sed -e "s,^Environment='$PROP=,," -e "s,'\$,," \ + || { echo "Did not find '${PROPFILE}' with a $PROP" ; return 1; } +} +systemd_findSavedDeviceName() { + # Returns long service instance name which has DEVICE=="$1" + # For empty "$1" returns a list of all recorded "SVCDEVICE" + if [ -z "$1" ]; then + grep -H "Environment='DEVICE=" \ + "${SYSTEMD_CONFPATH}"/nut-driver@*.service.d/nut-driver-enumerator-generated-devicename.conf \ + | sed 's|^'"${SYSTEMD_CONFPATH}"'/\(nut-driver@[^/]*\.service\)\.d/.*DEVICE='"[\"']*\([^\"']*\)[\"']*"'$|\1\t\2|' + else + grep -E -H "Environment='DEVICE=($1|\"$1\")'" \ + "${SYSTEMD_CONFPATH}"/nut-driver@*.service.d/nut-driver-enumerator-generated-devicename.conf \ + | sed 's|^'"${SYSTEMD_CONFPATH}"'/\(nut-driver@[^/]*\.service\)\.d/.*$|\1|' + fi +} +systemd_getSavedDeviceName() { + # Query service instance "$1" (quiet NO-OP if empty, for mis-use + # in global sections context) to get the unquoted saved DEVICE + # section name corresponding to this service instance + [ -n "$1" ] || { echo ""; return 0; } + PROP="DEVICE" + PROPFILE="${SYSTEMD_CONFPATH}/nut-driver@$1.service.d/nut-driver-enumerator-generated-devicename.conf" + [ -s "${PROPFILE}" ] \ + && grep "Environment='$PROP=" "${PROPFILE}" | sed -e "s,^Environment='$PROP=,," -e "s,'\$,," -e 's,^"\(.*\)"$,\1,' \ + || { echo "Did not find '${PROPFILE}' with a $PROP" ; return 1; } +} +systemd_setSavedDeviceName() { + # Save device (config section) name $2 into service instance $1 + [ -n "$1" ] || return # No-op for global section + PROPFILE="${SYSTEMD_CONFPATH}/nut-driver@$1.service.d/nut-driver-enumerator-generated-devicename.conf" + mkdir -p "${SYSTEMD_CONFPATH}/nut-driver@$1.service.d" && \ + cat > "${PROPFILE}" << EOF +[Service] +Environment='DEVICE="$2"' +EOF + [ $? = 0 ] && echo "OK" || { echo "FAILED to stash the device name">&2 ; return 1 ; } } systemd_setSavedMD5() { # Save checksum value $2 into service instance $1 PROP="SECTION_CHECKSUM" [ -n "$1" ] || PROP="SECTION_CHECKSUM_GLOBAL" + PROPFILE="${SYSTEMD_CONFPATH}/nut-driver@$1.service.d/nut-driver-enumerator-generated-checksum.conf" mkdir -p "${SYSTEMD_CONFPATH}/nut-driver@$1.service.d" && \ - cat > "${SYSTEMD_CONFPATH}/nut-driver@$1.service.d/nut-driver-enumerator-generated-checksum.conf" << EOF + cat > "${PROPFILE}" << EOF [Service] Environment='$PROP=$2' EOF @@ -899,7 +1065,7 @@ upslist_normalizeFile() { # Also use a SDP subset with just section, driver and port info # for faster parsing when determining driver-required media etc. UPSCONF_DATA="$(upslist_normalizeFile_filter < "$UPSCONF")" \ - && [ -n "$UPSCONF_DATA" ] \ + && [ "${#UPSCONF_DATA}" != 0 ] \ && UPSCONF_DATA_SDP="`grep -E '^(\[.*\]|driver=|port=)' << EOF $UPSCONF_DATA EOF`" \ @@ -913,7 +1079,7 @@ upslist_normalizeFile_once() { # Wrapper that ensures that the parsing is only done once # (will re-parse if there were no devices listed on the # first time, though) - [ -z "$UPSCONF_DATA" ] && [ -z "$UPSCONF_DATA_SDP" ] || return 0 + [ "${#UPSCONF_DATA}" = 0 ] && [ "${#UPSCONF_DATA_SDP}" = 0 ] || return 0 upslist_normalizeFile } @@ -929,11 +1095,11 @@ upslist_readFile() { upslist_normalizeFile || return # Propagate errors upwards fi - if [ -n "$UPSCONF_DATA" ] ; then + if [ "${#UPSCONF_DATA}" != 0 ] ; then # Note that section-name brackets should contain a single token UPSLIST_FILE="$(echo "$UPSCONF_DATA_SDP" | grep -E '^\[[^'"$TABCHAR"'\ ]*\]$' | sed 's,^\[\(.*\)\]$,\1,' | sort -n)" \ || UPSLIST_FILE="" - if [ -z "$UPSLIST_FILE" ] ; then + if [ "${#UPSLIST_FILE}" = 0 ] ; then echo "Error reading the '$UPSCONF' file or it does not declare any device configurations: no section declarations in parsed normalized contents" >&2 fi fi @@ -944,13 +1110,13 @@ upslist_readFile_once() { # Wrapper that ensures that the parsing is only done once # (will re-parse if there were no devices listed on the # first time, though) - [ -z "$UPSLIST_FILE" ] || return 0 + [ "${#UPSLIST_FILE}" = 0 ] || return 0 DO_NORMALIZE_ONCE=yes upslist_readFile } upslist_readSvcs() { UPSLIST_SVCS="`$hook_listInstances`" || UPSLIST_SVCS="" - if [ -z "$UPSLIST_SVCS" ] && [ "$1" != "-" ] ; then + if [ "${#UPSLIST_SVCS}" = 0 ] && [ "$1" != "-" ] ; then EXPLAIN="" [ -z "$1" ] || EXPLAIN=" - $1" echo "Error reading the list of ${SERVICE_FRAMEWORK-} service instances for UPS drivers, or none are defined${EXPLAIN}" >&2 @@ -995,8 +1161,31 @@ upslist_restartSvcs() { done } +# FIXME : process via kill -l? +# Different shells use a SIG prefix or not to signal names +# so standard numbers are in fact more portable :\ +TERMINATION_SIGNALS="2 3 15" +RECONFIGURATION_SIGNALS="1" + +TERMINATE_ASAP=false +trap_handle_interruption_exit() { + # Handle SIGINT, SIGQUIT, SIGTERM with a message + echo "`date -u` : Received an interruption signal, terminating the script now" >&2 + exit 0 +} + +trap_handle_interruption() { + # Handle SIGINT, SIGQUIT, SIGTERM gracefully - tell the main + # iteration to complete and just then abort + echo "`date -u` : Received an interruption signal, will terminate the script after ending the main routine. Repeat the signal if urgent!" >&2 + TERMINATE_ASAP=true + trap 'trap_handle_interruption_exit' $TERMINATION_SIGNALS +} + nut_driver_enumerator_main() { ################# MAIN PROGRAM by default + TERMINATE_ASAP=false + trap 'trap_handle_interruption' $TERMINATION_SIGNALS # Note: do not use the read..._once() here, to ensure that the # looped daemon sees the whole picture, which can be new every time @@ -1005,11 +1194,15 @@ nut_driver_enumerator_main() { upslist_readSvcs "before manipulations" # Test if global config has changed since last run + # Note that we have upslist_normalizeFile called from upslist_readFile + # just above, so even if it came empty (e.g. new NUT installation, no + # device sections yet) we do not want to spend time and log storage to + # parse again and complain again. RESTART_ALL=no - upssvcconf_checksum_unchanged "" || { echo "`date -u` : Detected changes in global section of '$UPSCONF', will restart all drivers"; RESTART_ALL=yes; } + AVOID_REPARSE=yes upssvcconf_checksum_unchanged "" || { echo "`date -u` : Detected changes in global section of '$UPSCONF', will restart all drivers"; RESTART_ALL=yes; } - # Quickly exit if there's nothing to do; note the lists are pre-sorted - # Otherwise a non-zero exit will be done below + # Quickly exit if there's nothing to do (both lists empty or equal); note + # the lists are pre-sorted. Otherwise a non-zero exit will be done below. # Note: We implement testing in detail whether section definitions were # changed since last run, as a first step before checking that name # lists are still equivalent, because we need to always have the result @@ -1017,15 +1210,17 @@ nut_driver_enumerator_main() { # while the check for no new device section definitions is just boolean. # We can only exit quickly if both there are no changed sections and no # new or removed sections since last run. - NEW_CHECKSUM="`upslist_checksums_unchanged "$UPSLIST_FILE" "$UPSLIST_SVCS"`" \ - && [ -z "$NEW_CHECKSUM" ] \ - && upslist_equals "$UPSLIST_FILE" "$UPSLIST_SVCS" \ + ( [ -z "$UPSLIST_FILE" -a -z "$UPSLIST_SVCS" ] || ( \ + NEW_CHECKSUM="`upslist_checksums_unchanged "$UPSLIST_FILE" "$UPSLIST_SVCS"`" \ + && [ "${#NEW_CHECKSUM}" = 0 ] \ + && upslist_equals "$UPSLIST_FILE" "$UPSLIST_SVCS" \ + ) ) \ && if [ -z "$DAEMON_SLEEP" -o "${VERBOSE_LOOP}" = yes ] ; then \ echo "`date -u` : OK: No changes to reconcile between ${SERVICE_FRAMEWORK} service instances and device configurations in '$UPSCONF'" ; \ fi \ && [ "$RESTART_ALL" = no ] && return 0 - if [ -n "$NEW_CHECKSUM" ]; then + if [ "${#NEW_CHECKSUM}" != 0 ]; then for UPSS in $NEW_CHECKSUM ; do CURR_DRV="`upsconf_getDriver "$UPSS"`" || CURR_DRV="" DO_UNREGISTER=yes @@ -1046,7 +1241,7 @@ nut_driver_enumerator_main() { upslist_readSvcs "after updating for new config section checksums" fi - if [ -n "$UPSLIST_SVCS" ]; then + if [ "${#UPSLIST_SVCS}" != 0 ]; then # Drop services that are not in config file (any more?) upslist_delSvcs @@ -1062,7 +1257,7 @@ nut_driver_enumerator_main() { $hook_setSavedMD5 "" "`upsconf_getSection_MD5 ""`" fi - if [ -n "$UPSLIST_FILE" ]; then + if [ "${#UPSLIST_FILE}" != 0 ]; then # Add services for sections that are in config file but not yet wrapped upslist_addSvcs $hook_refreshSupervizor @@ -1070,12 +1265,12 @@ nut_driver_enumerator_main() { fi upslist_readSvcs - if [ -n "$UPSLIST_SVCS" ] ; then + if [ "${#UPSLIST_SVCS}" != 0 ] ; then echo "=== The currently defined service instances are:" echo "$UPSLIST_SVCS" fi - if [ -n "$UPSLIST_FILE" ] ; then + if [ "${#UPSLIST_FILE}" != 0 ] ; then echo "=== The currently defined configurations in '$UPSCONF' are:" echo "$UPSLIST_FILE" fi @@ -1116,12 +1311,274 @@ nut_driver_enumerator_main() { return 13 } -daemonize() ( +nut_driver_enumerator_full_reconfigure() { + # Similar to the main routine for reconciling data, + # but this one removes all service instances and + # defines current mappings from scratch after that + upslist_readFile_once || return $? + upslist_readSvcs "before manipulations" + + if [ "${#UPSLIST_SVCS}" != 0 ]; then + for UPSS in $UPSLIST_SVCS ; do + echo "Dropping old ${SERVICE_FRAMEWORK} service instance for power device [${UPSS}] to reconfigure the service unit..." >&2 + $hook_unregisterInstance "$UPSS" + done + upslist_readSvcs "after dropping" + fi + if [ "${#UPSLIST_FILE}" != 0 ]; then + upslist_addSvcs + upslist_readSvcs "after checking for new config sections to define service instances" + fi + + # Save new checksum of global config + $hook_setSavedMD5 "" "`upsconf_getSection_MD5 ""`" + + # Service units were manipulated, including saving of checksums; + # refresh the service management daemon if needed + $hook_refreshSupervizor + + if [ "${#UPSLIST_SVCS}" != 0 ] ; then + echo "=== The currently defined service instances are:" + echo "$UPSLIST_SVCS" + fi + + if [ "${#UPSLIST_FILE}" != 0 ] ; then + echo "=== The currently defined configurations in '$UPSCONF' are:" + echo "$UPSLIST_FILE" + fi + + # We had some changes to the config file; upsd must be made aware + if [ "$AUTO_START" = yes ] ; then + $hook_restart_upsd + fi + + # Return 42 if there was a change applied succesfully + # (but e.g. some services should restart - upsd, maybe upsmon) + UPSLIST_EQ_RES=0 + upslist_equals "$UPSLIST_FILE" "$UPSLIST_SVCS" || UPSLIST_EQ_RES=$? + + # File processing and service startups take a while; + # make sure upsconf did not change while we worked... + # NOTE: Check this at the last moment to minimize + # the chance of still not noticing the change made + # at just the wrong moment. + UPSCONF_CHECKSUM_END="`calc_md5_file "$UPSCONF"`" || true + if [ "$UPSCONF_CHECKSUM_END" != "$UPSCONF_CHECKSUM_START" ] ; then + echo "`date -u` : '$UPSCONF' changed while $0 $* was processing its older contents; re-running the script to pick up and reconcile the late-coming changes" + nut_driver_enumerator_main ; return $? + # The "main" routine will do REPORT_RESTART_42 logic too + fi + + if [ "$UPSLIST_EQ_RES" = 0 ] ; then + echo "`date -u` : OK: No more changes to reconcile between ${SERVICE_FRAMEWORK} service instances and device configurations in '$UPSCONF'" + [ "${REPORT_RESTART_42-}" = no ] && return 0 || return 42 + fi + + return 13 +} + +list_services_for_devices() { + FINAL_RES=0 + upslist_readFile_once && [ "${#UPSLIST_FILE}" != 0 ] \ + || { echo "No devices detected in '$UPSCONF'" >&2 ; return 1 ; } + upslist_readSvcs "by user request" && [ "${#UPSLIST_SVCS}" != 0 ] \ + || { echo "No service instances detected" >&2 ; return 1; } + UPSLIST_SVCS_RAW="`$hook_listInstances_raw`" && [ "${#UPSLIST_SVCS_RAW}" != 0 ] \ + || { echo "No service units detected" >&2 ; return 1; } + for DEV in $UPSLIST_FILE ; do + vINST="`$hook_validInstanceName "$DEV"`" + vUNITD="`$hook_validFullUnitName "$DEV"`" + vUNITI="`$hook_validFullUnitName "$vINST"`" + # First pass over simple verbatim names + for INST in $UPSLIST_SVCS ; do + if [ "$INST" = "$DEV" ] ; then + for UNIT in $UPSLIST_SVCS_RAW ; do + if [ "$UNIT" = "$vUNITD" ] ; then + printf '%s\t%s\n' "$UNIT" "$DEV" + continue 3 + fi + done + fi + done + for INST in $UPSLIST_SVCS ; do + if [ "$INST" = "$vINST" ] ; then + for UNIT in $UPSLIST_SVCS_RAW ; do + if [ "$UNIT" = "$vUNITI" ] ; then + printf '%s\t%s\n' "$UNIT" "$DEV" + continue 3 + fi + done + fi + done + echo "WARNING: no service instances detected that match device '$DEV'" >&2 + FINAL_RES=1 + done + return $FINAL_RES +} + +SVCS_DEVS_LIST="" +list_services_for_devices_once() { + # On first call, caches the system reponse + # On next calls returns what it got earlier + # Does not return any text, just the exit code + # (0 = data avail, even if empty, in SVCS_DEVS_LIST) + [ "${#SVCS_DEVS_LIST}" != 0 ] && return + + # Pre-cache config file data, if nobody read it yet, + # and keep in main script context for reuse (no subshell) + upslist_readFile_once && \ + SVCS_DEVS_LIST="`list_services_for_devices "$@"`" || return $? +} + +get_device_for_service() { + [ -z "$1" ] && echo "Service (instance) name argument required" >&2 && return 1 + + # Instance name can be a hash or "native" NUT section name + SVC="`$hook_validInstanceSuffixName "$1"`" && [ -n "$SVC" ] \ + || { echo "Error getting SVC name from the inputs" >&2 ; return 1; } + + # Reading the config is too expensive to do for every + # driver management attempt when there are many devices + if [ "${USE_SAVEDINST-}" != false ]; then + # Try to use last-stashed values from service properties first + # (NOTE: saved value is assumed to be valid if present) + SAVEDINST="`$hook_getSavedDeviceName "$SVC"`" || SAVEDINST="" + [ "${#SAVEDINST}" = 0 ] || { echo "$SAVEDINST" ; return 0 ; } + fi + + case "$SVC" in + MD5_*) ;; # fall through to the bulk of code + *) upslist_readFile_once || return $? + echo "$UPSLIST_FILE" | grep -E "^$SVC\$" + return $? + ;; + esac + + # Inspect SVC=MD5_* usecase + FINAL_RES=0 + list_services_for_devices_once && [ "${#SVCS_DEVS_LIST}" != 0 ] || FINAL_RES=$? + if [ "$FINAL_RES" = 0 ]; then + echo "$SVCS_DEVS_LIST" | grep "$SVC" | ( \ + while read _SVC _DEV ; do + _SVC="`$hook_validInstanceSuffixName "${_SVC}"`" || exit + [ "${_SVC}" = "${SVC}" ] && echo "${_DEV}" && exit 0 + done ; exit 1 ) && return 0 + fi + echo "No service instance '$1' was detected that matches a NUT device" >&2 + return 1 +} + +get_service_for_device() { + DEV="$1" + [ -z "$DEV" ] && echo "Device name argument required" >&2 && return 1 + + # Cheap check in service instance metadata, if saved + # (NOTE: saved value is assumed to be valid if present) + if [ "${USE_SAVEDSVC-}" != false ]; then + SAVEDSVC="`$hook_findSavedDeviceName "$DEV"`" || SAVEDSVC="" + [ "${#SAVEDSVC}" = 0 ] || { echo "$SAVEDSVC" ; return 0 ; } + fi + + # Trawl all the data we have... + # TODO: Reorder to avoid extra parsing if we have an early hit? + upslist_readSvcs "by user request" && [ "${#UPSLIST_SVCS}" != 0 ] \ + || { echo "No service instances detected" >&2 ; return 1; } + UPSLIST_SVCS_RAW="`$hook_listInstances_raw`" && [ "${#UPSLIST_SVCS_RAW}" != 0 ] \ + || { echo "No service units detected" >&2 ; return 1; } + vINST="`$hook_validInstanceName "$DEV"`" + vUNITD="`$hook_validFullUnitName "$DEV"`" + vUNITI="`$hook_validFullUnitName "$vINST"`" + + # First pass over simple verbatim names + for INST in $UPSLIST_SVCS ; do + if [ "$INST" = "$DEV" ] ; then + for UNIT in $UPSLIST_SVCS_RAW ; do + if [ "$UNIT" = "$vUNITD" ] ; then + echo "$UNIT" + return 0 + fi + done + fi + done + # Second pass over other options + for INST in $UPSLIST_SVCS ; do + if [ "$INST" = "$vINST" ] ; then + for UNIT in $UPSLIST_SVCS_RAW ; do + if [ "$UNIT" = "$vUNITI" ] ; then + echo "$UNIT" + return 0 + fi + done + fi + done + echo "No service instances detected that match device '$DEV'" >&2 + return 1 +} + +update_upslist_savednames_find_missing() { + # Runs once in production modes that inspect and reconcile + # configs, to handle upgraded NUT deployments + SVCINSTS_NO_DEVICE="`upslist_savednames_find_missing`" || \ + case "$?" in + 1) return 0 ;; # No services defined yet + 2) ;; # All service units do not have DEVICE values + esac + # Something found... or not? Or all is populated? + [ "${#SVCINSTS_NO_DEVICE}" != 0 ] || return 0 + + # Make a list of what devices are known in config matched + # to service instances defined in the system, if any + # Note to not check the service instance properties which + # we are validating and currently to not quite trust. + USE_SAVEDINST=false list_services_for_devices_once \ + && [ "${#SVCS_DEVS_LIST}" != 0 ] || return 0 + + # Go over services with no device value saved into properties, + # and write the values learned from mapping above + _MISSING_RES=0 + for SVCINST in $SVCINSTS_NO_DEVICE ; do + _DEV="`printf '%s\n' "$SVCS_DEVS_LIST" | awk '( \$1 == "'"${SVCINST}"'" ) {print \$NF}'`" + echo "Service instance '$SVCINST' did not have a device recorded into properties, setting to '${_DEV}'" + [ -n "${_DEV}" ] || { echo "The device name value for '$SVCINST' is empty, skipping" >&2 ; _MISSING_RES=1 ; continue ; } + $hook_setSavedDeviceName "`$hook_validInstanceSuffixName "$SVCINST"`" "${_DEV}" || _MISSING_RES=$? + done + return ${_MISSING_RES} +} + +RECONFIGURE_ASAP=false +trap_handle_hup_main() { + echo "`date -u` : Received a HUP during processing, scheduling reconfiguration to repeat ASAP (after the current iteration is done)" >&2 + # Note: in the worst case the reconfig would run twice; + # we do not update UPSCONF_CHECKSUM_START in this case + # to avoid corrupting decisions of the currently running + # processing. + RECONFIGURE_ASAP=true +} + +trap_handle_hup_sleep() { + echo "`date -u` : Received a HUP in my sleep, reprocessing configs right now!" >&2 + # Avoid re-parsing main twice, though don't recalculate + # checksums needlessly on every loop cycle, either... + UPSCONF_CHECKSUM_START="`calc_md5_file "$UPSCONF"`" || true + RECONFIGURE_ASAP=true + if [ -n "$1" ] ; then + # Kill the sleeper PID + kill "$1" + fi +} + +daemonize() { + # Note: do not further sub-shell this routine, so systemd + # is not confused whom to signal. + echo "`date -u` : Daemonizing $0 with config re-evaluation frequency $DAEMON_SLEEP" >&2 + # Support (SIG)HUP == signal code 1 to quickly reconfigure, # e.g. to request it while the sleep is happening or while # "main" is processing an earlier change of the file. RECONFIGURE_ASAP=false - trap 'RECONFIGURE_ASAP=true' 1 + trap 'trap_handle_hup_main' $RECONFIGURATION_SIGNALS + + update_upslist_savednames_find_missing # Note: this loop would die on errors with config file or # inability to ensure that it matches the list of services. @@ -1134,18 +1591,24 @@ daemonize() ( # gets applied (e.g. if user disabled some services or they # died, or some config was not applied due to coding error). while nut_driver_enumerator_main ; do + trap 'trap_handle_interruption_exit' $TERMINATION_SIGNALS + if $TERMINATE_ASAP ; then + echo "`date -u` : Trapped a SIGTERM/SIGINT/SIGQUIT during last run of nut_driver_enumerator_main, terminating gracefully now" >&2 + exit 0 + fi + if $RECONFIGURE_ASAP ; then echo "`date -u` : Trapped a SIGHUP during last run of nut_driver_enumerator_main, repeating reconfiguration quickly" >&2 else sleep $DAEMON_SLEEP & - trap "kill $! ; echo 'Sleep interrupted, processing configs now!'>&2" 1 + trap "trap_handle_hup_sleep $!" $RECONFIGURATION_SIGNALS wait $! fi RECONFIGURE_ASAP=false - trap 'RECONFIGURE_ASAP=true' 1 + trap 'trap_handle_hup_main' $RECONFIGURATION_SIGNALS done exit $? -) +} # Save the checksum of ups.conf as early as possible, # to test in the end that it is still the same file. @@ -1153,6 +1616,7 @@ UPSCONF_CHECKSUM_START="`calc_md5_file "$UPSCONF"`" || true # By default, update wrapping of devices into services if [ $# = 0 ]; then + update_upslist_savednames_find_missing nut_driver_enumerator_main ; exit $? fi @@ -1161,8 +1625,14 @@ if [ $# = 1 ] ; then # Note: Not all shells have 'case ... ;&' support case "$1" in --daemon=*) DAEMON_SLEEP="`echo "$1" | sed 's,^--daemon=,,'`" ;; + --daemon-after=*) DAEMON_SLEEP="`echo "$1" | sed 's,^--daemon-after=,,'`" ;; esac case "$1" in + --daemon-after|--daemon-after=*) + REPORT_RESTART_42=no nut_driver_enumerator_main || exit $? + daemonize & + exit $? + ;; --daemon|--daemon=*) daemonize & exit $? @@ -1178,6 +1648,11 @@ $0 (no args) $0 --daemon(=freq) Update wrapping of devices into services in an infinite loop Default freq is 60 sec +$0 --daemon-after(=freq) + Update wrapping of devices into services in an infinite loop; + first do one run of the loop though, then daemonize (this way + service unit is deemed started only when NUT config and driver + instances are in sync). Default freq is 60 sec. $0 --reconfigure Stop and un-register all service instances and recreate them (e.g. if new dependency template was defined in a new @@ -1221,71 +1696,12 @@ while [ $# -gt 0 ]; do --help|-h|-help) usage; exit 0 ;; --get-service-framework) echo "${SERVICE_FRAMEWORK}" ; exit 0 ;; --reconfigure) - upslist_readFile_once || exit $? - upslist_readSvcs "before manipulations" - - if [ -n "$UPSLIST_SVCS" ]; then - for UPSS in $UPSLIST_SVCS ; do - echo "Dropping old ${SERVICE_FRAMEWORK} service instance for power device [${UPSS}] to reconfigure the service unit..." >&2 - $hook_unregisterInstance "$UPSS" - done - upslist_readSvcs "after dropping" - fi - - if [ -n "$UPSLIST_FILE" ]; then - upslist_addSvcs - upslist_readSvcs "after checking for new config sections to define service instances" - fi - - # Save new checksum of global config - $hook_setSavedMD5 "" "`upsconf_getSection_MD5 ""`" - - # Service units were manipulated, including saving of checksums; - # refresh the service management daemon if needed - $hook_refreshSupervizor - - if [ -n "$UPSLIST_SVCS" ] ; then - echo "=== The currently defined service instances are:" - echo "$UPSLIST_SVCS" - fi - - if [ -n "$UPSLIST_FILE" ] ; then - echo "=== The currently defined configurations in '$UPSCONF' are:" - echo "$UPSLIST_FILE" - fi - - # We had some changes to the config file; upsd must be made aware - if [ "$AUTO_START" = yes ] ; then - $hook_restart_upsd - fi - - # Return 42 if there was a change applied succesfully - # (but e.g. some services should restart - upsd, maybe upsmon) - UPSLIST_EQ_RES=0 - upslist_equals "$UPSLIST_FILE" "$UPSLIST_SVCS" || UPSLIST_EQ_RES=$? - - # File processing and service startups take a while; - # make sure upsconf did not change while we worked... - # NOTE: Check this at the last moment to minimize - # the chance of still not noticing the change made - # at just the wrong moment. - UPSCONF_CHECKSUM_END="`calc_md5_file "$UPSCONF"`" || true - if [ "$UPSCONF_CHECKSUM_END" != "$UPSCONF_CHECKSUM_START" ] ; then - echo "`date -u` : '$UPSCONF' changed while $0 $* was processing its older contents; re-running the script to pick up the late-coming changes" - $0 ; exit $? - # The "main" routine will do REPORT_RESTART_42 logic too - fi - - if [ "$UPSLIST_EQ_RES" = 0 ] ; then - echo "`date -u` : OK: No more changes to reconcile between ${SERVICE_FRAMEWORK} service instances and device configurations in '$UPSCONF'" - [ "${REPORT_RESTART_42-}" = no ] && exit 0 || exit 42 - fi - - exit 13 + nut_driver_enumerator_full_reconfigure "$@" + exit $? ;; --list-devices) upslist_readFile_once && \ - if [ -n "$UPSLIST_FILE" ] ; then + if [ "${#UPSLIST_FILE}" != 0 ] ; then echo "=== The currently defined configurations in '$UPSCONF' are:" >&2 echo "$UPSLIST_FILE" exit 0 @@ -1295,7 +1711,7 @@ while [ $# -gt 0 ]; do ;; --list-services) UPSLIST_SVCS_RAW="`$hook_listInstances_raw`" && \ - if [ -n "$UPSLIST_SVCS_RAW" ] ; then + if [ "${#UPSLIST_SVCS_RAW}" != 0 ] ; then echo "=== The currently defined service units are:" >&2 echo "$UPSLIST_SVCS_RAW" exit 0 @@ -1305,7 +1721,7 @@ while [ $# -gt 0 ]; do ;; --list-instances) upslist_readSvcs "by user request" && \ - if [ -n "$UPSLIST_SVCS" ] ; then + if [ "${#UPSLIST_SVCS}" != 0 ] ; then echo "=== The currently defined service instances are:" >&2 echo "$UPSLIST_SVCS" exit 0 @@ -1313,104 +1729,26 @@ while [ $# -gt 0 ]; do echo "No service instances detected" >&2 exit 1 ;; - --get-service-for-device) [ -z "$2" ] && echo "Device name argument required" >&2 && exit 1 - DEV="$2" - upslist_readSvcs "by user request" && [ -n "$UPSLIST_SVCS" ] \ - || { echo "No service instances detected" >&2 ; exit 1; } - UPSLIST_SVCS_RAW="`$hook_listInstances_raw`" && [ -n "$UPSLIST_SVCS_RAW" ] \ - || { echo "No service units detected" >&2 ; exit 1; } - vINST="`$hook_validInstanceName "$DEV"`" - vUNITD="`$hook_validFullUnitName "$DEV"`" - vUNITI="`$hook_validFullUnitName "$vINST"`" - # First pass over simple verbatim names - for INST in $UPSLIST_SVCS ; do - if [ "$INST" = "$DEV" ] ; then - for UNIT in $UPSLIST_SVCS_RAW ; do - if [ "$UNIT" = "$vUNITD" ] ; then - echo "$UNIT" - exit 0 - fi - done - fi - done - for INST in $UPSLIST_SVCS ; do - if [ "$INST" = "$vINST" ] ; then - for UNIT in $UPSLIST_SVCS_RAW ; do - if [ "$UNIT" = "$vUNITI" ] ; then - echo "$UNIT" - exit 0 - fi - done - fi - done - echo "No service instances detected that match device '$2'" >&2 - exit 1 + --get-service-for-device) + shift + get_service_for_device "$@" + exit $? ;; - --get-device-for-service) [ -z "$2" ] && echo "Service (instance) name argument required" >&2 && exit 1 - # Instance name can be a hash or "native" NUT section name - SVC="`$hook_validInstanceSuffixName "$2"`" - case "$SVC" in - MD5_*) ;; # fall through to the bulk of code - *) upslist_readFile_once || exit $? - echo "$UPSLIST_FILE" | grep -E "^$SVC\$" - exit $? - ;; - esac - FINAL_RES=0 - OUT="`"$0" --list-services-for-devices`" && [ -n "$OUT" ] || FINAL_RES=$? - if [ "$FINAL_RES" = 0 ]; then - echo "$OUT" | grep "$SVC" | ( \ - while read _SVC _DEV ; do - _SVC="`$hook_validInstanceSuffixName "${_SVC}"`" || exit - [ "${_SVC}" = "${SVC}" ] && echo "$_DEV" && exit 0 - done ; exit 1 ) && exit 0 - fi - echo "No service instance '$2' was detected that matches a NUT device" >&2 - exit 1 + --get-device-for-service) + shift + get_device_for_service "$@" + exit $? ;; --list-services-for-devices) - FINAL_RES=0 - upslist_readFile_once && [ -n "$UPSLIST_FILE" ] \ - || { echo "No devices detected in '$UPSCONF'" >&2 ; exit 1 ; } - upslist_readSvcs "by user request" && [ -n "$UPSLIST_SVCS" ] \ - || { echo "No service instances detected" >&2 ; exit 1; } - UPSLIST_SVCS_RAW="`$hook_listInstances_raw`" && [ -n "$UPSLIST_SVCS_RAW" ] \ - || { echo "No service units detected" >&2 ; exit 1; } - for DEV in $UPSLIST_FILE ; do - vINST="`$hook_validInstanceName "$DEV"`" - vUNITD="`$hook_validFullUnitName "$DEV"`" - vUNITI="`$hook_validFullUnitName "$vINST"`" - # First pass over simple verbatim names - for INST in $UPSLIST_SVCS ; do - if [ "$INST" = "$DEV" ] ; then - for UNIT in $UPSLIST_SVCS_RAW ; do - if [ "$UNIT" = "$vUNITD" ] ; then - printf '%s\t%s\n' "$UNIT" "$DEV" - continue 3 - fi - done - fi - done - for INST in $UPSLIST_SVCS ; do - if [ "$INST" = "$vINST" ] ; then - for UNIT in $UPSLIST_SVCS_RAW ; do - if [ "$UNIT" = "$vUNITI" ] ; then - printf '%s\t%s\n' "$UNIT" "$DEV" - continue 3 - fi - done - fi - done - echo "WARNING: no service instances detected that match device '$DEV'" >&2 - FINAL_RES=1 - done - exit $FINAL_RES + shift + list_services_for_devices "$@" + exit $? ;; --show-configs|--show-device-configs|--show-all-configs|--show-all-device-configs) RES=0 upslist_readFile_once || RES=$? [ "$RES" != 0 ] && { echo "ERROR: upslist_readFile_once () failed with code $RES" >&2; exit $RES; } - [ -n "$UPSLIST_FILE" ] \ + [ "${#UPSLIST_FILE}" != 0 ] \ || { echo "WARNING: No devices detected in '$UPSCONF'" >&2 ; RES=1 ; } echo "$UPSCONF_DATA" exit $RES @@ -1439,6 +1777,20 @@ while [ $# -gt 0 ]; do upslist_debug exit $? ;; + upslist_savednames_find_missing) # Not public, not in usage() + upslist_savednames_find_missing + exit $? + ;; + upslist_savednames_find_mismatch) # Not public, not in usage() + upslist_savednames_find_mismatch + exit $? + ;; + update_upslist_savednames_find_missing) # Not public, not in usage() + update_upslist_savednames_find_missing + exit $? + ;; + hook_findSavedDeviceName) shift ; $hook_findSavedDeviceName "$@" ; exit $? ;; + hook_getSavedDeviceName) shift ; $hook_getSavedDeviceName "$@" ; exit $? ;; *) echo "Unrecognized argument: $1" >&2 ; exit 1 ;; esac shift diff --git a/scripts/upsdrvsvcctl/upsdrvsvcctl.in b/scripts/upsdrvsvcctl/upsdrvsvcctl.in index d9e127c82f..5fe9c82414 100755 --- a/scripts/upsdrvsvcctl/upsdrvsvcctl.in +++ b/scripts/upsdrvsvcctl/upsdrvsvcctl.in @@ -59,6 +59,10 @@ Options: -h display this help -t testing mode - prints actions without doing them -D raise debugging level + --timeout-cmd service management calls will be time-limited + --timeout-args by calling the specified program with its args. + By default, if coreutils timeout is found, it + would be used to limit service calls by 90 sec. start start all UPS drivers in ups.conf start only start driver for UPS stop stop all UPS drivers in ups.conf @@ -98,6 +102,18 @@ SVCINST="" DRYRUN="" DEBUG=0 # Note: DEBUG is UNUSED_PARAM so far + +# Optionally use Coreutils timeout to limit the +# (potentially hanging) calls to systemd tools... +# Should not hurt with SMF too, if it ever misbehaves. +TIMEOUT_CMD="" +TIMEOUT_ARGS="" +if which timeout 2>/dev/null >/dev/null ; then + # Systemd default timeout for unit start/stop + TIMEOUT_CMD="timeout" + TIMEOUT_ARGS="90s" +fi + while [ $# -gt 0 ]; do case "$1" in resync) eval $DRYRUN $ENUMERATOR ; exit $? ;; @@ -133,6 +149,26 @@ while [ $# -gt 0 ]; do $0 start $2 exit $RES ;; + --timeout-length|--timeout-len|--timeout-args) + TIMEOUT_ARGS="$2" + shift + ;; + --timeout-cmd) + if [ -n "$2" ] ; then + if [ -x "$2" ] || which "$2" 2>/dev/null >/dev/null ; then + TIMEOUT_CMD="$2" + else + echo "ERROR: Received a '$2' argument for $1, and can not find such program; clearing the option so the basic functionality can proceed" >&2 + TIMEOUT_CMD="" + TIMEOUT_ARGS="" + fi + else + echo "INFO: Received an empty argument for $1, clearing the option" >&2 + TIMEOUT_CMD="" + TIMEOUT_ARGS="" + fi + shift + ;; -t) DRYRUN="echo" ;; -h) usage; exit 0 ;; -D) DEBUG="`expr $DEBUG + 1`" ;; @@ -152,6 +188,10 @@ if [ -z "$ACTION" ]; then exit 1 fi +if [ -n "$TIMEOUT_CMD" ]; then + echo "INFO: Detected presence of $TIMEOUT_CMD so will limit service management calls by passing the args: $TIMEOUT_ARGS" >&2 +fi + if [ -z "$SVCINST" ]; then SVCINST="`$ENUMERATOR --list-services`" || exit fi @@ -178,7 +218,7 @@ esac for INST in $SVCINST ; do echo "$VERB $INST ..." >&2 - $DRYRUN $CMD $CMDARG "$INST" & + $DRYRUN $TIMEOUT_CMD $TIMEOUT_ARGS $CMD $CMDARG "$INST" & done wait @@ -188,7 +228,7 @@ case "$SERVICE_FRAMEWORK" in echo "Post-process clearing services that failed early..." >&2 for INST in $SVCINST ; do echo "Clearing $INST (if it got broken) ..." >&2 - $DRYRUN $CMD clear "$INST" & + $DRYRUN $TIMEOUT_CMD $TIMEOUT_ARGS $CMD clear "$INST" & done ;; esac diff --git a/scripts/usb_resetter/README.md b/scripts/usb_resetter/README.adoc similarity index 80% rename from scripts/usb_resetter/README.md rename to scripts/usb_resetter/README.adoc index f1c226e255..56a65127fe 100644 --- a/scripts/usb_resetter/README.md +++ b/scripts/usb_resetter/README.adoc @@ -1,12 +1,12 @@ -Desc: Method for resetting unreliable USB UPS interfaces -File: scripts/usb_resetter/README -Date: 30 Mar 2023 -Auth: Orsiris de Jong - NetInvent SASU +Method for resetting unreliable USB UPS interfaces (on Linux) +============================================================= +Orsiris de Jong - NetInvent SASU +v1.0, 30 Mar 2023 (start date) Some cheaper USB UPS have the same kind of unreliable USB to serial interface, -being a "Cypress Semiconductor USB to Serial" or "INNO TECH USB to Serial" -(often with the `0665:5161` VendorID/ProductId seen in examples below). -Most of them use `blazer_usb` or `nutdrv_qx` driver, and sometimes the +often being a "Cypress Semiconductor USB to Serial" or "INNO TECH USB to Serial" +(often with the `0665:5161` VendorID/ProductID seen in examples below). +Most of them use `blazer_usb` or `nutdrv_qx` NUT driver, and sometimes the driver can't start because it can't communicate with the UPS. NOTE: It is believed that in some cases the chip on UPS side can go into @@ -23,23 +23,24 @@ to Linux platforms as of this writing. Grab a copy via `pip` with `pip install usb_resetter`, or make a plain install directly from GitHub with e.g.: -```` +---- :; curl -o /usr/local/bin/usb_resetter -L \ https://raw.githubusercontent.com/netinvent/usb_resetter/main/usb_resetter/usb_resetter.py \ - && chmod +x /usr/local/bin/usb_resetter -```` + && chmod +x /usr/local/bin/usb_resetter +---- Once you have got the script, identify the USB UPS with: -``` +---- :; usb_resetter --list -``` +---- In our case, we could see something like: -```` +---- Found device 0665:5161 at /dev/bus/usb/001/002 Manufacturer=INNO TECH, Product=USB to Serial -```` +---- The `usb_resetter` can work in three different ways: + - Reset device itself - Reset the hub the device is attached to - Reset all USB controllers @@ -48,30 +49,30 @@ A simple USB device reset typically isn't sufficient for those UPS devices, so we would need to reset the hub it's attached to. The command for doing that is: -``` +---- :; usb_resetter --reset-hub --device 0665:5161 -``` +---- Bear in mind that this will reset other devices connected to the same hub. -While this isn't a problem for a keyboard / mouse, it might be for a USB -storage device. On some hardware, each USB plug gets it's own hub. -On others, two or more USB plus share one hub. +While this isn't a problem for a keyboard/mouse, it might be for a USB +storage device. On some hardware, each USB plug gets its own hub. +On others, two or more USB plugs share one hub. A good practice would be to isolate the USB UPS on a hub without any other device in order to not interfere with other hardware, or to associate it on a hub where a non-critical device is already plugged. Getting the hub your device is attached to can be done with: -```` +---- :; usb_resetter --list-hubs --device 0665:5161 -```` +---- The easiest way to integrate this activity with the `nut-driver` service is to modify the systemd service file (or ideally use a separate "drop-in" snippet file) with the following line: -```` +---- ExecStartPre=/usr/local/bin/usb_reset.py --reset-hub --device 0665:5161 -```` +---- An example modified `nut-driver.service` file which may be applicable to a NUT v2.7.4 or older release (modulo the paths and the particular VID:PID) @@ -83,7 +84,7 @@ to run each driver in a dedicated instance, declared manually or often by the `nut-driver-enumerator` script or service (tracking `ups.conf` sections). The added call to `usb_resetter` can then be a systemd drop-in file tailored for that particular device and named like -`/etc/systemd/system/nut-driver@myups.service.d/dropin.conf`, +`/etc/systemd/system/nut-driver@myups.service.d/usbreset.conf`, so it does not impact others (unless they use the same USB hub). This way, every time the nut-driver service is restarted, the USB UPS link diff --git a/server/Makefile.am b/server/Makefile.am index fb18ff484b..878f16f588 100644 --- a/server/Makefile.am +++ b/server/Makefile.am @@ -1,27 +1,24 @@ # Network UPS Tools: server +# Export certain values for ccache which NUT ci_build.sh can customize, +# to facilitate developer iteration re-runs of "make" later. +# At least GNU and BSD make implementations are okay with this syntax. +@NUT_AM_MAKE_CAN_EXPORT@export CCACHE_NAMESPACE=@CCACHE_NAMESPACE@ +@NUT_AM_MAKE_CAN_EXPORT@export CCACHE_BASEDIR=@CCACHE_BASEDIR@ +@NUT_AM_MAKE_CAN_EXPORT@export CCACHE_DIR=@CCACHE_DIR@ +@NUT_AM_MAKE_CAN_EXPORT@export CCACHE_PATH=@CCACHE_PATH@ +@NUT_AM_MAKE_CAN_EXPORT@export PATH=@PATH_DURING_CONFIGURE@ + # Make sure out-of-dir dependencies exist (especially when dev-building parts): $(top_builddir)/common/libcommon.la \ $(top_builddir)/common/libparseconf.la: dummy - @cd $(@D) && $(MAKE) $(AM_MAKEFLAGS) $(@F) + +@cd $(@D) && $(MAKE) $(AM_MAKEFLAGS) $(@F) # Avoid per-target CFLAGS, because this will prevent re-use of object # files. In any case, CFLAGS are only -I options, so there is no harm, # but only add them if we really use the target. AM_CFLAGS = -I$(top_srcdir)/include -if WITH_WRAP - AM_CFLAGS += $(LIBWRAP_CFLAGS) -endif -if WITH_SSL - AM_CFLAGS += $(LIBSSL_CFLAGS) -endif LDADD = $(top_builddir)/common/libcommon.la $(top_builddir)/common/libparseconf.la $(NETLIBS) -if WITH_WRAP - LDADD += $(LIBWRAP_LIBS) -endif -if WITH_SSL - LDADD += $(LIBSSL_LIBS) -endif sbin_PROGRAMS = upsd EXTRA_PROGRAMS = sockdebug @@ -31,7 +28,19 @@ upsd_SOURCES = upsd.c user.c conf.c netssl.c sstate.c desc.c \ conf.h nut_ctype.h desc.h netcmds.h neterr.h netget.h netinstcmd.h \ netlist.h netmisc.h netset.h netuser.h netssl.h sstate.h stype.h upsd.h \ upstype.h user-data.h user.h +upsd_CFLAGS = $(AM_CFLAGS) +upsd_LDADD = $(LDADD) + +if WITH_WRAP + upsd_CFLAGS += $(LIBWRAP_CFLAGS) + upsd_LDADD += $(LIBWRAP_LIBS) +endif +if WITH_SSL + upsd_CFLAGS += $(LIBSSL_CFLAGS) + upsd_LDADD += $(LIBSSL_LIBS) +endif +# Developer, troubleshooting, or odd automation aid tool: if HAVE_WINDOWS sockdebug_SOURCES = pipedebug.c else !HAVE_WINDOWS diff --git a/server/conf.c b/server/conf.c index bddd0a69ca..3fa8393258 100644 --- a/server/conf.c +++ b/server/conf.c @@ -169,7 +169,7 @@ static int parse_upsd_conf_args(size_t numargs, char **arg) /* DEBUG_MIN (NUM) */ /* debug_min (NUM) also acceptable, to be on par with ups.conf */ if (!strcasecmp(arg[0], "DEBUG_MIN")) { - int lvl = -1; // typeof common/common.c: int nut_debug_level + int lvl = -1; /* typeof common/common.c: int nut_debug_level */ if ( str_to_int (arg[1], &lvl, 10) && lvl >= 0 ) { nut_debug_level_global = lvl; } else { @@ -202,7 +202,7 @@ static int parse_upsd_conf_args(size_t numargs, char **arg) } } - /* ALLOW_NO_DEVICE */ + /* ALLOW_NO_DEVICE */ if (!strcmp(arg[0], "ALLOW_NO_DEVICE")) { if (isdigit((size_t)arg[1][0])) { allow_no_device = (atoi(arg[1]) != 0); /* non-zero arg is true here */ @@ -215,6 +215,19 @@ static int parse_upsd_conf_args(size_t numargs, char **arg) return 0; } + /* ALLOW_NOT_ALL_LISTENERS */ + if (!strcmp(arg[0], "ALLOW_NOT_ALL_LISTENERS")) { + if (isdigit((size_t)arg[1][0])) { + allow_not_all_listeners = (atoi(arg[1]) != 0); /* non-zero arg is true here */ + return 1; + } + if (parse_boolean(arg[1], &allow_not_all_listeners)) + return 1; + + upslogx(LOG_ERR, "ALLOW_NOT_ALL_LISTENERS has non numeric and non boolean value (%s)!", arg[1]); + return 0; + } + /* MAXCONN */ if (!strcmp(arg[0], "MAXCONN")) { if (isdigit((size_t)arg[1][0])) { @@ -346,6 +359,7 @@ void load_upsdconf(int reloading) { char fn[SMALLBUF]; PCONF_CTX_t ctx; + int numerrors = 0; snprintf(fn, sizeof(fn), "%s/upsd.conf", confpath()); @@ -374,6 +388,7 @@ void load_upsdconf(int reloading) if (pconf_parse_error(&ctx)) { upslogx(LOG_ERR, "Parse error: %s:%d: %s", fn, ctx.linenum, ctx.errmsg); + numerrors++; continue; } @@ -391,6 +406,7 @@ void load_upsdconf(int reloading) snprintfcat(errmsg, sizeof(errmsg), " %s", ctx.arglist[i]); + numerrors++; upslogx(LOG_WARNING, "%s", errmsg); } @@ -399,7 +415,7 @@ void load_upsdconf(int reloading) if (reloading) { if (nut_debug_level_global > -1) { upslogx(LOG_INFO, - "Applying debug_min=%d from upsd.conf", + "Applying DEBUG_MIN %d from upsd.conf", nut_debug_level_global); nut_debug_level = nut_debug_level_global; } else { @@ -412,6 +428,13 @@ void load_upsdconf(int reloading) } } + /* FIXME: Per legacy behavior, we silently went on. + * Maybe should abort on unusable configs? + */ + if (numerrors) { + upslogx(LOG_ERR, "Encountered %d config errors, those entries were ignored", numerrors); + } + pconf_finish(&ctx); } diff --git a/server/netssl.c b/server/netssl.c index 79c5d3175f..d92fb1ba89 100644 --- a/server/netssl.c +++ b/server/netssl.c @@ -23,6 +23,9 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include "config.h" /* must be the first header */ +#include "common.h" /* for upsdebugx() etc */ + #include #ifndef WIN32 #include @@ -193,9 +196,16 @@ static char *nss_password_callback(PK11SlotInfo *slot, PRBool retry, static void nss_error(const char* text) { char buffer[SMALLBUF]; - PRInt32 length = PR_GetErrorText(buffer); - if (length > 0 && length < SMALLBUF) { - upsdebugx(1, "nss_error %ld in %s : %s", (long)PR_GetError(), text, buffer); + PRErrorCode err_num = PR_GetError(); + PRInt32 err_len = PR_GetErrorTextLength(); + + if (err_len > 0) { + if (err_len < SMALLBUF) { + PR_GetErrorText(buffer); + upsdebugx(1, "nss_error %ld in %s : %s", (long)err_num, text, buffer); + }else{ + upsdebugx(1, "nss_error %ld in %s : Internal error buffer too small, needs %ld bytes", (long)err_num, text, (long)err_len); + } }else{ upsdebugx(1, "nss_error %ld in %s", (long)PR_GetError(), text); } @@ -204,17 +214,21 @@ static void nss_error(const char* text) static int ssl_error(PRFileDesc *ssl, ssize_t ret) { char buffer[256]; + PRErrorCode err_num = PR_GetError(); + PRInt32 err_len = PR_GetErrorTextLength(); PRInt32 length; - PRErrorCode e; NUT_UNUSED_VARIABLE(ssl); NUT_UNUSED_VARIABLE(ret); - e = PR_GetError(); - length = PR_GetErrorText(buffer); - if (length > 0 && length < 256) { - upsdebugx(1, "ssl_error() ret=%d %*s", e, length, buffer); - } else { - upsdebugx(1, "ssl_error() ret=%d", e); + if (err_len > 0) { + if (err_len < SMALLBUF) { + length = PR_GetErrorText(buffer); + upsdebugx(1, "ssl_error %ld : %*s", (long)err_num, length, buffer); + }else{ + upsdebugx(1, "ssl_error %ld : Internal error buffer too small, needs %ld bytes", (long)err_num, (long)err_len); + } + }else{ + upsdebugx(1, "ssl_error %ld", (long)err_num); } return -1; @@ -506,24 +520,21 @@ void ssl_init(void) PK11_SetPasswordFunc(nss_password_callback); - if (certfile) - /* Note: this call can generate memory leaks not resolvable - * by any release function. - * Probably NSS key module object allocation and - * probably NSS key db object allocation too. */ - status = NSS_Init(certfile); - else - status = NSS_NoDB_Init(NULL); + /* Note: this call can generate memory leaks not resolvable + * by any release function. + * Probably NSS key module object allocation and + * probably NSS key db object allocation too. */ + status = NSS_Init(certfile); if (status != SECSuccess) { upslogx(LOG_ERR, "Can not initialize SSL context"); - nss_error("upscli_init / NSS_[NoDB]_Init"); + nss_error("ssl_init / NSS_Init"); return; } status = NSS_SetDomesticPolicy(); if (status != SECSuccess) { upslogx(LOG_ERR, "Can not initialize SSL policy"); - nss_error("upscli_init / NSS_SetDomesticPolicy"); + nss_error("ssl_init / NSS_SetDomesticPolicy"); return; } @@ -531,7 +542,7 @@ void ssl_init(void) status = SSL_ConfigServerSessionIDCache(0, 0, 0, NULL); if (status != SECSuccess) { upslogx(LOG_ERR, "Can not initialize SSL server cache"); - nss_error("upscli_init / SSL_ConfigServerSessionIDCache"); + nss_error("ssl_init / SSL_ConfigServerSessionIDCache"); return; } @@ -539,13 +550,13 @@ void ssl_init(void) status = SSL_OptionSetDefault(SSL_ENABLE_SSL3, PR_TRUE); if (status != SECSuccess) { upslogx(LOG_ERR, "Can not enable SSLv3"); - nss_error("upscli_init / SSL_OptionSetDefault(SSL_ENABLE_SSL3)"); + nss_error("ssl_init / SSL_OptionSetDefault(SSL_ENABLE_SSL3)"); return; } status = SSL_OptionSetDefault(SSL_ENABLE_TLS, PR_TRUE); if (status != SECSuccess) { upslogx(LOG_ERR, "Can not enable TLSv1"); - nss_error("upscli_init / SSL_OptionSetDefault(SSL_ENABLE_TLS)"); + nss_error("ssl_init / SSL_OptionSetDefault(SSL_ENABLE_TLS)"); return; } } else { @@ -553,7 +564,7 @@ void ssl_init(void) status = SSL_VersionRangeGetSupported(ssl_variant_stream, &range); if (status != SECSuccess) { upslogx(LOG_ERR, "Can not get versions supported"); - nss_error("upscli_init / SSL_VersionRangeGetSupported"); + nss_error("ssl_init / SSL_VersionRangeGetSupported"); return; } range.min = SSL_LIBRARY_VERSION_TLS_1_1; @@ -563,7 +574,7 @@ void ssl_init(void) status = SSL_VersionRangeSetDefault(ssl_variant_stream, &range); if (status != SECSuccess) { upslogx(LOG_ERR, "Can not set versions supported"); - nss_error("upscli_init / SSL_VersionRangeSetDefault"); + nss_error("ssl_init / SSL_VersionRangeSetDefault"); return; } /* Disable old/weak ciphers */ @@ -575,13 +586,13 @@ void ssl_init(void) status = SSL_OptionSetDefault(SSL_ENABLE_SSL3, PR_FALSE); if (status != SECSuccess) { upslogx(LOG_ERR, "Can not disable SSLv3"); - nss_error("upscli_init / SSL_OptionSetDefault(SSL_DISABLE_SSL3)"); + nss_error("ssl_init / SSL_OptionSetDefault(SSL_DISABLE_SSL3)"); return; } status = SSL_OptionSetDefault(SSL_ENABLE_TLS, PR_TRUE); if (status != SECSuccess) { upslogx(LOG_ERR, "Can not enable TLSv1"); - nss_error("upscli_init / SSL_OptionSetDefault(SSL_ENABLE_TLS)"); + nss_error("ssl_init / SSL_OptionSetDefault(SSL_ENABLE_TLS)"); return; } #endif @@ -599,7 +610,7 @@ void ssl_init(void) status = SSL_OptionSetDefault(SSL_REQUEST_CERTIFICATE, PR_TRUE); if (status != SECSuccess) { upslogx(LOG_ERR, "Can not enable certificate request"); - nss_error("upscli_init / SSL_OptionSetDefault(SSL_REQUEST_CERTIFICATE)"); + nss_error("ssl_init / SSL_OptionSetDefault(SSL_REQUEST_CERTIFICATE)"); return; } } @@ -608,7 +619,7 @@ void ssl_init(void) status = SSL_OptionSetDefault(SSL_REQUIRE_CERTIFICATE, PR_TRUE); if (status != SECSuccess) { upslogx(LOG_ERR, "Can not enable certificate requirement"); - nss_error("upscli_init / SSL_OptionSetDefault(SSL_REQUIRE_CERTIFICATE)"); + nss_error("ssl_init / SSL_OptionSetDefault(SSL_REQUIRE_CERTIFICATE)"); return; } } @@ -617,14 +628,14 @@ void ssl_init(void) cert = PK11_FindCertFromNickname(certname, NULL); if(cert==NULL) { upslogx(LOG_ERR, "Can not find server certificate"); - nss_error("upscli_init / PK11_FindCertFromNickname"); + nss_error("ssl_init / PK11_FindCertFromNickname"); return; } privKey = PK11_FindKeyByAnyCert(cert, NULL); if(privKey==NULL){ upslogx(LOG_ERR, "Can not find private key associate to server certificate"); - nss_error("upscli_init / PK11_FindKeyByAnyCert"); + nss_error("ssl_init / PK11_FindKeyByAnyCert"); return; } diff --git a/server/pipedebug.c b/server/pipedebug.c index b8e7f78fa1..53007449ff 100644 --- a/server/pipedebug.c +++ b/server/pipedebug.c @@ -53,14 +53,14 @@ static HANDLE pipe_connect(const char *pipefn) } fd = CreateFile( - pipename, // pipe name - GENERIC_READ | // read and write access + pipename, /* pipe name */ + GENERIC_READ | /* read and write access */ GENERIC_WRITE, - 0, // no sharing - NULL, // default security attributes FIXME - OPEN_EXISTING, // opens existing pipe - FILE_FLAG_OVERLAPPED, // enable async IO - NULL); // no template file + 0, /* no sharing */ + NULL, /* default security attributes FIXME */ + OPEN_EXISTING, /* opens existing pipe */ + FILE_FLAG_OVERLAPPED, /* enable async IO */ + NULL); /* no template file */ if (fd == INVALID_HANDLE_VALUE) { printf("CreateFile : %d\n",GetLastError()); diff --git a/server/sockdebug.c b/server/sockdebug.c index b1c3addbdf..a86868b6bc 100644 --- a/server/sockdebug.c +++ b/server/sockdebug.c @@ -19,6 +19,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include "common.h" #include #include @@ -28,7 +29,6 @@ #include #include -#include "common.h" #include "parseconf.h" #include "nut_stdint.h" diff --git a/server/sstate.c b/server/sstate.c index 26bc76ca18..5da0834e29 100644 --- a/server/sstate.c +++ b/server/sstate.c @@ -278,14 +278,14 @@ TYPE_FD sstate_connect(upstype_t *ups) } fd = CreateFile( - pipename, // pipe name - GENERIC_READ | // read and write access + pipename, /* pipe name */ + GENERIC_READ | /* read and write access */ GENERIC_WRITE, - 0, // no sharing - NULL, // default security attributes FIXME - OPEN_EXISTING, // opens existing pipe - FILE_FLAG_OVERLAPPED, // enable async IO - NULL); // no template file + 0, /* no sharing */ + NULL, /* default security attributes FIXME */ + OPEN_EXISTING, /* opens existing pipe */ + FILE_FLAG_OVERLAPPED, /* enable async IO */ + NULL); /* no template file */ if (fd == INVALID_HANDLE_VALUE) { upslog_with_errno(LOG_ERR, "Can't connect to UPS [%s] (%s)", ups->name, ups->fn); diff --git a/server/upsd.c b/server/upsd.c index 5e4b37e7dd..bd3a1543f7 100644 --- a/server/upsd.c +++ b/server/upsd.c @@ -85,6 +85,12 @@ int tracking_delay = 3600; */ int allow_no_device = 0; +/* + * Preloaded to ALLOW_NOT_ALL_LISTENERS from upsd.conf or environment variable + * (with higher prio for envvar); defaults to disabled for legacy compat. + */ +int allow_not_all_listeners = 0; + /* preloaded to {OPEN_MAX} in main, can be overridden via upsd.conf */ nfds_t maxconn = 0; @@ -276,7 +282,7 @@ static void setuptcp(stype_t *server) int v = 0, one = 1; if (VALID_FD_SOCK(server->sock_fd)) { - /* Alredy bound, e.g. thanks to 'LISTEN *' handling and injection + /* Already bound, e.g. thanks to 'LISTEN *' handling and injection * into the list we loop over */ upsdebugx(6, "setuptcp: SKIP bind to %s port %s: entry already initialized", server->addr, server->port); @@ -284,6 +290,13 @@ static void setuptcp(stype_t *server) } upsdebugx(3, "setuptcp: try to bind to %s port %s", server->addr, server->port); + if (!strcmp(server->addr, "localhost")) { + /* Warn about possible surprises with IPv4 vs. IPv6 */ + upsdebugx(1, + "setuptcp: WARNING: requested to LISTEN on 'localhost' " + "by name - will use the first system-resolved " + "IP address for that"); + } /* Special handling note for `LISTEN * ` directive with the * literal asterisk on systems with RFC-3493 (no relation!) support @@ -877,6 +890,16 @@ static void client_readline(nut_ctype_t *client) void server_load(void) { stype_t *server; + size_t listenersTotal = 0, listenersValid = 0, + listenersTotalLocalhost = 0, listenersValidLocalhost = 0, + listenersLocalhostName = 0, + listenersLocalhostName6 = 0, + listenersLocalhostIPv4 = 0, + listenersLocalhostIPv6 = 0, + listenersValidLocalhostName = 0, + listenersValidLocalhostName6 = 0, + listenersValidLocalhostIPv4 = 0, + listenersValidLocalhostIPv6 = 0; /* default behaviour if no LISTEN address has been specified */ if (!firstaddr) { @@ -896,10 +919,115 @@ void server_load(void) setuptcp(server); } + /* Account separately from setuptcp() because it can edit the list, + * e.g. when handling `LISTEN *` lines. + */ + for (server = firstaddr; server; server = server->next) { + listenersTotal++; + if (VALID_FD_SOCK(server->sock_fd)) { + listenersValid++; + } + + if (!strcmp(server->addr, "localhost")) { + listenersLocalhostName++; + listenersTotalLocalhost++; + if (VALID_FD_SOCK(server->sock_fd)) { + listenersValidLocalhostName++; + listenersValidLocalhost++; + } + } + + if (!strcmp(server->addr, "localhost6")) { + listenersLocalhostName6++; + listenersTotalLocalhost++; + if (VALID_FD_SOCK(server->sock_fd)) { + listenersValidLocalhostName6++; + listenersValidLocalhost++; + } + } + + if (!strcmp(server->addr, "127.0.0.1")) { + listenersLocalhostIPv4++; + listenersTotalLocalhost++; + if (VALID_FD_SOCK(server->sock_fd)) { + listenersValidLocalhostIPv4++; + listenersValidLocalhost++; + } + } + + if (!strcmp(server->addr, "::1")) { + listenersLocalhostIPv6++; + listenersTotalLocalhost++; + if (VALID_FD_SOCK(server->sock_fd)) { + listenersValidLocalhostIPv6++; + listenersValidLocalhost++; + } + } + } + + upsdebugx(1, "%s: tried to set up %" PRIuSIZE + " listening sockets, succeeded with %" PRIuSIZE, + __func__, listenersTotal, listenersValid); + upsdebugx(3, "%s: ...of those related to localhost: " + "overall: %" PRIuSIZE " tried, %" PRIuSIZE " succeeded; " + "by name: %" PRIuSIZE "T/%" PRIuSIZE "S; " + "by name(6): %" PRIuSIZE "T/%" PRIuSIZE "S; " + "by IPv4 addr: %" PRIuSIZE "T/%" PRIuSIZE "S; " + "by IPv6 addr: %" PRIuSIZE "T/%" PRIuSIZE "S", + __func__, + listenersTotalLocalhost, listenersValidLocalhost, + listenersLocalhostName, listenersValidLocalhostName, + listenersLocalhostName6, listenersValidLocalhostName6, + listenersLocalhostIPv4, listenersValidLocalhostIPv4, + listenersLocalhostIPv6, listenersValidLocalhostIPv6 + ); + /* check if we have at least 1 valid LISTEN interface */ - if (INVALID_FD_SOCK(firstaddr->sock_fd)) { + if (!listenersValid) { fatalx(EXIT_FAILURE, "no listening interface available"); } + + /* is everything requested - handled okay? */ + if (listenersTotal == listenersValid) + return; + + /* check for edge cases we can let slide */ + if ( (listenersTotal - listenersValid) == + (listenersTotalLocalhost - listenersValidLocalhost) + ) { + /* Note that we can also get into this situation + * when "dual-stack" IPv6 listener also handles + * IPv4 connections, and precludes successful + * setup of the IPv4 listener later. + * + * FIXME? Can we get into this situation the other + * way around - an IPv4 listener precluding the + * IPv6 one, so end-user actually lacks one of the + * requested connection types? + */ + upsdebugx(1, "%s: discrepancy corresponds to " + "addresses related to localhost; assuming " + "that it was attempted under several names " + "which resolved to same IP:PORT socket specs " + "(so only the first one of each succeeded)", + __func__); + return; + } + + if (allow_not_all_listeners) { + upslogx(LOG_WARNING, + "WARNING: some listening interfaces were " + "not available, but the ALLOW_NOT_ALL_LISTENERS " + "setting is active"); + } else { + upsdebugx(0, + "Reconcile available NUT server IP addresses " + "and LISTEN configuration, or consider the " + "ALLOW_NOT_ALL_LISTENERS setting!"); + fatalx(EXIT_FAILURE, + "Fatal error: some listening interfaces were " + "not available"); + } } void server_free(void) @@ -2074,6 +2202,30 @@ int main(int argc, char **argv) } } /* scope */ + { /* scope */ + /* As documented above, the ALLOW_NOT_ALL_LISTENERS can be provided via + * envvars and then has higher priority than an upsd.conf setting + */ + const char *envvar = getenv("ALLOW_NOT_ALL_LISTENERS"); + if ( envvar != NULL) { + if ( (!strncasecmp("TRUE", envvar, 4)) || (!strncasecmp("YES", envvar, 3)) || (!strncasecmp("ON", envvar, 2)) || (!strncasecmp("1", envvar, 1)) ) { + /* Admins of this server expressed a desire to serve + * NUT protocol if at least one configured listener + * works (some may be missing and clients using those + * addresses would not be served!) + */ + allow_not_all_listeners = 1; + } else if ( (!strncasecmp("FALSE", envvar, 5)) || (!strncasecmp("NO", envvar, 2)) || (!strncasecmp("OFF", envvar, 3)) || (!strncasecmp("0", envvar, 1)) ) { + /* Admins of this server expressed a desire to serve + * NUT protocol only if all configured listeners work + * (default for least surprise - admins must address + * any configuration inconsistencies!) + */ + allow_not_all_listeners = 0; + } + } + } /* scope */ + /* start server */ server_load(); diff --git a/server/upsd.h b/server/upsd.h index 9d2802cb24..dfe27140ae 100644 --- a/server/upsd.h +++ b/server/upsd.h @@ -97,7 +97,7 @@ int tracking_disable(void); int tracking_is_enabled(void); /* declarations from upsd.c */ -extern int maxage, tracking_delay, allow_no_device; +extern int maxage, tracking_delay, allow_no_device, allow_not_all_listeners; extern nfds_t maxconn; extern char *statepath, *datapath; extern upstype_t *firstups; diff --git a/tests/Makefile.am b/tests/Makefile.am index b0e79625e7..d7a1cd9ccc 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -1,5 +1,14 @@ # Network UPS Tools: tests +# Export certain values for ccache which NUT ci_build.sh can customize, +# to facilitate developer iteration re-runs of "make" later. +# At least GNU and BSD make implementations are okay with this syntax. +@NUT_AM_MAKE_CAN_EXPORT@export CCACHE_NAMESPACE=@CCACHE_NAMESPACE@ +@NUT_AM_MAKE_CAN_EXPORT@export CCACHE_BASEDIR=@CCACHE_BASEDIR@ +@NUT_AM_MAKE_CAN_EXPORT@export CCACHE_DIR=@CCACHE_DIR@ +@NUT_AM_MAKE_CAN_EXPORT@export CCACHE_PATH=@CCACHE_PATH@ +@NUT_AM_MAKE_CAN_EXPORT@export PATH=@PATH_DURING_CONFIGURE@ + SUBDIRS = . NIT all: $(TESTS) @@ -12,12 +21,15 @@ CLEANFILES = *.trs *.log AM_CFLAGS = -I$(top_srcdir)/include -I$(top_srcdir)/drivers AM_CXXFLAGS = -I$(top_srcdir)/include +# Compiler flags for cppunit tests +CPPUNIT_NUT_CXXFLAGS = @CPPUNIT_NUT_CXXFLAGS@ + check_PROGRAMS = $(TESTS) check_SCRIPTS = # NUT Integration Testing suite check-NIT check-NIT-devel: - cd "$(builddir)/NIT" && $(MAKE) $@ + +cd "$(builddir)/NIT" && $(MAKE) $(AM_MAKEFLAGS) $@ nutlogtest_SOURCES = nutlogtest.c nutlogtest_LDADD = $(top_builddir)/common/libcommon.la @@ -36,9 +48,9 @@ nutlogtest-nofail.sh: nutlogtest$(EXEEXT) @chmod +x $@ # NOTE: Keep the line above empty! -else +else !REQUIRE_NUT_STRARG TESTS += nutlogtest$(EXEEXT) -endif +endif !REQUIRE_NUT_STRARG TESTS += nuttimetest nuttimetest_SOURCES = nuttimetest.c @@ -60,9 +72,9 @@ nodist_getvaluetest_SOURCES = hidparser.c # Pull the right include path for chosen libusb version: getvaluetest_CFLAGS = $(AM_CFLAGS) $(LIBUSB_CFLAGS) getvaluetest_LDADD = $(top_builddir)/common/libcommon.la -else +else !WITH_USB EXTRA_DIST += getvaluetest.c hidparser.c -endif +endif !WITH_USB if WITH_GPIO TESTS += gpiotest @@ -79,21 +91,24 @@ gpiotest_SOURCES = generic_gpio_utest.c generic_gpio_liblocal.c nodist_gpiotest_SOURCES = generic_gpio_libgpiod.c generic_gpio_common.c gpiotest_LDADD = $(top_builddir)/drivers/libdummy_mockdrv.la gpiotest_CFLAGS = $(AM_CFLAGS) -I$(top_srcdir)/tests -DDRIVERS_MAIN_WITHOUT_MAIN=1 -else +else !WITH_GPIO EXTRA_DIST += generic_gpio_utest.c generic_gpio_liblocal.c -endif +endif !WITH_GPIO CLEANFILES += generic_gpio_libgpiod.c generic_gpio_common.c EXTRA_DIST += generic_gpio_utest.h generic_gpio_test.txt # Make sure out-of-dir dependencies exist (especially when dev-building parts): $(top_builddir)/drivers/libdummy_mockdrv.la \ +$(top_builddir)/common/libnutconf.la \ $(top_builddir)/common/libcommon.la: dummy - @cd $(@D) && $(MAKE) $(AM_MAKEFLAGS) $(@F) + +@cd $(@D) && $(MAKE) $(AM_MAKEFLAGS) $(@F) ### Optional tests which can not be built everywhere # List of src files for CppUnit tests CPPUNITTESTSRC = example.cpp nutclienttest.cpp +# These are an optional part of cppunittest, if building WITH_NUTCONF +CPPUNITTESTSRC_NUTCONF = nutconf_parser_ut.cpp nutstream_ut.cpp nutconf_ut.cpp nutipc_ut.cpp # The test driver which orchestrates running those tests above CPPUNITTESTERSRC = cpputest.cpp @@ -114,13 +129,22 @@ check_PROGRAMS += cppnit if WITH_VALGRIND check-local: $(check_PROGRAMS) RES=0; for P in $^ ; do $(VALGRIND) ./$$P || { RES=$$? ; echo "FAILED: $(VALGRIND) ./$$P" >&2; }; done; exit $$RES -endif +endif WITH_VALGRIND cppunittest_CXXFLAGS = $(AM_CXXFLAGS) $(CPPUNIT_CFLAGS) $(CPPUNIT_CXXFLAGS) $(CPPUNIT_NUT_CXXFLAGS) $(CXXFLAGS) +###cppunittest_CXXFLAGS += -I$(top_srcdir)/include -DTOP_SRCDIR="\"$(top_srcdir)\"" cppunittest_LDFLAGS = $(CPPUNIT_LDFLAGS) $(CPPUNIT_LIBS) -cppunittest_LDADD = $(top_builddir)/clients/libnutclient.la $(top_builddir)/clients/libnutclientstub.la +cppunittest_LDADD = $(top_builddir)/clients/libnutclient.la +cppunittest_LDADD += $(top_builddir)/clients/libnutclientstub.la cppunittest_SOURCES = $(CPPUNITTESTSRC) $(CPPUNITTESTERSRC) +# Currently nutconf and related codebase causes woes for static analysis +# so we do not build it unless explicitly asked to. +if WITH_NUTCONF +cppunittest_SOURCES += $(CPPUNITTESTSRC_NUTCONF) +cppunittest_LDADD += $(top_builddir)/common/libnutconf.la +endif WITH_NUTCONF + cppnit_CXXFLAGS = $(AM_CXXFLAGS) $(CPPUNIT_CFLAGS) $(CPPUNIT_CXXFLAGS) $(CPPUNIT_NUT_CXXFLAGS) $(CXXFLAGS) cppnit_LDFLAGS = $(CPPUNIT_LDFLAGS) $(CPPUNIT_LIBS) cppnit_LDADD = $(top_builddir)/clients/libnutclient.la $(top_builddir)/clients/libnutclientstub.la @@ -130,12 +154,12 @@ cppnit_SOURCES = $(CPPCLIENTTESTSRC) $(CPPUNITTESTERSRC) # only some parts of NUT): $(top_builddir)/clients/libnutclient.la \ $(top_builddir)/clients/libnutclientstub.la: dummy - @cd $(@D) && $(MAKE) $(AM_MAKEFLAGS) $(@F) + +@cd $(@D) && $(MAKE) $(AM_MAKEFLAGS) $(@F) else !HAVE_CPPUNIT # Just redistribute test source into tarball if not building tests -EXTRA_DIST += $(CPPUNITTESTSRC) $(CPPCLIENTTESTSRC) $(CPPUNITTESTERSRC) +EXTRA_DIST += $(CPPUNITTESTSRC) $(CPPCLIENTTESTSRC) $(CPPUNITTESTERSRC) $(CPPUNITTESTSRC_NUTCONF) cppnit: @echo "SKIP: $@ not implemented without C++11 and CPPUNIT enabled" >&2 ; exit 1 @@ -145,7 +169,7 @@ endif !HAVE_CPPUNIT else !HAVE_CXX11 # Just redistribute test source into tarball if not building C++ at all -EXTRA_DIST += $(CPPUNITTESTSRC) $(CPPCLIENTTESTSRC) $(CPPUNITTESTERSRC) +EXTRA_DIST += $(CPPUNITTESTSRC) $(CPPCLIENTTESTSRC) $(CPPUNITTESTERSRC) $(CPPUNITTESTSRC_NUTCONF) cppnit: @echo "SKIP: $@ not implemented without C++11 and CPPUNIT enabled" >&2 ; exit 1 diff --git a/tests/NIT/Makefile.am b/tests/NIT/Makefile.am index cf69699664..086519757e 100644 --- a/tests/NIT/Makefile.am +++ b/tests/NIT/Makefile.am @@ -1,4 +1,15 @@ -EXTRA_DIST = nit.sh README +# Network UPS Tools: NUT Integration Tests (NIT) + +# Export certain values for ccache which NUT ci_build.sh can customize, +# to facilitate developer iteration re-runs of "make" later. +# At least GNU and BSD make implementations are okay with this syntax. +@NUT_AM_MAKE_CAN_EXPORT@export CCACHE_NAMESPACE=@CCACHE_NAMESPACE@ +@NUT_AM_MAKE_CAN_EXPORT@export CCACHE_BASEDIR=@CCACHE_BASEDIR@ +@NUT_AM_MAKE_CAN_EXPORT@export CCACHE_DIR=@CCACHE_DIR@ +@NUT_AM_MAKE_CAN_EXPORT@export CCACHE_PATH=@CCACHE_PATH@ +@NUT_AM_MAKE_CAN_EXPORT@export PATH=@PATH_DURING_CONFIGURE@ + +EXTRA_DIST = nit.sh README.adoc if WITH_CHECK_NIT check: check-NIT @@ -14,11 +25,35 @@ check-NIT: $(abs_srcdir)/nit.sh # Make sure pre-requisites for NIT are fresh as we iterate check-NIT-devel: $(abs_srcdir)/nit.sh - @cd .. && ( $(MAKE) -s cppnit$(EXEEXT) || echo "OPTIONAL C++ test client test will be skipped" ) - @cd "$(top_builddir)/clients" && $(MAKE) -s upsc$(EXEEXT) upsrw$(EXEEXT) upsmon$(EXEEXT) - @cd "$(top_builddir)/server" && $(MAKE) -s upsd$(EXEEXT) - @cd "$(top_builddir)/drivers" && $(MAKE) -s dummy-ups$(EXEEXT) - @$(MAKE) check-NIT + +@cd .. && ( $(MAKE) $(AM_MAKEFLAGS) -s cppnit$(EXEEXT) || echo "OPTIONAL C++ test client test will be skipped" ) + +@cd "$(top_builddir)/clients" && $(MAKE) $(AM_MAKEFLAGS) -s upsc$(EXEEXT) upsrw$(EXEEXT) upsmon$(EXEEXT) + +@cd "$(top_builddir)/server" && $(MAKE) $(AM_MAKEFLAGS) -s upsd$(EXEEXT) + +@cd "$(top_builddir)/drivers" && $(MAKE) $(AM_MAKEFLAGS) -s dummy-ups$(EXEEXT) + +@$(MAKE) $(AM_MAKEFLAGS) check-NIT + +SPELLCHECK_SRC = README.adoc + +# NOTE: Due to portability, we do not use a GNU percent-wildcard extension. +# We also have to export some variables that may be tainted by relative +# paths when parsing the other makefile (e.g. MKDIR_P that may be defined +# via expanded $(top_builddir)/install_sh): +#%-spellchecked: % Makefile.am $(top_srcdir)/docs/Makefile.am $(abs_srcdir)/$(NUT_SPELL_DICT) +# +$(MAKE) -s -f $(top_builddir)/docs/Makefile $(AM_MAKEFLAGS) MKDIR_P="$(MKDIR_P)" builddir="$(builddir)" srcdir="$(srcdir)" top_builddir="$(top_builddir)" top_srcdir="$(top_srcdir)" SPELLCHECK_SRC_ONE="$<" SPELLCHECK_SRCDIR="$(srcdir)" SPELLCHECK_BUILDDIR="$(builddir)" $@ + +# NOTE: Portable suffix rules do not allow prerequisites, so we shim them here +# by a wildcard target in case the make implementation can put the two together. +*-spellchecked: Makefile.am $(top_srcdir)/docs/Makefile.am $(abs_srcdir)/$(NUT_SPELL_DICT) + +.sample.sample-spellchecked: + +$(MAKE) -s -f $(top_builddir)/docs/Makefile $(AM_MAKEFLAGS) MKDIR_P="$(MKDIR_P)" builddir="$(builddir)" srcdir="$(srcdir)" top_builddir="$(top_builddir)" top_srcdir="$(top_srcdir)" SPELLCHECK_SRC_ONE="$<" SPELLCHECK_SRCDIR="$(srcdir)" SPELLCHECK_BUILDDIR="$(builddir)" $@ + +.in.in-spellchecked: + +$(MAKE) -s -f $(top_builddir)/docs/Makefile $(AM_MAKEFLAGS) MKDIR_P="$(MKDIR_P)" builddir="$(builddir)" srcdir="$(srcdir)" top_builddir="$(top_builddir)" top_srcdir="$(top_srcdir)" SPELLCHECK_SRC_ONE="$<" SPELLCHECK_SRCDIR="$(srcdir)" SPELLCHECK_BUILDDIR="$(builddir)" $@ + +spellcheck spellcheck-interactive spellcheck-sortdict: + +$(MAKE) -f $(top_builddir)/docs/Makefile $(AM_MAKEFLAGS) MKDIR_P="$(MKDIR_P)" builddir="$(builddir)" srcdir="$(srcdir)" top_builddir="$(top_builddir)" top_srcdir="$(top_srcdir)" SPELLCHECK_SRC="$(SPELLCHECK_SRC)" SPELLCHECK_SRCDIR="$(srcdir)" SPELLCHECK_BUILDDIR="$(builddir)" $@ + +CLEANFILES = *-spellchecked MAINTAINERCLEANFILES = Makefile.in .dirstamp diff --git a/tests/NIT/README b/tests/NIT/README.adoc similarity index 83% rename from tests/NIT/README rename to tests/NIT/README.adoc index 729e8a560d..b442f27434 100644 --- a/tests/NIT/README +++ b/tests/NIT/README.adoc @@ -1,5 +1,5 @@ -NUT Integration Testing suite -============================= +NUT Integration Testing suite (aka NIT) +======================================= This suite aims to simplify running `upsd`, a `dummy-ups` driver and a few clients to query them, as part of regular `make check` routine @@ -7,7 +7,7 @@ or separately with existing binaries (should not impact any existing installation data, processes or communications). WARNING: Current working directory when starting the script should be -the location where it may create temporary data (e.g. the BUILDDIR). +the location where it may create temporary data (e.g. the `BUILDDIR`). See also link:https://git.launchpad.net/ubuntu/+source/nut/tree/debian/tests/test-nut.py[The NUT testing script] diff --git a/tests/NIT/nit.sh b/tests/NIT/nit.sh index 9cee5082a7..611c1d2eed 100755 --- a/tests/NIT/nit.sh +++ b/tests/NIT/nit.sh @@ -34,6 +34,9 @@ export TZ LANG LC_ALL NUT_QUIET_INIT_SSL="true" export NUT_QUIET_INIT_SSL +NUT_QUIET_INIT_UPSNOTIFY="true" +export NUT_QUIET_INIT_UPSNOTIFY + NUT_DEBUG_PID="true" export NUT_DEBUG_PID @@ -50,6 +53,7 @@ log_debug() { if shouldDebug ; then echo "`TZ=UTC LANG=C date` [DEBUG] $@" >&2 fi + return 0 } log_info() { @@ -82,8 +86,8 @@ isBusy_NUT_PORT() { # or available (non-0 = false) [ -n "${NUT_PORT}" ] || return - log_debug "Trying to report if NUT_PORT=${NUT_PORT} is used" - if [ -s /proc/net/tcp ] || [ -s /proc/net/tcp6 ]; then + log_debug "isBusy_NUT_PORT() Trying to report if NUT_PORT=${NUT_PORT} is used" + if [ -e /proc/net/tcp ] || [ -e /proc/net/tcp6 ]; then # Assume Linux - hex-encoded # IPv4: # sl local_address rem_address st tx_queue rx_queue tr tm->when retrnsmt uid timeout inode @@ -94,19 +98,27 @@ isBusy_NUT_PORT() { # 0: 00000000000000000000000000000000:1F46 00000000000000000000000000000000:0000 0A 00000000:00000000 00:00000000 00000000 33 0 37451 1 00000000fa3c0c15 100 0 0 10 0 NUT_PORT_HEX="`printf '%04X' "${NUT_PORT}"`" NUT_PORT_HITS="`cat /proc/net/tcp /proc/net/tcp6 2>/dev/null | awk '{print $2}' | grep -E ":${NUT_PORT_HEX}\$"`" \ - && [ -n "$NUT_PORT_HITS" ] && return 0 + && [ -n "$NUT_PORT_HITS" ] \ + && log_debug "isBusy_NUT_PORT() found that NUT_PORT=${NUT_PORT} is busy per /proc/net/tcp*" \ + && return 0 # We had a way to check, and the way said port is available + log_debug "isBusy_NUT_PORT() found that NUT_PORT=${NUT_PORT} is not busy per /proc/net/tcp*" return 1 fi - (netstat -an || sockstat -l) 2>/dev/null | grep -E "[:.]${NUT_PORT}(\t| |\$)" > /dev/null && return + (netstat -an || sockstat -l || ss -tn || ss -n) 2>/dev/null | grep -E "[:.]${NUT_PORT}(\t| |\$)" > /dev/null \ + && log_debug "isBusy_NUT_PORT() found that NUT_PORT=${NUT_PORT} is busy per netstat, sockstat or ss" \ + && return - (lsof -i :"${NUT_PORT}") 2>/dev/null && return + (lsof -i :"${NUT_PORT}") 2>/dev/null \ + && log_debug "isBusy_NUT_PORT() found that NUT_PORT=${NUT_PORT} is busy per lsof" \ + && return # Not busy... or no tools to confirm? - if (command -v netstat || command -v sockstat || command -v lsof) 2>/dev/null >/dev/null ; then + if (command -v netstat || command -v sockstat || command -v ss || command -v lsof) 2>/dev/null >/dev/null ; then # at least one tool is present, so not busy + log_debug "isBusy_NUT_PORT() found that NUT_PORT=${NUT_PORT} is not busy per netstat, sockstat, ss or lsof" return 1 fi @@ -591,34 +603,76 @@ testcase_upsd_no_configs_in_driver_file() { fi } -testcase_upsd_allow_no_device() { - log_separator - log_info "[testcase_upsd_allow_no_device] Test UPSD allowed to run without driver configs" - generatecfg_upsd_nodev - generatecfg_upsdusers_trivial - generatecfg_ups_trivial - if shouldDebug ; then - ls -la "$NUT_CONFPATH/" || true +upsd_start_loop() { + TESTCASE="${1-upsd_start_loop}" + + if isPidAlive "$PID_UPSD" ; then + return 0 fi + upsd -F & PID_UPSD="$!" - log_debug "[testcase_upsd_allow_no_device] Tried to start UPSD as PID $PID_UPSD" + log_debug "[${TESTCASE}] Tried to start UPSD as PID $PID_UPSD" sleep 2 + # Due to a busy port, server could have died by now COUNTDOWN=60 while [ "$COUNTDOWN" -gt 0 ]; do - if isPidAlive "$PID_UPSD"; then break ; fi - # FIXME: If we are here, even once, then PID_UPSD which we - # knew has already disappeared... wait() for its exit-code? sleep 1 COUNTDOWN="`expr $COUNTDOWN - 1`" + + # Is our server alive AND occupying the port? + PID_OK=true + isPidAlive "$PID_UPSD" || PID_OK=false # not running + PORT_OK=true + isBusy_NUT_PORT 2>/dev/null >/dev/null || PORT_OK=false # not busy + if "${PID_OK}" ; then + if "${PORT_OK}" ; then break ; fi + continue + fi + + # FIXME: If we are here, even once, then PID_UPSD which we + # knew has already disappeared... wait() for its exit-code? + # Give some time for ports to time out, if busy and that is + # why the server died. + PORT_WORD="" + ${PORT_OK} || PORT_WORD="not " + log_warn "[${TESTCASE}] Port ${NUT_PORT} is ${PORT_WORD}listening and UPSD PID $PID_UPSD is not alive, will sleep and retry" + + sleep 10 + upsd -F & + PID_UPSD="$!" + log_warn "[${TESTCASE}] Tried to start UPSD again, now as PID $PID_UPSD" + sleep 5 done if [ "$COUNTDOWN" -le 50 ] ; then # Should not get to this, except on very laggy systems maybe - log_warn "[testcase_upsd_allow_no_device] Had to wait a few retries for the UPSD process to appear" + log_warn "[${TESTCASE}] Had to wait a few retries for the UPSD process to appear" fi + # Return code is 0/OK if the server is alive AND occupying the port + if isPidAlive "$PID_UPSD" && isBusy_NUT_PORT 2>/dev/null >/dev/null ; then + log_debug "[${TESTCASE}] Port ${NUT_PORT} is listening and UPSD PID $PID_UPSD is alive" + return + fi + + log_error "[${TESTCASE}] Port ${NUT_PORT} is not listening and/or UPSD PID $PID_UPSD is not alive" + return 1 +} + +testcase_upsd_allow_no_device() { + log_separator + log_info "[testcase_upsd_allow_no_device] Test UPSD allowed to run without driver configs" + generatecfg_upsd_nodev + generatecfg_upsdusers_trivial + generatecfg_ups_trivial + if shouldDebug ; then + ls -la "$NUT_CONFPATH/" || true + fi + + upsd_start_loop "testcase_upsd_allow_no_device" + res_testcase_upsd_allow_no_device=0 if [ "$COUNTDOWN" -gt 0 ] \ && isPidAlive "$PID_UPSD" \ @@ -717,10 +771,8 @@ sandbox_start_upsd() { sandbox_generate_configs log_info "Starting UPSD for sandbox" - upsd -F & - PID_UPSD="$!" - log_debug "Tried to start UPSD as PID $PID_UPSD" - sleep 5 + + upsd_start_loop "sandbox" } sandbox_start_drivers() { @@ -831,6 +883,8 @@ testcase_sandbox_start_upsd_after_drivers() { kill -15 $PID_UPSD 2>/dev/null wait $PID_UPSD + # Not calling upsd_start_loop() here, before drivers + # If the server starts, fine; if not - we retry below upsd -F & PID_UPSD="$!" log_debug "[testcase_sandbox_start_upsd_after_drivers] Tried to start UPSD as PID $PID_UPSD" @@ -1212,9 +1266,12 @@ testcase_sandbox_nutscanner_list() { # Note: the reported "driver" string is not too helpful as a "nutclient". # In practice this could be a "dummy-ups" repeater or "clone" driver, # or some of the config elements needed for upsmon (lacking creds/role) + # Also note that before PR #2247 nut-scanner returned "nutdev" + # section names, but now it returns "nutdev-" to differentiate + # the scanned buses (serial, snmp, usb, etc.) if ( test -n "$CMDOUT" \ - && echo "$CMDOUT" | grep -E '^\[nutdev1\]$' \ + && echo "$CMDOUT" | grep -E '^\[nutdev-nut1\]$' \ && echo "$CMDOUT" | grep 'port = "dummy@' \ || return @@ -1231,9 +1288,9 @@ testcase_sandbox_nutscanner_list() { if [ x"${TOP_SRCDIR}" = x ]; then log_info "[testcase_sandbox_nutscanner_list] Note: only testing one dummy device" >&2 else - echo "$CMDOUT" | grep -E '^\[nutdev2\]$' \ + echo "$CMDOUT" | grep -E '^\[nutdev-nut2\]$' \ && echo "$CMDOUT" | grep 'port = "UPS1@' \ - && echo "$CMDOUT" | grep -E '^\[nutdev3\]$' \ + && echo "$CMDOUT" | grep -E '^\[nutdev-nut3\]$' \ && echo "$CMDOUT" | grep 'port = "UPS2@' \ || { log_error "[testcase_sandbox_nutscanner_list] something about UPS1/UPS2 not found" >&2 @@ -1329,6 +1386,7 @@ testgroup_sandbox_nutscanner() { ################################################################ case "${NIT_CASE}" in + isBusy_NUT_PORT) DEBUG=yes isBusy_NUT_PORT ;; cppnit) testgroup_sandbox_cppnit ;; python) testgroup_sandbox_python ;; nutscanner|nut-scanner) testgroup_sandbox_nutscanner ;; diff --git a/tests/cpputest.cpp b/tests/cpputest.cpp index d0b0adbec7..099e00ebd8 100644 --- a/tests/cpputest.cpp +++ b/tests/cpputest.cpp @@ -19,13 +19,24 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include "common.h" + #include +#include #include #include #include #include #include -#include "common.h" + +extern "C" { +#include "timehead.h" + +/* Let tests also see this flag */ +extern bool verbose; +} + +bool verbose = false; // Inspired by https://stackoverflow.com/a/66702001 class MyCustomProgressTestListener : public CppUnit::TextTestProgressListener { @@ -39,18 +50,19 @@ class MyCustomProgressTestListener : public CppUnit::TextTestProgressListener { // [-Werror,-Wweak-vtables] void MyCustomProgressTestListener::startTest(CppUnit::Test *test) { //fprintf(stderr, "starting test %s\n", test->getName().c_str()); - std::cerr << "starting test " << test->getName() << std::endl; + std::cerr << "starting test " << (test == nullptr ? "" : test->getName()) << std::endl << std::flush; } int main(int argc, char* argv[]) { - bool verbose = false; if (argc > 1) { if (strcmp("-v", argv[1]) == 0 || strcmp("--verbose", argv[1]) == 0 ) { verbose = true; } } + ::srand(static_cast(::time(nullptr))); + /* Get the top level suite from the registry */ std::cerr << "D: Getting test suite..." << std::endl; CppUnit::Test *suite = CppUnit::TestFactoryRegistry::getRegistry().makeTest(); @@ -68,7 +80,8 @@ int main(int argc, char* argv[]) if (verbose) { /* Add a listener to report test names */ std::cerr << "D: Setting test runner listener for test names..." << std::endl; - MyCustomProgressTestListener progress; + /* Only allocate when needed; static to avoid freeing */ + static MyCustomProgressTestListener progress; runner.eventManager().addListener(&progress); } diff --git a/tests/generic_gpio_liblocal.c b/tests/generic_gpio_liblocal.c index afd7ec32f9..2716a6db76 100644 --- a/tests/generic_gpio_liblocal.c +++ b/tests/generic_gpio_liblocal.c @@ -75,6 +75,7 @@ void setNextLinesReadToFail(void) { int gpiod_line_get_value_bulk(struct gpiod_line_bulk *bulk, int *values) { + unsigned int i; int pinPos = 1; NUT_UNUSED_VARIABLE(bulk); @@ -83,7 +84,7 @@ int gpiod_line_get_value_bulk(struct gpiod_line_bulk *bulk, errno = EPERM; return -1; } - for(unsigned int i=0; irules[j]->stateName); - for(int k=0; kupsLinesCount; k++) { + for(k=0; kupsLinesCount; k++) { printf(" %d", upsfdtest->upsLinesStates[k]); } printf("\n"); @@ -386,4 +389,10 @@ int main(int argc, char **argv) { cases_passed+cases_failed, cases_passed, cases_failed); fclose(testData); done = 1; + + /* Return 0 (exit-code OK, boolean false) if no tests failed and some ran */ + if ( (cases_failed == 0) && (cases_passed > 0) ) + return 0; + + return 1; } diff --git a/tests/getvaluetest.c b/tests/getvaluetest.c index 76a6a96d33..0d2c445ad6 100644 --- a/tests/getvaluetest.c +++ b/tests/getvaluetest.c @@ -110,7 +110,7 @@ static int RunBuiltInTests(char *argv[]) { NUT_UNUSED_VARIABLE(argv); - for (i = 0; i < sizeof(testData)/sizeof(testData[0]); i++) { + for (i = 0; i < SIZEOF_ARRAY(testData); i++) { next = testData[i].buf; for (bufSize = 0; *next != 0; bufSize++) { reportBuf[bufSize] = (uint8_t) strtol(next, (char **)&next, 16); diff --git a/tests/nutconf_parser_ut.cpp b/tests/nutconf_parser_ut.cpp new file mode 100644 index 0000000000..f429b28cc9 --- /dev/null +++ b/tests/nutconf_parser_ut.cpp @@ -0,0 +1,345 @@ +/* + tests/nutconf.cpp - based on CppUnit unit test example + + Copyright (C) + 2012 Emilien Kia + + 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 + +// Define to de-activate protection of parsing tool members: +#define UNITEST_MODE 1 + +#include "nutconf.hpp" +using namespace nut; + +#include +#include +using namespace std; + +class NutConfTest : public CppUnit::TestFixture +{ + CPPUNIT_TEST_SUITE( NutConfTest ); + CPPUNIT_TEST( testOptions ); + CPPUNIT_TEST( testParseCHARS ); + CPPUNIT_TEST( testParseSTRCHARS ); + CPPUNIT_TEST( testPasreToken ); + CPPUNIT_TEST( testPasreTokenWithoutColon ); + CPPUNIT_TEST( testGenericConfigParser ); + CPPUNIT_TEST( testUpsmonConfigParser ); + CPPUNIT_TEST( testNutConfConfigParser ); + CPPUNIT_TEST( testUpsdConfigParser ); + CPPUNIT_TEST_SUITE_END(); + +public: + void setUp() override; + void tearDown() override; + + void testOptions(); + void testParseCHARS(); + void testParseSTRCHARS(); + void testPasreToken(); + void testPasreTokenWithoutColon(); + + void testGenericConfigParser(); + void testUpsmonConfigParser(); + void testNutConfConfigParser(); + void testUpsdConfigParser(); +}; + +// Registers the fixture into the 'registry' +CPPUNIT_TEST_SUITE_REGISTRATION( NutConfTest ); + + +void NutConfTest::setUp() +{ +} + + +void NutConfTest::tearDown() +{ +} + +void NutConfTest::testOptions() +{ + { + NutParser parse("Bonjour monde!", NutParser::OPTION_DEFAULT); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Has parsing options", 0u, parse.getOptions()); + CPPUNIT_ASSERT_MESSAGE("Has OPTION_IGNORE_COLON parsing option", !parse.hasOptions(NutParser::OPTION_IGNORE_COLON)); + } + + { + NutParser parse("Bonjour monde!", NutParser::OPTION_IGNORE_COLON); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Has bad parsing options", static_cast(NutParser::OPTION_IGNORE_COLON), parse.getOptions()); + CPPUNIT_ASSERT_MESSAGE("Has not OPTION_IGNORE_COLON parsing option", parse.hasOptions(NutParser::OPTION_IGNORE_COLON)); + } + +} + +void NutConfTest::testParseCHARS() +{ + { + NutParser parse("Bonjour monde!"); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Cannot find first string 'Bonjour'", string("Bonjour"), parse.parseCHARS()); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Cannot get a character ''", ' ', parse.get()); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Cannot find second string 'monde!'", string("monde!"), parse.parseCHARS()); + } + + { + NutParser parse("To\\ to"); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Cannot find escaped string 'To to'", string("To to"), parse.parseCHARS()); + } + + { + NutParser parse("To\"to"); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Cannot find escaped string 'To'", string("To"), parse.parseCHARS()); + } + + { + NutParser parse("To\\\"to"); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Cannot find escaped string 'To\"to'", string("To\"to"), parse.parseCHARS()); + } + +} + + +void NutConfTest::testParseSTRCHARS() +{ + { + NutParser parse("Bonjour\"monde!\""); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Cannot find first string 'Bonjour'", string("Bonjour"), parse.parseSTRCHARS()); + parse.get(); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Cannot find second string 'monde!'", string("monde!"), parse.parseSTRCHARS()); + } + + { + NutParser parse("To to"); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Cannot find spaced string 'To tue de l’appareil qui se serait malencontreuo'", string("To to"), parse.parseSTRCHARS()); + } + + { + NutParser parse("To\\\"to"); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Cannot find quoted-escaped string 'To\"to'", string("To\"to"), parse.parseSTRCHARS()); + } +} + +void NutConfTest::testPasreToken() +{ + static const char* src = + "Bonjour monde\n" + "[ceci]# Plouf\n" + "\n" + "titi = \"tata toto\"\n" + "NOTIFYFLAG LOWBATT SYSLOG+WALL\n" + "::1" + ; + NutParser parse(src); + +// NutConfigParser::Token tok = parse.parseToken(); +// std::cout << "token = " << tok.type << " - " << tok.str << std::endl; + + CPPUNIT_ASSERT_MESSAGE("Cannot find 1st token 'Bonjour'", parse.parseToken() == NutParser::Token(NutParser::Token::TOKEN_STRING, "Bonjour")); + CPPUNIT_ASSERT_MESSAGE("Cannot find 2nd token 'monde'", parse.parseToken() == NutParser::Token(NutParser::Token::TOKEN_STRING, "monde")); + CPPUNIT_ASSERT_MESSAGE("Cannot find 3th token '\n'", parse.parseToken() == NutParser::Token(NutParser::Token::TOKEN_EOL, "\n")); + CPPUNIT_ASSERT_MESSAGE("Cannot find 4rd token '['", parse.parseToken() == NutParser::Token(NutParser::Token::TOKEN_BRACKET_OPEN, "[")); + CPPUNIT_ASSERT_MESSAGE("Cannot find 5th token 'ceci'", parse.parseToken() == NutParser::Token(NutParser::Token::TOKEN_STRING, "ceci")); + CPPUNIT_ASSERT_MESSAGE("Cannot find 6th token ']'", parse.parseToken() == NutParser::Token(NutParser::Token::TOKEN_BRACKET_CLOSE, "]")); + CPPUNIT_ASSERT_MESSAGE("Cannot find 7th token ' Plouf'", parse.parseToken() == NutParser::Token(NutParser::Token::TOKEN_COMMENT, " Plouf")); + CPPUNIT_ASSERT_MESSAGE("Cannot find 8th token '\n'", parse.parseToken() == NutParser::Token(NutParser::Token::TOKEN_EOL, "\n")); + CPPUNIT_ASSERT_MESSAGE("Cannot find 9th token 'titi'", parse.parseToken() == NutParser::Token(NutParser::Token::TOKEN_STRING, "titi")); + CPPUNIT_ASSERT_MESSAGE("Cannot find 10th token '='", parse.parseToken() == NutParser::Token(NutParser::Token::TOKEN_EQUAL, "=")); + CPPUNIT_ASSERT_MESSAGE("Cannot find 11th token 'tata toto'", parse.parseToken() == NutParser::Token(NutParser::Token::TOKEN_QUOTED_STRING, "tata toto")); + CPPUNIT_ASSERT_MESSAGE("Cannot find 12th token '\n'", parse.parseToken() == NutParser::Token(NutParser::Token::TOKEN_EOL, "\n")); + CPPUNIT_ASSERT_MESSAGE("Cannot find 13th token 'NOTIFYFLAG'", parse.parseToken() == NutParser::Token(NutParser::Token::TOKEN_STRING, "NOTIFYFLAG")); + CPPUNIT_ASSERT_MESSAGE("Cannot find 14th token 'LOWBATT'", parse.parseToken() == NutParser::Token(NutParser::Token::TOKEN_STRING, "LOWBATT")); + CPPUNIT_ASSERT_MESSAGE("Cannot find 15th token 'SYSLOG+WALL'", parse.parseToken() == NutParser::Token(NutParser::Token::TOKEN_STRING, "SYSLOG+WALL")); + CPPUNIT_ASSERT_MESSAGE("Cannot find 16th token '\n'", parse.parseToken() == NutParser::Token(NutParser::Token::TOKEN_EOL, "\n")); + CPPUNIT_ASSERT_MESSAGE("Cannot find 17th token ':'", parse.parseToken() == NutParser::Token(NutParser::Token::TOKEN_COLON, ":")); + CPPUNIT_ASSERT_MESSAGE("Cannot find 18th token ':'", parse.parseToken() == NutParser::Token(NutParser::Token::TOKEN_COLON, ":")); + CPPUNIT_ASSERT_MESSAGE("Cannot find 19th token '1'", parse.parseToken() == NutParser::Token(NutParser::Token::TOKEN_STRING, "1")); + +} + +void NutConfTest::testPasreTokenWithoutColon() +{ + static const char* src = + "Bonjour monde\n" + "[ceci]# Plouf\n" + "\n" + "titi = \"tata toto\"\n" + "NOTIFYFLAG LOWBATT SYSLOG+WALL\n" + "::1" + ; + NutParser parse(src, NutParser::OPTION_IGNORE_COLON); + +// NutConfigParser::Token tok = parse.parseToken(); +// std::cout << "token = " << tok.type << " - " << tok.str << std::endl; + + CPPUNIT_ASSERT_MESSAGE("Cannot find 1st token 'Bonjour'", parse.parseToken() == NutParser::Token(NutParser::Token::TOKEN_STRING, "Bonjour")); + CPPUNIT_ASSERT_MESSAGE("Cannot find 2nd token 'monde'", parse.parseToken() == NutParser::Token(NutParser::Token::TOKEN_STRING, "monde")); + CPPUNIT_ASSERT_MESSAGE("Cannot find 3th token '\n'", parse.parseToken() == NutParser::Token(NutParser::Token::TOKEN_EOL, "\n")); + CPPUNIT_ASSERT_MESSAGE("Cannot find 4rd token '['", parse.parseToken() == NutParser::Token(NutParser::Token::TOKEN_BRACKET_OPEN, "[")); + CPPUNIT_ASSERT_MESSAGE("Cannot find 5th token 'ceci'", parse.parseToken() == NutParser::Token(NutParser::Token::TOKEN_STRING, "ceci")); + CPPUNIT_ASSERT_MESSAGE("Cannot find 6th token ']'", parse.parseToken() == NutParser::Token(NutParser::Token::TOKEN_BRACKET_CLOSE, "]")); + CPPUNIT_ASSERT_MESSAGE("Cannot find 7th token ' Plouf'", parse.parseToken() == NutParser::Token(NutParser::Token::TOKEN_COMMENT, " Plouf")); + CPPUNIT_ASSERT_MESSAGE("Cannot find 8th token '\n'", parse.parseToken() == NutParser::Token(NutParser::Token::TOKEN_EOL, "\n")); + CPPUNIT_ASSERT_MESSAGE("Cannot find 9th token 'titi'", parse.parseToken() == NutParser::Token(NutParser::Token::TOKEN_STRING, "titi")); + CPPUNIT_ASSERT_MESSAGE("Cannot find 10th token '='", parse.parseToken() == NutParser::Token(NutParser::Token::TOKEN_EQUAL, "=")); + CPPUNIT_ASSERT_MESSAGE("Cannot find 11th token 'tata toto'", parse.parseToken() == NutParser::Token(NutParser::Token::TOKEN_QUOTED_STRING, "tata toto")); + CPPUNIT_ASSERT_MESSAGE("Cannot find 12th token '\n'", parse.parseToken() == NutParser::Token(NutParser::Token::TOKEN_EOL, "\n")); + CPPUNIT_ASSERT_MESSAGE("Cannot find 13th token 'NOTIFYFLAG'", parse.parseToken() == NutParser::Token(NutParser::Token::TOKEN_STRING, "NOTIFYFLAG")); + CPPUNIT_ASSERT_MESSAGE("Cannot find 14th token 'LOWBATT'", parse.parseToken() == NutParser::Token(NutParser::Token::TOKEN_STRING, "LOWBATT")); + CPPUNIT_ASSERT_MESSAGE("Cannot find 15th token 'SYSLOG+WALL'", parse.parseToken() == NutParser::Token(NutParser::Token::TOKEN_STRING, "SYSLOG+WALL")); + CPPUNIT_ASSERT_MESSAGE("Cannot find 16th token '\n'", parse.parseToken() == NutParser::Token(NutParser::Token::TOKEN_EOL, "\n")); + CPPUNIT_ASSERT_MESSAGE("Cannot find 17th token '::1'", parse.parseToken() == NutParser::Token(NutParser::Token::TOKEN_STRING, "::1")); + +} + +void NutConfTest::testGenericConfigParser() +{ + static const char* src = + "glovar1 = toto\n" + "glovar2 = \"truc bidule\"\n" + "\n" + "[section1] # One section\n" + "var1 = \"one value\"\n" + " \n" + "var2\n" + "\n" + "[section2]\n" + "var1 = other value\n" + "var toto"; + + GenericConfiguration conf; + conf.parseFromString(src); + + CPPUNIT_ASSERT_MESSAGE("Cannot find a global section", conf.sections.find("") != conf.sections.end() ); + CPPUNIT_ASSERT_MESSAGE("Cannot find global section's glovar1 variable", conf.sections[""]["glovar1"].values.front() == "toto" ); + CPPUNIT_ASSERT_MESSAGE("Cannot find global section's glovar2 variable", conf.sections[""]["glovar2"].values.front() == "truc bidule" ); + + CPPUNIT_ASSERT_MESSAGE("Cannot find section1", conf.sections.find("section1") != conf.sections.end() ); + CPPUNIT_ASSERT_MESSAGE("Cannot find section1's var1 variable", conf.sections["section1"]["var1"].values.front() == "one value" ); + CPPUNIT_ASSERT_MESSAGE("Cannot find section1's var2 variable", conf.sections["section1"]["var2"].values.size() == 0 ); + + CPPUNIT_ASSERT_MESSAGE("Cannot find section2", conf.sections.find("section2") != conf.sections.end() ); + CPPUNIT_ASSERT_MESSAGE("Cannot find section2's var1 variable", conf.sections["section2"]["var1"].values.front() == "other" ); + CPPUNIT_ASSERT_MESSAGE("Cannot find section2's var1 variable", *(++(conf.sections["section2"]["var1"].values.begin())) == "value" ); + CPPUNIT_ASSERT_MESSAGE("Cannot find section2's var variable", conf.sections["section2"]["var"].values.front() == "toto" ); + +} + +void NutConfTest::testUpsmonConfigParser() +{ + static const char* src = + "RUN_AS_USER nutmon\n" + "MONITOR myups@bigserver 1 monmaster blah master\n" + "MONITOR su700@server.example.com 1 upsmon secretpass slave\n" + "MONITOR myups@localhost 1 upsmon pass master\n" + "MINSUPPLIES 1\n" + "\n" + "# MINSUPPLIES 25\n" + "SHUTDOWNCMD \"/sbin/shutdown -h +0\"\n" + "NOTIFYCMD /usr/local/ups/bin/notifyme\n" + "POLLFREQ 30\n" + "POLLFREQALERT 5\n" + "HOSTSYNC 15\n" + "DEADTIME 15\n" + "POWERDOWNFLAG /etc/killpower\n" + "NOTIFYMSG ONLINE \"UPS %s on line power\"\n" + "NOTIFYFLAG LOWBATT SYSLOG+WALL\n" + "RBWARNTIME 43200\n" + "NOCOMMWARNTIME 300\n" + "FINALDELAY 5" + ; + + UpsmonConfiguration conf; + conf.parseFromString(src); + + CPPUNIT_ASSERT_EQUAL_MESSAGE("Cannot find RUN_AS_USER 'nutmon'", string("nutmon"), *conf.runAsUser); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Cannot find MINSUPPLIES 1", 1u, *conf.minSupplies); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Cannot find SHUTDOWNCMD '/sbin/shutdown -h +0'", string("/sbin/shutdown -h +0"), *conf.shutdownCmd); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Cannot find NOTIFYCMD '/usr/local/ups/bin/notifyme'", string("/usr/local/ups/bin/notifyme"), *conf.notifyCmd); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Cannot find POWERDOWNFLAG '/etc/killpower'", string("/etc/killpower"), *conf.powerDownFlag); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Cannot find POLLFREQ 30", 30u, *conf.poolFreq); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Cannot find POLLFREQALERT 5", 5u, *conf.poolFreqAlert); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Cannot find HOSTSYNC 15", 15u, *conf.hotSync); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Cannot find DEADTIME 15", 15u, *conf.deadTime); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Cannot find RBWARNTIME 43200", 43200u, *conf.rbWarnTime); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Cannot find NOCOMMWARNTIME 300", 300u, *conf.noCommWarnTime); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Cannot find FINALDELAY 5", 5u, *conf.finalDelay); + + CPPUNIT_ASSERT_MESSAGE("Find a NOTIFYFLAG ONLINE", !conf.notifyFlags[nut::UpsmonConfiguration::NOTIFY_ONLINE].set()); + CPPUNIT_ASSERT_MESSAGE("Cannot find a NOTIFYFLAG LOWBATT", conf.notifyFlags[nut::UpsmonConfiguration::NOTIFY_LOWBATT].set()); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Cannot find a NOTIFYFLAG LOWBATT SYSLOG+WALL", 3u, static_cast(conf.notifyFlags[nut::UpsmonConfiguration::NOTIFY_LOWBATT])); + + + CPPUNIT_ASSERT_MESSAGE("Find a NOTIFYMSG LOWBATT", !conf.notifyMessages[nut::UpsmonConfiguration::NOTIFY_LOWBATT].set()); + CPPUNIT_ASSERT_MESSAGE("Cannot find a NOTIFYMSG ONLINE", conf.notifyMessages[nut::UpsmonConfiguration::NOTIFY_ONLINE].set()); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Cannot find a NOTIFYMSG ONLINE \"UPS %s on line power\"", string("UPS %s on line power"), *conf.notifyMessages[nut::UpsmonConfiguration::NOTIFY_ONLINE]); +} + + +void NutConfTest::testNutConfConfigParser() +{ + static const char* src = + "\n\nMODE=standalone\n"; + + NutConfiguration conf; + conf.parseFromString(src); + + CPPUNIT_ASSERT_MESSAGE("Cannot find a MODE", conf.mode.set()); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Cannot find a MODE=standalone", nut::NutConfiguration::MODE_STANDALONE, *conf.mode); +} + +void NutConfTest::testUpsdConfigParser() +{ + static const char* src = + "MAXAGE 15\n" + "STATEPATH /var/run/nut\n" + "LISTEN 127.0.0.1 3493\n" + "LISTEN ::1 3493\n" + "MAXCONN 1024\n" + "CERTFILE /home/toto/cert.file" + ; + + UpsdConfiguration conf; + conf.parseFromString(src); + + CPPUNIT_ASSERT_EQUAL_MESSAGE("Cannot find MAXAGE 15", 15u, *conf.maxAge); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Cannot find MAXCONN 1024", 1024u, *conf.maxConn); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Cannot find STATEPATH /var/run/nut", string("/var/run/nut"), *conf.statePath); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Cannot find CERTFILE /home/toto/cert.file", string("/home/toto/cert.file"), *conf.certFile); + + // Find Listen 127.0.0.1 3493 + { + typedef std::list ListenList; + UpsdConfiguration::Listen listen = {"127.0.0.1", 3493}; + ListenList::const_iterator it = find(conf.listens.begin(), conf.listens.end(), listen); + CPPUNIT_ASSERT_MESSAGE("LISTEN 127.0.0.1 3493", it != conf.listens.end()); + } + + // Find Listen ::1 3493 + { + typedef std::list ListenList; + UpsdConfiguration::Listen listen = {"::1", 3493}; + ListenList::const_iterator it = find(conf.listens.begin(), conf.listens.end(), listen); + CPPUNIT_ASSERT_MESSAGE("LISTEN ::1 3493", it != conf.listens.end()); + } + +} diff --git a/tests/nutconf_ut.cpp b/tests/nutconf_ut.cpp new file mode 100644 index 0000000000..ba8c8947d1 --- /dev/null +++ b/tests/nutconf_ut.cpp @@ -0,0 +1,237 @@ +/* + NUT configuration unit test + + Copyright (C) + 2012 Vaclav Krpec + + 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 "nutstream.hpp" +#include "nutconf.hpp" +#include "nutwriter.hpp" + +#include + +/** + * \brief NUT configuration unit test + */ +class NutConfigUnitTest: public CppUnit::TestFixture { + private: + + CPPUNIT_TEST_SUITE(NutConfigUnitTest); + CPPUNIT_TEST( testNutConfiguration ); + CPPUNIT_TEST( testUpsmonConfiguration ); + CPPUNIT_TEST( testUpsdConfiguration ); + CPPUNIT_TEST( testUpsConfiguration ); + CPPUNIT_TEST( testUpsdUsersConfiguration ); + CPPUNIT_TEST_SUITE_END(); + + /** + * \brief Load configuration from file + * + * \param config Configuration object + * \param file_name Configuration file name + */ + void load(nut::Serialisable * config, const std::string & file_name); + + /** + * \brief Check configuration serialization contents + * + * \param config Configuration object + * \param content Expected serialization + */ + void check(const nut::Serialisable * config, const std::string & content); + + public: + + /** nut.conf test */ + void testNutConfiguration(); + + /** upsmon.conf test */ + void testUpsmonConfiguration(); + + /** upsd.conf test */ + void testUpsdConfiguration(); + + /** ups.conf test */ + void testUpsConfiguration(); + + /** upsd.users test */ + void testUpsdUsersConfiguration(); + + inline void setUp() override {} + inline void tearDown() override {} + + virtual ~NutConfigUnitTest() override; +}; // end of class NutConfigUnitTest + +// Register the test suite +CPPUNIT_TEST_SUITE_REGISTRATION(NutConfigUnitTest); + + +void NutConfigUnitTest::load(nut::Serialisable * config, const std::string & file_name) { + nut::NutFile file(file_name, nut::NutFile::READ_ONLY); + + CPPUNIT_ASSERT(config->parseFrom(file)); +} + + +void NutConfigUnitTest::check(const nut::Serialisable * config, const std::string & content) { + nut::NutMemory mem; + + CPPUNIT_ASSERT(config->writeTo(mem)); + + std::string str; + + nut::NutStream::status_t status = mem.getString(str); + + CPPUNIT_ASSERT(nut::NutStream::NUTS_OK == status); + + if (content != str) { + std::cerr << "--- expected ---" << std::endl << content << "--- end ---" << std::endl; + std::cerr << "--- serialized ---" << std::endl << str << "--- end ---" << std::endl; + + CPPUNIT_ASSERT_MESSAGE("Configuration serialization check failed", 0); + } +} + + +void NutConfigUnitTest::testNutConfiguration() { + nut::NutConfiguration config; + + load(static_cast(&config), ABS_TOP_SRCDIR "/conf/nut.conf.sample"); + + config.mode = nut::NutConfiguration::MODE_STANDALONE; + + check(static_cast(&config), + "MODE=standalone\n" + ); +} + + +void NutConfigUnitTest::testUpsmonConfiguration() { + nut::UpsmonConfiguration config; + + // Note: this file gets generated from a .in template + load(static_cast(&config), ABS_TOP_BUILDDIR "/conf/upsmon.conf.sample"); + + config.shutdownCmd = "/sbin/shutdown -h +2 'System shutdown in 2 minutes!'"; + config.powerDownFlag = "/run/nut/killpower"; + config.poolFreqAlert = 10; + config.deadTime = 30; + + check(static_cast(&config), + "SHUTDOWNCMD \"/sbin/shutdown -h +2 'System shutdown in 2 minutes!'\"\n" + "POWERDOWNFLAG /run/nut/killpower\n" + "MINSUPPLIES 1\n" + "POLLFREQ 5\n" + "POLLFREQALERT 10\n" + "HOSTSYNC 15\n" + "DEADTIME 30\n" + "RBWARNTIME 43200\n" + "NOCOMMWARNTIME 300\n" + "FINALDELAY 5\n" + ); +} + + +void NutConfigUnitTest::testUpsdConfiguration() { + nut::UpsdConfiguration config; + + load(static_cast(&config), ABS_TOP_SRCDIR "/conf/upsd.conf.sample"); + + config.maxAge = 15; + config.statePath = "/var/run/nut"; + config.maxConn = 1024; + config.certFile = "/usr/share/ssl-cert/ssleay.cnf"; + + nut::UpsdConfiguration::Listen listen; + + listen.address = "127.0.0.1"; + listen.port = 3493; + + config.listens.push_back(listen); + + listen.address = "::1"; + + config.listens.push_back(listen); + + check(static_cast(&config), + "MAXAGE 15\n" + "MAXCONN 1024\n" + "STATEPATH /var/run/nut\n" + "CERTFILE /usr/share/ssl-cert/ssleay.cnf\n" + "LISTEN 127.0.0.1 3493\n" + "LISTEN ::1 3493\n" + ); +} + + +void NutConfigUnitTest::testUpsConfiguration() { + nut::UpsConfiguration config; + + load(static_cast(&config), ABS_TOP_SRCDIR "/conf/ups.conf.sample"); + + static const std::string my_ups("powerpal"); + + config.setDriver(my_ups, "blazer_ser"); + config.setPort(my_ups, "/dev/ttyS0"); + config.setDescription(my_ups, "Web server"); + + // Note: "maxretry = 3" comes from current ups.conf.sample non-comment lines + check(static_cast(&config), + "maxretry = 3\n\n" + "[powerpal]\n" + "\tdesc = \"Web server\"\n" + "\tdriver = blazer_ser\n" + "\tport = /dev/ttyS0\n" + "\n" + ); +} + + +void NutConfigUnitTest::testUpsdUsersConfiguration() { + nut::UpsdUsersConfiguration config; + + load(static_cast(&config), ABS_TOP_SRCDIR "/conf/upsd.users.sample"); + + config.setPassword("upsmon", "ytrewq"); + config.setUpsmonMode(nut::UpsdUsersConfiguration::UPSMON_MASTER); + + config.setPassword("admin", "qwerty=ui"); + config.setActions("admin", nut::ConfigParamList(1, "SET")); + config.setInstantCommands("admin", nut::ConfigParamList(1, "ALL")); + + check(static_cast(&config), + "[admin]\n" + "\tactions = SET\n" + "\tinstcmds = ALL\n" + "\tpassword = \"qwerty=ui\"\n" + "\n" + "[upsmon]\n" + "\tpassword = ytrewq\n" + "\tupsmon master\n" + "\n" + ); +} + +// Implement out of class declaration to avoid +// error: 'SomeClass' has no out-of-line virtual method +// definitions; its vtable will be emitted in every translation unit +// [-Werror,-Wweak-vtables] +NutConfigUnitTest::~NutConfigUnitTest() {} diff --git a/tests/nutipc_ut.cpp b/tests/nutipc_ut.cpp new file mode 100644 index 0000000000..9c49f0f0a7 --- /dev/null +++ b/tests/nutipc_ut.cpp @@ -0,0 +1,307 @@ +/* + NUT IPC unit test + + Copyright (C) 2012 + + \author Vaclav Krpec + + 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 "nutipc.hpp" +#include "nutstream.hpp" + +#include + +#include + +extern "C" { +#include +#include +#include + +extern bool verbose; +} + + +/** + * \brief NUT IPC module unit test + */ +class NutIPCUnitTest: public CppUnit::TestFixture { + private: + + CPPUNIT_TEST_SUITE(NutIPCUnitTest); + CPPUNIT_TEST( testExec ); + CPPUNIT_TEST( testSignalSend ); + CPPUNIT_TEST( testSignalRecvQuick ); + CPPUNIT_TEST( testSignalRecvStaggered ); + CPPUNIT_TEST_SUITE_END(); + + /** + * \brief Test signal handler + * + * \param signal Signal caught + */ + static void testSignalHandler(int signal); + + public: + + /** External command execution test */ + void testExec(); + + /** Signal sending test */ + void testSignalSend(); + + /** Signal receiving test */ + void testSignalRecvQuick(); + void testSignalRecvStaggered(); + + inline void setUp() override {} + inline void tearDown() override {} + + virtual ~NutIPCUnitTest() override; +}; // end of class NutIPCUnitTest + +// Register the test suite +CPPUNIT_TEST_SUITE_REGISTRATION(NutIPCUnitTest); + + +void NutIPCUnitTest::testExec() { +#ifdef WIN32 + /* FIXME: Some other program, maybe NUT's "message" handler, or "cmd -k" etc.? + * And get Process working in the first place */ + std::cout << "NutIPCUnitTest::testExec(): skipped on this platform" << std::endl; +#else + static const std::string bin = "/bin/sh"; + + nut::Process::Executor::Arguments args; + + args.push_back("-c"); + args.push_back("exit 123"); + + nut::Process::Execution child(bin, args); + + CPPUNIT_ASSERT(123 == child.wait()); + + CPPUNIT_ASSERT(0 == nut::Process::execute("test 'Hello world' = 'Hello world'")); +#endif /* WIN32 */ +} + + +/** Last signal caught */ +static int signal_caught = 0; + +void NutIPCUnitTest::testSignalHandler(int signal) { + signal_caught = signal; +} + +void NutIPCUnitTest::testSignalSend() { +#ifdef WIN32 + /* FIXME: Needs implementation for signals via pipes */ + std::cout << "NutIPCUnitTest::testSignalSend(): skipped on this platform" << std::endl; +#else + struct sigaction action; + + pid_t my_pid = nut::Process::getPID(); + + // Set SIGUSR1 signal handler + ::memset(&action, 0, sizeof(action)); +# ifdef sigemptyset + // no :: here because macro + sigemptyset(&action.sa_mask); +# else + ::sigemptyset(&action.sa_mask); +# endif + + action.sa_handler = &testSignalHandler; + + CPPUNIT_ASSERT(0 == ::sigaction(static_cast(nut::Signal::USER1), &action, nullptr)); + + // Send signal directly + CPPUNIT_ASSERT(0 == nut::Signal::send(nut::Signal::USER1, my_pid)); + + CPPUNIT_ASSERT(static_cast(nut::Signal::USER1) == signal_caught); + + signal_caught = 0; + + std::stringstream my_pid_ss; + + // Save PID to a PIDfile; use an unique filename as much as we can + // (avoid conflicts in parallel running tests on NUT CI farm, etc.) + my_pid_ss << nut::NutFile::tmp_dir() << nut::NutFile::path_sep() + << "nutipc_ut_" << my_pid << ".pid"; + static const std::string pid_file_name(my_pid_ss.str()); + + my_pid_ss.str(""); + my_pid_ss.clear(); + my_pid_ss << my_pid; + + if (verbose) + std::cerr << "NutIPCUnitTest::testSignalSend(): using PID file '" + << pid_file_name << "' for PID " << my_pid + << " to store string '" << my_pid_ss.str() << "'" + << std::endl << std::flush; + + nut::NutFile pid_file(pid_file_name, nut::NutFile::WRITE_ONLY); + + pid_file.putString(my_pid_ss.str()); + + pid_file.closex(); + + // Send signal to process via the PIDfile + CPPUNIT_ASSERT(0 == nut::Signal::send(nut::Signal::USER1, pid_file_name)); + + CPPUNIT_ASSERT(static_cast(nut::Signal::USER1) == signal_caught); + + pid_file.removex(); + + signal_caught = 0; +#endif /* WIN32 */ +} + + +/** Caught signal list */ +static nut::Signal::List caught_signals; + +/** Signal handler routine */ +class TestSignalHandler: public nut::Signal::Handler { + public: + + void operator () (nut::Signal::enum_t signal) override { + caught_signals.push_back(signal); + } + + virtual ~TestSignalHandler() override; +}; // end of class TestSignalHandler + +void NutIPCUnitTest::testSignalRecvQuick() { +#ifdef WIN32 + /* FIXME: Needs implementation for signals via pipes */ + std::cout << "NutIPCUnitTest::testSignalRecvQuick(): skipped on this platform" << std::endl; +#else + // Create signal handler thread + nut::Signal::List signals; + caught_signals.clear(); + + signals.push_back(nut::Signal::USER1); + signals.push_back(nut::Signal::USER2); + + nut::Signal::HandlerThread sig_handler(signals); + + pid_t my_pid = nut::Process::getPID(); + + /* NOTE: The signal order delivery is not specified by POSIX if several + * ones arrive nearly simultaneously (and/or get confused by multi-CPU + * routing). In this test we only verify that after sending several copies + * of several signals, the expected counts of events were received. + */ + CPPUNIT_ASSERT(0 == nut::Signal::send(nut::Signal::USER1, my_pid)); + CPPUNIT_ASSERT(0 == nut::Signal::send(nut::Signal::USER2, my_pid)); + CPPUNIT_ASSERT(0 == nut::Signal::send(nut::Signal::USER2, my_pid)); + CPPUNIT_ASSERT(0 == nut::Signal::send(nut::Signal::USER1, my_pid)); + CPPUNIT_ASSERT(0 == nut::Signal::send(nut::Signal::USER1, my_pid)); + + // Let the sig. handler thread finish... + ::sleep(1); + + CPPUNIT_ASSERT(caught_signals.size() == 5); + + int countUSER1 = 0; + int countUSER2 = 0; + while (!caught_signals.empty()) { + nut::Signal::enum_t signal = caught_signals.front(); + caught_signals.pop_front(); + + if (signal == nut::Signal::USER1) { + countUSER1++; + } else if (signal == nut::Signal::USER2) { + countUSER2++; + } else { + std::stringstream msg; + msg << "Unexpected signal was received: " << signal; + CPPUNIT_ASSERT_MESSAGE(msg.str(), 0); + } + } + + CPPUNIT_ASSERT(countUSER1 == 3); + CPPUNIT_ASSERT(countUSER2 == 2); +#endif /* WIN32 */ +} + +void NutIPCUnitTest::testSignalRecvStaggered() { +#ifdef WIN32 + /* FIXME: Needs implementation for signals via pipes */ + std::cout << "NutIPCUnitTest::testSignalRecvStaggered(): skipped on this platform" << std::endl; +#else + // Create signal handler thread + nut::Signal::List signals; + caught_signals.clear(); + + signals.push_back(nut::Signal::USER1); + signals.push_back(nut::Signal::USER2); + + nut::Signal::HandlerThread sig_handler(signals); + + pid_t my_pid = nut::Process::getPID(); + + /* NOTE: The signal order delivery is not specified by POSIX if several + * ones arrive nearly simultaneously (and/or get confused by multi-CPU + * routing). Linux tends to deliver lower-numbered signals first, so we + * expect USER1 (10) before USER2 (12) to be consistent. Otherwise CI + * builds tend to mess this up a bit. + */ + CPPUNIT_ASSERT(0 == nut::Signal::send(nut::Signal::USER1, my_pid)); + ::sleep(1); + + CPPUNIT_ASSERT(0 == nut::Signal::send(nut::Signal::USER2, my_pid)); + ::sleep(1); + + CPPUNIT_ASSERT(0 == nut::Signal::send(nut::Signal::USER2, my_pid)); + ::sleep(1); + + /* Help ensure ordered (one-by-one) delivery before re-posting a + * presumably lower-numbered signal after some higher-numbered ones. + */ + CPPUNIT_ASSERT(0 == nut::Signal::send(nut::Signal::USER1, my_pid)); + + // Let the sig. handler thread finish... + ::sleep(1); + + CPPUNIT_ASSERT(caught_signals.size() == 4); + + CPPUNIT_ASSERT(caught_signals.front() == nut::Signal::USER1); + + caught_signals.pop_front(); + + CPPUNIT_ASSERT(caught_signals.front() == nut::Signal::USER2); + + caught_signals.pop_front(); + + CPPUNIT_ASSERT(caught_signals.front() == nut::Signal::USER2); + + caught_signals.pop_front(); + + CPPUNIT_ASSERT(caught_signals.front() == nut::Signal::USER1); +#endif /* WIN32 */ +} + +// Implement out of class declaration to avoid +// error: 'SomeClass' has no out-of-line virtual method +// definitions; its vtable will be emitted in every translation unit +// [-Werror,-Wweak-vtables] +TestSignalHandler::~TestSignalHandler() {} +NutIPCUnitTest::~NutIPCUnitTest() {} diff --git a/tests/nutstream_ut.cpp b/tests/nutstream_ut.cpp new file mode 100644 index 0000000000..918daa0c95 --- /dev/null +++ b/tests/nutstream_ut.cpp @@ -0,0 +1,474 @@ +/* + NUT stream unit test + + Copyright (C) + 2012 Vaclav Krpec + + 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 "nutstream.hpp" +#include "nutipc.hpp" /* Used in a test to "freeze" a writer child process */ + +#include +#include +#include + +extern "C" { +#ifndef WIN32 +# include +# include +#else +# if !(defined random) && !(defined HAVE_RANDOM) + /* WIN32 names it differently: */ +# define random() rand() +# endif +#endif /* WIN32 */ +#include +#include +#include + +extern bool verbose; +} + +/* Current CPPUnit offends the honor of C++98 */ +#if (defined HAVE_PRAGMA_GCC_DIAGNOSTIC_PUSH_POP) && (defined HAVE_PRAGMA_GCC_DIAGNOSTIC_IGNORED_EXIT_TIME_DESTRUCTORS || defined HAVE_PRAGMA_GCC_DIAGNOSTIC_IGNORED_GLOBAL_CONSTRUCTORS || defined HAVE_PRAGMA_GCC_DIAGNOSTIC_IGNORED_DEPRECATED_DECLARATIONS) +#pragma GCC diagnostic push +# ifdef HAVE_PRAGMA_GCC_DIAGNOSTIC_IGNORED_GLOBAL_CONSTRUCTORS +# pragma GCC diagnostic ignored "-Wglobal-constructors" +# endif +# ifdef HAVE_PRAGMA_GCC_DIAGNOSTIC_IGNORED_EXIT_TIME_DESTRUCTORS +# pragma GCC diagnostic ignored "-Wexit-time-destructors" +# endif +# ifdef HAVE_PRAGMA_GCC_DIAGNOSTIC_IGNORED_DEPRECATED_DECLARATIONS +# pragma GCC diagnostic ignored "-Wdeprecated-declarations" +# endif +#endif +#ifdef __clang__ +# pragma clang diagnostic push "-Wdeprecated-declarations" +#endif + +#include + +namespace nut { + +/** Test data */ +static const std::string test_data( + "And the mother of Jesus said unto the Lord, ""They have no more wine.""\n" + "And Jesus said unto the servants, ""Fill six water pots with water.""\n" + "And they did so.\n" + "And when the steward of the feast did taste of the water from the pots, it had become wine.\n" + "And he knew not whence it had come.\n" + "But the servants did know, and they applauded loudly in the kitchen.\n" + "And they said unto the Lord, ""How the Hell did you do that!?""\n" + "And inquired of him ""Do you do children’s parties?""\n" + "And the Lord said ""No.""\n" + ); + + +/** + * \brief Read and check test data from a stream + * + * \param stream Input stream + * + * \retval true in case of success + * \retval false in case of failure + */ +static bool readTestData(nut::NutStream * stream) { + assert(nullptr != stream); + + // Read characters from the stream + for (size_t pos = 0, iter = 0; ; ++iter) { + char ch; + + nut::NutStream::status_t status = stream->getChar(ch); + + if (nut::NutStream::NUTS_ERROR == status) { + if (verbose) + std::cerr << "readTestData(): status==nut::NutStream::NUTS_ERROR" << std::endl; + return false; + } + + if (nut::NutStream::NUTS_EOF == status) + break; + + if (nut::NutStream::NUTS_OK != status) { + if (verbose) + std::cerr << "readTestData(): status!=nut::NutStream::NUTS_OK: " << status << std::endl; + return false; + } + + if (ch != test_data.at(pos)) { + if (verbose) + std::cerr << "readTestData(): unexpected char '" + << ch << "' at pos " << pos << ": want '" + << test_data.at(pos) << "'" << std::endl; + return false; + } + + // Every other character shall be checked twice + if (0 == iter % 8) + continue; + + // Consume current character + stream->readChar(); + + ++pos; + } + + return true; +} + + +/** + * \brief Write test data to a stream + * + * \param stream Output stream + * + * \retval true in case of success + * \retval false in case of failure + */ +static bool writeTestData(nut::NutStream * stream) { + assert(nullptr != stream); + + size_t pivot = static_cast(0.5 * static_cast(test_data.size())); + + // Write characters to the stream + for (size_t i = 0; i < pivot; ++i) { + char ch = test_data.at(i); + + nut::NutStream::status_t status = stream->putChar(ch); + + if (nut::NutStream::NUTS_OK != status) { + if (verbose) + std::cerr << "writeTestData(): status!=nut::NutStream::NUTS_OK: " << status << std::endl; + return false; + } + } + + // Write string to the stream + const std::string str = test_data.substr(pivot); + + nut::NutStream::status_t status = stream->putString(str); + + CPPUNIT_ASSERT(nut::NutStream::NUTS_OK == status); + + return true; +} + + +/** + * \brief NUT stream unit test suite (abstract) + */ +class NutStreamUnitTest: public CppUnit::TestFixture { + protected: + + /** + * \brief Read test data from stream + * + * \c CPPUNIT_ASSERT macro is used to resolve error. + * + * \param stream Input stream + */ + inline void readx(nut::NutStream * stream) { + CPPUNIT_ASSERT(readTestData(stream)); + } + + /** + * \brief Write test data to stream + * + * \c CPPUNIT_ASSERT macro is used to resolve error. + * + * \param stream Output stream + */ + inline void writex(nut::NutStream * stream) { + CPPUNIT_ASSERT(writeTestData(stream)); + } + + virtual ~NutStreamUnitTest() override; +}; // end of class NutStreamUnitTest + + +/** + * \brief NUT memory stream unit test suite + */ +class NutMemoryUnitTest: public NutStreamUnitTest { + private: + + CPPUNIT_TEST_SUITE(NutMemoryUnitTest); + CPPUNIT_TEST(test); + CPPUNIT_TEST_SUITE_END(); + + public: + + inline void setUp() override {} + inline void tearDown() override {} + + virtual void test(); + +}; // end of class NutMemoryUnitTest + + +void NutMemoryUnitTest::test() { + nut::NutMemory input_mstream(test_data); + nut::NutMemory output_mstream; + + readx(&input_mstream); + writex(&output_mstream); + readx(&output_mstream); +} + + +/** + * \brief NUT file stream unit test suite + */ +class NutFileUnitTest: public NutStreamUnitTest { + private: + + CPPUNIT_TEST_SUITE(NutFileUnitTest); + CPPUNIT_TEST(test); + CPPUNIT_TEST_SUITE_END(); + + public: + + inline void setUp() override {} + inline void tearDown() override {} + + virtual void test(); + +}; // end of class NutFileUnitTest + + +void NutFileUnitTest::test() { + nut::NutFile fstream(nut::NutFile::ANONYMOUS); + + writex(&fstream); + fstream.flushx(); + readx(&fstream); +} + + +/** + * \brief NUT socket stream unit test suite + */ +class NutSocketUnitTest: public NutStreamUnitTest { + private: + + /** NUT socket stream unit test: writer */ + class Writer { + private: + + /** Remote listen address */ + nut::NutSocket::Address m_remote_address; + + public: + + /** + * \brief Constructor + * + * \param addr Remote address + */ + Writer(const nut::NutSocket::Address & addr): + m_remote_address(addr) + {} + + /** + * \brief Writer routine + * + * Writer shall write contents of the test data + * to its connection socket. + * + * \retval true in case of success + * \retval false otherwise + */ + bool run(); + + }; // end of class Writer + + /** TCP listen address IPv4 */ + static const nut::NutSocket::Address m_listen_address; + + CPPUNIT_TEST_SUITE(NutSocketUnitTest); + CPPUNIT_TEST(test); + CPPUNIT_TEST_SUITE_END(); + + public: + + inline void setUp() override {} + inline void tearDown() override {} + + virtual void test(); + +}; // end of class NutSocketUnitTest + + +/* Static initializer below may run before methods of the test, + * so it tends to repeat the same port for parallel CI runs */ +static long reallyRandom() { + ::srand(static_cast(::time(nullptr))); + return ::random(); +} + +/* Randomize to try avoiding collisions in parallel testing */ +static uint16_t getFreePort() { + int tries = 100; +#ifdef WIN32 + WSADATA wsaData; + static int wsaStarted = 0; + if (!wsaStarted) { + if (WSAStartup(MAKEWORD(2, 2), &wsaData) != 0) { + std::cerr << "WIN32: Failed to WSAStartup() the socket layer" << std::endl << std::flush; + } + // well, at least attempted + wsaStarted = 1; + } +#endif + while (tries > 0) { + uint16_t port = 10000 + static_cast(reallyRandom() % 40000); + nut::NutSocket::Address addr(127, 0, 0, 1, port); + nut::NutSocket sock; + int ec; + std::string em; + + if (sock.bind(addr, ec, em)) { + /* FWIW, "verbose" is only set in main() and this method currently + * is part of static initialization before that. So no trace. + */ + if (verbose) + std::cerr << "getFreePort() could bind() port " << port + << "; is FD valid?=" << sock.valid() << std::endl; + /* Let the destructor close it */ + sock.closex(); + return port; + } + + if (verbose) + std::cerr << "getFreePort() failed to bind() port " << port + << ": code " << ec << " aka " << em << ": will try another" + << std::endl; + sock.closex(); + tries--; + } + + // Well, gotta try something... + if (verbose) + std::cerr << "getFreePort() failed to bind(), falling back to 10000" << std::endl; + return 10000; +} + +const nut::NutSocket::Address NutSocketUnitTest::m_listen_address( + 127, 0, 0, 1, + getFreePort()); + +bool NutSocketUnitTest::Writer::run() { + nut::NutSocket conn_sock; + + if (!conn_sock.connect(m_remote_address)) + return false; + + if (!writeTestData(&conn_sock)) + return false; + + if (!conn_sock.close()) + return false; + + return true; +} + + +void NutSocketUnitTest::test() { +#ifdef WIN32 + /* FIXME: get Process working in the first place */ + std::cout << "NutSocketUnitTest::test(): skipped on this platform" << std::endl; +#else + // Fork writer + pid_t writer_pid = ::fork(); + + if (!writer_pid) { + // Wait for listen socket + ::sleep(1); + + // Run writer + CPPUNIT_ASSERT(Writer(m_listen_address).run()); + + exit(0); + } + + // Freeze the writer until we bind the port + CPPUNIT_ASSERT(0 == nut::Signal::send(nut::Signal::STOP, writer_pid)); + + // Listen + nut::NutSocket listen_sock; + + std::stringstream msg_bind; + msg_bind << "Expected to listen on " << m_listen_address.str(); + bool bound = listen_sock.bind(m_listen_address); + int retries = 5; + + while (!bound && retries > 0) { + retries--; + if (verbose) + std::cerr << msg_bind.str() << ": will retry test in 15 sec (" + << retries << " retries remaining)" << std::endl; + sleep(15); + bound = listen_sock.bind(m_listen_address); + } + + // Un-freeze the writer as we have bound the port (or will fail next line) + CPPUNIT_ASSERT(0 == nut::Signal::send(nut::Signal::CONT, writer_pid)); + + CPPUNIT_ASSERT_MESSAGE(msg_bind.str(), bound); + CPPUNIT_ASSERT(listen_sock.listen(10)); + + // Accept connection + nut::NutSocket conn_sock(nut::NutSocket::ACCEPT, listen_sock); + + // Read the test data + readx(&conn_sock); + + // Wait for writer + int writer_exit; + pid_t wpid = ::waitpid(writer_pid, &writer_exit, 0); + + CPPUNIT_ASSERT(wpid == writer_pid); + + std::stringstream msg_writer_exit; + msg_writer_exit << "Got writer_exit=" << writer_exit << ", expected 0"; + CPPUNIT_ASSERT_MESSAGE(msg_writer_exit.str(), 0 == writer_exit); +#endif /* WIN32 */ +} + + +// Register the test suite +CPPUNIT_TEST_SUITE_REGISTRATION(NutMemoryUnitTest); +CPPUNIT_TEST_SUITE_REGISTRATION(NutFileUnitTest); +CPPUNIT_TEST_SUITE_REGISTRATION(NutSocketUnitTest); + +// Implement out of class declaration to avoid +// error: 'SomeClass' has no out-of-line virtual method +// definitions; its vtable will be emitted in every translation unit +// [-Werror,-Wweak-vtables] +NutStreamUnitTest::~NutStreamUnitTest() {} + +} // namespace nut {} + +#ifdef __clang__ +# pragma clang diagnostic pop +#endif +#if (defined HAVE_PRAGMA_GCC_DIAGNOSTIC_PUSH_POP) && (defined HAVE_PRAGMA_GCC_DIAGNOSTIC_IGNORED_EXIT_TIME_DESTRUCTORS || defined HAVE_PRAGMA_GCC_DIAGNOSTIC_IGNORED_GLOBAL_CONSTRUCTORS || defined HAVE_PRAGMA_GCC_DIAGNOSTIC_IGNORED_DEPRECATED_DECLARATIONS) +# pragma GCC diagnostic pop +#endif diff --git a/tools/Makefile.am b/tools/Makefile.am index bc3d255202..97cdccf0f1 100644 --- a/tools/Makefile.am +++ b/tools/Makefile.am @@ -1,3 +1,14 @@ +# Network UPS Tools: generators and other tools + +# Export certain values for ccache which NUT ci_build.sh can customize, +# to facilitate developer iteration re-runs of "make" later. +# At least GNU and BSD make implementations are okay with this syntax. +@NUT_AM_MAKE_CAN_EXPORT@export CCACHE_NAMESPACE=@CCACHE_NAMESPACE@ +@NUT_AM_MAKE_CAN_EXPORT@export CCACHE_BASEDIR=@CCACHE_BASEDIR@ +@NUT_AM_MAKE_CAN_EXPORT@export CCACHE_DIR=@CCACHE_DIR@ +@NUT_AM_MAKE_CAN_EXPORT@export CCACHE_PATH=@CCACHE_PATH@ +@NUT_AM_MAKE_CAN_EXPORT@export PATH=@PATH_DURING_CONFIGURE@ + # SUBDIRS are explicitly a listing of all the directories that make # must recurse into BEFORE processing the current directory. # @@ -9,7 +20,7 @@ # to have nutscan-{usb,snmp}.h built before going into the nut-scanner # sub-directory. For good measure we also call this from nut-scanner's # make, to handle developer workflow (editing the *.c sources this uses). -SUBDIRS = . nut-scanner +SUBDIRS = . nut-scanner nutconf PYTHON = @PYTHON@ @@ -41,6 +52,9 @@ GENERATED_USB_OS_FILES += $(top_builddir)/scripts/udev/nut-usbups.rules.in # BSD devd output file GENERATED_USB_OS_FILES += $(top_builddir)/scripts/devd/nut-usb.conf.in +# FreeBSD quirks output file +GENERATED_USB_OS_FILES += $(top_builddir)/scripts/devd/nut-usb.quirks + # UPower output file # Note: unlike others above, this one is currently tracked in Git GENERATED_USB_OS_FILES += $(top_builddir)/scripts/upower/95-upower-hid.hwdb @@ -60,7 +74,7 @@ nut-scanner-deps-usb: $(GENERATED_USB_FILES) # The distributed nut-snmpinfo.py.in template is assumed to only differ from # a generated nut-snmpinfo.py by the @PYTHON@ shebang. -$(GENERATED_SNMP_FILES): $(top_srcdir)/drivers/*-mib.c +$(GENERATED_SNMP_FILES): $(top_srcdir)/drivers/*-mib.c $(top_srcdir)/tools/nut-snmpinfo.py.in @if [ -n "$(PYTHON)" ] && [ x"no" != x"$(PYTHON)" ] && $(PYTHON) -c 1; then \ echo "Regenerating the SNMP helper files in SRC dir with '$(PYTHON)'."; \ TOP_SRCDIR="$(top_srcdir)" ; export TOP_SRCDIR; \ @@ -101,7 +115,7 @@ $(GENERATED_USB_OS_FILES): $(GENERATED_USB_FILES) fi @touch "$@" -$(GENERATED_USB_FILES): $(top_srcdir)/drivers/*-hid.c $(top_srcdir)/drivers/*usb*.c $(top_srcdir)/drivers/nutdrv_qx.c +$(GENERATED_USB_FILES): $(top_srcdir)/drivers/*-hid.c $(top_srcdir)/drivers/*usb*.c $(top_srcdir)/drivers/nutdrv_qx.c $(top_srcdir)/tools/nut-usbinfo.pl @if perl -e 1; then \ echo "Regenerating the USB helper files in SRC dir."; \ TOP_SRCDIR="$(top_srcdir)" ; export TOP_SRCDIR; \ diff --git a/tools/gitlog2changelog.py.in b/tools/gitlog2changelog.py.in index f4c1fd3c1f..a5e4d78660 100755 --- a/tools/gitlog2changelog.py.in +++ b/tools/gitlog2changelog.py.in @@ -54,11 +54,22 @@ except TypeError: 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") +# Create a ChangeLog file in the current directory by default. +CHANGELOG_FILE = "ChangeLog" +try: + # e.g. point from Makefile to a builddir (caller ensures it exists) + if os.environ.get("CHANGELOG_FILE", None) is not None: + CHANGELOG_FILE = os.environ.get("CHANGELOG_FILE") +except Exception as ignored: + pass + +if CHANGELOG_FILE == "-": + fout = sys.stdout else: - fout = open("ChangeLog", "w") + if fin_mode == 3: + fout = open(CHANGELOG_FILE, "w", encoding="UTF-8") + else: + fout = open(CHANGELOG_FILE, "w") # Set up the loop variables in order to locate the blocks we want authorFound = False diff --git a/tools/nut-scanner/Makefile.am b/tools/nut-scanner/Makefile.am index 0a5108d798..4ed34f7214 100644 --- a/tools/nut-scanner/Makefile.am +++ b/tools/nut-scanner/Makefile.am @@ -1,3 +1,14 @@ +# Network UPS Tools: nut-scanner + +# Export certain values for ccache which NUT ci_build.sh can customize, +# to facilitate developer iteration re-runs of "make" later. +# At least GNU and BSD make implementations are okay with this syntax. +@NUT_AM_MAKE_CAN_EXPORT@export CCACHE_NAMESPACE=@CCACHE_NAMESPACE@ +@NUT_AM_MAKE_CAN_EXPORT@export CCACHE_BASEDIR=@CCACHE_BASEDIR@ +@NUT_AM_MAKE_CAN_EXPORT@export CCACHE_DIR=@CCACHE_DIR@ +@NUT_AM_MAKE_CAN_EXPORT@export CCACHE_PATH=@CCACHE_PATH@ +@NUT_AM_MAKE_CAN_EXPORT@export PATH=@PATH_DURING_CONFIGURE@ + # Generally, list headers and/or sources which are re-generated # for nut-scanner in the parent dir NUT_SCANNER_DEPS_H = nutscan-usb.h nutscan-snmp.h @@ -13,12 +24,13 @@ EXTRA_DIST = README.adoc # Make sure we have the freshest files (no-op if built earlier and then # no driver sources and other dependencies were edited by a developer) $(NUT_SCANNER_DEPS): dummy - @cd .. && $(MAKE) $(AM_MAKEFLAGS) nut-scanner-deps + +@cd .. && $(MAKE) $(AM_MAKEFLAGS) nut-scanner-deps # Make sure out-of-dir dependencies exist (especially when dev-building parts): +$(top_builddir)/include/nut_version.h \ $(top_builddir)/common/libcommonclient.la \ $(top_builddir)/common/libcommon.la: dummy - @cd $(@D) && $(MAKE) $(AM_MAKEFLAGS) $(@F) + +@cd $(@D) && $(MAKE) $(AM_MAKEFLAGS) $(@F) # do not hard depend on '../include/nut_version.h', since it blocks # 'dist', and is only required for actual build, in which case @@ -42,15 +54,12 @@ bcmxcp_ser.c: $(top_srcdir)/drivers/bcmxcp_ser.c CLEANFILES += $(LINKED_SOURCE_FILES) BUILT_SOURCES += $(LINKED_SOURCE_FILES) -$(top_builddir)/include/nut_version.h: - @cd $(@D) && $(MAKE) $(AM_MAKEFLAGS) $(@F) - # Note: we only build nut-scanner, and its library, if libltdl was found (required!) if WITH_NUT_SCANNER bin_PROGRAMS = nut-scanner lib_LTLIBRARIES = libnutscan.la -endif -libnutscan_la_SOURCES = scan_nut.c scan_ipmi.c \ +endif WITH_NUT_SCANNER +libnutscan_la_SOURCES = scan_nut.c scan_nut_simulation.c scan_ipmi.c \ nutscan-device.c nutscan-ip.c nutscan-display.c \ nutscan-init.c scan_usb.c scan_snmp.c scan_xml_http.c \ scan_avahi.c scan_eaton_serial.c nutscan-serial.c @@ -58,12 +67,12 @@ nodist_libnutscan_la_SOURCES = $(LINKED_SOURCE_FILES) libnutscan_la_LIBADD = $(NETLIBS) if WITH_LIBLTDL libnutscan_la_LIBADD += $(LIBLTDL_LIBS) -endif +endif WITH_LIBLTDL libnutscan_la_LIBADD += $(top_builddir)/common/libcommonclient.la if HAVE_SEMAPHORE_LIBS # Are additional libraries needed for semaphore support? libnutscan_la_LIBADD += $(SEMLIBS) -endif +endif HAVE_SEMAPHORE_LIBS # FIXME: From old ages onward, SERLIBS are added here and not in LIBADD... why? libnutscan_la_LDFLAGS = $(SERLIBS) @@ -71,7 +80,7 @@ libnutscan_la_LDFLAGS = $(SERLIBS) if HAVE_WINDOWS # Many versions of MingW seem to fail to build non-static DLL without this libnutscan_la_LDFLAGS += -no-undefined -endif +endif HAVE_WINDOWS # # Below we set API versions of public libraries @@ -80,7 +89,7 @@ endif # object .so names would differ) # # libnutscan version information -libnutscan_la_LDFLAGS += -version-info 2:2:0 +libnutscan_la_LDFLAGS += -version-info 2:5:0 # libnutscan exported symbols regex # WARNING: Since the library includes parts of libcommon (as much as needed @@ -102,10 +111,10 @@ nut_scanner_LDADD = libnutscan.la if WITH_SSL libnutscan_la_CFLAGS += $(LIBSSL_CFLAGS) libnutscan_la_LIBADD += $(LIBSSL_LIBS) -endif +endif WITH_SSL if WITH_USB libnutscan_la_CFLAGS += $(LIBUSB_CFLAGS) -endif +endif WITH_USB # Note: do not indent automake "if" lines if WITH_SNMP libnutscan_la_CFLAGS += $(LIBNETSNMP_CFLAGS) @@ -125,13 +134,13 @@ endif WITH_SNMP_STATIC endif WITH_SNMP if WITH_NEON libnutscan_la_CFLAGS += $(LIBNEON_CFLAGS) -endif +endif WITH_NEON if WITH_AVAHI libnutscan_la_CFLAGS += $(LIBAVAHI_CFLAGS) -endif +endif WITH_AVAHI if WITH_IPMI libnutscan_la_CFLAGS += $(LIBIPMI_CFLAGS) -endif +endif WITH_IPMI # C is not a header, but there is no dist_noinst_SOURCES dist_noinst_HEADERS = $(NUT_SCANNER_DEPS_H) $(NUT_SCANNER_DEPS_C) @@ -139,9 +148,9 @@ dist_noinst_HEADERS = $(NUT_SCANNER_DEPS_H) $(NUT_SCANNER_DEPS_C) # Optionally deliverable as part of NUT public API: if WITH_DEV include_HEADERS = nut-scan.h nutscan-device.h nutscan-ip.h nutscan-init.h nutscan-serial.h -else +else !WITH_DEV dist_noinst_HEADERS += nut-scan.h nutscan-device.h nutscan-ip.h nutscan-init.h nutscan-serial.h -endif +endif !WITH_DEV dummy: diff --git a/tools/nut-scanner/README.adoc b/tools/nut-scanner/README.adoc index 043cddff0c..4761796386 100644 --- a/tools/nut-scanner/README.adoc +++ b/tools/nut-scanner/README.adoc @@ -39,10 +39,11 @@ iteration function to display results: { nutscan_options_t * opt; nutscan_device_t *device; + nutscan_usb_t usb_scanopts; nutscan-init(); - if ((device = nutscan_scan_usb()) == NULL) { + if ((device = nutscan_scan_usb(&usb_scanopts)) == NULL) { printf("No device found\n"); exit(EXIT_FAILURE); } diff --git a/tools/nut-scanner/nut-scan.h b/tools/nut-scanner/nut-scan.h index ae5f8f42cd..3bba701369 100644 --- a/tools/nut-scanner/nut-scan.h +++ b/tools/nut-scanner/nut-scan.h @@ -1,10 +1,10 @@ /* * Copyright (C) * 2011 - EATON - * 2012 - Arnaud Quette + * 2012 - 2024 Arnaud Quette * 2016 - EATON - IP addressed XML scan - * 2016-2021 - EATON - Various threads-related improvements - * 2023 - Jim Klimov + * 2016 - 2021 - EATON - Various threads-related improvements + * 2023 - 2024 - 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 @@ -128,10 +128,10 @@ typedef struct nutscan_ipmi { #define IPMI_AUTHENTICATION_TYPE_STRAIGHT_PASSWORD_KEY 0x04 #define IPMI_AUTHENTICATION_TYPE_OEM_PROP 0x05 #define IPMI_AUTHENTICATION_TYPE_RMCPPLUS 0x06 -#endif +#endif /* IPMI_AUTHENTICATION_TYPE_NONE */ #ifndef IPMI_PRIVILEGE_LEVEL_ADMIN #define IPMI_PRIVILEGE_LEVEL_ADMIN 0x04 -#endif +#endif /* IPMI_PRIVILEGE_LEVEL_ADMIN */ #define IPMI_1_5 1 #define IPMI_2_0 0 @@ -144,10 +144,24 @@ typedef struct nutscan_xml { char *peername; /* Hostname or NULL for broadcast mode */ } nutscan_xml_t; +/* USB scan options structure */ +typedef struct nutscan_usb { + /* Hardware link related values below are not reliable for run-time + * matching (they can change over time) but can be useful if e.g. + * "serial" is not available or unique */ + int report_bus; + int report_busport; + int report_device; + + /* The value is not currently used for device matching, but might be + * used later, and it is available from discovery */ + int report_bcdDevice; +} nutscan_usb_t; + /* Scanning */ nutscan_device_t * nutscan_scan_snmp(const char * start_ip, const char * stop_ip, useconds_t usec_timeout, nutscan_snmp_t * sec); -nutscan_device_t * nutscan_scan_usb(void); +nutscan_device_t * nutscan_scan_usb(nutscan_usb_t * scanopts); /* If "ip" == NULL, do a broadcast scan */ /* If sec->usec_timeout <= 0 then the common usec_timeout arg overrides it */ @@ -155,6 +169,8 @@ nutscan_device_t * nutscan_scan_xml_http_range(const char *start_ip, const char nutscan_device_t * nutscan_scan_nut(const char * startIP, const char * stopIP, const char * port, useconds_t usec_timeout); +nutscan_device_t * nutscan_scan_nut_simulation(void); + nutscan_device_t * nutscan_scan_avahi(useconds_t usec_timeout); nutscan_device_t * nutscan_scan_ipmi(const char * startIP, const char * stopIP, nutscan_ipmi_t * sec); diff --git a/tools/nut-scanner/nut-scanner.c b/tools/nut-scanner/nut-scanner.c index 9e84d77ec2..500b3d9d59 100644 --- a/tools/nut-scanner/nut-scanner.c +++ b/tools/nut-scanner/nut-scanner.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2011 - 2012 Arnaud Quette + * Copyright (C) 2011 - 2024 Arnaud Quette * Copyright (C) 2016 Michal Vyskocil * Copyright (C) 2016 - 2023 Jim Klimov * @@ -61,7 +61,7 @@ #define ERR_BAD_OPTION (-1) -static const char optstring[] = "?ht:T:s:e:E:c:l:u:W:X:w:x:p:b:B:d:L:CUSMOAm:QNPqIVaD"; +static const char optstring[] = "?ht:T:s:e:E:c:l:u:W:X:w:x:p:b:B:d:L:CUSMOAm:QnNPqIVaD"; #ifdef HAVE_GETOPT_LONG static const struct option longopts[] = { @@ -89,6 +89,7 @@ static const struct option longopts[] = { { "xml_scan", no_argument, NULL, 'M' }, { "oldnut_scan", no_argument, NULL, 'O' }, { "avahi_scan", no_argument, NULL, 'A' }, + { "nut_simulation_scan", no_argument, NULL, 'n' }, { "ipmi_scan", no_argument, NULL, 'I' }, { "disp_nut_conf_with_sanity_check", no_argument, NULL, 'Q' }, { "disp_nut_conf", no_argument, NULL, 'N' }, @@ -111,15 +112,62 @@ static char * start_ip = NULL; static char * end_ip = NULL; static char * port = NULL; static char * serial_ports = NULL; +static int cli_link_detail_level = -1; #ifdef HAVE_PTHREAD static pthread_t thread[TYPE_END]; static void * run_usb(void *arg) { - NUT_UNUSED_VARIABLE(arg); + nutscan_usb_t scanopts, *scanopts_ptr = &scanopts; + + if (!arg) { + /* null => use library defaults; should not happen here anyway */ + scanopts_ptr = NULL; + } else { + /* 0: do not report bus/device/busport details + * 1: report bus and busport, if available + * 2: report bus/device/busport details + * 3: like (2) and report bcdDevice (limited use and benefit) + */ + int link_detail_level = *((int*)arg); + + switch (link_detail_level) { + case 0: + scanopts.report_bus = 0; + scanopts.report_busport = 0; + scanopts.report_device = 0; + scanopts.report_bcdDevice = 0; + break; + + case 1: + scanopts.report_bus = 1; + scanopts.report_busport = 1; + scanopts.report_device = 0; + scanopts.report_bcdDevice = 0; + break; + + case 2: + scanopts.report_bus = 1; + scanopts.report_busport = 1; + scanopts.report_device = 1; + scanopts.report_bcdDevice = 0; + break; - dev[TYPE_USB] = nutscan_scan_usb(); + case 3: + scanopts.report_bus = 1; + scanopts.report_busport = 1; + scanopts.report_device = 1; + scanopts.report_bcdDevice = 1; + break; + + default: + upsdebugx(1, "%s: using library default link_detail_level settings", __func__); + scanopts_ptr = NULL; + } + } + + dev[TYPE_USB] = nutscan_scan_usb(scanopts_ptr); return NULL; } @@ -147,6 +195,14 @@ static void * run_nut_old(void *arg) return NULL; } +static void * run_nut_simulation(void *arg) +{ + NUT_UNUSED_VARIABLE(arg); + + dev[TYPE_NUT_SIMULATION] = nutscan_scan_nut_simulation(); + return NULL; +} + static void * run_avahi(void *arg) { NUT_UNUSED_VARIABLE(arg); @@ -170,7 +226,6 @@ static void * run_eaton_serial(void *arg) dev[TYPE_EATON_SERIAL] = nutscan_scan_eaton_serial(serial_ports); return NULL; } - #endif /* HAVE_PTHREAD */ static void show_usage(void) @@ -183,7 +238,8 @@ static void show_usage(void) puts("OPTIONS:"); printf(" -C, --complete_scan: Scan all available devices except serial ports (default).\n"); if (nutscan_avail_usb) { - printf(" -U, --usb_scan: Scan USB devices.\n"); + printf(" -U, --usb_scan: Scan USB devices. Specify twice or more to report different\n" + " detail levels of (change-prone) physical properties.\n"); } else { printf("* Options for USB devices scan not enabled: library not detected.\n"); } @@ -203,6 +259,7 @@ static void show_usage(void) } else { printf("* Options for NUT devices (avahi method) scan not enabled: library not detected.\n"); } + printf(" -n, --nut_simulation_scan: Scan for NUT simulated devices (.dev files in $CONFPATH).\n"); if (nutscan_avail_ipmi) { printf(" -I, --ipmi_scan: Scan IPMI devices.\n"); } else { @@ -360,6 +417,7 @@ int main(int argc, char *argv[]) int allow_snmp = 0; int allow_xml = 0; int allow_oldnut = 0; + int allow_nut_simulation = 0; int allow_avahi = 0; int allow_ipmi = 0; int allow_eaton_serial = 0; /* MUST be requested explicitly! */ @@ -625,6 +683,9 @@ int main(int argc, char *argv[]) goto display_help; } allow_usb = 1; + /* NOTE: Starts as -1, so the first -U sets it to 0 (minimal detail) */ + if (cli_link_detail_level < 3) + cli_link_detail_level++; break; case 'M': if (!nutscan_avail_xml_http) { @@ -641,6 +702,9 @@ int main(int argc, char *argv[]) } allow_avahi = 1; break; + case 'n': + allow_nut_simulation = 1; + break; case 'I': if (!nutscan_avail_ipmi) { goto display_help; @@ -737,7 +801,7 @@ int main(int argc, char *argv[]) upsdebugx(1, "Extracted IP address range from CIDR net/mask: %s => %s", start_ip, end_ip); } - if (!allow_usb && !allow_snmp && !allow_xml && !allow_oldnut && + if (!allow_usb && !allow_snmp && !allow_xml && !allow_oldnut && !allow_nut_simulation && !allow_avahi && !allow_ipmi && !allow_eaton_serial ) { allow_all = 1; @@ -748,6 +812,7 @@ int main(int argc, char *argv[]) allow_snmp = 1; allow_xml = 1; allow_oldnut = 1; + allow_nut_simulation = 1; allow_avahi = 1; allow_ipmi = 1; /* BEWARE: allow_all does not include allow_eaton_serial! */ @@ -759,13 +824,13 @@ int main(int argc, char *argv[]) if (allow_usb && nutscan_avail_usb) { upsdebugx(quiet, "Scanning USB bus."); #ifdef HAVE_PTHREAD - if (pthread_create(&thread[TYPE_USB], NULL, run_usb, NULL)) { + if (pthread_create(&thread[TYPE_USB], NULL, run_usb, &cli_link_detail_level)) { upsdebugx(1, "pthread_create returned an error; disabling this scan mode"); nutscan_avail_usb = 0; } #else upsdebugx(1, "USB SCAN: no pthread support, starting nutscan_scan_usb..."); - dev[TYPE_USB] = nutscan_scan_usb(); + dev[TYPE_USB] = nutscan_scan_usb(&cli_link_detail_level); #endif /* HAVE_PTHREAD */ } else { upsdebugx(1, "USB SCAN: not requested, SKIPPED"); @@ -832,6 +897,22 @@ int main(int argc, char *argv[]) upsdebugx(1, "NUT bus (old) SCAN: not requested, SKIPPED"); } + if (allow_nut_simulation && nutscan_avail_nut_simulation) { + upsdebugx(quiet, "Scanning NUT simulation devices."); +#ifdef HAVE_PTHREAD + upsdebugx(1, "NUT simulation devices SCAN: starting pthread_create with run_nut_simulation..."); + if (pthread_create(&thread[TYPE_NUT_SIMULATION], NULL, run_nut_simulation, NULL)) { + upsdebugx(1, "pthread_create returned an error; disabling this scan mode"); + nutscan_avail_nut_simulation = 0; + } +#else + upsdebugx(1, "NUT simulation devices SCAN: no pthread support, starting nutscan_scan_nut_simulation..."); + dev[TYPE_NUT_SIMULATION] = nutscan_scan_nut_simulation(timeout); +#endif /* HAVE_PTHREAD */ + } else { + upsdebugx(1, "NUT simulation devices SCAN: not requested, SKIPPED"); + } + if (allow_avahi && nutscan_avail_avahi) { upsdebugx(quiet, "Scanning NUT bus (avahi method)."); #ifdef HAVE_PTHREAD @@ -898,6 +979,10 @@ int main(int argc, char *argv[]) upsdebugx(1, "NUT bus (old) SCAN: join back the pthread"); pthread_join(thread[TYPE_NUT], NULL); } + if (allow_nut_simulation && nutscan_avail_nut_simulation && thread[TYPE_NUT_SIMULATION]) { + upsdebugx(1, "NUT simulation devices SCAN: join back the pthread"); + pthread_join(thread[TYPE_NUT_SIMULATION], NULL); + } if (allow_avahi && nutscan_avail_avahi && thread[TYPE_AVAHI]) { upsdebugx(1, "NUT bus (avahi) SCAN: join back the pthread"); pthread_join(thread[TYPE_AVAHI], NULL); @@ -934,6 +1019,11 @@ int main(int argc, char *argv[]) upsdebugx(1, "SCANS DONE: free resources: NUT bus (old)"); nutscan_free_device(dev[TYPE_NUT]); + upsdebugx(1, "SCANS DONE: display results: NUT simulation devices"); + display_func(dev[TYPE_NUT_SIMULATION]); + upsdebugx(1, "SCANS DONE: free resources: NUT simulation devices"); + nutscan_free_device(dev[TYPE_NUT_SIMULATION]); + upsdebugx(1, "SCANS DONE: display results: NUT bus (avahi)"); display_func(dev[TYPE_AVAHI]); upsdebugx(1, "SCANS DONE: free resources: NUT bus (avahi)"); diff --git a/tools/nut-scanner/nutscan-device.c b/tools/nut-scanner/nutscan-device.c index d22e23f027..c01e229b98 100644 --- a/tools/nut-scanner/nutscan-device.c +++ b/tools/nut-scanner/nutscan-device.c @@ -1,4 +1,5 @@ /* + * Copyright (C) 2011 - 2024 Arnaud Quette (Design and part of implementation) * Copyright (C) 2011 - EATON * * This program is free software; you can redistribute it and/or modify @@ -19,6 +20,7 @@ /*! \file nutscan-device.c \brief manipulation of a container describing a NUT device \author Frederic Bohe + \author Arnaud Quette */ #include "config.h" /* must be the first header */ @@ -27,16 +29,31 @@ #include #include -const char * nutscan_device_type_strings[TYPE_END - 1] = { +const char * nutscan_device_type_strings[TYPE_END] = { + "NONE", /* 0 */ "USB", "SNMP", "XML", "NUT", + "NUT_SIMULATION", "IPMI", "Avahi", "serial", }; +/* lower strings, used for device names */ +const char * nutscan_device_type_lstrings[TYPE_END] = { + "none", /* 0 */ + "usb", + "snmp", + "xml", + "nut", + "simulation", + "ipmi", + "avahi", + "serial", +}; + nutscan_device_t * nutscan_new_device(void) { nutscan_device_t * device; @@ -77,6 +94,10 @@ static void deep_free_device(nutscan_device_t * device) free(current->value); } + if (current->comment_tag != NULL) { + free(current->comment_tag); + } + free(current); } @@ -106,6 +127,11 @@ void nutscan_free_device(nutscan_device_t * device) } void nutscan_add_option_to_device(nutscan_device_t * device, char * option, char * value) +{ + nutscan_add_commented_option_to_device(device, option, value, NULL); +} + +void nutscan_add_commented_option_to_device(nutscan_device_t * device, char * option, char * value, char * comment_tag) { nutscan_options_t **opt; @@ -135,6 +161,13 @@ void nutscan_add_option_to_device(nutscan_device_t * device, char * option, char else { (*opt)->value = NULL; } + + if (comment_tag != NULL) { + (*opt)->comment_tag = strdup(comment_tag); + } + else { + (*opt)->comment_tag = NULL; + } } nutscan_device_t * nutscan_add_device_to_device(nutscan_device_t * first, nutscan_device_t * second) diff --git a/tools/nut-scanner/nutscan-device.h b/tools/nut-scanner/nutscan-device.h index 902339494d..4ab9bc714b 100644 --- a/tools/nut-scanner/nutscan-device.h +++ b/tools/nut-scanner/nutscan-device.h @@ -1,4 +1,5 @@ /* + * Copyright (C) 2011 - 2024 Arnaud Quette (Design and part of implementation) * Copyright (C) 2011 - EATON * * This program is free software; you can redistribute it and/or modify @@ -19,6 +20,7 @@ /*! \file nutscan-device.h \brief definition of a container describing a NUT discovered device \author Frederic Bohe + \author Arnaud Quette */ #ifndef SCAN_DEVICE @@ -39,6 +41,8 @@ extern "C" { */ #define nutscan_device_type_string(type) \ (assert(0 < (type) && (type) < TYPE_END), nutscan_device_type_strings[type - 1]) +#define nutscan_device_type_lstring(type) \ + (assert(0 < (type) && (type) < TYPE_END), nutscan_device_type_lstrings[type - 1]) typedef enum nutscan_device_type { TYPE_NONE = 0, @@ -46,6 +50,7 @@ typedef enum nutscan_device_type { TYPE_SNMP, TYPE_XML, TYPE_NUT, + TYPE_NUT_SIMULATION, TYPE_IPMI, TYPE_AVAHI, TYPE_EATON_SERIAL, @@ -53,17 +58,20 @@ typedef enum nutscan_device_type { } nutscan_device_type_t; /** Device type -> string mapping */ -extern const char * nutscan_device_type_strings[TYPE_END - 1]; +extern const char * nutscan_device_type_strings[TYPE_END]; +extern const char * nutscan_device_type_lstrings[TYPE_END]; typedef struct nutscan_options { char * option; char * value; + char * comment_tag; /* if not NULL, this option may be not shown in some output formats, or represented as a comment with this tag in others (and empty string may also be used) */ struct nutscan_options* next; } nutscan_options_t; typedef struct nutscan_device { nutscan_device_type_t type; char * driver; + char * alt_driver_names; char * port; nutscan_options_t * opt; struct nutscan_device * prev; @@ -72,6 +80,8 @@ typedef struct nutscan_device { nutscan_device_t * nutscan_new_device(void); void nutscan_free_device(nutscan_device_t * device); +void nutscan_add_commented_option_to_device(nutscan_device_t * device, char * option, char * value, char * comment_tag); +/* This method calls the one above, using a NULL comment_tag */ void nutscan_add_option_to_device(nutscan_device_t * device, char * option, char * value); nutscan_device_t * nutscan_add_device_to_device(nutscan_device_t * first, nutscan_device_t * second); diff --git a/tools/nut-scanner/nutscan-display.c b/tools/nut-scanner/nutscan-display.c index 6539c166a4..bae9824bbb 100644 --- a/tools/nut-scanner/nutscan-display.c +++ b/tools/nut-scanner/nutscan-display.c @@ -39,10 +39,19 @@ static char * nutscan_device_type_string[TYPE_END] = { "EATON_SERIAL" }; -static int last_nutdev_num = 0; +/* Counter incremented by nutscan_display_ups_conf(); later maybe adding other + * renderer methods which could be interested in uniquely numbering the device + * configurations. Note that this is a monotonously increasing number suffixed + * to "nutdev-". Naming of this sort is NOT part of nutscan_device_t or + * nutscan_options_t, it is defined by/appears in the renderer alone so far. + */ +static size_t last_nutdev_num = 0; void nutscan_display_ups_conf_with_sanity_check(nutscan_device_t * device) { + /* Note: while a single device is passed to the method, it is actually + * used to locate the list of related device types and iterate it all. + */ upsdebugx(2, "%s: %s", __func__, device ? (device->type < TYPE_END ? nutscan_device_type_string[device->type] : "") : ""); @@ -52,9 +61,12 @@ void nutscan_display_ups_conf_with_sanity_check(nutscan_device_t * device) void nutscan_display_ups_conf(nutscan_device_t * device) { + /* Note: while a single device is passed to the method, it is actually + * used to locate the list of related device types and iterate it all. + */ nutscan_device_t * current_dev = device; nutscan_options_t * opt; - static int nutdev_num = 1; + static size_t nutdev_num = 1; upsdebugx(2, "%s: %s", __func__, device ? (device->type < TYPE_END ? nutscan_device_type_string[device->type] : "") @@ -71,15 +83,31 @@ void nutscan_display_ups_conf(nutscan_device_t * device) /* Display each device */ do { - printf("[nutdev%i]\n\tdriver = \"%s\"\n\tport = \"%s\"\n", - nutdev_num, current_dev->driver, - current_dev->port); + printf("[nutdev-%s%" PRIuSIZE "]\n\tdriver = \"%s\"", + nutscan_device_type_lstrings[current_dev->type], + nutdev_num, current_dev->driver); + + if (current_dev->alt_driver_names) { + printf("\t# alternately: %s", + current_dev->alt_driver_names); + } + + printf("\n\tport = \"%s\"\n", + current_dev->port); opt = current_dev->opt; while (NULL != opt) { if (opt->option != NULL) { - printf("\t%s", opt->option); + printf("\t"); + if (opt->comment_tag) { + if (opt->comment_tag[0] == '\0') { + printf("# "); + } else { + printf("###%s### ", opt->comment_tag); + } + } + printf("%s", opt->option); if (opt->value != NULL) { printf(" = \"%s\"", opt->value); } @@ -99,6 +127,9 @@ void nutscan_display_ups_conf(nutscan_device_t * device) void nutscan_display_parsable(nutscan_device_t * device) { + /* Note: while a single device is passed to the method, it is actually + * used to locate the list of related device types and iterate it all. + */ nutscan_device_t * current_dev = device; nutscan_options_t * opt; @@ -126,7 +157,7 @@ void nutscan_display_parsable(nutscan_device_t * device) opt = current_dev->opt; while (NULL != opt) { - if (opt->option != NULL) { + if (opt->option != NULL && opt->comment_tag == NULL) { /* Do not separate by whitespace, in case someone already parses this */ printf(",%s", opt->option); if (opt->value != NULL) { @@ -136,6 +167,9 @@ void nutscan_display_parsable(nutscan_device_t * device) opt = opt->next; } + /* NOTE: Currently no handling for current_dev->alt_driver_names + * here, since no driver options maps to this concept */ + printf("\n"); current_dev = current_dev->next; @@ -155,6 +189,9 @@ typedef struct keyval_strings { void nutscan_display_sanity_check_serial(nutscan_device_t * device) { + /* Note: while a single device is passed to the method, it is actually + * used to locate the list of related device types and iterate it all. + */ /* Some devices have useless serial numbers * (empty strings, all-zeroes, all-spaces etc.) * and others have identical serial numbers on @@ -177,10 +214,20 @@ void nutscan_display_sanity_check_serial(nutscan_device_t * device) */ nutscan_device_t * current_dev = device; nutscan_options_t * opt; - /* Keep numbering consistent with global entry naming. - * Note its last value is after loop, so "real + 1". + /* Keep numbering consistent with global entry naming + * as we call the device config renderer and the sanity + * check collector for the same device, then iterate. + * Note its last value is after loop, so says "real + 1". + * Starts with "1", so a discovery of 1 device yields a + * "last_nutdev_num==2" value here. We would rewind the + * number to start at the beginning of the list for the + * current device type. + * FIXME: It now feels beneficial to add a "nutdev_name" + * right into the nutscan_device_t or its "opt" and to + * pre-parse all discovered lists of devices before any + * rendering to consistently pre-set these strings. */ - int nutdev_num = last_nutdev_num - 1; + size_t nutdev_num = last_nutdev_num - 1; size_t listlen = 0, count = 0, i; keyval_strings_t *map = NULL, *entry = NULL; @@ -192,7 +239,7 @@ void nutscan_display_sanity_check_serial(nutscan_device_t * device) return; } - /* At least one entry exists... */ + /* At least one entry exists, this one (note the 1-based count!)... */ listlen++; /* Find end of the list */ @@ -203,11 +250,12 @@ void nutscan_display_sanity_check_serial(nutscan_device_t * device) /* Find start of the list and count its size */ while (current_dev->prev != NULL) { current_dev = current_dev->prev; + nutdev_num--; listlen++; } /* Process each device: - * Build a map of "serial"=>"nutdevX[,...,nutdevZ]" + * Build a map of "serial"=>"nutdev-serialX[,...,nutdev-serialZ]" * and warn if there are bogus "serial" keys or if * there are several nutdev's (a comma in value). */ @@ -222,9 +270,14 @@ void nutscan_display_sanity_check_serial(nutscan_device_t * device) upsdebugx(3, "%s: checking serial numbers for %" PRIuSIZE " device configuration(s)", __func__, listlen); + /* NOTE: we start the loop with current_dev == first device in list */ do { - /* Look for serial option in current device */ + /* Look for serial option in current device (iterated) */ + char nutdev_name[SMALLBUF]; opt = current_dev->opt; + snprintf(nutdev_name, sizeof(nutdev_name), "nutdev-%s%" PRIuSIZE, + nutscan_device_type_lstrings[current_dev->type], + nutdev_num); while (NULL != opt) { if (opt->option != NULL && !strcmp(opt->option, "serial")) { @@ -242,18 +295,18 @@ void nutscan_display_sanity_check_serial(nutscan_device_t * device) if (entry) { /* Got a hit => append value */ - upsdebugx(3, "%s: duplicate entry for serial '%s'", - __func__, keytmp); + upsdebugx(3, "%s: duplicate entry for serial '%s' of '%s': %s", + __func__, keytmp, nutdev_name, entry->val); /* TODO: If changing from preallocated LARGEBUF to * dynamic allocation, malloc data for larger "val". */ snprintfcat(entry->val, sizeof(entry->val), - ",nutdev%i", nutdev_num); + ",%s", nutdev_name); } else { /* No hit => new key */ - upsdebugx(3, "%s: new entry for serial '%s'", - __func__, keytmp); + upsdebugx(3, "%s: new entry for serial '%s' of %s", + __func__, keytmp, nutdev_name); /* TODO: If changing from preallocated LARGEBUF to * dynamic allocation, malloc data for new "entry" @@ -273,7 +326,7 @@ void nutscan_display_sanity_check_serial(nutscan_device_t * device) snprintf(entry->key, sizeof(entry->key), "%s", keytmp); snprintf(entry->val, sizeof(entry->val), - "nutdev%i", nutdev_num); + "%s", nutdev_name); } /* Abort the opt-searching loop for this device */ @@ -342,6 +395,9 @@ void nutscan_display_sanity_check_serial(nutscan_device_t * device) void nutscan_display_sanity_check(nutscan_device_t * device) { + /* Note: while a single device is passed to the method, it is actually + * used to locate the list of related device types and iterate it all. + */ upsdebugx(2, "%s: %s", __func__, device ? (device->type < TYPE_END ? nutscan_device_type_string[device->type] : "") : ""); diff --git a/tools/nut-scanner/nutscan-init.c b/tools/nut-scanner/nutscan-init.c index c2ae3c3751..11efb6c894 100644 --- a/tools/nut-scanner/nutscan-init.c +++ b/tools/nut-scanner/nutscan-init.c @@ -1,4 +1,5 @@ /* + * Copyright (C) 2011 - 2024 Arnaud Quette (Design and part of implementation) * Copyright (C) 2011-2021 - EATON * * This program is free software; you can redistribute it and/or modify @@ -20,6 +21,7 @@ \brief init functions for nut scanner library \author Frederic Bohe \author Arnaud Quette + \author Arnaud Quette */ #include "common.h" @@ -39,6 +41,7 @@ int nutscan_avail_avahi = 0; int nutscan_avail_ipmi = 0; int nutscan_avail_nut = 0; +int nutscan_avail_nut_simulation = 1; #ifdef WITH_SNMP_STATIC int nutscan_avail_snmp = 1; #else @@ -357,6 +360,11 @@ void nutscan_init(void) __func__, nutscan_avail_nut ? "succeeded" : "failed", "NUT Client library"); /* end of libupsclient for "old NUT" (vs. Avahi) protocol */ + +/* start of "NUT Simulation" - unconditional */ +/* no need for additional library */ + nutscan_avail_nut = 1; + } void nutscan_free(void) diff --git a/tools/nut-scanner/nutscan-init.h b/tools/nut-scanner/nutscan-init.h index 4ff5f39d16..b9531b1cdc 100644 --- a/tools/nut-scanner/nutscan-init.h +++ b/tools/nut-scanner/nutscan-init.h @@ -1,4 +1,5 @@ /* + * Copyright (C) 2011 - 2024 Arnaud Quette (Design and part of implementation) * Copyright (C) 2011 - EATON * * This program is free software; you can redistribute it and/or modify @@ -19,6 +20,7 @@ /*! \file nutscan-init.h \brief initialisation data \author Frederic Bohe + \author Arnaud Quette */ #ifndef SCAN_INIT @@ -33,6 +35,7 @@ extern "C" { extern int nutscan_avail_avahi; extern int nutscan_avail_ipmi; extern int nutscan_avail_nut; +extern int nutscan_avail_nut_simulation; extern int nutscan_avail_snmp; extern int nutscan_avail_usb; extern int nutscan_avail_xml_http; diff --git a/tools/nut-scanner/scan_avahi.c b/tools/nut-scanner/scan_avahi.c index 18344709b1..1c41fc0d40 100644 --- a/tools/nut-scanner/scan_avahi.c +++ b/tools/nut-scanner/scan_avahi.c @@ -1,4 +1,5 @@ /* + * Copyright (C) 2011 - 2024 Arnaud Quette (Design and part of implementation) * Copyright (C) 2011 - EATON * * This program is free software; you can redistribute it and/or modify @@ -19,6 +20,7 @@ /*! \file scan_avahi.c \brief detect NUT through Avahi mDNS / DNS-SD services \author Frederic Bohe + \author Arnaud Quette */ #include "common.h" @@ -40,6 +42,8 @@ #include +#define SCAN_AVAHI_DRIVERNAME "dummy-ups" + /* dynamic link library stuff */ static lt_dlhandle dl_handle = NULL; static const char *dl_error = NULL; @@ -266,7 +270,7 @@ static void update_device(const char * host_name, const char *ip, uint16_t port, dev->type = TYPE_NUT; /* NOTE: There is no driver by such name, in practice it could * be a dummy-ups relay, a clone driver, or part of upsmon config */ - dev->driver = strdup("nutclient"); + dev->driver = strdup(SCAN_AVAHI_DRIVERNAME); if (proto == AVAHI_PROTO_INET) { nutscan_add_option_to_device(dev, "desc", "IPv4"); } @@ -322,7 +326,7 @@ static void update_device(const char * host_name, const char *ip, uint16_t port, else { dev = nutscan_new_device(); dev->type = TYPE_NUT; - dev->driver = strdup("nutclient"); + dev->driver = strdup(SCAN_AVAHI_DRIVERNAME); if (proto == AVAHI_PROTO_INET) { nutscan_add_option_to_device(dev, "desc", "IPv4"); } diff --git a/tools/nut-scanner/scan_eaton_serial.c b/tools/nut-scanner/scan_eaton_serial.c index 205f3ad109..fad55f3e11 100644 --- a/tools/nut-scanner/scan_eaton_serial.c +++ b/tools/nut-scanner/scan_eaton_serial.c @@ -658,7 +658,7 @@ nutscan_device_t * nutscan_scan_eaton_serial(const char* ports_range) /* free everything... */ i = 0; while (serial_ports_list[i] != NULL) { - free(serial_ports_list[i]); + free(serial_ports_list[i]); i++; } free( serial_ports_list); diff --git a/tools/nut-scanner/scan_ipmi.c b/tools/nut-scanner/scan_ipmi.c index d0c6d7e9f5..ba4e50776f 100644 --- a/tools/nut-scanner/scan_ipmi.c +++ b/tools/nut-scanner/scan_ipmi.c @@ -64,12 +64,12 @@ static const char *dl_error = NULL; /* Functions symbols remapping */ #define IPMI_FRU_CLOSE_DEVICE_ID "ipmi_fru_parse_close_device_id" #define IPMI_FRU_CTX_DESTROY "ipmi_fru_parse_ctx_destroy" - #define IPMI_FRU_CTX_CREATE "ipmi_fru_parse_ctx_create" - #define IPMI_FRU_CTX_SET_FLAGS "ipmi_fru_parse_ctx_set_flags" - #define IPMI_FRU_OPEN_DEVICE_ID "ipmi_fru_parse_open_device_id" - #define IPMI_FRU_CTX_ERRORMSG "ipmi_fru_parse_ctx_errormsg" - #define IPMI_FRU_READ_DATA_AREA "ipmi_fru_parse_read_data_area" - #define IPMI_FRU_PARSE_NEXT "ipmi_fru_parse_next" + #define IPMI_FRU_CTX_CREATE "ipmi_fru_parse_ctx_create" + #define IPMI_FRU_CTX_SET_FLAGS "ipmi_fru_parse_ctx_set_flags" + #define IPMI_FRU_OPEN_DEVICE_ID "ipmi_fru_parse_open_device_id" + #define IPMI_FRU_CTX_ERRORMSG "ipmi_fru_parse_ctx_errormsg" + #define IPMI_FRU_READ_DATA_AREA "ipmi_fru_parse_read_data_area" + #define IPMI_FRU_PARSE_NEXT "ipmi_fru_parse_next" /* Functions remapping */ static void (*nut_ipmi_sdr_cache_ctx_destroy) (ipmi_sdr_cache_ctx_t ctx); static void (*nut_ipmi_sdr_parse_ctx_destroy) (ipmi_sdr_parse_ctx_t ctx); @@ -90,23 +90,23 @@ static int (*nut_ipmi_fru_read_data_area) (ipmi_fru_parse_ctx_t ctx, static int (*nut_ipmi_fru_next) (ipmi_fru_parse_ctx_t ctx); static ipmi_ctx_t (*nut_ipmi_ctx_create) (void); static int (*nut_ipmi_ctx_find_inband) (ipmi_ctx_t ctx, - ipmi_driver_type_t *driver_type, - int disable_auto_probe, - uint16_t driver_address, - uint8_t register_spacing, - const char *driver_device, - unsigned int workaround_flags, - unsigned int flags); + ipmi_driver_type_t *driver_type, + int disable_auto_probe, + uint16_t driver_address, + uint8_t register_spacing, + const char *driver_device, + unsigned int workaround_flags, + unsigned int flags); static int (*nut_ipmi_ctx_open_outofband) (ipmi_ctx_t ctx, - const char *hostname, - const char *username, - const char *password, - uint8_t authentication_type, - uint8_t privilege_level, - unsigned int session_timeout, - unsigned int retransmission_timeout, - unsigned int workaround_flags, - unsigned int flags); + const char *hostname, + const char *username, + const char *password, + uint8_t authentication_type, + uint8_t privilege_level, + unsigned int session_timeout, + unsigned int retransmission_timeout, + unsigned int workaround_flags, + unsigned int flags); static int (*nut_ipmi_ctx_errnum) (ipmi_ctx_t ctx); static char * (*nut_ipmi_ctx_errormsg) (ipmi_ctx_t ctx); static int (*nut_ipmi_ctx_close) (ipmi_ctx_t ctx); diff --git a/tools/nut-scanner/scan_nut.c b/tools/nut-scanner/scan_nut.c index f8e75c572c..cfff369f8e 100644 --- a/tools/nut-scanner/scan_nut.c +++ b/tools/nut-scanner/scan_nut.c @@ -1,4 +1,5 @@ /* + * Copyright (C) 2011 - 2023 Arnaud Quette (Design and part of implementation) * Copyright (C) 2011 - EATON * Copyright (C) 2016-2021 - EATON - Various threads-related improvements * @@ -21,6 +22,7 @@ \brief detect remote NUT services \author Frederic Bohe \author Jim Klimov + \author Arnaud Quette */ #include "common.h" @@ -29,6 +31,8 @@ #include "nut_stdint.h" #include +#define SCAN_NUT_DRIVERNAME "dummy-ups" + /* dynamic link library stuff */ static lt_dlhandle dl_handle = NULL; static const char *dl_error = NULL; @@ -192,7 +196,7 @@ static void * list_nut_devices(void * arg) dev->type = TYPE_NUT; /* NOTE: There is no driver by such name, in practice it could * be a dummy-ups relay, a clone driver, or part of upsmon config */ - dev->driver = strdup("nutclient"); + dev->driver = strdup(SCAN_NUT_DRIVERNAME); /* +1+1 is for '@' character and terminating 0 */ buf_size = strlen(answer[1]) + strlen(hostname) + 1 + 1; if (port != PORT) { diff --git a/tools/nut-scanner/scan_nut_simulation.c b/tools/nut-scanner/scan_nut_simulation.c new file mode 100644 index 0000000000..402293ad47 --- /dev/null +++ b/tools/nut-scanner/scan_nut_simulation.c @@ -0,0 +1,89 @@ +/* + * Copyright (C) 2023-2024 Arnaud Quette + * + * 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 + */ + +/*! \file scan_nut_simulation.c + \brief detect local NUT simulation devices (.dev & .seq) + \author Arnaud Quette +*/ + +#include "common.h" +#include "nut-scan.h" +#include "nut_stdint.h" +#include + +#define SCAN_NUT_SIMULATION_DRIVERNAME "dummy-ups" + +/* dynamic link library stuff */ +static nutscan_device_t * dev_ret = NULL; + +#ifdef HAVE_PTHREAD +static pthread_mutex_t dev_mutex; +#endif + +nutscan_device_t * nutscan_scan_nut_simulation(void) +{ + DIR *dp; + struct dirent *dirp; + nutscan_device_t * dev = NULL; + +#if HAVE_PTHREAD + pthread_mutex_init(&dev_mutex, NULL); +#endif /* HAVE_PTHREAD */ + + upsdebugx(1,"Scanning: %s", CONFPATH); + + if ((dp = opendir(CONFPATH)) == NULL) { + fatal_with_errno(EXIT_FAILURE, "Failed to open %s", CONFPATH); + return NULL; + } + + while ((dirp = readdir(dp)) != NULL) + { + const char *ext; + + upsdebugx(5, "Comparing file %s with simulation file extensions", dirp->d_name); + ext = strrchr(dirp->d_name, '.'); + if((!ext) || (ext == dirp->d_name)) + continue; + + /* Filter on '.dev' and '.seq' extensions' */ + if ((strcmp(ext, ".dev") == 0) || (strcmp(ext, ".seq") == 0)) { + upsdebugx(1,"Found simulation file: %s", dirp->d_name); + + dev = nutscan_new_device(); + dev->type = TYPE_NUT_SIMULATION; + dev->driver = strdup(SCAN_NUT_SIMULATION_DRIVERNAME); + dev->port = strdup(dirp->d_name); + +#ifdef HAVE_PTHREAD + pthread_mutex_lock(&dev_mutex); +#endif + dev_ret = nutscan_add_device_to_device(dev_ret, dev); +#ifdef HAVE_PTHREAD + pthread_mutex_unlock(&dev_mutex); +#endif + } + } + closedir(dp); + +#if HAVE_PTHREAD + pthread_mutex_destroy(&dev_mutex); +#endif /* HAVE_PTHREAD */ + + return nutscan_rewind_device(dev_ret); +} diff --git a/tools/nut-scanner/scan_usb.c b/tools/nut-scanner/scan_usb.c index 0e355f86b7..c24dc09a51 100644 --- a/tools/nut-scanner/scan_usb.c +++ b/tools/nut-scanner/scan_usb.c @@ -230,7 +230,7 @@ int nutscan_load_usb_library(const char *libname_path) /* end of dynamic link library stuff */ static char* is_usb_device_supported(usb_device_id_t *usb_device_id_list, - int dev_VendorID, int dev_ProductID) + int dev_VendorID, int dev_ProductID, char **alt) { usb_device_id_t *usbdev; @@ -238,6 +238,8 @@ static char* is_usb_device_supported(usb_device_id_t *usb_device_id_list, if ((usbdev->vendorID == dev_VendorID) && (usbdev->productID == dev_ProductID) ) { + if (alt) + *alt = usbdev->alt_driver_names; return usbdev->driver_name; } } @@ -246,7 +248,7 @@ static char* is_usb_device_supported(usb_device_id_t *usb_device_id_list, } /* return NULL if error */ -nutscan_device_t * nutscan_scan_usb(void) +nutscan_device_t * nutscan_scan_usb(nutscan_usb_t * scanopts) { int ret; char string[256]; @@ -256,6 +258,7 @@ nutscan_device_t * nutscan_scan_usb(void) * (drivers/usb-common.h). */ char *driver_name = NULL; + char *alt_driver_names = NULL; char *serialnumber = NULL; char *device_name = NULL; char *vendor_name = NULL; @@ -277,8 +280,12 @@ nutscan_device_t * nutscan_scan_usb(void) * In libusb0 API: "device filename" */ char *device_port = NULL; + /* bcdDevice: aka "Device release number" - note we currently do not match by it */ uint16_t bcdDevice = 0; + + nutscan_usb_t default_scanopts; + #if WITH_LIBUSB_1_0 libusb_device *dev; libusb_device **devlist; @@ -305,6 +312,18 @@ nutscan_device_t * nutscan_scan_usb(void) return NULL; } + if (!scanopts) { + default_scanopts.report_bus = 1; + default_scanopts.report_busport = 1; + /* AQU note: disabled by default, since it may lead to instabilities + * and give more issues than solutions! */ + default_scanopts.report_device = 0; + /* Generally not useful at the moment, and coded to be commented away + * in formats that support it (e.g. ups.conf) or absent in others. */ + default_scanopts.report_bcdDevice = 0; + scanopts = &default_scanopts; + } + /* libusb base init */ /* Initialize Libusb */ #if WITH_LIBUSB_1_0 @@ -397,7 +416,7 @@ nutscan_device_t * nutscan_scan_usb(void) #endif if ((driver_name = is_usb_device_supported(usb_device_table, - VendorID, ProductID)) != NULL) { + VendorID, ProductID, &alt_driver_names)) != NULL) { /* open the device */ #if WITH_LIBUSB_1_0 @@ -533,6 +552,9 @@ nutscan_device_t * nutscan_scan_usb(void) if (driver_name) { nut_dev->driver = strdup(driver_name); } + if (alt_driver_names) { + nut_dev->alt_driver_names = strdup(alt_driver_names); + } nut_dev->port = strdup("auto"); sprintf(string, "%04X", VendorID); @@ -569,29 +591,36 @@ nutscan_device_t * nutscan_scan_usb(void) vendor_name = NULL; } - nutscan_add_option_to_device(nut_dev, + nutscan_add_commented_option_to_device(nut_dev, "bus", - busname); + busname, + scanopts->report_bus ? NULL : ""); - nutscan_add_option_to_device(nut_dev, + nutscan_add_commented_option_to_device(nut_dev, "device", - device_port); + device_port, + scanopts->report_device ? NULL : ""); #if WITH_LIBUSB_1_0 if (bus_port) { - nutscan_add_option_to_device(nut_dev, + nutscan_add_commented_option_to_device(nut_dev, "busport", - bus_port); + bus_port, + scanopts->report_busport ? NULL : ""); free(bus_port); bus_port = NULL; } #endif /* WITH_LIBUSB_1_0 */ - /* Not currently matched by drivers, hence commented for now: */ - sprintf(string, "%04X", bcdDevice); - nutscan_add_option_to_device(nut_dev, - "###NOTMATCHED-YET###bcdDevice", - string); + if (scanopts->report_bcdDevice) { + /* Not currently matched by drivers, hence commented + * for now even if requested via scanopts */ + sprintf(string, "%04X", bcdDevice); + nutscan_add_commented_option_to_device(nut_dev, + "bcdDevice", + string, + "NOTMATCHED-YET"); + } current_nut_dev = nutscan_add_device_to_device( current_nut_dev, @@ -623,8 +652,10 @@ nutscan_device_t * nutscan_scan_usb(void) #else /* not WITH_USB */ /* stub function */ -nutscan_device_t * nutscan_scan_usb(void) +nutscan_device_t * nutscan_scan_usb(nutscan_usb_t * scanopts) { + NUT_UNUSED_VARIABLE(scanopts); + return NULL; } diff --git a/tools/nut-scanner/scan_xml_http.c b/tools/nut-scanner/scan_xml_http.c index 6348a9bad7..490d2b9b21 100644 --- a/tools/nut-scanner/scan_xml_http.c +++ b/tools/nut-scanner/scan_xml_http.c @@ -60,10 +60,10 @@ static lt_dlhandle dl_handle = NULL; static const char *dl_error = NULL; static void (*nut_ne_xml_push_handler)(ne_xml_parser *p, - ne_xml_startelm_cb *startelm, - ne_xml_cdata_cb *cdata, - ne_xml_endelm_cb *endelm, - void *userdata); + ne_xml_startelm_cb *startelm, + ne_xml_cdata_cb *cdata, + ne_xml_endelm_cb *endelm, + void *userdata); static void (*nut_ne_xml_destroy)(ne_xml_parser *p); static int (*nut_ne_xml_failed)(ne_xml_parser *p); static ne_xml_parser * (*nut_ne_xml_create)(void); @@ -321,7 +321,6 @@ static void * nutscan_scan_xml_http_generic(void * arg) sizeof(string), NULL, 0, NI_NUMERICHOST) != 0 ) { - fprintf(stderr, "Error converting IP address: %d\n", errno); usleep(usec_timeout); diff --git a/tools/nut-usbinfo.pl b/tools/nut-usbinfo.pl index 590760c93d..080a5e91aa 100755 --- a/tools/nut-usbinfo.pl +++ b/tools/nut-usbinfo.pl @@ -3,7 +3,7 @@ # Copyright (C) 2008 - 2012 dloic (loic.dardant AT gmail DOT com) # Copyright (C) 2008 - 2015 Arnaud Quette # Copyright (C) 2013 - 2014 Charles Lepple -# Copyright (C) 2014 - 2022 Jim Klimov +# Copyright (C) 2014 - 2023 Jim Klimov # # Based on the usbdevice.pl script, made for the Ubuntu Media Center # for the final use of the LIRC project. @@ -53,6 +53,9 @@ # BSD devd output file my $output_devd="$TOP_BUILDDIR/scripts/devd/nut-usb.conf.in"; +# FreeBSD/pfSense/... quirks output file +my $output_freebsd_quirks="$TOP_BUILDDIR/scripts/devd/nut-usb.quirks"; + # UPower output file my $outputUPower="$TOP_BUILDDIR/scripts/upower/95-upower-hid.hwdb"; @@ -118,6 +121,14 @@ sub gen_usb_files print $out_devd '# This file is generated and installed by the Network UPS Tools package.'."\n"; print $out_devd "# Homepage: https://www.networkupstools.org/\n\n"; + my $out_freebsd_quirks = do {local *OUT_FREEBSD_QUIRKS}; + open $out_freebsd_quirks, ">$output_freebsd_quirks" || die "error $output_freebsd_quirks : $!"; + print $out_freebsd_quirks '# This file is generated and installed by the Network UPS Tools package.'."\n"; + print $out_freebsd_quirks "# Homepage: https://www.networkupstools.org/\n"; + print $out_freebsd_quirks "# Contents should be added to /boot/loader.conf.local (watch out for unique quirk numbers!)\n"; + print $out_freebsd_quirks "# Inspired by 'Notes on USB quirks' under https://forum.netgate.com/topic/183961/nut-package-2-8-1-and-above\n"; + print $out_freebsd_quirks "# and https://github.com/freebsd/freebsd-src/blob/main/sys/dev/usb/quirk/usb_quirk.c\n\n"; + # UPower file header my $outUPower = do {local *OUT_UPOWER}; open $outUPower, ">$outputUPower" || die "error $outputUPower : $!"; @@ -132,7 +143,9 @@ sub gen_usb_files # Device scanner header my $outDevScanner = do {local *OUT_DEV_SCANNER}; open $outDevScanner, ">$outputDevScanner" || die "error $outputDevScanner : $!"; - print $outDevScanner '/* nutscan-usb'.$GPL_header."\n */\n\n"; + print $outDevScanner "/* nutscan-usb.h - header with USB identifiers known to NUT drivers\n"; + print $outDevScanner " * This file was automatically generated during NUT build by 'tools/nut-usbinfo.pl'\n *"; + print $outDevScanner $GPL_header."\n */\n\n"; print $outDevScanner "#ifndef DEVSCAN_USB_H\n#define DEVSCAN_USB_H\n\n"; print $outDevScanner "#include \"nut_stdint.h\"\t/* for uint16_t etc. */\n\n"; print $outDevScanner "#include \t/* for PATH_MAX in usb.h etc. */\n\n"; @@ -161,9 +174,10 @@ sub gen_usb_files print $outDevScanner " typedef usb_dev_handle libusb_device_handle;\n"; print $outDevScanner "#endif\n"; # vid, pid, driver - print $outDevScanner "typedef struct {\n\tuint16_t\tvendorID;\n\tuint16_t\tproductID;\n\tchar*\tdriver_name;\n} usb_device_id_t;\n\n"; + print $outDevScanner "typedef struct {\n\tuint16_t\tvendorID;\n\tuint16_t\tproductID;\n\tchar*\tdriver_name;\n\tchar*\talt_driver_names;\n} usb_device_id_t;\n\n"; print $outDevScanner "/* USB IDs device table */\nstatic usb_device_id_t usb_device_table[] = {\n\n"; + my $entryNumber = 0; # generate the file in alphabetical order (first for VendorID, then for ProductID) foreach my $vendorId (sort { lc $a cmp lc $b } keys %vendorName) { @@ -182,6 +196,10 @@ sub gen_usb_files print $out_devd "\n# ".$vendorName{$vendorId}."\n"; } + # FreeBSD quirks vendor header + if ($vendorName{$vendorId}) { + print $out_freebsd_quirks "\n# ".$vendorName{$vendorId}."\n"; + } # UPower vendor header flag my $upowerVendorHasDevices = 0; @@ -194,22 +212,26 @@ sub gen_usb_files print $outHotplug " 0x00 0x00 0x00 0x00 0x00 0x00000000\n"; # udev device entry - print $outUdev "# ".$vendor{$vendorId}{$productId}{"comment"}.' - '.$vendor{$vendorId}{$productId}{"driver"}."\n"; + print $outUdev "# ".$vendor{$vendorId}{$productId}{"comment"}.' - '.$vendor{$vendorId}{$productId}{"drivers"}."\n"; print $outUdev "ATTR{idVendor}==\"".removeHexPrefix($vendorId); print $outUdev "\", ATTR{idProduct}==\"".removeHexPrefix($productId)."\","; print $outUdev ' MODE="664", GROUP="@RUN_AS_GROUP@"'."\n"; # devd device entry - print $out_devd "# ".$vendor{$vendorId}{$productId}{"comment"}.' - '.$vendor{$vendorId}{$productId}{"driver"}."\n"; + print $out_devd "# ".$vendor{$vendorId}{$productId}{"comment"}.' - '.$vendor{$vendorId}{$productId}{"drivers"}."\n"; print $out_devd "notify 100 {\n\tmatch \"system\"\t\t\"USB\";\n"; print $out_devd "\tmatch \"subsystem\"\t\"DEVICE\";\n"; print $out_devd "\tmatch \"type\"\t\t\"ATTACH\";\n"; print $out_devd "\tmatch \"vendor\"\t\t\"$vendorId\";\n"; - # print $out_devd "\tmatch \"product\"\t\t\"$productId\";\n"; print $out_devd "\taction \"chgrp \@RUN_AS_GROUP\@ /dev/\$cdev; chmod g+rw /dev/\$cdev\";\n"; print $out_devd "};\n"; + # FreeBSD quirks device entry + # e.g. hw.usb.quirk.1="0x051d 0x0003 0x0000 0xffff UQ_HID_IGNORE" + print $out_freebsd_quirks "# ".$vendor{$vendorId}{$productId}{"comment"}.' - '.$vendor{$vendorId}{$productId}{"drivers"}."\n"; + print $out_freebsd_quirks "hw.usb.quirk." . $entryNumber . "=\"" . $vendorId . " " . $productId . " 0x0000 0xffff UQ_HID_IGNORE\"\n"; + # UPower device entry (only for USB/HID devices!) if ($vendor{$vendorId}{$productId}{"driver"} eq "usbhid-ups" || $vendor{$vendorId}{$productId}{"driver"} eq "apc_modbus") @@ -224,7 +246,20 @@ sub gen_usb_files } # Device scanner entry - print $outDevScanner "\t{ ".$vendorId.', '.$productId.", \"".$vendor{$vendorId}{$productId}{"driver"}."\" },\n"; + print $outDevScanner "\t{ ".$vendorId.', '.$productId.", \"".$vendor{$vendorId}{$productId}{"driver"}."\", "; + if (index($vendor{$vendorId}{$productId}{"drivers"}, " ") != -1) { + my $otherDrivers = $vendor{$vendorId}{$productId}{"drivers"}; + $otherDrivers =~ s/$vendor{$vendorId}{$productId}{"driver"}//; + $otherDrivers =~ s/ / /; + $otherDrivers =~ s/^ //; + $otherDrivers =~ s/ $//; + print $outDevScanner "\"".$otherDrivers."\""; + } else { + print $outDevScanner "NULL"; + } + print $outDevScanner " },\n"; + + $entryNumber++; } if ($upowerVendorHasDevices) { @@ -239,7 +274,7 @@ sub gen_usb_files print $outUdev "\n".'LABEL="nut-usbups_rules_end"'."\n"; # Device scanner footer - print $outDevScanner "\n\t/* Terminating entry */\n\t{ 0, 0, NULL }\n};\n#endif /* DEVSCAN_USB_H */\n\n"; + print $outDevScanner "\n\t/* Terminating entry */\n\t{ 0, 0, NULL, NULL }\n};\n#endif /* DEVSCAN_USB_H */\n\n"; } sub find_usbdevs @@ -317,6 +352,7 @@ sub find_usbdevs $vendor{$VendorID}{$ProductID}{"comment"}=$lastComment; # process the driver name my $driver=$nameFile; + my $preferDriver=1; if($nameFile=~/(.+)-hid\.c/) { $driver="usbhid-ups"; } @@ -325,15 +361,69 @@ sub find_usbdevs $driver=$1; } else { - die "Unknown driver type: $nameFile"; + warn "Unknown driver type: $nameFile"; + next; } - if ($vendor{$VendorID}{$ProductID}{"driver"} && $ENV{"DEBUG"}) { - print STDERR "nut-usbinfo.pl: VendorID=$VendorID ProductID=$ProductID " . - "was already related to driver '" . - $vendor{$VendorID}{$ProductID}{"driver"} . - "' and changing to '$driver'\n"; + if ($vendor{$VendorID}{$ProductID}{"driver"}) { + if ($driver ne $vendor{$VendorID}{$ProductID}{"driver"}) { + # FIXME: Prefer apc_modbus to usbhid-ups in builds + # with libmodbus versions which support USB + if ($vendor{$VendorID}{$ProductID}{"driver"} eq "usbhid-ups" + || $vendor{$VendorID}{$ProductID}{"driver"} eq "nutdrv_qx" + || (index($vendor{$VendorID}{$ProductID}{"driver"}, "blazer_") == 0 && $driver ne "nutdrv_qx") + ) { + # This newly seen driver is not as cool + # as the one we already saw earlier. + $preferDriver = 0; + } + } + if ($ENV{"DEBUG"}) { + if ($preferDriver) { + print STDERR "nut-usbinfo.pl: VendorID=$VendorID ProductID=$ProductID " . + "was already related to driver '" . + $vendor{$VendorID}{$ProductID}{"driver"} . + "' and changing to '$driver' as latest hit\n"; + } else { + print STDERR "nut-usbinfo.pl: VendorID=$VendorID ProductID=$ProductID " . + "was already related to driver '" . + $vendor{$VendorID}{$ProductID}{"driver"} . + "' and now also to '$driver'; keeping original as more preferred\n"; + } + } + + # \Q \E magic is only since perl 5.16 so preferring index instead: + if ($ENV{"DEBUG"}) { + print STDERR "nut-usbinfo.pl: checking " . + "list='" . $vendor{$VendorID}{$ProductID}{"drivers"} . "'" . + " l1=" . (index($vendor{$VendorID}{$ProductID}{"drivers"}, " " . $driver . " ")) . + " l2=" . (index($vendor{$VendorID}{$ProductID}{"drivers"}, $driver . " ")) . + " l3=" . (index($vendor{$VendorID}{$ProductID}{"drivers"}, " " . $driver)) . + " l4=" . (length($vendor{$VendorID}{$ProductID}{"drivers"}) - length($driver) - 1) . + "\n"; + } + + if (index($vendor{$VendorID}{$ProductID}{"drivers"}, " " . $driver . " ") > -1 + || index($vendor{$VendorID}{$ProductID}{"drivers"}, $driver . " ") == 0 + || (index($vendor{$VendorID}{$ProductID}{"drivers"}, " " . $driver) == length($vendor{$VendorID}{$ProductID}{"drivers"}) - length($driver) - 1 + && index($vendor{$VendorID}{$ProductID}{"drivers"}, " " . $driver) > -1) + ) { + if ($ENV{"DEBUG"}) { + print STDERR "nut-usbinfo.pl: driver '$driver' was already listed for VendorID=$VendorID ProductID=$ProductID\n"; + } + } else { + $vendor{$VendorID}{$ProductID}{"drivers"} .= " " . $driver; + if ($ENV{"DEBUG"}) { + print STDERR "nut-usbinfo.pl: added '$driver' to list for VendorID=$VendorID ProductID=$ProductID, now: " . $vendor{$VendorID}{$ProductID}{"drivers"} . "\n"; + } + } + } else { + # First hit + $vendor{$VendorID}{$ProductID}{"drivers"} = $driver; + } + + if ($preferDriver) { + $vendor{$VendorID}{$ProductID}{"driver"} = $driver; } - $vendor{$VendorID}{$ProductID}{"driver"}=$driver; } } } diff --git a/tools/nutconf/.gitignore b/tools/nutconf/.gitignore new file mode 100644 index 0000000000..95548aa108 --- /dev/null +++ b/tools/nutconf/.gitignore @@ -0,0 +1,2 @@ +nutconf + diff --git a/tools/nutconf/Makefile.am b/tools/nutconf/Makefile.am new file mode 100644 index 0000000000..53663e4a53 --- /dev/null +++ b/tools/nutconf/Makefile.am @@ -0,0 +1,32 @@ +# Network UPS Tools: NUT configuration tool + +all: $(bin_PROGRAMS) + +bin_PROGRAMS = + +# Currently nutconf and related codebase causes woes for static analysis +# so we do not build it unless explicitly asked to. +if WITH_NUTCONF +bin_PROGRAMS += nutconf +nutconf_SOURCES = nutconf-cli.cpp +nutconf_CXXFLAGS = -I$(top_builddir)/include -I$(top_srcdir)/include +nutconf_LDADD = $(top_builddir)/common/libcommon.la \ + $(top_builddir)/common/libnutconf.la + +# Add support for device scanning +if WITH_LIBLTDL +nutconf_CXXFLAGS += -DWITH_NUTSCANNER -I$(top_srcdir)/tools/nut-scanner +nutconf_LDADD += $(top_builddir)/tools/nut-scanner/libnutscan.la +endif WITH_LIBLTDL + +endif WITH_NUTCONF + +# Make sure out-of-dir dependencies exist (especially when dev-building parts): +$(top_builddir)/common/libcommon.la \ +$(top_builddir)/common/libnutconf.la \ +$(top_builddir)/tools/nut-scanner/libnutscan.la: dummy + +@cd $(@D) && $(MAKE) $(AM_MAKEFLAGS) $(@F) + +dummy: + +MAINTAINERCLEANFILES = Makefile.in .dirstamp diff --git a/tools/nutconf/nutconf-cli.cpp b/tools/nutconf/nutconf-cli.cpp new file mode 100644 index 0000000000..f20a3eb724 --- /dev/null +++ b/tools/nutconf/nutconf-cli.cpp @@ -0,0 +1,3268 @@ +/* + * Copyright (C) 2013 - EATON + * + * 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 + */ + +/*! \file nutconf.cpp + \brief NUT configuration tool + \author Frederic Bohe + \author Vaclav Krpec +*/ + +#include "config.h" +#include "nutconf.hpp" +#include "nutstream.hpp" + +extern "C" { +#if (defined WITH_NUTSCANNER) +#include "nut-scan.h" +#include "nutscan-init.h" +#include "nutscan-device.h" +#endif // defined WITH_NUTSCANNER +} + +#include +#include +#include +#include +#include +#include +#include + + +class Usage { + private: + + /** Usage text */ + static const char * s_text[]; + + /** Private constructor (no instances) */ + Usage() {} + + public: + + /** Print usage */ + static void print(const std::string & bin); + +}; // end of class usage + + +const char * Usage::s_text[] = { + " -h -help", + " --help Display this help and exit", + " --autoconfigure Perform automatic configuration", + " --is-configured Checks whether NUT is configured", + " --local Sets configuration directory", + " --system Sets configuration directory to " CONFPATH " (default)", + " --get-mode Gets NUT mode (see below)", + " --set-mode Sets NUT mode (see below)", + " --set-monitor Configures one monitor (see below)", + " All existing entries are removed; however, it may be", + " specified multiple times to set multiple entries", + " --add-monitor Same as --set-monitor, but keeps existing entries", + " The two options are mutually exclusive", + " --set-listen [] Configures one listen address for the NUT daemon", + " All existing entries are removed; however, it may be", + " specified multiple times to set multiple entries", + " --add-listen [] Same as --set-listen, but keeps existing entries", + " The two options are mutually exclusive", + " --set-device Configures one UPS device (see below)", + " All existing devices are removed; however, it may be", + " specified multiple times to set multiple devices", + " --add-device Same as --set-device, but keeps existing devices", + " The two options are mutually exclusive", + " --set-notifyflags + Configures notify flags for notification type", + " See below for the types and supported flags", + " Existing flags are replaced", + " --add-notifyflags + Same as --set-notifyflags, but keeps existing flags", + " --set-notifymsg Configures notification message for the type", + " --set-notifycmd Configures notification command", + " --set-shutdowncmd Configures shutdown command", + " --set-minsupplies Configures minimum of required power supplies", + " --set-powerdownflag Configures powerdown flag file", + " --set-user Configures one user (see below)", + " All existing users are removed; however, it may be", + " specified multiple times to set multiple users", + " --add-user Same as --set-user, but keeps existing users", + " The two options are mutually exclusive", + " -v", + " --verbose Increase verbosity of output one level", + " May be specified multiple times", +#if (defined WITH_NUTSCANNER) +#if (defined WITH_SNMP) + " --scan-snmp Scan SNMP devices (see below)", + " May be specified multiple times", +#endif // defined WITH_SNMP +#if (defined WITH_USB) + " --scan-usb Scan USB devices", +#endif // defined WITH_USB +#if (defined WITH_NEON) + " --scan-xml-http [] Scan XML/HTTP devices (optional timeout in us)", +#endif // defined WITH_NEON + " --scan-nut Scan NUT devices (see below for the specs)", + " May be specified multiple times", +#if (defined WITH_AVAHI) + " --scan-avahi [] Scan Avahi devices (optional timeout in us)", +#endif // defined WITH_AVAHI +#if (defined WITH_IPMI) + " --scan-ipmi Scan IPMI devices (see below)", + " May be specified multiple times", +#endif // defined WITH_IPMI + " --scan-serial * Scan for serial devices on specified ports", +#endif // defined WITH_NUTSCANNER + "", + "NUT modes: standalone, netserver, netclient, controlled, manual, none", + "Monitor is specified by the following sequence:", + " [:] (\"master\"|\"slave\")", + "UPS device is specified by the following sequence:", + " [=]*", + "Notification types:", + " ONLINE, ONBATT, LOWBATT, FSD, COMMOK, COMMBAD, SHUTDOWN, REPLBATT, NOCOMM, NOPARENT", + "Notification flags:", + " SYSLOG, WALL, EXEC, IGNORE", + "User specification:", + "The very 1st argument is the username (but see the upsmon exception, below).", + "Next arguments use scheme of key/value pairs in form =", + "Known keys are:", + " password, actions (from {SET,FSD}), instcmds (accepted multiple times)", + "Specially, for the upsmon user, the 1st argument takes form of", + " upsmon={master|slave}", +#if (defined WITH_NUTSCANNER) +#if (defined WITH_SNMP) + "SNMP device scan specification:", + " [=]*", + "Known attributes are:", + " timeout (in us), community, sec-level, sec-name, auth-password, priv-password,", + " auth-protocol, priv-protocol, peer-name", +#endif // defined WITH_SNMP + "NUT device scan specification:", + " []", +#if (defined WITH_IPMI) + "IMPI device scan specification:", + " [=]*", + "Known attributes are:", + " username, password, auth-type, cipher-suite-id, K-g-BMC-key, priv-level,", + " workaround-flags, version", +#endif // defined WITH_IPMI +#endif // defined WITH_NUTSCANNER + "", +}; + + +void Usage::print(const std::string & bin) { + std::cerr + << "Usage: " << bin << " [OPTIONS]" << std::endl + << std::endl + << "OPTIONS:" << std::endl; + + for (size_t i = 0; i < sizeof(s_text) / sizeof(char *); ++i) { + std::cerr << s_text[i] << std::endl; + } +} + + +/** Command line options */ +class Options { + public: + + /** Options list */ + typedef std::list List; + + /** Option arguments list */ + typedef std::list Arguments; + + protected: + + /** Options map */ + typedef std::multimap Map; + + private: + + /** Option type */ + typedef enum { + singleDash, /**< Single-dash prefixed option */ + doubleDash, /**< Double-dash prefixed option */ + } type_t; + + /** Arguments of the last option processed (\c nullptr means bin. args) */ + Arguments * m_last; + + /** Binary arguments */ + Arguments m_args; + + /** Single-dashed options */ + Map m_single; + + /** Double-dashed options */ + Map m_double; + + /** + * \brief Add option + * + * \param type Option type + * \param opt Option + */ + void add(type_t type, const std::string & opt); + + /** + * \brief Add argument to the last option + * + * \param arg Argument + */ + inline void addArg(const std::string & arg) { + Arguments * args = nullptr != m_last ? m_last : &m_args; + + args->push_back(arg); + } + + /** + * \brief Count options + * + * \param map Option map + * \param opt Option + * + * \return Options count + */ + size_t count(const Map & map, const std::string & opt) const; + + /** + * \brief Get option arguments + * + * \param[in] map Option map + * \param[in] opt Option + * \param[out] args Option arguments + * \param[in] order Option order (1st by default) + * + * \retval true IFF the option was specified on the command line + * \retval false otherwise + */ + bool get(const Map & map, const std::string & opt, Arguments & args, size_t order = 0) const; + + /** + * \brief Get options list + * + * \param[in] map Option map + * \param[out] list Option list + * + * \return List of options + */ + void strings(const Map & map, List & list) const; + + /** + * \brief Dump options (for debugging reasons) + * + * \param stream Output stream + */ + void dump(std::ostream & stream) const; + + public: + + /** + * \brief Constructor (from \c main routine arguments) + * + * \param argv Argument list + * \param argc Argument count + */ + Options(char * const argv[], int argc); + + /** + * \brief Count single-dashed options + * + * \param opt Option + * + * \return Options count + */ + inline size_t countSingle(const std::string & opt) const { + return count(m_single, opt); + } + + /** + * \brief Count double-dashed options + * + * \param opt Option + * + * \return Options count + */ + inline size_t countDouble(const std::string & opt) const { + return count(m_double, opt); + } + + /** + * \brief Count options (single or double dashed) + * + * \param opt Option + * + * \return Options count + */ + inline bool count(const std::string & opt) const { + return countSingle(opt) + countDouble(opt); + } + + /** + * \brief Check single-dashed option existence + * + * \param opt Option + * + * \retval true IFF the option was specified on the command line + * \retval false otherwise + */ + inline bool existsSingle(const std::string & opt) const { + return countSingle(opt) > 0; + } + + /** + * \brief Check double-dashed option existence + * + * \param opt Option + * + * \retval true IFF the option was specified on the command line + * \retval false otherwise + */ + inline bool existsDouble(const std::string & opt) const { + return countDouble(opt) > 0; + } + + /** + * \brief Check option existence (single or double dashed) + * + * \param opt Option + * + * \retval true IFF the option was specified on the command line + * \retval false otherwise + */ + inline bool exists(const std::string & opt) const { + return existsSingle(opt) || existsDouble(opt); + } + + /** + * \brief Get single-dashed option arguments + * + * \param[in] opt Option + * \param[out] args Option arguments + * \param[in] order Option order (1st by default) + * + * \retval true IFF the option was specified on the command line + * \retval false otherwise + */ + inline bool getSingle(const std::string & opt, Arguments & args, size_t order = 0) const { + return get(m_single, opt, args, order); + } + + /** + * \brief Get double-dashed option arguments + * + * \param[in] opt Option + * \param[out] args Option arguments + * \param[in] order Option order (1st by default) + * + * \retval true IFF the option was specified on the command line + * \retval false otherwise + */ + inline bool getDouble(const std::string & opt, Arguments & args, size_t order = 0) const { + return get(m_double, opt, args, order); + } + + /** + * \brief Get binary arguments + * + * \return Arguments of the binary itself + */ + inline const Arguments & get() const { return m_args; } + + /** + * \brief Get single-dashed options list + * + * \return List of single-dashed options + */ + inline List stringsSingle() const { + List list; + + strings(m_single, list); + + return list; + } + + /** + * \brief Get double-dashed options list + * + * \return List of double-dashed options + */ + inline List stringsDouble() const { + List list; + + strings(m_double, list); + + return list; + } + + /** + * \brief Get all options list + * + * \return List of single or double-dashed options + */ + inline List strings() const; + +}; // end of class Options + + +void Options::add(Options::type_t type, const std::string & opt) { + Map * map; + + switch (type) { + case singleDash: + map = &m_single; + + break; + + case doubleDash: + map = &m_double; + + break; + +#if (defined HAVE_PRAGMA_GCC_DIAGNOSTIC_PUSH_POP) && ( (defined HAVE_PRAGMA_GCC_DIAGNOSTIC_IGNORED_COVERED_SWITCH_DEFAULT) || (defined HAVE_PRAGMA_GCC_DIAGNOSTIC_IGNORED_UNREACHABLE_CODE) ) +# pragma GCC diagnostic push +#endif +#ifdef HAVE_PRAGMA_GCC_DIAGNOSTIC_IGNORED_COVERED_SWITCH_DEFAULT +# pragma GCC diagnostic ignored "-Wcovered-switch-default" +#endif +#ifdef HAVE_PRAGMA_GCC_DIAGNOSTIC_IGNORED_UNREACHABLE_CODE +# pragma GCC diagnostic ignored "-Wunreachable-code" +#endif +/* Older CLANG (e.g. clang-3.4) seems to not support the GCC pragmas above */ +#ifdef __clang__ +# pragma clang diagnostic push +# pragma clang diagnostic ignored "-Wunreachable-code" +# pragma clang diagnostic ignored "-Wcovered-switch-default" +#endif + default: + /* Must not occur thanks to enum. + * But otherwise we can see + * error: 'map' may be used uninitialized + * from some overly zealous compilers. + */ + if (1) { // scoping + std::stringstream e; + + e << "Options::add() got unsupported enum value"; + + throw std::logic_error(e.str()); + } +#ifdef __clang__ +# pragma clang diagnostic pop +#endif +#if (defined HAVE_PRAGMA_GCC_DIAGNOSTIC_PUSH_POP) && ( (defined HAVE_PRAGMA_GCC_DIAGNOSTIC_IGNORED_COVERED_SWITCH_DEFAULT) || (defined HAVE_PRAGMA_GCC_DIAGNOSTIC_IGNORED_UNREACHABLE_CODE) ) +# pragma GCC diagnostic pop +#endif + } + + Map::iterator entry = map->insert(Map::value_type(opt, Arguments())); + + m_last = &entry->second; +} + + +size_t Options::count(const Options::Map & map, const std::string & opt) const { + size_t cnt = 0; + + Map::const_iterator entry = map.find(opt); + + for (; entry != map.end() && entry->first == opt; ++entry) + ++cnt; + + return cnt; +} + + +bool Options::get(const Options::Map & map, const std::string & opt, Arguments & args, size_t order) const { + Map::const_iterator entry = map.find(opt); + + if (map.end() == entry) + return false; + + for (; order; --order) { + Map::const_iterator next = entry; + + ++next; + + if (map.end() == next || next->first != opt) + return false; + + entry = next; + } + + args = entry->second; + + return true; +} + + +void Options::strings(const Map & map, List & list) const { + for (Map::const_iterator opt = map.begin(); opt != map.end(); ++opt) + list.push_back(opt->first); +} + + +void Options::dump(std::ostream & stream) const { + stream << "----- Options dump begin -----" << std::endl; + + Map::const_iterator opt; + + Arguments::const_iterator arg; + + for (opt = m_single.begin(); opt != m_single.end(); ++opt) { + stream << '-' << opt->first << ' '; + + for (arg = opt->second.begin(); arg != opt->second.end(); ++arg) + stream << *arg << ' '; + + stream << std::endl; + } + + for (opt = m_double.begin(); opt != m_double.end(); ++opt) { + stream << "--" << opt->first << ' '; + + for (arg = opt->second.begin(); arg != opt->second.end(); ++arg) + stream << *arg << ' '; + + stream << std::endl; + } + + stream << "-- "; + + for (arg = m_args.begin(); arg != m_args.end(); ++arg) + stream << *arg; + + stream << std::endl << "----- Options dump end -----" << std::endl; +} + + +Options::Options(char * const argv[], int argc): m_last(nullptr) { + for (int i = 1; i < argc; ++i) { + const std::string arg(argv[i]); + + // Empty string is the current option argument, too + // '-' alone is also an option argument + // (like stdout placeholder etc) + if (arg.empty() || '-' != arg[0] || 1 == arg.size()) + addArg(arg); + + // Single-dashed option + else if ('-' != arg[1]) + add(singleDash, arg.substr(1)); + + // "--" alone is valid as it means that what follows + // belongs to the binary ("empty" option arguments) + else if (2 == arg.size()) + m_last = nullptr; + + // Double-dashed option + else if ('-' != arg[2]) + add(doubleDash, arg.substr(2)); + + // "---" prefix means an option argument + else + addArg(arg); + } + + // Options debugging + //dump(std::cerr); +} + + +Options::List Options::strings() const { + List list = stringsSingle(); + + strings(m_double, list); + + return list; +} + + +#if (defined WITH_NUTSCANNER) + +/** NUT scanner wrapper */ +class NutScanner { + public: + + /** Device info */ + class Device { + friend class NutScanner; + + public: + + /** Device type */ + typedef nutscan_device_type_t type_t; + + /** Device options */ + typedef std::map options_t; + + public: + + const std::string type; /**< Type */ + const std::string driver; /**< Driver */ + const std::string port; /**< Port */ + const options_t options; /**< Options */ + + private: + + /** + * \brief Create options + * + * \param opt libnutscan device options + * + * \return Device option list + */ + static options_t createOptions(nutscan_options_t * opt); + + /** Constructor */ + Device(nutscan_device_t * dev); + + }; // end of class Device + + /** Device list */ + typedef std::list devices_t; + + /** SNMP attributes */ + struct SNMPAttributes { + std::string community; /**< Community */ + std::string sec_level; /**< Sec. level */ + std::string sec_name; /**< Sec. name */ + std::string auth_passwd; /**< Authentication password */ + std::string priv_passwd; /**< Priv. password */ + std::string auth_proto; /**< Authentication protocol */ + std::string priv_proto; /**< Priv. protocol */ + std::string peer_name; /**< Peer name */ + }; // end of class SNMPAttributes + + /** IMPI attributes */ + struct IPMIAttributes { + std::string username; /**< Username */ + std::string passwd; /**< Password */ + int auth_type; /**< Authentication type */ + int cipher_suite_id; /**< Cipher suite ID */ + std::string K_g_BMC_key; /**< Optional 2nd key */ + int priv_level; /**< Priviledge level */ + unsigned wa_flags; /**< Workaround flags */ + int version; /**< IPMI protocol version */ + + /** Constructor */ + IPMIAttributes(): + auth_type(IPMI_AUTHENTICATION_TYPE_MD5), + cipher_suite_id(3), + priv_level(IPMI_PRIVILEGE_LEVEL_ADMIN), + wa_flags(0), + version(IPMI_1_5) + {} + + }; // end of struct IMPIAttributes + + private: + + /** NUT scanner initialization/finalization */ + struct InitFinal { + /** Initialization */ + InitFinal() { nutscan_init(); } + + /** Finalization */ + ~InitFinal() { nutscan_free(); } + + }; // end of struct InitFinal + + /** Initializer / finalizer */ + static InitFinal s_init_final; + + /** + * \brief Transform nut-scan provided devices into list of device info + * + * The nut-scan provided device list is destroyed. + * + * \param dev_list nut-scan provided device list + * + * \return Device info list + */ + static devices_t dev2list(nutscan_device_t * dev_list); + + /** Instantiation forbidden */ + NutScanner() {} + + public: + + /** + * \brief Scan for SNMP devices + * + * \param start_ip Address range left border + * \param stop_ip Address range right border + * \param us_timeout Device scan timeout + * \param attrs SNMP attributes + * + * \return Device list + */ + static devices_t devicesSNMP( + const std::string & start_ip, + const std::string & stop_ip, + useconds_t us_timeout, + const SNMPAttributes & attrs); + + /** + * \brief Scan for USB devices + * + * \return Device list + */ + inline static devices_t devicesUSB() { + // FIXME: Since NUT v2.8.2 nutscan_scan_usb accepts + // a `nutscan_usb_t * scanopts` to tweak what values + // it reports -- make use of it in this class. + // A nullptr value causes safe defaults to be used, + // as decided by the library. + nutscan_device_t * dev = ::nutscan_scan_usb(nullptr); + + return dev2list(dev); + } + + /** + * \brief Scan for XML/HTTP devices (broadcast) + * + * \param us_timeout Scan timeout + * + * \return Device list + */ + inline static devices_t devicesXMLHTTP(useconds_t us_timeout) { + nutscan_xml_t xml_sec; + nutscan_device_t * dev; + + ::memset(&xml_sec, 0, sizeof(xml_sec)); + /* Set the default values for XML HTTP (run_xml()) */ + xml_sec.port_http = 80; + xml_sec.port_udp = 4679; + xml_sec.usec_timeout = us_timeout; + xml_sec.peername = nullptr; + dev = ::nutscan_scan_xml_http_range(nullptr, nullptr, us_timeout, &xml_sec); + + return dev2list(dev); + } + + /** + * \brief Scan for NUT (pseudo-)devices + * + * \param start_ip Address range left border + * \param stop_ip Address range right border + * \param port Port + * \param us_timeout Device scan timeout + * + * \return Device list + */ + inline static devices_t devicesNUT( + const std::string & start_ip, + const std::string & stop_ip, + const std::string & port, + useconds_t us_timeout) + { + nutscan_device_t * dev = ::nutscan_scan_nut( + start_ip.c_str(), stop_ip.c_str(), port.c_str(), us_timeout); + + return dev2list(dev); + } + + /** + * \brief Scan for Avahi devices + * + * \param us_timeout Scan timeout + * + * \return Device list + */ + inline static devices_t devicesAvahi(useconds_t us_timeout) { + nutscan_device_t * dev = ::nutscan_scan_avahi(us_timeout); + + return dev2list(dev); + } + + /** + * \brief Scan for IPMI devices + * + * \return Device list + */ + static devices_t devicesIPMI( + const std::string & start_ip, + const std::string & stop_ip, + const IPMIAttributes & attrs); + + /** + * \brief Scan for Eaton serial devices + * + * \param ports List of serial ports + * + * \return Device list + */ + static devices_t devicesEatonSerial(const std::list & ports); + +}; // end of class NutScanner + + +NutScanner::InitFinal NutScanner::s_init_final; + + +NutScanner::Device::options_t NutScanner::Device::createOptions(nutscan_options_t * opt) { + options_t options; + + // Create options + for (; nullptr != opt; opt = opt->next) { + assert(nullptr != opt->option); + + options.insert( + options_t::value_type(opt->option, + nullptr != opt->value ? opt->value : "")); + } + + return options; +} + + +NutScanner::Device::Device(nutscan_device_t * dev): + type(nutscan_device_type_string(dev->type)), + driver(nullptr != dev->driver ? dev->driver : ""), + port(nullptr != dev->port ? dev->port : ""), + options(createOptions(dev->opt)) +{} + + +NutScanner::devices_t NutScanner::dev2list(nutscan_device_t * dev_list) { + devices_t list; + + nutscan_device_t * dev = dev_list; + + for (; dev != nullptr; dev = dev->next) { + // Skip devices of type NONE + // TBD: This happens with the serial scan on an invalid device + // Should be fixed in libnutscan I think + if (TYPE_NONE == dev->type) + continue; + + list.push_back(Device(dev)); + } + + ::nutscan_free_device(dev_list); + + return list; +} + + +NutScanner::devices_t NutScanner::devicesSNMP( + const std::string & start_ip, + const std::string & stop_ip, + useconds_t us_timeout, + const SNMPAttributes & attrs) +{ + nutscan_snmp_t snmp_attrs; + + ::memset(&snmp_attrs, 0, sizeof(snmp_attrs)); + + // TBD: const casting is necessery + // Shouldn't the nutscan_snmp_t items be constant? + + if (!attrs.community.empty()) + snmp_attrs.community = const_cast(attrs.community.c_str()); + + if (!attrs.sec_level.empty()) + snmp_attrs.secLevel = const_cast(attrs.sec_level.c_str()); + + if (!attrs.sec_name.empty()) + snmp_attrs.secName = const_cast(attrs.sec_name.c_str()); + + if (!attrs.auth_passwd.empty()) + snmp_attrs.authPassword = const_cast(attrs.auth_passwd.c_str()); + + if (!attrs.priv_passwd.empty()) + snmp_attrs.privPassword = const_cast(attrs.priv_passwd.c_str()); + + if (!attrs.auth_proto.empty()) + snmp_attrs.authProtocol = const_cast(attrs.auth_proto.c_str()); + + if (!attrs.priv_proto.empty()) + snmp_attrs.privProtocol = const_cast(attrs.priv_proto.c_str()); + + if (!attrs.peer_name.empty()) + snmp_attrs.peername = const_cast(attrs.peer_name.c_str()); + + nutscan_device_t * dev = ::nutscan_scan_snmp( + start_ip.c_str(), stop_ip.c_str(), us_timeout, &snmp_attrs); + + return dev2list(dev); +} + + +NutScanner::devices_t NutScanner::devicesIPMI( + const std::string & start_ip, + const std::string & stop_ip, + const IPMIAttributes & attrs) +{ + nutscan_ipmi_t ipmi_attrs; + + ::memset(&ipmi_attrs, 0, sizeof(ipmi_attrs)); + + // TBD: const casting is necessary + // Shouldn't the nutscan_ipmi_t C-string items be constant? + + if (!attrs.username.empty()) + ipmi_attrs.username = const_cast(attrs.username.c_str()); + + if (!attrs.passwd.empty()) + ipmi_attrs.password = const_cast(attrs.passwd.c_str()); + + ipmi_attrs.authentication_type = attrs.auth_type; + ipmi_attrs.cipher_suite_id = attrs.cipher_suite_id; + + if (!attrs.K_g_BMC_key.empty()) + ipmi_attrs.K_g_BMC_key = const_cast(attrs.K_g_BMC_key.c_str()); + + ipmi_attrs.privilege_level = attrs.priv_level; + ipmi_attrs.workaround_flags = attrs.wa_flags; + ipmi_attrs.ipmi_version = attrs.version; + + nutscan_device_t * dev = ::nutscan_scan_ipmi( + start_ip.c_str(), stop_ip.c_str(), &ipmi_attrs); + + return dev2list(dev); +} + + +NutScanner::devices_t NutScanner::devicesEatonSerial(const std::list & ports) { + std::string port_list; + + std::list::const_iterator port = ports.begin(); + + while (port != ports.end()) { + port_list += *port; + + ++port; + + if (port == ports.end()) + break; + + port_list += ' '; + } + + nutscan_device_t * dev = ::nutscan_scan_eaton_serial(port_list.c_str()); + + return dev2list(dev); +} + +#endif // defined WITH_NUTSCANNER + + +/** nutconf tool specific options */ +class NutConfOptions: public Options { + public: + + /** + * \brief Option mode (getter/setter) + * + * The mode is typically used for options that act as a value (info) + * getter when specified without arguments while if given arguments, + * it sets the value (info). + */ + typedef enum { + NOT_SPECIFIED, /**< Option not specified on command line */ + GETTER, /**< Option is a getter */ + SETTER, /**< Option is a setter */ + } mode_t; + + /** Listen address specification */ + typedef std::pair ListenAddrSpec; + + /** Device specification */ + struct DeviceSpec { + /** Device settings map */ + typedef std::map Map; + + std::string id; /**< Device identifier */ + Map settings; /**< Device settings */ + }; // end of struct DeviceSpec + + /** Notify flags specification */ + typedef std::pair > NotifyFlagsSpec; + + /** Notify flags specifications */ + typedef std::map NotifyFlagsSpecs; + + /** Notify messages specifications */ + typedef std::map NotifyMsgSpecs; + + /** User specification */ + struct UserSpec { + std::string name; /**< Username */ + std::string passwd; /**< Password */ + std::list actions; /**< Actions */ + std::list instcmds; /**< Instant commands */ + }; // end of struct UserSpec + + /** upsmon user specification */ + struct UpsmonUserSpec: public UserSpec { + std::string mode; /**< upsmon mode (master/slave) */ + }; // end of struct UpsmonUserSpec + + /** User specification list */ + typedef std::list UserSpecs; + + private: + + /** Unknown options */ + List m_unknown; + + /** Option specification errors */ + std::list m_errors; + + /** + * \brief Option mode getter (including arguments for setters) + * + * \param[in] opt Option + * \param[out] args Option arguments + * \param[in] order Option order (1st by default) + * + * \retval NOT_SPECIFIED if the option was not specified on the command line + * \retval GETTER if the option has no arguments + * \retval SETTER otherwise (option specified with arguments) + */ + mode_t optMode(const std::string & opt, Arguments & args, size_t order = 0) const; + + + /** + * \brief Option mode getter + * + * \param opt Option + * \param order Option order (1st by default) + * + * \retval NOT_SPECIFIED if the option was not specified on the command line + * \retval GETTER if the option has no arguments + * \retval SETTER otherwise (option specified with arguments) + */ + mode_t optMode(const std::string & opt, size_t order = 0) const { + Arguments args; + + return optMode(opt, args, order); + } + + public: + + /** Options are valid */ + bool valid; + + /** --autoconfigure */ + bool autoconfigure; + + /** --is-configured */ + bool is_configured; + + /** -- local argument */ + std::string local; + + /** --system */ + bool system; + + /** --get-mode */ + bool get_mode; + + /** --set-mode argument */ + std::string mode; + + /** --{add|set}-monitor arguments (all the monitors) */ + std::vector monitors; + + /** Set monitor options count */ + size_t set_monitor_cnt; + + /** Add monitor options count */ + size_t add_monitor_cnt; + + /** --{add|set}-listen arguments (all the addresses) */ + std::vector listen_addrs; + + /** Set listen address options count */ + size_t set_listen_cnt; + + /** Add listen address options count */ + size_t add_listen_cnt; + + /** Device specifications */ + std::vector devices; + + /** Set devices options count */ + size_t set_device_cnt; + + /** Add devices options count */ + size_t add_device_cnt; + + /** Notify flags specifications */ + NotifyFlagsSpecs notify_flags; + + /** Set notify flags options count */ + size_t set_notify_flags_cnt; + + /** Add notify flags options count */ + size_t add_notify_flags_cnt; + + /** Notify messages specifications */ + NotifyMsgSpecs notify_msgs; + + /** Set notify message options count */ + size_t set_notify_msg_cnt; + + /** Notify command */ + std::string notify_cmd; + + /** Shutdown command */ + std::string shutdown_cmd; + + /** Min. supplies */ + std::string min_supplies; + + /** Powerdown flag */ + std::string powerdown_flag; + + /** Users specifications */ + UserSpecs users; + + /** Set user options count */ + size_t set_user_cnt; + + /** Add user options count */ + size_t add_user_cnt; + + /** Verbosity level */ + unsigned int verbose; + + /** Scan NUT devices options count */ + size_t scan_nut_cnt; + + /** Scan USB devices */ + bool scan_usb; + + /** Scan xml_http_devices */ + bool scan_xml_http; + + /** Scan Avahi devices */ + bool scan_avahi; + + /** Scan IPMI devices */ + size_t scan_ipmi_cnt; + + /** Scan SNMP devices options count */ + size_t scan_snmp_cnt; + + /** Scan Eaton serial devices */ + bool scan_serial; + + /** Constructor */ + NutConfOptions(char * const argv[], int argc); + + /** Destructor */ + ~NutConfOptions(); + + /** + * \brief Report invalid options to STDERR + * + * BEWARE: throws an exception if options are valid. + * Check that using the \ref valid flag. + */ + void reportInvalid() const +#if (defined __cplusplus) && (__cplusplus < 201100) + throw(std::logic_error) +#endif + ; + + /** + * \brief Get NUT mode + * + * \return NUT mode (if --mode option was specified with an argument) + */ + inline std::string getMode() const { + Arguments args; + + if (SETTER != optMode("mode", args)) + return ""; + + assert(!args.empty()); + + return args.front(); + } + + /** + * \brief Get monitor definition + * + * \param[out] ups UPS name + * \param[out] host_port Host (possibly including port specification) + * \param[out] pwr_val Power value + * \param[out] user Username + * \param[out] passwd User password + * \param[out] mode Monitor mode + * \param[in] which Monitor order (1st by default) + */ + void getMonitor( + std::string & ups, + std::string & host_port, + std::string & pwr_val, + std::string & user, + std::string & passwd, + std::string & mode, + size_t which = 0) const +#if (defined __cplusplus) && (__cplusplus < 201100) + throw(std::range_error) +#endif + ; + + private: + + /** + * \brief Check --mode argument validity + * + * \param mode Mode argument + * + * \retval true IFF the mode is set correctly + * \retval false otherwise + */ + static bool checkMode(const std::string & mode); + + /** + * \brief Add another user specification + * + * The method is responsible for parsing --{set|add}-user option arguments + * and storing the user specification in \ref users list. + * + * \param args User specification (raw) + */ + void addUser(const Arguments & args); + +}; // end of class NutConfOptions + + +NutConfOptions::mode_t NutConfOptions::optMode(const std::string & opt, Arguments & args, size_t order) const { + if (!getDouble(opt, args, order)) + return NOT_SPECIFIED; + + if (args.empty()) + return GETTER; + + return SETTER; +} + + +NutConfOptions::NutConfOptions(char * const argv[], int argc): + Options(argv, argc), + valid(true), + autoconfigure(false), + is_configured(false), + system(false), + get_mode(false), + set_monitor_cnt(0), + add_monitor_cnt(0), + set_listen_cnt(0), + add_listen_cnt(0), + set_device_cnt(0), + add_device_cnt(0), + set_notify_flags_cnt(0), + add_notify_flags_cnt(0), + set_notify_msg_cnt(0), + set_user_cnt(0), + add_user_cnt(0), + verbose(0), + scan_nut_cnt(0), + scan_usb(false), + scan_xml_http(false), + scan_avahi(false), + scan_ipmi_cnt(0), + scan_snmp_cnt(0), + scan_serial(false) +{ + static const std::string sDash("-"); + static const std::string dDash("--"); + + // Specify single-dashed options + List list = stringsSingle(); + + for (List::const_iterator opt = list.begin(); opt != list.end(); ++opt) { + // Known options + if ("v" == *opt) { + ++verbose; + } + + // Unknown option + else { + m_unknown.push_back(sDash + *opt); + } + } + + // Specify double-dashed options + list = stringsDouble(); + + for (List::const_iterator opt = list.begin(); opt != list.end(); ++opt) { + // Known options + if ("autoconfigure" == *opt) { + if (autoconfigure) + m_errors.push_back("--autoconfigure option specified more than once"); + else + autoconfigure = true; + } + else if ("is-configured" == *opt) { + if (is_configured) + m_errors.push_back("--is-configured option specified more than once"); + else + is_configured = true; + } + else if ("local" == *opt) { + Arguments args; + + if (!local.empty()) + m_errors.push_back("--local option specified more than once"); + + else if (NutConfOptions::SETTER != optMode("local", args)) + m_errors.push_back("--local option requires an argument"); + + else if (args.size() > 1) + m_errors.push_back("Only one directory may be specified with the --local option"); + + else + local = args.front(); + } + else if ("system" == *opt) { + if (system) + m_errors.push_back("--system option specified more than once"); + else + system = true; + } + else if ("get-mode" == *opt) { + if (get_mode) + m_errors.push_back("--get-mode option specified more than once"); + else + get_mode = true; + } + else if ("set-mode" == *opt) { + Arguments args; + + if (!mode.empty()) + m_errors.push_back("--set-mode option specified more than once"); + + else if (NutConfOptions::SETTER != optMode(*opt, args)) + m_errors.push_back("--set-mode option requires an argument"); + + else if (args.size() > 1) + m_errors.push_back("Only one argument allowed for the --set-mode option"); + + else if (args.size() == 1 && !checkMode(args.front())) + m_errors.push_back("Unknown NUT mode: \"" + args.front() + "\""); + + else + mode = args.front(); + } + else if ("set-monitor" == *opt || "add-monitor" == *opt) { + size_t * cnt = ('s' == (*opt)[0] ? &set_monitor_cnt : &add_monitor_cnt); + + Arguments args; + + if (NutConfOptions::SETTER != optMode(*opt, args, *cnt)) + m_errors.push_back("--" + *opt + " option requires arguments"); + + else if (args.size() != 6) + m_errors.push_back("--" + *opt + " option requires exactly 6 arguments"); + + else + for (Arguments::const_iterator arg = args.begin(); arg != args.end(); ++arg) + monitors.push_back(*arg); + + ++*cnt; + } + else if ("set-listen" == *opt || "add-listen" == *opt) { + size_t * cnt = ('s' == (*opt)[0] ? &set_listen_cnt : &add_listen_cnt); + + Arguments args; + + if (NutConfOptions::SETTER != optMode(*opt, args, *cnt)) + m_errors.push_back("--" + *opt + " option requires arguments"); + + else if (args.size() < 1 || args.size() > 2) + m_errors.push_back("--" + *opt + " option requires 1 or 2 arguments"); + + else { + ListenAddrSpec addr_port(args.front(), args.size() > 1 ? args.back() : ""); + + listen_addrs.push_back(addr_port); + } + + ++*cnt; + } + else if ("set-device" == *opt || "add-device" == *opt) { + size_t * cnt = ('s' == (*opt)[0] ? &set_device_cnt : &add_device_cnt); + + Arguments args; + + if (NutConfOptions::SETTER != optMode(*opt, args, *cnt)) + m_errors.push_back("--" + *opt + " option requires arguments"); + + else if (args.size() < 3) + m_errors.push_back("--" + *opt + " option requires at least 3 arguments"); + + else { + DeviceSpec dev; + + Arguments::const_iterator arg = args.begin(); + + assert(args.size() >= 3); + + dev.id = *arg++; + + dev.settings["driver"] = *arg++; + dev.settings["port"] = *arg++; + + for (; arg != args.end(); ++arg) { + size_t eq_pos = (*arg).find('='); + + if (std::string::npos == eq_pos) + m_errors.push_back("--" + *opt + + " option extra argument '" + + *arg + "' is illegal"); + + else + dev.settings[(*arg).substr(0, eq_pos)] = + (*arg).substr(eq_pos + 1); + } + + devices.push_back(dev); + } + + ++*cnt; + } + else if ("set-notifyflags" == *opt || "add-notifyflags" == *opt) { + bool set = 's' == (*opt)[0]; + size_t * cnt = (set ? &set_notify_flags_cnt : &add_notify_flags_cnt); + + Arguments args; + + if (NutConfOptions::SETTER != optMode(*opt, args, *cnt)) + m_errors.push_back("--" + *opt + " option requires arguments"); + + else if (args.size() < 2) + m_errors.push_back("--" + *opt + " option requires at least 2 arguments"); + + else { + Arguments::const_iterator arg = args.begin(); + + const std::string & type = *arg++; + + NotifyFlagsSpecs::iterator flags = notify_flags.lower_bound(type); + + if (flags != notify_flags.end() && flags->first == type) + m_errors.push_back( + "--" + *opt + " option: conflicting specifications " + + "for notification type " + type); + + else { + flags = notify_flags.insert(flags, + NotifyFlagsSpecs::value_type( + type, + NotifyFlagsSpec(set, std::list()))); + + for (; arg != args.end(); ++arg) + flags->second.second.push_back(*arg); + } + } + + ++*cnt; + } + else if ("set-notifymsg" == *opt) { + Arguments args; + + if (NutConfOptions::SETTER != optMode(*opt, args, set_notify_msg_cnt)) + m_errors.push_back("--" + *opt + " option requires arguments"); + + else if (args.size() != 2) { + m_errors.push_back("--" + *opt + " option requires 2 arguments"); + m_errors.push_back(" (perhaps you need to quote the message?)"); + } + + else { + notify_msgs[args.front()] = args.back(); + } + + ++set_notify_msg_cnt; + } + else if ("set-notifycmd" == *opt) { + Arguments args; + + if (!notify_cmd.empty()) + m_errors.push_back("--set-notifycmd option specified more than once"); + + else if (NutConfOptions::SETTER != optMode("set-notifycmd", args)) + m_errors.push_back("--set-notifycmd option requires an argument"); + + else if (args.size() > 1) { + m_errors.push_back("Too many arguments for the --set-notifycmd option"); + m_errors.push_back(" (perhaps you need to quote the command?)"); + } + + else + notify_cmd = args.front(); + } + else if ("set-shutdowncmd" == *opt) { + Arguments args; + + if (!shutdown_cmd.empty()) + m_errors.push_back("--set-shutdowncmd option specified more than once"); + + else if (NutConfOptions::SETTER != optMode("set-shutdowncmd", args)) + m_errors.push_back("--set-shutdowncmd option requires an argument"); + + else if (args.size() > 1) { + m_errors.push_back("Too many arguments for the --set-shutdowncmd option"); + m_errors.push_back(" (perhaps you need to quote the command?)"); + } + + else + shutdown_cmd = args.front(); + } + else if ("set-minsupplies" == *opt) { + Arguments args; + + if (!min_supplies.empty()) + m_errors.push_back("--set-minsupplies option specified more than once"); + + else if (NutConfOptions::SETTER != optMode("set-minsupplies", args)) + m_errors.push_back("--set-minsupplies option requires an argument"); + + else if (args.size() > 1) { + m_errors.push_back("Too many arguments for the --set-minsupplies option"); + } + + else + min_supplies = args.front(); + } + else if ("set-powerdownflag" == *opt) { + Arguments args; + + if (!powerdown_flag.empty()) + m_errors.push_back("--set-powerdownflag option specified more than once"); + + else if (NutConfOptions::SETTER != optMode("set-powerdownflag", args)) + m_errors.push_back("--set-powerdownflag option requires an argument"); + + else if (args.size() > 1) { + m_errors.push_back("Too many arguments for the --set-powerdownflag option"); + } + + else + powerdown_flag = args.front(); + } + else if ("set-user" == *opt || "add-user" == *opt) { + size_t * cnt = ('s' == (*opt)[0] ? &set_user_cnt : &add_user_cnt); + + Arguments args; + + if (NutConfOptions::SETTER != optMode(*opt, args, *cnt)) + m_errors.push_back("--" + *opt + " option requires arguments"); + + else + addUser(args); + + ++*cnt; + } + else if ("verbose" == *opt) { + ++verbose; + } + +#if (defined WITH_NUTSCANNER) + +#if (defined WITH_USB) + else if ("scan-usb" == *opt) { + if (scan_usb) + m_errors.push_back("--scan-usb option specified more than once"); + else + scan_usb = true; + } +#endif // defined WITH_USB + else if ("scan-nut" == *opt) { + Arguments args; + + getDouble(*opt, args, scan_nut_cnt); + + if (args.size() < 3) + m_errors.push_back("--scan-nut option requires at least 3 arguments"); + + else if (args.size() > 4) + m_errors.push_back("--scan-nut option requires at most 4 arguments"); + + ++scan_nut_cnt; + } +#if (defined WITH_NEON) + else if ("scan-xml-http" == *opt) { + if (scan_xml_http) + m_errors.push_back("--scan-xml-http option specified more than once"); + else { + Arguments args; + + getDouble(*opt, args); + + if (args.size() > 1) + m_errors.push_back("--scan-xml-http option accepts only one argument"); + + scan_xml_http = true; + } + } +#endif // defined WITH_NEON +#if (defined WITH_AVAHI) + else if ("scan-avahi" == *opt) { + if (scan_avahi) + m_errors.push_back("--scan-avahi option specified more than once"); + else { + Arguments args; + + getDouble(*opt, args); + + if (args.size() > 1) + m_errors.push_back("--scan-avahi option accepts only one argument"); + + scan_avahi = true; + } + } +#endif // defined WITH_AVAHI +#if (defined WITH_IPMI) + else if ("scan-ipmi" == *opt) { + Arguments args; + + getDouble(*opt, args, scan_ipmi_cnt); + + if (args.size() < 2) + m_errors.push_back("--scan-ipmi option requires at least 2 arguments"); + + ++scan_ipmi_cnt; + } +#endif // defined WITH_IPMI +#if (defined WITH_SNMP) + else if ("scan-snmp" == *opt) { + Arguments args; + + getDouble(*opt, args, scan_snmp_cnt); + + if (args.size() < 2) + m_errors.push_back("--scan-snmp option requires at least 2 arguments"); + + ++scan_snmp_cnt; + } +#endif // defined WITH_SNMP + else if ("scan-serial" == *opt) { + if (scan_serial) + m_errors.push_back("--scan-serial option specified more than once"); + else + scan_serial = true; + } + +#endif // defined WITH_NUTSCANNER) + + // Unknown option + else { + m_unknown.push_back(dDash + *opt); + } + } + + // Options are valid IFF we know all of them + // and there are no direct binary arguments + valid = m_unknown.empty() && m_errors.empty() && get().empty(); + + // --set-monitor and --add-monitor are mutually exclusive + if (set_monitor_cnt > 0 && add_monitor_cnt > 0) { + m_errors.push_back("--set-monitor and --add-monitor options can't both be specified"); + + valid = false; + } + + // --set-listen and --add-listen are mutually exclusive + if (set_listen_cnt > 0 && add_listen_cnt > 0) { + m_errors.push_back("--set-listen and --add-listen options can't both be specified"); + + valid = false; + } + + // --set-device and --add-device are mutually exclusive + if (set_device_cnt > 0 && add_device_cnt > 0) { + m_errors.push_back("--set-device and --add-device options can't both be specified"); + + valid = false; + } + + // --set-user and --add-user are mutually exclusive + if (set_user_cnt > 0 && add_user_cnt > 0) { + m_errors.push_back("--set-user and --add-user options can't both be specified"); + + valid = false; + } +} + + +NutConfOptions::~NutConfOptions() { + UserSpecs::iterator user = users.begin(); + + for (; user != users.end(); ++user) { + delete *user; + *user = nullptr; + } +} + + +void NutConfOptions::reportInvalid() const +#if (defined __cplusplus) && (__cplusplus < 201100) + throw(std::logic_error) +#endif +{ + if (valid) + throw std::logic_error("No invalid options to report"); + + List::const_iterator unknown_opt = m_unknown.begin(); + + for (; unknown_opt != m_unknown.end(); ++unknown_opt) { + std::cerr << "Unknown option: " << *unknown_opt << std::endl; + } + + std::list::const_iterator error = m_errors.begin(); + + for (; error != m_errors.end(); ++error) { + std::cerr << "Option error: " << *error << std::endl; + } + + // No direct arguments expected + const Arguments & args = get(); + + Arguments::const_iterator arg = args.begin(); + + for (; arg != args.end(); ++arg) { + std::cerr << "Unexpected argument: " << *arg << std::endl; + } +} + + +bool NutConfOptions::checkMode(const std::string & mode) { + if ("standalone" == mode) return true; + if ("netserver" == mode) return true; + if ("netclient" == mode) return true; + if ("controlled" == mode) return true; + if ("manual" == mode) return true; + if ("none" == mode) return true; + + return false; +} + + +/** + * \brief Automatically destroyed dynamic object pointer + * + * The template class is useful in situation where you need to + * create a dynamic object, process its attributes and automatically + * destroy it in case of error simply by leaving the scope + * (i.e. not having to worry about calling \c delete by hand). + */ +template +class autodelete_ptr { + private: + + T * m_impl; + + /** Cleanup */ + inline void cleanup() { + if (nullptr != m_impl) + delete m_impl; + + m_impl = nullptr; + } + + public: + + /** Constructor (unset) */ + autodelete_ptr(): m_impl(nullptr) {} + + /** Constructor */ + autodelete_ptr(T * ptr): m_impl(ptr) {} + + /** Setter */ + inline autodelete_ptr & operator = (T * ptr) { + cleanup(); + + m_impl = ptr; + + return *this; + } + + /** Pointer accessor */ + inline operator T * () const { return m_impl; } + + /** Pointer accessor */ + inline T * operator -> () const { return m_impl; } + + /** Pointer overtake (invalidates the object) */ + inline T * give() { + T * ptr = m_impl; + + m_impl = nullptr; + + return ptr; + } + + /** Destructor */ + ~autodelete_ptr() { + cleanup(); + } + + private: + + /** Copying is forbidden */ + autodelete_ptr(const autodelete_ptr & orig) { + NUT_UNUSED_VARIABLE(orig); + } + + /** Assignment is forbidden */ + autodelete_ptr & operator = (const autodelete_ptr & orig) { + NUT_UNUSED_VARIABLE(orig); + } + +}; // end of template class autodelete_ptr + + +void NutConfOptions::addUser(const Options::Arguments & args) { + assert(args.size() > 0); + + Arguments::const_iterator arg_iter = args.begin(); + + // Create new user specification + autodelete_ptr user; + + const std::string & name = *arg_iter; + + // upsmon user (apparently) + // Note that we use pragmatic do ... while (0) loop to enable break + do if (name.size() >= 6 && name.substr(0, 6) == "upsmon") { + if (6 == name.size()) { + m_errors.push_back("upsmon user specification requires monitor mode"); + + return; + } + + // Fall-through to ordinary user specification + if ('=' != name[6]) + break; + + UpsmonUserSpec * upsmon_user = new UpsmonUserSpec; + + upsmon_user->name = "upsmon"; + upsmon_user->mode = name.substr(7); + + user = upsmon_user; + + } while (0); // end of pragmatic do ... while (0) loop + + // Ordinary user + if (nullptr == user) { + user = new UserSpec; + + user->name = name; + } + + assert(nullptr != user); + + // Set user attributes + bool errors = false; + + for (++arg_iter; arg_iter != args.end(); ++arg_iter) { + const std::string & arg = *arg_iter; + + size_t eq_pos = arg.find('='); + + if (std::string::npos == eq_pos) { + m_errors.push_back("Illegal user attribute specification: \"" + arg + '"'); + + errors = true; + + continue; + } + + const std::string attr = arg.substr(0, eq_pos); + const std::string val = arg.substr(eq_pos + 1); + + if ("password" == attr) + user->passwd = val; + + else if ("actions" == attr) + user->actions.push_back(val); + + else if ("instcmds" == attr) + user->instcmds.push_back(val); + + else { + m_errors.push_back("Unknown user attribute: \"" + attr + '"'); + + errors = true; + } + } + + if (errors) + return; + + // Store user specification + users.push_back(user.give()); +} + + +void NutConfOptions::getMonitor( + std::string & ups, + std::string & host_port, + std::string & pwr_val, + std::string & user, + std::string & passwd, + std::string & mode_arg, + size_t which) const +#if (defined __cplusplus) && (__cplusplus < 201100) + throw(std::range_error) +#endif +{ + if (which >= monitors.size() / 6) + throw std::range_error("INTERNAL ERROR: monitors index overflow"); + + size_t base_idx = 6 * which; + + assert(monitors.size() >= base_idx + 6); + + ups = monitors[base_idx]; + host_port = monitors[base_idx + 1]; + pwr_val = monitors[base_idx + 2]; + user = monitors[base_idx + 3]; + passwd = monitors[base_idx + 4]; + mode_arg = monitors[base_idx + 5]; +} + + +/** + * \brief Sources configuration object from file (if exists) + * + * If the file doesn't exist, the conf. object is unchanged + * (and the result is indicated by the return value). + * If the file exists, but can't be parsed, an error is reported + * and the execution is terminated. + * + * \param config Configuration object + * \param file_name File name + * + * \retval true if the configuration file was sourced + * \retval false if the file doesn't exist + */ +static bool source(nut::Serialisable * config, const std::string & file_name) { + nut::NutFile file(file_name); + + if (!file.exists()) + return false; + + file.openx(); + + bool parsed_ok = config->parseFrom(file); + + file.closex(); + + if (parsed_ok) + return true; + + std::cerr << "Error: Failed to parse " << file_name << std::endl; + + ::exit(1); +} + + +/** + * \brief Store configuration object to file + * + * If the file exists, it's rewritten. + * + * \param config Configuration object + * \param file_name File name + */ +static void store(nut::Serialisable * config, const std::string & file_name) { + nut::NutFile file(file_name, nut::NutFile::WRITE_ONLY); + + bool written_ok = config->writeTo(file); + + file.closex(); + + if (written_ok) + return; + + std::cerr << "Error: Failed to write " << file_name << std::endl; + + ::exit(1); +} + + +/** + * \brief Check whether NUT was configured + * + * \param etc Configuration directory + * + * \retval true IFF nut.conf exists and MODE != none + * \retval false otherwise + */ +static bool isConfigured(const std::string & etc) { + nut::NutFile nut_conf_file(etc + "/nut.conf"); + + if (!nut_conf_file.exists()) + return false; + + nut_conf_file.openx(); + + nut::NutConfiguration nut_conf; + + nut_conf.parseFrom(nut_conf_file); + + return + nut::NutConfiguration::MODE_UNKNOWN != nut_conf.mode && + nut::NutConfiguration::MODE_NONE != nut_conf.mode; +} + + +/** + * \brief Transform monitor specification + * + * Transform monitor specification from cmd. line to monitor configuration. + * + * \param i Monitor index + * \param options nutconf options + * + * \return Monitor configuration + */ +static nut::UpsmonConfiguration::Monitor monitor( + size_t i, + const NutConfOptions & options) +{ + nut::UpsmonConfiguration::Monitor monitor; + + std::string host_port, pwr_val, mode; + + options.getMonitor( + monitor.upsname, host_port, pwr_val, + monitor.username, monitor.password, mode, + i); + + // Parse host[:port] + unsigned short port = 0; + + size_t colon_idx = host_port.rfind(':'); + + if (std::string::npos != colon_idx) { + std::stringstream ss(host_port.substr(colon_idx + 1)); + + if ((ss >> port).fail()) { + std::cerr + << "Error: failed to parse host specification \"" + << host_port << '"' << std::endl; + + ::exit(1); + } + } + + // Parse power value + unsigned int power_value; + + std::stringstream ss(pwr_val); + + if ((ss >> power_value).fail()) { + std::cerr + << "Error: failed to parse power value \"" + << pwr_val << '"' << std::endl; + + ::exit(1); + } + + monitor.hostname = host_port.substr(0, colon_idx); + monitor.port = port; + monitor.powerValue = power_value; + monitor.isMaster = "master" == mode; + + return monitor; +} + + +/** + * \brief NUT mode getter + * + * \param etc Configuration directory + * + * \return NUT mode (as string) + */ +static std::string getMode(const std::string & etc) { + std::string nut_conf_file(etc + "/nut.conf"); + std::stringstream e; + nut::NutConfiguration nut_conf; + + // Source previous configuration + source(&nut_conf, nut_conf_file); + + nut::NutConfiguration::NutMode mode = nut_conf.mode; + + switch (mode) { + case nut::NutConfiguration::MODE_UNKNOWN: return "unknown"; + case nut::NutConfiguration::MODE_NONE: return "none"; + case nut::NutConfiguration::MODE_STANDALONE: return "standalone"; + case nut::NutConfiguration::MODE_NETSERVER: return "netserver"; + case nut::NutConfiguration::MODE_NETCLIENT: return "netclient"; + case nut::NutConfiguration::MODE_CONTROLLED: return "controlled"; + case nut::NutConfiguration::MODE_MANUAL: return "manual"; + +#if (defined HAVE_PRAGMA_GCC_DIAGNOSTIC_PUSH_POP) && ( (defined HAVE_PRAGMA_GCC_DIAGNOSTIC_IGNORED_COVERED_SWITCH_DEFAULT) || (defined HAVE_PRAGMA_GCC_DIAGNOSTIC_IGNORED_UNREACHABLE_CODE) ) +# pragma GCC diagnostic push +#endif +#ifdef HAVE_PRAGMA_GCC_DIAGNOSTIC_IGNORED_COVERED_SWITCH_DEFAULT +# pragma GCC diagnostic ignored "-Wcovered-switch-default" +#endif +#ifdef HAVE_PRAGMA_GCC_DIAGNOSTIC_IGNORED_UNREACHABLE_CODE +# pragma GCC diagnostic ignored "-Wunreachable-code" +#endif +/* Older CLANG (e.g. clang-3.4) seems to not support the GCC pragmas above */ +#ifdef __clang__ +# pragma clang diagnostic push +# pragma clang diagnostic ignored "-Wunreachable-code" +# pragma clang diagnostic ignored "-Wcovered-switch-default" +#endif + default: + break; + } + + e << "INTERNAL ERROR: Unknown NUT mode: " << mode; + throw std::logic_error(e.str()); +#ifdef __clang__ +# pragma clang diagnostic pop +#endif +#if (defined HAVE_PRAGMA_GCC_DIAGNOSTIC_PUSH_POP) && ( (defined HAVE_PRAGMA_GCC_DIAGNOSTIC_IGNORED_COVERED_SWITCH_DEFAULT) || (defined HAVE_PRAGMA_GCC_DIAGNOSTIC_IGNORED_UNREACHABLE_CODE) ) +# pragma GCC diagnostic pop +#endif +} + + +/** + * \brief NUT mode setter + * + * \param mode Mode + * \param etc Configuration directory + */ +static void setMode(const std::string & mode, const std::string & etc) { + std::string nut_conf_file(etc + "/nut.conf"); + + nut::NutConfiguration nut_conf; + + // Source previous configuration (if any) + source(&nut_conf, nut_conf_file); + + // Set mode + nut_conf.mode = nut::NutConfiguration::NutModeFromString(mode); + + // Store configuration + store(&nut_conf, nut_conf_file); +} + + +/** + * \brief Set monitors in upsmon.conf + * + * \param monitors Monitor list + * \param etc Configuration directory + * \param keep_ex Keep existing entries (discard by default) + */ +static void setMonitors( + const std::list & monitors, + const std::string & etc, bool keep_ex = false) +{ + std::string upsmon_conf_file(etc + "/upsmon.conf"); + + nut::UpsmonConfiguration upsmon_conf; + + // Source previous configuration (if any) + source(&upsmon_conf, upsmon_conf_file); + + // Remove existing monitors (unless we want to keep them) + if (!keep_ex) + upsmon_conf.monitors.clear(); + + // Add monitors to the current ones (if any) + std::list::const_iterator + monitor = monitors.begin(); + + for (; monitor != monitors.end(); ++monitor) + upsmon_conf.monitors.push_back(*monitor); + + // Store configuration + store(&upsmon_conf, upsmon_conf_file); +} + + +/** + * \brief Transform listen address specification + * + * Transform listen address specification from cmd. line to listen address configuration. + * + * \param i Listen address index + * \param options nutconf options + * + * \return Listen address configuration + */ +static nut::UpsdConfiguration::Listen listenAddr( + size_t i, + const NutConfOptions & options) +{ + nut::UpsdConfiguration::Listen listen_addr; + + const NutConfOptions::ListenAddrSpec & addr_spec = options.listen_addrs[i]; + + listen_addr.address = addr_spec.first; + + // Parse port + if (!addr_spec.second.empty()) { + unsigned short port = 0; + + std::stringstream ss(addr_spec.second); + + if ((ss >> port).fail()) { + std::cerr + << "Error: failed to parse port specification \"" + << addr_spec.second << '"' << std::endl; + + ::exit(1); + } + + listen_addr.port = port; + } + + return listen_addr; +} + + +/** + * \brief Set listen addresses in upsd.conf + * + * \param listen_addrs Address list + * \param etc Configuration directory + * \param keep_ex Keep existing entries (discard by default) + */ +static void setListenAddrs( + const std::list & listen_addrs, + const std::string & etc, bool keep_ex = false) +{ + std::string upsd_conf_file(etc + "/upsd.conf"); + + nut::UpsdConfiguration upsd_conf; + + // Source previous configuration (if any) + source(&upsd_conf, upsd_conf_file); + + // Remove existing listen addresses (unless we want to keep them) + if (!keep_ex) + upsd_conf.listens.clear(); + + // Add listen addresses to the current ones (if any) + std::list::const_iterator + listen = listen_addrs.begin(); + + for (; listen != listen_addrs.end(); ++listen) + upsd_conf.listens.push_back(*listen); + + // Store configuration + store(&upsd_conf, upsd_conf_file); +} + + +/** + * \brief Set devices in ups.conf + * + * \param devices Device list + * \param etc Configuration directory + * \param keep_ex Keep existing entries (discard by default) + */ +static void setDevices( + const std::vector & devices, + const std::string & etc, bool keep_ex = false) +{ + std::string ups_conf_file(etc + "/ups.conf"); + + nut::UpsConfiguration ups_conf; + + // Source previous configuration (if any) + source(&ups_conf, ups_conf_file); + + // Remove existing devices (unless we want to keep them) + if (!keep_ex) { + nut::UpsConfiguration::SectionMap::iterator + ups = ups_conf.sections.begin(); + + for (; ups != ups_conf.sections.end(); ++ups) { + // Keep global section + if (ups->first.empty()) + continue; + + ups_conf.sections.erase(ups); + } + } + + // Add devices to the current ones (if any) + std::vector::const_iterator + dev = devices.begin(); + + for (; dev != devices.end(); ++dev) { + const std::string & id = (*dev).id; + + NutConfOptions::DeviceSpec::Map::const_iterator + setting = (*dev).settings.begin(); + + for (; setting != (*dev).settings.end(); ++setting) + ups_conf.setKey(id, setting->first, setting->second); + } + + // Store configuration + store(&ups_conf, ups_conf_file); +} + + +/** + * \brief Set notify flags in upsmon.conf + * + * \param flags Notify flags specifications + * \param etc Configuration directory + */ +static void setNotifyFlags( + const NutConfOptions::NotifyFlagsSpecs & flags, + const std::string & etc) +{ + std::string upsmon_conf_file(etc + "/upsmon.conf"); + + nut::UpsmonConfiguration upsmon_conf; + + // Source previous configuration (if any) + source(&upsmon_conf, upsmon_conf_file); + + NutConfOptions::NotifyFlagsSpecs::const_iterator specs = flags.begin(); + + for (; specs != flags.end(); ++specs) { + // Resolve notification type + nut::UpsmonConfiguration::NotifyType type = + nut::UpsmonConfiguration::NotifyTypeFromString(specs->first); + + if (nut::UpsmonConfiguration::NOTIFY_TYPE_MAX == type) { + std::cerr + << "Error: failed to parse notification type specification \"" + << specs->first << '"' << std::endl; + + ::exit(1); + } + + nut::Settable & sum = + upsmon_conf.notifyFlags[type]; + + // Clear current flags (unless we want to keep them) + if (specs->second.first || !sum.set()) + sum = nut::UpsmonConfiguration::NOTIFY_IGNORE; + + // Assemble flags + std::list::const_iterator spec = specs->second.second.begin(); + + for (; spec != specs->second.second.end(); ++spec) { + nut::UpsmonConfiguration::NotifyFlag flag = + nut::UpsmonConfiguration::NotifyFlagFromString(*spec); + + sum |= static_cast(flag); + } + } + + // Store configuration + store(&upsmon_conf, upsmon_conf_file); +} + + +/** + * \brief Set notify messages in upsmon.conf + * + * \param msgs Notify messages specifications + * \param etc Configuration directory + */ +static void setNotifyMsgs( + const NutConfOptions::NotifyMsgSpecs & msgs, + const std::string & etc) +{ + std::string upsmon_conf_file(etc + "/upsmon.conf"); + + nut::UpsmonConfiguration upsmon_conf; + + // Source previous configuration (if any) + source(&upsmon_conf, upsmon_conf_file); + + NutConfOptions::NotifyMsgSpecs::const_iterator spec = msgs.begin(); + + for (; spec != msgs.end(); ++spec) { + // Resolve notification type + nut::UpsmonConfiguration::NotifyType type = + nut::UpsmonConfiguration::NotifyTypeFromString(spec->first); + + if (nut::UpsmonConfiguration::NOTIFY_TYPE_MAX == type) { + std::cerr + << "Error: failed to parse notification type specification \"" + << spec->first << '"' << std::endl; + + ::exit(1); + } + + // Set message + upsmon_conf.notifyMessages[type] = spec->second; + } + + // Store configuration + store(&upsmon_conf, upsmon_conf_file); +} + + +/** + * \brief Set notify command in upsmon.conf + * + * \param cmd Notify command + * \param etc Configuration directory + */ +static void setNotifyCmd(const std::string & cmd, const std::string & etc) +{ + std::string upsmon_conf_file(etc + "/upsmon.conf"); + + nut::UpsmonConfiguration upsmon_conf; + + // Source previous configuration (if any) + source(&upsmon_conf, upsmon_conf_file); + + upsmon_conf.notifyCmd = cmd; + + // Store configuration + store(&upsmon_conf, upsmon_conf_file); +} + + +/** + * \brief Set shutdown command in upsmon.conf + * + * \param cmd Shutdown command + * \param etc Configuration directory + */ +static void setShutdownCmd(const std::string & cmd, const std::string & etc) +{ + std::string upsmon_conf_file(etc + "/upsmon.conf"); + + nut::UpsmonConfiguration upsmon_conf; + + // Source previous configuration (if any) + source(&upsmon_conf, upsmon_conf_file); + + upsmon_conf.shutdownCmd = cmd; + + // Store configuration + store(&upsmon_conf, upsmon_conf_file); +} + + +/** + * \brief Set minimum of power supplies in upsmon.conf + * + * \param min_supplies Minimum of power supplies + * \param etc Configuration directory + */ +static void setMinSupplies(const std::string & min_supplies, const std::string & etc) { + std::string upsmon_conf_file(etc + "/upsmon.conf"); + + nut::UpsmonConfiguration upsmon_conf; + + // Source previous configuration (if any) + source(&upsmon_conf, upsmon_conf_file); + + unsigned int min; + + std::stringstream ss(min_supplies); + + if ((ss >> min).fail()) { + std::cerr + << "Error: invalid min. power supplies specification: \"" + << min_supplies << '"' << std::endl; + + ::exit(1); + } + + upsmon_conf.minSupplies = min; + + // Store configuration + store(&upsmon_conf, upsmon_conf_file); +} + + +/** + * \brief Set powerdown flag file in upsmon.conf + * + * \param powerdown_flag Powerdown flag file + * \param etc Configuration directory + */ +static void setPowerdownFlag(const std::string & powerdown_flag, const std::string & etc) { + std::string upsmon_conf_file(etc + "/upsmon.conf"); + + nut::UpsmonConfiguration upsmon_conf; + + // Source previous configuration (if any) + source(&upsmon_conf, upsmon_conf_file); + + upsmon_conf.powerDownFlag = powerdown_flag; + + // Store configuration + store(&upsmon_conf, upsmon_conf_file); +} + + +/** + * \brief Set users in upsd.users + * + * \param users User list + * \param etc Configuration directory + * \param keep_ex Keep existing entries (discard by default) + */ +static void setUsers( + const NutConfOptions::UserSpecs & users, + const std::string & etc, bool keep_ex = false) +{ + std::string upsd_users_file(etc + "/upsd.users"); + + nut::UpsdUsersConfiguration upsd_users; + + // Source previous configuration (if any) + source(&upsd_users, upsd_users_file); + + // Remove existing users (unless we want to keep them) + if (!keep_ex) { + nut::UpsdUsersConfiguration::SectionMap::iterator + user = upsd_users.sections.begin(); + + for (; user != upsd_users.sections.end(); ++user) { + // Keep global section + if (user->first.empty()) + continue; + + upsd_users.sections.erase(user); + } + } + + // Set/add users and/or their attributes + NutConfOptions::UserSpecs::const_iterator + user_iter = users.begin(); + + for (; user_iter != users.end(); ++user_iter) { + const NutConfOptions::UserSpec * user = *user_iter; + + const std::string & username = user->name; + + // Set password + if (!user->passwd.empty()) + upsd_users.setPassword(username, user->passwd); + + // Set actions + std::list::const_iterator action = user->actions.begin(); + + for (; action != user->actions.end(); ++action) + upsd_users.addActions(username, nut::ConfigParamList(1, *action)); + + // Set instant commands + std::list::const_iterator cmd = user->instcmds.begin(); + + for (; cmd != user->instcmds.end(); ++cmd) + upsd_users.addInstantCommands(username, nut::ConfigParamList(1, *cmd)); + + // upsmon user-specific settings + if ("upsmon" == username) { + const NutConfOptions::UpsmonUserSpec * upsmon_user = + static_cast(user); + + // Set upsmon mode + nut::UpsdUsersConfiguration::upsmon_mode_t mode = + nut::UpsdUsersConfiguration::UPSMON_UNDEF; + + if ("master" == upsmon_user->mode) + mode = nut::UpsdUsersConfiguration::UPSMON_MASTER; + + else if ("slave" == upsmon_user->mode) + mode = nut::UpsdUsersConfiguration::UPSMON_SLAVE; + + else { + std::cerr + << "Error: Invalid upsmon mode specification: \"" + << upsmon_user->mode << '"' << std::endl; + + ::exit(1); + } + + upsd_users.setUpsmonMode(mode); + } + } + + // Store configuration + store(&upsd_users, upsd_users_file); +} + + +#if (defined WITH_NUTSCANNER) + +/** + * \brief Print devices info + * + * \param devices Device list + * \param verbose Verbosity level + */ +static void printDevicesInfo(const NutScanner::devices_t & devices, unsigned int verbose = 0) { + NutScanner::devices_t::const_iterator dev_iter = devices.begin(); + + nut::GenericConfiguration devices_conf; + + unsigned int dev_no = 1; + + for (; dev_iter != devices.end(); ++dev_iter, ++dev_no) { + const NutScanner::Device & dev = *dev_iter; + + // Print just plain list + if (verbose == 0) + std::cout + << dev.type << ' ' + << dev.driver << ' ' + << dev.port << std::endl; + + // Assemble full info + else { + std::stringstream name; + + name << "device_type_" << dev.type << "_no_"; + + name.width(3); + name.fill('0'); + + name << dev_no; + + nut::GenericConfigSection & device_conf = devices_conf[name.str()]; + + device_conf.name = name.str(); + + // Set driver + nut::GenericConfigSectionEntry & driver = device_conf["driver"]; + + driver.name = "driver"; + driver.values.push_back(dev.driver); + + // Set port + nut::GenericConfigSectionEntry & port = device_conf["port"]; + + port.name = "port"; + port.values.push_back(dev.port); + + // Set options + NutScanner::Device::options_t::const_iterator + opt = dev.options.begin(); + + for (; opt != dev.options.end(); ++opt) { + nut::GenericConfigSectionEntry & option = device_conf[opt->first]; + + option.name = opt->first; + option.values.push_back(opt->second); + } + } + } + + // Print full info + if (0 != verbose) { + nut::NutMemory info; + + devices_conf.writeTo(info); + + std::string info_str; + + assert(nut::NutStream::NUTS_OK == info.getString(info_str)); + + std::cout << info_str; + } +} + + +/** + * \brief Scan for SNMP devices + * + * \param options Options + */ +static void scanSNMPdevices(const NutConfOptions & options) { + for (size_t i = 0; ; ++i) { + NutConfOptions::Arguments args; + + bool ok = options.getDouble("scan-snmp", args, i); + + if (!ok) break; + + // Sanity checks + assert(args.size() >= 2); + + NutConfOptions::Arguments::const_iterator arg = args.begin(); + + const std::string & start_ip = *arg++; + const std::string & stop_ip = *arg++; + + // TBD: where should we get the default? + useconds_t us_timeout = 1000000; + + NutScanner::SNMPAttributes attrs; + + // Parse = pairs + bool errors = false; + + for (; arg != args.end(); ++arg) { + size_t eq_pos = (*arg).find('='); + + if (std::string::npos == eq_pos) { + std::cerr + << "Error: Invalid SNMP attribute specification: \"" + << *arg << '"' << std::endl; + + errors = true; + + continue; + } + + std::string attr = (*arg).substr(0, eq_pos); + std::string val = (*arg).substr(eq_pos + 1); + + if ("timeout" == attr) { + std::stringstream ss(val); + + if ((ss >> us_timeout).fail()) { + std::cerr + << "Error: Invalid SNMP timeout specification: \"" + << val << '"' << std::endl; + + errors = true; + + continue; + } + } + else if ("community" == attr) { + attrs.community = val; + } + else if ("sec-level" == attr) { + attrs.sec_level = val; + } + else if ("sec-name" == attr) { + attrs.sec_name = val; + } + else if ("auth-password" == attr) { + attrs.auth_passwd = val; + } + else if ("priv-password" == attr) { + attrs.priv_passwd = val; + } + else if ("auth-protocol" == attr) { + attrs.auth_proto = val; + } + else if ("priv-protocol" == attr) { + attrs.priv_proto = val; + } + else if ("peer-name" == attr) { + attrs.peer_name = val; + } + + else { + std::cerr + << "Error: Unknown SNMP attribute: \"" + << attr << '"' << std::endl; + + errors = true; + } + } + + if (errors) continue; + + NutScanner::devices_t devices = NutScanner::devicesSNMP( + start_ip, stop_ip, us_timeout, attrs); + + printDevicesInfo(devices, options.verbose); + } +} + + +/** + * \brief Scan for USB devices + * + * \param options Options + */ +static void scanUSBdevices(const NutConfOptions & options) { + NutScanner::devices_t devices = NutScanner::devicesUSB(); + + printDevicesInfo(devices, options.verbose); +} + + +/** + * \brief Scan for NUT devices + * + * \param options Options + */ +static void scanNUTdevices(const NutConfOptions & options) { + for (size_t i = 0; ; ++i) { + NutConfOptions::Arguments args; + + bool ok = options.getDouble("scan-nut", args, i); + + if (!ok) break; + + // Sanity checks + assert(args.size() >= 3); + + NutConfOptions::Arguments::const_iterator arg = args.begin(); + + const std::string & start_ip = *arg++; + const std::string & stop_ip = *arg++; + const std::string & port = *arg++; + + // TBD: where should we get the default? + useconds_t us_timeout = 1000000; + + if (arg != args.end()) { + std::stringstream ss(*arg); + + ss >> us_timeout; + } + + NutScanner::devices_t devices = NutScanner::devicesNUT( + start_ip, stop_ip, port, us_timeout); + + printDevicesInfo(devices, options.verbose); + } +} + + +/** + * \brief Scan for XML/HTTP devices + * + * \param options Options + */ +static void scanXMLHTTPdevices(const NutConfOptions & options) { + NutConfOptions::Arguments args; + + bool ok = options.getDouble("scan-xml-http", args); + + // Sanity checks + assert(ok); + + // TBD: where should we get the default? + useconds_t us_timeout = 1000000; + + if (!args.empty()) { + std::stringstream ss(args.front()); + + ss >> us_timeout; + } + + NutScanner::devices_t devices = NutScanner::devicesXMLHTTP(us_timeout); + + printDevicesInfo(devices, options.verbose); +} + + +/** + * \brief Scan for Avahi devices + * + * \param options Options + */ +static void scanAvahiDevices(const NutConfOptions & options) { + NutConfOptions::Arguments args; + + bool ok = options.getDouble("scan-avahi", args); + + // Sanity checks + assert(ok); + + // TBD: where should we get the default? + useconds_t us_timeout = 1000000; + + if (!args.empty()) { + std::stringstream ss(args.front()); + + ss >> us_timeout; + } + + NutScanner::devices_t devices = NutScanner::devicesAvahi(us_timeout); + + printDevicesInfo(devices, options.verbose); +} + + +/** + * \brief Scan for IPMI devices + * + * \param options Options + */ +static void scanIPMIdevices(const NutConfOptions & options) { + for (size_t i = 0; ; ++i) { + NutConfOptions::Arguments args; + + bool ok = options.getDouble("scan-ipmi", args, i); + + if (!ok) break; + + // Sanity checks + assert(args.size() >= 2); + + NutConfOptions::Arguments::const_iterator arg = args.begin(); + + const std::string & start_ip = *arg++; + const std::string & stop_ip = *arg++; + + NutScanner::IPMIAttributes attrs; + + // Parse = pairs + bool errors = false; + + for (; arg != args.end(); ++arg) { + size_t eq_pos = (*arg).find('='); + + if (std::string::npos == eq_pos) { + std::cerr + << "Error: Invalid IPMI attribute specification: \"" + << *arg << '"' << std::endl; + + errors = true; + + continue; + } + + std::string attr = (*arg).substr(0, eq_pos); + std::string val = (*arg).substr(eq_pos + 1); + + if ("username" == attr) { + attrs.username = val; + } + else if ("password" == attr) { + attrs.passwd = val; + } + else if ("auth-type" == attr) { + if ("none" == val) + attrs.auth_type = IPMI_AUTHENTICATION_TYPE_NONE; + else if ("MD2" == val) + attrs.auth_type = IPMI_AUTHENTICATION_TYPE_MD2; + else if ("MD5" == val) + attrs.auth_type = IPMI_AUTHENTICATION_TYPE_MD5; + else if ("plain-password" == val) + attrs.auth_type = IPMI_AUTHENTICATION_TYPE_STRAIGHT_PASSWORD_KEY; + else if ("OEM" == val) + attrs.auth_type = IPMI_AUTHENTICATION_TYPE_OEM_PROP; + else if ("RMCPplus" == val) + attrs.auth_type = IPMI_AUTHENTICATION_TYPE_RMCPPLUS; + else { + std::cerr + << "Error: Invalid IPMI auth. type: \"" + << val << '"' << std::endl; + + errors = true; + + continue; + } + } + else if ("cipher-suite-id" == attr) { + std::stringstream ss(val); + + if ((ss >> attrs.cipher_suite_id).fail()) { + std::cerr + << "Error: Invalid IPMI cipher suite ID: \"" + << val << '"' << std::endl; + + errors = true; + + continue; + } + } + else if ("K-g-BMC-key" == attr) { + attrs.K_g_BMC_key = val; + } + else if ("priv-level" == attr) { + std::stringstream ss(val); + + if ((ss >> attrs.priv_level).fail()) { + std::cerr + << "Error: Invalid IPMI priv. level: \"" + << val << '"' << std::endl; + + errors = true; + + continue; + } + } + else if ("workaround-flags" == attr) { + std::stringstream ss(val); + + if ((ss >> attrs.wa_flags).fail()) { + std::cerr + << "Error: Invalid IPMI workaround flags: \"" + << val << '"' << std::endl; + + errors = true; + + continue; + } + } + + else if ("version" == attr) { + if ("1.5" == val) + attrs.version = IPMI_1_5; + else if ("2.0" == val) + attrs.version = IPMI_2_0; + else { + std::cerr + << "Error: Unsupported IPMI version " + << val << std::endl; + + errors = true; + + continue; + } + } + + else { + std::cerr + << "Error: Unknown IPMI attribute: \"" + << attr << '"' << std::endl; + + errors = true; + } + } + + if (errors) continue; + + NutScanner::devices_t devices = NutScanner::devicesIPMI( + start_ip, stop_ip, attrs); + + printDevicesInfo(devices, options.verbose); + } +} + + +/** + * \brief Scan for serial devices devices + * + * \param options Options + */ +static void scanSerialDevices(const NutConfOptions & options) { + NutConfOptions::Arguments args; + + bool ok = options.getDouble("scan-serial", args); + + // Sanity checks + assert(ok); + + NutScanner::devices_t devices = NutScanner::devicesEatonSerial(args); + + printDevicesInfo(devices, options.verbose); +} + +#endif // defined WITH_NUTSCANNER + + +/** + * \brief Main routine (exceptions unsafe) + * + * \param argc Argument count + * \param argv Arguments + * + * \return 0 always (exits on error) + */ +static int mainx(int argc, char * const argv[]) { + // Get options + NutConfOptions options(argv, argc); + + // Usage + if (options.exists("help") || options.existsSingle("h")) { + Usage::print(argv[0]); + + ::exit(0); + } + + // Check that command-line options validity + if (!options.valid) { + options.reportInvalid(); + + Usage::print(argv[0]); + + ::exit(1); + } + + // Set configuration directory + std::string etc(CONFPATH); + + if (!options.local.empty()) { + etc = options.local; + } + + // Check configuration directory availability + nut::NutFile etc_dir(etc); + + if (!etc_dir.exists()) { + std::cerr << "Error: Configuration directory " << etc << " isn't available" << std::endl; + + ::exit(1); + } + + // --is-configured query + if (options.is_configured) { + bool is_configured = isConfigured(etc); + + std::cout << (is_configured ? "true" : "false") << std::endl; + + ::exit(is_configured ? 0 : 1); + } + + // --get-mode + if (options.get_mode) { + std::cout << getMode(etc) << std::endl; + } + + // --set-mode + if (!options.mode.empty()) { + setMode(options.mode, etc); + } + + // Monitors were set + if (!options.monitors.empty()) { + std::list monitors; + + for (size_t n = options.monitors.size() / 6, i = 0; i < n; ++i) { + monitors.push_back(monitor(i, options)); + } + + setMonitors(monitors, etc, options.add_monitor_cnt > 0); + } + + // Listen addresses were set + if (!options.listen_addrs.empty()) { + std::list listen_addrs; + + for (size_t i = 0; i < options.listen_addrs.size(); ++i) { + listen_addrs.push_back(listenAddr(i, options)); + } + + setListenAddrs(listen_addrs, etc, options.add_listen_cnt > 0); + } + + // Devices were set + if (!options.devices.empty()) { + setDevices(options.devices, etc, options.add_device_cnt > 0); + } + + // Notify flags were set + if (!options.notify_flags.empty()) { + setNotifyFlags(options.notify_flags, etc); + } + + // Notify messages were set + if (!options.notify_msgs.empty()) { + setNotifyMsgs(options.notify_msgs, etc); + } + + // Notify command was set + if (!options.notify_cmd.empty()) { + setNotifyCmd(options.notify_cmd, etc); + } + + // Shutdown command was set + if (!options.shutdown_cmd.empty()) { + setShutdownCmd(options.shutdown_cmd, etc); + } + + // Min. of power supplies was set + if (!options.min_supplies.empty()) { + setMinSupplies(options.min_supplies, etc); + } + + // Powerdown flag file was set + if (!options.powerdown_flag.empty()) { + setPowerdownFlag(options.powerdown_flag, etc); + } + + // Users were set + if (!options.users.empty()) { + setUsers(options.users, etc, options.add_user_cnt > 0); + } + +#if (defined WITH_NUTSCANNER) + + // SNMP devices scan + if (options.scan_snmp_cnt) { + scanSNMPdevices(options); + } + + // USB devices scan + if (options.scan_usb) { + scanUSBdevices(options); + } + + // NUT devices scan + if (options.scan_nut_cnt) { + scanNUTdevices(options); + } + + // XML/HTTP devices scan + if (options.scan_xml_http) { + scanXMLHTTPdevices(options); + } + + // Avahi devices scan + if (options.scan_avahi) { + scanAvahiDevices(options); + } + + // IPMI devices scan + if (options.scan_ipmi_cnt) { + scanIPMIdevices(options); + } + + // Serial devices scan + if (options.scan_serial) { + scanSerialDevices(options); + } + +#endif // defined WITH_NUTSCANNER + + return 0; +} + + +/** + * \brief Main routine exception-safe wrapper + * + * Exceptions should never leak... + * + * \param argc Argument count + * \param argv Arguments + */ +int main(int argc, char * const argv[]) { + try { + return mainx(argc, argv); + } + catch (const std::exception & e) { + std::cerr + << "Error: " << e.what() << std::endl; + } + catch (...) { + std::cerr + << "INTERNAL ERROR: exception of unknown origin caught" << std::endl + << "Please issue a bug report to nut-upsdev@lists.alioth.debian.org" + << std::endl; + } + + ::exit(128); +}