Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can get ups runtime because "unsupported value type" #50

Open
zoic21 opened this issue Nov 1, 2024 · 2 comments
Open

Can get ups runtime because "unsupported value type" #50

zoic21 opened this issue Nov 1, 2024 · 2 comments

Comments

@zoic21
Copy link

zoic21 commented Nov 1, 2024

Hello,

I got an issue to get battery runtime, I have an error with "unsupported value type" :

ts=2024-11-01T14:05:46.715Z caller=nut_collector.go:176 level=debug variable_name=battery.runtime value=1952 type=INTEGER description="Battery runtime (seconds)" writeable=false maximum_length=0 original_type=NUMBER
ts=2024-11-01T14:05:46.715Z caller=nut_collector.go:269 level=debug msg="Export the variable? false" count=8 variables="unsupported value type"

Here my configuration :

services:
  nut-exporter:
    image: druggeri/nut_exporter
    container_name: nut-exporter
    restart: always
    ports:
      - 9199:9199
    command:
      - --nut.vars_enable="battery.runtime,battery.charge,battery.voltage,battery.voltage.nominal,input.voltage,input.voltage.nominal,ups.load,ups.status"
      - --nut.serverport=3493
      - --log.level=debug

I don't understand why it's did that, I think I misconfiguring something but I can't find what....

Thanks in advance

@DRuggeri
Copy link
Owner

DRuggeri commented Nov 7, 2024

This does seem strange. Can you share the full debug output (be sure to trim out any credentials). The NUT library used by this exporter should have support for the NUMBER type listed in the above output, so maybe seeing a bit more information leading up to this point would help

@mmeija
Copy link

mmeija commented Nov 17, 2024

I think i'm seeing the same behaviour
nut_exporter-v3.1.1-linux-amd64
I think it works as expected with native binary?
docker does strange things with the nut.vars_enable - I don't know
in either case without the nut.vars_enable I don't get battery.runtime - with the vars set in the docker i get battery.runtime but lose ups.status?

here's docker with no nut.vars_enable

docker compose:
services:
  nut-exporter:
    image: druggeri/nut_exporter
    container_name: nut-exporter
    restart: always
    ports:
      - 9199:9199
    command:
      - --log.level=debug
      - --nut.server=10.1.4.20

debug_no_vars.txt

and with:

services:
  nut-exporter:
    image: druggeri/nut_exporter
    container_name: nut-exporter
    restart: always
    ports:
      - 9199:9199
    command:
      - --nut.vars_enable="battery.runtime,battery.charge,battery.charge.low,battery.charge.warning,battery.runtime,battery.temperature,battery.voltage,battery.voltage.nominal,input.transfer.high,input.transfer.low,ups.beeper.status,input.voltage,input.voltage.nominal,ups.load,ups.status"
      - --log.level=debug
      - --nut.server=10.1.4.20

debug_vars.txt

./nut_exporter --nut.server="10.1.4.20" --log.level=debug
native_no_vars.txt

./nut_exporter --nut.server="10.1.4.20" --log.level=debug --nut.vars_enable="battery.runtime,battery.charge,battery.charge.low,battery.charge.warning,battery.runtime,battery.temperature,battery.voltage,battery.voltage.nominal,input.transfer.high,input.transfer.low,ups.beeper.status,input.voltage,input.voltage.nominal,ups.load,ups.status"
native_vars.txt

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants