<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Transitional//EN">
<HTML>
<HEAD>
  <!--
    *************************************************************************************
    * Copyright (c) 2005 VERITAS Software Corporation. All rights reserved. *

      For third-party license citations, please see the bottom of this file.
    *************************************************************************************
  -->
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="TEMPLATEBASE" content="vx_vxhelp_2005c">
<meta name="LASTUPDATED" content="06/17/05 10:11:26">
<meta name="PRODUCTNAME" content="VERITAS Software Documentation">
<meta name="FILENAME" content="06_build_agent.fm">
     
<title>Building a Custom VCS Agent</title>

</HEAD>

<BODY bgcolor="#FFFFFF" link="#000066" vlink="#0000ff" marginheight="0" topmargin="0">
<basefont=1>

<a name="998937"></a>

<div align="left">
<table border="0" cellspacing="0" cellpadding="0" width="100%">
 <tr>
   <td height="2" border="0" cellspacing="0" cellpadding="0" colspan="2" bgcolor="#000000">
   </td>
 </tr>
 <tr>
   <td height="15" width="50%" border="0" cellspacing="0" cellpadding="0" bgcolor="#cccccc">
    <img src="images/vxsymbol.gif" height="20" width="31" border="0" cellspacing="0" cellpadding="0" align="left">
     
     
   </td>
   <td align="right" width="50%" bgcolor="#cccccc">

<!-- Header Breadcrumbs -->
<font face="Verdana, Arial, Helvetica, Geneva, sansserif, sans serif" size="-2">&lt;&nbsp;<a href="05_logging_vcs155_1002026.html" title="Previous - Example of Logging Functions Used in Script Agent">Previous</a>&nbsp;&nbsp;|&nbsp;&nbsp;<a href="06_build_agent_vcs157_999022.html" title="Next - Building a VCS Agent for FileOnOff Resources">Next</a>
&nbsp;&gt;&nbsp;&nbsp;</font>
   </td>
 </tr>

 <tr>
  <td bgcolor="#CCCCCC" colspan="2" height="15" align="right">
  <font face="Verdana, Arial, Helvetica, Geneva, sansserif, sans serif" size="1">Product:  
<a href="vcs_splashpage_docCD_vcs1_103036.vxhd" title="Cluster Server Guides title page ">Cluster Server Guides</a>
  &nbsp;&nbsp;
  </font>
  </td>
 </tr>
 <tr>
  <td bgcolor="#CCCCCC" colspan="2" height="15" align="right">
  <font face="Verdana, Arial, Helvetica, Geneva, sansserif, sans serif" size="1">Manual:  
<a href="adg_hpux41_titlepage_docCD_vcs95_73700.vxhd" title="Cluster Server 4.1 Agent Developer's Guide title page ">Cluster Server 4.1 Agent Developer's Guide</a>
  &nbsp;&nbsp;
  </font>
  </td>
 </tr>


</table>
</div>

<div align="left">
 <table border="0" width="100%" bgcolor="#FFFFFF">
  <tr>
   <td width="100%" valign="top" bgcolor="#FFFFFF">

<!-- Start Main Topic Content -->
        <a name="startcontent"></a>
	
<h1><font face="Arial, Helvetica, Geneva, sansserif, sans serif, Verdana" size="+1" color="#000000"><a name="998937"></a>Building a Custom VCS Agent</font>
</h1>
          

<p>
<font face="Verdana, Arial, Helvetica, Geneva, sansserif, sans serif" size="2"><a name="998970"></a>The <font face="Courier New, Courier, sansserif, sans serif" size="2">VRTSvcs</font> package installed by the VCS installation program includes the following files to facilitate agent development. Note that custom agents are not supported by VERITAS Technical Support.</font>
</p>

<p>
<font face="Verdana, Arial, Helvetica, Geneva, sansserif, sans serif" size="2"><a name="1053521"></a><p><font face="Arial, Helvetica, Geneva, sansserif, sans serif, Verdana" size="2" color="#000000"><a name="1053525"></a>Script Agents</font>
</p>

<Table width="100%" border="1" cellpadding="2" cellspacing="0" title="C++ Agents">
<tr bgcolor="#CCCCCC"><th align="left"><font face="Verdana, Arial, Helvetica, Geneva, sansserif, sans serif" size="2" color="#000000"><b><a name="1053529"></a>Description</b>
</font></th>

<th align="left"><font face="Verdana, Arial, Helvetica, Geneva, sansserif, sans serif" size="2" color="#000000"><b><a name="1053531"></a>Pathname</b>
</font></th>

