Giter VIP home page Giter VIP logo

Comments (15)

addons-assistant avatar addons-assistant commented on June 19, 2024

👋 Thanks for opening your first issue here! If you're reporting a 🐛 bug, please make sure you include steps to reproduce it. Also, logs, error messages and information about your hardware might be useful.

from addon-nut.

sinclairpaul avatar sinclairpaul commented on June 19, 2024

As I'm sure you can appreciate, we can't test and validate every UPS config out there. Although in theory it should work from what I can see, is there a chance you could validate using SNMP v1/2 rather than V3?

from addon-nut.

kkellner avatar kkellner commented on June 19, 2024

Yep, I and understand not having the ability to test all configurations. I just wanted to check if you might know how SNMP can be configured. I also tried v1 with the same result. I also set logging to debug level and other then giving me some debug statements on Pwned database calls, it did not provide any additional information as to why snmp-ups is failing.

Is there any way to send/add "-DD" argument to snmp-ups executable to show detailed debug info? E.g., snmp-ups -DD

SNMP v1 config:

devices:
  - name: apcups
    driver: snmp-ups
    port: 172.20.0.55
    config:
      community: public
      snmp_version: v1
      mibs: apcc
      pollfreq: 15

from addon-nut.

sinclairpaul avatar sinclairpaul commented on June 19, 2024

To get the addon to start, you can set the config to be something like:

devices:
  - name: myups
    driver: dummy-ups
    port: dummy.dev
    config: []

This would start using the dummy driver, you could then possibly exec into the container and run the nut executables from there.

from addon-nut.

kkellner avatar kkellner commented on June 19, 2024

Does the plugin create the ups.conf file similar to below and run the below command? I'll give the dummy command a shot.

The contents of the ups.conf file

[APC_UPS]
                   driver = snmp-ups
                   port = 172.20.0.55
                   snmp_version = v3
                   secLevel = authPriv
                   secName = snmpprofile1
                   authPassword = *********
                   authProtocol = MD5
                   privPassword = *********
                   privProtocol = DES
                   desc = "APC UPS"

Command:
$ sudo /lib/nut/snmp-ups -DD -a APC_UPS

from addon-nut.

sinclairpaul avatar sinclairpaul commented on June 19, 2024

We generate the ups.conf

for device in $(bashio::config "devices|keys"); do

Only run the -D on debug being set today, we could change this if needed:

if bashio::debug; then

from addon-nut.

kkellner avatar kkellner commented on June 19, 2024

I was able to exec into the container.... Editing the /etc/nut/ups.conf and running /usr/lib/nut/snmp-ups -DD -a myups worked fine.

Looks like the config param values are not getting set.

This is what I have in the config (for devices):

devices:
  - name: myups
    driver: dummy-ups
    port: dummy.dev
    config: []
  - name: apcups
    driver: snmp-ups
    port: 172.20.0.55
    config:
      snmp_version: v3
      secLevel: authPriv
      secName: snmpprofile1
      authPassword: myauthenticationpassphrase
      authProtocol: MD5
      privPassword: myprivatepassphrase
      privProtocol: DES
      desc: APC UPS

And here is what is in the /etc/nut/ups.conf file:

image

from addon-nut.

dale3h avatar dale3h commented on June 19, 2024

@kkellner Try an array of strings for the config option, like so:

Documentation for config option: https://github.com/hassio-addons/addon-nut/blob/master/README.md#sub-option-config

devices:
  - name: myups
    driver: dummy-ups
    port: dummy.dev
    config: []
  - name: apcups
    driver: snmp-ups
    port: 172.20.0.55
    config:
      - snmp_version = v3
      - secLevel = authPriv
      - secName = snmpprofile1
      - authPassword = myauthenticationpassphrase
      - authProtocol = MD5
      - privPassword = myprivatepassphrase
      - privProtocol = DES
      - desc = APC UPS

I believe I originally set it up this way due to validation restraints when using nested arrays in add-on config files.

from addon-nut.

kkellner avatar kkellner commented on June 19, 2024

So when I type this config section in the plugin config text box:

    config:
      snmp_version = v3
      secLevel = authPriv
      secName = snmpprofile1
      authPassword = myauthenticationpassphrase
      authProtocol = MD5
      privPassword = myprivatepassphrase
      privProtocol = DES
      desc = APC UPS

then click save, it turns to this in the config text box:

    config: >-
      snmp_version = v3 secLevel = authPriv secName = snmpprofile1 authPassword
      = myauthenticationpassphrase authProtocol = MD5 privPassword =
      myprivatepassphrase privProtocol = DES desc = APC UPS

The ups.conf ends up looking like this:
image

from addon-nut.

dale3h avatar dale3h commented on June 19, 2024

Please review my sample config again carefully. The hyphens at the beginning of each line are required.

from addon-nut.

kkellner avatar kkellner commented on June 19, 2024

Sorry, too many cut/paste/edits. Your version with hyphens worked. I'm going to add the sensor next to see if I have real data.

from addon-nut.

dale3h avatar dale3h commented on June 19, 2024

That is great news! Please report back your findings so that we can close this issue if nothing further needs to be implemented to get this to work without in-container modifications.

from addon-nut.

kkellner avatar kkellner commented on June 19, 2024

Looks like I've getting real data! Two questions:

  1. Where does host a0d7b954-nut come from and when might it change? I saw in another issue the statement this will change if the addon moves from the edge repo. but I don't know what that means.

  2. Is there a way to get additional attributes? E.g., current in voltage and out voltage, ups temperature?

image

from addon-nut.

dale3h avatar dale3h commented on June 19, 2024

Awesome, even more great news!

  1. The host is derived from the name of the container, which I believe is generated based on the hash of the add-on repo and the name of the add-on. In this case a0d7b954 is the repo hash (Community Edge repo) and nut is the add-on slug.

  2. In a normal install, the available sensors are specific to each model of UPS device and what it exposes. I am not 100% sure on how to expose that same data via SNMP, as I have never before used SNMP.

from addon-nut.

addons-assistant avatar addons-assistant commented on June 19, 2024

This thread has been automatically locked because it has not had recent activity. Please open a new issue for related bugs and link to relevant comments in this thread.

from addon-nut.

Related Issues (20)

Recommend Projects

  • React photo React

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

  • Vue.js photo Vue.js

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

  • Typescript photo Typescript

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

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

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

Recommend Topics

  • javascript

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

  • web

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

  • server

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

  • Machine learning

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

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

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

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.