I recently bought a Belkin 600VA UPS (model F6S600auUSB) and here's what I had to do to setup the monitoring and automatic shutdown on Ubuntu 9.10 (karmic). (This procedure should work on recent versions of Debian as well.)

This UPS comes with a proprietary monitoring tool (written in Java) and you can find instructions to get this working on the Ubuntu forums, but I was looking for a free solution that would integrate well with the rest of the system. So after reading this blog post I decided to go with the Network UPS Tools project:

$ apt-get install nut

Once the nut package is installed, I edited /etc/nut/nut.conf to set:

MODE=standalone

and created the following files:

$ vim /nut/ups.conf  
  
[belkinusb]  
driver = megatec_usb  
port = auto  
desc = "Belkin UPS, USB interface"  
  
$ vim /etc/nut/upsd.conf  
  
# MAXAGE 15  
# LISTEN 127.0.0.1 3493  
# MAXCONN 1024  
  
$ vim /etc/nut/upsd.users  
  
[local_mon]  
password = MYPASSWORD  
upsmon master  
  
$ vim /etc/nut/upsmon.conf  
  
MONITOR belkinusb@localhost 1 local_mon MYPASSWORD master  
POWERDOWNFLAG /etc/killpower  
SHUTDOWNCMD "/sbin/shutdown -h +0"  

Then all that was left to do was to restart nut:

$ /etc/init.d/nut restart

and check syslog for any errors:

$ tail /var/log/syslog

While nut is running, it will monitor the UPS and report any power problems to syslog. Once the UPS is running on battery, it will make sure the computer is safely shut down before power runs out.

Hopefully future versions of GNOME Power Manager will be able to integrate with nut directly and display battery information through its notification icon.

sadly, GPM (in fact UPower) will never talk to NUT directly. This was the way I was investigating with the nut-hal-drivers, but Richard (Hughes) doesn't want such bridges. At least, he thinks that UPower should only support standard units (the one supported by NUT's usbhid-ups driver). So you're stuck with NUT... For the GUI part, you should take a look at NUT Monitor (integrated in NUT, but still not packaged): http://www.lestat.st/informatique/projets/nut-monitor-en
The last release includes a notification icon.

Arnaud
Linux / Unix Expert R&D - Eaton - http://www.eaton.com/mgeops
Network UPS Tools (NUT) Project Leader - http://www.networkupstools.org/
Debian Developer - http://www.debian.org
Free Software Developer - http://arnaud.quette.free.fr/

Comment by Arnaud
I don't think that GPM can't talk to the nut directly, as using the mentioned process my UPS was working fine with U Ubuntu.
Comment by standby power

Did you ever get this working on Lucid?

https://bugs.launchpad.net/ubuntu/+source/nut/+bug/578200

I'm trying to get my Belkin USB UPS (model f6s400auusb) working with Lucid NUT and having no success.

Comment by Anonymous

I only got it to work on Lucid using the Karmic package, which I have ported to Lucid and put in my PPA:

https://launchpad.net/~fmarier/+archive/ppa

Comment by Fran├žois
NUT Karmic > Lucid Port

Hi, I was using the Karmic > Lucid port of NUT which helped my server recognize my Belkin UPS.

I notice the NUT package is no longer available in your PPA. Do you know where I can find it? (or was the megatec_usb issue finally fixed in Lucid?)

Do you know if the Belkin UPS works ok with Precise?

Thanks in advance!

Comment by Anonymous
Re: NUT Karmic > Lucid Port

On Precise, that UPS works out of the box, but it's now using the blazer_usb driver.

Here's my new /etc/nut/ups.conf:

[belkinusb]
    driver = blazer_usb
    port = auto
    desc = "Belkin UPS, USB interface"
Comment by fmarier