Alter oswatcher collection interval when it is implemented as a SMF Service (SuperCluster)

On SuperCluster the oracle oswatcher statistics collection service is installed as a package from the exa-family repository

root@sc5acn01-d2:~# pkg info oswatcher
          Name: system/platform/exa-family/oswatcher
       Summary: Oracle system performance monitor
   Description: Oracle system performance monitor
         State: Installed
     Publisher: exa-family
       Version: 0.5.11
 Build Release: 5.11
        Branch: 0.1.0.19
Packaging Date: Fri Sep 27 13:42:50 2013
          Size: 1.28 MB
          FMRI: pkg://exa-family/system/platform/exa-family/oswatcher@0.5.11,5.11-0.1.0.19:20130927T134250Z

and created as a service

root@sc5acn01-d2:~# svcs /system/oswatcher
STATE          STIME    FMRI
enabled       10:23:50 svc:/system/oswatcher:default

This means that it is restarted automatically on reboot (Good!) but it is less straightforward to change the default parameters such as collection interval and retention.

Stop the service

root@sc5acn01-d2:~# svcadm disable /system/oswatcher

Find the startup script used by the service

root@sc5acn01-d2:/lib/svc/method# svccfg -s oswatcher:default listprop *exec*
start/exec astring     "/lib/svc/method/oswatcher start"
stop/exec  astring     "/lib/svc/method/oswatcher stop"

edit the script to set your required collection interval by changing the line below. 15 is the collection interval in seconds, 168 is the retention in hours

        pushd /opt/oracle.oswatcher/osw/ && { ./startOSW.sh 15 168 bzip2;  popd; } || exit $SMF_EXIT_ERR_FATAL

So, if you need a 60 second collection interval and a 28 day retention it becomes

        pushd /opt/oracle.oswatcher/osw/ && { ./startOSW.sh 60 672 bzip2;  popd; } || exit $SMF_EXIT_ERR_FATAL

Refresh the service and start it

root@sc5acn01-d2:~# svcadm refresh /system/oswatcher
root@sc5acn01-d2:~# svcadm enable /system/oswatcher
root@sc5acn01-d2:~# svcs /system/oswatcher
STATE          STIME    FMRI
online         11:05:05 svc:/system/oswatcher:default

You can check via ps to see that is running with your new settings

root@sc5acn01-d2:~# ps -ef |grep OSW
    root 29477 29436   0 11:05:13 ?           0:00 /usr/bin/ksh ./OSWatcherFM.sh 672
    root 29436     1   0 11:05:05 ?           0:00 /usr/bin/ksh ./OSWatcher.sh 60 672 bzip2

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s