Announcement

Collapse
No announcement yet.

Connection error for remote machine.

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Connection error for remote machine.

    Good evening one and all.
    Firstly let me say I am out of my comfort zone trying to get information from a remote machine.
    The remote machine is running FreePBX and the UPS is an APC 750.
    In FreePBX there is GUI that allows for configuration of a UPS, super simple no trying to mess with "Linux" stuff that being said the apcupsd.conf files shows FreePBX as the host and port 3553 as the UPS port.
    I believe my issue is something to do with firewall type stuff as HS says connection refused. I have tried turning OFF Fail2ban and the firewall on the FreePBX machine along with the HS3 windows firewall all at the same time. I perceive I have probably missed something somewhere but have no idea of what to try next.
    Attached HS log error and FreePBX setup.

    Any and all help appreciated.

    Click image for larger version

Name:	UPS setup FreePBX.PNG
Views:	305
Size:	28.3 KB
ID:	1312717Click image for larger version

Name:	FreePBX connection error 1.PNG
Views:	283
Size:	9.6 KB
ID:	1312715

    Peter
    Attached Files

    #2
    I think your going to be messing with "Linux" stuff. At least to find out if the UPS is detected and actually talking with the server.
    I'll attach a couple links that center on FreePBX and checking the apcupsd. You will need a console and su ability for some of it. Basically you want to run commands that will check the status of the ups. If it's not connected you'll want to look at the logs for errors.
    Also, is the FreePBX on the same LAN as your HS server or are you trying to connect over a WAN?
    Is there a router in between that would need port forwarding or a tunnel set up?

    https://community.freepbx.org/t/apc-...-refused/53037

    https://community.freepbx.org/t/how-...onnected/46555

    https://ubuntuforums.org/showthread.php?t=1778274

    Comment


      #3
      For network testing and take HS3 and the apcupsd out of the mix, you could try to telnet to 192.168.1.100 port 3553 including from the Linux FreePBX as a starting point just to see if the connection is accepted locally. The Telnet session is not do any interaction with the apcupsd server, just to ensure network connections can be established. I am not familiar with FreePBX on specifics regarding security/firewall setup.

      Comment


        #4
        Hello all,
        Firstly msinklair, thank you for the links, spent a happy evening getting totally confused but did try! On the up side I eventually after much reading found this command "apcaccess status" guess it speaks volumes so on the the right path. See attached. Still poking about! Restarted the freePBX machine to check the status and still "COMMLOST" more surfing I guess. Also now know the issue is with the FreePBX machine I think need to get status as "ONLINE" and see how it goes from there. Click image for larger version

Name:	Capture from SSH.PNG
Views:	425
Size:	64.0 KB
ID:	1312926
        Oh the machine runs on the same LAN as the HS machine. When the FreePBX is shut down I do get a notification e-mail.

        Peter

        Comment


          #5
          Looks like your on the right track with COMMLOST. Nothing will be able to get the status of the UPS if the server it is plugged into can't talk to it.

          Comment


            #6
            Good morning, thank you both for your replies, had about 4 hours getting this far so a little brain fade at present and need to take some time out. Tried Telnet as PCP suggested this also has connection refused. Slowly slowly wins the race a dear friend always tells me, sometimes I wish I could move faster than a snail! One of the links says
            # Apcupsd-devel internal configuration APCACCESS=/sbin/apcaccess ISCONFIGURED=yes Found this information and not sure what to do with it as cannot look to see if "ISCONFIGURED=yes" exists so a touch stuck again. Peter

            Comment


              #7
              [root@voipserver ~]# apctest


              2019-06-28 09:31:25 apctest 3.14.14 (31 May 2016) redhat
              Checking configuration ...
              sharenet.type = Network & ShareUPS Disabled
              cable.type = USB Cable
              mode.type = USB UPS Driver
              Setting up the port ...
              apctest FATAL ERROR in apctest.c at line 321
              Unable to open UPS device.
              If apcupsd or apctest is already running,
              please stop it and run this program again.
              apctest error termination completed
              [root@voipserver ~]# apcupsd stop
              [root@voipserver ~]# apctest

              Got this far and now stuck, not able to stop apcupsd even through it is turned off at the FreePBX GUI. FreePBX uses CentOS 7 so basic stuff for a guru, me well if I had hair I would pull it out! Tried service apcupsd stop, systemctl stop apcupsd but get same result for apctest.

              Peter

              Comment


                #8
                The result is just saying “if it is running”
                I don’t see that you’ve verified it is still running. It is saying it can’t open the device. That could just be a configuration error. It may be trying to talk to the wrong port or something.

                Try lsusb and see if it lists the UPS.
                Also look through the output of dmesg. It should show the driver and port that it assigns.

                Comment


                  #9
                  Hi msinklair, thanks for the info, was trying to stop apcupsd to run apctest but I appear not to be able to stop apcusd which I guess is me typing in the wrong thing in the wrong place.
                  Still trying to find the file with "ISCONFIGURED=yes" that is why I tried to stop apcupsd from running to use apctest.
                  Have tried systemctl apcupsd stop, apcupsd stop and service apcupsd stop but nothing comes back on the command line and always fails apctest.
                  Hope this is logical and makes sense!

                  Peter

                  Comment


                    #10
                    Originally posted by Pervez2602 View Post
                    Still trying to find the file with "ISCONFIGURED=yes" that is why I tried to stop apcupsd from running to use apctest.
                    Check
                    Code:
                    cat /etc/default/apcupsd
                    I recommend making a backup of the config file before you make any changes. sudo is needed if you are not root.
                    Code:
                    sudo cp /etc/default/apcupsd /etc/default/apcupsd.bak
                    What is the response when you run:
                    Code:
                    sudo systemctl stop apcupsd

                    Comment


                      #11
                      msinklair,
                      Many thanks for the commands to try, attached are the results, not sure what to think. The base system for FreePBX is based on CentOS version 7 I believe, if that helps.

                      Peter
                      Attached Files

                      Comment


                        #12
                        I'm sorry for the delayed response. I've been loaded up here at work. I wish I knew more about FreePBX and it's configuration to help more. I would probably go next to a FreePBX forum to learn more about how they implement UPS control. With what I am seeing it looks like it's not fully configured and running.

                        Comment


                          #13
                          Please msinklair, do not worry about the late response sorry to hear you are loaded up with work.
                          Did try " yum install https://sourceforge.net/projects/apc...atest/download.
                          Came back with the following.
                          Loading mirror speeds from cached hostfile
                          No package https://sourceforge.net/projects/apc...atest/download available.
                          Error: Nothing to do.

                          Not sure if this the right place for the the download so tried "yum update" but nothing for apcupsd.

                          Thanks once again for your help.

                          Peter

                          Comment


                            #14
                            You shouldn't have to specify a source. Only the package name should be needed. The package is available from the included sources.

                            What is the response of the following command:
                            Code:
                            yum list all | grep ups

                            Comment


                              #15
                              Ha! Got there in the end.

                              Should have read the reply on here first!
                              Thanks Peter
                              Attached Files

                              Comment

                              Working...
                              X