This is an old revision of the document!


NUT (Network UPS Tool)

Install instruction for Network UPS Tools (NUT) version 2.2.2 with fun_plug 0.5

What's Needed

Successful installation of NUT requires three packages. They are;

  • neon-0.25.5-1.tgz
  • libusb-0.1.12-1.tgz
  • nut-2.2.2-2.tgz

Obtain the packages and store them in the /mnt/HD_a2/ffp/var/packages directory using the following commands;

cd /mnt/HD_a2/ffp/var/packages
wget http://www.inreto.de/dns323/fun-plug/0.5/packages/neon-0.25.5-1.tgz
wget http://www.inreto.de/dns323/fun-plug/0.5/packages/libusb-0.1.12-1.tgz
wget http://www.inreto.de/dns323/fun-plug/0.5/packages/nut-2.2.2-2.tgz

Install the packages using the commands that follow

funpkg -i neon-0.25.5-1.tgz
funpkg -i libusb-0.1.12-1.tgz
funpkg -i nut-2.2.2-2.tgz

Prepare The Environment

Create a User Group

For the purposes of this exercise the group will be named nut.

groupadd nut

Create user and add to existing group. For the purposes of this exercise the user will be named ups

adduser -s /bin/false -G nut -H -D ups
set password Fi8H7m11lb

Copy sample ups configuration file to the /ffp/etc directory.

cp /ffp/etc/ups.conf.sample /ffp/etc/ups.conf

Change ownership of /ffp/etc/ups.conf

chown root:nut /ffp/etc/ups.conf

Use favourite editor (I use Notepad++) to establish ups.conf settings.

An APC Back-UPS RS 900 is connected to the USB port on my DNS323. Settings for this device would be;

[APC_UPS]
	driver = usbhid-ups
	port = USB
	desc = "Back-UPS RS 900"

A UPS hardware compatibility list is located at http://networkupstools.org/compat/stable.html



Change ownership of /ffp/var/state/ups directory

chmod 0770 /ffp/var/state/ups
chown root:nut /ffp/var/state/ups

—– Startup —–

Start the driver for your hardware.

# /ffp/bin/upsdrvctl -t -u ups start

Make sure the driver doesn't report any errors. It should show a few details about the hardware and then enter the background. You should get back to the command prompt a few seconds later. For reference, a successful start of the usbhid-ups driver looks like this:

Network UPS Tools - UPS driver controller 2.2.2
Network UPS Tools: 0.29 USB communication driver - core 0.33 (2.2.2)
Using subdriver: APC HID 0.92

If the driver doesn't start cleanly, make sure you have picked the right one for your hardware. You might need to try other drivers by changing the “driver=” value in ups.conf.

Be sure to check the driver's man page to see if it needs any extra settings in ups.conf to detect your hardware.

If it says “can't bind /var/state/ups/…” or similar, then your state path probably isn't writable by the driver. Check the permissions and mode on that directory.

—– Configuration Process —–

Basic configuration of upsd requires copying the sample configuration file to the /ffp/etc directory.

cp /ffp/etc/upsd.conf.sample /ffp/etc/upsd.conf

Configuring a specific host requires modification of the upsd.conf file. For example, to add a host named DNS323_NAS on IP 192.168.1.50 the following lines need to be added to the upsd.conf file;

ACL DNS323_NAS 192.168.1.50/32
ACCEPT DNS323_NAS

Copy sample user configuration file to the /ffp/etc directory.

cp /ffp/etc/upsd.users.sample /ffp/etc/upsd.users

Use favourite editor (I use Notepad++) to establish upsd.users settings.

[ups]
	password =
	allowfrom = localhost DNS323_NAS
	actions = SET
	instcmds = ALL


Do not make either of the upsd files (upsd.conf or upsd.users) world-readable. Since they both hold access control data and passwords they just need to be readable by the user you created in the preparation process.

