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

    NUT server on Pfsense

    Scheduled Pinned Locked Moved UPS Tools
    5 Posts 2 Posters 1.2k 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.
    • E
      ewok2
      last edited by

      Hello

      I have a NUT server on pfsense (on a VM) with an UPS configured.
      Another Ubuntu VM with NUT client.
      I would like to poweroff the Ubuntu when NUT is ONBATT.

      On client side I get the information that UPS is ON BAT, but my client conf does not switch off the VM

      my "upsmon.conf"

      MONITOR BX500MI@VMserverNUT 1 user-monitor password slave
      MINSUPPLIES 1
      SHUTDOWNCMD "/sbin/shutdown -h +0"
      POLLFREQ 30
      POLLFREQALERT 15
      HOSTSYNC 15
      DEADTIME 15
      POWERDOWNFLAG /etc/killpower
      RBWARNTIME 43200
      NOCOMMWARNTIME 300
      FINALDELAY 5
      
      NOTIFYFLAG ONLINE     SYSLOG+WALL
      NOTIFYFLAG ONBATT     SYSLOG+WALL+EXEC
      NOTIFYFLAG LOWBATT    SYSLOG+WALL
      NOTIFYFLAG FSD        SYSLOG+WALL
      
      NOTIFYCMD /usr/sbin/upssched
      

      my "upssched.conf"

      CMDSCRIPT /usr/sbin/upsmon -c fsd
      

      my understanding of NUT :
      The file "upsmon.conf"" define that on "ONBATT" state

      • he send to syslog a print => Ok check in syslog
      • he display mlessage on the console => Ok
      • he execute the command specify in "NOTIFYCMD" => I guess "/usr/sbin/upssched" execute the command in the "upssched.conf" => So "/usr/sbin/upsmon -c fsd" => but it is not the case ...

      Where am I wrong?
      I know is it not a pfsense issue :-) but did not find a NUT forum...

      thanks

      E dennypageD 2 Replies Last reply Reply Quote 0
      • E
        ewok2 @ewok2
        last edited by

        One solution (a litle more complex... but that works)

        change "upssched.conf"

        CMDSCRIPT /usr/bin/upssched-cmd
        PIPEFN    /etc/nut/upssched.pipe
        LOCKFN    /etc/nut/upssched.lock
        
        AT ONBATT * EXECUTE powerdown
        

        modify "/usr/bin/upssched-cmd"

        case $1 in
                powerdown)
                        logger -t upssched-cmd "The UPS has been on battery - shutdown required"
                        /usr/sbin/upsmon -c fsd
                        ;;
                *)
                        logger -t upssched-cmd "Unrecognized command: $1"
                        ;;
        esac
        
        1 Reply Last reply Reply Quote 0
        • dennypageD
          dennypage @ewok2
          last edited by

          @ewok2 said in NUT server on Pfsense:

          I know is it not a pfsense issue :-) but did not find a NUT forum...

          https://networkupstools.org/support.html

          E 1 Reply Last reply Reply Quote 0
          • E
            ewok2 @dennypage
            last edited by

            @dennypage said in NUT server on Pfsense:

            I know this page but it is not a forum?
            You have FAQ where I have search
            And mailing list but I thinks it more for developper?

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

              @ewok2 There is a users mailing list, a developers mailing list, and an IRC channel, all on that page.

              1 Reply Last reply Reply Quote 0
              • stephenw10S stephenw10 moved this topic from pfSense Packages on
              • First post
                Last post
              Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.