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

    NUT: shutdown LAN machines in the event of a power failure.

    Scheduled Pinned Locked Moved pfSense Packages
    15 Posts 9 Posters 8.8k 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.
    • panzP
      panz
      last edited by

      So, how do I trigger that signal?

      pfSense 2.3.2-RELEASE-p1 (amd64)
      motherboard: MSI C847MS-E33 Micro ATX (with Intel Celeron CPU 847 @ 1.10 GHz) ~ PSU: Corsair VS350 ~ RAM: Kingston KVR1333D3E9S 4096 MB 240-pin DIMM DDR3 SDRAM 1.5 volt ~ NIC: Intel EXPI9301CTBLK (LAN) ~ NIC: D-Link DFE-528TX (CAM) ~ Hard Disk: Western Digital WD10JFCX Red ~ Case: Cooler Master HAF XB ~ power consumption: 21 Watts.

      1 Reply Last reply Reply Quote 0
      • J
        Joe4evr
        last edited by

        @panz:

        So, how do I trigger that signal?

        I haven't put this in practice, but theoretically you could modify pfSense's shutdown script to send the shutdown command via SSH. At least, that's what I was planning to figure out once I have a UPS, but I'm not that well versed in *nix commandline stuff.

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

          Just read NUT documentation.

          pfSense 's NUT web gui doesn't cover all the options, but I guess you could modify the config file generated to include your options.

          1 Reply Last reply Reply Quote 0
          • panzP
            panz
            last edited by

            So, pfSense NUT as master and other machines as slave(s). I fear to do modifications to system scripts  :'(

            pfSense 2.3.2-RELEASE-p1 (amd64)
            motherboard: MSI C847MS-E33 Micro ATX (with Intel Celeron CPU 847 @ 1.10 GHz) ~ PSU: Corsair VS350 ~ RAM: Kingston KVR1333D3E9S 4096 MB 240-pin DIMM DDR3 SDRAM 1.5 volt ~ NIC: Intel EXPI9301CTBLK (LAN) ~ NIC: D-Link DFE-528TX (CAM) ~ Hard Disk: Western Digital WD10JFCX Red ~ Case: Cooler Master HAF XB ~ power consumption: 21 Watts.

            1 Reply Last reply Reply Quote 0
            • F
              FlashPan
              last edited by

              I've done this the other way round.

              Using the out of the box apc powerchute software on windows.

              That can trigger a batch file to run what ever you put it in.

              So my setup was the use plink.exe to ssh into pfsense and run shutdown command on that box.  The rest of my windows batch file would then shutdown my windows clients using the default windows "shutdown" command line.

              I'm at work right now but if I can find my windows batch file I'll post it's contents.

              Cheers

              1 Reply Last reply Reply Quote 0
              • panzP
                panz
                last edited by

                I need to shutdown a FreeNAS 9.2 machine (this box is not in the UPS room; pfSense box is).

                NUT master / slave is the way to go, but I'd like not to make a mess with scripts. Is there a way to accomplish this via GUI?

                pfSense 2.3.2-RELEASE-p1 (amd64)
                motherboard: MSI C847MS-E33 Micro ATX (with Intel Celeron CPU 847 @ 1.10 GHz) ~ PSU: Corsair VS350 ~ RAM: Kingston KVR1333D3E9S 4096 MB 240-pin DIMM DDR3 SDRAM 1.5 volt ~ NIC: Intel EXPI9301CTBLK (LAN) ~ NIC: D-Link DFE-528TX (CAM) ~ Hard Disk: Western Digital WD10JFCX Red ~ Case: Cooler Master HAF XB ~ power consumption: 21 Watts.

                1 Reply Last reply Reply Quote 0
                • jimpJ
                  jimp Rebel Alliance Developer Netgate
                  last edited by

                  Since that system is FreeNAS perhaps you have another option:

                  mount a NAS share on pfSense, have nut touch a flag file that triggers FreeNAS to shut down when present. (e.g. a cron job with a script that checks every minute, if it's seen, rm the file and issue a shutdown -p)

                  Remember: Upvote with the 👍 button for any user/post you find to be helpful, informative, or deserving of recognition!

                  Need help fast? Netgate Global Support!

                  Do not Chat/PM for help!

                  1 Reply Last reply Reply Quote 0
                  • V
                    Visseroth
                    last edited by

                    I am trying to do the same thing and then you lost me at mounting a share with PfSense.
                    I have a PfSense machine (obviously) and a freenas box and I've been trying to get either my freenas box to read the snmp card in my UPS (Tripplite SU2200RTXL2U) or even the serial cable but all I get is unable to communicate or UPS on battery.
                    So now I'm trying to see if I can get my firewall to tell my NAS box to shut down when on battery.
                    Anyone had any luck?

                    1 Reply Last reply Reply Quote 0
                    • L
                      lonevipr
                      last edited by

                      To panz and Visseroth, this will answer questions for you guys. I'm also working on getting this configured for my pfSense box & UPS. I have heavily read the documentation at http://www.networkupstools.org/docs/user-manual.chunked/index.html.

                      It contains lots of useful information on how to configure this tool. You will need to do some reading to make it work for your exact application, but the program seems very well built to cover a wide range of scenarios.

                      @panz:

                      Do I have any chance to send the shutdown signal to all the computers in my small LAN? (Windows, MacOS and Ubuntu machines).

                      Ok, refer to the documentation for more info but upsd is a network server daemon (running on main pfSense/NUT setup) that makes battery info available over IP network to other computers (setup as slaves, on the client end) that have setup upsmon (a client for *nix/BSD). In Windows there is a tool called WinNUT that is suppose to receive battery info from upsd. I can't say anything about how to send info to Macs. Mabye google NUT upsmon Mac client to try to locate one.

                      For instance with my setup. I have 8 UPS, with 1 server on each. I have all the serial ports ran to my pfSense box with two 4 port rs232 serial to usb hubs. My pfSense box will monitor all batteries for life & send appropriate shutdown signals out to be received via upsmon (for *nix/BSD) or WinNUT (in Windows).

                      Pretty good info about some NUT stuff at this link too, http://dns323.kood.org/howto:nut_ups

                      Edit:As someone else already mentioned, your pfSense box with NUT & switch(es) need to be plugged into UPS as well to transmit signals over IP. Switches shouldn't matter if they hard shut off.

                      More good info, https://forum.pfsense.org/index.php?topic=78977.0

                      Running pfSense 2.2-RELEASE (amd64)

                      1 Reply Last reply Reply Quote 0
                      • panzP
                        panz
                        last edited by

                        It was easier than I thought: pfSense now needs a Port Forward from LAN to 127.0.0.1.

                        Now works like a charm :)

                        pfSense 2.3.2-RELEASE-p1 (amd64)
                        motherboard: MSI C847MS-E33 Micro ATX (with Intel Celeron CPU 847 @ 1.10 GHz) ~ PSU: Corsair VS350 ~ RAM: Kingston KVR1333D3E9S 4096 MB 240-pin DIMM DDR3 SDRAM 1.5 volt ~ NIC: Intel EXPI9301CTBLK (LAN) ~ NIC: D-Link DFE-528TX (CAM) ~ Hard Disk: Western Digital WD10JFCX Red ~ Case: Cooler Master HAF XB ~ power consumption: 21 Watts.

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