Monday, May 4, 2009

Script to retrieve Tivoli patches

For the longest time, I have been visiting the IBM FTP site looking for patches that have recently become available. This is especially true when I am waiting for one to come out that I am expecting. If anyone else has done this, then you know how much fun that is. I am on the various emails that let you know when patches are released, but these seem to have no rhyme or reason on when they are run or what they report on. The best source seems to be the FTP site.

Recently I decided to do something I have been meaning to do for the longest time and that is write a simple script that would connect to the ftp site and find any recently released patches. In order to use this script there are a couple modifications that will need to be done. I have kept all the variables in the Initialize subroutine in order to make these modifications easier.

SMTP Server - This will need to be modified to supply any smtp server.
    $gMailDomain = "";

Sender address - Whatever the address you want the "From" field to use
    $gSenderAddr = "\@";

Recipient - Address to send the listing to
    $gToAddr = "\@";

    Note: to send to multiple addresses, just comma delimit:
    $gToAddr = "name1\, name2\@domain";

Also there is a variable to specify the number of days to look back for patch updates. Just set the global variable $gDayDiff to the number of days you want to look back for updates.

When the script is executed, it will create a file called updates.html (name can be modified by changing the global variable $gHtmlFile). This file is then used as input into the email.

This script does have a requirement for the Mail::Sender module. If you do not want to receive the emails, then comment out the following lines
    use Mail::Sender
    The entire SendMail subroutine

The file can be downloaded from:

I have tested the execution on Windows XP, Vista and Red Hat 4. Please let me know of any errors you might encounter.

BTW, leave comments and let us know you are out there.


Martin Carnegie

No comments: