How to Easily Generate AIX Systems Management Reports

How to Easily Generate AIX Systems Management Reports

 

 

 

Generating system management information service (MIS) reports is a common task for system administrators. These reports are generated as comma/character-separated values (CSV) files because the format allows for easy data exchange, allowing the information to be loaded into, for example, a spreadsheet or a database application.

For those not in the know, a CSV file holds one record per line, which each field separated by a comma (although other characters can be used as a field separator). If a field contains more than one attribute, it should be enclosed with double quotes.

In years past, I would take the data produced by the prtconf command and manipulate it into a CSV file. However, due to the vast number of AIX systems I now support, getting prtconf output from more than 90 AIX boxes can take some time. Now, I just extract the information I require and what managers request. The type of information you’ll want to produce will depend on your environmental or operational requirements. This could include:

  • Disk space allocations
  • Current AIX levels
  • Types of hardware used
  • Installed filesets

With this information, various reports can be generated covering your AIX hosts’ different attributes.

Getting the Information

Before deciding what data to pull back, you must have a transport method in place to connect the AIX hosts. Typically, you can use distributed shell (DSH) or secure shell (SSH), which is my preferred method. Be sure to pull the public keys from the remote hosts you want a password-less connection back to your main server, as this ensures a automatic script execution.

A CSV can contain almost any type of data. Let's examine some common system information that's been pulled back. In this example, a request has been made to all remote servers to pull: hostname, AIX level, machine model, total memory, total CPU, total paging space, total Ethernet cards available, volume groups, total capacity of the disks, and total number of disks with all sizing totals in MB.

First, Listing 1. system_info contains a partial listing of various remote hosts containing that said information.

Listing 1. system_info.csv
cars6001,5300-12,IBM-8203-E4A,15990784,1,15360,5,"db2vg appsvg rootvg",1583026,4
cars6002,5300-12,IBM-8203-E4A,15859712,2,15360,5,"data1vg data2vg rootvg",1583026,4
sgrs6001,5300-12,IBM-9133-55A,16777216,4,16384,2,"datavg rootvg",7308012,9
krrs6001,5300-12,IBM-9133-55A,8126464,2,7936,2,"appsvg rootvg",1224972,3
krrs6002,5300-12,IBM-9133-55A,8519680,2,7936,1,"appsvg rootvg",2237164,3
ukrs6020,6100-03,IBM-9117-MMC,67108864,4,17536,3,"datavg rootvg",640029,11
nlrs6001,5300-12,IBM-9131-52A,8126464,1,8096,2,"appsvg rootvg",1224972,3
sgrs6007,7100-01,IBM-8205-E6C,14680064,7,10240,9,"rootvg",280026,2
uk0rs6034,6100-03,IBM-9117-MMC,16777216,2,5504,3,"accvg datavg rootvg",886194,3

In the output, assume all hostnames will have the first two characters set to the country it resides in. The output might not look like much at first glance, but from it we can tell which AIX hosts are at what level, how many hosts reside in which country, and much more. Once the information is pulled into a spreadsheet, the data can be manipulated further for more concise reporting. Say a request was made for the following:

  • How many AIX hosts in are in Korea?
  • How many are on AIX V6?
  • What’s the total disk space allocation for all boxes in Canada?

With the output provided, it’s a breeze to figure out the answers. But when the file has more than 90 rows, it gets more difficult. In a spreadsheet, those answers can be found in a few minutes. However, awk is a good tool for such easy data extraction—as are other utilities, like grep, cut, join, etc. The awk statements to the previous questions could include:

awk -F, '$1 ~ /^kr/' system_info.csv
awk -F, '/6100/' system_info.csv 
awk -F, '$2=="6100-03"' system_info.csv
awk -F, '$1 ~/^ca/ {x+=$9;} END {print x}' system_info.csv 

Volume Groups and Disks

One of my regular tasks is producing a current status on volume groups and disk types, so the numbers can be married up with the rest of the SAN disks split around the company. You can discover or refresh your memory on how your volume groups are laid out around the system. Generating these types of reports is essential for a snapshot of your disks before and after a migration to ensure you don’t have any unassigned or left over disks. For easy data extraction when generating these reports, it’s useful to have a volume group as one record (one line) per host. Therefore, a host may have many entries as demonstrated in Listing 2. vg_info, which contains a partial output of the said report. A more typical CSV file containing volume group information would be: volume group name, volume group size, disks assigned, disk sizes, type of disks, logical volumes. Armed with that information, you can get all kinds of information out, by hostname, volume group and disk; the tasks are endless.

Listing 2. vg_info.csv
ukrs6004,rootvg,hdisk43,MPIO 2810 XIV Disk
ukrs6004,portvg,hdisk44,MPIO 2810 XIV Disk
ukrs6004,vdivg,hdisk45,MPIO 2810 XIV Disk
ukrs6004,appsvg,hdisk86,IBM MPIO FC 2107
ukrs6004,uwpvg,hdisk85,MPIO 2810 XIV Disk
usrs6020,rootvg,hdisk10,MPIO 2810 XIV Disk
usrs6020,datavg,hdisk20,IBM MPIO FC 2107
usrs6020,datavg,hdisk11,IBM MPIO FC 2107
usrs6020,datavg,hdisk12,IBM MPIO FC 2107

From this output you can review the disk assignment to the volume groups, also the type of disks being used. For example, to see how many XIV disks are assigned to ukrs6004, use:

awk -F, '/ukrs6004/ &&  /XIV/ ' vg_info.csv | wc

Surprises in Store

Generating CSV files is quite easy; it’s the data manipulation that’s fun. Occasionally, you’ll find surprises when looking at the data. This can spark the brain to standardize how your systems are mapped out to devices.

For example, you can calculate the percentage of different disk types you’re using on your system for different volume group applications. Is one disk type better than the other? Are the disk paths evenly matched? Getting data from your fibre cards or the lspath will point you to the answer of that one.

0 (0)
Article Rating (No Votes)
Rate this article
Attachments
There are no attachments for this article.
Comments
There are no comments for this article. Be the first to post a comment.
Full Name
Email Address
Security Code Security Code
Related Articles RSS Feed
LVM: Unmirror/Mirror "rootvg" Volume Group
Viewed 3088 times since Mon, May 21, 2018
AIX - How to monitor memory usage
Viewed 4471 times since Fri, Jun 8, 2018
AIX, Red Hat, Security, System Admin↑ System-wide separated shell history files for each user and session
Viewed 1995 times since Fri, Apr 19, 2019
This document discusses a new feature implemented for JFS2 filesystems to prevent simultaneous mounting.
Viewed 2574 times since Sat, Jun 1, 2019
AIX - How to get Memory infomation
Viewed 8549 times since Fri, Jun 8, 2018
AIX Password expiry /etc/passwd
Viewed 17675 times since Wed, Jul 3, 2019
Understanding dump devices sysdumpdev
Viewed 4220 times since Mon, Jul 9, 2018
Problems with NFS on an AIX Reboot? Then Go Single
Viewed 6374 times since Wed, May 30, 2018
Topics: PowerHA / HACMP, Storage Adding a new volume group to an active PowerHA resource group
Viewed 2337 times since Mon, Jun 3, 2019
AIX Booting
Viewed 9868 times since Tue, Apr 16, 2019