Tuesday, April 29, 2008

Sample Emailing Script

Here is a simple custom emailing script using Perl. You need to install Mail::Sendmail module from CPAN to get it to work. You also need to change the values of $mailhost and $from field values.

Here is a typical usage of this program.

/itm_email.pl somebody@gulfsoft.com "Sample Subject" "Sample message body"


#!/usr/bin/perl

# Send emails via this platform independent module
use Mail::Sendmail;

main();

sub main {
my ($to, $subject, $message) = @ARGV;
send_email($to, $subject, $message);
}

# Sends email using Mail::Sendmail module
sub send_email {
my ($to, $subject, $message) = @_;
my ($mailhost, $from, %mail, @to);

$mailhost = "smtp.mydomain.com";
$from = "itm_alerts\@mydomain.com";

%mail = (
Smtp => $mailhost,
From => $from,
To => $to,
Subject => $subject,
Message => $message,
);
sendmail(%mail);
}


Hope you find it useful.

Sunday, April 20, 2008

TCM 4.2.3 FP06

Not sure how I missed this but FP06 is now out (since March 28).

Some interesting features:

1. Windows 2008 is supported as an Endpoint
2. AIX 6.1 is supported as an Endpoint
3. WSUS 3.0 support

There are also some other changes that you can read further about at ftp://ftp.software.ibm.com/software/tivoli_support/patches/patches_4.2.3/4.2.3-TIV-TCM-FP0006/4.2.3-TIV-TCM-FP0006.README

Thursday, April 17, 2008

Tivoli System Automation for Multiplatforms Overview

TSAM is not a new product, but it's definitely one that is becoming more popular these days, especially with the introduction of the Balanced Data Warehouse, which relies on its capabilities. So I thought a general overview might be useful. This high-level overview doesn't go into the gory details, as those are very well documented in the product documentation and in several redbooks and redpieces (links at the end of this post). Rather, this overview is meant to be a little more explanatory than the existing marketing material.

TSAM competes directly with Veritas Cluster Services (VCS). The purpose of both products is the same: to provide high availability to resources. A large portion of the functionality of TSAM is provided by Reliable Scalable Cluster Technology (RSCT) component, which is included as part of AIX, and is available for Windows, Red Hat and SuSE Linux. RSCT, along with its prerequisites (such as General Purpose File System), provides the mechanisms that allow you to define resources and have them monitored. There is no graphical interface for the configuration of RSCT or TSAM, so all of the configuration must be done from the command line.

RSCT provides the ability to "harvest" resources in your environment, so it will find and identify all of your network adapters, disks, filesystems, etc. You don't have to define *those* components. RSCT also provides the *ability* to define arbitrary logical resources and the *ability* to define automations to react to changes in the environment. RSCT also allows you to group resources into Resource Groups, which allow you to manage multiple resources as a single logical entity. RSCT also allows you to define Relationships between resources, allowing you to specify, for example, that these two filesystems must ALWAYS be available on the same node. (Update: these features are actually provided by TSAM) RSCT also allows you to define actions that should be taken when different resource change states. However, if you wanted to leverage RSCT directly, you would have to do a LOT of detailed customization for each component that you want actually automate to make highly available.

This is where TSAM fits in to make life easier for you. You've still got a good bit of customization to do, but it's a LOT less that you would otherwise have to do with the base RSCT. TSAM sits on top of RSCT and provides the mechanism that actually allows you to define arbitrary resources, resource groups and relationships, and based on your configuration (or "policy"), TSAM configures all of the automation necessary to make your resources highly available among the nodes in a cluster.

Specifically, TSAM allows you define resources of type "IBM.Application" (these are your applications) for which you configure Start, Stop, and Monitor commands. TSAM also provides the feature that automates the reflex actions required when your resources change state (for example, when an application goes Offline). With the introduction of these features (on top of RSCT as the base technology), TSAM fully automates the high availability of your applications based upon your configuration.

Much (certainly not all) of TSAM is scripts that are wrappers for the underlying RSCT commands. So when debugging TSAM, you'll primarily use RSCT commands. This is important to note, since it means that you must be intimately familiar with RSCT to be able to successfully deploy and manage TSAM. And TSAM makes a point of not replicating the RSCT documentation, so many of the commands you'll use to configure TSAM are documented in the RSCT manuals.

