Batch patch analysis

When you have multiple systems to manage, patch analysis can be tedious. However, the built-in features of Software Distributor (SD) make this job quite easy. The HP script “swainv” has several useful options:

swainv [-D directory | -N inventory] [-q] [-x option=value]
[-e name=value] [-h target [-e name=value]]

The script itself is the only documentation but it is quite thorough. Normally, you would just run swainv and the output is “inventory.xml“, but with -N you can specify a full pathname on the local server. But wait, there’s more! The -h option allows you to collect the .xml file from a remote system. The only requirement is that ssh be installed and enabled between the local and remote system. This means that a passwordless login is allowed between all the systems. If there are concerns or restrictions for root and ssh using public keys, swainv (actually, swlist) does not have to run as root. Any normal user can run swainv on a local or remote system and collect the inventories locally. Here is a simple script to read the hostnames from a file and collect all the inventory files on the local system:

echo host1 host2 host33 host997 > mysystems
mkdir /tmp/collect.swainv

cat mysystems | while read MYHOST
do
swainv -h $MYHOST -N /tmp/collector/$MYHOST.xml
-x ssh_options=”-o batchmode=yes”
done

This will collect the inventories in the directory: /tmp/collector/
with each file named with the hostname.

– See more at: http://serviceitdirect.com/blog/batch-patch-analysis#sthash.YfvFJC8s.dpuf


Tags: