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.
    • M Offline
      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 Offline
        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 Offline
          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 Offline
            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 Offline
              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 Offline
                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 Offline
                  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 Offline
                    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 Offline
                      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 Offline
                        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 Offline
                          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 Offline
                            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 Offline
                              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 Offline
                                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 Offline
                                  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 Offline
                                    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
                                    • D Offline
                                      dbaio
                                      last edited by

                                      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?

                                      Thank you McFuzz.

                                      I will update the package for fix this problem.

                                      About notifications.

                                      Config:
                                      System -> Advanced -> Notifications –> SMTP E-Mail

                                      Install:
                                      mailgraph package

                                      And then, you can test apcupsd e-mail notifications:

                                      /usr/pbi/apcupsd-i386/etc/apcupsd/onbattery
                                      /usr/pbi/apcupsd-i386/etc/apcupsd/offbattery

                                      or

                                      /usr/pbi/apcupsd-amd64/etc/apcupsd/onbattery
                                      /usr/pbi/apcupsd-amd64/etc/apcupsd/offbattery

                                      Best Regards.

                                      –
                                      Danilo G. Baio (dbaio)

                                      1 Reply Last reply Reply Quote 0
                                      • W Offline
                                        webdawg
                                        last edited by

                                        https://forum.pfsense.org/index.php?topic=91783

                                        Sent you a PM about this.  I am having the same issue now where multiple instances of it get ran.

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

                                          @webdawg:

                                          https://forum.pfsense.org/index.php?topic=91783

                                          Sent you a PM about this.  I am having the same issue now where multiple instances of it get ran.

                                          Ok thanks.

                                          I've sent a PR for adding apcupsd on pfSense 2.3.

                                          https://github.com/pfsense/FreeBSD-ports/pull/128

                                          On pfSense 2.3 the problem with emails won't happening.  ;D

                                          –
                                          Danilo G. Baio (dbaio)

                                          1 Reply Last reply Reply Quote 0
                                          • W Offline
                                            webdawg
                                            last edited by

                                            Rockin…I am thinking I will have to install it.

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