TSAM also provides an Operations Console, which is implemented as a WebSphere application that plugs into the WebSphere-based Integrated Solutions Console. This is really JUST an Operations Console, in that it ONLY allows operator-level management of your environment (e.g. bring an application online or offline, view information). This console provides you with NO configuration capabilities. You need to create all of your Resources, Resource Groups, Relationships, etc. from the command line. But it's not all painful. TSAM also provides the capability to export your "Automation Policy" (essentially, your entire configuration) to an XML file, and also to import from the same file. So this allows IBM and others to provide sample automation XML files that you can download, modify for your environment, and add to your existing policy.

All of the above is provided by the TSAM Base Automation Component. TSAM also provides an End to End (E2E) Automation Adapter, which allows you to manage and automate actions to be performed on resources across multiple clusters. This E2E component supports not only TSAM clusters, but also HACMP, Linux clusters, and even VCS clusters on Solaris.

TSAM also provides a TEC EIF publisher so you can send events to TEC (or the Omnibus EIF Probe) to allow you to monitor the status of your TSAM environment.

Links:

Lots of Documentation and Downloads:
http://www.ibm.com/software/tivoli/products/sys-auto-linux/downloads.html

Version 2.1 Redbook:
http://www.redbooks.ibm.com/redbooks/pdfs/sg247117.pdf

Main Product Page:
http://www-306.ibm.com/software/tivoli/products/sys-auto-multi/index.html

Wednesday, April 16, 2008

Installing BIRT on Windows Vista?

Well, installing BIRT is a no-brainer.  Just download the BIRT All-in-one from eclipse.org and unzip it. Very simple, right?  Prepare for a little bit of surprise when you do it in Windows Vista.   While trying to unzip on my Windows Vista computer, Vista displayed the following error. 

 

The source file name(s) are larger than is supported by the file system. Try moving to a location which has a shorter path name or try renaming to shorter name(s) before attempting this operation".

 

This error occurs due to 255 character limit on file names and C:\users\administrator\downloads\birt-report-designer-all-in-one-2_2_2.zip takes about 75 characters! This does not leave much room for the files within the zip causing the above error.

 

The solution is very simple. Rename the zip file to something like b.zip and move it up to the root directory (C:\).   Now try extracting it, it works like a charm. 

 

And, don’t ask me how the heck this worked in Windows XP and NOT in Vista? J  

 

 

Thursday, April 3, 2008

Some other useful VMWare tips

Since Venkat posted some nice tips for VMWare, I thought I would add a couple of my own.

Pre-allocate Disk
There are significant performance increases in pre-allocating the disk. Obviously this take more space, but it can really save having a fragmented image. This can also save on having to defragment all the time.

Split Disk
When building the image, make sure to split the disk into 2 GB files.

Run VM image from separate physical drive than the host
The host drive is going to be busy enough, if you have a second drive, use it! Also if you are using a laptop, there is a very good chance that the internal drive is a 4200 or 5400 RPM drive. These are really slow and to slow to run anything other than one VM that you are going to use Notepad on.