</tr>
<tr valign="top"><td><p>
<font face="Verdana, Arial, Helvetica, Geneva, sansserif, sans serif" size="2"><a name="1053533"></a>Ready-to-use VCS agent that includes a built-in implementation of the <font face="Courier New, Courier, sansserif, sans serif" size="2">VCSAgStartup</font> entry point.</font>
</p>
</td>
<td><p>
<font face="Verdana, Arial, Helvetica, Geneva, sansserif, sans serif" size="2"><a name="1053535"></a>	$VCS_HOME/bin/ScriptAgent</font>
</p>
<p>
<font face="Verdana, Arial, Helvetica, Geneva, sansserif, sans serif" size="2"><a name="1053536"></a>ScriptAgent cannot be used with C++ entry points.</font>
</p>
<p>
<font face="Verdana, Arial, Helvetica, Geneva, sansserif, sans serif" size="2"><a name="1053537"></a></font>
</p>
</td>
</tr>

</table>


<Table width="100%" border="0" cellpadding="1" cellspacing="0">
<tr><td>
</Table></font>
</p>

<p>
<font face="Verdana, Arial, Helvetica, Geneva, sansserif, sans serif" size="2"><a name="1053546"></a><p><font face="Arial, Helvetica, Geneva, sansserif, sans serif, Verdana" size="2" color="#000000"><a name="1053550"></a>C++ Agents</font>
</p>

<Table width="100%" border="1" cellpadding="2" cellspacing="0" >
<tr bgcolor="#CCCCCC"><th align="left"><font face="Verdana, Arial, Helvetica, Geneva, sansserif, sans serif" size="2" color="#000000"><b><a name="1053554"></a>Description</b>
</font></th>

<th align="left"><font face="Verdana, Arial, Helvetica, Geneva, sansserif, sans serif" size="2" color="#000000"><b><a name="1053556"></a>Pathname</b>
</font></th>

</tr>
<tr valign="top"><td><p>
<font face="Verdana, Arial, Helvetica, Geneva, sansserif, sans serif" size="2"><a name="1053558"></a>Directory containing a sample C++ agent and <font face="Courier New, Courier, sansserif, sans serif" size="2">Makefile</font>.	</font>
</p>
</td>
<td><p>
<font face="Verdana, Arial, Helvetica, Geneva, sansserif, sans serif" size="2"><a name="1053560"></a>$VCS_HOME/src/agent/Sample</font>
</p>
</td>
</tr>
<tr valign="top"><td><p>
<font face="Verdana, Arial, Helvetica, Geneva, sansserif, sans serif" size="2"><a name="1053562"></a>Sample <font face="Courier New, Courier, sansserif, sans serif" size="2">Makefile</font> for building a C++ agent.	</font>
</p>
</td>
<td><p>
<font face="Verdana, Arial, Helvetica, Geneva, sansserif, sans serif" size="2"><a name="1053564"></a>$VCS_HOME/src/agent/Sample/Makefile</font>
</p>
</td>
</tr>
<tr valign="top"><td><p>
<font face="Verdana, Arial, Helvetica, Geneva, sansserif, sans serif" size="2"><a name="1053566"></a>Entry point templates for C++ agents.	</font>
</p>
</td>
<td><p>
<font face="Verdana, Arial, Helvetica, Geneva, sansserif, sans serif" size="2"><a name="1053568"></a>$VCS_HOME/src/agent/Sample/agent.C</font>
</p>
</td>
</tr>

</table>


<Table width="100%" border="0" cellpadding="1" cellspacing="0">
<tr><td>
</Table></font>
</p>

<p>
<font face="Verdana, Arial, Helvetica, Geneva, sansserif, sans serif" size="2"><a name="1037317"></a></font>
</p>

<p>
<font face="Verdana, Arial, Helvetica, Geneva, sansserif, sans serif" size="2"><a name="999003"></a>Compiling is not required if all entry points are implemented using scripts. A copy of ScriptAgent is sufficient.</font>
</p>

<p>
<font face="Verdana, Arial, Helvetica, Geneva, sansserif, sans serif" size="2"><a name="999004"></a>Compiling is required to build the agent if any entry points are implemented using C++. We recommend the following procedures for developers implementing entry points using C++:</font>
</p>

