The pfSense Store

Author Topic: NUT package  (Read 23297 times)

0 Members and 1 Guest are viewing this topic.

Offline dennypage

  • Hero Member
  • *****
  • Posts: 697
  • Karma: +133/-0
    • View Profile
NUT package
« on: July 18, 2016, 04:21:10 pm »
This topic is for information on the new NUT package.

The new package, version 2.7.4, has been released. If you have the prior 2.3.X package installed, it is recommended, but not required, that you uninstall the old package before installing the new package. This will ensure that all files from the prior package are removed.

The new package brings an all new gui and alignment with current NUT architecture. It supports configuration for all UPS types that the FreeBSD NUT distribution supports, including local USB, local serial, remote SNMP, remote NUT and apcupsd servers.

After installing the new package, NUT status and settings can be accessed in Services / UPS. The new widget can be added to the dashboard by selecting UPS Status.

Background information can be found in the beta test topic here: https://forum.pfsense.org/index.php?topic=114871.0


Version history:
  • 2.7.4_1   Fix repo/build issues
  • 2.7.4_2   Fix repo/build issues
  • 2.7.4_3   Remove orphaned NUT menu entry on upgrade
  • 2.7.4_4   Allow mixed case for serial port (/dev/cua[uU]?)
  • 2.7.4_5   Add support for NUT's "dummy" driver
« Last Edit: August 24, 2017, 01:33:33 pm by dennypage »

Offline dennypage

  • Hero Member
  • *****
  • Posts: 697
  • Karma: +133/-0
    • View Profile
Re: NUT package
« Reply #1 on: July 25, 2016, 12:02:59 am »
If you want to allow access to the NUT daemon from other hosts, there are two options available. You can either use a port forward in the firewall rules, or you can add a listen directive to upsd.conf.

Option 1: To add a port forward, go to Firewall / NAT / Port Forward, and create a port forward with the following attributes:

 Interface: The interface you want to allow access from, usually LAN
 Protocol: TCP
 Destination: The firewall address matching the interface, usually LAN address.
 Destination port: The port you want to use for access, usually 3493
 Redirect target IP 127.0.0.1
 Redirect target port: 3493

In general, this option is simpler because you can easily restrict access by adding a Source Address to the NAT rule.

Option 2: To add a listen directive to NUT, go to Services / UPS / Settings. Use the Display Advanced button to show the Advanced settings section. In the section for upsd.conf, add a line like:

 LISTEN 192.168.1.1

where 192.168.1.1 is the address of the interface you want to allow access from. You can also specify IPv6 addresses with the listen directive. Note that if you use this option, you will need to use firewall rules to restrict access to specific source addresses.

It is important to choose one option or the other. DO NOT DO BOTH AT THE SAME TIME.

Regardless of which option above you choose, you will also need to add a user entry in upsd.users. To add the entry, go to Services / UPS / Settings. Use the Display Advanced button to show the Advanced settings section. In the section for upsd.users, add lines like:

 [remoteuser]
 password = mypassword
 upsmon slave

Allowing remote access to NUT on the firewall should not be done casually. If you do allow remote access, it is a good idea to restrict access to trusted source addresses only.

Offline th3r3isnospoon

  • Jr. Member
  • **
  • Posts: 46
  • Karma: +0/-0
    • View Profile
Re: NUT package
« Reply #2 on: August 05, 2016, 03:45:44 pm »
Cross post from the beta...

Hello All,

Thank you for the work on this.

After installing the new version, I no longer see it listed in the services menu (neither NUT nor UPS).  I tried the install on two different pfSense FW's running 2.3.2 (pfsense amd64 and nanobsd) and right now it doesn't work on either box.


When I do a full reinstall it says this:

>>> Upgrading pfSense-pkg-nut...
Updating pfSense-core repository catalogue...
pfSense-core repository is up-to-date.
Updating pfSense repository catalogue...
pfSense repository is up-to-date.
All repositories are up-to-date.
Checking integrity... done (0 conflicting)
The following 1 package(s) will be affected (of 0 checked):

Installed packages to be REINSTALLED:
   pfSense-pkg-nut-2.7.4_1 [pfSense]

Number of packages to be reinstalled: 1
[1/1] Reinstalling pfSense-pkg-nut-2.7.4_1...
[1/1] Extracting pfSense-pkg-nut-2.7.4_1: .......... done
The nut package is not installed.

Deletion aborted.XML error: PKGINFOLINK at line 8 cannot occur more than once
>>> Cleaning up cache... done.
Success



I tried a full uninstall and reinstall but the service is nowhere to be found.  It shows that the package is installed, I just can't do anything besides that.  Any ideas?



Thanks,

-th3r3isnospoon

Offline dennypage

  • Hero Member
  • *****
  • Posts: 697
  • Karma: +133/-0
    • View Profile
Re: NUT package
« Reply #3 on: August 05, 2016, 09:19:24 pm »
FYI, I pulled the package from the factory download apart, and there are indeed two pkginfo lines in the file usr/local/share/pfSense-pkg-nut/info.xml. The second occurrence of the pkginfo line is not present in github, but appears in the version downloaded by the package manager. I have an email in to ask if anyone knows how this got added.

Offline dennypage

  • Hero Member
  • *****
  • Posts: 697
  • Karma: +133/-0
    • View Profile
Re: NUT package
« Reply #4 on: August 05, 2016, 11:48:06 pm »
The issue has been tracked down to a specific problem with a branch of the repo. I'm sure it will be fixed soon.

Thank you for your patience.


Offline w0w

  • Sr. Member
  • ****
  • Posts: 536
  • Karma: +30/-6
  • kernel panic attack
    • View Profile
Re: NUT package
« Reply #5 on: August 06, 2016, 12:46:04 am »
The fun is that I have successfully reinstalled NUT in VM, and doing the same steps on production caused error posted above. Strange.
« Last Edit: August 06, 2016, 12:59:33 am by w0w »

Offline dennypage

  • Hero Member
  • *****
  • Posts: 697
  • Karma: +133/-0
    • View Profile
Re: NUT package
« Reply #6 on: August 06, 2016, 12:54:00 am »
Is the VM using beta.pfsense.org as its repo? You can check with "pkg -vv".

Offline w0w

  • Sr. Member
  • ****
  • Posts: 536
  • Karma: +30/-6
  • kernel panic attack
    • View Profile
Re: NUT package
« Reply #7 on: August 06, 2016, 01:04:07 am »
Yes, you are right. I just forgot that changed repository some time before. It's just beta.

Offline esquire1968

  • Full Member
  • ***
  • Posts: 148
  • Karma: +1/-1
    • View Profile
Re: NUT package
« Reply #8 on: August 06, 2016, 03:22:53 am »
After updating to 2.7.4_1 I can't find the Service! Where can I download the previous version or how can I repair this Version.

Thx!
Thomas

Offline w0w

  • Sr. Member
  • ****
  • Posts: 536
  • Karma: +30/-6
  • kernel panic attack
    • View Profile
Re: NUT package
« Reply #9 on: August 06, 2016, 04:25:53 am »
After updating to 2.7.4_1 I can't find the Service! Where can I download the previous version or how can I repair this Version.

Thx!
Thomas


https://forum.pfsense.org/index.php?topic=114871.msg645613#msg645613

Offline AR15USR

  • Full Member
  • ***
  • Posts: 266
  • Karma: +10/-0
    • View Profile
Re: NUT package
« Reply #10 on: August 06, 2016, 09:59:23 am »
Well me too. Installed the new package and its gone. Maybe you should pull this update till this problem is fixed...
_________________________

Release: pfSense 2.3.4

Offline dennypage

  • Hero Member
  • *****
  • Posts: 697
  • Karma: +133/-0
    • View Profile
Re: NUT package
« Reply #11 on: August 06, 2016, 01:09:56 pm »
Maybe you should pull this update till this problem is fixed...

I don't have access to pull the package from the servers.

It's correct in the development branch of the repo, which is why beta works. There appears to have been a merge problem in moving between the development branch and the 2_3_2 branch which resulted in a duplicate line in the xml file. I don't have access to modify the 2_3_2 branch, or update the package servers. If I did, I would fix the issue.

I have an email in, but don't know if anyone will be available over the weekend to update the package servers.

Offline AR15USR

  • Full Member
  • ***
  • Posts: 266
  • Karma: +10/-0
    • View Profile
Re: NUT package
« Reply #12 on: August 06, 2016, 04:35:30 pm »
Maybe you should pull this update till this problem is fixed...

I don't have access to pull the package from the servers.

It's correct in the development branch of the repo, which is why beta works. There appears to have been a merge problem in moving between the development branch and the 2_3_2 branch which resulted in a duplicate line in the xml file. I don't have access to modify the 2_3_2 branch, or update the package servers. If I did, I would fix the issue.

I have an email in, but don't know if anyone will be available over the weekend to update the package servers.

Gotcha, hopefully it will get fixed shortly..
_________________________

Release: pfSense 2.3.4

Offline AR15USR

  • Full Member
  • ***
  • Posts: 266
  • Karma: +10/-0
    • View Profile
Re: NUT package
« Reply #13 on: August 06, 2016, 04:41:17 pm »
It sure is flooding my logs now though:

Code: [Select]
Aug 6 14:39:40 kernel uhid0: <CPS OR1500LCDRM1U, class 0/0, rev 1.10/2.00, addr 1> on usbus0
Aug 6 14:39:39 kernel ugen0.2: <CPS> at usbus0
Aug 6 14:39:37 kernel uhid0: at uhub1, port 5, addr 1 (disconnected)
Aug 6 14:39:37 kernel ugen0.2: <CPS> at usbus0 (disconnected)
Aug 6 14:39:31 kernel uhid0: <CPS OR1500LCDRM1U, class 0/0, rev 1.10/2.00, addr 1> on usbus0
Aug 6 14:39:30 kernel ugen0.2: <CPS> at usbus0
Aug 6 14:39:28 kernel uhid0: at uhub1, port 5, addr 1 (disconnected)
Aug 6 14:39:28 kernel ugen0.2: <CPS> at usbus0 (disconnected)
Aug 6 14:39:21 kernel uhid0: <CPS OR1500LCDRM1U, class 0/0, rev 1.10/2.00, addr 1> on usbus0
Aug 6 14:39:21 kernel ugen0.2: <CPS> at usbus0
Aug 6 14:39:18 kernel uhid0: at uhub1, port 5, addr 1 (disconnected)
Aug 6 14:39:18 kernel ugen0.2: <CPS> at usbus0 (disconnected)
Aug 6 14:39:12 kernel uhid0: <CPS OR1500LCDRM1U, class 0/0, rev 1.10/2.00, addr 1> on usbus0

on and on...
_________________________

Release: pfSense 2.3.4

Offline dennypage

  • Hero Member
  • *****
  • Posts: 697
  • Karma: +133/-0
    • View Profile
Re: NUT package
« Reply #14 on: August 06, 2016, 04:51:57 pm »
If you are comfortable with the command line, you can fully delete the package with the following command:

  pkg delete pfSense-pkg-nut

If you need a functioning package right away, you can update the package using the beta switch switch as w0w describes in the beta thread, or you can PM me with an email address and I will send you a package which is functionally the same as the release version.