Netgate SG-1000 microFirewall

Author Topic: NUT package  (Read 23505 times)

0 Members and 1 Guest are viewing this topic.

Offline dennypage

  • Hero Member
  • *****
  • Posts: 697
  • Karma: +133/-0
    • View Profile
Re: NUT package
« Reply #45 on: August 28, 2016, 05:16:50 pm »
mattlach, did you get your issue resolved?

Offline LinuxTracker

  • Full Member
  • ***
  • Posts: 175
  • Karma: +5/-0
    • View Profile
Re: NUT package
« Reply #46 on: August 30, 2016, 11:18:47 pm »
Just a note I was getting "Driver not connected" errors that wouldn't go away until I rebooted.
Works fine now.

Backstory:
After install, Nut picked up an old (and correct) config - Local USB & usbhid.

It kept failing w/ the following errors:
Poll UPS [APC] failed - Driver not connected
Can't connect to UPS [APC] (usbhid-ups-APC): No such file or directory.

I followed every suggestion here and other BSD (ie: NAS) threads.

None of that helped but a reboot put everything right.
I still appreciate everyone's input though.



Below is just for ref:

Original config:
Code: [Select]
                <nut>
                        <config>
                                <type>local_usb</type>
                                <name>APC</name>
                                <email></email>
                                <usb_driver>usbhid-ups</usb_driver>
                                <upsmon_conf/>
                                <extra_args/>
                                <ups_conf/>
                                <upsd_conf/>
                                <upsd_users/>
                        </config>
                </nut>


Current (working) config:
Code: [Select]
<nut>
<config>
<type>local_usb</type>
<name>APC</name>
<email></email>
<usb_driver>usbhid-ups</usb_driver>
<upsmon_conf>UlVOX0FTX1VTRVIgcm9vdA==</upsmon_conf>
<extra_args/>
<ups_conf/>
<upsd_conf/>
<upsd_users/>
</config>
</nut>

2.3.2-RELEASE (amd64)
Intel Xeon CPU X3430 @ 2.40GHz
4GB RAM
APC Back-UPS NS1250 (BN1250G)

Output of usbconfig dump_device_desc
Code: [Select]
ugen1.4: <Back-UPS BN1250G FW867.L5 .D USB FWL5 American Power Conversion> at usbus1, cfg=0 md=HOST spd=FULL (12Mbps) pwr=ON (2mA)

  bLength = 0x0012
  bDescriptorType = 0x0001
  bcdUSB = 0x0200
  bDeviceClass = 0x0000  <Probed by interface class>
  bDeviceSubClass = 0x0000
  bDeviceProtocol = 0x0000
  bMaxPacketSize0 = 0x0040
  idVendor = 0x051d
  idProduct = 0x0002
  bcdDevice = 0x0090
  iManufacturer = 0x0001  <American Power Conversion>
  iProduct = 0x0002  <Back-UPS BN1250G FW:867.L5 .D USB FW:L5 >
  iSerialNumber = 0x0003  <xxxxxxxxxxx  >
  bNumConfigurations = 0x0001
« Last Edit: August 30, 2016, 11:23:59 pm by LinuxTracker »

Offline dennypage

  • Hero Member
  • *****
  • Posts: 697
  • Karma: +133/-0
    • View Profile
Re: NUT package
« Reply #47 on: August 31, 2016, 10:30:58 am »
After install, Nut picked up an old (and correct) config - Local USB & usbhid.

It kept failing w/ the following errors:
Poll UPS [APC] failed - Driver not connected
Can't connect to UPS [APC] (usbhid-ups-APC): No such file or directory.

Original config:
Code: [Select]
                <nut>
                        <config>
                                <type>local_usb</type>
                                <name>APC</name>
                                <email></email>
                                <usb_driver>usbhid-ups</usb_driver>
                                <upsmon_conf/>
                                <extra_args/>
                                <ups_conf/>
                                <upsd_conf/>
                                <upsd_users/>
                        </config>
                </nut>


Current (working) config:
Code: [Select]
<nut>
<config>
<type>local_usb</type>
<name>APC</name>
<email></email>
<usb_driver>usbhid-ups</usb_driver>
<upsmon_conf>UlVOX0FTX1VTRVIgcm9vdA==</upsmon_conf>
<extra_args/>
<ups_conf/>
<upsd_conf/>
<upsd_users/>
</config>
</nut>

Do you mean to say that you install a new version of the NUT package? Both configs you posted are are from the new version of the package. Neither is from the old package.

