Run a script automatically when an IP is added

Pedro unpete unpetee at gmail.com
Thu Aug 28 17:31:27 UTC 2014


Hi,

Will VIP relocation trigger it? <---- unfortunately, i have not an RAC
environment to try it and i've never used somethig like this, but maybe the
answer is yes, because the resource moves with de vip.


1. appvipcfg create -network=1 -ip <your_vip> -vipname myapp -user=root

2. crsctl start rest myapp

3 cat myapp.sh

#!/bin/bash
case $1 in
'start')
(your script)
;;
'stop')
(your script).
;;
esac

exit 0

4. cat myapp_profile

ACTION_SCRIPT=[ANY_PATH]/myapp.sh
HOSTING_MEMBERS= host1 [host2 host3]
START_DEPENDENCIES=hard(myapp)
STOP_DEPENDENCES=hard(myapp)

crsctl add resource myresource -type=cluster_resource -file myapp_profile

crsctl start resource myresource

Regards
Pedro


2014-08-28 18:40 GMT+02:00 Yong Huang <yong321 at yahoo.com>:

> Thanks Pedro. How will the action script for the new profile be triggered?
> Will VIP relocation trigger it?
>
> I already tested Oracle RAC's FAN callout, i.e., a script in
> $GRID_HOME/racg/usrco is run on certain events. It works on instance or
> service up or down event. But it does NOT work on VIP relocation (crsctl
> relocate resource ora.thisserver.vip -n anotherserver).
>
> Camero, thanks. I already scheduled a cron job to do exactly what you
> described. But it's not *triggered* on VIP relocation. So it's not ideal.
>
>



More information about the redhat-list mailing list