Monitoring an APC UPS with a Raspberry Pi

If you're looking to monitor an APC USP (many of the latest models have a USB port for monitoring) this is the best walk-through I've found:

Thanks to Kenneth Burgener for his great write up.

Being able to query the UPS or perform actions based on Power Off/Power On state is fantastic.

$ apcaccess 
CABLE    : USB Cable
UPSMODE  : Stand Alone
STARTTIME: 2016-03-09 09:10:19 -0700  
MODEL    : Back-UPS ES 550G 
LINEV    : 122.0 Volts
LOADPCT  : 6.0 Percent
BCHARGE  : 100.0 Percent
TIMELEFT : 107.5 Minutes
MBATTCHG : 5 Percent
MINTIMEL : 3 Minutes
MAXTIME  : 0 Seconds
SENSE    : Medium
LOTRANS  : 92.0 Volts
HITRANS  : 139.0 Volts
ALARMDEL : 30 Seconds
BATTV    : 13.5 Volts
LASTXFER : Automatic or explicit self test
XONBATT  : 2016-04-04 06:36:26 -0700  
TONBATT  : 0 Seconds
CUMONBATT: 16 Seconds
XOFFBATT : 2016-04-04 06:36:34 -0700  
LASTSTEST: 2016-04-04 06:36:26 -0700  
STATFLAG : 0x05000008
SERIALNO : 4B1414P00197  
BATTDATE : 2014-03-31
NOMINV   : 120 Volts
NOMBATTV : 12.0 Volts
END APC  : 2016-04-10 09:13:05 -0700

Graphing Data With SNMP and MRTG


  • Had to install the extra MIBs with ``
  • Data is always in integer format. If you want decimals you have to use Factor
  • Watch your MaxBytes! If a value goes above that, MRGT will assume it was an error and either make it a 0 or not display it at all.
  • How to check an OID with SNMP: snmpget -v 2c localhost -c public .
  • I put the entire flow of Updating MRTGs into a single script to avoid race conditions /usr/local/bin/update_values_and_run_mrtg
  • APCUPSD Getting Started:
  • MRTG is writing to /www/mrgt on the Pi, but NGINX just points to that as the root.

Helpful Links:

Cox Gigablast Install

Around November 2015 I got a letter in the mail from Cox Communications, my ISP. “Gigablast is coming soon!” it said, along with a warning that service might be interrupted from time to time over the next few weeks as they install infrastructure.

Gigablast is Cox’s Fiber To The Home (FTTH) gigabit internet offering.

Needless to say, I was excited. I was already on their highest-tier plan (300Mbps down, 30Mbps up), but faster always seems better. Why? Because why not?

I was also very interested in the rollout because I wasn’t familiar with much of the technology of optical networks. This was a chance to observe up-close how it all works. And since a lot of the technology was going underground, there would be a limited window of opportunity to observe it, ever.

With that in mind I did my best to take photos, talk to workers, and document as much of the process as I could. I’ve documented the process here in roughly chronological order, and I’ve done my best to gather the details necessary to get a good grip on how the Cox Fiber network is physically setup in neighborhoods with Gigablast.

If you know details that I don’t, or have corrections, I’d love to know.

Step 1: Digging the holes for the POSs and Digging some trenches for new conduit.

The first sign of activity in the neighborhood was the digging of holes to install the POSs. A Passive Optical Splitter is the point in an optical network where the incoming “Main” fiber line is split up into a single line for each house.

Workers dig a hole for an POS
A utility box is prepared to be placed into the hole previous dug. The POS will sit on this utility box, fed by the Fiber in conduit beneath it.

Step 2: Pulling Conduit and Pulling Fiber to the Pedestals

While the POSs are being prepared, workers are pulling conduit through the existing coaxial conduit. Yes, that's right, they're pulling conduit through existing conduit. You can see the new, bright orange conduit being pulled within the existing gray conduit. Once that has been pulled, the fiber is pulled within the orange conduit. I presume this is because the stresses that the orange flexible conduit can endure far exceed what they are willing to put the fiber through.

New conduit (orange) being pulled near the existing coaxial amplifier, and the new utility box that the POS will be placed on.
Closeup view of new conduit (orange) near existing amplifier and the new POS container.
New conduit (orange) being pulled to the pedestal in front of a house. Once the new conduit is in place, fiber was pulled through the new (orange) conduit.
Inside of the underground utility box where the POS will be placed.