<ol>
<li value="1">
<font face="Verdana, Arial, Helvetica, Geneva, sansserif, sans serif" size="2"><a name="1009487"></a>Edit <font face="Courier New, Courier, sansserif, sans serif" size="2">agent.C</font> to customize the implementation; agent.C is located in the directory <font face="Courier New, Courier, sansserif, sans serif" size="2">$VCS_HOME/src/agent/Sample</font>.
</font>
<li value="2">
<font face="Verdana, Arial, Helvetica, Geneva, sansserif, sans serif" size="2"><a name="1009489"></a>After completing the changes to agent.C, invoke the make command to build the agent. The command is invoked from <font face="Courier New, Courier, sansserif, sans serif" size="2">$VCS_HOME/src/agent/Sample</font>, where the Makefile is located.
</font>
</ol>
<br>
<p>
<font face="Font_SingleByte;" size="2"><a name="999007"></a><b>Additional Recommendations</b></font>
</p>
<p>
<font face="Verdana, Arial, Helvetica, Geneva, sansserif, sans serif" size="2"><a name="999008"></a>We also recommend naming the agent binary <font face="Courier New, Courier, sansserif, sans serif" size="2">resource_typeAgent</font>. Place the agent in the directory <font face="Courier New, Courier, sansserif, sans serif" size="2">$VCS_HOME/bin/resource_type</font>.</font>
</p>

<p>
<font face="Verdana, Arial, Helvetica, Geneva, sansserif, sans serif" size="2"><a name="1050113"></a>The agent binary for Oracle would be <font face="Courier New, Courier, sansserif, sans serif" size="2">$VCS_HOME/bin/Oracle/OracleAgent</font>, for example. If the agent file is different, for example <font face="Courier New, Courier, sansserif, sans serif" size="2">/foo/ora_agent</font>, the <font face="Courier New, Courier, sansserif, sans serif" size="2">types.cf</font> file must contain the following entry:</font>
</p>

<br>
<font face="Courier New, Courier, sansserif, sans serif" size="2"><a name="1050114"></a>&nbsp;&nbsp;...
</font>
<br>
<font face="Courier New, Courier, sansserif, sans serif" size="2"><a name="1050115"></a>&nbsp;&nbsp;&nbsp;Type&nbsp;Oracle&nbsp;(
</font>
<br>
<font face="Courier New, Courier, sansserif, sans serif" size="2"><a name="1050116"></a>&nbsp;&nbsp;&nbsp;&nbsp;...
</font>
<br>
<font face="Courier New, Courier, sansserif, sans serif" size="2"><a name="1050117"></a>&nbsp;&nbsp;&nbsp;&nbsp;static&nbsp;str&nbsp;AgentFile&nbsp;=&nbsp;&quot;/foo/ora_agent&quot;
</font>
<br>
<font face="Courier New, Courier, sansserif, sans serif" size="2"><a name="1050118"></a>&nbsp;&nbsp;&nbsp;&nbsp;...
</font>
<br>
<font face="Courier New, Courier, sansserif, sans serif" size="2"><a name="1050119"></a>&nbsp;&nbsp;)
</font>
<p>
<font face="Verdana, Arial, Helvetica, Geneva, sansserif, sans serif" size="2"><a name="1050120"></a>If entry points are implemented using scripts, the script file must be placed in the directory <font face="Courier New, Courier, sansserif, sans serif" size="2">$VCS_HOME/bin/</font><em>resource_type</em>. It must be named correctly (if necessary, review <a href="02_ep_oview_vcs112_998965.html#998979">Script Agents</a>). </font>
</p>

<p>
<font face="Verdana, Arial, Helvetica, Geneva, sansserif, sans serif" size="2"><a name="1000672"></a>If all entry points are scripts, all scripts should be in the directory <font face="Courier New, Courier, sansserif, sans serif" size="2">$VCS_HOME/bin/</font><em>resource_type</em>. Copy the ScriptAgent into the agent directory as <font face="Courier New, Courier, sansserif, sans serif" size="2">$VCS_HOME/bin/</font><em>resource_type</em><font face="Courier New, Courier, sansserif, sans serif" size="2">/</font><em>resource_type</em><font face="Courier New, Courier, sansserif, sans serif" size="2">Agent</font>.</font>
</p>

<p>
<font face="Verdana, Arial, Helvetica, Geneva, sansserif, sans serif" size="2"><a name="1033318"></a>For example, if the online entry point for Oracle is implemented using Perl, the online script must be: <font face="Courier New, Courier, sansserif, sans serif" size="2">$VCS_HOME/bin/Oracle/online</font>.</font>
</p>


<!-- End Main Topic Content -->

   </td>
  </tr>
 </table>
</div>

