How to configure ACP UPS in mga5 x86_64?

This forum is dedicated to basic help and support :

Ask here your questions about basic installation and usage of Mageia. For example you may post here all your questions about getting Mageia isos and installing it, configuring your printer, using your word processor etc.

Try to ask your questions in the right sub-forum with as much details as you can gather. the more precise the question will be, the more likely you are to get a useful answer

How to configure ACP UPS in mga5 x86_64?

Postby magfan » Feb 22nd, '16, 16:11

How can I configure my ACP UPS in mga5 x86_64? Unfortunately, ACP does not provide a 64-bit version of their software and the installation of their pbeagent requires a 32-bit GLIBC:
Code: Select all
# rpm -i pbeagent-9.2.0-604.i386.rpm
Warnung: pbeagent-9.2.0-604.i386.rpm: Header V3 DSA/SHA1 Signature, Schlüssel-ID bb271b8a: NOKEY

############### ATTENTION ###############
A 32 bit version of GLIBC is required.
Please install this and run the installer again.
e.g. yum install glibc.i686
##########################################

Fehler: %prein(pbeagent-9.2.0-604.i386) Scriptlet fehlgeschlagen, Beenden-Status 3
Fehler: pbeagent-9.2.0-604.i386: installieren fehlgeschlagen
#

My APC UPS:
Code: Select all
# lsusb -D /dev/bus/usb/003/003
Device: ID 051d:0002 American Power Conversion Uninterruptible Power Supply
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               1.10
  bDeviceClass            0
  bDeviceSubClass         0
  bDeviceProtocol         0
  bMaxPacketSize0         8
  idVendor           0x051d American Power Conversion
  idProduct          0x0002 Uninterruptible Power Supply
  bcdDevice            0.06
  iManufacturer           3 American Power Conversion
  iProduct                1 Smart-UPS 2200 FW:654.19.I USB FW:7.4
  iSerial                 2 JS1033022223
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength           34
    bNumInterfaces          1
    bConfigurationValue     1
    iConfiguration         11 1
    bmAttributes         0xe0
      Self Powered
      Remote Wakeup
    MaxPower               30mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           1
      bInterfaceClass         3 Human Interface Device
      bInterfaceSubClass      0
      bInterfaceProtocol      0
      iInterface              0
        HID Device Descriptor:
          bLength                 9
          bDescriptorType        33
          bcdHID               1.10
          bCountryCode           33 US
          bNumDescriptors         1
          bDescriptorType        34 Report
          wDescriptorLength    1064
         Report Descriptors:
           ** UNAVAILABLE **
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0006  1x 6 bytes
        bInterval             100
can't get debug descriptor: Resource temporarily unavailable
Device Status:     0x0001
  Self Powered
#
magfan
 
Posts: 334
Joined: Apr 3rd, '12, 12:33

Re: How to configure ACP UPS in mga5 x86_64?

Postby doktor5000 » Feb 22nd, '16, 20:11

Well glibc is dual-arch, maybe it's simply their tests that fail? You could check via
Code: Select all
rpm -qp --scripts --triggers pbeagent-9.2.0-604.i386.rpm
what they're doing.

Apart from that, did you try to run harddrake2 with that thing attached?
We also have apcupsd and nut packages in our repos, nut-server is what harddrake usually installs IIRC although I don't have a ups.

Code: Select all
[doktor5000@Mageia5]─[19:10:01]─[~] urpmq -i apcupsd
Name        : apcupsd
Version     : 3.14.13
Release     : 3.mga5
Group       : System/Servers
Size        : 1867353                      Architecture: x86_64
Source RPM  : apcupsd-3.14.13-3.mga5.src.rpm
URL         : http://sourceforge.net/projects/apcupsd/
Summary     : Power management software for APC UPS hardware
Description :
UPS power management under Linux for APCC Products. It allows your
computer/server to run during power problems for a specified length of time or
the life of the batteries in your BackUPS, BackUPS Pro, SmartUPS v/s, or
SmartUPS, and then properly executes a controlled shutdown during an extended
power failure.

[doktor5000@Mageia5]─[19:10:10]─[~] urpmq -i nut
Name        : nut
Version     : 2.6.5
Release     : 15.mga5
Group       : System/Kernel and hardware
Size        : 2280631                      Architecture: x86_64
Source RPM  : nut-2.6.5-15.mga5.src.rpm
URL         : http://www.networkupstools.org/
Summary     : Network UPS Tools Client Utilities
Description :
These programs are part of a developing project to monitor the assortment of
UPSes that are found out there in the field. Many models have serial ports of
some kind that allow some form of state checking. This capability has been
harnessed where possible to allow for safe shutdowns, live status tracking on
web pages, and more.

This package includes the client utilities that are required to monitor a UPS
that the client host is powered from - either connected directly via a serial
port (in which case the nut-server package needs to be installed on this
machine) or across the network (where another host on the network monitors the
UPS via serial cable and runs the main nut package to allow clients to see the
information).
Cauldron is not for the faint of heart!
Caution: Hot, bubbling magic inside. May explode or cook your kittens!
----
Disclaimer: Beware of allergic reactions in answer to unconstructive complaint-type posts
User avatar
doktor5000
 
