User Tools

Site Tools


aix:lpar2rrd

LPAR2RRD

This is a tool easy to use because it collect statistics on one single point, the HMC and/or IVM.

Source packages

http://www.lpar2rrd.com/

Missing rpm in the list:

perl-Env

http://www.perzl.org/aix/

Install RPM packages

# What I basically install on AIX server
rpm -Uhv lsof-4.87-1.aix7.1.ppc.rpm 
rpm -Uhv zlib-1.2.8-1.aix5.1.ppc.rpm
rpm -Uhv gmp-5.0.5-1.aix5.1.ppc.rpm
rpm -Uhv bzip2-1.0.6-1.aix5.1.ppc.rpm
rpm -Uhv popt-1.16-1.aix5.1.ppc.rpm
rpm -Uhv bash-4.2-12.aix5.1.ppc.rpm
rpm -Uhv coreutils-8.21-1.aix5.1.ppc.rpm
rpm -Uhv logrotate-3.8.2-1.aix5.1.ppc.rpm
rpm -Uhv zip-3.0-1.aix5.1.ppc.rpm
rpm -Uhv unzip-6.0-2.aix5.1.ppc.rpm

# for rrdtool 1.4
rpm -Uhv xz-libs-5.0.4-1.aix5.1.ppc.rpm
rpm -Uhv gettext-0.10.40-8.aix5.2.ppc.rpm
rpm -Uhv libiconv-1.14-2.aix5.1.ppc.rpm
rpm -Uhv libgcc-4.8.1-1.aix7.1.ppc.rpm 
rpm -Uhv libpng-1.6.3-1.aix5.1.ppc.rpm 
rpm -Uhv libxml2-2.9.1-1.aix5.1.ppc.rpm
rpm -Uhv libffi-3.0.13-1.aix5.1.ppc.rpm
rpm -Uhv glib2-2.34.3-1.aix5.1.ppc.rpm 
rpm -Uhv libxcb-1.7-1.aix5.1.ppc.rpm 
rpm -Uhv lzo-2.06-1.aix5.1.ppc.rpm
rpm -Uhv expat-2.1.0-1.aix5.1.ppc.rpm
rpm -Uhv fontconfig-2.8.0-2.aix5.1.ppc.rpm freetype2-2.5.0-1.aix5.1.ppc.rpm
rpm -Uhv pixman-0.28.2-1.aix5.1.ppc.rpm
rpm -Uhv libXrender-0.9.8-1.aix6.1.ppc.rpm
rpm -Uhv atk-1.32.0-1.aix5.1.ppc.rpm
rpm -Uhv libjpeg-9-1.aix5.1.ppc.rpm
rpm -Uhv jbigkit-libs-2.0-2.aix5.1.ppc.rpm
rpm -Uhv libtiff-4.0.3-1.aix5.1.ppc.rpm
rpm -Uhv jasper-1.900.1-2.aix5.1.ppc.rpm
rpm -Uhv libdatrie-0.2.4-1.aix5.1.ppc.rpm 
rpm -Uhv libthai-0.1.18-1.aix5.1.ppc.rpm
rpm -Uhv libcroco-0.6.5-1.aix5.1.ppc.rpm
rpm -Uhv libart_lgpl-2.3.21-1.aix5.1.ppc.rpm
rpm -Uhv pango-1.24.5-1.aix5.1.ppc.rpm librsvg2-2.34.2-1.aix5.1.ppc.rpm cairo-1.12.14-1.aix5.1.ppc.rpm gtk2-2.20.1-2.aix5.1.ppc.rpm
rpm -Uhv libdbi-0.8.4-1.aix5.1.ppc.rpm 
rpm -Uhv openssl-1.0.1f-1.aix5.1.ppc.rpm 
rpm -Uhv dejavu-lgc-sans-mono-fonts-2.33-1.aix5.1.noarch.rpm dejavu-sans-mono-fonts-2.33-1.aix5.1.noarch.rpm
rpm -Uhv rrdtool-1.4.8-2.aix5.1.ppc.rpm
rpm -Uhv rrdtool-cached-1.4.8-2.aix5.1.ppc.rpm
rpm -Uhv gdbm-1.10-1.aix5.1.ppc.rpm
rpm -Uhv perl-5.8.8-2.aix5.1.ppc.rpm
rpm -Uhv rrdtool-perl-1.4.8-2.aix5.1.ppc.rpm
rpm -Uhv perl-TimeDate-1.20-1.aix5.1.noarch.rpm
rpm -Uhv perl-URI-1.58-1.aix5.1.noarch.rpm
rpm -Uhv perl-XML-Parser-2.41-1.aix5.1.ppc.rpm
rpm -Uhv perl-XML-Simple-2.18-1.aix5.1.noarch.rpm
rpm -Uhv perl-XML-LibXML-Common-0.13-1.aix5.1.ppc.rpm
rpm -Uhv perl-XML-LibXML-2.0012-1.aix5.1.ppc.rpm
rpm -Uhv perl-XML-SAX-0.99-1.aix5.1.noarch.rpm

Create apache user

mkgroup id=501 apache mkuser id=501 apache chuser data=-1 stack=-1 rss=-1 apache

# packages needed for http server
rpm -Uhv db4-4.7.25-2.aix5.1.ppc.rpm
rpm -Uhv info-5.1-1.aix5.1.ppc.rpm
rpm -Uhv readline-6.2-4.aix5.1.ppc.rpm
rpm -Uhv apr-1.4.8-1.aix5.2.ppc.rpm
rpm -Uhv pcre-8.33-1.aix5.1.ppc.rpm
rpm -Uhv apr-util-1.5.2-1.aix5.1.ppc.rpm
rpm -Uhv openldap-2.4.23-0.3.aix5.1.ppc.rpm
rpm -Uhv apr-util-ldap-1.5.2-1.aix5.1.ppc.rpm
rpm -Uhv httpd-2.4.6-1.aix5.1.ppc.rpm

Create user for LPAR2RRD

As root user:

mkuser id=500 lpar2rrd
echo "lpar2rrd:lpar2rrd" | chpasswd -c
chuser  data=-1 stack=-1 rss=-1 lpar2rrd

# Generate a RSA key (even if the doc specify DSA, RSA works too)
su - lpar2rrd
ssh-keygen -t rsa -b 2048
## Probably no more needed. Automatically create at installation
#cp .ssh/id_rsa .ssh/realt_dsa
#chown apache /home/lpar2rrd/.ssh/realt_dsa

mkdir /var/www/htdocs/lpar2rrd
chown -R lpar2rrd.staff /var/www/htdocs/lpar2rrd

HMC connection

On the HMC,create a user lpar2rrd and add the public key:

