HOWTO: Set Up NUT, the Network UPS Tools
Ted Felix
Note: This page is incomplete. I will remove this when I have successfully completed configuring my UPS with NUT.
The power goes out all the time here, so I decided to take a shot at setting up a UPS and having the server shutdown when the power goes out. This turned out to be pretty difficult as the “Network UPS Tools” are a bit of a pain to set up. Here are my notes so far…
UPS’s from Dell, MGE, and Eaton appear to be fully supported by NUT. Others should work, but if you can find one of those, it’s guaranteed to work.
The ubuntu package is “nut”:
$ sudo apt-get install nutNUT is very painful to configure. Follow these steps carefully. The blasterspike.it link appears to be the best.
Identify UPS and Driver
Identify UPS. lsusb works for USB connected UPS’s. In my case, I have a “Cyber Power Systems CP1500AVR USB”.
$ lsusb ... Bus 001 Device 003: ID 0764:0501 Cyber Power System, Inc. CP1500 AVR UPSCheck the NUT Hardware Compatibility List to figure out which driver will work for your UPS. For my USB UPS, the correct driver is “usbhid-ups”.
Update ups.conf and Test
Add a new section to /etc/nut/ups.conf for the ups. I picked “serverups” for the name. “ups” would probably be better for a simple setup like mine.
[serverups] driver = usbhid-ups port = auto desc = "Server UPS"- Install udev rules for usbhid-ups (see man usbhid-ups INSTALLATION) sudo cp /lib/udev/rules.d/52-nut-usbups.rules /etc/udev/rules.d/ reboot - Set up /var/run/nut per http://www.blasterspike.it/2011/03/28/how-to-install-nut-on-ubuntu-10-10-maverick-meerkat/ sudo mkdir /var/run/nut sudo chown root:nut /var/run/nut sudo chmod 770 /var/run/nut - Test the ups.conf file: sudo upsdrvctl start Normal output: Network UPS Tools - UPS driver controller 2.6.3 Network UPS Tools - Generic HID driver 0.35 (2.6.3) USB communication driver 0.31 Using subdriver: CyberPower HID 0.3upsd
- Launch upsd sudo upsd Normal output: Network UPS Tools upsd 2.6.3 listening on 127.0.0.1 port 3493 listening on ::1 port 3493 Connected to UPS [serverups]: usbhid-ups-serverups - Test the upsd with upsc sudo upsc serverups@localhost Should see values for a lot of variables.More steps…
- Continue with the blasterspike.it steps. They seem to be good. http://www.blasterspike.it/2011/03/28/how-to-install-nut-on-ubuntu-10-10-maverick-meerkat/ - upsd.users - Need to add a user id for upsmon to login. - upsmon.conf - Need to add a line to monitor the ups. - nut.conf - Set the mode. - Start it up at boot. blasterspike uses the old "service" to start this. Is upstart an option? It might be if we set it up ourselves. As it stands, initctl does not appear to know of it. See /etc/init.d/nut.Five Minutes?
- Configure it to shutdown after 5 minutes instead of when the UPS goes critical. I don't see a way to do this anywhere. Strange. What exactly is its criteria for shutting down? 10% battery left? It's a UPS data item: battery.charge: 100 (percent) battery.charge.low: 10 (percent, this is when shutdown will occur) battery.charge.warning: 20 (percent) battery.runtime: 2887 (seconds) battery.runtime.low: 300 (seconds, this is when shutdown will occur) I think you can tweak this in one of the config files. There's an override. But this doesn't seem ideal. There's no way to say that it should shutdown after 5 minutes (if it can last that long).References
How To Install NUT – Great article with all the steps.
Network UPS Tools – NUT
NUT Documentation
nut manual section 3.9 “One UPS, one computer. This is also known as “Standalone” configuration. This is the configuration that most users will use. You need at least a driver, upsd, and upsmon running.”
5.2 “Configuration files are located in /etc/nut. nut.conf(5) must be edited to be able to invoke /etc/init.d/nut”
Section 6 of the docs covers setup. Basically, the ups.conf file has to have an entry for the ups. Then it will work. (If only that were it!)
Config files for NUT: nut.conf(5), ups.conf(5), upsd.conf(5), upsd.users(5), upsmon.conf(5)
http://archive09.linux.com/feature/128099 – Not sure this is any good.
Month: March 2017
“Failed to load platform plugin “xcb” ” while launching qt5 app on linux without qt installed – Stack Overflow
I wrote application for linux which uses Qt5.But when I am trying to launch it on the linux without Qt SDK installed, the output in console is: Failed to load platform plugin “xcb”. Available
[SOLVED] error while loading shared libraries: libstdc++-libc6.2-2.so.3 – Page 2
I’m trying to run the Linux version of Return to Castle Wolfenstein, but I get the following errors: clevelandrock@Centurion:~$ wolf ./wolf.x86: error while loading shared libraries: libstdc++-libc6.2-2.so.3: cannot open shared object file: No such file or directory clevelandrock@Centurion:~$ apt-file search libstdc++-libc6.2-2.so.3 clevelandrock@Centurion:~$ uname -a Linux Centurion 2.6.32-23-generic #37-Ubuntu SMP Fri Jun 11 07:54:58 UTC 2010 i686 GNU/Linux clevelandrock@Centurion:~$
Source: [SOLVED] error while loading shared libraries: libstdc++-libc6.2-2.so.3 – Page 2
[help]Install QT4 in Ubuntu
I want to learn QT4 in Ubuntu,I have installed it in WindowsXP,but it has some problem in linux.Can’t make the program. I want to use synaptic to install the QT4,QT assistant,QT designer,can you tell me how to do.
Source: [help]Install QT4 in Ubuntu
Were must be libqt.so.2? / Newbie Corner / Arch Linux Forums
I want install waveforge and write, that need libqt.so.2.
I download from internet libqt.so.2 and do not know were paste it.
[al@myhost ~]$ ‘/home/al/tar.gz,tgz/waveforge.0.1.2/WaveForge’
/home/al/tar.gz,tgz/waveforge.0.1.2/WaveForge: error while loading shared libraries: libqt.so.2: cannot open shared object file: No such file or directory
Source: Were must be libqt.so.2? / Newbie Corner / Arch Linux Forums
OpenUPSmart
OpenUPSmart
Go NUT(s)!
12-12-2008
All units supported by OpenUPSmart should now be supported by the Network UPS Tools. If you are having issues with any of the UPS units previously supported by OpenUPSmart they will be happy to help.
OpenUPSmart should be considered retired; NUT is your best choice for robust UPS support.
About
OpenUPSmart is a UNIX based daemon mainly for the no name UPS available from Dick Smith Electronics in Australia. It is listed on the website simply as “UPS Power Supply UPS0400 400VA”, but otherwise has no unique identifying features. If you know anything more about this little UPS, please contact us!
Update: Thanks to the Google cache, this appears to be called the “Micro Master” UPS, originally made by a company called Centralion.
The Protocol
At first OpenUPSmart used data gleened from sniffing the serial line with the Windows software. On later investigation the protocol appears to be based on the Megatec protocol, available here. (thanks to Chris Barnesfor relating this to the sniffed commands). Although the particular UPS pictured and originally targetted does not appear to be able to handle all of the commands.
The Software
The software is aimed as a daemon based replacement for the Commander Pro software available from www.ups-software-download.com It appears to be authored by a company called Waytech.
If your UPS uses software from this site, you should be able to replace it with OpenUPSmart. Please report any success.
The Linux software available from that site in RPM format is called UPSmart (hence OpenUPSmart).
The goal of OpenUPSmart is to communicate with the UPS, poll it periodically for status updates and run commands on event changes (power failure, power restore, etc).
The software is targetted at building and running on Linux and NetBSD but should be portable to any UNIX style operating system.
The SourceForge project page is available here.
Other confirmed working UPS devices
The BlackOut Buster 800 from PowerKinetics has been reported as working by Julian Gomez. Thanks, Julian!
The Energy Sistem UPS Smart 500 VA has been reported as working by Daniel Sanjurjo. Thanks also for the bug report Daniel!
Also, the Energy Sistem UPS Smart 800 VA has been reported as working by Paco Brufal.
The WinPower CPM-800 has been reported as working by Quoc-Huy Nguyen Dinh. He also included a photo.
The Mustek PowerMust 800 Pro has been reported as working by Alexander Ennulat. The Mustek PowerMust 600Va has been reported working by Paulo Freire.
The Micro Master 600 has been reported as working by Ed.
The Ablerex Hope Office 400/600 (apparently that is hope not home) has been reported working by Ross Marshall.
The UNITEK Alpha 500 has been reported working by Julien.
The Infosec 500XP has been reported as working by Regis Damongeot.
The IPPON Back Power Pro has been reported working by blueman.
The Neus 400va and Neus 600va have been reported working by Gonzalo Mazarrasa.
ActivePower UPS devices have been reported working by Tadeusz Milek.
The Orvaldi 600 has been reported working by Zbynek Michl.
The Phasak 400VA and 600VA UPS has been reported working by Francisco Perez. Front photo | Back photo.
Downloading
The current download version is 1.0. You can download the latest sources from the project page.
If you are having any issues, please check out the latest CVS version using the instructions below.
cvs -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/openupsmart login
cvs -z3 -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/openupsmart co openupsmart
Once you have the sources, run autogen.sh and then configure, make and make install as usual.
Bugs and patches
Bug reports or patches are happily accepted, but please try the latest CVS sources first, just incase.
If you’re sending code please create a patch using diff(1) (or use cvs with cvs diff -u). Feel free to email me if you’re unfamiliar with creating patches.
Sample Output
MRTG Output
OpenUPSmart can optionally create a thread that listens on a specified port and reports status information. This can be easily plugged into MRTG.
Here is an example of how it works
ianw@morrison:~$ /usr/pkg/sbin/nc localhost 8740 248.0 58.0 28 days, 21 hours, 46 minutes, 35 seconds OpenUPSmart
gnuplot output
Here is a little of the logging information OpenUPSmart can show via gnuplot.
Console output
You can also assign various levels of console based output which is often useful for debugging your setup.
Thu Jul 3 22:58:48 2003 openupsmartd : starting Thu Jul 3 22:58:49 2003 init ups Thu Jul 3 22:58:50 2003 begin polling Thu Jul 3 22:58:51 2003 IN:227.50V, FAULT:227.00V, OUT:227.50V, LOAD:41.00% INFREQ:49.70hz, BATT:13.40V, TEMP:37.80C, FLAGS 00001000 ( FLAG_STANDBY ) Thu Jul 3 22:58:52 2003 IN:227.50V, FAULT:227.00V, OUT:227.50V, LOAD:41.00% INFREQ:49.70hz, BATT:13.40V, TEMP:37.80C, FLAGS 00001000 ( FLAG_STANDBY ) Thu Jul 3 22:58:53 2003 IN:6.00V, FAULT:69.00V, OUT:230.00V, LOAD:53.00% INFREQ:50.00hz, BATT:13.40V, TEMP:37.80C, FLAGS 10001000 ( FLAG_STANDBY FLAG_UTIL_POWER_FAIL ) Thu Jul 3 22:58:53 2003 ** Power failure ** Thu Jul 3 22:58:54 2003 IN:20.00V, FAULT:188.00V, OUT:230.00V, LOAD:53.00% INFREQ:50.00hz, BATT:12.50V, TEMP:37.80C, FLAGS 10001000 ( FLAG_STANDBY FLAG_UTIL_POWER_FAIL ) Thu Jul 3 22:58:55 2003 IN:230.00V, FAULT:230.00V, OUT:230.00V, LOAD:46.00% INFREQ:50.00hz, BATT:11.90V, TEMP:37.80C, FLAGS 00001000 ( FLAG_STANDBY ) Thu Jul 3 22:58:55 2003 ** Power restored **
Author
For any problems or queries contact Ian Wienand
Source: OpenUPSmart
(Apollo) UPS, AVR, Inverter, Solar UPS, Elevator Rescue Device
Source: (Apollo) UPS, AVR, Inverter, Solar UPS, Elevator Rescue Device
How to detect an USB device? – Ask Ubuntu
I got a scenario, where a software works only when you insert the USB device provided by the software vendor in windows operating system. Im trying to find the content stored in the USB device. In windows operating system, the USB device icon is not shown in My_Computer. I thought, I can see the content or atleast detect the USB device in Ubuntu.Also in ubuntu, the drive is not detected. I tried “sudo fdisk -l” to know the file system, but its not useful. The drive is not detected at all.I wanted to know, how the software works only when the USB drive is inserted and it wont when it is not inserted. Do they have any files stored in the USB device? In any case, how can we detect such kind of device in Ubuntu?
[SOLVED] Error contacting apcupsd @ localhost:3551: Connection refused
Hi all, I am trying to get apcupsd going. I have installed it thru synaptic, set it up accordingly to the various guides one can find across the net. When I run “acpaccess” I get the following error. “Error contacting apcupsd @ localhost:3551: Connection refused” What, if anything, can I do to rectify the above situtation. I am on Ubuntu Lucid 10.04.2 Desktop. Thanks.
Source: [SOLVED] Error contacting apcupsd @ localhost:3551: Connection refused
Linux Commando: One-liner to shutdown remote host
One-liner to shutdown remote host
To shutdown the local machine immediately, you execute this command as root or under sudo:$ shutdown -h nowIf it is a remote server that you want to shutdown, it could be slightly more involved.
You need to have root privileges to shutdown a machine. However, many systems are configured to block root from logging in remotely usingssh. So, you need to ssh in as a regular, non-root user, and pass the sudo command to shutdown host.
$ ssh -t peter@192.168.1.112 'sudo shutdown -h now' peter@192.168.1.112's password: [sudo] password for peter: Broadcast message from root@tiger (pts/2) (Sat Apr 13 10:56:30 2013): The system is going down for system halt NOW! Connection to 192.168.1.112 closed. $Don’t forget the -t sshparameter to “force pseudo-tty allocation”. Without it, the above one-liner will fail with this message.
sudo: no tty present and no askpass program specifiedNote that you will be prompted twice to type in your password. The first time is for ssh; the second, sudo.
To avoid typing the first password, set up password-less login. This is a topic by itself, and I won’t go into it here.
To avoid the second, configure sudo to not prompt peter for his password when he issues a sudo command. This is done by editing the /etc/sudoers file.
$ visudoInsert the following line to the file:
peter ALL=(ALL) NOPASSWD: ALLThe above line allows peter to sudo as anybody from any host and run any command without being authenticated. Only do this after you have considered its security ramifications. You have been forewarned.
Now run the one-liner again.
$ ssh -t peter@192.168.1.112 'sudo shutdown -h now' peter@192.168.1.112's password: Broadcast message from root@tiger (pts/1) (Sat Apr 20 21:40:50 2013): The system is going down for system halt NOW! Connection to 192.168.1.112 closed.The user is only prompted once, by ssh, to enter a password.
filesystem – How do I avoid the “S to Skip” message on boot? – Ask Ubuntu
After upgrading my laptop from karmic to lucid, my fat32 partition won’t mount automatically. I get the message:
The disk drive for /osshare is not ready yet or not present Continue to wait; or Press S to skip mounting or M for manual recovery
Funny thing is, if I skip, then
/osshare/
is mounted once I log in.I’ve a similar setup on my desktop, and it works fine. Fstab on desktop:
UUID=4663-6853 /osshare vfat utf8,umask=007,gid=46 0 1
/etc/fstab
on laptop:UUID=1234-5678 /osshare vfat utf8,auto,rw,user 0 0
Source: filesystem – How do I avoid the “S to Skip” message on boot? – Ask Ubuntu
FAQ — ZoneMinder documentation
Source: FAQ — ZoneMinder documentation