How to Easily Generate AIX Systems Management Reports


How to Easily Generate AIX Systems Management Reports

 

August 2013 | by David Tansley

 

 

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:

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:

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.



Article Number: 101
Posted: Wed, May 30, 2018 11:24 AM
Last Updated: Wed, May 30, 2018 11:24 AM

Online URL: http://kb.ictbanking.net/article.php?id=101