AIX: upgrade to using Linux Tool Box packages via yum

Follow it if you have already installed oldc rpm package of RRDTool and Apache to the one using yum (Linux Tool Box)
It is typically when you have rrdtool 1.4.8 and Apache like 2.4.18.
To upgrade to the latest version,
  1. Remove nearly all existing packages, in our test example it was:
    rpm --nodeps -e libjpeg expat libiconv openssl zlib freetype2 gettext libdatrie libthai libXrender fontconfig libffi glib2 libpng libxcb xz libxml2 libcroco libart_lgpl lzo pixman atk jasper jbigkit jbigkit-libs libtiff gtk2 librsvg2 cairo pango gtk2 libdbi dejavu-sans-mono-fonts dejavu--lgc-sans-mono-fonts gdbm perl perl-TimeDate perl-XML-Simple perl-XML-Parser perl-URI perl-XML-SAX perl-XML-LibXML perl-XML-SAX-Base perl-XML-NamespaceSupport net-snmp-util net-snmp-perl perl-DBI dejavu-lgc-sans-mono-fonts perl-Net_SSLeay.pm xz-libs perl-Compress-Raw-Zlib net-snmp-utils unzip info gtk2-immodules db tcl net-snmp-utils ncurses libXpm pcre expect perl-DBD-Pg sudo libgcc perl-Want postgresql-libs lemon gts graphviz xorg-compat-aix python python-iniparse ca-certificates python-pycurl python-tools gettext gdbm tk gd wget perl-IO-Tty httpd sqlite net-snmp bzip2 perl-DBD-SQLite swig perl-Crypt-SSLeay vnc pkg-config readline lua pysqlite curl python-urlgrabber python-devel glib2
    
    But it might vary in different environments, basically here is what could stay there:
    rpm -qa
      lpar2rrd-agent-7.20-5.ppc
      yum-3.4.3-8.noarch
      AIX-rpm-7.1.4.30-4.ppc
      bash-3.0-1.ppc
      yum-metadata-parser-1.1.4-2.ppc
    
  2. You can even use this script to remove everything public.dhe.ibm.com/aix/freeSoftware/aixtoolbox/contrib/destroyRPMS
    Then install rpm base
    ./destroyRPMS
    installp -YqacXFd rpm.rte.4.15.1.1006 all                                                                                                    
    
  3. AIX 7.3 DNF support, get this: https://public.dhe.ibm.com/aix/freeSoftware/aixtoolbox/ezinstall/ppc/dnf_aixtoolbox.sh
    ./dnf_aixtoolbox.sh -d 
    dnf update
    
  4. Activate yum as per IBM procedure, download "yum.sh" and run it, then run this:
    updtvpkg
    
  5. Install as per AIX yum install
    yum install httpd rrdtool rrdtool-perl
    yum install net-snmp net-snmp-utils net-snmp-perl
    
  6. Make sure installated package is working, it should not proint any error (rrdtool 1.7.2 might print an error, check Troubleshooting section)
    /opt/freeware/bin/rrdtool_32 -v
    /opt/freeware/bin/rrdtool -v
    
  7. Apache configuration, append into /opt/freeware/etc/httpd/conf/httpd.conf this:
    vi /opt/freeware/etc/httpd/conf/httpd.conf
    
    Enable CGI (it is hashed by default):
    <IfModule mpm_prefork_module>
            LoadModule cgi_module /opt/freeware/lib/httpd/modules/mod_cgi.so
    </IfModule>
    
    Add this:
    # LPAR2RRD
    LoadModule cgi_module /opt/freeware/lib/httpd/modules/mod_cgi.so
    Alias /lpar2rrd  "/home/lpar2rrd/lpar2rrd/www/"
    <Directory "/home/lpar2rrd/lpar2rrd/www/">
        Options Indexes FollowSymLinks Includes MultiViews
        Require all granted
    </Directory>
    
    # CGI-BIN
    ScriptAlias /lpar2rrd-cgi/ "/home/lpar2rrd/lpar2rrd/lpar2rrd-cgi/"
    <Directory "/home/lpar2rrd/lpar2rrd/lpar2rrd-cgi">
        AllowOverride None
        SetHandler cgi-script
        Options ExecCGI Includes FollowSymLinks
        Require all granted
    </Directory>
    
    
    # STOR2RRD
    Alias /stor2rrd  "/home/stor2rrd/stor2rrd/www/"
    <Directory "/home/stor2rrd/stor2rrd/www/">
        Options Indexes FollowSymLinks Includes MultiViews
        Require all granted
    </Directory>
    
    # CGI-BIN
    ScriptAlias /stor2rrd-cgi/ "/home/stor2rrd/stor2rrd/stor2rrd-cgi/"
    <Directory "/home/stor2rrd/stor2rrd/stor2rrd-cgi">
        AllowOverride None
        SetHandler cgi-script
        Options ExecCGI Includes FollowSymLinks
        Require all granted
    </Directory>
    
    Apache restart:
    /opt/freeware/sbin/apachectl restart
    
  8. Change LPAR2RRD/STOR2RRD parameters:
    Definitelly use /usr/bin/perl and 32bit rrdtool: /opt/freeware/bin/rrdtool_32
    • LPAR2RRD: edit /home/lpar2rrd/lpar2rrd/etc/lpar2rrd.cfg
      RRDTOOL=/opt/freeware/bin/rrdtool_32
      PERL=/usr/bin/perl
      PERL5LIB=/home/lpar2rrd/lpar2rrd/bin:/home/lpar2rrd/lpar2rrd/lib:/opt/freeware/lib/perl5/5.34/vendor_perl:/opt/freeware/lib64/perl5/5.34/vendor_perl:/opt/freeware/lib/perl5/5.38/vendor_perl:/opt/freeware/lib64/perl5/5.38/vendor_perl
      
    • STOR2RRD: edit /home/stor2rrd/stor2rrd/etc/stor2rrd.cfg
      RRDTOOL=/opt/freeware/bin/rrdtool_32
      PERL=/usr/bin/perl
      PERL5LIB=/home/stor2rrd/stor2rrd/bin:/home/stor2rrd/stor2rrd/lib:/opt/freeware/lib/perl5/5.34/vendor_perl:/opt/freeware/lib64/perl5/5.34/vendor_perl:/opt/freeware/lib/perl5/5.38/vendor_perl:/opt/freeware/lib64/perl5/5.38/vendor_perl
      
    Adjust above PERL5LIB path based on which Perl you have in /opt/freeware/bin/perl, above example works for "5.34" and "5.38", you see it in the paths:
    # /opt/freeware/bin/perl -v| head -2
    
    This is perl 5, version 34, subversion 1 (v5.34.1) built for ppc-aix-thread-multi-64all
    
  9. Make sure that it is correct, it should not produce any output
    cd /home/lpar2rrd/lpar2rrd
     . etc/lpar2rrd.cfg; $PERL bin/perl_modules_check.pl 
    