The suggested configuration is to chown it to root, chgrp it to the group you created, then make it readable by the group.

cd /ffp/etc
chown root:nut upsd.conf upsd.users
chmod 0640 upsd.conf upsd.users


Start the network server.

# /ffp/sbin/upsd -u ups

(To stop the network server use /ffp/sbin/upsd -u ups -c stop)

Make sure that the UPS is providing good status data.

# /ffp/bin/upsc APC_UPS@localhost ups.status or

Look at all of the status data which is being monitored.

/ffp/bin/upsc APC_UPS@localhost

What happens now depends on the kind of UPS and driver you have.In the list, you should see ups.status with the same value you got above. A sample run on an APC Back-UPS RS 900 looks like this:

battery.charge: 100 battery.charge.low: 10 battery.charge.warning: 50 battery.date: 2001/09/25 battery.mfr.date: 2008/06/05 battery.runtime: 2025 battery.runtime.low: 120 battery.temperature: 3022999999999998800 battery.type: PbAc battery.voltage: 27.8 battery.voltage.nominal: 24.0 driver.name: usbhid-ups driver.parameter.pollfreq: 30 driver.parameter.pollinterval: 2 driver.parameter.port: auto driver.version: 2.2.2 driver.version.data: APC HID 0.92 driver.version.internal: 0.33 input.voltage: 122.0 input.voltage.nominal: 120 output.voltage: 120.0 output.voltage.nominal: 120.0 ups.beeper.status: enabled ups.delay.shutdown: 20 ups.delay.start: 30 ups.firmware: 9.o2 .D ups.firmware.aux: o2 ups.load: 229999999999999940000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 ups.mfr: American Power Conversion ups.mfr.date: 2007/10/24 ups.model: Back-UPS RS 900 ups.productid: 0002 ups.serial: 5B0743U08220 ups.status: OL ups.test.result: No test initiated ups.timer.reboot: 0 ups.timer.shutdown: -1 ups.vendorid: 051d

—– Confiure Monitor —–

Create user and add to existing group. For the purposes of this exercise the user will be named nutmon

adduser -s /bin/false -G nut -H -D nutmon

Create a user for the monitor

adduser -s /bin/false -G nut -H monuser

The system will respond with:

Changing password for monuser Enter the new password (minimum of 5, maximum of 8 characters) Please use a combination of upper and lower case letters and numbers.

The selected password for monuser is 8htPm3Tayc. Enter this value at the New password: and Re-enter new password: prompts

Copy sample monitor configuration file to the /ffp/etc directory.

cp /ffp/etc/upsmon.conf.sample /ffp/etc/upsmon.conf

Use favourite editor (I use Notepad++) to establish upsmon.conf settings.

Do not make the upsmon.conf files world-readable. Since this file holds access control data and passwords it just needs to be readable by the user you created in the preparation process.

The suggested configuration is to chown it to root, chgrp it to the group you created, then make it readable by the group.

chmod 0640 upsmon.conf
chown root:nut upsmon.conf

Configure upsd to recognize upsmon.

First create an ACL in upsd.conf for the host that will be running upsmon. Then use it in an ACCEPT line to allow that host to monitor the UPS. This will let upsmon connect to upsd.

Assuming a host called DNS323_NAS with the IP address of 192.168.1.50, the additional configuration items would look like this:

ACL mybox 192.168.1.50/32
ACCEPT DNS323_NAS

Start the upsmon monitor.

# /ffp/sbin/upsmon -u monuser

—– Installing WinNUT —–

Create a user for WinNUT Monitoring Tool

adduser -s /bin/false -G nut -H winnmonuser

The system will respond with:

Changing password for winnmonuser Enter the new password (minimum of 5, maximum of 8 characters) Please use a combination of upper and lower case letters and numbers.

The selected password for winmonuser is Lh63Dfli21. Enter this value at the New password: and Re-enter new password: prompts


Navigation

Personal Tools