Beta test of new NUT UPS package



  • I am looking for some volunteers to help with testing a new NUT UPS package.

    Please note that in order to install the beta nut package, you must be comfortable using the command line interface. If you are not comfortable with the command line, please wait for the ga version of the package.

    Please PM me if interested.



  • Here are instructions for installing the beta:

    PM me with an email address and I will send you a copy of the current beta package.

    Before installing the beta package, please backup your current config file. You will want your prior config handy if you need to revert to the prior package.

    IMPORTANT: Before installing the beta package, you MUST remove the existing nut package. If you fail to remove the prior package, you will end up with a non-functional nut package. Please use the pfSense package manager to remove the existing nut package.

    To begin, copy the beta package to the system. Then log into the system as root and use the FreeBSD package manager to to install the package. The install command is:

    pkg install pfSense-pkg-nut-2.7.4b1.txz

    After the package is installed, goto Services -> UPS in the pfSense gui to configure settings for your UPS.

    If you need to revert to the prior version, you must first remove the beta package via the pfSense package manager or the FreeBSD package manger. The command to remove the package via the FreeBSD package manager is:

    pkg delete pfSense-pkg-nut

    After the beta package has been removed, you can re-install nut via the pfSense package manager in the normal way. After you have reinstalled the prior nut package, you can either reconfigure nut via the package gui in Services -> NUT, or you can restore your prior config using the file you saved above. A config restore will cause a reboot, so it might be preferable to simply reconfigure via the GUI.

    Thank you for your help!



  • One last thing… if it takes me a while to respond, please be patient with me. I have a lot going on right now. :)



  • Did you created github pull request already?
    What's new coming?
    It would be good if NUT can get a new option like "keep service alive" fixing this bug — https://redmine.pfsense.org/issues/6571
    Currently I'am using CRON to run the script that checks if NUT is running and starts it if not.



  • It is a completely new version of the nut package, written from scratch. It brings an all new gui and alignment with current NUT architecture. PR will follow some initial testing.



  • Denny, the new package is very nice!  Great work!  It installed cleanly and ran great the first time.  I love the more easy to understand options and the status screen looks great.

    I did find an issue.  Following a reboot, it was unable to chdir to /var/db/nut as I have my /var in a ramdisk because I am running on mirrored SSDs for system drives.



  • Thanks Ben. I actually have code to fix up a missing /var/db/nut, but it's currently only run at install time to fix a problem with the prior nut package. It's easy enough to move the fix up check to be executed at each config sync. I'll have it for you when I get back in a day or two.

    @Starrbuck:

    I did find an issue.  Following a reboot, it was unable to chdir to /var/db/nut as I have my /var in a ramdisk because I am running on mirrored SSDs for system drives.



  • Btw, do you mind posting the ups type and driver that you are testing with?



  • Hi,

    I'm running a generic asian ups with the following

    (Various USB)
    UPSilon 2000 software blazer_usb langid_fix=0x409

    It installed perfectly, looks great, unfortunately it gives me

    "Failed to retrieve status"



  • @dennypage:

    Thanks Ben. I actually have code to fix up a missing /var/db/nut, but it's currently only run at install time to fix a problem with the prior nut package. It's easy enough to move the fix up check to be executed at each config sync. I'll have it for you when I get back in a day or two.

    Awesome, that should be a rather easy fix!

    @dennypage:

    Btw, do you mind posting the ups type and driver that you are testing with?

    I will have to check this evening after I get home with access to the server.



  • Several questions:

    What messages are in the system log? Look for messages from upsd, upsmon, upsdrvctl, blazer*.
    What are the contents of /usr/local/etc/nut/ups.conf and upsd.conf?
    What nut processes are running? (ps -axuwww | grep ups)
    Does anything change if you restart the nut service via the nut status page or the services page?
    Have you successfully tested this specific ups model with nut previously?

    @johnabbot:

    I'm running a generic asian ups with the following

    (Various USB)
    UPSilon 2000 software blazer_usb langid_fix=0x409

    It installed perfectly, looks great, unfortunately it gives me

    "Failed to retrieve status"



  • USB type:  Local USB
    Driver:  usbhid



  • Hey Starrbuck, I sent you an update that should address your ram disk issue. Please let me know that it works for you. Thanks.



  • Got it, thanks!



  • @dennypage:

    Hey Starrbuck, I sent you an update that should address your ram disk issue. Please let me know that it works for you. Thanks.

    The ramdisk issue is corrected.  Upon rebooting the package started up normally and the status looks fine.



  • Good to hear. Thanks again for testing.



  • w0w, I may have an approach that will address the SNMP unreachable on startup issue issue. Give me a couple of days, and I'll let you know. In the mean time, please test the existing beta2 version. Thanks.



  • UPS Status — OFF, but displayed battery charge and load are OK.
    Fixed with an extra argument for driver.
    mibs=ietf
    Looks much better now :)
    Good job!

    P.S. Don't look at I/O Voltage at first picture, it's Powercom firmware bug that could not be fixed anyway.






  • Can I request some features for package? (lowest priority in your list) :)
    1. I want shutdown pfsense before battery get LOW condition, for example after running 5 minutes on battery, I have seen some implementations using internal nut scripting, but not for pfsense. Feature is very similar to what APCUPSD already have for years.
    2. It would be good to kill UPS power, sending command to shutdown UPS, like APCUPSD doing it.

    BTW I am using APCUPSD on windows for the same UPS.



  • @dennypage:

    Several questions:

    What messages are in the system log? Look for messages from upsd, upsmon, upsdrvctl, blazer*.

    upsmon 73821 Poll UPS [sunpac] failed - Driver not connected
    upsd 71207 Can't connect to UPS [sunpac] (blazer_usb-sunpac): No such file or directory

    What are the contents of /usr/local/etc/nut/ups.conf and upsd.conf?

    sunpac]
    driver=blazer_usb
    port=auto
    langid_fix=0x4095
    subdriver=krauler
    productid=1234
    vendorid=0925

    LISTEN 127.0.0.1
    LISTEN ::1

    What nut processes are running? (ps -axuwww | grep ups)

    ps -axuwww | grep ups
    root    71207  0.0  0.0  20712    2368  -  Ss    6:10PM    0:00.24 /usr/local/sbin/upsd -u root
    root    72651  0.0  0.0  16612    2308  -  Is    6:10PM    0:00.00 /usr/local/sbin/upsmon
    uucp    73821  0.0  0.0  16612    2340  -  S    6:10PM    0:00.20 /usr/local/sbin/upsmon
    root    58229  0.0  0.0  18740    2240  0  S+    9:44PM    0:00.00 grep ups

    Does anything change if you restart the nut service via the nut status page or the services page?

    No

    Have you successfully tested this specific ups model with nut previously?

    No

    @johnabbot:

    I'm running a generic asian ups with the following

    (Various USB)
    UPSilon 2000 software blazer_usb langid_fix=0x409

    It installed perfectly, looks great, unfortunately it gives me

    "Failed to retrieve status"



  • I have "tecnoware" UPS, some ERA series but not the same as listed in NUT supported devices. It have similar behavior to yours,  johnabbot
    Playing with driver options not helped, strange… but UPSilon 2000 works under windows environment at least.



  • John, it looks like the usb information for the ups doesn't match. I would recommend dumping the usb information on the device and heading over to the NUT forums with it. You can dump the usb information with the following command on the console:

    usbconfig dump_device_desc



  • I've sent out beta 3. You do not need to remove the beta 1/2 package before installing the beta 3 package. Note that it is normal that the nut service is stopped during the install–you will need to restart the service after the install completes.

    Again, thank you for all your help!



  • w0w, with the beta 3 release you should be able to address the SNMP unreachable on startup issue issue. Add the following lines to ups.conf in the advanced section:

    maxretry=60
      retrydelay=60

    This will result in a retry every minute for an hour. Be careful how you use this.

    See the ups.conf man page for more information.



  • I believe NUT already handles this. Have a look at the man page for the apcsmart driver. Pretty rich configuration options for power handling in there.

    @w0w:

    It would be good to kill UPS power, sending command to shutdown UPS, like APCUPSD doing it.



  • Hey John, just wondering if you had a chance to dump the usb config to check the vendor and product id?

    @johnabbot:

    driver=blazer_usb
    port=auto
    langid_fix=0x4095
    subdriver=krauler
    productid=1234
    vendorid=0925



  • dennypage
    Thanks, looks like b3 works. UPS reconnects if no connection at startup or if it lost.

    @dennypage:

    I believe NUT already handles this. Have a look at the man page for the apcsmart driver. Pretty rich configuration options for power handling in there.

    @w0w:

    It would be good to kill UPS power, sending command to shutdown UPS, like APCUPSD doing it.

    I don't use apcsmart driver, I use SNMP. I think I'll try

    something like " /usr/local/ups/sbin/upsdrvctl shutdown" later to check if this works.

    Thanks again about tip for ups.conf, shame on me. :)



  • w0w

    If that works to kill the UPS, you can add this to rc.shutdown and it will send the command if NUT shuts down the system
    I use the system patches package to keep it there across updates.

    
    if (test -f /etc/killpower)
        then
            echo "Shutting down UPS power..."
            /usr/local/sbin/upsdrvctl shutdown
        fi
    
    


  • Glad it works. No shame btw, it wasn't possible to do in beta 2. Both config and script changes were needed to support it.

    @w0w:

    Thanks, looks like b3 works. UPS reconnects if no connection at startup or if it lost.

    Thanks again about tip for ups.conf, shame on me. :)





  • @dennypage:

    Hey John, just wondering if you had a chance to dump the usb config to check the vendor and product id?

    Hi Denny,

    There was an attempt to reverse engineer this back in 3013 that seems to have come to nothing.

    http://lists.alioth.debian.org/pipermail/nut-upsdev/2013-January/006390.html

    my understanding is they won't do any more work on supporting it. I've wasted enough time on getting it to work I think I will wait to see what works well with NUT on the pfsense and buy one of those.

    John

    @johnabbot:

    driver=blazer_usb
    port=auto
    langid_fix=0x4095
    subdriver=krauler
    productid=1234
    vendorid=0925



  • If you are looking for a new UPS, pretty much anything that is supported by NUT 2.7.4 should work fine with the new nut package under pfSense. To ensure compatibility with NUT, it would be a good idea to choose a ups that operates with a publicly available protocol. You can find these on the NUT hardware compatibility list by selecting "***" as the minimum Support Level.



  • sorry, wrong thread



  • I got a Eaton 5E2000iUSB and it seems to work perfectly.

    I still have to add the Nut Clients (debian servers & a NAS) and test it properly but looking good.

    Thanks a million for your work, this is one thing about Pfsense that has been really bugging me.



  • Thanks John. I'm glad it worked for you. I really appreciate your help with testing the new package.



  • let me know if I can test for you too.
    Does this NUT update support reporting on enviromentals via an APC 9631 and sensors?



  • The UPS Detail section on the Status page will display all variables reported by the NUT driver, however I don't personally know what variables are reported by the driver for the 9631 card.

    If you would like a copy of the beta package, please pm me with an email address. Thanks.

    @irj972:

    Does this NUT update support reporting on enviromentals via an APC 9631 and sensors?



  • Does the Beta package properly support the connection to Apcupsd ? Now I use a workaround with the old package, but I'd rather use something that can be configured through the pfsense webui.



  • Yes, the package supports configuration of remote apcupsd.



  • Thanks for letting me join the Beta Phase.
    Here's my feedback:
    I use a remote APC UPS which is hooked up on one of my Synology NAS.
    After removing the current package i installed the beta via cmdline and was very happy that my Config Data has been found :)
    I had to re-enable these by saving them and i got every value from the APC now shown in pfSense. That's cool!
    There is also a new widget. The new one seems to be a little bigger. There i have to say, that i liked the older one a little more.
    As i remember there where colored texts in it and it was, yes smaller.

    I keep up looking if there is any bug left :)
    Thank you!


Log in to reply