From a UPS driver point of view, the two configs are identical. The addition of RUN_AS_USER in upsmon_conf has no effect on the driver (usbhid-ups). It's only use is have the monitor (upsmon) run as root in order to work around an issue sending email with a TLS connection, which you are not using. Unless you are planning to use email with a TLS connection, you should remove this directive.

Offline LinuxTracker

  • Full Member
  • ***
  • Posts: 175
  • Karma: +5/-0
    • View Profile
Re: NUT package
« Reply #48 on: August 31, 2016, 06:43:11 pm »
Do you mean to say that you install a new version of the NUT package? Both configs you posted are are from the new version of the package. Neither is from the old package.
It went like this.
I installed Nut from the package manager. After install, Nut said it found an old config and would use that.
That's when I started getting the driver errors.  I did some poking around, checked out the Nut section of config.xml.  That's what I posted as my original config.

Today, I went into a config.xml backup from June and the Nut config section there is in the older format.
Code: [Select]
<nut>
<config>
<monitor/>
<powerdown/>
<allowaddr/>
<allowuser>fakeuser</allowuser>
<allowpass>fakepass</allowpass>
<name>APC</name>
<driver>usbhid-ups00</driver>
<port>auto</port>
<upstype/>
<cable/>
<snmpname/>
<snmpaddr/>
<snmpcommunity/>
<snmpversion>v2c</snmpversion>
<snmpmib>ietf</snmpmib>
<snmpfreq/>
<snmpdisabletransfer/>
<remotename/>
<remoteaddr/>
<remoteuser>fakeuser</remoteuser>
<remotepass>fakepass</remotepass>
</config>
</nut>

I'm assuming the new ver of Nut rewrote my config, sometime after install.

