![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How to check which software is installed on UNIX | sunil.1908 | UNIX for Advanced & Expert Users | 6 | 07-30-2008 12:31 PM |
| listing installed software | ravi raj kumar | UNIX for Advanced & Expert Users | 2 | 07-10-2007 07:55 PM |
| Listing all Software and Tools installed | hasnain | UNIX for Advanced & Expert Users | 7 | 07-03-2007 10:53 AM |
| Installed Software | tt1ect | UNIX for Dummies Questions & Answers | 1 | 04-03-2007 04:27 AM |
| Installed software | wakeley | UNIX for Dummies Questions & Answers | 3 | 02-08-2005 06:59 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
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). |
|
||||
|
Ugly but it works.
# 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); |
| Sponsored Links | ||
|
|