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

    wake-on-lan

    UPS Tools
    3
    10
    623
    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.
    • C
      chipbreak
      last edited by chipbreak

      i was able to setup my eaton 9135 5kva ups using snmp.
      pfsense can pull all the information, no issues.

      ive got all my servers setup as to pull info from the ups. certain servers will shut down immediately apon battery to prolong the battery life for other servers. then the other servers will shutdown when the battery level is low.

      if the ups never dies then the servers will never reboot.

      is there a way to have pfsense send a wake-on-lan command once power has been restored to the ups automatically?

      GertjanG dennypageD 2 Replies Last reply Reply Quote 0
      • GertjanG
        Gertjan @chipbreak
        last edited by

        @chipbreak

        Sure.
        Install
        4dc6393f-f44b-4cb8-bcd6-66c3bc456943-image.png

        Add a command :

        d58d1d58-ecf3-49de-a1a5-0806bf9e4a7d-image.png

        where 192.168.1.2 is the IPv4 of the device and MAC is the MAC.

        Easy to test :
        Shut down your device 192.168.1.2
        Open a pfSense console - option 8.
        Execute the command, the server will wake up.
        Now you know the command is ok, copy paste into a Startcmd entry in the GUI.
        Extra test : shut down the 192.168.1.2
        Shut down pfSense.
        Start pfSense : the server should start also.

        No "help me" PM's please. Use the forum, the community will thank you.
        Edit : and where are the logs ??

        1 Reply Last reply Reply Quote 0
        • dennypageD
          dennypage @chipbreak
          last edited by

          @chipbreak said in wake-on-lan:

          is there a way to have pfsense send a wake-on-lan command once power has been restored to the ups automatically?

          No, you would have to code something up for this.

          C 1 Reply Last reply Reply Quote 0
          • C
            chipbreak @dennypage
            last edited by

            @dennypage is this something that can be coded on shellcmd or would i need be better off setting up a raspberry pie to code something for this?

            dennypageD GertjanG 2 Replies Last reply Reply Quote 0
            • dennypageD
              dennypage @chipbreak
              last edited by

              @chipbreak I would think you can do it with scripting from cron.

              1 Reply Last reply Reply Quote 0
              • GertjanG
                Gertjan @chipbreak
                last edited by

                @chipbreak said in wake-on-lan:

                can be coded on shellcmd

                Coded ?
                Executing a command is coding now ?

                Whats wrong / not clear with the solution posted above ?

                No "help me" PM's please. Use the forum, the community will thank you.
                Edit : and where are the logs ??

                dennypageD 1 Reply Last reply Reply Quote 0
                • dennypageD
                  dennypage @Gertjan
                  last edited by

                  @Gertjan said in wake-on-lan:

                  Whats wrong / not clear with the solution posted above ?

                  What you posted would work, but is a manual solution. OP asked about an automated solution:

                  @chipbreak said in wake-on-lan:

                  is there a way to have pfsense send a wake-on-lan command once power has been restored to the ups automatically?

                  Automation requires coding/scripting.

                  C 1 Reply Last reply Reply Quote 0
                  • C
                    chipbreak @dennypage
                    last edited by chipbreak

                    @dennypage this would only work if pfsense turns off due to the ups running out of battery charge. All my systems are set to turn on with the return of power. the issue I'm having is when the power goes out my system initiate shut down but my ups never dies. Now I have to manually turn the system back on.

                    I believe the easiest way to code this would be to send a wake on lan signal every 5mins if the ups is sending a charging signal.

                    Edit: when I say systems Im specifically referring to my hypervisor and nas not pfsense.

                    GertjanG dennypageD 2 Replies Last reply Reply Quote 0
                    • GertjanG
                      Gertjan @chipbreak
                      last edited by

                      @chipbreak said in wake-on-lan:

                      I believe the easiest way to code this would be to send a wake on lan signal every 5mins if the ups is sending a charging signal.

                      Has also been solved in the sixties (last century).
                      The solution is nearly identical : install the pfSense cron package.
                      Now you can create a cron task that executes every x minutes the wol command I've shown above.
                      wol wakeup packets are very small (3 times the MAC size + Ethernet packet header) so you won't 'feel' the network load.

                      Or : why note, you automate it the more intelligent way : a small shells script that pings the server(s). If it fails after several pings, it starts to execute the wol command. if that fails after x tries, a mail notification to tell you the server won't wake up.
                      In reality such a solution is used less often. People tend to look for a more stable power source / not hosting servers where the power goes out all the time. Like a data center, as this auto solves the issue without coding ^^

                      No "help me" PM's please. Use the forum, the community will thank you.
                      Edit : and where are the logs ??

                      1 Reply Last reply Reply Quote 1
                      • dennypageD
                        dennypage @chipbreak
                        last edited by

                        @chipbreak said in wake-on-lan:

                        I believe the easiest way to code this would be to send a wake on lan signal every 5mins if the ups is sending a charging signal.

                        Start with this command:

                        upsc myups ups.status
                        

                        "OL" (On Line) would be the status on mains, but they are others that will appear, and are separated by comma. Important ones would be "OB" (On Battery), "LB" (Low Battery), "FSD" (Forced Shut Down).

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