09-13-2011 01:50 PM
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/servlet.sh 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.
09-15-2011 10:00 PM
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.
09-16-2011 02:07 PM
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.