Netgate Discussion Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Register
    • Login

    UPS shutdown

    pfSense Packages
    12
    67
    32.4k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • B
      Berg
      last edited by

      @rsw686:

      I've gotten NUT up and running on pfSense. Here is the install script I am running. Everything is hardcoded and I've tested it from a clean install of pfsense in VMware with a UPS on the serial port and below is the output. The hard part of this is making a web interface that will be able to change the numerous settings required. I will work on that.

      Once I get it all working if anybody would like to make a donation for my time it would be appreciated.

      http://wgnrs.dynalias.com:81/pfsense/nut/installnut.sh

      Awesome !!!! Thanks for working on this !

      1 Reply Last reply Reply Quote 0
      • R
        rsw686
        last edited by

        Okay I've run into a snag. Can one of the devs tell me how I can change the url for the package manager so I can test this out?

        1 Reply Last reply Reply Quote 0
        • R
          rsw686
          last edited by

          I have a working package. However it needs error handling and features to be added, which I will work on.  Heres the package edit screen. And below that the log from clicking change. You can see it stops the old and starts the service back up. Also it starts successfully on reboot.

          **I really needs one of the devs help in getting the package manager to work. If I can change the url somehow to run it off my server. I looked into it and it talks to xmlrpc.php. I can't test the install and uninstall functions and have to perform them at the command line.

          Also the global booting variable is false when the packages are being synced. Is there a way to know when the system is booting so the sync package command doesn't start the package, that way when the rc.d scripts execute it will start. Otherwise it starts, stops, then starts again.**

          Oct 21 03:50:09 	upsmon[2160]: UPS sparky@10.10.1.200 battery is low
          Oct 21 03:50:09 	upsmon[2160]: UPS sparky@10.10.1.200 battery is low
          Oct 21 03:50:09 	upsd[2157]: Client monuser@10.10.1.200 logged into UPS [sparky]
          Oct 21 03:50:09 	upsd[2157]: Connection from 10.10.1.200
          Oct 21 03:50:09 	upsmon[2159]: Startup successful
          Oct 21 03:50:09 	upsd[2157]: Startup successful
          Oct 21 03:50:07 	upsd[2156]: Connected to UPS [sparky]: apcsmart-ttyd0
          Oct 21 03:50:07 	apcsmart[2155]: Startup successful
          Oct 21 03:49:57 	php: nut: Starting service
          Oct 21 03:49:57 	php: nut: Taking control of port
          Oct 21 03:49:56 	php: nut: Releasing control of port
          Oct 21 03:49:55 	apcsmart[1970]: Signal 15: exiting
          Oct 21 03:49:55 	upsd[1972]: Signal 15: exiting
          Oct 21 03:49:55 	upsmon[1975]: Signal 15: exiting
          Oct 21 03:49:55 	php: nut: Stopping service
          
          1 Reply Last reply Reply Quote 0
          • R
            rsw686
            last edited by

            Wanted to add when the power fails it starts shutdown and halts the box. This is from remote syslog. I need to set the delay as right now it shutsdown immediately on powerfail.

            10-21-2006	01:17:08	Daemon.Info	10.10.1.200	Oct 21 05:18:05 upsd[622]: Signal 15: exiting
            10-21-2006	01:17:06	Auth.Notice	10.10.1.200	Oct 21 05:18:03 shutdown: halt by root:
            10-21-2006	01:17:06	Daemon.Info	10.10.1.200	Oct 21 05:18:03 upsd[622]: Host 10.10.1.200 disconnected (read failure)
            10-21-2006	01:17:01	Daemon.Notice	10.10.1.200	Oct 21 05:17:58 upsmon[625]: Auto logout and shutdown proceeding
            10-21-2006	01:17:01	Daemon.Critical	10.10.1.200	Oct 21 05:17:58 upsmon[625]: Executing automatic power-fail shutdown
            10-21-2006	01:17:01	Daemon.Info	10.10.1.200	Oct 21 05:17:58 upsd[622]: Client monuser@10.10.1.200 set FSD on UPS [sparky]
            10-21-2006	01:17:01	Daemon.Notice	10.10.1.200	Oct 21 05:17:58 upsmon[625]: UPS sparky@10.10.1.200 on battery
            
            1 Reply Last reply Reply Quote 0
            • Cry HavokC
              Cry Havok
              last edited by

              Left to it's own devices NUT would normally trigger a shutdown on LB (low battery).  This should be the correct process (otherwise you'll start a shutdown if the power goes out for a fraction of a second, probably not what you want).

              I'd also be interested in a client only option - for those of us already running a NUT server.

              1 Reply Last reply Reply Quote 0
              • R
                rsw686
                last edited by

                Thats probably what it is as the UPS I was testing with is old and has a low battery condition. I have others but there used for production boxes. The client is easy to implement as well. What I'm trying to figure out is how to change the pacakge url so I can install and uninstall the package to test everything out.

                1 Reply Last reply Reply Quote 0
                • B
                  billm
                  last edited by

                  @rsw686:

                  Okay I've run into a snag. Can one of the devs tell me how I can change the url for the package manager so I can test this out?

                  "xmlrpcbaseurl" => "www.pfsense.com",
                      "xmlrpcpath" => "/pfSense/xmlrpc.php",

                  in /etc/inc/globals.inc

                  –Bill

                  pfSense core developer
                  blog - http://www.ucsecurity.com/
                  twitter - billmarquette

                  1 Reply Last reply Reply Quote 0
                  • R
                    rsw686
                    last edited by

                    @billm:

                    @rsw686:

                    Okay I've run into a snag. Can one of the devs tell me how I can change the url for the package manager so I can test this out?

                    "xmlrpcbaseurl" => "www.pfsense.com",
                        "xmlrpcpath" => "/pfSense/xmlrpc.php",

                    in /etc/inc/globals.inc

                    –Bill

                    Thanks I had looked in the globals.inc before but I don't have the xmlrpc.php file. I got a copy of the xmlrpc.php and will try this out.

                    http://cvstrac.pfsense.com/rlog?f=www/xmlrpc/xmlrpc.php

                    1 Reply Last reply Reply Quote 0
                    • R
                      rsw686
                      last edited by

                      I got the package installer up and running on my local server. I can install the package now and have worked on the gui interface for it. I need to implement this in the backend code. Hopefully in a week I will have it committed and you all can start testing it out.

                      1 Reply Last reply Reply Quote 0
                      • R
                        rsw686
                        last edited by

                        Tomorrow (Friday) it should be committed. I just have to add more models to the list and check a few things.

                        The interface is shown in the above post. Its plain but gets the job done. Suggestions would be appreciated. However due to the package system generating the page theres not much more I can do unless I want to build my own configuration page, which I might work on later.

                        Local, local monitoring with remote access, and remote monitoring are all supported.

                        1 Reply Last reply Reply Quote 0
                        • R
                          rsw686
                          last edited by

                          The package is committed. Let me know how it works. I've only gotten to test it on a APC Smart-UPS. If there are cable types, etc you need added let me know. I went through the list and added all the major brands, etc.

                          1 Reply Last reply Reply Quote 0
                          • Y
                            yoda715
                            last edited by

                            This is as far as I get when trying to install nut:

                            Downloading package configuration file… done.
                            Saving updated package information... done.
                            Downloading nut and its dependencies...

                            It will hang there at downloading dependencies and will never complete.

                            1 Reply Last reply Reply Quote 0
                            • R
                              rsw686
                              last edited by

                              @yoda715:

                              This is as far as I get when trying to install nut:

                              Downloading package configuration file… done.
                              Saving updated package information... done.
                              Downloading nut and its dependencies...

                              It will hang there at downloading dependencies and will never complete.

                              The FreeBSD mirror containing the dependencies was up and down all morning. I thought it was back up. I will see if theres another one I can use instead.

                              1 Reply Last reply Reply Quote 0
                              • R
                                rsw686
                                last edited by

                                I've added more cable types and made some changes to get USB UPS's working. You need to specify auto as the port if using USB. I have also built the development tree version of newhidups, which should be tested soon. If it resolves more of the issues I will commit it. If anybody is interested in testing it contact me either by private message or email. Any feedback on this package would be appreciated.

                                1 Reply Last reply Reply Quote 0
                                • C
                                  cadtiagof
                                  last edited by

                                  How do I add my ups driver to NUT ( powercom ) ?

                                  How to change the shutdown times?

                                  thanks  ;)

                                  1 Reply Last reply Reply Quote 0
                                  • T
                                    trendchiller
                                    last edited by

                                    Would be nice to implement a screen showing the status of the UPS…  ;D

                                    1 Reply Last reply Reply Quote 0
                                    • R
                                      rsw686
                                      last edited by

                                      I have done a rewrite of the NUT package which cleaned up the code, and fixed permission errors. I have also added a status tab which displays the model, status, load, battery charge/voltage, input/output voltage. and temperature.

                                      Feedback on if the package works for you, what doesn't work, ideas for improvement would be appreciated.

                                      1 Reply Last reply Reply Quote 0
                                      • T
                                        trendchiller
                                        last edited by

                                        hmmm, does not work for me…

                                        seems not to find my smart-ups via calbe (com1)  :'(

                                        I configured every setting that's NOT optional... and I get the following:

                                        Feb 15 22:51:45 php: nut: Service failed to start: check configuration
                                        Feb 15 22:51:45 php: nut: Starting service
                                        Feb 15 22:50:44 php: nut: Service failed to start: check configuration
                                        Feb 15 22:50:43 php: nut: Starting service
                                        Feb 15 22:49:34 php: /pkg_mgr_install.php: Beginning package installation for nut.

                                        UPS Monitoring   LOCAL
                                        Local UPS Name UPS_IDEN
                                        Local UPS Model SMART-UPS
                                        Local UPS Port    COM1 (ttyd0)

                                        any idea ?

                                        1 Reply Last reply Reply Quote 0
                                        • R
                                          rsw686
                                          last edited by

                                          @trendchiller:

                                          hmmm, does not work for me…

                                          seems not to find my smart-ups via calbe (com1)  :'(

                                          I configured every setting that's NOT optional... and I get the following:

                                          Feb 15 22:51:45 php: nut: Service failed to start: check configuration
                                          Feb 15 22:51:45 php: nut: Starting service
                                          Feb 15 22:50:44 php: nut: Service failed to start: check configuration
                                          Feb 15 22:50:43 php: nut: Starting service
                                          Feb 15 22:49:34 php: /pkg_mgr_install.php: Beginning package installation for nut.

                                          UPS Monitoring   LOCAL
                                          Local UPS Name UPS_IDEN
                                          Local UPS Model SMART-UPS
                                          Local UPS Port    COM1 (ttyd0)

                                          any idea ?

                                          You need to specify a cable type, that is why is it in () next to Smart-UPS. If that is an APC cable look at both ends. In the plastic it will have the cable number engraved. Specify that cable in the nut cable type selection.

                                          1 Reply Last reply Reply Quote 0
                                          • T
                                            trendchiller
                                            last edited by

                                            Hmmm, did it that way, but it does not work either :-(

                                            And the service is being started, tells me successful, but then does not start at all  :-\

                                            1 Reply Last reply Reply Quote 0
                                            • First post
                                              Last post
                                            Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.