A blog about my experience in the IT world.

Change TFA default OSWATCHER parameters

May 26, 2017

By default, after TFA installation OSWATCHER runs with:

> ps -edf | grep -i osw
...  /bin/sh ./OSWatcher.sh 30 48 ...

Meaning that a snapshot is made every 30 minutes and kept for 48 hours.

Since this 48 hours seem to be insufficient for a problem detection/analysis so I wanted to double it, but nowhere on tfactl was I able to find any way to change it.

Looking into the file $TFA_BASE/$hostname/tfa_home/ext/oswbb/oswbb.pm

Where $TFA_BASE is the path you specified when install TFA:

Enter a location for installing TFA (/tfa will be appended if not supplied) [/root/tfa]

I found that a file called .osw.prop is being read to get the values for the variables:

my $tool = "oswbb";
my $tfa_base = tfactlshare_get_tfa_base($tfa_home);
..
my $tool_base = catfile($tfa_base, "suptools", "$hostname", $tool, $current_user);
my $osw_prop = catfile($tool_base, ".osw.prop");
..
    if ( -f $osw_prop )
    {
      open(ORF, $osw_prop);
      while()
      {
        if ( ! $interval && /interval=(\d+)/ )
        {
          $interval = $1;
        }
         elsif ( ! $hours && /hours=(\d+)/ )
        {
          $hours = $1;
        }
         elsif ( ! $zip && /zip=(.*)/ )

The location of the file is not clear since it is given by the function tfactlshare_get_tfa_base, so:

find . -name ".osw.prop"

And the file is found in:

> $TFA_BASE/repository/suptools/$hostname/oswbb/$current_user/.osw.prop

Note: after know this the file is easily found by checking the archive location of the running process:

[root@hostname root]# ps -edf | grep -i osw
root     31662     1  0 20:57 pts/0    00:00:00 /bin/sh ./OSWatcher.sh 30 48 NONE /oracle/products/tfa/repository/suptools/hostname/oswbb/root/archive


The .osw.prop resides in the parent directory.

Having located the file is just a matter of editing it:

> cat $TFA_BASE/repository/suptools/$hostname/oswbb//$current_user/.osw.prop
interval=30
hours=48
zip=NONE
runuser=oracle

> vi $TFA_BASE/repository/suptools/$hostname/oswbb//$current_user/.osw.prop

> cat $TFA_BASE/repository/suptools/$hostname/oswbb//$current_user/.osw.prop
interval=30
hours=96
zip=NONE
runuser=oracle

> tfactl stop oswbb
> tfactl start oswddb

And now the values are modified.

> ps -edf | grep -i osw
... /bin/sh ./OSWatcher.sh 30 96 ...

I think there should be a easier way to do this: Making this change in a cluster environment we'll need to run it in all nodes of the cluster.