Video Screencast Help
Symantec to Separate Into Two Focused, Industry-Leading Technology Companies. Learn more.

Only need to add specific word in monitoring process

Created: 05 May 2014 | 7 comments
Zahid.Haseeb's picture

Environment

OS = RHEL/Solaris

SFHA = 5.1/6.x

Query

Under monitoring process I only want the VCS see xyz name instead of a complete line in the result ps -ef |grep xyz

Operating Systems:
Discussion Filed Under:

Comments 7 CommentsJump to latest comment

Setu Gupta's picture

Hi Zaheed,

Can you please explain the use-case for this requirement?

Zahid.Haseeb's picture

Under monotoring process we have to add complete process line which we got under result of ps -ef|grep process. (See a example output below)

process.exe  /home/app/logs/process.o 5

 

The number 5 is the verbosity of application logs. Sometimes the application support guys change the value of verbosity from 5 to 4 or 3 which results application resource faulted. (it happens sometime when the support team deploy application fixes/patches ) . So we only want to pick the process name only instead of catching a complete process line.

Any comment will be appreciated. Mark as Solution if your query is resolved
__________________
Thanks in Advance
Zahid Haseeb

zahidhaseeb.wordpress.com

Setu Gupta's picture

It is possible that the same binary takes different arguments to invoke different processes. It is for this purpose that the complete process line should be provided in the MonitorProcesses attribute of Application resource.

For your use case, you can probably write a small script that will simply match the process line ignoring the last 5 or 4 or 3 and will return 100 if the process is not running and 110 if it is running. Then this script can be configured in MonitorProgram attribute of the resource.

mikebounds's picture

Or you can use PIDFiles attribute - i.e modify you StartProgram script to create a pid file and get VCS to monitor the process in the PIDFile by specifying this PIDFile in the attribute.

Mike

UK Symantec Consultant in VCS, GCO, SF, VVR, VxAT on Solaris, AIX, HP-ux, Linux & Windows

If this post has answered your question then please click on "Mark as solution" link below

Zahid.Haseeb's picture

I am able to create a monitor program. Now the time is to remove processes from the Monitor Process attribute and define the monitor program under monitor program attribute.

My question is that, can I do it while the Service Grroup is online ?

Any comment will be appreciated. Mark as Solution if your query is resolved
__________________
Thanks in Advance
Zahid Haseeb

zahidhaseeb.wordpress.com

mikebounds's picture

You can use:

hares -modify app-res MonitorProcesses ""

 

or

hares -modify app-res MonitorProcesses -delete -keys

 

I would freeze service group first and add MonitorProgram first.  After adding MonitorProgram, it should use BOTH MonitorProcesses and MonitorProgram, so if resource is still online after this, then MonitorProgram works and you can remove MonitorProcesses.

Mike

 

UK Symantec Consultant in VCS, GCO, SF, VVR, VxAT on Solaris, AIX, HP-ux, Linux & Windows

If this post has answered your question then please click on "Mark as solution" link below

Zahid.Haseeb's picture

One thing I noticed while using the Monitor Program. On every 24 hours close to 1:50 AM - 1:59 AM my application resource gets faulted which leads a failover. This I noticed in last two days. Eventually I removed the monitor program script and add the monitor processes and then did not see any unexpected failover.

After discussing with the application support team, they respond that it seems one process which is monitor getting crashed. My question is why at time of using the specific process is crashing.

Please Note: I only want to grap a specific word from the Process instead of complete process. which is not possible when using the Monitor Process. Thats why we created a Monitor Program. See the below created Monitor Program. Where USER_ABC is the user under which the process is running

SCRIPT

#!/usr/bin/bash

returnval=110

for arg in $*;
do
    proc=`ps -ef | grep USER_ABC | grep exe |grep -v grep | grep $arg | awk '{print $8}'`
    if [ -z "$proc" ]; then
        echo $arg is not running
        returnval=100
    else
        if [ -z "`echo $proc | grep $arg`" ]; then
            echo $arg is not running
            returnval=100
        fi
    fi
done

exit $returnval

 

MONITOR PROGRAM EXECUTION

#/FOLDER/MonitorProgram.sh process1 process2 process3

#110

Any comment will be appreciated. Mark as Solution if your query is resolved
__________________
Thanks in Advance
Zahid Haseeb

zahidhaseeb.wordpress.com