pfSense Support Subscription

Author Topic: NUT package  (Read 23573 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 #60 on: September 09, 2016, 09:20:37 pm »
Man do I want to buy you a beer!  Added mibs=ietf to the "Extra Arguments to driver" field, saved it and BOOM!

Thanks :D

You are quite welcome. Glad it's working for you. While disappointing, 136 minutes of runtime is much more realistic than 136 hours.

How about a whiskey instead?

:)

Offline bulldog5

  • Newbie
  • *
  • Posts: 12
  • Karma: +0/-0
    • View Profile
Re: NUT package
« Reply #61 on: September 21, 2016, 12:08:04 am »
Hi dennypage,

I'm having an issue with  NUT on pfSense 2.3.2 and newest NUT pkg 2.7.4_2.  My UPS is detected and displays the graphs just fine using the usbhid driver.  I have my pfSense box set as Local USB master.  My other freeNas server will connect to it just fine as a Slave.  When I pull the wall plug.  I see the WALL message "ups on bat" but it never initiates the shutdown command on the pfSense box itself, the remote NUT slave will get the shutdown command.  If i plug the UPS into my Freenas box and set that as a master, and pfsense as a slave it works as expected.  However I'd prefer pfsense being my Master control.

Any ideas are appreciated, I've spent a couple hours pulling my hair out thinking it was something with upssched.conf or NOTIFYCMD. 

Thanks,

Offline dennypage

  • Hero Member
  • *****
  • Posts: 697
  • Karma: +133/-0
    • View Profile
Re: NUT package
« Reply #62 on: September 21, 2016, 12:05:25 pm »
When you say you pull the plug, are you leaving it pulled until the battery runs down?

By default, NUT will not initiate a shutdown until the UPS unit reports that the battery is low. Most UPS will not report a low battery until 10% or so. Depending upon your battery runtime, this can be a while.

I don't use FreeNAS, but I did take a quick look at their configuration. There is a configuration parameter titled "Shutdown mode" which if set to "UPS goes on battery" which will cause NUT to initiate a shutdown immediately when mains are lost. The other mode is "UPS reaches low battery" which is the default behavior of NUT and what the pfSense package uses. Given that most power disruptions are short term, this is generally desirable.

You can of course change this configuration with the pfSense package by placing directives in the advanced section for ups.conf. Here is an example of something you might want to do:

Code: [Select]
ignorelb
override.battery.charge.low = 50
override.battery.runtime.low = 600

This would tell NUT to initiate a shutdown if the battery level falls below 50% or the runtime falls below 10 minutes.

See the 'ignorelb' section in the ups.conf manual for details on this.

With some UPS you can also change the low battery condition settings in the UPS itself. You can determine this by running

Code: [Select]
  upsrw <upsname>

If the UPS supports configuring these variables, you will see values for battery.charge.low and battery.runtime.low.

See upsrw upsrw manual for details on using the upsrw command. Also see the forum post on running commands.
« Last Edit: September 21, 2016, 01:10:13 pm by dennypage »

Offline bulldog5

  • Newbie
  • *
  • Posts: 12
  • Karma: +0/-0
    • View Profile
Re: NUT package
« Reply #63 on: September 21, 2016, 01:32:23 pm »
dennypage,

You're exactly right, I was pulling the main and tapping my fingers expecting the same would happen in 30seconds or so with no result.  Its a CyberPower OR1500PFCRT2U, so at half load I've got about 17-18mins runtime.

Its a tough design decision to make.  I'm at about 50% load with my pfsense, HP G6 VM box and FreeNAS server, and HP procurve switch.  My original idea was to shutdown the two big boys, freenas and HP G6 pretty quickly, then keep the internet up requiring pfsense and the HP switch.



One other question I had, I've been seeing every 2hours or so COMMBAD  COMMOK within 5second polls.  I'm using the default usbhid driver.  Have you seen this happen before? Is the UPS actually dropping out and establishing within the 5seconds? 

Offline dennypage

  • Hero Member
  • *****
  • Posts: 697
  • Karma: +133/-0
    • View Profile
Re: NUT package
« Reply #64 on: September 21, 2016, 04:36:24 pm »
One other question I had, I've been seeing every 2hours or so COMMBAD  COMMOK within 5second polls.  I'm using the default usbhid driver.  Have you seen this happen before?

I've not experienced this specific issue personally, but I have had some strange issues with CyberPower units. It could be the result of either a UPS issue or a USB issue. First thing I would check would be the physicals: good USB cable, direct connection with no hub, etc. Assuming that you are satisfied with the hardware connection, my only other suggestion would be to try increasing the pollinterval (ups.conf) to 5 or 10 seconds to see if that helps.

Offline bulldog5

  • Newbie
  • *
  • Posts: 12
  • Karma: +0/-0
    • View Profile
Re: NUT package
« Reply #65 on: September 21, 2016, 05:38:33 pm »
Its a brand new unit, literally just hooked it up yesterday. USB cable everything is good. It will be fine for hours. then it does a single UPS lost, UPS established.


        (no tty) at 16:36 CDT...

Communications with UPS ups lost

        (no tty) at 16:36 CDT...

Communications with UPS ups established

