Comparing installed software.

I have some 30 AIX servers and I want their software packages to be consistent. AIX provides a command to list out all pertinent information on a software package in a colon separate list - I grab this through ssh and collect in a temp directory server_name.log.

Now, I'm stuck. I can create a list of all unique packages but how do I traverse through each server list to see whether the sofware is installed?

The example below may help explain my dilema.

File 1

awk:1.1
sed:3.2
ssh:4.1.2

File 2
something:1.0.1
awk:1.1
sed:3.2

File 3

something:1.0.1
awk:1.1
bgp:1.0
sed:3.2

Do you have a master list of what software should be installed?

You might want to use Perl or Awk to read the versions into an array (Perh hash) and then in the end print missing packages (array keys) and wrong versions (key values).

# I used ssh server1 lslpp -Lc > /tmp/lslpp_files/server1.log to create
# the log files. I then did a cat of all the log files sorting out the unique
# cat /tmp/lslpp_files/*log | cut -d":" -f1 | sort -u

#!/usr/bin/perl
@host=(server1, server2, server3);

for $host (@host) {
open(MYINPUTFILE, "</tmp/lslpp_files/$host.log");
my (@lines) = <MYINPUTFILE>;
foreach $line (@lines)
{
chomp;
next if /^#/;
( $PackageName, $Fileset, $Level, $State, $PTFId, $FixState, $Type, $Description, $DestinationDir, $Uninstaller, $MessageCatalog, $MessageSet, $MessageNumber, $Parent, $Automatic, $EFIXLocked, $InstallPath, $BuildDate ) = split ( /:/, $line);

#print "$host -- $Fileset -- $Level\n";
$HoH{$host}{$Fileset} = $Level;
}
close(MYINPUTFILE);
}
#
# compare file
#
open(COMPFILE, "</tmp/lslpp_files.final");
my (@complines) = <COMPFILE>;

#
# print header
#
print "fileset:server1:server2:server3\n";
foreach $compline (@complines)
{
( $Filset, $Lvl ) = split ( /:/, $compline);
print "$Filset";
for $host (@host) {
print ":$HoH{$host}{$Filset}";
}
print "\n";
}
close(COMPFILE);