Step 3: Installation of the POS

Once the conduit is in place the POS is installed adopt the utility box that was placed in the ground. So far all of these are right next to existing amplifiers in the coaxial network. This seems like a logical way to structure the network, but by no means would it be mandatory.

Once the POS is installed, the fiber was pulled into the cabinet and terminated.

POS atop its utility box. Fiber is fed from beneath.
Closer view of Cox POS.

Step 4: Termination of the Fiber at the Pedestals

This was one of the most confusing parts to me before I watched the install take place. I couldn't figure out how the fibers were routed through the pedestals. Were there optical switches in each pedestal, linking the fibers to main network? Were there splices everywhere?

Turns out the answer is super simple.

The cable that's pulled from the POS is then looped through each pedestal, with about 12 or 15 feet of coiled slack left in each pedestal.

The trick is that this cable actually has 96 glass fibers in it, enough for 96 houses.

Example of multi-fiber cable.

Here's how they do this at each pedestal:

  1. Pull off the out layer(s) of insulation, exposing the "tubes". (Each "tube" contains 12 optical fibers, each in its own protective jacket).
  2. Pull off the out layer(s) of the tube(s) that need to be access at this pedestal.
  3. Now the individual fibers are visible, in their protective jackets.
  4. Cut the fibers that need to be terminated at this pedestal.
  5. Terminate the fibers with standard SC or LC (etc) style connectors and install in place in the pedestal.
  6. Carefully coil the cable back into its harness and close up the pedestal.

So the trick I failed to see is that, the fibers that are terminated at this pedestal remain in the cable bundle, they're just unusable beyond this point.

Here's a diagram representing this:

The path of the fibers in the main cable bundle, from pedestal to pedestal.

Step 5: Home Install

The Home install is very straighforward. There are only a few steps:

  1. Pull Fiber and a new piece of Coax from the Pedestal to the Home through the existing conduit.
  2. Terminate the Fiber inside the home and connect to an ONT, installed in the home.
  3. Terminate the Fiber at the pedestal and connect to incoming Fiber.
  4. Provision the ONT (Mine is an Alcatel-Lucent G-010G-A).
  5. Do a speed test.
Pulling new Fiber and RG-6 from the pedestal to my house.
This box, on the wall in my garage, splices the rigid fiber from the conduit (black) to the flexible cable that was run to the ONT in my house (beige).
Closeup of the flexible fiber.
Terminating the flexible fiber.
Terminating the flexible fiber.
The tool used to splice the connectors onto the ends of the fiber, a Swift F1.
Some of the many layers of a fiber optic cable.

Final Notes

  • A new piece of Coax was pulled at the same time. At least in my neighborhood TV isn't going to be on Fiber any time soon. The old Coax was used to do the pull of the new cables.
  • A box was installed in my garage were the rigid fiber from the conduit was spliced to much more flexible fiber that was then run to the ONT.
  • The ONT was required to be indoors. The garage was not sufficient.
  • I was able to keep using my existing router (TP-Link Archer C7). The techs recognized it and gave me no trouble leaving it in place.
  • The techs noted that Gigablast is not overclocked the way the rest of their internet products are. If you get 950Mbps, be happy. Don't expect over 1000. Also, good luck finding a switch or router that'll go over 1Gbps for any consumer price at this point, so you wouldn't notice anyway.
  • The connectors were spliced onto the ends of the fiber, the fiber wasn't hand-fed and terminated through the connectors.
  • The installation was 2 hours from the time the first tech showed up until I was back online.
  • The installation process was supposed to take multiple days (pull fiber one day, come back and install ONT another), but the tech offered to pull the fiber and do it all in one go. Of course I took him up on the offer.
One of the many speed tests I have run since the install. The max speed I've seen is about 960Mbps. I'm satisfied.

If you know details that I don’t, or have corrections, I’d love to know.


  1. An earlier version of this article mistakenly referred to the POS as an OLT. The OLT exists in the CO or PoP, not in the neighborhood.
  2. An earlier version of this article mistakenly referred to the coax being pulled as "RG-8". It is, in fact, RG-6.
  3. An earlier version of this article referred to coaxial "Nodes". These are, in fact, Amplifiers.