OPNsense Forum

Archive => 19.1 Legacy Series => Topic started by: pilotboy72 on May 07, 2019, 03:56:09 pm

Title: [solved] UPS Status Empty
Post by: pilotboy72 on May 07, 2019, 03:56:09 pm
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
Title: Re: UPS Status Empty
Post by: mimugmail on May 07, 2019, 03:58:31 pm
No, what do you get when starting debugging browser network via F12?
Title: Re: UPS Status Empty
Post by: pilotboy72 on May 07, 2019, 04:43:17 pm
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.
Title: Re: UPS Status Empty
Post by: mimugmail on May 07, 2019, 04:54:33 pm
Then the UPS is not recognized by OPN.
Whats your setup?
Title: Re: UPS Status Empty
Post by: pilotboy72 on May 07, 2019, 04:59:00 pm
TrippLite UPS connected via USB.

It has to be working somehow since other devices on the network can see the status of the UPS.
Title: Re: UPS Status Empty
Post by: pilotboy72 on May 07, 2019, 05:01:16 pm
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.
Title: Re: UPS Status Empty
Post by: mimugmail on May 07, 2019, 08:22:39 pm
Wonderful :)
Title: Re: [solved] UPS Status Empty
Post by: sepahewe on May 15, 2019, 11:31:06 am
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?
Title: Re: [solved] UPS Status Empty
Post by: mimugmail on May 15, 2019, 07:02:26 pm
Can you post the output vial console, system.log and configd.log?
Title: Re: [solved] UPS Status Empty
Post by: sepahewe on May 15, 2019, 07:26:09 pm
Hi,

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

Quote
Script 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.
Title: Re: [solved] UPS Status Empty
Post by: mimugmail on May 15, 2019, 09:55:18 pm
Good news!