Showing results for 
Search instead for 
Did you mean: 

Running StartProgram and StopProgram manually

Level 3

I am writing a script that will allow members of an application development team to restart/stop/start their applications which run under VCS without triggering a failover or fault within the cluster. I'm doing this by simply freezing the service group and then calling StartProgram and StopProgram as necessary. I'm parsing hares -display $MYRESOURCE -attribute StartProgram or StopProgram to get this information.


# hares -display myresource -attribute StartProgram
#Resource                             Attribute        System      Value
myresource                           StartProgram     global      /apps/software/javaservlet/myresource/bin/ start


The issue I'm facing is that parsing this output for the Value information isn't always resulting in a clean command to be run. So I'm wondering if there is an hares command I can use to call the Start or Stop programs directly, even while the service group is frozen? I looked at hares -action but I'm not sure if that's what I want. Any help or suggestions are appreciated.



Level 5

Most likely you seem to be using Application Agent. If you have MonitorProgram specified as the monitoring method for your VCS resource, then you may want to use the Intentional Offline feature that is available from VCS 5.0MP3 onwards. If you modify your MonitorProgram to return Intentional Offline return code (i.e. 200) then the resource would not be faulted in VCS. Instead it will be marked as Offline and would not trigger any failover or fault.

Level 6
Partner Accredited

If you just want to offline a resource without causing a failover, then you can offline resource in VCS by just using "hares -offline res_name -sys system" and there is no need to freeze.  If you can't do this for some reason, then you could try using "hares -value" as this will return just your attribute so will be easier to parse.