2013-10-20 // Display the AIX devices in a tree format
In AIX there is the proctree
(or ps -fT 0
) command to display the currently running processes in a tree format. This is very helpful when one is primaryly interested in the parent and child relationship between the individual processes. Unfortunately a similar command for the parent and child relationship of devices is still missing from the stock AIX. There are already several script implementations out on the net to fill that particular gap. As a scripting exercise i wanted to do my own version of a devtree
command. It was included in the aaa_base RPM package. The output for e.g. an LPAR with virtual ethernet and virtual SCSI devices looks like this:
| |-- inet0 | |-- en1 | |-- et1 | |-- lo0 |-- iocp0 |-- lvdd |-- pty0 |-- rootvg | |-- hd1 | |-- hd2 | |-- hd3 | |-- hd4 | |-- hd5 | |-- hd6 | |-- hd8 | |-- hd10opt | |-- hd9var | |-- lv_srv |-- sfw0 |-- sys0 | |-- sysplanar0 | | |-- L2cache0 | | |-- mem0 | | |-- pci0 | | | |-- pci4 | | | |-- pci5 | | | |-- pci6 | | |-- pci1 | | | |-- pci7 | | | |-- pci8 | | |-- pci2 | | | |-- pci9 | | | |-- pci10 | | | |-- pci11 | | |-- pci3 | | | |-- pci12 | | | |-- pci13 | | |-- pci14 | | |-- proc0 | | |-- proc4 | | |-- vio0 | | | |-- ent1 | | | |-- vsa0 | | | | |-- vty0 | | | |-- vscsi0 | | | | |-- hdisk0 | | | |-- vscsi1 | `-- End of the device tree
in the regular mode, or like this:
| |-- inet0 Available Internet Network Extension | |-- en1 Available Standard Ethernet Network Interface | |-- et1 Defined IEEE 802.3 Ethernet Network Interface | |-- lo0 Available Loopback Network Interface |-- iocp0 Defined I/O Completion Ports |-- lvdd Available LVM Device Driver |-- pty0 Available Asynchronous Pseudo-Terminal |-- rootvg Defined Volume group | |-- hd1 Defined Logical volume | |-- hd2 Defined Logical volume | |-- hd3 Defined Logical volume | |-- hd4 Defined Logical volume | |-- hd5 Defined Logical volume | |-- hd6 Defined Logical volume | |-- hd8 Defined Logical volume | |-- hd10opt Defined Logical volume | |-- hd9var Defined Logical volume | |-- lv_srv Defined Logical volume |-- sfw0 Available Storage Framework Module |-- sys0 Available System Object | |-- sysplanar0 Available System Planar | | |-- L2cache0 Available L2 Cache | | |-- mem0 Available Memory | | |-- pci0 Defined PCI Bus | | | |-- pci4 Defined 00-10 PCI Bus | | | |-- pci5 Defined 00-12 PCI Bus | | | |-- pci6 Defined 00-16 PCI Bus | | |-- pci1 Defined PCI Bus | | | |-- pci7 Defined 02-10 PCI Bus | | | |-- pci8 Defined 02-12 PCI Bus | | |-- pci2 Defined PCI Bus | | | |-- pci9 Defined 03-10 PCI Bus | | | |-- pci10 Defined 03-12 PCI Bus | | | |-- pci11 Defined 03-16 PCI Bus | | |-- pci3 Defined PCI Bus | | | |-- pci12 Defined 01-10 PCI Bus | | | |-- pci13 Defined 01-12 PCI Bus | | |-- pci14 Defined PCI Bus | | |-- proc0 Available 00-00 Processor | | |-- proc4 Available 00-04 Processor | | |-- vio0 Available Virtual I/O Bus | | | |-- ent1 Available Virtual I/O Ethernet Adapter (l-lan) | | | |-- vsa0 Available LPAR Virtual Serial Adapter | | | | |-- vty0 Available Asynchronous Terminal | | | |-- vscsi0 Available Virtual SCSI Client Adapter | | | | |-- hdisk0 Available Virtual SCSI Disk Drive | | | |-- vscsi1 Available Virtual SCSI Client Adapter | `-- End of the device tree
in the detailed output mode.
2013-07-20 // AIX RPMs: GestioIP, net-snmp and netdisco-mibs
Following up to the previous posts, regarding the topic of AIX RPM packages, here are three new AIX RPM packages related to network and IP adress management (IPAM):
GestioIP: A web based open source IP address management (IPAM) system (GestioIP). See the
README.AIX
file for further installation instructions.Filename Filesize Last modified gestioip-3.0.22-1.ppc-aix5.1.rpm 1.4 MiB 2013/07/20 21:03 gestioip-3.0.22-1.ppc-aix5.1.rpm.sha1sum 75.0 B 2013/07/20 21:03 Filename Filesize Last modified gestioip-3.0.22-1.src.rpm 1.4 MiB 2013/07/20 21:02 gestioip-3.0.22-1.src.rpm.sha1sum 68.0 B 2013/07/20 21:02
Net-SNMP: Basically the same as Michael Perzls Net-SNMP package, but build with the IBM XL C/C++ compiler against the Perl package provided here: AIX RPMs: Perl and CPAN Perl Modules.
Filename Filesize Last modified net-snmp-5.7.2-1.ppc-aix5.1.rpm 1.5 MiB 2013/07/20 21:03 net-snmp-5.7.2-1.ppc-aix5.1.rpm.sha1sum 74.0 B 2013/07/20 21:03 net-snmp-devel-5.7.2-1.ppc-aix5.1.rpm 201.3 KiB 2013/07/20 21:03 net-snmp-devel-5.7.2-1.ppc-aix5.1.rpm.sha1sum 80.0 B 2013/07/20 21:03 net-snmp-perl-5.7.2-1.ppc-aix5.1.rpm 200.5 KiB 2013/07/20 21:03 net-snmp-perl-5.7.2-1.ppc-aix5.1.rpm.sha1sum 79.0 B 2013/07/20 21:03 net-snmp-shared-5.7.2-1.ppc-aix5.1.rpm 1.5 MiB 2013/07/20 21:03 net-snmp-shared-5.7.2-1.ppc-aix5.1.rpm.sha1sum 81.0 B 2013/07/20 21:03 net-snmp-trapd-5.7.2-1.ppc-aix5.1.rpm 32.5 KiB 2013/07/20 21:03 net-snmp-trapd-5.7.2-1.ppc-aix5.1.rpm.sha1sum 80.0 B 2013/07/20 21:03 net-snmp-utils-5.7.2-1.ppc-aix5.1.rpm 695.0 KiB 2013/07/20 21:03 net-snmp-utils-5.7.2-1.ppc-aix5.1.rpm.sha1sum 80.0 B 2013/07/20 21:03 Filename Filesize Last modified net-snmp-5.7.2-1.src.rpm 6.0 MiB 2013/07/20 21:03 net-snmp-5.7.2-1.src.rpm.sha1sum 67.0 B 2013/07/20 21:03
netdisco-mibs: A substantial collection of SNMP MIB files from a number of different network equipment vendors provided by the Netdisco project.
Filename Filesize Last modified netdisco-mibs-1.0-1.ppc-aix5.1.rpm 13.8 MiB 2013/07/20 21:03 netdisco-mibs-1.0-1.ppc-aix5.1.rpm.sha1sum 77.0 B 2013/07/20 21:03 netdisco-mibs-1.3-1.ppc-aix5.1.rpm 17.1 MiB 2013/07/20 21:03 netdisco-mibs-1.3-1.ppc-aix5.1.rpm.sha1sum 77.0 B 2013/07/20 21:03 Filename Filesize Last modified netdisco-mibs-1.0-1.src.rpm 14.0 MiB 2013/07/20 21:02 netdisco-mibs-1.0-1.src.rpm.sha1sum 70.0 B 2013/07/20 21:02 netdisco-mibs-1.3-1.src.rpm 17.3 MiB 2013/07/20 21:02 netdisco-mibs-1.3-1.src.rpm.sha1sum 70.0 B 2013/07/20 21:02
2013-07-20 // AIX RPMs: Perl and CPAN Perl Modules
Following up to the previous posts, regarding the topic of AIX RPM packages, here are several new AIX RPM packages related to Perl:
Perl: Basically the same as Michael Perzls Perl package, but with a more recent upsteam version and build with the IBM XL C/C++ compiler. Thus it does not depend on libgcc to be installed, but requires all Perl modules to also be build with the IBM XL C/C++ compiler.
Filename Filesize Last modified perl-5.8.9-1.ppc-aix5.1.rpm 21.0 MiB 2013/07/20 16:31 perl-5.8.9-1.ppc-aix5.1.rpm.sha1sum 70.0 B 2013/07/20 16:31 Filename Filesize Last modified perl-5.8.9-1.src.rpm 13.1 MiB 2013/07/20 16:35 perl-5.8.9-1.src.rpm.sha1sum 63.0 B 2013/07/20 16:35 CPAN Perl Modules: Several Perl modules from CPAN build with the IBM XL C/C++ compiler and to be used with the above Perl package:
2013-07-20 // AIX RPMs: MySQL, percona-ganglia-mysql and phpMyAdmin
Following up to the previous posts, regarding the topic of AIX RPM packages, here are three new AIX RPM packages related to the MySQL database:
MySQL: A fast, stable, multi-user, multi-threaded, open source SQL database system. Unfortunately at the moment only MySQL versions 5.1.x or lower can be successfully build on AIX. More recent versions of MySQL were developed with a strong focus on Linux rather than a focus on protability, which is why their build fails on AIX.
During the first startup of the MySQL server via the
/etc/rc.d/init.d/mysql
init script, several initial configuration tasks are performed. The command/opt/freeware/bin/mysql_install_db
is called to initialize the MySQL data directory/srv/mysql/
with system databases and tables. Also, the MySQL userprocadm
is added. This user is used for maintainance, startup and shutdown tasks, mainly triggered by the init script/etc/rc.d/init.d/mysql
.In addition to the stock MySQL files, the simple custom backup script
/opt/freeware/libexec/mysql/mysql_backup.sh
is provided. After defining a database user with the appropriate permissions to backup all databases, the user and its password should be added to the configuration file/opt/freeware/etc/mysql/mysql_backup.conf
of the backup script. With the run_parts wrapper scripts:/opt/freeware/etc/run_parts/daily.d/050_mysql.sh /opt/freeware/etc/run_parts/monthly.d/050_mysql.sh /opt/freeware/etc/run_parts/weekly.d/050_mysql.sh
simple daily, weekly and monthly full database backups are done to the filesystem (
/srv/backup/mysql/
). From there they can be picked up by a regular filesystem backup with e.g. the TSM BA client.Filename Filesize Last modified mysql-5.1.62-5.src.rpm 22.8 MiB 2013/07/20 14:09 mysql-5.1.62-5.src.rpm.sha1sum 65.0 B 2013/07/20 14:09 mysql-5.1.70-1.src.rpm 22.3 MiB 2013/07/20 14:09 mysql-5.1.70-1.src.rpm.sha1sum 65.0 B 2013/07/20 14:09 mysql-5.1.73-1.src.rpm 22.4 MiB 2013/12/11 22:37 mysql-5.1.73-1.src.rpm.sha1sum 65.0 B 2013/12/11 22:37 percona-ganglia-mysql: A Ganglia addon provided by Percona, designed to retrieve performance metrics from a MySQL database system and insert them into a Ganglia monitoring system. The package
percona-ganglia-mysql-scripts
is to be installed on the host running the MySQL database. It depends on theganglia-addons-base
package, specifically on the cronjob (/opt/freeware/etc/run_parts/conf.d/ganglia-addons.sh
) defined by this package. In the context of this cronjob all avaliable scripts in the directory/opt/freeware/libexec/ganglia-addons/
are executed. For this specific Ganglia addon, a MySQL user with the necessary permissions to access the MySQL performance metrics and the MySQL users password need to be configured:- /opt/freeware/etc/ganglia-addons/ganglia-addons-mysql.cfg
ENABLED="yes" #SS_GET_MYSQL_STATS="/opt/freeware/libexec/percona-ganglia-mysql/ss_get_mysql_stats.php" MY_USER="root" MY_PASS="insert your password here" #MY_HOST="127.0.0.1" #MY_PORT="3306"
The package
percona-ganglia-mysql
is to be installed on the host running the Ganglia webinterface. It contains templates for the customization of the MySQL metrics within the Ganglia Web 2 interface. To use the templates, install the RPM and copy the Ganglia Web 2 (gweb2) templates from/opt/freeware/share/percona-ganglia-mysql/graph.d/*.json
to the Ganglia Web 2 graph directory. Usually this is/ganglia/graph.d/
in the DocumentRoot of the webserver, but may be different in the individual Ganglia Web 2 installation, depending on the setting of the:$conf['gweb_root'] $conf['graphdir']
configuration parameters.
To include the MySQL templates in all host definitions, copy the report view definition
/opt/freeware/share/percona-ganglia-mysql/conf/default.json
to the Ganglia Web 2 configuration directory. Usually this is/ganglia/conf/
in the DocumentRoot of the webserver, but may be different in the individual Ganglia Web 2 installation, depending on the setting of the:$conf['views_dir']
configuration parameter.
To include the MySQL templates only in individual host view configurations for specific hosts, copy the report view definition
/opt/freeware/share/percona-ganglia-mysql/conf/default.json
to the Ganglia Web 2 configuration directory with the file namehost_<hostname>.json
.Filename Filesize Last modified percona-ganglia-mysql-0.6-1.ppc-aix5.1.rpm 28.1 KiB 2013/07/20 14:05 percona-ganglia-mysql-0.6-1.ppc-aix5.1.rpm.sha1sum 85.0 B 2013/07/20 14:05 percona-ganglia-mysql-scripts-0.6-1.ppc-aix5.1.rpm 31.1 KiB 2013/07/20 14:05 percona-ganglia-mysql-scripts-0.6-1.ppc-aix5.1.rpm.sha1sum 93.0 B 2013/07/20 14:05 Filename Filesize Last modified percona-ganglia-mysql-0.6-1.src.rpm 55.9 KiB 2013/07/20 14:05 percona-ganglia-mysql-0.6-1.src.rpm.sha1sum 78.0 B 2013/07/20 14:05 phpMyAdmin: A web based administration tool for MySQL, MariaDB and Drizzle database systems. After the installation of the RPM package, phpMyAdmin can be used by directing a browser to
http://<hostname>/phpmyadmin/
. To enable more advanced phpMyAdmin functions, several additional configuration steps are necessary:Import the phpMyAdmin database schema:
$ mysql -u root -p < /opt/freeware/doc/phpmyadmin-<version>/examples/create_tables.sql
Create a database user for phpMyAdmin and grant the necessary MySQL permissions:
$ mysql -u root -p mysql> GRANT USAGE ON mysql.* TO 'pma'@'localhost' IDENTIFIED BY 'password'; mysql> GRANT SELECT ( Host, User, Select_priv, Insert_priv, Update_priv, Delete_priv, Create_priv, Drop_priv, Reload_priv, Shutdown_priv, Process_priv, File_priv, Grant_priv, References_priv, Index_priv, Alter_priv, Show_db_priv, Super_priv, Create_tmp_table_priv, Lock_tables_priv, Execute_priv, Repl_slave_priv, Repl_client_priv ) ON mysql.user TO 'pma'@'localhost'; mysql> GRANT SELECT ON mysql.db TO 'pma'@'localhost'; mysql> GRANT SELECT ON mysql.host TO 'pma'@'localhost'; mysql> GRANT SELECT (Host, Db, User, Table_name, Table_priv, Column_priv) ON mysql.tables_priv TO 'pma'@'localhost'; mysql> GRANT SELECT, INSERT, UPDATE, DELETE ON phpmyadmin.* TO 'pma'@'localhost';
Configure phpMyAdmin to use the MySQL user and password:
- /opt/freeware/etc/phpmyadmin/config-db.php
<?php $dbname = 'phpmyadmin'; $dbuser = 'pma'; $dbpass = 'password'; ?>
Logout and login from phpMyAdmin or restart your browser.
RPM packages
Filename Filesize Last modified phpmyadmin-3.5.0-2.ppc-aix5.1.rpm 5.7 MiB 2013/07/20 14:08 phpmyadmin-3.5.0-2.ppc-aix5.1.rpm.sha1sum 76.0 B 2013/07/20 14:08 phpmyadmin-3.5.8.1-2.ppc-aix5.1.rpm 6.1 MiB 2013/07/20 14:08 phpmyadmin-3.5.8.1-2.ppc-aix5.1.rpm.sha1sum 78.0 B 2013/07/20 14:08 phpmyadmin-4.0.4.1-2.ppc-aix5.1.rpm 6.5 MiB 2013/07/20 14:08 phpmyadmin-4.0.4.1-2.ppc-aix5.1.rpm.sha1sum 78.0 B 2013/07/20 14:08 Filename Filesize Last modified phpmyadmin-3.5.0-2.src.rpm 4.5 MiB 2013/07/20 14:08 phpmyadmin-3.5.0-2.src.rpm.sha1sum 69.0 B 2013/07/20 14:08 phpmyadmin-3.5.8.1-2.src.rpm 4.7 MiB 2013/07/20 14:08 phpmyadmin-3.5.8.1-2.src.rpm.sha1sum 71.0 B 2013/07/20 14:08 phpmyadmin-4.0.4.1-2.src.rpm 5.7 MiB 2013/07/20 14:08 phpmyadmin-4.0.4.1-2.src.rpm.sha1sum 71.0 B 2013/07/20 14:08
2013-07-02 // AIX RPMs: AWStats, ganglia-addons-httpd, httpd and mod_perl
Following up to the previous posts, regarding the topic of AIX RPM packages, here are four new AIX RPM packages from the webserver and webserver monitoring category:
AWStats: AWStats is a open source logfile analyzer which can parse and process a number of popular logfile formats and generate graphical reports from the information gathered.
In order to run AWStats on a host, you need to edit the configuration files in
/opt/freeware/etc/awstats/
according to your needs and environment. To perform regular updates on the generated statistics, a cronjob – preferably with use of the run_parts wrapper – should be set up. E.g. for an statistics update every ten minutes:8,18,28,38,48,58 * * * * /opt/freeware/libexec/run_parts/run-parts -x /opt/freeware/share/awstats/tools/update.sh
Filename Filesize Last modified awstats-7.1-2.ppc-aix5.1.rpm 1.3 MiB 2013/06/14 17:21 awstats-7.1-2.ppc-aix5.1.rpm.sha1sum 71.0 B 2013/06/14 17:21 awstats-7.1.1-1.ppc-aix5.1.rpm 1.3 MiB 2013/06/30 14:35 awstats-7.1.1-1.ppc-aix5.1.rpm.sha1sum 73.0 B 2013/06/30 14:35 Filename Filesize Last modified awstats-7.1-2.src.rpm 1.2 MiB 2013/06/14 17:21 awstats-7.1-2.src.rpm.sha1sum 64.0 B 2013/06/14 17:21 awstats-7.1.1-1.src.rpm 1.2 MiB 2013/06/30 14:35 awstats-7.1.1-1.src.rpm.sha1sum 66.0 B 2013/06/30 14:35 ganglia-addons-httpd: A Ganglia addon to gather performance metrics from the Apache webserver via the Apache
mod_status
module. The packageganglia-addons-httpd-scripts
is to be installed on the host running the Apache webserver. It depends on theganglia-addons-base
package, specifically on the cronjob (/opt/freeware/etc/run_parts/conf.d/ganglia-addons.sh
) defined by this package. In the context of this cronjob all avaliable scripts in the directory/opt/freeware/libexec/ganglia-addons/
are executed. For this specific Ganglia addon, the Apache configurationmod_status
needs to be enabled:$ a2enmod status Enabling module status. Run '/etc/rc.d/init.d/httpd restart' to activate new configuration
and the module option set to
ExtendedStatus On
:- /opt/freeware/etc/httpd/mods-enabled/status.conf
<Location /server-status> SetHandler server-status Order deny,allow Deny from all Allow from 127.0.0.1 ::1 </Location> # Keep track of extended status information for each request ExtendedStatus On
After those changes the Apache processes need to be restarted:
$ apachectl -t Syntax OK $ /etc/rc.d/init.d/httpd restart
The package
ganglia-addons-httpd
is to be installed on the host running the Ganglia webinterface. It contains templates for the customization of the Apache metrics within the Ganglia Web 2 interface. See theREADME.templates
file for further installation instructions. Here are samples of the three graphs created with those Ganglia monitoring templates:Filename Filesize Last modified ganglia-addons-httpd-0.1-3.ppc-aix5.1.rpm 3.7 KiB 2013/06/14 16:03 ganglia-addons-httpd-0.1-3.ppc-aix5.1.rpm.sha1sum 84.0 B 2013/06/14 16:03 ganglia-addons-httpd-0.1-4.ppc-aix5.1.rpm 3.8 KiB 2013/06/14 17:21 ganglia-addons-httpd-0.1-4.ppc-aix5.1.rpm.sha1sum 84.0 B 2013/06/14 17:21 ganglia-addons-httpd-scripts-0.1-3.ppc-aix5.1.rpm 5.2 KiB 2013/06/14 16:03 ganglia-addons-httpd-scripts-0.1-3.ppc-aix5.1.rpm.sha1sum 92.0 B 2013/06/14 16:03 ganglia-addons-httpd-scripts-0.1-4.ppc-aix5.1.rpm 5.3 KiB 2013/06/14 17:21 ganglia-addons-httpd-scripts-0.1-4.ppc-aix5.1.rpm.sha1sum 92.0 B 2013/06/14 17:21 Filename Filesize Last modified ganglia-addons-httpd-0.1-3.src.rpm 7.4 KiB 2013/06/14 16:03 ganglia-addons-httpd-0.1-3.src.rpm.sha1sum 77.0 B 2013/06/14 16:03 ganglia-addons-httpd-0.1-4.src.rpm 7.6 KiB 2013/06/14 17:21 ganglia-addons-httpd-0.1-4.src.rpm.sha1sum 77.0 B 2013/06/14 17:21 httpd: A slightly modified version of Michael Perzls Apache packages. The packaging has been done in a different way, so that the different MPMs as well as their development files are part of different sub-packages, which can be installed seperately. The contents of the configuration directory
/opt/freeware/etc/httpd
are modeled closer to the setup one usually finds on current Debian Linux distributions, namely with the subdirectoriesconf.d
,mods-available
,mods-enabled
,sites-available
andsites-enabled
. “mods” (modules) and “sites” are enabled by symlinking the respective files from themods-available
andsites-available
directories into the directoriesmods-enabled
andsites-enabled
. The commandsa2enmod
,a2dismod
,a2ensite
anda2dissite
known from current Debian Linux environments have been added to ease the job of creating and removing the necessary symlinks.To run a at least minimal httpd setup, you need to enable some modules after installing the RPM packages:
$ for MOD in alias authz_host log_config log_io mime; do a2enmod ${MOD}; done Enabling module alias. Run '/etc/rc.d/init.d/httpd restart' to activate new configuration! Enabling module authz_host. Run '/etc/rc.d/init.d/httpd restart' to activate new configuration! Enabling module log_config. Run '/etc/rc.d/init.d/httpd restart' to activate new configuration! Enabling module log_io. Run '/etc/rc.d/init.d/httpd restart' to activate new configuration! Enabling module mime. Run '/etc/rc.d/init.d/httpd restart' to activate new configuration! $ apachectl -t Syntax OK $ /etc/rc.d/init.d/httpd start
Filename Filesize Last modified httpd-2.2.22-10.src.rpm 5.2 MiB 2013/06/14 17:21 httpd-2.2.22-10.src.rpm.sha1sum 66.0 B 2013/06/14 17:21 httpd-2.2.24-1.src.rpm 5.3 MiB 2013/06/30 12:52 httpd-2.2.24-1.src.rpm.sha1sum 65.0 B 2013/06/30 12:52 mod_perl: Basically the same as Michael Perzls mod_perl package, but build with the IBM XL C/C++ compiler against the Perl package provided here: AIX RPMs: Perl and CPAN Perl Modules. Thus it does not need libgcc to be installed.
Filename Filesize Last modified mod_perl-2.0.7-1.ppc-aix5.1.rpm 3.8 MiB 2013/07/06 17:57 mod_perl-2.0.7-1.ppc-aix5.1.rpm.sha1sum 74.0 B 2013/07/06 17:57 mod_perl-devel-2.0.7-1.ppc-aix5.1.rpm 36.4 KiB 2013/07/06 17:57 mod_perl-devel-2.0.7-1.ppc-aix5.1.rpm.sha1sum 80.0 B 2013/07/06 17:57 Filename Filesize Last modified mod_perl-2.0.7-1.src.rpm 3.6 MiB 2013/07/06 17:57 mod_perl-2.0.7-1.src.rpm.sha1sum 67.0 B 2013/07/06 17:57