pfSense Support Subscription

Author Topic: NUT package  (Read 23640 times)

0 Members and 1 Guest are viewing this topic.

Offline AR15USR

  • Full Member
  • ***
  • Posts: 266
  • Karma: +10/-0
    • View Profile
Re: NUT package
« Reply #15 on: August 06, 2016, 07:46:18 pm »
Well got this result, but it has disappeared off the Installed Packages list. However my logs are still being flooded...

Code: [Select]
[2.3.2-RELEASE][xxxx@xxxxx.lan]/root: pkg delete pfSense-pkg-nut
Checking integrity... done (0 conflicting)
Deinstallation has been requested for the following 1 packages (of 0 packages in the universe):

Installed packages to be REMOVED:
pfSense-pkg-nut-2.7.4_1

Number of packages to be removed: 1

Proceed with deinstalling packages? [y/N]: y
[1/1] Deinstalling pfSense-pkg-nut-2.7.4_1...
The nut package is not installed.

[1/1] Deleting files for pfSense-pkg-nut-2.7.4_1: 100%nut-2.7.4_1:   0%
The nut package is not installed.

_________________________

Release: pfSense 2.3.4

Offline AR15USR

  • Full Member
  • ***
  • Posts: 266
  • Karma: +10/-0
    • View Profile
Re: NUT package
« Reply #16 on: August 06, 2016, 07:52:39 pm »
OK I did the install from the development branch and it still didn't show up afterwards. So I uninstalled and switched back to Stable.

I'll be waiting for the update/fix to show in the Stable...
_________________________

Release: pfSense 2.3.4

Offline w0w

  • Sr. Member
  • ****
  • Posts: 540
  • Karma: +31/-6
  • kernel panic attack
    • View Profile
Re: NUT package
« Reply #17 on: August 07, 2016, 12:26:25 am »
Are you sure that you are looked for "UPS" in Services menu instead of "NUT"?

Just because "development trick" still working for me on VM and production. 

Offline AR15USR

  • Full Member
  • ***
  • Posts: 266
  • Karma: +10/-0
    • View Profile
Re: NUT package
« Reply #18 on: August 07, 2016, 07:52:42 am »
Are you sure that you are looked for "UPS" in Services menu instead of "NUT"?

Just because "development trick" still working for me on VM and production.

Ah, there it is. See it now, thanks...
_________________________

Release: pfSense 2.3.4

Offline dennypage

  • Hero Member
  • *****
  • Posts: 697
  • Karma: +133/-0
    • View Profile
Re: NUT package
« Reply #19 on: August 08, 2016, 08:03:57 am »
The repo issue has been fixed. The package version has been updated to 2.7.4_2.

Offline justmie

  • Newbie
  • *
  • Posts: 3
  • Karma: +0/-0
    • View Profile
Re: NUT package
« Reply #20 on: August 08, 2016, 10:30:58 am »
I can confirm it's working with apcupsd as a remote host. Thanks Dennypage !

Offline AR15USR

  • Full Member
  • ***
  • Posts: 266
  • Karma: +10/-0
    • View Profile
Re: NUT package
« Reply #21 on: August 08, 2016, 11:43:39 am »
Confirmed here as well. Thanks!
_________________________

Release: pfSense 2.3.4

Offline lemonkey

  • Newbie
  • *
  • Posts: 11
  • Karma: +0/-0
    • View Profile
Re: NUT package
« Reply #22 on: August 08, 2016, 03:13:54 pm »
Confirmed working, thanks.

Offline th3r3isnospoon

  • Jr. Member
  • **
  • Posts: 46
  • Karma: +0/-0
    • View Profile
Re: NUT package
« Reply #23 on: August 08, 2016, 03:25:49 pm »
The repo issue has been fixed. The package version has been updated to 2.7.4_2.

Thank you for the fix!  Looks good!


-th3r3isnospoon

Offline lemonkey

  • Newbie
  • *
  • Posts: 11
  • Karma: +0/-0
    • View Profile
Re: NUT package
« Reply #24 on: August 08, 2016, 03:43:48 pm »
I have a new APC UPS (BN1080G) which only has a serial data port on the back but it came with a serial-to-USB cable. I already tried to use the default USB driver via the UPS service settings but it couldn't connect to the UPS. From what I read (http://www.freebsddiary.org/apcupsd.php) in order for the serial-to-USB connection to typically work you'll need to also be running the apcupsd daemon. "apcupsd" is listed as a remote connection option in the UPS services settings, but I would like to run it local to the firewall if possible.

