Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Use a third-party APC UPS management tool for more control UNIX
My APC UPS beeps whenever the power fails. If this happens at night, the beep is loud enough to wake people. The beep can be disabled by software in Windows, but not in the Mac version of PowerChute Personal Edition. The Mac version provides features that Mac OS X already provides: shutdown timers for any UPS connected via USB.

I stumbled across the open source Unix app Apcupsd which gives me all the features I want from the Windows version of PowerChute: beep settings, battery change dates, and so forth. Furthermore, it can send email notifications for significant events. As someone who runs an old G4 as a home server, this is very nice to know.

After downloading and installing Apcupsd is installed, run this command from Terminal: sudo /sbin/apctest. This will display a simple text-based menu, and it's self-explanatory. If you get an error message that reads Cannot find UPS device..., it could be because:
  1. Only one tool can query the UPS, and the background monitoring process is running, so stop it with sudo /Library/StartupItems/apcupsd/apcupsd stop, then try again.
  2. The software might only work with PowerPC Macs at this point. It works perfectly on my G4, but not on my ICBM (Intel Chip Based Mac).
[robg adds: I haven't tested this app.]
    •    
  • Currently 4.25 / 5
  You rated: 3 / 5 (24 votes cast)
 
[31,160 views]  

Use a third-party APC UPS management tool for more control | 20 comments | Create New Account
Click here to return to the 'Use a third-party APC UPS management tool for more control' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Use a third-party APC UPS management tool for more control
Authored by: kyngchaos on Mar 18, '10 09:27:44AM

Hm, I've been dreading the battery and power failure beeps with my new APC UPSs. But I don't think the consumer models, I have BackUps LS and CS, have the option to control the alert sounds. Previous models I had were BackUps Pros, and I used the Windoze Powerchute in virtualization to turn off the sounds. I did not see any alert sound options for the CS and LS.

A warning about the installer (I like to poke inside strange new installers, especially from open source): it installs things in system locations, /sbin, /etc & /usr/share, when they should be installed in /usr/local/*. Stuff in system locations has the potential to be removed by Apple updaters, and it's good to have 3rd-party software outside the system, especially for ease of uninstalling.



[ Reply to This | # ]
Use a third-party APC UPS management tool for more control
Authored by: slb on Mar 18, '10 12:12:29PM

Why bother? The built-in software (Energy Saver) is good enough.
Never needed anything beyond that. If you wanted, I'm sure AppleScript and/or Automator could be added for more needs.



[ Reply to This | # ]
Use a third-party APC UPS management tool for more control
Authored by: sjk on Mar 18, '10 02:08:56PM

> Why bother?

Maybe for the reason described in the first paragraph of colinng's hint? I've used apcupsd precisely for that purpose.

> The built-in software (Energy Saver) is good enough. Never needed anything beyond that.

Good (enough) for you.

> If you wanted, I'm sure AppleScript and/or Automator could be added for more needs.

Do you a specific method to suggest for disabling APC UPS beeps instead of simply a think-you-know-better response?

Thanks for writing up this hint, colinng. Hopefully a few folks will appreciate it.



[ Reply to This | # ]
Use a third-party APC UPS management tool for more control
Authored by: sjk on Mar 18, '10 02:11:09PM

> Thanks for writing up this hint, colinng. Hopefully a few folks will appreciate it.

D'oh! I just accidentally gave it a 1- instead of 5-star voteÖ sorry.



[ Reply to This | # ]
Use a third-party APC UPS management tool for more control
Authored by: Zeitkind on Mar 18, '10 04:52:35PM

Does the built-in monitor more than one UPS? Does it send email notifications?



[ Reply to This | # ]
Use a third-party APC UPS management tool for more control
Authored by: dfbills on Mar 18, '10 01:20:33PM

What a strange comment. Clearly there is value in silencing the beeping noise- I'm going to have mine mute during the night.

---
-d



[ Reply to This | # ]
Use a third-party APC UPS management tool for more control
Authored by: sjk on Mar 19, '10 12:51:02PM
I'm going to have mine mute during the night.
Minimally, I think that would require a script to interact with apctest to enable/disable beeping using the "6) View/Change alarm behavior" item (shown in the list thwaite posted) or similar. Then cron (for instance) could be used to run that script, with an enable or disable option, at desired intervals.

Setting BEEPSTATE to 'N' (or other values) in apcupsd.conf doesn't apparent to have any effect on the alarm, at least not that I could determine with some brief testing this morning.

I always realize there's a power outage when I'm on/near my home systems and awake to possibly take action. Plus now there's less intrusive Growl notification. And I normally don't want/need to care about outages while asleep. So, I used apctest to change the alarm behavior to unconditionally never beep since there's no reason for it in this context.

[ Reply to This | # ]
Use a third-party APC UPS management tool for more control
Authored by: thwaite on Mar 18, '10 02:00:42PM

This is a useful utility, and the authorís reasons are good: APC software doesnít give full control even for beeps, much less for network notifications (tho I donít use these). Donít expect AppleScript or Automator would expand it.

More usefully, Iíll report:

* the utility works fine on my ďICBMĒ (heh), a late Ď09 iMac. I finally got a UPS just for it, APCís BE750G and was annoyed by APCís limited controls, tho happy that OSX itself does the basic controls nicely (aside: regret that I read the macintouch writer Robert Mohnís recommendation for iDowellís iBox and iPack UPS's only later, tho they cost at least twice as much: macintouch.com/reviews/idowell )

* the installer for apcusd is simple, but doesnít warn that a reboot will be required to complete the install. It does open TextEdit to display two windows, one with the apcupsd.conf file, the other with a notice that you have to edit this configuration file for your specific UPS and should do this before agreeing to the installer's request to reboot. You might be able to skip this step but should read through the config file now to ensure its default settings match your situation. And youíll need to later edit this .conf file if you want to add network reporting, which canít be set up using only the simple CLI menu.

* This config file is at /private/etc/apcupsd/apcupsd.conf. But its permissions are read-only so you can't save changes using TextEdit, which doesn't allow superuser override. Solution: use the Terminal (which you'll have to use anyway for their CLI menu). Navigate to the directory and sudo-launch your favorite CLI text editor (vim, pico, etc).

Having a little Unix knowledge, I lived dangerously and edited various parameters as suggested by their comments. Recall that lines prefaced by # are comments, often useful example settings; but for functional parameter specifications you must remove the #.

* After rebooting, the CLI menu allows for the following choices:
1) Test kill UPS power
2) Perform self-test
3) Read last self-test result
4) View/Change battery date
5) View manufacturing date
6) View/Change alarm behavior
7) View/Change sensitivity
8) View/Change low transfer voltage
9) View/Change high transfer voltage
10) Perform battery calibration
11) Test alarm
12) View/Change self-test interval
Q) Quit

Iíve not yet tried #1 or #10, but the others work as expected.



[ Reply to This | # ]
Use a third-party APC UPS management tool for more control
Authored by: jollyroger on Mar 18, '10 02:24:11PM

Another great feature of apcupsd is that you can install it on more than one machine, and each can communicate with the other. If you have several machines that are powered from the same battery, you can set up apcupsd to shut all of the machines down gracefully before the battery runs out. You can also do lots of other cool things, limited only by your imagination.

For instance, I have two Mac minis in my server closet, and when power goes out and the battery is almost out of juice, on each machine, apcupsd quits all user-space applications (with an Applescript run through the 'osascript' command-line tool, schedules a 'wakeorpoweron' event with the power manager so the machine will reboot once power is restored, and then shuts the system down.

---
-monoclast



[ Reply to This | # ]
Use a third-party APC UPS management tool for more control
Authored by: jollyroger on Mar 18, '10 02:29:33PM

The software also works fine with Intel-based Macs.

---
-monoclast



[ Reply to This | # ]
Use a third-party APC UPS management tool for more control
Authored by: jelockwood on Mar 19, '10 03:57:03AM

APC make good UPSs but their Mac software stinks (to put it mildly).

While their wilful neglect of Macs in terms of software provision might have been justified the many years ago when the Mac market was in serious decline, the massive increase in Mac share in more recent years has led other more sensible companies to resume providing decent Mac support. Even Microsoft have improved their Mac support :)

People might also be interested in the open-source NUTS project (Network Ups ToolS), see http://www.networkupstools.org/ and http://boxster.ghz.cc/projects/nut/wiki/NutOnMacOSX this will work with other makes as well as APC.



[ Reply to This | # ]
Use a third-party APC UPS management tool for more control
Authored by: Loh-Q on Mar 19, '10 04:32:34AM

Not working in 10.6.2 on an Intel 2.66Ghz 8-core.
I ran "sudo /Library/StartupItems/apcupsd/apcupsd stop"
I still get this:

2010-03-19 04:28:11 apctest 3.14.8 (16 January 2010) darwin
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 ...
apctest FATAL ERROR in generic-usb.c at line 636
Cannot find UPS device --
For a link to detailed USB trouble shooting information,
please see <http://www.apcupsd.com/support.html>.
apctest error termination completed

Any ideas?

---
Mac muzak maniac



[ Reply to This | # ]
Use a third-party APC UPS management tool for more control
Authored by: sjk on Mar 19, '10 12:22:19PM

- Was there any output from running:

sudo /Library/StartupItems/apcupsd/apcupsd stop

If successful, it should be:

Shutting down UPS monitoring

- Try running this:

ps acx | grep apcupsd

No output if apcupsd isn't running. Otherwise, it'll look similar to:

105 ?? Ss 1:10.01 apcupsd

What to suggest next depends on the results.



[ Reply to This | # ]
Use a third-party APC UPS management tool for more control
Authored by: thwaite on Mar 19, '10 12:32:40PM

Are you running your intel chip with OSX's 64-bit kernel? I get your error msg with 64bit though it works fine for me with 32-bit. Hmph.

My system log shows this during the boot:

Mar 19 12:15:04 RG-iMac com.apple.SystemStarter[47]: Starting UPS monitoring
Mar 19 12:15:04 RG-iMac apcupsd[96]: Valid lock file for pid=86, but not ours pid=96
Mar 19 12:15:05 RG-iMac configd[15]: network configuration changed.
Mar 19 12:15:05 RG-iMac apcupsd[97]: apcupsd FATAL ERROR in generic-usb.c at line 636...
Mar 19 12:15:05 RG-iMac apcupsd[97]: Valid lock file for pid=86, but not ours pid=97
Mar 19 12:15:05 RG-iMac apcupsd[97]: apcupsd error shutdown completed

I've not time to follow up on this just now.



[ Reply to This | # ]
Use a third-party APC UPS management tool for more control
Authored by: Loh-Q on Mar 19, '10 07:47:23PM

Yep, running in 64-bit...
Ah well :-)

---
Mac muzak maniac



[ Reply to This | # ]
GUI interface
Authored by: ambrose on Mar 20, '10 07:14:27AM

Since I didn't see it mentioned in the other posts, I thought I'd add that the apcupsd installer places an application--apcupsd.app--in the /Applications folder.

When launched, no dock icon or interface window will open. Instead, your only indication that it is running is the appearance in the menubar of a generic UPS icon. Should a connection failure occur, the icon will acquire a superimposed red '?', and hovering the mouse over the icon will reveal the tooltip "NETWORK ERROR". Clicking on the icon reveals the available interface options.

The GUI's available functions are pretty much limited to status and event monitoring, and provide no equivalent for issuing the CLI commands. It is handy, though, in that it provides the ability, via the preferences settings, to add additional monitors for multiple networked devices, and to turn Growl notifications on and off for them.

Just in case someone else is having the same difficulties I encountered, take a look at your UPS cases.

The battery backup I couldn't get apcupsd to find--among the several it did find--was labeled "Belkin."

D'Oh! <forehead slap>



[ Reply to This | # ]
GUI interface
Authored by: jelockwood on Mar 22, '10 07:37:09AM

The NUTS software I referred to in a previous comment, does support various Belkin models as well as APC models (and others).

See http://www.networkupstools.org/compat/stable.html



[ Reply to This | # ]
Use a third-party APC UPS management tool for more control
Authored by: Warnerbros on May 27, '10 12:34:10AM
My APC UPS beeps whenever the power fails.Tech Web, If this happens at night, the beep is loud enough to wake people. The beep can be disabled by software in Windows,Cell Phones, but not in the Mac version of PowerChute Personal Edition. The Mac version provides features that Mac OS X already provides: shutdown timers for any UPS connected via USB.Desktop PCs

[ Reply to This | # ]
Use a third-party APC UPS management tool for more control
Authored by: newooser on Jun 23, '10 08:51:46PM

I don't think this utility is ready for primetime. I installed it and decided to uninstall it. Dragged it to the trash, found the startup item, dragged that to the trash, emptied the trash, and rebooted. Now my UPS no longer shows up in Energy Saver under System Preferences!

It says in the documentation that a dummy kernel extension is installed to prevent OS X from recognizing the UPS, but darned if I can find it. Help, please!



[ Reply to This | # ]
Use a third-party APC UPS management tool for more control
Authored by: sneadm on Aug 08, '10 07:20:22AM

Just had the same problem. You need to go to terminal and run sudo /sbin/apcupsd-uninstall. This will get rid of all the related code. Reboot and your APC should show up in energy saver again.



[ Reply to This | # ]