1-888-310-4540 (main) / 1-888-707-6150 (support) info@spkaa.com
Select Page

How to Monitor Your APC UPS Units – Part 1

Published by SPK Blog Post
on September 29, 2011

Picture your ideal company technological infrastructure. Servers to handle day to day tasks, servers to do engineering simulations, network equipment to handle communication, network-attached storage for your company critical data, and last but not least, uninterruptible power supplies otherwise known as UPS. It’s a given that you will probably have monitoring setup on your servers, network equipment and even your network attached storage, but what about the UPS units? These definitely can be monitored, but it requires a bit of setup. In this 2 part post series, I’ll be detailing how SPK and Associates does monitoring of APC-based UPS units as part of our infrastructure support services.

The first part of this process involves setting up the UPS unit to be monitored. APC UPS units are pretty much the industry standard for a small to medium-sized datacenter. They offer several different models based on your power and on-battery time needs. Most (if not all) of their units have the ability to be monitored through their serial or USB console interface. For this example, we’ll be using the Smart-UPS 3000VA which features both a serial and USB console interface. You’ll need to hook up this console interface to a server, preferably one that has one of its power supplies hooked into the UPS unit. At one of our client’s sites, we ensured that every server had at least one power supply hooked up to a UPS unit. We’ll get into the reasoning for this a bit later, but for now, make sure the server that is hosting the monitoring has a power supply hooked up to the UPS unit.

Next, we’ll need to download the heart of this project, APCUPSD. APC actually offers their own monitoring solution called PowerChute, but from my experience, it’s not very user-friendly and requires a lot of setup to work properly, especially with SNMP-based monitoring. PowerChute also is geared towards Windows and does not offer easy integration with existing monitoring systems. APCUPSD is multi-platform, ties into existing monitoring systems, and best of all, it’s free! For this example, we’ll be setting up APCUPSD on a Linux-based server.

After downloading the RPM package, I install with the rpm command:

rpm -ivh apcupsd.rpm

Next, we need to setup the daemon to monitor our UPS unit attached to a serial or USB port of the server. The configuration file is located in /etc/apcupsd/apcupsd.conf. For simplicity sake, here’s a very basic configuration file which uses the USB interface of the server and UPS unit.

  LOCKFILE /var/lock
  UPSCLASS standalone
  UPSMODE disable

Of course, these options can be modified and there are a lot more options to include in the configuration file, which I’ll get into more in Part 2 of this series. After editing the configuration file, you should have a simple, standalone UPS monitor daemon on your server. You can start it by running the start script, often found in /etc/init.d/apcupsd or by using the service apcupsd start command.

Once the daemon is up and running, you can query the UPS unit using the apctest program which allows you to view the status of the UPS unit as well as perform tests on it. This is a lot easier to do from a command line on Unix than a console interface on your laptop! Here’s a what the menu of apctest looks like:

Checking configuration ...
  Attached to driver: usb
  sharenet.type = DISABLE
  cable.type = USB_CABLE

  You are using a USB cable type, so I'm entering USB test mode
  mode.type = USB_UPS
  Setting up the port ...
  Creating the device lock file ...
  Hello, this is the apcupsd Cable Test program.
  This part of apctest is for testing USB UPSes.
  Getting UPS capabilities...SUCCESS

  Please select the function you want to perform.
  1) Test kill UPS power
  2) Perform self-test
  3) Read last self-test result
  4) Change battery date
  5) View battery date
  6) View manufacturing date
  7) Quit

As you can see, there’s some basic tests you can do as well as view the status of the UPS. The test kill UPS power option is nice for verifying that your UPS units are working as expected. If you can see this menu, you’re good to go on to the next step of setting up the monitoring, which I will detail in Part 2!

Have a good or bad experience with APCUPSD? Need UPS unit advice? Feel free to post a comment and I’ll be happy to help out!

Bradley Tinder
Systems Integrator, SPK and Associates

Latest White Papers

Three Trends Are Transforming The Service Desk

Three Trends Are Transforming The Service Desk

Your IT service desk is about to change. Find out what's shaping the future. Three factors — enterprise service management (ESM), collaboration, and intelligent service management — are driving the transformation of the service desk. To better meet customers’ needs...

Related Resources

Is The IT Department Really “Dead?”

Is The IT Department Really “Dead?”

“It’s Time to Get Rid of the IT Department.”  That was the title of an opinion piece recently published in the Wall Street Journal.  Provocative?  Sure.  My answer to this is not “yes,” but many of the author’s points are valid.  The Same Old IT Department? No, the IT...

How To Add More Disk Space To Your Redhat Server Without Reformatting

How To Add More Disk Space To Your Redhat Server Without Reformatting

(Originally published in 2012, updated January 2022.) One of the common tasks for any system administrator is managing disk space on a server. A common question is how to increase disk space on a linux system. I won't go into a boring lecture on why managing disk...

January 2022 vCAD feature updates

January 2022 vCAD feature updates

Happy New Year vCAD Users! It was a busy 2021 in terms of vCAD development and feature enhancements. We've been receiving lots of feedback regarding the platform, and we're assembling a roadmap for 2022 based on our users' needs. Here's what to expect in 2022:...