[solved] UPS Status Empty

Started by pilotboy72, May 07, 2019, 03:56:09 PM

Previous topic - Next topic
May 07, 2019, 03:56:09 PM Last Edit: May 08, 2019, 07:08:40 PM by pilotboy72
Hello,

I have a UPS attached to my OPNsense firewall and the NUT service seems to be working fine.  I have this networked to other devices as well and they are able to read the status of the UPS, time remaining, and the other metrics that NUT provides.  However, on the Diagnostics screen there is no information under UPS status.  Is this normal?

NOTE:  This is not unique to 19.1.7 -- have observed this behavior since installing OPNsense with version 19.1.1.

Brian

No, what do you get when starting debugging browser network via F12?

There are a lot of pending API calls to /api/nut/diagnostics/upsstatus.  Looks like these calls never return anything.  Also tried using cURL with the same result -- no response from the server after 30 seconds.

Then the UPS is not recognized by OPN.
Whats your setup?

TrippLite UPS connected via USB.

It has to be working somehow since other devices on the network can see the status of the UPS.

Ok, cracked the NUT (pun intended).

I looked at the listen configuration and saw that it was listening on my LAN address only.  I added 127.0.0.1 as a listen address and the diagnostics are showing up.


Hi, i'm reusing this thread as I have the very same problem, I hope it's ok...

The issue is the same, that the diagnostics page is empty. Nut itself works and if I run 'upsc ups@localhost' I get my UPS's info.

Turning on debugging in my browser I see several requests to upsstatus and the response is 200 with '{"response":null}' in the payload.

So the network works, the diagnostics page can access upsstatus, upsc works, but something between the api and upsc fails...

Any suggestions to where I should look?

Can you post the output vial console, system.log and configd.log?

Hi,

thanks for pointing me in the right direction  :) While gathering the files you asked for I noticed in configd.log the following error:

QuoteScript action failed with Command '/usr/local/bin/upsc 'ups@oldupsserver.domain.com''

The hostname is incorrect (oldupsserver.domain.com) and should be localhost. Looking at my config I noticed that oldupsserver.domain.com was still in my config for NUT netclient and that fooled the diagnostics page to query the remote NUT server instead of my usbhid UPS.

I did use netclient before but have now moved my UPS to the firewall instead. When doing so I disabled netclient, enabled usbhid and configured usbhid. Netclient is disabled but the config line för remote host was still left configured. Removing the FQDN from the netclients "ip adress" made everything work.