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

    UPS shutdown

    Scheduled Pinned Locked Moved pfSense Packages
    67 Posts 12 Posters 32.5k Views
    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

      I would certainly be in favour of using NUT.

      I am already using it on a Linux server that would should down a couple of Linux and Windows machines from the server. This would be a great addition to pfSense,

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

        Disreguard this post I figured it out.

        So in

        http://ftp-mirror.internap.com/pub/FreeBSD/ports/i386/packages-6.0-release/All/

        the nut package seems to include everything but upsdrvctl which is needed to start the driver control part of nut.

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

          I have made some progress on this. Again I need to get my other box setup with its own ups setup to continue.

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

          Make sure you read through the files before you run anything as this is all in the devel phase. The files needed are in place and the user and group are there.

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

            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

            
            installnut.sh                                 100% of 2733  B 3360 kBps
            -                                             100% of  799 kB  876 kBps
            Network UPS Tools - UPS driver controller 2.0.2
            Network UPS Tools (version 2.0.2) - APC Smart protocol driver
                    Driver version 1.99.7, command table version 2.0
            Detected SMART-UPS 700 [XS9904001510] on /dev/ttyd0
            Network UPS Tools upsd 2.0.2
            Connected to UPS [sparky]: apcsmart-ttyd0
            Synchronizing....done
            OL LB
            Network UPS Tools upsmon 2.0.2
            Using power down flag file /etc/killpower
            
            UPS: sparky@10.10.1.200 (master) (power value 1)
            
            Broadcast Message from admin@pfsense.local
                    (no tty) at 21:57 UTC...
            
            UPS sparky@10.10.1.200 battery is low
            
            
            1 Reply Last reply Reply Quote 0
            • 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
                                            • First post
                                              Last post
                                            Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.