Posts: 18057
Joined: Jun 4th, '11, 10:10
Location: Leipzig, Germany

Re: How to configure ACP UPS in mga5 x86_64?

Postby magfan » Feb 23rd, '16, 08:42

Yes, the install script fails right in the beginning:
Code: Select all
# rpm -qp --scripts --triggers pbeagent-9.2.0-604.i386.rpm
preinstall scriptlet (using /bin/sh):
#
# This section is run prior to the %install section so we can check our pre-requisites.
#
if [ -e /etc/rc.d/init.d/PowerChute -o -e /etc/init.d/PowerChute ]; then
    echo ""
    echo "############### ATTENTION ###############"
    echo "PowerChute Network Shutdown is installed. Please uninstall PCNS."
    echo "##########################################"
    echo ""
    exit 2
fi
if [ -e /opt/APC/PowerChuteBusinessEdition/Agent/uninstallPowerChuteBusinessEditionAgent ]; then
    echo ""
    echo "############### ATTENTION ###############"
    echo "PowerChute Business Edition is installed. Please uninstall PCBE."
    echo "##########################################"
    echo ""
    exit 1
fi
ARCH=`uname -p`
LIBCFOUND="false"
if [[ $ARCH == "x86_64" ]]; then
                if [ -f /etc/redhat-release ]; then
                        rpm -qa --qf "%{n}.%{arch}\n" | grep glibc.i686 1>/dev/null 2>/dev/null
                        if [ $? == 0 ]; then
                                LIBCFOUND="true"
                        fi
                                                                                                                                     
                        if [[ $LIBCFOUND == "false" ]]; then                                                                         
                            echo ""                                                                                                   
                            echo "############### ATTENTION ###############"                                                         
                                echo "A 32 bit version of GLIBC is required."                                                         
                                echo "Please install this and run the installer again."                                               
                                echo "e.g. yum install glibc.i686"
                                echo "##########################################"
                                echo ""
                                exit 3
                        fi
                fi
fi
...

The output on my system is:
Code: Select all
# rpm -qa --qf "%{n}.%{arch}\n" | grep glibc.i686
# rpm -qa --qf "%{n}.%{arch}\n" | grep glibc
glibc-profile.x86_64
glibc-doc.noarch
lib64glibc_lsb.x86_64
glibc-i18ndata.x86_64
glibc-debuginfo.x86_64
glibc.x86_64
glibc-devel.x86_64
#

What can I do to convince the script that there is a 32-bit glibc? Or is it really missing?
magfan
 
Posts: 334
Joined: Apr 3rd, '12, 12:33

Re: How to configure ACP UPS in mga5 x86_64?

Postby doktor5000 » Feb 23rd, '16, 21:12

magfan wrote:What can I do to convince the script that there is a 32-bit glibc? Or is it really missing?

Well, you cannot really convince the script, and it will always fail as we don't use i686 but i586. And the package is not missing, that script is simply tailored to Redhat.

I'd have to check if it's easily possible to modify the package metadata which includes the script, but there are a few other options:
- install the package via --noscripts - you would have to do all the things in the %pre/%post scripts manually, but shouldn't be too hard
- I could create a bogus, empty glibc i686 package, but I'm not sure that this won't introduce any other dependendency issues
- extract the contents of the package via rpm2cpio and install them manually - least favorable, better use --noscripts
Cauldron is not for the faint of heart!
Caution: Hot, bubbling magic inside. May explode or cook your kittens!
----
Disclaimer: Beware of allergic reactions in answer to unconstructive complaint-type posts
User avatar
doktor5000
 
Posts: 18057
Joined: Jun 4th, '11, 10:10
Location: Leipzig, Germany

Re: How to configure ACP UPS in mga5 x86_64?

Postby daniewicz » Feb 24th, '16, 05:51

I have used apcupsd in the past. You may need to manually edit /etc/apcuspd/apcupsd.conf
The dude abides.
User avatar
daniewicz
 
Posts: 224
Joined: Feb 10th, '13, 03:37

Re: How to configure ACP UPS in mga5 x86_64?

Postby magfan » Feb 24th, '16, 10:41

@doktor5000: Finally I could install pbeagent. I edited the script (setting LIBFOUND="true") and installed the rebuilt rpm package:
Code: Select all
rpmrebuild -e -p pbeagent-9.2.0-604.i386.rpm
rpm --install --nodeps /root/rpmbuild/RPMS/i386/pbeagent-9.2.0-604.i386.rpm

The agent is running now and I can login into PowerChute:
Code: Select all
https://localhost:6547

The problem now is that my system does not have a serial port. Connecting the UPS via USB is physically possible and officially supported by APC, but the agent does not connect to the UPS.

@daniewicz: I was thinking about apcupsd but could not find an example how to send UPS failure messages via an external SMTP server.
magfan
 
Posts: 334
Joined: Apr 3rd, '12, 12:33


Return to Basic support

Who is online

Users browsing this forum: No registered users and 1 guest