Troubleshooting

  • In some cases is necessary to set LIBPATH, do not do it unless you see such error during load.sh
    Can't load '/usr/opt/perl5/lib/site_perl/5.28.1/aix-thread-multi/auto/XML/Parser/Expat/Expat.so' for module XML::Parser::Expat: Could not load module /usr/opt/perl5/lib/site_perl/5.28.1/aix-thread-multi/auto/XML/Parser/Expat/Expat.so
    
    or this one:
    Could not load module /opt/freeware/lib/libcairo.a(libcairo.so.2).
            Dependent module /usr/lib/libXrender.a(libXrender.so.1) could not be loaded.
            Member libXrender.so.1 is not found in archive
    Could not load module rrdtool_64.
            Dependent module /opt/freeware/lib/libcairo.a(libcairo.so.2) could not be loaded.
    
    In both cases:
    su - lpar2rrd
    cd /home/lpar2rrd/lpar2rrd
    umask 022
    echo "export LIBPATH=/opt/freeware/lib" >> etc/.magic
    
  • RRDTOOL 1.7.2 problem (only 32bit one)
    /opt/freeware/bin/rrdtool_32 -v
      exec(): 0509-036 Cannot load program /opt/freeware/bin/rrdtool_32 because of the following errors:
      0509-130 Symbol resolution failed for /opt/freeware/lib/libpangocairo-1.0.a(libpangocairo-1.0.so.0) because:
      0509-136 Symbol __dbargs (number 185) is not exported from
      dependent module /opt/freeware/lib/libpixman-1.a(libpixman-1.so.0).
      0509-136 Symbol __dbsubc (number 186) is not exported from
      dependent module /opt/freeware/lib/libpixman-1.a(libpixman-1.so.0).
      0509-136 Symbol __dbsubg (number 187) is not exported from
      dependent module /opt/freeware/lib/libpixman-1.a(libpixman-1.so.0).
      0509-136 Symbol __dbsubn (number 188) is not exported from
      dependent module /opt/freeware/lib/libpixman-1.a(libpixman-1.so.0).
      0509-192 Examine .loader section symbols with the
      'dump -Tv' command.
    
    Fix it by removing "pixman" package, ignore dependencies
    yum erase pixman