UWMLSC > Beowulf Systems > Medusa
   NUTs

Protecting Your GC Machines From Power Failure With NUTs


Quick Synopsis of Installation Procedure: Read it! You will understand much better what you are doing.

The instructions below explain how to install NUTs (Network UPS Tools) on one (or a few) desk-top computer(s). If the line power to the UPS fails, the NUTs software informs the computers. The machines then run on the UPS battery power for a specified (configurable) time period (0[10 min] recommended). If power is not restored before the time expires, NUTs will issue a shutdown command to the computer. If power is restored before the time expires, normal operations resume.

The installation consists of downloading and installing the NUTs rpm (basically the same rpm we install on the cluster); editing a few lines in a few configuration files; restarting NUTs; and then testing it.

There are actually two sets of instructions below. The first explains how to install NUTs on a single computer )the UPS "master"). The master communicates directly with the UPS over a serial cable. If your office has only one computer plugged into the UPS, it will need to be configured as the master, and you will only need to follow the first set of instructions. The second set of instructions explains how to add additional "client" computers to the same UPS. If the power fails, the UPS master is informed via the serial cable and then relays the information to the clients over the network.

The sensible path is to install NUTs on a single (master) computer and test it. Once you have this working, follow the second set of instructions to add client computers.

NUTs in an incredibly flexible tool. If you want to do something more exotic than the simple configuration given here, see http://us1.networkupstools.org/

How To Install NUTs On A Single Machine

  • Wiring
    1. Plug the UPS into the wall outlet.
    2. Plug your computer into the UPS directly or through a powerstrip.
    3. A serial cable then connects the UPS to your computer.
      NOTE:Some UPSs require a special serial cable, ask an Admin for this.

  • Setting Up NUTs As A UPS Server.
    1. Change to root.

      su -

    2. Obtain the NUTs rpm by typing.
      • The nut rpm is installed by the RedHat9 post install script. If this script has been run, skip to step 4.
      • Otherwise, the rpm can obtained from Medusa CVS by:

        cvs co 9install/commonconfig/rpms/nut-0.50.0-3medusaRH9.i386.rpm

    3. Install RPM:

      rpm -Uvh nut-0.50.0-3medusaRH9.i386.rpm

    4. Five files may need to be configured. Open each with the text editor of your choice.
      1. /etc/ups/ups.conf
        • Uncomment the appropriate lines for your UPS model. The default is a Powerware UPS.

      2. /etc/sysconfig/ups
        • This file determines whether or not your machine will act as a UPS server or client. Remove all lines except for the following:

          STARTUPSD=1
          LOGINLEVEL=master
          UPSDSERVER="127.0.0.1"

      3. /etc/ups/upsd.conf
        • This config file controls access to the UPS server. Change medusa in the first ACL line to be your machine name (without the .phys.uwm.edu) as well as in the second ACCESS line. Change the IP and netmask to read 129.89.57.0/255.255.255.0. The file should read as follows:

          ACL yourcomputer 129.89.57.0/255.255.255.0
          ACL localhost 127.0.0.1/32
          ACCESS grant master localhost
          ACCESS grant login yourcomputer passwd
          ACCESS deny all all passwd

      4. /etc/ups/upsd.users
        • This file administors users that connect to UPS servers. This file will only need to be changed on UPS servers that other clients monitor.
        • Under [client] edit allowfrom=medusa to be the name of yourcomputer specified in /etc/ups/upsd.conf.

      5. /etc/ups/upssched.conf
        • Scroll through the file until you see the line:

          AT ONBATT * START-TIMER onbatt_too_long 120

          Replace 120 with the time in seconds you would like your machine to stay running. The more machines on one UPS, the shorter the time should be. 600 seconds (10 minutes) is recommended for UPSs powering one machine.

    5. After all config files are set do:

      service nuts restart

  • Testing
    • The following can be done without disruption of service:
        Disconnect the UPSs power cable from the wall. Check /var/log/ups for the alert.

        June 25 11:32:22 yourmachine upsmon: UPS 127.0.0.1 is on battery

        The output of var/log/messages will look like this:

        Jun 25 11:32:37 yourmachine upssched : New timer: onbatt_too_long (900 seconds)

    • You may also keep the UPS unplugged and allow your machines to turn off after the length of time.

How To Install NUTs On An Additional Client Machine

  • Wiring
    1. Plug computer into UPS (possibly via a power strip).

  • Set-UP
    1. Change to root.

      su -

    2. Obtain the NUTs rpm by typing: (This location is only temporary)
      • The nut rpm is installed by the RedHat9 post install script. If this script has been run, skip to step 4.
      • Otherwise, the rpm can obtained from Medusa CVS by:

      cvs co 9install/commonconfig/rpms/nut-0.50.0-3medusaRH9.i386.rpm

    3. Install RPM:

      rpm -Uvh nut-0.50.0-3medusaRH9.i386.rpm

    4. Four files may need to be configured at this point. Open each with the text editor of your choice.
      1. /etc/sysconfig/ups
        • This file will determine whether or not your machine will act as a UPS server or client. There will be only 3 lines:
        • Your machine is a client to a UPS server, enter the IP of the server after UPSDSERVER=

          STARTUPSD=0
          LOGINLEVEL=slave
          UPSDSERVER="129.89.57.xyz"

      2. /etc/ups/upsd.conf
        • This config file controls access to the UPS server. Change medusa in the first ACL line to be the UPS master host name (without the .phys.uwm.edu) as well as in the second ACCESS line. Then change the IP and netmask to read 129.89.57.0/255.255.255.0. In the end, the file should read as follows:

          ACL yourcomputer 129.89.57.0/255.255.255.0
          ACL localhost 127.0.0.1/32
          ACCESS grant master localhost
          ACCESS grant login yourcomputer passwd
          ACCESS deny all all passwd

      3. /etc/ups/upsd.users
        • This file administors users that connect to UPS servers.
        • Under [client] edit allowfrom = to be the name of the machine specified in /etc/ups/upsd.conf above.

      4. /etc/ups/upssched.conf
        • Scroll through the file until you see the line:

          AT ONBATT * START-TIMER onbatt_too_long 120

          Replace 120 with the time in seconds you would like your machine to stay running. The more machines on one UPS, the shorter the time should be. 600 seconds (10 minutes) is recommended for UPSs powering one machine.

    5. After all config files are set do:

      service nuts restart

  • Testing
    • The following can be done without disruption of service:
        Disconnect the UPSs power cable from the wall. Check /var/log/ups for the alert.

        June 25 11:32:22 yourmachine upsmon: UPS 127.0.0.1 is on battery

        The output of var/log/messages will look like this:

        Jun 25 11:32:37 yourmachine upssched : New timer: onbatt_too_long (900 seconds)

    • You may also keep the UPS unplugged and allow your machines to turn off after the length of time.
Check this page for dead links, sloppy HTML, or a bad style sheet; or strip it for printing.
Any opinions, findings, and conclusions or recommendations expressed in this material are those of the author(s) and do not necessarily reflect the views of the National Science Foundation.