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

    New package Apcupsd is available.

    Scheduled Pinned Locked Moved pfSense Packages
    57 Posts 13 Posters 25.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.
    • K
      KaneR
      last edited by

      Hi,

      Many thanks for the package.

      It looks like it has been compiled without snmp support, see below:

      php: /pkg_edit.php: The command '/usr/local/etc/rc.d/apcupsd.sh restart' returned exit code '1', the output was 'Stopping APC UPS Daemon… No matching processes were found Starting APC UPS Daemon... apcupsd FATAL ERROR in apcupsd.c at line 259 Apcupsd cannot continue without a valid driver. Apcupsd driver snmplite not found. The available apcupsd drivers are: dumb apcsmart net usb pcnet Most likely, you need to add --enable-snmplite to your ./configure options. '

      Can this be changed?

      Thanks

      Kane

      1 Reply Last reply Reply Quote 0
      • G
        gogol
        last edited by

        @Hollander:

        G'day Danilo  ;D

        Could I ask a question? I have an APC-UPS (SmartUPS 1000), which connects to a Synology NAS via a USB-cable which has some (I don't know which one yet, but Synology runs Linux) UPS-server running. So the APC-UPS sends a signal to the Synology when there is a power problem, after which the Synology can shut down itself and the other Synology NAS-ses I have via LAN. Would your package be able to act as a slave towards the Synology also? As in:
        APC-UPS: power problem signal to Synology NAS 1
        –----------> Synology NAS 1 (UPS server monitoring software)
        -------------------------------> signal to other Synologies: shutdown
        -------------------------------> signal to pfSense: shutdown

        If so, what would be the settings in your package to accomplish this? I have been poking around, but to be honest: I have no clue  :-[

        Thank you in advance for your answer  ;D

        Bye,
        [/quote]

        I have done this with the NUT package. The USB cable from my backups ES700 is connected to a Synology NAS and this NAS acts as a server for my Pfsense box.
        Works like a charm:

        • On your NAS check shutdown UPS and enable Network UPS Server

        • In Permitted disk stations enter IP adres of your Pfsense box (Lan IP address in most cases)

        • In the NUT package settings set Remote UPS

        • And Remote NUT ups settings set name to "ups", Remote address to you NAS IP, User "monuser" and Password "secret"

        Thats all there is. But don't forget that with a power failure your network doesn't have power too, so your switch must be connected to the UPS too (that's what I forgot while testing) :D

        1 Reply Last reply Reply Quote 0
        • M
          Mr. Jingles
          last edited by

          @gogol:

          @Hollander:

          G'day Danilo  ;D

          Could I ask a question? I have an APC-UPS (SmartUPS 1000), which connects to a Synology NAS via a USB-cable which has some (I don't know which one yet, but Synology runs Linux) UPS-server running. So the APC-UPS sends a signal to the Synology when there is a power problem, after which the Synology can shut down itself and the other Synology NAS-ses I have via LAN. Would your package be able to act as a slave towards the Synology also? As in:
          APC-UPS: power problem signal to Synology NAS 1
          –----------> Synology NAS 1 (UPS server monitoring software)
          -------------------------------> signal to other Synologies: shutdown
          -------------------------------> signal to pfSense: shutdown

          If so, what would be the settings in your package to accomplish this? I have been poking around, but to be honest: I have no clue  :-[

          Thank you in advance for your answer  ;D

          Bye,
          [/quote]

          I have done this with the NUT package. The USB cable from my backups ES700 is connected to a Synology NAS and this NAS acts as a server for my Pfsense box.
          Works like a charm:

          • On your NAS check shutdown UPS and enable Network UPS Server

          • In Permitted disk stations enter IP adres of your Pfsense box (Lan IP address in most cases)

          • In the NUT package settings set Remote UPS

          • And Remote NUT ups settings set name to "ups", Remote address to you NAS IP, User "monuser" and Password "secret"

          Thats all there is. But don't forget that with a power failure your network doesn't have power too, so your switch must be connected to the UPS too (that's what I forgot while testing) :D

          Thank you Gogol for the very clear instructions, very kind of you  ;D

          Of course, knowing me, it didn't work  :-[

          ( ;D)

          I will open a new thread in order not to hijack Danilo's thread. Perhaps you'd be willing to look in that new thread? (I'll post it here once I've created it). EDIT: new thread is here: http://forum.pfsense.org/index.php/topic,71121.msg388428.html#msg388428

          Thank you  ;D

          6 and a half billion people know that they are stupid, agressive, lower life forms.

          1 Reply Last reply Reply Quote 0
          • D
            dbaio
            last edited by

            The package was updated. (apcupsd-3.14.10_1 pkg v0.2)

            • Fixed snmp.

            • Added device option.

            • Added script to send alerts if you have smtp notifications enabled and mailreport package.

            If you use pcnet on the Upstype field, the parameters need to be on same field.
            If you use snmp, the parameters need to be on device field.

            –
            Danilo G. Baio (dbaio)

            1 Reply Last reply Reply Quote 0
            • M
              McFuzz
              last edited by

              Hello!

              Love the UPS monitoring feature; very nice!

              Question/request though - it is possible to get email notifications when the power is cut out?

              Thanks!

              1 Reply Last reply Reply Quote 0
              • D
                doktornotor Banned
                last edited by

                @McFuzz:

                Question/request though - it is possible to get email notifications when the power is cut out?

                May I suggest reading the previous post, right above yours?

                1 Reply Last reply Reply Quote 0
                • M
                  McFuzz
                  last edited by

                  @doktornotor:

                  @McFuzz:

                  Question/request though - it is possible to get email notifications when the power is cut out?

                  May I suggest reading the previous post, right above yours?

                  blind, i am :D

                  1 Reply Last reply Reply Quote 0
                  • M
                    McFuzz
                    last edited by

                    So I am hitting a bit of a weird issue…

                    Upgraded to 2.1.2 and all was well; apcupsd worked fine with my USB based APC UPS.

                    Then all of the sudden, I started getting the operation timed out error when clicking on the status tab. Checking the logs, I see this:

                    
                    2014-04-10 21:21:48 -0700  Lock file data error: Xìÿÿÿ^?
                    2014-04-10 21:21:48 -0700  apcupsd FATAL ERROR in apcupsd.c at line 285
                    Failed to acquire device lock file
                    2014-04-10 21:21:48 -0700  Lock file data error: Ø^ËB
                    2014-04-10 21:21:48 -0700  apcupsd error shutdown completed
                    
                    

                    Tried restarting the service, reinstalling, rebooting, removing, rebooting, reinstalling… no dice.

                    Then, I just put a random string in the 'Device' field (the one right above 'Poll Time') - not to confuse with 'USB Type / Device' field which shows "usb BLANK"

                    Now I see this:

                    
                    2014-04-10 21:27:50 -0700  apcupsd FATAL ERROR in generic-usb.c at line 674
                    Cannot find UPS device --
                    For a link to detailed USB trouble shooting information,
                    please see <http: www.apcupsd.com="" support.html="">.
                    2014-04-10 21:27:50 -0700  apcupsd error shutdown completed</http:> 
                    

                    For testing sake - I installed NUT and it seems to be working just fine.

                    So, any ideas of why apcupsd ceased to work? :(

                    1 Reply Last reply Reply Quote 0
                    • D
                      dbaio
                      last edited by

                      Before, We had just one field to be filled: UPS Type / Device.
                      Now, We have Device field separated.

                      For pcnet config, parameters need to be just on UPS Type field.
                      With snmp, the parameters need to be on device field.

                      How was your config before the upgrade?

                      –
                      Danilo G. Baio (dbaio)

                      1 Reply Last reply Reply Quote 0
                      • D
                        dbaio
                        last edited by

                        @McFuzz:

                        Hello!

                        Love the UPS monitoring feature; very nice!

                        Question/request though - it is possible to get email notifications when the power is cut out?

                        Thanks!

                        Hi.

                        You need to configure smtp email notifications on pfSense and install mailreport package (just install it).
                        After that, apcupsd will send email alerts to you.

                        –
                        Danilo G. Baio (dbaio)

                        1 Reply Last reply Reply Quote 0
                        • M
                          McFuzz
                          last edited by

                          @dbaio:

                          Before, We had just one field to be filled: UPS Type / Device.
                          Now, We have Device field separated.

                          For pcnet config, parameters need to be just on UPS Type field.
                          With snmp, the parameters need to be on device field.

                          How was your config before the upgrade?

                          Config was as attached (of course service was enabled; I disabled it for now since I am using NUT). All other settings are left at default.

                          ![Screen Shot 2014-04-11 at 9.28.52 AM.png_thumb](/public/imported_attachments/1/Screen Shot 2014-04-11 at 9.28.52 AM.png_thumb)
                          ![Screen Shot 2014-04-11 at 9.28.52 AM.png](/public/imported_attachments/1/Screen Shot 2014-04-11 at 9.28.52 AM.png)

                          1 Reply Last reply Reply Quote 0
                          • D
                            dbaio
                            last edited by

                            @McFuzz:

                            Config was as attached (of course service was enabled; I disabled it for now since I am using NUT). All other settings are left at default.

                            When you have a chance, on UPSType / Device put just "usb" and try again.

                            –
                            Danilo G. Baio (dbaio)

                            1 Reply Last reply Reply Quote 0
                            • M
                              McFuzz
                              last edited by

                              @dbaio:

                              @McFuzz:

                              Config was as attached (of course service was enabled; I disabled it for now since I am using NUT). All other settings are left at default.

                              When you have a chance, on UPSType / Device put just "usb" and try again.

                              Unfortunately that did not help :\ still have the same problem:

                              
                              2014-04-11 13:58:04 -0700  Lock file data error: X����
                              2014-04-11 13:58:04 -0700  apcupsd FATAL ERROR in apcupsd.c at line 285
                              Failed to acquire device lock file
                              2014-04-11 13:58:04 -0700  Lock file data error: ؋B
                              2014-04-11 13:58:04 -0700  apcupsd error shutdown completed
                              
                              
                              1 Reply Last reply Reply Quote 0
                              • D
                                dbaio
                                last edited by

                                Could you collect all the log?

                                On Diagnostics –> Command Prompt

                                cat /var/log/apcupsd.events

                                Use a pastebin like pastebin.ca

                                Thank you.

                                @McFuzz:

                                @dbaio:

                                @McFuzz:

                                Config was as attached (of course service was enabled; I disabled it for now since I am using NUT). All other settings are left at default.

                                When you have a chance, on UPSType / Device put just "usb" and try again.

                                Unfortunately that did not help :\ still have the same problem:

                                
                                2014-04-11 13:58:04 -0700  Lock file data error: X����
                                2014-04-11 13:58:04 -0700  apcupsd FATAL ERROR in apcupsd.c at line 285
                                Failed to acquire device lock file
                                2014-04-11 13:58:04 -0700  Lock file data error: ؋B
                                2014-04-11 13:58:04 -0700  apcupsd error shutdown completed
                                
                                

                                –
                                Danilo G. Baio (dbaio)

                                1 Reply Last reply Reply Quote 0
                                • M
                                  McFuzz
                                  last edited by

                                  @dbaio:

                                  Could you collect the log?

                                  On Diagnostics –> Command Prompt

                                  cat /var/log/apcupsd.events

                                  Use a pastebin like pastebin.ca

                                  Thank you.

                                  @McFuzz:

                                  @dbaio:

                                  @McFuzz:

                                  Config was as attached (of course service was enabled; I disabled it for now since I am using NUT). All other settings are left at default.

                                  When you have a chance, on UPSType / Device put just "usb" and try again.

                                  Unfortunately that did not help :\ still have the same problem:

                                  
                                  2014-04-11 13:58:04 -0700  Lock file data error: X����
                                  2014-04-11 13:58:04 -0700  apcupsd FATAL ERROR in apcupsd.c at line 285
                                  Failed to acquire device lock file
                                  2014-04-11 13:58:04 -0700  Lock file data error: ؋B
                                  2014-04-11 13:58:04 -0700  apcupsd error shutdown completed
                                  
                                  

                                  Log here:

                                  http://pastebin.com/9e347baC

                                  The log is as-of yesterday.

                                  1 Reply Last reply Reply Quote 0
                                  • D
                                    dbaio
                                    last edited by

                                    Thanks for the log.

                                    Could you check what is on this directory?

                                    ls -lha /var/spool/lock/
                                    

                                    Log here:

                                    http://pastebin.com/9e347baC

                                    The log is as-of yesterday.

                                    –
                                    Danilo G. Baio (dbaio)

                                    1 Reply Last reply Reply Quote 0
                                    • D
                                      dbaio
                                      last edited by

                                      Also, this file exists?

                                      /var/run/apcupsd.pid

                                      @dbaio:

                                      Thanks for the log.

                                      Could you check what is on this directory?

                                      ls -lha /var/spool/lock/
                                      

                                      Log here:

                                      http://pastebin.com/9e347baC

                                      The log is as-of yesterday.

                                      –
                                      Danilo G. Baio (dbaio)

                                      1 Reply Last reply Reply Quote 0
                                      • M
                                        McFuzz
                                        last edited by

                                        @dbaio:

                                        Also, this file exists?

                                        /var/run/apcupsd.pid

                                        @dbaio:

                                        Thanks for the log.

                                        Could you check what is on this directory?

                                        ls -lha /var/spool/lock/
                                        

                                        Log here:

                                        http://pastebin.com/9e347baC

                                        The log is as-of yesterday.

                                        I enabled the service and checked /var/spool/lock - nothing there except LCK..:

                                        [2.1.2-RELEASE][root@pfsense]/var/spool/lock(8): ls -la
                                        total 4
                                        drwxrwxr-x  2 uucp  dialer  512 Apr 10 21:37 .
                                        drwxr-xr-x  8 root  wheel   512 Apr 10 23:37 ..
                                        -rw-r--r--  1 root  dialer    0 Apr 10 19:46 LCK..
                                        
                                        

                                        In /var/run - apcupsd.pid does not exist :\

                                        1 Reply Last reply Reply Quote 0
                                        • D
                                          dbaio
                                          last edited by

                                          remove this LCK and restart the service, please

                                          I enabled the service and checked /var/spool/lock - nothing there except LCK..:

                                          [2.1.2-RELEASE][root@pfsense]/var/spool/lock(8): ls -la
                                          total 4
                                          drwxrwxr-x  2 uucp  dialer  512 Apr 10 21:37 .
                                          drwxr-xr-x  8 root  wheel   512 Apr 10 23:37 ..
                                          -rw-r--r--  1 root  dialer    0 Apr 10 19:46 LCK..
                                          
                                          

                                          In /var/run - apcupsd.pid does not exist :\

                                          –
                                          Danilo G. Baio (dbaio)

                                          1 Reply Last reply Reply Quote 0
                                          • M
                                            McFuzz
                                            last edited by

                                            @dbaio:

                                            remove this LCK and restart the service, please

                                            I enabled the service and checked /var/spool/lock - nothing there except LCK..:

                                            [2.1.2-RELEASE][root@pfsense]/var/spool/lock(8): ls -la
                                            total 4
                                            drwxrwxr-x  2 uucp  dialer  512 Apr 10 21:37 .
                                            drwxr-xr-x  8 root  wheel   512 Apr 10 23:37 ..
                                            -rw-r--r--  1 root  dialer    0 Apr 10 19:46 LCK..
                                            
                                            

                                            In /var/run - apcupsd.pid does not exist :\

                                            Yup! That did it!

                                            Thanks!!!

                                            Now - the email functionality; I presume there's nothing to modify or change, right? Once it goes on battery power - an email is automatically dispatched?

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