Offline AR15USR

  • Full Member
  • ***
  • Posts: 266
  • Karma: +10/-0
    • View Profile
Re: NUT package
« Reply #66 on: September 25, 2016, 03:18:11 pm »
Its a brand new unit, literally just hooked it up yesterday. USB cable everything is good. It will be fine for hours. then it does a single UPS lost, UPS established.


        (no tty) at 16:36 CDT...

Communications with UPS ups lost

        (no tty) at 16:36 CDT...

Communications with UPS ups established

I get this same thing, when I switch usb ports it stops doing it. I think its a usb2 vs 3 thing, at least on mine..
_________________________

Release: pfSense 2.3.4

Offline stanthewizard

  • Full Member
  • ***
  • Posts: 166
  • Karma: +3/-0
    • View Profile
Re: NUT package
« Reply #67 on: September 26, 2016, 08:38:46 am »
Hello

Nice nice feature with this plugin

When battery is low the NUT service does send a signal ?
Or I have something to do ?

Thanks for help

Offline dennypage

  • Hero Member
  • *****
  • Posts: 697
  • Karma: +133/-0
    • View Profile
Re: NUT package
« Reply #68 on: September 26, 2016, 11:05:53 am »
When the UPS enters a low battery state NUT initiates a shutdown.

Offline McFuzz

  • Jr. Member
  • **
  • Posts: 85
  • Karma: +0/-0
    • View Profile
Re: NUT package
« Reply #69 on: October 06, 2016, 11:42:13 pm »
Hello!

Is there a tutorial to get email notifications to work? I have the checkbox ticked, but when I tested by putting the UPS on battery power (yanking power cord), it did not produce any notifications... I had it all working before upgrading to 2.3.2_1 and NUT upgrading to 2.4.7_2... but seems like things are a whole lot different now.

Offline dennypage

  • Hero Member
  • *****
  • Posts: 697
  • Karma: +133/-0
    • View Profile
Re: NUT package
« Reply #70 on: October 07, 2016, 12:21:35 am »
Have you sucessfully tested emails in System Advanced / Notifications / E-Mail following the upgrade?

Offline McFuzz

  • Jr. Member
  • **
  • Posts: 85
  • Karma: +0/-0
    • View Profile
Re: NUT package
« Reply #71 on: October 07, 2016, 01:42:33 am »
Have you sucessfully tested emails in System Advanced / Notifications / E-Mail following the upgrade?

Yes I have - and indeed they are coming through. I have not done any additional configurations in the UPS Settings -> Advanced Settings section... am I supposed to configure anything there aside from ticking the checkbox?

Offline dennypage

  • Hero Member
  • *****
  • Posts: 697
  • Karma: +133/-0
    • View Profile
Re: NUT package
« Reply #72 on: October 07, 2016, 01:47:18 am »
You did a save of the NUT settings after ticking the checkbox, yes?

Please post the contents of /usr/local/etc/nut/upsmon.conf.

Offline McFuzz

  • Jr. Member
  • **
  • Posts: 85
  • Karma: +0/-0
    • View Profile
Re: NUT package
« Reply #73 on: October 07, 2016, 01:51:51 am »
You did a save of the NUT settings after ticking the checkbox, yes?

Please post the contents of /usr/local/etc/nut/upsmon.conf.

Yup - I did.

Here are the contents of upsmon.conf - I did not modify it yet; want to first get the defaults working:

Code: [Select]
MONITOR BX1300G 1 monuser a620bdded832fb08439a master
SHUTDOWNCMD "/sbin/shutdown -p +0"
POWERDOWNFLAG /etc/killpower
NOTIFYCMD /usr/local/pkg/nut/nut_email.php
NOTIFYFLAG ONLINE   SYSLOG+WALL+EXEC
NOTIFYFLAG ONBATT   SYSLOG+WALL+EXEC
NOTIFYFLAG LOWBATT  SYSLOG+WALL+EXEC
NOTIFYFLAG FSD   SYSLOG+WALL+EXEC
NOTIFYFLAG COMMOK   SYSLOG+WALL+EXEC
NOTIFYFLAG COMMBAD  SYSLOG+WALL+EXEC
NOTIFYFLAG SHUTDOWN SYSLOG+WALL+EXEC
NOTIFYFLAG REPLBATT SYSLOG+WALL+EXEC
NOTIFYFLAG NOCOMM   SYSLOG+WALL+EXEC
NOTIFYFLAG NOPARENT SYSLOG+WALL+EXEC


Naturally, I browsed through nut_email.php and noticed that it is referencing to a file called notices.inc:

Code: [Select]
require_once("notices.inc");

However - can't find that file anywhere...

Offline dennypage

  • Hero Member
  • *****
  • Posts: 697
  • Karma: +133/-0
    • View Profile
Re: NUT package
« Reply #74 on: October 07, 2016, 02:01:28 am »
Naturally, I browsed through nut_email.php and noticed that it is referencing to a file called notices.inc:

Code: [Select]
require_once("notices.inc");

However - can't find that file anywhere...

You should find this as /etc/inc/notices.inc.

The contents of upsmon.conf look fine. Please run the following:

Code: [Select]
echo "hello" | /usr/local/pkg/nut/nut_email.php
What happens?