From a UPS driver point of view, the two configs are identical. The addition of RUN_AS_USER in upsmon_conf has no effect on the driver (usbhid-ups). It's only use is have the monitor (upsmon) run as root in order to work around an issue sending email with a TLS connection, which you are not using. Unless you are planning to use email with a TLS connection, you should remove this directive.
Okay. I tried that after reading a github post about perm issues w/ Nut & was ready to throw spaghetti at the wall.
(ref: https://github.com/rockstor/rockstor-core/issues/1073)

I'll get rid of RUN_AS_USER.
Thanks for the input.

Offline dennypage

  • Hero Member
  • *****
  • Posts: 697
  • Karma: +133/-0
    • View Profile
Re: NUT package
« Reply #49 on: August 31, 2016, 09:12:32 pm »
After install, Nut said it found an old config and would use that.
...
I'm assuming the new ver of Nut rewrote my config, sometime after install.

It wrote the new config when you pressed the save button on the Settings page. This is also when the service starts.

Offline runjmc

  • Newbie
  • *
  • Posts: 2
  • Karma: +0/-0
    • View Profile
Re: NUT package
« Reply #50 on: September 02, 2016, 07:54:38 pm »
I noticed the APC UPS plugged in via USB seems to stay connected for a few days then shows up as offline. I can reload the service and still doesn't work but if I physically unplug it and plug it back it works again.

usbconfig dump_device_desc

Online

ugen0.4: <Back-UPS NS 1250 LCD FW846.H2 .D USB FWH2 American Power Conversion> at usbus0, cfg=0 md=HOST spd=LOW (1.5Mbps) pwr=ON (2mA)

  bLength = 0x0012
  bDescriptorType = 0x0001
  bcdUSB = 0x0110
  bDeviceClass = 0x0000  <Probed by interface class>
  bDeviceSubClass = 0x0000
  bDeviceProtocol = 0x0000
  bMaxPacketSize0 = 0x0008
  idVendor = 0x051d
  idProduct = 0x0002
  bcdDevice = 0x0101
  iManufacturer = 0x0003  <American Power Conversion>
  iProduct = 0x0001  <Back-UPS NS 1250 LCD FW:846.H2 .D USB FW:H2 >
  iSerialNumber = 0x0002  <3B0902X11627  >
  bNumConfigurations = 0x0001


Offline

ugen0.4: <Back-UPS NS 1250 LCD FW846.H2 .D USB FWH2 American Power Conversion> at usbus0, cfg=0 md=HOST spd=LOW (1.5Mbps) pwr=ON (2mA)

  bLength = 0x0012
  bDescriptorType = 0x0001
  bcdUSB = 0x0110
  bDeviceClass = 0x0000  <Probed by interface class>
  bDeviceSubClass = 0x0000
  bDeviceProtocol = 0x0000
  bMaxPacketSize0 = 0x0008
  idVendor = 0x051d
  idProduct = 0x0002
  bcdDevice = 0x0101
  iManufacturer = 0x0003  <retrieving string failed>
  iProduct = 0x0001  <retrieving string failed>
  iSerialNumber = 0x0002  <retrieving string failed>
  bNumConfigurations = 0x0001


Offline dennypage

  • Hero Member
  • *****
  • Posts: 697
  • Karma: +133/-0
    • View Profile
Re: NUT package
« Reply #51 on: September 02, 2016, 08:38:20 pm »
Not sure what to tell you about this one. It sure looks like a USB connectivity issue. Is there a USB hub or anything you can remove? Another USB connector on the MB you can try? Another cable perhaps?

Yes, I'm shooting in the dark here. :)

Offline runjmc

  • Newbie
  • *
  • Posts: 2
  • Karma: +0/-0
    • View Profile
Re: NUT package
« Reply #52 on: September 03, 2016, 01:17:01 am »
It could be a issue with vmware passthrough.. Ill try another port and see if I have the same issues with a windows vm.

Thanks

Offline frozensteel

  • Newbie
  • *
  • Posts: 0
  • Karma: +0/-0
    • View Profile
Re: NUT package
« Reply #53 on: September 09, 2016, 12:13:55 am »
Hey Dennypage,

I just switched from an older server to a newer server.  Older server was running Pfsense 2.3.1 running a much older version of NUT.  Backed up the configuration file, installed Pfsense 2.3.2 and restored the configuration file.  I then installed the NUT package (Which is now 2.7.4_2) and now the service runs, and the UPS option is under the services menu, but the NUT option is still under the services menu.  Is this option supposed to work?  All it gives me is "404 Not Found nginx".  The UPS tab also doesn't have the fancy bar graphics the older NUT package has.  Is this supposed to be under the NUT tab?  How do I fix it?

Offline dennypage

  • Hero Member
  • *****
  • Posts: 697
  • Karma: +133/-0
    • View Profile
Re: NUT package
« Reply #54 on: September 09, 2016, 03:36:24 am »
I'm looking at how to automatically remove the old Services / NUT menu item. In the interim, this tells you how to do it manually:

https://forum.pfsense.org/index.php?topic=115349.msg650408#msg650408

Offline dennypage

  • Hero Member
  • *****
  • Posts: 697
  • Karma: +133/-0
    • View Profile
Re: NUT package
« Reply #55 on: September 09, 2016, 03:45:10 am »
The UPS tab also doesn't have the fancy bar graphics the older NUT package has.

Both the old and the new NUT package have the same two bar graphs, UPS Load and Battery charge.

In the new package, you will find them on the status page (Services / UPS / Status). This page also shows full detail of what is reported by the NUT driver for the UPS. There is also a UPS Status widget for the dashboard which provides a abbreviated status listing including the two bar graphs.

Offline frozensteel

  • Newbie
  • *
  • Posts: 0
  • Karma: +0/-0
    • View Profile
Re: NUT package
« Reply #56 on: September 09, 2016, 09:27:47 am »
So I did what you said and removed the following:

Code: [Select]

<menu/>
<menu>
<name>NUT</name>
<tooltiptext>Set Network UPS Tools settings.</tooltiptext>
<section>Services</section>
<url>/ups_status.php</url>
</menu>


Restored only the package information (since my configuration has changed since this configuration file was used) and it worked like a charm.

However, this is the output I get from UPS Status:



I wish it looked like the older version which was like this:


Offline dennypage

  • Hero Member
  • *****
  • Posts: 697
  • Karma: +133/-0
    • View Profile
Re: NUT package
« Reply #57 on: September 09, 2016, 12:08:26 pm »
The reason that you are not seeing bar graphs for load and charge is because they are not being reported for your UPS. The fields battery.charge and ups.load are missing from the UPS Detail section.

Best guess is that you want a different mib. I would try explicitly setting the ietf mib and see what it shows.

https://forum.pfsense.org/index.php?topic=115349.msg649477#msg649477
« Last Edit: September 09, 2016, 03:26:49 pm by dennypage »

Offline dennypage

  • Hero Member
  • *****
  • Posts: 697
  • Karma: +133/-0
    • View Profile
Re: NUT package
« Reply #58 on: September 09, 2016, 04:03:44 pm »
Another indication that something may be wrong with the mib is that your UPS has a runtime of 136 hours. :)

Offline frozensteel

  • Newbie
  • *
  • Posts: 0
  • Karma: +0/-0
    • View Profile
Re: NUT package
« Reply #59 on: September 09, 2016, 08:26:38 pm »
Man do I want to buy you a beer!  Added mibs=ietf to the "Extra Arguments to driver" field, saved it and BOOM!



That about wraps up all the issues!

Thanks :D