Forum Discussion

Divakar_SK's avatar
Divakar_SK
Level 2
13 years ago

Need help to configure Event Trigger - VCS

Hi All,

 

We have a requirment to configure Event Trigger (sysoffline, sysjoin).

Cutomer provided a shell script which controls their applcaiton. We need to call this script via sysoffline and sysjoin.

 

We have added the below line on sysoffline and sysjoing triggers...

=========

# put your code here...
system("/opt/Carmen/CARMUSR/PROD/bin/admin/inspect_cluster_status $ARGV[0] $ARGV[1]");

=========

But I am not sure how to invoke this scripts whenever cluster node down and join again.

The example saying to use " sysjoin <system> <systemstate> ". Not sure where to put the entries.

 

Could you please help me to fix it.

Please let me know if you need more details.

 

Thanks.

Divakar SK

  • Just put triggers in /opt/VRTSvcs/bin/triggers and make sure they are executable (i.e copy triggers from  /opt/VRTSvcs/bin/sample_triggers to  /opt/VRTSvcs/bin/triggers and then amend as required).

    Mike

4 Replies

  • Just put triggers in /opt/VRTSvcs/bin/triggers and make sure they are executable (i.e copy triggers from  /opt/VRTSvcs/bin/sample_triggers to  /opt/VRTSvcs/bin/triggers and then amend as required).

    Mike

  • Divakar,

    The example you mentioned above, of "sysjoin <system> <systemstate>", is what the VCS engine will execute when it calls the script.  So VCS is passing two arguments to the script, which you can use in your code.  Use the argument $ARGV[0] if you want to obtain the system name which is passed to the sysjoin script, and use $ARGV[1] to get the systemstate value, if you want to use it.

    As Mike mentioned, copy the sysjoin script into the triggers directory to use it.  If VCS sees the script there, it will execute it when a system joins the cluster.  You need to copy it to the triggers dir on each system.

    Its been a while since I've used triggers, but this is how I remember using them.

    -John

  • There is no offline/online method for triggers. 

    If you want to enable a trigger in VCS, copy the trigger file to /opt/VRTSvcs/bin/triggers, and it will be activated during VCS operations. To disable, remove the trigger file from above location.

    The sysoffline and sysjoin triggers will be invoked from lowest id node in cluster in case of node state change on other nodes in cluster.

  • Apologies for the late response.

    I just copied the required script to triggers location and modify the script as below and it work as expected.

    ========

    # put your code here...
    system("/home/tng/restart_jep.sh >> /users/vfu/restart_jep.runlog 2>&1");

    =======

    Thanks to everyone who replied.

     

    Regards,

    Divakar