<div>
<table border="0" cellspacing="0" cellpadding="0" width="100%">
 <tr>
  <td height="18" border="0" cellspacing="0" cellpadding="0" colspan="2" bgcolor="#FFFFFF">
  </td>
 </tr>
  <td align="left"><font face="Verdana, Arial, Helvetica, Geneva, sansserif, sans serif" size="-2">&nbsp;&#94;&nbsp;<a href="06_build_agent_vcs156_998937.html" title="Building a Custom VCS Agent">Return to Top</a></font>

  </td>
  <td align="right"><font face="Verdana, Arial, Helvetica, Geneva, sansserif, sans serif" size="-2">&lt;&nbsp;<a href="05_logging_vcs155_1002026.html" title="Previous - Example of Logging Functions Used in Script Agent">Previous</a>&nbsp;&nbsp;|&nbsp;&nbsp;<a href="06_build_agent_vcs157_999022.html" title="Next - Building a VCS Agent for FileOnOff Resources">Next</a>
&nbsp;&gt;&nbsp;&nbsp;</font>
  </td>
 <tr>
   <td height="9" border="0" cellspacing="0" cellpadding="0" colspan="2" bgcolor="#FFFFFF">
   </td>
 </tr>

<!-- Footer Breadcrumbs -->
<tr>
<td bgcolor="#FFFFFF" colspan="2" height="15" align="right">
<font face="Verdana, Arial, Helvetica, Geneva, sansserif, sans serif" size="1">Product:  
<a href="vcs_splashpage_docCD_vcs1_103036.vxhd" title="Cluster Server Guides title page ">Cluster Server Guides</a>&nbsp;&nbsp;</font></td>
</tr>

<tr>
<td bgcolor="#FFFFFF" colspan="2" height="15" align="right">
<font face="Verdana, Arial, Helvetica, Geneva, sansserif, sans serif" size="1">Manual:  
<a href="adg_hpux41_titlepage_docCD_vcs95_73700.vxhd" title="Cluster Server 4.1 Agent Developer's Guide title page ">Cluster Server 4.1 Agent Developer's Guide</a>&nbsp;&nbsp;</font></td>
</tr>


 <tr>
  <td colspan="2" align="left"><font face="Verdana, Arial, Helvetica, Geneva, sansserif, sans serif" color="#000000" align="right" size="-2">
<em>VERITAS Software Corporation
</em></font><br>

<font face="Verdana, Arial, Helvetica, Geneva, sansserif, sans serif" size="-2">www.veritas.com</font><br>
  </td>
 </tr>
</table>
</div>

</BODY>
  <!--
    *************************************************************************************
    * Copyright (c) 2005 VERITAS Software Corporation. All rights reserved. *

    VERITAS, VERITAS SOFTWARE, the VERITAS Logo, and VERITAS Software Documentation 
    are trademarks or registered trademarks of VERITAS Software Corporation 
    or its affiliates in the U.S. and other countries. Other names may be 
    trademarks of their respective owners. 

    Apache Jakarta Lucene:
    Apache Software License
    Version 1.1

    Copyright (c) 2000 The Apache Software Foundation. All rights reserved.

    Redistribution and use in source and binary forms, with or without modification, 
    are permitted provided that the following conditions are met:

    1. Redistributions of source code must retain the above copyright notice, this 
    list of conditions and the following disclaimer.

    2. Redistributions in binary form must reproduce the above copyright notice, this 
    list of conditions and the following disclaimer in the documentation and/or other 
    materials provided with the distribution.

    3. The end-user documentation included with the redistribution, if any, must include 
    the following acknowledgment: "This product includes software developed by the Apache 
    Software Foundation (http://www.apache.org/)." Alternately, this acknowledgment may 
    appear in the software itself, if and wherever such third-party acknowledgments 
    normally appear.

    4. The names "Apache" and "Apache Software Foundation" must not be used to endorse or 
    promote products derived from this software without prior written permission. For 
    written permission, please contact apache@apache.org.

    5. Products derived from this software may not be called "Apache", nor may "Apache" 
    appear in their name, without prior written permission of the Apache Software Foundation.

    THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, 
    BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 
    PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION 
    OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, 
    OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 
    OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 
    ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 
    NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 
    ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

    This software consists of voluntary contributions made by many individuals on behalf 
    of the Apache Software Foundation. For more information on the Apache Software Foundation, 
    please see <http://www.apache.org/>. Portions of this software are based upon public domain 
    software originally written at the National Center for Supercomputing Applications, University 
    of Illinois, Urbana-Champaign.
    
    This product includes WebWindow Software developed by Horst Heistermann.
    *************************************************************************************
  -->
</HTML>
