Video Screencast Help

triggers.

Created: 15 Apr 2005 • Updated: 22 May 2010 | 2 comments

All,

I am not very good at scripting.We are using cluster server 1.3 which is not supported by veritas any more.

Any help from this group in getting the following issue resolved would be of great help..

All I need to do is..TO BLINDLY RUN A SCRIPT AFTER A FILE SYSTEM IS MOUNTED (which is a resource , type mount in my configuration)"

I know triggers are available in 1.3 but not sure how to use them for above case.I used application agent but I got stuck as I am not supposed to monitor the agent.

Again your help is highly appreciated...

Discussion Filed Under:

Comments 2 CommentsJump to latest comment

system storage's picture

As an alternate solution, you can develop your own agent, for example, postmountagent and put the script that you want to run after mount in the online script of the agent, then add a resource of postmount type in your main.cf.

Ralph Göstenmeier 2's picture

Hi,
Triggers are used in two cases:
- for groups (after online, after offline, after faulted)
- for resources (after status change)

All Triggers located in /opt/VRTSvcs/bin/triggers and named by the reason of calling, e.g. postonline, postoffline, resstatechange.

So, to use a trigger when the status of a resource changes:
- configure the service group to use the resstatechange trigger
hagrp -modify TriggerResStateChange 1

- create a script in /opt/VRTSvcs/bin/triggers called resstatechange. This will be called on all systems, when the status of the resource is change (called with parameters

If you want to perform an action on the system where the resource becomes online, you have to do somethine like

THISHOST=`hostname`
STATE=`hares -state $2 -sys $THISHOST`
if
then
.. .. perform action
fi


Hope that helps
Ralph