Catalog Downloader and Update Wrapper Script

    This script automates the running of offline downloaders and the running of the Catalog Update Jobs.  As of 8.2, the Catalog Update Jobs

    are not currently in the Jobs workspace and they are difficult to manage because it involves digging to each catalog.  This creates

    NSH Script Jobs that can be put in a Batch Job and otherwise more easily handled.

    For the downloadRepo mode, you are required to upload the Offline Patch Downloader to the Depot as a Depot File

    There are three (sort of four) modes of this script and they are detailed below:


    General Options

    -d    <debug level>        Debug Log level output, 0-5

    -R    <blRole>             BladeLogic RBAC Role to authenticate as

    -P    <blProfile>           BladeLogic Authentication profile to authenticate as

    -X    <jvm opts>        Options for the blcli jvm

    -O        <notify email>         Email address to send the downloader log or Catalog Update Job notification

    -m        <scriptMode>        downloadRepo, updateCatalog, installScript

    -I        <createJob>            create a NSH Script Job instead of running the download or update, true/false


    ScriptMode: downloadRepo

      This mode will download the payloads from the vendor site onto the patch helper system.  The arguments should trainslate pretty clearly

      to the options required in the downloader XML files...


      -t     <targetOS>            OS type of the download: OEL, SUSE, RHEL, Windows, Solaris

         -S    <retries>            Integer - number of retries for the downloader, default is 10

        -T     <timeout>            Integer - timeout for the download operation, default is 180000

        -A     <parallelThreads>    Integer - parallel threads for downloader execution, default is 5

         -h    <repoHost>            Hostname of the system holding the Patch Repository payloads

        -r     <repoLocation>        NSH path style path to the repository location on the repo host

      -e  <errataType>        Errata type to download - RedHat only - critical,high,moderate,low

      -s  <errataLevel>        Errata severity levels - RedHat only - security,bugfix,enchancement

        -u     <downloadUser>        Username for Vendor patch site login, used for RHEL, SUSE and Solaris

        -p     <downloadPassword>    Password for the Vendor patch site login, used for RHEL, SUSE and Solaris in blenc format

        -c    <downloadChannel>    Channel name, os type and arch of the patches to download.  Used for Linux, SUSE, OEL and Windows

      -l  <offline dowloader>    Depot path to the offline downloader depot file

        -L  <downloadLanguage>  Download language(s) for Windows

        -y     <yummifyRepo>        Run a createrepo after the download, this can be useful for Linux repos that are missing rpms.  true/false

      -U  <proxy>                Proxy Host and port - server:port for a http proxy used for the download

      -V    <proxyUser>            Username auth for a http proxy

      -W  <proxyPass>            Password auth for a http proxy

      -Y  <proxyDomain>        Domain name auth for a http proxy

      -Z  <proxyType>            Proxy Type for a http proxy - ntlm, ntlvm2, squid


            Usage: OEL

          usage -m downloadRepo -l <downloaderLocation> -r <repoLocation> -h <repoHost> -t OEL -c ol5_i386_base:OEL5-i386

            Usage: Multiple OEL

          usage -m downloadRepo -l <downloaderLocation> -r <repoLocation> -h <repoHost> -t OEL -c ol5_i386_base:OEL5-i386,ol5_i386_latest:OEL5-i386

            Usage: RHEL

          usage -m downloadRepo -l <downloaderLocation> -r <repoLocation> -h <repoHost> -t RHEL c rhel-server-5-i386:RHES5-x86 -u -p ******

            Usage: RHEL Multiple Channels

          usage -m downloadRepo -l <downloaderLocation> -r <repoLocation> -h <repoHost> -t RHEL -c rhel-server-5-i386:RHES5-x86,rhel-server-5-vt-i386:RHES5-x86,rhel-x86_64-server-6:RHES6-x86_64 -u -p ******

            Usage: SUSE

            usage -m downloadRepo -l <downloaderLocation> -r <repoLocation> -h <repoHost> -t SUSE -u UC***** -p ***** -a x86 -s SLES11 -c SLES11-Updates:SLES11-x86_64

            Usage: SUSE Multiple Channels

            usage -m downloadRepo -l <downloaderLocation> -r <repoLocation> -h <repoHost> -t SUSE -u UC***** -p ***** -a x86 -s SLES11 -c 'SLES11-Updates:SLES11-x86_64,SLES11-SP2-SDK-Updates:SLES11-x86_64'

            Usage: Windows

          usage -m downloadRepo -l <downloaderLocation> -r <repoLocation> -h <repoHost> -t Windows -c ALL -L English

            Usage: Solaris

          usage -m downloadRepo -l <downloaderLocation> -r <repoLocation> -h <repoHost> -t Solaris -s 10 -a sparc -u -p *****


    ScriptMode: updateCatalog

      This mode will run the catalog update job for the targeted catalog and can be included in Batch Jobs and scheduled more easily


        -t    <targetOS>            OS type of the catalog to update: OEL, SUSE, RHEL, Windows, Solaris

        -C    <catalogPath>        Path to the Catalog to update

        -x    <metaLocation>        NSH Path to the directory containing the patch meta files (Shavlik XML or patchdiag.xref), for Windows and Solaris

        -h    <repoHost>            Hostname of the system holding the Patch Repository payloads

        -f     <depotFolder>        Depot Folder containing the Depot Files of the metadata used in the offline catalog (Solaris and Windows)

        -o     <removeObsoletes>    Remove obsolete patches after the update job finishes, true/false


           Usage: Linux

            usage -m updateCatalog -t RHEL -C "/Some Path/To/Catalog" -y true -o true -h server1

            Usage: Windows/Solaris

            usage -m updateCatalog -t Solaris -C "/Some Path/To/Catalog" -x "/tmp/Windows" -f "/Workspace/Catalogs" -h server1


    ScriptMode: installScript

    Creates a NSHScript Object in the Depot

      Usage: usage -m installScript


    createJob - to create a job run the script in updateCatalog or downloadRepo and add the -I true and a job will be created in the Jobs

    workspace with all the optons you have specified, then you can run the job

      Usage: usage -m updateCatalog -t RHEL -C "/Some Path/To/Catalog" -y true -o true -h server1  -I true