Example: Using script entry points on UNIX

The following example shows how to build the FileOnOff agent without writing and compiling any C++ code. This example implements the online, offline, and monitor entry points only.

Example: implementing entry points using scripts

  1. Create the directory /opt/VRTSvcs/bin/FileOnOff:

    mkdir /opt/VRTSvcs/bin/FileOnOff

  2. Use the VCS agent /opt/VRTSvcs/bin/Script50Agent as the FileOnOff agent. Copy this file to the following path: /opt/VRTSvcs/bin/FileOnOff/FileOnOffAgent

    or create a link.

    To copy the agent binary:

    cp /opt/VRTSvcs/bin/Script50Agent

    /opt/VRTSvcs/bin/FileOnOff/FileOnOffAgent

    To create a link to the agent binary:

    ln -s /opt/VRTSvcs/bin/Script50Agent

    /opt/VRTSvcs/bin/FileOnOff/FileOnOffAgent

  3. Implement the online, offline, and monitor entry points using scripts. Use any editor.

# !/bin/sh

# Create the file specified by the PathName

# attribute.

touch $2

exit 0

# !/bin/sh

# Remove the file specified by the PathName

# attribute.

rm $2

exit 0

# !/bin/sh

# Verify file specified by the PathName attribute

# exists.

if test -f $2

then exit 110;

else exit 100;

fi

  1. Additionally, you can implement the info and action entry points. For the action entry point, create a subdirectory named "actions" under the agent directory, and create scripts with the same names as the action_tokens within the subdirectory.