There isn't a PFSense plugin for this yet but there is a BSD port for it (https://www.freshports.org/sysutils/apcupsd/).

Unfortunately it doesn't appear to be listed as an available package in the latest stable PFSense release's core package repository.

2.3.2-RELEASE (amd64)
built on Tue Jul 19 12:44:43 CDT 2016
FreeBSD 10.3-RELEASE-p5

I have another FreeBSD machine internally that I can probably run apcupsd on and then have its port available for PFSense to use in the meantime.

Any advice?

Thanks

Offline afa

  • Newbie
  • *
  • Posts: 0
  • Karma: +0/-0
    • View Profile
Re: NUT package
« Reply #25 on: August 08, 2016, 04:16:51 pm »
First, I want to thank the developers for their work in this open source project  :)
I can confirm that the new package works with EATON Protection Station 800.  But the E-mails notification option does not work, I have this error in the system log:

Code: [Select]
php-cgi: nut_email.php: Could not send the message to email@example.com -- Error: could not start TLS connection encryption protocol.
The E-mail notifications works well if I Test SMTP Settings under System -> Advanced -> Notifications.
Thanks (and sorry for my bad English).

Offline dennypage

  • Hero Member
  • *****
  • Posts: 697
  • Karma: +133/-0
    • View Profile
Re: NUT package
« Reply #26 on: August 08, 2016, 05:49:41 pm »
I have a new APC UPS (BN1080G) which only has a serial data port on the back but it came with a serial-to-USB cable.

According to APC documentation it's a USB port. A new model UPS with a real serial port is pretty rare these days.

According to the NUT HCL, the default values should support this UPS. Use "Local USB" for UPS Type and "usbhid" for the driver.

Offline dennypage

  • Hero Member
  • *****
  • Posts: 697
  • Karma: +133/-0
    • View Profile
Re: NUT package
« Reply #27 on: August 08, 2016, 05:56:16 pm »
But the E-mails notification option does not work, I have this error in the system log:

Code: [Select]
php-cgi: nut_email.php: Could not send the message to email@example.com -- Error: could not start TLS connection encryption protocol.
The E-mail notifications works well if I Test SMTP Settings under System -> Advanced -> Notifications.

NUT invokes a script to send the email. Unfortunately, SSL is not available when PHP is invoked from a script. This is a known issue with pfSense. It's considered a bug, but no one has tracked it down yet.

It's on my list when time permits.

Offline dennypage

  • Hero Member
  • *****
  • Posts: 697
  • Karma: +133/-0
    • View Profile
Re: NUT package
« Reply #28 on: August 08, 2016, 11:47:19 pm »
But the E-mails notification option does not work, I have this error in the system log:

Code: [Select]
php-cgi: nut_email.php: Could not send the message to email@example.com -- Error: could not start TLS connection encryption protocol.
The E-mail notifications works well if I Test SMTP Settings under System -> Advanced -> Notifications.

NUT invokes a script to send the email. Unfortunately, SSL is not available when PHP is invoked from a script. This is a known issue with pfSense. It's considered a bug, but no one has tracked it down yet.


I had a brief moment to take a look at this. I've narrowed it to an issue with PHP scripts invoked by users other than root. By default, upsmon runs as uucp, so it isn't able to initialize the secure connection. It's not clear what the long term solution will be, but you can work around the issue by adding the following line to upsmon.conf in the Advanced section:

  RUN_AS_USER root

This will keep upsmon as root and allow secure connections from PHP.

As a security best practice it is generally recommended to run upsmon as a user other than root. However, given the closed environment nature of the firewall, I don't see an obvious security issue running upsmon as root.


Offline afa

  • Newbie
  • *
  • Posts: 0
  • Karma: +0/-0
    • View Profile
Re: NUT package
« Reply #29 on: August 09, 2016, 02:29:43 am »
I had a brief moment to take a look at this. I've narrowed it to an issue with PHP scripts invoked by users other than root. By default, upsmon runs as uucp, so it isn't able to initialize the secure connection. It's not clear what the long term solution will be, but you can work around the issue by adding the following line to upsmon.conf in the Advanced section:

  RUN_AS_USER root

The solution works correctly, thanks dennypage!