Tuesday, February 8, 2011

Comparing Packages Between Platforms


Comparing Packages Beteen Plataforms

Abstract:
When working in a clustered environment, it is often a requirement to see if the appropriate packages have been installed on all platforms in the cluster. The number of packages on a platform are many, but a simple script can be helpful.

Packaging Technology:
The industry standard packaging for UNIX systems is UNIX SVR4 packaging. Standard tools for packaging include: pkgadd, pkginfo, pkgtrans, pkgrm, pkgmk, pkgchk, pkgparam, pkgproto, pkgadm.

A long utput from the pkginfo command follows:

sun9/user$ pkginfo -l HPNP                                             

PKGINST: HPNP
NAME: JetAdmin for Unix
CATEGORY: application
ARCH: sparc
VERSION: D.06.15
BASEDIR: /
VENDOR: HP
DESC: HP Network Printer support package
PSTAMP: odybld3981208144215
INSTDATE: Aug 12 2005 08:50
STATUS: completely installed
FILES: 348 installed pathnames
6 shared pathnames
32 directories
238 executables
13353 blocks used (approx)



For a cursory view of a system, the pkginfo command provides basic information required for cursory consistency checks.

Simple Check:
If the identical install media is used, a simple post-install check may be desired across multiple platforms in a cluster. An sample script follows where sun1, sun2, sun3, sun4 are located on a network where temporary directories are shared via NFS and automounting is enabled.

sun1/user$ pkginfo >/net/sun4/tmp/sun1.packages
sun2/user$ pkginfo >/net/sun4/tmp/sun2.packages
sun3/user$ pkginfo >/net/sun4/tmp/sun3.packages
sun4/user$ cd /tmp

sun4/user$ nawk ' BEGIN { Pattern="%35s%35s%35s%35s\n" }
FILENAME=="sun1.packages" { sun1[$2]=$2 ; Name[$2]=$2 }
FILENAME=="sun2.packages" { sun2[$2]=$2 ; Name[$2]=$2 }
FILENAME=="sun3.packages" { sun3[$2]=$2 ; Name[$2]=$2 }
END {
printf Pattern,"Common","sun1","sun2","sun3"
for ( i in Name ) printf Pattern,i,sun1[i],sun2[i],sun3[i]
}' *.packages sort nawk 'NF<4'
A simple output of 4 columns is produced, with differences.

   SMCdb       SMCdb     SMCdb                      
SMCtk SMCtk SMCtk
SFWatk SFWatk SFWatk
SMCgcc SMCgcc SMCgcc
SMCtcl SMCtcl SMCtcl
SMCxpm SMCxpm SMCxpm
SUNWdc SUNWdc SUNWdc
SUNWus SUNWus
TSIpgx TSIpgx
SFWdbus SFWdbus SFWdbus
SFWgtk2 SFWgtk2 SFWgtk2
SMCgdbm SMCgdbm SMCgdbm
SMCntop SMCntop SMCntop
SMCossl SMCossl SMCossl
SMCpcre SMCpcre SMCpcre
SMCrrdt SMCrrdt SMCrrdt
SMEvplr SMEvplr
SMEvplu SMEvplu
SUNWaac SUNWaac
SUNWafb SUNWafb
SUNWbdb SUNWbdb
...
Versioning and Integrity Checks:

In order to test for proper versions and package integrity, there are other commands which can be leveraged:
  • pkgchk
    Check detailed integrity of files associated with packages, including existence, permissions, etc.
  • pkginfo -l
    Check versioning, architecture, dates, install integrity, etc.
The package checking script can be enhanced with such scripts for more robust checking.

No comments:

Post a Comment