Differences

This shows you the differences between the selected revision and the current version of the page.

howto:nut_ups 2008/08/17 03:19 howto:nut_ups 2023/09/07 21:19 current
Line 1: Line 1:
====== NUT (Network UPS Tool) ====== ====== NUT (Network UPS Tool) ======
Instruction for installation of Network UPS Tools (NUT) on fun_plug v 0.5. These instructions are based on information found at the Network UPS Tool website ([[http://networkupstools.org/doc/2.2.0/INSTALL.html]]). Instruction for installation of Network UPS Tools (NUT) on fun_plug v 0.5. These instructions are based on information found at the Network UPS Tool website ([[http://networkupstools.org/doc/2.2.0/INSTALL.html]]).
 +
 +====== Summary ======
 +The primary goal of the Network UPS Tools (NUT) project is to provide reliable monitoring of UPS and PDU hardware and ensure safe shutdowns of the systems which are connected.
 +We attempt to monitor every kind of UPS and PDU, given sufficient interest.  Summary from [[http://networkupstools.org|NUT project page]].
 +
===== Getting Started ===== ===== Getting Started =====
-==== What's Needed ==== 
-A DNS323 with Fun_Plug 0.5 installed. 
-A functional telnet connection. 
 +
 +==== What's Needed ====
Successful installation of NUT requires three packages from fonz's website ([[http://www.inreto.de/dns323/fun-plug/0.5/packages/]]). They are; Successful installation of NUT requires three packages from fonz's website ([[http://www.inreto.de/dns323/fun-plug/0.5/packages/]]). They are;
  * libusb-0.1.12-1.tgz;   * libusb-0.1.12-1.tgz;
  * neon-0.25.5-1.tgz and;   * neon-0.25.5-1.tgz and;
-  * nut-2.2.2-2.tgz+  * nut-2.2.2-3.tgz 
 + 
 + 
 +=== Assumptions === 
 +DNS323 is operating with Firmware version 1.05 or 1.06 (Installation has not been tested with other firmware versions). 
 + 
 +Fun_Plug 0.5 installed and operable. 
 + 
 +A functional telnet connection. 
 + 
 + 
 + 
Line 24: Line 40:
rsync -av inreto.de::dns323/fun-plug/0.5/packages/neon-0.25.5-1.tgz . rsync -av inreto.de::dns323/fun-plug/0.5/packages/neon-0.25.5-1.tgz .
rsync -av inreto.de::dns323/fun-plug/0.5/packages/libusb-0.1.12-1.tgz . rsync -av inreto.de::dns323/fun-plug/0.5/packages/libusb-0.1.12-1.tgz .
- rsync -av inreto.de::dns323/fun-plug/0.5/packages/nut-2.2.2-2.tgz .+ rsync -av inreto.de::dns323/fun-plug/0.5/packages/nut-2.2.2-3.tgz . 
Line 32: Line 49:
funpkg -i neon-0.25.5-1.tgz funpkg -i neon-0.25.5-1.tgz
funpkg -i libusb-0.1.12-1.tgz funpkg -i libusb-0.1.12-1.tgz
- funpkg -i nut-2.2.2-2.tgz+ funpkg -i nut-2.2.2-3.tgz
Line 60: Line 77:
**Note** **Note**
  * In this example NUTMonPW is used as the password for a user named ''nutmon''. If you use a different password be sure to include it when configuring the upsd.users file.   * In this example NUTMonPW is used as the password for a user named ''nutmon''. If you use a different password be sure to include it when configuring the upsd.users file.
 +
 +
 +==== Preserve the Users Password ====
 +Each time the DNS323 is booted key files are copied from NVRAM to the /etc directory. When this occurs information pertaining to those Groups and Users added as shown above will be lost. Loss can be prevented by writing group and user information to NVRAM using the store-passwd.sh script.
 +
 + store-passwd.sh
===== Configure and Start NUT Driver ===== ===== Configure and Start NUT Driver =====
 +
==== Create ups.conf File ==== ==== Create ups.conf File ====
During NUT installation sample configuration files were copied to the /ffp/etc directory. These files are identifiable by their ''.sample'' suffix. During this step of the configuration process a ups.conf file will be created from the ups.conf.sample file. This is achieved by copying the sample ups configuration file to the /ffp/etc directory. The command to do so follows; During NUT installation sample configuration files were copied to the /ffp/etc directory. These files are identifiable by their ''.sample'' suffix. During this step of the configuration process a ups.conf file will be created from the ups.conf.sample file. This is achieved by copying the sample ups configuration file to the /ffp/etc directory. The command to do so follows;
- cp /ffp/etc/ups.conf.sample /ffp/etc/ups.conf+ cp /ffp/etc/examples/nut/ups.conf.sample /ffp/etc/ups.conf 
 + 
==== Add Driver Configuration Detail ==== ==== Add Driver Configuration Detail ====
-Prior to modifying the ups.conf file you'll need to determine which driver is used with your specific UPS. A UPS hardware compatibility list is located on the [[http://www.networkupstools.org/compat/stable.html|Network UPS Tools]] website. Review this list to determine which driver is required for your specific application. Please note these instructions pertain specifically to USB connected UPS. +Prior to modifying the ups.conf file you'll need to determine which driver is used with your specific UPS. A UPS hardware compatibility list is located on the [[https://networkupstools.org/stable-hcl.html]] website. Review this list to determine which driver is required for your specific application. Please note these instructions pertain specifically to USB connected UPS.
Use your favourite editor (I use Notepad++) to open the ups.conf file, enter and subsequently save your specific settings. Use your favourite editor (I use Notepad++) to open the ups.conf file, enter and subsequently save your specific settings.
Line 101: Line 127:
During this step of the configuration process a upsd.conf file will be created from the upsd.conf.sample file. This is achieved by copying the sample upsd configuration file to the /ffp/etc directory. The command to do so follows; During this step of the configuration process a upsd.conf file will be created from the upsd.conf.sample file. This is achieved by copying the sample upsd configuration file to the /ffp/etc directory. The command to do so follows;
- cp /ffp/etc/upsd.conf.sample /ffp/etc/upsd.conf+ cp /ffp/etc/examples/nut/upsd.conf.sample /ffp/etc/upsd.conf
=== Configuring Specific Host Settings === === Configuring Specific Host Settings ===
Line 114: Line 140:
During this step of the configuration process a upsd.users file will be created from the upsd.users.sample file. This is achieved by copying the sample upsd configuration file to the /ffp/etc directory. The command to do so follows; During this step of the configuration process a upsd.users file will be created from the upsd.users.sample file. This is achieved by copying the sample upsd configuration file to the /ffp/etc directory. The command to do so follows;
- cp /ffp/etc/upsd.users.sample /ffp/etc/upsd.users+ cp /ffp/etc/examples/nut/upsd.users.sample /ffp/etc/upsd.users
=== Configuring an Administrative User === === Configuring an Administrative User ===
Line 138: Line 164:
The Network Server can be stopped by issuing an ''upsd -c stop'' command. The Network Server can be stopped by issuing an ''upsd -c stop'' command.
 +
 +
==== UPS and Server Status Check ==== ==== UPS and Server Status Check ====
Line 158: Line 186:
battery.date: 2001/09/25 battery.date: 2001/09/25
battery.mfr.date: 2008/06/05 battery.mfr.date: 2008/06/05
- battery.runtime: 2025+ battery.runtime: 2535
battery.runtime.low: 120 battery.runtime.low: 120
- battery.temperature: 3022999999999998800+ battery.temperature: 29.2
battery.type: PbAc battery.type: PbAc
battery.voltage: 27.8 battery.voltage: 27.8
battery.voltage.nominal: 24.0 battery.voltage.nominal: 24.0
 + device.mfr: American Power Conversion
 + device.model: Back-UPS RS 900
 + device.serial: 5B0743U08220
 + device.type: ups
driver.name: usbhid-ups driver.name: usbhid-ups
driver.parameter.pollfreq: 30 driver.parameter.pollfreq: 30
driver.parameter.pollinterval: 2 driver.parameter.pollinterval: 2
- driver.parameter.port: auto + driver.parameter.port: AUTO 
- driver.version: 2.2.2 + driver.version: 2.4.1 
- driver.version.data: APC HID 0.92 + driver.version.data: APC HID 0.93 
- driver.version.internal: 0.33+ driver.version.internal: 0.34
input.voltage: 122.0 input.voltage: 122.0
input.voltage.nominal: 120 input.voltage.nominal: 120
Line 177: Line 209:
ups.beeper.status: enabled ups.beeper.status: enabled
ups.delay.shutdown: 20 ups.delay.shutdown: 20
- ups.delay.start: 30 
ups.firmware: 9.o2 .D ups.firmware: 9.o2 .D
ups.firmware.aux: o2 ups.firmware.aux: o2
- ups.load:22999999999999994+ ups.load: 18.0
ups.mfr: American Power Conversion ups.mfr: American Power Conversion
ups.mfr.date: 2007/10/24 ups.mfr.date: 2007/10/24
Line 196: Line 227:
During this step of the configuration process a upsmon.conf file will be created from the upsmon.conf.sample file. This is achieved by copying the sample upsmon configuration file to the /ffp/etc directory. The command to do so follows; During this step of the configuration process a upsmon.conf file will be created from the upsmon.conf.sample file. This is achieved by copying the sample upsmon configuration file to the /ffp/etc directory. The command to do so follows;
- cp /ffp/etc/upsmon.conf.sample /ffp/etc/upsmon.conf+ cp /ffp/etc/examples/nut/upsmon.conf.sample /ffp/etc/upsmon.conf
==== Configure a RUN_AS_USER ==== ==== Configure a RUN_AS_USER ====
Line 217: Line 248:
  * MonUserPW is the password that was established when ''monuser'' was added to the upsd.users file. If you used a different password, which you should, be sure to replace MonUserPW with the password that you set in the upsd.users file.   * MonUserPW is the password that was established when ''monuser'' was added to the upsd.users file. If you used a different password, which you should, be sure to replace MonUserPW with the password that you set in the upsd.users file.
  * DNS323 is the host name that was established when configuring the upsd.conf file.   * DNS323 is the host name that was established when configuring the upsd.conf file.
 +
==== Monitor Startup ==== ==== Monitor Startup ====
Start the upsmon Monitor. This is accomplished by issuing the following command; Start the upsmon Monitor. This is accomplished by issuing the following command;
- upsmon -u monuser+ upsmon
-===== Increase File and Directory Security =====+ 
 + 
 +====== Increase File and Directory Security ======
Many of NUT's configuration files contain sensitive data; user names and passwords. To guard against inappropriate access of this information restricting access to users belonging to the ''nut'' group is recommended. This is achieved through the following commands; Many of NUT's configuration files contain sensitive data; user names and passwords. To guard against inappropriate access of this information restricting access to users belonging to the ''nut'' group is recommended. This is achieved through the following commands;
Line 234: Line 268:
chmod 0770 /ffp/var/state/ups chmod 0770 /ffp/var/state/ups
-===== Preserving Passwords ===== 
-Each time the DNS323 is booted key files are copied from NVRAM to the /etc directory. When this occurs information pertaining to those Groups and Users added as shown above will be lost. Loss can be prevented by writing group and user information to NVRAM using the store-passwd.sh script. 
- store-passwd.sh 
-====== Add Control to A Remote Windows Machine ====== +====== Automating the Startup Process ====== 
-If you have a Windows PC connected to the same UPS then the utility named WinNUT will be of interest to you.+You can Telnet to the DNS323 each time you want to start NUT or use a startup script. The following can be added to a nut.sh script file and stored in the /ffp/start directory by copying the content of the code box into your favourite editor then saving the resultant file as /ffp/start/nut.sh.
-WinNUT  +Use this script for DNS323 firmware versions prior to 1.07.
-==== Installing WinNUT ====+
-Create a user for WinNUT Monitoring Tool+ #!/ffp/bin/sh 
 +  
 + # PROVIDE: nut 
 +  
 + . /ffp/etc/ffp.subr 
 +  
 + name="nut" 
 + start_cmd="nut_start" 
 + stop_cmd="nut_stop" 
 +  
 + nut_start() 
 +
 + # Start NUT driver for UPS hardware. 
 + /ffp/bin/upsdrvctl start 
 +  
 + # Start NUT Network Server 
 + /ffp/sbin/upsd 
 +  
 + # Start NUT monitor agent 
 + /ffp/sbin/upsmon -u monuser 
 +
 +  
 + nut_stop() 
 +
 + # Stop NUT monitor agent 
 + /ffp/sbin/upsmon -c stop 
 +  
 + # Stop NUT Network Server 
 + /ffp/sbin/upsd -c stop 
 +  
 + # Stop NUT driver for UPS hardware. 
 + /ffp/bin/upsdrvctl stop 
 +
 +  
 + run_rc_command "$1"
- adduser -s /bin/false -G nut -H winnmonuser 
-The system will respond with:+Use this script for DNS323 firmware version 1.07.
- Changing password for winnmonuser + #!/ffp/bin/sh 
- Enter the new password (minimum of 5, maximum of 8 characters+  
- Please use a combination of upper and lower case letters and numbers.+ # PROVIDE: nut 
 +  
 + . /ffp/etc/ffp.subr 
 +  
 + name="nut" 
 + start_cmd="nut_start" 
 + stop_cmd="nut_stop" 
 +  
 + nut_start() 
 +
 + ##################### 
 + # We're using NUT UPS from ffp; # 
 + ##################### 
 +  
 + ############################################ 
 + # Stop built in NUT UPS deamons in preparation for starting ffp NUT UPS # 
 + ############################################ 
 + if ps | grep /usr/local/ups/bin/usbhid-ups | grep -v grep 
 + then 
 + echo "* Stopping Default UPS Services" 
 + # Stop NUT Network Server 
 + /sys/crfs/sbin/upsd -c stop 
 +  
 + # Stop NUT driver for UPS hardware. 
 + /sys/crfs/sbin/upsdrvctl stop 
 + fi 
 +  
 + sleep 2 
 +  
 + ############## 
 + # Start ffp NUT UPS # 
 + ############## 
 + # Start NUT driver for UPS hardware. 
 + /ffp/bin/upsdrvctl start 
 +  
 + # Start NUT Network Server 
 + /ffp/sbin/upsd 
 +  
 + # Start NUT monitor agent 
 + /ffp/sbin/upsmon -u monuser 
 +
 +  
 + nut_stop() 
 +
 + # Stop NUT monitor agent 
 + /ffp/sbin/upsmon -c stop 
 +  
 + # Stop NUT Network Server 
 + /ffp/sbin/upsd -c stop 
 +  
 + # Stop NUT driver for UPS hardware. 
 + /ffp/bin/upsdrvctl stop 
 +
 +  
 + run_rc_command "$1" 
 + 
 +Don't forget to make it runnable: 
 + 
 + chmod a+x /ffp/start/nut.sh 
 + 
 +====== Add UPS Monitoring and Shut Down Capability to A Remote Windows Machine ====== 
 +If you have a Windows PC connected to the same UPS then a Windows Application named WinNUT may be of interest to you. See [[http://csociety.ecn.purdue.edu/~delpha/winnut/|WinNUT]] for details. 
 + 
 + 
 +==== Configuring the NUT Environment for Use With WinNUT ==== 
 +For WinNUT to run successfully it will be necessary to add user information to the upsd.users and host information to the upsd.conf files located on the DNS323. 
 + 
 +=== Add a Remote Monitoring User  === 
 +Use your favourite editor to open the upsd.users file, enter and subsequently save your specific settings. 
 + 
 + [winmonuser] 
 + password = WinMonUserPW 
 + allowfrom = Remote-PC 
 + upsmon slave 
 + 
 +=== Configuring Remote Host Settings === 
 +Configuring access for the remote host requires modification of the upsd.conf file. For this example it will be necessary to add a host named Remote-PC on IP 192.168.1.200 to the server configuration file. Use your favourite editor to open the upsd.conf file, enter and subsequently save the following lines; 
 + 
 + ACL DNS323 192.168.1.200/32 
 +  
 + ACCEPT Remote-PC
-Selected a password for ups then enter it at the New password: and Re-enter new password: prompts.+If the NUT Server is running when this change is made it will be necessary to reload the configuration file. This can be done by issuing the following command;
 + upsd -reload

Navigation

Personal Tools