How to Verify APC UPS Is Actually Connected

Hi,

I have recently added a UPS to my FREEPBX 13 implementation. I wanted to ask the experts in FreePBX about how I would be able to verify that the FREEPBX server sees the APC UPS and will orderly shutdown the server when the battery runs low.

When I run: cat /proc/bus/usb/devices, I get:

T: Bus=01 Lev=02 Prnt=02 Port=04 Cnt=01 Dev#= 5 Spd=1.5 MxCh= 0
D: Ver= 1.10 Cls=00(>ifc ) Sub=00 Prot=00 MxPS= 8 #Cfgs= 1
P: Vendor=051d ProdID=0002 Rev= 0.06
S: Manufacturer=American Power Conversion
S: Product=Smart-UPS 2200 XL FW:690.17.D USB FW:7.3
S: SerialNumber=JS0751005068
C:* #Ifs= 1 Cfg#= 1 Atr=e0 MxPwr= 30mA
I:* If#= 0 Alt= 0 #EPs= 1 Cls=03(HID ) Sub=00 Prot=00 Driver=usbhid
E: Ad=81(I) Atr=03(Int.) MxPS= 6 Ivl=100ms

This means that the server has detected the APC UPC, right?

Then, on the Web interface, Admin --> Sysadmin --> UPS Server, under Device/Port, I typed ‘/dev/usb/hiddev0’,

I also verified via SSH session to the server that the above indeed exists

To verify more: I typed:
‘ps aux | grep acupad’ and got the following:
root 15892 0.0 0.0 103244 892 pts/0 S+ 16:26 0:00 grep acupad

Interestingly, when type:

[[email protected] ~]# /etc/rc.d/init.d/apcupsd stop
Shutting down UPS monitoring: [FAILED]
[[email protected] ~]# /etc/rc.d/init.d/apcupsd start
Starting UPS monitoring: [ OK ]
[[email protected] ~]# /etc/rc.d/init.d/apcupsd stop
Shutting down UPS monitoring: [OK]
[[email protected] ~]# /etc/rc.d/init.d/apcupsd start
Starting UPS monitoring: [ OK ]

All this should tell me that the UPC is setup properly even though, I got a FAILED result when I stopped on the apcupcd daemon. This happens every time I restart the server, which I would prefer that it started property automatically.

Anyway, assuming that everything is working, when I pulled the power from the APC UPS, I never get an email notification sent to me. I did set the email address though.

If someone knows what I’m doing wrong, please tell me. :slight_smile:

Thanks!!

RC

The first FAILED is not an error per-se, because if the service was not running before, it can’t be stopped…

You can check the status of an APC UPS with the following command, provided the daemon has been correctly configured: apcaccess status

If you get a long list of data, then your ups is correctly connected.

Thanks for the command help.

Just to be sure, sure. it is OK.

[[email protected] ~]# apcaccess status
APC : 001,018,0464
DATE : 2017-12-27 22:50:03 +0000
HOSTNAME : freepbx.sangoma.local
VERSION : 3.14.14 (31 May 2016) redhat
UPSNAME : FreePBX UPS
CABLE : Custom Cable Smart
DRIVER : APC Smart UPS (any)
UPSMODE : Stand Alone
STARTTIME: 2017-12-27 22:49:59 +0000
STATUS :
MBATTCHG : 5 Percent
MINTIMEL : 2 Minutes
MAXTIME : 0 Seconds
NUMXFERS : 0
TONBATT : 0 Seconds
CUMONBATT: 0 Seconds
XOFFBATT : N/A
STATFLAG : 0x05000000
END APC : 2017-12-27 22:50:03 +0000

Does it mean that my UPS is correctly setup?

Also should the email address be more explicit than [email protected] so I can get email notifications?

I think your configuration is not correct, because you are not getting all the information that you should.

You should be getting something like this

[[email protected] ~]# apcaccess status
APC : 001,051,1305
DATE : 2017-12-28 07:51:24 -0300
HOSTNAME : freepbx
VERSION : 3.14.10 (13 September 2011) redhat
UPSNAME : SMARTUPS1000
CABLE : Custom Cable Smart
DRIVER : APC Smart UPS (any)
UPSMODE : Stand Alone
STARTTIME: 2017-12-20 09:18:40 -0300
MODEL : Smart-UPS 1000
STATUS : ONLINE
LINEV : 230.4 Volts
LOADPCT : 10.4 Percent Load Capacity
BCHARGE : 100.0 Percent
TIMELEFT : 102.0 Minutes
MBATTCHG : 5 Percent
MINTIMEL : 5 Minutes
MAXTIME : 0 Seconds
MAXLINEV : 231.8 Volts
MINLINEV : 221.7 Volts
OUTPUTV : 230.4 Volts
SENSE : Medium
DWAKE : 000 Seconds
DSHUTD : 090 Seconds
DLOWBATT : 02 Minutes
LOTRANS : 208.0 Volts
HITRANS : 253.0 Volts
RETPCT : 000.0 Percent
ITEMP : 33.3 C Internal
ALARMDEL : 5 seconds
BATTV : 27.4 Volts
LINEFREQ : 50.0 Hz
LASTXFER : Unacceptable line voltage changes
NUMXFERS : 5
XONBATT : 2017-12-27 18:13:35 -0300
TONBATT : 0 seconds
CUMONBATT: 834 seconds
XOFFBATT : 2017-12-27 18:13:41 -0300
SELFTEST : NO
STESTI : 336
STATFLAG : 0x07000008 Status Flag
REG1 : 0x00 Register 1
REG2 : 0x00 Register 2
REG3 : 0x00 Register 3
MANDATE : 12/15/12
SERIALNO : AS1234567890
BATTDATE : 12/15/12
NOMOUTV : 230 Volts
NOMBATTV : 24.0 Volts
EXTBATTS : 0
FIRMWARE : 652.19.I
END APC : 2017-12-28 07:51:44 -0300

Would it be possible that my UPS can’t give that level of detail?

The model is APC Smart-UPS 2200XL.

If it’s even upgradeable??

All of the settings you got back are server settings from the apcupsd running on the server. It’s up and seems to be running, but doesn’t appear to have a UPS to query. Most likely, your COM port setting is incorrect.

Thanks for the feedback Dave Burgess. Would you show me how to change the com listen port so Freepbx get the right data?

There should be a apcupsd section in the Management Interface. If you aren’t using the System Admin module, there should also be a apcupsd.conf file in the /etc directory somewhere.

Guys,

I’m excited to report that I got the same report going as arielgrin showed me. I decided to be curious. I changed the UPS Type from “APC Smart” to “USB” (i.e. mode.type = USB UPS Driver). And it turned on. I figured that if the APC UPS works with my FreeNAS, then it must be a driver issue. Perhaps it was a mislabeling in FreePBX 14?

But, now I have another concern though. How come the LOADPCT is showing 0.0? In fact, it is confirmed that the front LOAD LEDs don’t light light up. However, I have 2 server attached to the UPS. I suppose it is unlikely that the load would be 0%. Anyone?

[[email protected] ~]# apcaccess status
APC : 001,043,1036
DATE : 2017-12-30 03:47:00 +0000
HOSTNAME : freepbx.sangoma.local
VERSION : 3.14.14 (31 May 2016) redhat
UPSNAME : FreePBX UPS
CABLE : USB Cable
DRIVER : USB UPS Driver
UPSMODE : Stand Alone
STARTTIME: 2017-12-30 03:46:52 +0000
MODEL : Smart-UPS 2200 XL
STATUS : ONLINE
LINEV : 123.1 Volts
LOADPCT : 3.9 Percent
BCHARGE : 100.0 Percent
TIMELEFT : 203.0 Minutes
MBATTCHG : 5 Percent
MINTIMEL : 2 Minutes
MAXTIME : 0 Seconds
OUTPUTV : 123.1 Volts
SENSE : High
DWAKE : -1 Seconds
DSHUTD : 180 Seconds
LOTRANS : 106.0 Volts
HITRANS : 127.0 Volts
RETPCT : 15.0 Percent
ITEMP : 21.6 C
ALARMDEL : 30 Seconds
BATTV : 55.4 Volts
LINEFREQ : 60.0 Hz
LASTXFER : Automatic or explicit self test
NUMXFERS : 0
TONBATT : 0 Seconds
CUMONBATT: 0 Seconds
XOFFBATT : N/A
SELFTEST : NO
STESTI : 14 days
STATFLAG : 0x05000008
MANDATE : 2007-12-18
SERIALNO : JS0751005068
BATTDATE : 2017-12-18
NOMOUTV : 120 Volts
NOMBATTV : 48.0 Volts
FIRMWARE : 690.17.D USB FW:7.3
END APC : 2017-12-30 03:47:08 +0000

I suppose that the servers are plugged into the Battery side powered plugs and not into the Surge Suppressor only plugs. Not doing that would cause a 0% load on the battery for sure…

Yup. No surge/power bar being used. The load is still under 10% or LOADPCT : 3.9 Percent. I would like. to run a calibration on it but ‘apctest’ won’t run when the UPS load is under 10% load. I suppose I could plug a halogen light to it or anyone want to suggest other option?

I see load at 3,9%, why are you assuming it is wrong? If the model is 2200, your UPS is capable to serve a 2200 VA load. The calibration function is not to adjust load, but to adjust battery time. The ups “thinks” it can run for X minutes on battery and uses that value for different features inside the software, but if you see that the actual run time differs greatly, you run the calibration process so the ups can recognize this difference and adjust its parameters accordingly.

I get a

Error contacting apcupsd @ localhost:3551: Connection refused

Shows the APC connected:

lsusb
Bus 001 Device 002: ID 051d:0003 American Power Conversion UPS

Here’s the config:

UPSNAME APC
UPSCABLE usb
UPSTYPE usb
DEVICE /dev/usb/hiddev002
ONBATTERYDELAY 10
MINUTES 2
TIMEOUT 0
LOCKFILE /var/lock
BATTERYLEVEL 5
SCRIPTDIR /etc/apcupsd
PWRFAILDIR /etc/apcupsd
NOLOGINDIR /etc
ANNOY 300
ANNOYDELAY 60
NOLOGON disable
KILLDELAY 0
NETSERVER on
NISIP 0.0.0.0
NISPORT 3551
EVENTSFILE /var/log/apcupsd.events
EVENTSFILEMAX 10
UPSCLASS standalone
UPSMODE disable
STATTIME 0
STATFILE /var/log/apcupsd.status
LOGSTATS off
DATATIME 0

I restarted twice. The process is running. Anything I’m missing?

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.