System Administration
cancel
Showing results for 
Search instead for 
Did you mean: 

FREE SHELL SCRIPT: Automated HP-UX SWA Auditing and Patch Download Accross Many Servers

VK2COT
Honored Contributor

FREE SHELL SCRIPT: Automated HP-UX SWA Auditing and Patch Download Accross Many Servers

Hello,

Some time ago, one of our ITRC colleagues
Doug O'Leary provided a nice reference to
SWA scripts.

And then recently, one of my students (when I
was teaching HP-UX SNA II) asked for another
SWA option.

So, it made me think about it and the result is
my script. I know, our colleague JRF would
probably prefer Perl but I decided to do it in
Shell because the script is relatively simple
and no need to use high-powered language :)

Basically, the script reads a file with
HP-UX hostnames and their OS release,
then runs the SWA audits (via SSH),
and optionally, downloads the patches for
each server.

The script can be run with various options:

SCRIPT [-c] [-a PROXYDOM] [-f] [-g] \
[-u PROXYUSER] [-p PROXYPASS] \
[-s PROXYSERV] [-w PROXYPORT] \
[-d datestamp_of_catalog] \
[-n CATALOG_DIR] [-h] [-g]
-h Print help file
-a PROXYDOM Web proxy domain
-c Get SWA catalog file only
-d MMMYYYY Run SWA on already-downloaded datestamp-reference catalog (Dec2009)
-f If SWA get catalog fails, try curl command
-g Run SWA get (default is to run SWA report only)
-n CATALOG_DIR Run SWA on already-downloaded swa_catalog.xml in CATALOG_DIR
-p PROXYPASS Web proxy password
-s PROXYSERV Web proxy server (IP address or hostname)
-u PROXYUSER Web proxy username
-w PROXYPORT Web proxy port number

Proxy login details are not really for
SWA itself, but for CURL as an alternative
tool to download SWA catalog.

Examples of usage:

1. To download the catalog only (by default,
it will be saved with MMMYYYY datestamp, in
/swa/conf/swa-catalog-May2010.xml:

HP-UX-SWA-global-audit.sh -c

This is a very good candidate to run once a
month and preserve previous versions of
catalog files that can be used to audit
the server wheh not the latest but some older
patch bundles are required.

This request came from a critical customer who
never installs latest versions of patches.
Instead, they apply N-1 version, where N is
the current release...

2. Run SWA report for a group of servers as
listed in /swa/conf/swa-hosts.conf based on
older (previously downloaded) catalog file,
for example /swa/conf/swa-catalog-Apr2010.xml

HP-UX-SWA-global-audit.sh -d Apr2010

3. Run SWA report for a group of servers as
listed in /swa/conf/swa-hosts.conf based on
latest catalog file (which will be downloaded
in real-time):

HP-UX-SWA-global-audit.sh

4. Run SWA report for a group of servers as
listed in /swa/conf/swa-hosts.conf based on
latest catalog file (which will be downloaded
in real-time), and then download the patches
into /swa/patches/HP-UX-11.XX/... directory
(example,
/swa/patches/HP-UX-11.31/myhost-05May2010-swa-patches)

HP-UX-SWA-global-audit.sh -g

5. To view the SWA reports - point the Web
browser to:

http://swa-server/SWA

The HTML files are actually saved in
/opt/hpws/apache/htdocs/SWA and it assumes
that the centralized server runs Apache Web.

Cheers,

VK2COT
VK2COT - Dusan Baljevic
1 REPLY
VK2COT
Honored Contributor

Re: FREE SHELL SCRIPT: Automated HP-UX SWA Auditing and Patch Download Accross Many Servers

Hello,

Closing the thread. It was informational message only.

The latest version of the script is always
on my home web server (see other posts
for references).

VK2COT
VK2COT - Dusan Baljevic