Oracle OSWatcher: Enterprise Wide Install Tips

by Seth Miller

I recently finished setting up a two node 11gR1 Oracle RAC cluster. One of the last steps was to run RACCHECK to see if anything was missed. A lot of recommendations came up, including setting up OSWatcher. Setting this up has not been a standard practice for us but I have used it for troubleshooting in the past as well as having Oracle Support request the files in support cases. My goal was to set it up in a central location to have access to the logs for all of the servers running OSWatcher in one place.

I unzipped the latest version of the software in a “golden template” location (we’ll call this $GOLDEN_BASE) so I can just copy the whole thing for each different server. Then, I created the central location accessible to all of the servers on which OSWatcher is to be installed. We’ll call this $OSW_BASE. oswatcher was added for clarity.

mkdir -p $OSW_BASE/oswatcher

Since we only have one domain, all of the server names that I install the program on will be unique. The -s flag on the hostname command trims the domain leaving just the hostname. $(hostname -s) can be used literally because it will expand to the hostname it is running on automatically. It is functionally the same as `hostname -s`. Here is the command to create the directory for the server.

mkdir -p $OSW_BASE/oswatcher/$(hostname -s)

Copy the golden image files to the newly created directory.

cp -a $GOLDEN_BASE/OSWatcher/* $OSW_BASE/oswatcher/$(hostname -s)/

Creating the “private.net” file is not necessary but does give additional monitoring for the interconnect between the nodes of a RAC. It is nothing more than a traceroute to each of the other nodes in the cluster through the interconnect. In my case, I am using Oracle Linux 5. I created private.net in the home directory of OSWatcher with the following contents.

echo “zzz ***”`date`
traceroute -r -F usc1-racdev01-priv
######################################################################
# DO NOT DELETE THE FOLLOWING LINE!!!!!!!!!!!!!!!!!!!!!
######################################################################
rm locks/lock.file

The program can be started manually with the script startOSWbb.sh located within the base directory. However, in order to make sure the program is started on boot and restarted if it dies, an entry is added to the crontab of the user that owns the program. In my case, I put the entry in oracle’s crontab.

######################################################################
### Oracle OS Watcher
######################################################################
0,15,30,45 * * * * cd $OSW_BASE/oswatcher/$(hostname -s); ./startOSWbb.sh > $OSW_BASE/oswatcher/$(hostname -s)/tmplog 2>&1

OSWatcher is a good program to have installed and running both from a database and OS support perspective as well as having an even closer eye on what is happening on the database server. This program has little to do with Oracle database and can be run on any Unix system. The documentation is very ambiguous on setup scenarios and the layout I provided here is purely from trial and error. Feel free to share your comments and suggestions.