External Drive Solutions
I have tried a couple different drives running through USB, but this really is not much better than running on the host drive. USB is too slow for this type of use. You could use firewire, but not many x86 machines have firewire. One of the newer things to come out is eSATA (http://en.wikipedia.org/wiki/Serial_ATA#eSATA_in_comparison_to_other_external_buses). I purchased a 7200 RPM 2.5" drive with an eSATA enclosure and eSATA PCMCIA card for about $250.00. This will work without an external power supply, which is great

Here are the parts
- SEAGATE 160GB Momentus 7200.2 SATA Notebook HDD w/ G-Force Protection, NCQ, 8MB Cache
- Vantec eSATA 2-Port SATA PCMCIA Adapter (there is also an express card version)
- Vantec Nexstar 3 eSATA Aluminum 3.5" Enclosure, eSATA & USB2.0

This drive gets about 55Mb/s transfer versus my internal 5400 RPM drive at about 25Mb/s.

Image Snapshots
Snapshots are supposed to only cause a very minor amount of performance impact on the VM image, but if you don't need the snapshot, get rid of it.

Disk Space
Make sure there is more than 30% disk space available on the physical disk. There are many write ups on this topic that state when you drop below 30% free, there is significant slow down in performance.

Defrag
Make sure that there is a regular defrag of the physical drive along with defragmenting the VM drive.

A couple links for your viewing pleasure
http://www.virtualization.info/2005/11/how-to-improve-disk-io-performances.html

http://www.scribd.com/doc/281249/Vmware-server-tips-tricks-vmworld-2006

Hope this helps.

Martin

Wednesday, April 2, 2008

Some useful VMware parameters

If you are running VMWare server/workstation, you will find the following Vmware parameters useful.

mainMem.useNamedFile = "False"

This parameter is helpful if you have a slower disk like flash drive or drivers like ntfs-3g.

tools.syncTime = "TRUE"

Syncs the VM's clock with the host. Helpful to avoid time slips while running VMs.

MemTrimRate = "0"

Vmware, by default, trims the unused VMs memory and gives it back to host OS. This parameter disable the behavior. While this results in increased memory usage per VM, it also improves the VM performance.

Sched.mem.pshare.enable = "False"

Disables page sharing across VMs. This is again useful on systems with large amount of memory.

prefvmx.minVmMemPct = "100"

If you have a huge amount of memory, you might want to "pre-allocate" all allocated memory. It gives good performance boost but obviously limits the number of VMs you can run on the host.

Hope you find these parameters useful.

Tuesday, April 1, 2008

Strange errors with the Warehouse Proxy Agent if you have a bad initial configuration

I was just installing all of the pieces of ITM 6.2, ITCAM for Web Resources 6.2 and ITCAM for Response Time 6.2 on Windows with DB2 9.1 and I ran into a painful problem. The problem is that the WPA trace log had these errors:

(Tuesday, April 1, 2008, 3:35:20 PM-{9AC}khdxdbb.cpp,2360,"checkUTF8ClientEncoding") Database client encoding is not UTF8.
+47F29C88.0003 You need to set the OS environment variable DB2CODEPAGE=1208 for DB2 or
+47F29C88.0003 NLS_LANG=_.AL32UTF8 for ORACLE
(Tuesday, April 1, 2008, 3:35:20 PM-{9AC}khdxdbb.cpp,1728,"createStatusLogTable") Table WAREHOUSELOG exists already
(Tuesday, April 1, 2008, 3:35:20 PM-{9AC}khdxdbb.cpp,1735,"createStatusLogTable") Index WHLOG_IDX1 on WAREHOUSELOG exists already
(Tuesday, April 1, 2008, 3:35:20 PM-{9AC}khdxdbb.cpp,1746,"createStatusLogTable") Index WHLOG_IDX2 on WAREHOUSELOG exists already
(Tuesday, April 1, 2008, 3:35:20 PM-{9AC}khdxdbb.cpp,1757,"createStatusLogTable") Index WHLOG_IDX3 on WAREHOUSELOG exists already
(Tuesday, April 1, 2008, 3:35:20 PM-{9AC}khdxbase.cpp,250,"setError") Error 219/3/-443(FFFFFE45)/0 executing SQLColumns
(Tuesday, April 1, 2008, 3:35:20 PM-{9AC}khdxbase.cpp,266,"setError") Error "[IBM][CLI Driver][DB2/NT] SQL0443N Routine "SYSIBM.SQLCOLUMNS" (specific name "COLUMNS") has returned an error SQLSTATE with diagnostic text "SYSIBM:CLI:-727". SQLSTATE=38553
+47F29C88.0009 "
(Tuesday, April 1, 2008, 3:35:20 PM-{9AC}khdxdbb.cpp,792,"initializeDatabase") Initialization with Datasource "ITM Warehouse" failed
(Tuesday, April 1, 2008, 3:35:20 PM-{9AC}khdxsrvc.cpp,722,"testDatabaseConnection") testDatabaseConnection failed
(Tuesday, April 1, 2008, 3:35:20 PM-{9AC}khdxsrvc.cpp,653,"setupExportServer") A retry will be attempted in 10 minute(s).
(Tuesday, April 1, 2008, 3:35:20 PM-{9AC}khdxsrvc.cpp,654,"setupExportServer") Please check the troubleshooting guide for any error not described above.

And that meant that no data was getting in the warehouse.

The root of the problem is that I had NOT set the environment variable "DB2CODEPAGE=1208" before I started installing, and at this point some tables were created incorrectly. To fix the problem, I had to:

1. Stop the WPA

2. drop the UTF8TEST and WAREHOUSELOG tables from the WAREHOUS database (don't worry - the WPA recreates them when it starts back up)

3. Restart the WPA

And at this point, all was well.