Topic
13 replies Latest Post - ‏2013-08-15T19:43:23Z by robberendt
robberendt
robberendt
27 Posts
ACCEPTED ANSWER

Pinned topic How do I modify UPS settings on suse Linux running on Power 6?

‏2013-07-30T14:16:24Z |

I am a newbie and know practically nothing about linux.  I am an IBM i guy.  I have four lpars of IBM i and one lpar of suse linux running on one of my power 6 boxes.  Main application on the linux lpar is Tivoli Storage Manager.

On IBM i, you can control how your system reacts to your UPS going on battery power by a series of system values:

http://pic.dhe.ibm.com/infocenter/iseries/v7r1m0/topic/rzakz/rzakzpoweroverview.htm

I set these system values and flipped the big arm feeding the UPS.  IBM i handled this well.  I didn't keep it long enough for the QUPSDLYTIM value to start shutting down the IBM i lpars.  I discovered that the suse linux lpar shut itself down.  How do I adjust the time in between the UPS going on battery power and before suse linux shuts itself down?

We had the UPS off for 10 minutes and it still had 55 minutes of juice left.  It has a few dozen batteries.

  • k0da
    k0da
    48 Posts
    ACCEPTED ANSWER

    Re: How do I modify UPS settings on suse Linux running on Power 6?

    ‏2013-07-30T20:02:28Z  in response to robberendt

    I don't know what kind of UPS do you have, but there is a package named "apcupsd" to control APC devices.

    If you don't have it installed, you could do "sudo zypper install apcupsd"

    here is documentation for that project http://www.apcupsd.com/manual/manual.html

     

    • robberendt
      robberendt
      27 Posts
      ACCEPTED ANSWER

      Re: How do I modify UPS settings on suse Linux running on Power 6?

      ‏2013-07-30T20:21:44Z  in response to k0da

      I have no doubt that the UPS is currently being monitored successfully.  It's not that I need a driver for any particular kind of UPS.  After all, it was the successful processing of the signal from the UPS that got the OS to power itself off.  What I want to know is how to adjust the time between when the signal was sent and before the OS powers itself off.  For example, you get a signal that says something like "System utility power failed at such and such a date and time".  And if your power gets restored before a certain time interval your OS will get a message something like "System utility power restored at such and such a date and time".  So there's a timer in there that waits for the second message.  If it doesn't receive it before that timer expires then it shuts itself down.  How do I adjust that timer?

      • k0da
        k0da
        48 Posts
        ACCEPTED ANSWER

        Re: How do I modify UPS settings on suse Linux running on Power 6?

        ‏2013-08-01T15:40:12Z  in response to robberendt

        What kind of UPS do you have? (vendor/modelname)

        • robberendt
          robberendt
          27 Posts
          ACCEPTED ANSWER

          Re: How do I modify UPS settings on suse Linux running on Power 6?

          ‏2013-08-01T16:49:35Z  in response to k0da

          Leibert AP341

          • k0da
            k0da
            48 Posts
            ACCEPTED ANSWER

            Re: How do I modify UPS settings on suse Linux running on Power 6?

            ‏2013-08-02T08:27:33Z  in response to robberendt

            Oh for that UPS there is a nut package. It should be installed and running by default (that's why it works for you.)

            http://www.networkupstools.org/

            Man page says that liebert driver doesn't support any extra settings in ups.conf but you can try (there are should be options available which you wanted)

            • robberendt
              robberendt
              27 Posts
              ACCEPTED ANSWER

              Re: How do I modify UPS settings on suse Linux running on Power 6?

              ‏2013-08-02T11:50:34Z  in response to k0da

              Ok, it's starting to click.  If it is using nut then my interpretation of their man pages is that I need to look at the upsmon.conf and modify

              FINALDELAY seconds

              Now, with my almost total lack of knowledge of Linux I have to find, and edit, this file.

              • k0da
                k0da
                48 Posts
                ACCEPTED ANSWER

                Re: How do I modify UPS settings on suse Linux running on Power 6?

                ‏2013-08-02T12:10:12Z  in response to robberendt

                 

                <your favorite editor> /etc/ups/upsmon.conf

                • robberendt
                  robberendt
                  27 Posts
                  ACCEPTED ANSWER

                  Re: How do I modify UPS settings on suse Linux running on Power 6?

                  ‏2013-08-02T14:08:58Z  in response to k0da

                  hqlinux2:/var/mail # cd /
                  hqlinux2:/ # cd etc
                  hqlinux2:/etc # cd ups
                  -bash: cd: ups: No such file or directory

                   

                  • k0da
                    k0da
                    48 Posts
                    ACCEPTED ANSWER

                    Re: How do I modify UPS settings on suse Linux running on Power 6?

                    ‏2013-08-02T14:21:33Z  in response to robberendt

                    oh.. zypper in nut-classic :)

                    • robberendt
                      robberendt
                      27 Posts
                      ACCEPTED ANSWER

                      Re: How do I modify UPS settings on suse Linux running on Power 6?

                      ‏2013-08-02T18:32:33Z  in response to k0da

                      zypper?  Doesn't that normally mean I need to install something?  I would think that the system shutting down would be indicative that 'something' is installed.

                      • k0da
                        k0da
                        48 Posts
                        ACCEPTED ANSWER

                        Re: How do I modify UPS settings on suse Linux running on Power 6?

                        ‏2013-08-02T19:04:38Z  in response to robberendt

                        Well, the file you're looking for is provided by this package.

      • robberendt
        robberendt
        27 Posts
        ACCEPTED ANSWER

        Re: How do I modify UPS settings on suse Linux running on Power 6?

        ‏2013-08-13T18:32:57Z  in response to robberendt

        I did another UPS test.  When I chopped power to the UPS I got this message on my console:

        Broadcast Message from root@hqlinux2
                (somewhere) at 11:39 ...
        /etc/rc.powerfail: The system has switched to battery backup.
                The system will begin shutting down in 8 minutes if the problem is not remedied.

         

        When I restored power I got:

        Broadcast Message from root@hqlinux2
                (somewhere) at 11:41 ...
        /etc/rc.powerfail: The problem that caused the delayed shutdown to begin has been remedied.
                The system shutdown has been canceled.

        Well, now it shows me that 8 minutes is the magic number.  So that's the number I want to adjust.

         

        ps -ef
        UID        PID  PPID  C STIME TTY          TIME CMD
        root         1     0  0 Jul30 ?        00:00:11 init [3]
        root         2     0  0 Jul30 ?        00:00:00 [kthreadd]
        root         3     2  0 Jul30 ?        00:00:00 [migration/0]
        root         4     2  0 Jul30 ?        00:00:10 [ksoftirqd/0]
        root         5     2  0 Jul30 ?        00:00:03 [migration/1]
        root         6     2  0 Jul30 ?        00:00:02 [ksoftirqd/1]
        root         7     2  0 Jul30 ?        00:00:00 [migration/2]
        root         8     2  0 Jul30 ?        00:00:05 [ksoftirqd/2]
        root         9     2  0 Jul30 ?        00:00:03 [migration/3]
        root        10     2  0 Jul30 ?        00:00:01 [ksoftirqd/3]
        root        11     2  0 Jul30 ?        00:00:00 [migration/4]
        root        12     2  0 Jul30 ?        00:00:02 [ksoftirqd/4]
        root        13     2  0 Jul30 ?        00:00:03 [migration/5]
        root        14     2  0 Jul30 ?        00:00:00 [ksoftirqd/5]
        root        15     2  0 Jul30 ?        00:00:00 [migration/6]
        root        16     2  0 Jul30 ?        00:00:03 [ksoftirqd/6]
        root        17     2  0 Jul30 ?        00:00:03 [migration/7]
        root        18     2  0 Jul30 ?        00:00:01 [ksoftirqd/7]
        root        19     2  0 Jul30 ?        00:00:59 [events/0]
        root        20     2  0 Jul30 ?        00:00:51 [events/1]
        root        21     2  0 Jul30 ?        00:00:53 [events/2]
        root        22     2  0 Jul30 ?        00:00:52 [events/3]
        root        23     2  0 Jul30 ?        00:00:54 [events/4]
        root        24     2  0 Jul30 ?        00:00:53 [events/5]
        root        25     2  0 Jul30 ?        00:01:11 [events/6]
        root        26     2  0 Jul30 ?        00:01:43 [events/7]
        root        27     2  0 Jul30 ?        00:00:00 [cpuset]
        root        28     2  0 Jul30 ?        00:00:00 [khelper]
        root        29     2  0 Jul30 ?        00:00:00 [netns]
        root        30     2  0 Jul30 ?        00:00:00 [async/mgr]
        root        31     2  0 Jul30 ?        00:00:00 [pm]
        root        32     2  0 Jul30 ?        00:00:01 [sync_supers]
        root        33     2  0 Jul30 ?        00:00:02 [bdi-default]
        root        34     2  0 Jul30 ?        00:00:00 [kintegrityd/0]
        root        35     2  0 Jul30 ?        00:00:00 [kintegrityd/1]
        root        36     2  0 Jul30 ?        00:00:00 [kintegrityd/2]
        root        37     2  0 Jul30 ?        00:00:00 [kintegrityd/3]
        root        38     2  0 Jul30 ?        00:00:00 [kintegrityd/4]
        root        39     2  0 Jul30 ?        00:00:00 [kintegrityd/5]
        root        40     2  0 Jul30 ?        00:00:00 [kintegrityd/6]
        root        41     2  0 Jul30 ?        00:00:00 [kintegrityd/7]
        root        42     2  0 Jul30 ?        00:00:21 [kblockd/0]
        root        43     2  0 Jul30 ?        00:00:03 [kblockd/1]
        root        44     2  0 Jul30 ?        00:00:15 [kblockd/2]
        root        45     2  0 Jul30 ?        00:00:02 [kblockd/3]
        root        46     2  0 Jul30 ?        00:00:12 [kblockd/4]
        root        47     2  0 Jul30 ?        00:00:01 [kblockd/5]
        root        48     2  0 Jul30 ?        00:00:12 [kblockd/6]
        root        49     2  0 Jul30 ?        00:00:01 [kblockd/7]
        root        50     2  0 Jul30 ?        00:00:00 [kseriod]
        root        59     2  0 Jul30 ?        00:00:00 [khungtaskd]
        root        60     2  0 Jul30 ?        00:00:55 [kswapd0]
        root        61     2  0 Jul30 ?        00:00:00 [aio/0]
        root        62     2  0 Jul30 ?        00:00:00 [aio/1]
        root        63     2  0 Jul30 ?        00:00:00 [aio/2]
        root        64     2  0 Jul30 ?        00:00:00 [aio/3]
        root        65     2  0 Jul30 ?        00:00:00 [aio/4]
        root        66     2  0 Jul30 ?        00:00:00 [aio/5]
        root        67     2  0 Jul30 ?        00:00:00 [aio/6]
        root        68     2  0 Jul30 ?        00:00:00 [aio/7]
        root        69     2  0 Jul30 ?        00:00:00 [crypto/0]
        root        70     2  0 Jul30 ?        00:00:00 [crypto/1]
        root        71     2  0 Jul30 ?        00:00:00 [crypto/2]
        root        72     2  0 Jul30 ?        00:00:00 [crypto/3]
        root        73     2  0 Jul30 ?        00:00:00 [crypto/4]
        root        74     2  0 Jul30 ?        00:00:00 [crypto/5]
        root        75     2  0 Jul30 ?        00:00:00 [crypto/6]
        root        76     2  0 Jul30 ?        00:00:00 [crypto/7]
        root        78     2  0 Jul30 ?        00:00:00 [khvcd]
        root        79     2  0 Jul30 ?        00:00:00 [kpsmoused]
        root        80     2  0 Jul30 ?        00:00:00 [edac-poller]
        root       126     2  0 Jul30 ?        00:00:00 [scsi_tgtd/0]
        root       127     2  0 Jul30 ?        00:00:00 [scsi_tgtd/1]
        root       128     2  0 Jul30 ?        00:00:00 [scsi_tgtd/2]
        root       129     2  0 Jul30 ?        00:00:00 [scsi_tgtd/3]
        root       130     2  0 Jul30 ?        00:00:00 [scsi_tgtd/4]
        root       131     2  0 Jul30 ?        00:00:00 [scsi_tgtd/5]
        root       132     2  0 Jul30 ?        00:00:00 [scsi_tgtd/6]
        root       133     2  0 Jul30 ?        00:00:00 [scsi_tgtd/7]
        root       134     2  0 Jul30 ?        00:00:08 [lpfc_worker_0]
        root       135     2  0 Jul30 ?        00:00:00 [scsi_eh_0]
        root       136     2  0 Jul30 ?        00:00:00 [scsi_wq_0]
        root       137     2  0 Jul30 ?        00:00:00 [fc_wq_0]
        root       138     2  0 Jul30 ?        00:00:00 [fc_dl_0]
        root       139     2  0 Jul30 ?        00:00:09 [lpfc_worker_1]
        root       140     2  0 Jul30 ?        00:00:00 [scsi_eh_1]
        root       141     2  0 Jul30 ?        00:00:00 [scsi_wq_1]
        root       142     2  0 Jul30 ?        00:00:00 [fc_wq_1]
        root       143     2  0 Jul30 ?        00:00:00 [fc_dl_1]
        root       151     2  0 Jul30 ?        00:00:00 [ata/0]
        root       152     2  0 Jul30 ?        00:00:00 [ata/1]
        root       153     2  0 Jul30 ?        00:00:00 [ata/2]
        root       154     2  0 Jul30 ?        00:00:00 [ata/3]
        root       155     2  0 Jul30 ?        00:00:00 [ata/4]
        root       156     2  0 Jul30 ?        00:00:00 [ata/5]
        root       157     2  0 Jul30 ?        00:00:00 [ata/6]
        root       158     2  0 Jul30 ?        00:00:00 [ata/7]
        root       159     2  0 Jul30 ?        00:00:00 [ata_aux]
        root       160     2  0 Jul30 ?        00:00:00 [scsi_eh_2]
        root       593     2  0 Jul30 ?        00:00:42 [flush-8:0]
        root       600     2  0 Jul30 ?        00:02:36 [kjournald]
        root       669     1  0 Jul30 ?        00:00:00 /sbin/udevd --daemon
        root      1214     2  0 Jul30 ?        00:00:00 [kauditd]
        root      1228     2  0 Jul30 ?        00:00:00 [kstriped]
        root      1684     1  0 Jul30 ?        00:00:00 /sbin/srcmstr
        100       1751     1  0 Jul30 ?        00:00:01 /bin/dbus-daemon --system
        root      1768     1  0 Jul30 ?        00:00:03 /sbin/syslog-ng
        root      1771     1  0 Jul30 ?        00:00:00 /sbin/klogd -c 1 -x
        root      1828     1  0 Jul30 ?        00:00:55 /usr/bin/lin_taped start
        101       1868     1  0 Jul30 ?        00:00:00 /usr/sbin/hald --daemon=yes
        root      1871     1  0 Jul30 ?        00:00:00 /usr/sbin/console-kit-daemon
        root      1872  1868  0 Jul30 ?        00:00:00 hald-runner
        root      2542     1  0 Jul30 ?        00:00:01 /opt/ibm/icc/bin/cimlistener -D
        root      2554     1  0 Jul30 ?        00:00:14 ./dirsnmpd -x /var/run/agentx/ma
        root      2558     1  0 Jul30 ?        00:00:00 /sbin/auditd -s disable
        root      2560  2558  0 Jul30 ?        00:00:01 /sbin/audispd
        daemon    2607     1  0 Jul30 ?        00:00:43 /opt/ibm/icc/bin/slpd
        root      2608     1  0 Jul30 ?        00:00:00 /opt/ibm/icc/bin/cimserver -D /e
        root      2616     1  0 Jul30 ?        00:00:00 /etc/opt/ibm/icc/bin/cimprovagt
        root      2620     1  0 Jul30 ?        00:00:00 /etc/opt/ibm/icc/bin/cimprovagt
        root      2630     1  0 Jul30 ?        00:00:00 /etc/opt/ibm/icc/bin/cimprovagt
        root      2656  1684  0 Jul30 ?        00:00:46 /usr/sbin/rsct/bin/rmcd -a IBM.L
        root      2728  1684  0 Jul30 ?        00:00:00 /usr/sbin/rsct/bin/IBM.ServiceRM
        root      2762     1  0 Jul30 ?        00:00:01 /sbin/rpcbind
        root      2794     1  0 Jul30 ?        00:00:00 /opt/ibm/platform/bin/tier1slp
        root      3066  1684  0 Jul30 ?        00:00:00 /usr/sbin/rsct/bin/IBM.DRMd
        root      3176     1  0 Jul30 ?        00:00:00 /sbin/iprinit --daemon
        root      3187     1  0 Jul30 ?        00:00:00 /sbin/iprupdate --daemon
        root      3255  3410  0 11:13 ?        00:00:00 sshd: root@pts/0
        root      3270  3255  0 11:13 pts/0    00:00:00 -bash
        root      3397     1  0 Jul30 ?        00:00:00 pure-ftpd (SERVER)
        root      3410     1  0 Jul30 ?        00:00:00 /usr/sbin/sshd -o PidFile=/var/r
        root      3423     1  0 Jul30 ?        00:00:00 /usr/sbin/cupsd
        root      3424     1  0 Jul30 ?        00:00:00 /sbin/iprdump --daemon
        root      3440     1  0 Jul30 ?        00:03:19 /usr/sbin/irqbalance
        root      3453     1  0 Jul30 ?        00:00:38 /usr/sbin/nscd
        root      3473     1  0 Jul30 ?        00:00:00 /usr/sbin/rtas_errd
        root      3542     1  0 Jul30 ?        00:00:12 /usr/lib/postfix/master
        root      3567     1  0 Jul30 ?        00:00:02 /usr/sbin/cron
        postfix   3579  3542  0 Jul30 ?        00:00:04 qmgr -l -t fifo -u
        root      3585     1  0 Jul30 tty1     00:00:00 /sbin/mingetty --noclear tty1
        root      3604     1  0 Jul30 tty2     00:00:00 /sbin/mingetty tty2
        root      3605     1  0 Jul30 tty3     00:00:00 /sbin/mingetty tty3
        root      3606     1  0 Jul30 tty4     00:00:00 /sbin/mingetty tty4
        root      3607     1  0 Jul30 tty5     00:00:00 /sbin/mingetty tty5
        root      3608     1  0 Jul30 tty6     00:00:00 /sbin/mingetty tty6
        root      3682     1  0 Jul30 ?        00:00:00 /sbin/agetty -L 38400 console
        root      3687     1  0 Jul30 ?        00:02:39 /opt/tivoli/tsm/db2/bin/db2fmcd
        root      4400  1684  0 11:27 ?        00:00:00 /usr/sbin/rsct/bin/IBM.HostRMd
        postfix   5723  3542  0 11:41 ?        00:00:00 cleanup -z -t unix -u
        postfix   5735  3542  0 11:41 ?        00:00:00 local -t unix
        postfix   5807  3542  0 11:41 ?        00:00:00 smtp -t unix -u
        postfix   5808  3542  0 11:41 ?        00:00:00 bounce -z -n defer -t unix -u
        root      5821  3270  0 11:41 pts/0    00:00:00 ps -ef
        ntp      19468     1  0 Aug02 ?        00:00:44 /usr/sbin/ntpd -p /var/run/ntp/n
        postfix  30255  3542  0 10:07 ?        00:00:00 pickup -l -t fifo -u

  • robberendt
    robberendt
    27 Posts
    ACCEPTED ANSWER

    Re: How do I modify UPS settings on suse Linux running on Power 6?

    ‏2013-08-15T19:43:23Z  in response to robberendt

    I think I've hit it.  Read the following:

    For the equivalent of QUPSDLYTIM on suse linux be sure to look at the file
    /etc/rc.powerfail
    In there you will see a section like:
    #
    # long_warning()
    #
    # This function is called in response to a 10-minute warning.  The default
    # response is to check for status updates every 5 seconds.  If the status
    # does not improve within 8 minutes, the system will be shut down.  If the
    # status worsens, the system will be shut down immediately.  This routine
    # can be modified to send e-mail messages or pages.
    #
    long_warning()
    {
            time=480                # seconds until shutdown begins (8 minutes)


    Be aware, there are a lot of screen messages and whatnot in this file
    which echo back stuff like:


            6)                      # secondary fan failure
                    notify \
                        "A secondary fan has experienced a failure." \
                        "The system will begin shutting down in 8 minutes if
    the problem is not remedied."
                    long_warning

    or

            7)                      # battery backup
                    notify \
                        "The system has switched to battery backup." \
                        "The system will begin shutting down in 8 minutes if
    the problem is not remedied."
                    long_warning

    Updated on 2013-08-15T19:45:52Z at 2013-08-15T19:45:52Z by robberendt