[lpar2rrd@monitor2]/home/lpar2rrd# cat .ssh/id_rsa.pub
ssh-rss AAAAB3NzaC1kc3MAAACBALvbupPL
nqy6UfJjgMG5SRnnFDfD013OtBxFv8P7qoHfGKCG0Vu2IhNCYttpYMmsMR+BWADo4c9oT7r92raLfVDjNW
8uO5C5fatK305+sNqazbT91HDDNDKQnbpoKUqybVRC2BQbPR8ESh+ws3uHdxXSQKwOSyrHO6Nwkkx8/h4T
AAAAFQDZgT9MxrEUQg4uOwxhciwwdoOO8QAAAIAH37x06Ia4FiCdlk3U9vuOI0QEvCKMXL+ZPFNoRcgiqi
CnR2WeiaG5qM+odYWk/F/owV0Y/DmkmrrjPrgDADjS1uKoSy+NMg803+4cS1B06EMtia+RmMbWkr+kQZ90
WvB8C5cxofzcllnQjztQxVrZnZPmMI73/SQdS7QBU9a9WwAAAIA3VAdMvP+ZO3zs57FaznMySoszxgNWxu
INlcP61TQuyuCp5Bq3mFXwxFwJWPpqpbW5yHj9N1+3pscSsFxEQb9YVvb1oL9c5QdPDnmXZK8BHHmNZ{{M
n+ftuzJKHgR2lynaxQ4hxTnz+xT0ywGwokeuuCnr4G3Bftc70Yn9vCNjuzGQ== lpar2rrd@p550-2
[lpar2rrd@monitor2]/home/lpar2rrd# ssh -l hscroot luhmc1
hscroot@luhmc1:~> mkhmcusr -u lpar2rrd -a hmcviewer --passwd abc1234
hscroot@luhmc1:~> mkauthkeys -u lpar2rrd -a 'ssh-rss AAAAB3NzaC1kc3MAAACBALvbupPL
nqy6UfJjgMG5SRnnFDfD013OtBxFv8P7qoHfGKCG0Vu2IhNCYttpYMmsMR+BWADo4c9oT7r92raLfVDjNW
8uO5C5fatK305+sNqazbT91HDDNDKQnbpoKUqybVRC2BQbPR8ESh+ws3uHdxXSQKwOSyrHO6Nwkkx8/h4T
AAAAFQDZgT9MxrEUQg4uOwxhciwwdoOO8QAAAIAH37x06Ia4FiCdlk3U9vuOI0QEvCKMXL+ZPFNoRcgiqi
CnR2WeiaG5qM+odYWk/F/owV0Y/DmkmrrjPrgDADjS1uKoSy+NMg803+4cS1B06EMtia+RmMbWkr+kQZ90
WvB8C5cxofzcllnQjztQxVrZnZPmMI73/SQdS7QBU9a9WwAAAIA3VAdMvP+ZO3zs57FaznMySoszxgNWxu
INlcP61TQuyuCp5Bq3mFXwxFwJWPpqpbW5yHj9N1+3pscSsFxEQb9YVvb1oL9c5QdPDnmXZK8BHHmNZ{{M
n+ftuzJKHgR2lynaxQ4hxTnz+xT0ywGwokeuuCnr4G3Bftc70Yn9vCNjuzGQ== lpar2rrd@p550-2'

Enable collect of statistics on the HMC:

hscroot@luhmc1:~> chlparutil -r config -s 60
hscroot@luhmc1:~> lslparutil -r config  -F name,sample_rate
PWR6A-9117-MMA-SN103A4B0,60
PWR6B-9117-MMA-SN103B5C0,60

As lpar2rrd: try a connection to HMC to accept the ssh key.

[lpar2rrd@monitor2]/home/lpar2rrd# ssh luhmc1
Last login: Tue Mar 12 10:36:55 2013 from 192.168.222.155
lpar2rrd@luhmc1:~>

Install LPAR2rrd package

As lpar2rrd unpack and install the package:

tar xvf /mnt/monitoring/lpar2rrd-4.70.tar
cd lpar2rrd-4.70

[lpar2rrd@monitor2]/home/lpar2rrd/lpar2rrd-4.70# ./install.sh
LPAR2RRD installation under user : "lpar2rrd"
 make sure it is realy the user which should own it

Where LPAR2RRD will be installed [/home/lpar2rrd/lpar2rrd]:
/var/www/htdocs/lpar2rrd

Extracting distribution
Copy distribution to the target location
Setting up directory permissions
Configuring /var/www/htdocs/lpar2rrd/etc/lpar2rrd.cfg
Do you want to create ssh-keys now (ssh-keygen -t dsa)?[n]


Favourites config file creation
Favourites initial configuration is running:
  /var/www/htdocs/lpar2rrd/etc/favourites.cfg

Alerting config file creation
Alerting initial configuration is running:
  /var/www/htdocs/lpar2rrd/etc/alert.cfg

ERROR: Perl module has not been found: Date::Parse

Install all missing Perl modules and do this test again, check http://www.lpar2rrd.com/install.htm:
Usage: . etc/lpar2rrd.cfg; $PERL bin/perl_modules_check.pl $PERL

Installation has finished
Follow post-install instructions at:
  http://www.lpar2rrd.com/install.htm

Update config file

Update the configuration file, and check PATHs for PERL (use AIX perl) and PERL5LIB

# vi /var/www/htdocs/lpar2rrd/etc/lpar2rrd.cfg
LPAR2RRD_AGENT_DAEMON=1
HMC_LIST="luhmc1"
PERL=/usr/bin/perl
PERL5LIB=/opt/freeware/lib/perl5/vendor_perl/5.8.8:/opt/freeware/lib/perl5/site_perl/5.8.8:/opt/freeware/lib/perl/5.8.8:/var/www/htdocs/lpar2rrd/bin

SSH="ssh" 

Test config

Test the perl modules:

[lpar2rrd@monitor2]/var/www/htdocs/lpar2rrd# . etc/lpar2rrd.cfg ; $PERL bin/perl_modules_check.pl $PERL

Test the configuration file:

[lpar2rrd@monitor2]/var/www/htdocs/lpar2rrd/bin# ./sample_rate.sh
Going to check HMC as user lpar2rrd, will ask for a password if there is not allowed automatic access
luhmc1:P55A-9133-55A-SN06C1B4G sample rate : 60, OK
luhmc1:P720-8202-E4B-SN06D457P sample rate : 60, OK
[lpar2rrd@monitor2]/var/www/htdocs/lpar2rrd# ./load.sh
LPAR2RRD free version 3.42
Host           : monitor2
HMC            : luhmc1
date start     : luhmc1 Tue Mar 26 10:08:02 2013
managed system : luhmc1:P55A-9133-55A-SN06C1B4G (type_model*serial : 9133-55A*06C1B4G)
HMC version    : luhmc1 77500
sample rate    : luhmc1:P55A-9133-55A-SN06C1B4G 60 seconds
last rec       : luhmc1:P55A-9133-55A-SN06C1B4G 03/26/2013 09:59:01 /var/www/htdocs/lpar2rrd/data/P55A-9133-55A-SN06C1B4G/luhmc1/last.txt
.............

Apache config

Create symbolic links: apachectl (start/stop apache), httpd -S : to test httpd.conf

Now edit http.conf:

vi /opt/freeware/etc/httpd/conf/httpd.conf
1. verify alias_module and cgi_module is loaded (uncommented it, the path can be different)
    LoadModule alias_module /opt/freeware/lib/httpd/modules/mod_alias.so
    LoadModule cgi_module /opt/freeware/lib/httpd/modules/mod_cgi.so
2. change user and group
User lpar2rrd
Group staff

3. append this at the end
AddHandler cgi-script .sh
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>

Check your apache configuration:

[root@monitor2]/root# /sbin/httpd -S
VirtualHost configuration:
ServerRoot: "/opt/freeware/etc/httpd"
Main DocumentRoot: "/var/www/htdocs"
Main ErrorLog: "/var/log/httpd/error_log"
Mutex default: dir="/var/logs/" mechanism=default
Mutex mpm-accept: using_defaults
Mutex proxy-balancer-shm: using_defaults
PidFile: "/var/run/httpd.pid"
Define: DUMP_VHOSTS
Define: DUMP_RUN_CFG
User: name="lpar2rrd" id=500
Group: name="staff" id=1

Start your web server

[root@monitor2]/root# /sbin/apachectl start

Test a connection:

http://monitor2/lpar2rrd/

Test the CGI module http://monitor2/lpar2rrd-cgi/test.sh

Add an entry into lpar2rrd crontab (recheck every hour the LPARs definitions in case of change, support also LPAR mobility):

[lpar2rrd@monitor2]/home/lpar2rrd# crontab -e
0 * * * * /var/www/htdocs/lpar2rrd/load.sh > /var/www/htdocs/lpar2rrd/logs/load.out 2>&1

Debug:

check missing components:

[lpar2rrd@lpar2rrd lpar2rrd]$ cd /home/lpar2rrd
[lpar2rrd@lpar2rrd lpar2rrd]$ . ./etc/lpar2rrd.cfg
[lpar2rrd@lpar2rrd lpar2rrd]$  perl bin/lpar2rrd-realt.pl
Can't locate Env.pm in @INC (@INC contains: /usr/lib64/perl5/vendor_perl /usr/lib64/perl5 /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .) at bin/lpar2rrd-realt.pl line 20.
BEGIN failed--compilation aborted at bin/lpar2rrd-realt.pl line 20.

[root@lpar2rrd lpar2rrd]$ yum -y install perl-Env

[lpar2rrd@lpar2rrd lpar2rrd]$ perl bin/lpar2rrd-realt.pl
Content-type: text/html
Expires: Thu Oct 30 13:37:10 2014

<HTML><BODY BGCOLOR="#D3D2D2" TEXT="#000000" LINK="#0000FF" VLINK="#0000FF" ALINK="#FF0000" ><table align="center" summary="Graphs"><tr><td><img src="/lpar2rrd-cgi/real-time.sh?source=&hmc=&mname=&new_gui=0"></td>
<td valign="top"><font size=-1><A HREF="/lpar2rrd-cgi/lpar2rrd-realt.sh?source=&hmc=&mname=&new_gui=0&new_gui=0&none=">Refresh</A></font>
</td></tr>
</table><br>
<ul style="display: none"><li class="tabagent"></li></ul>
aix/lpar2rrd.txt · Last modified: 2015/03/31 16:24 by manu