When a console user right clicks a tool target object and selects a tool from the pop-up menu, that action triggers a call to the tool’s executable file, which is a shell script on UNIX. Using the “LSP Ping” server tool as an example, right clicking an LSP object and selecting “LSP Ping” from the pop-up menu triggers a call to the LSPPing.cmd file. The following lines in the lsp-ping-action.xml file for LSP Ping clarify this behavior.

<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE ics_config SYSTEM "ics-config.dtd">
<ics_config version="2">
    <actionconfig name="LSP Ping" type="Server" enable="True">
            <program_name>LSPPing.cmd</program_name>
            <timeout>60</timeout>
            <display display_value="True" />
            <trace trace_value="False" />
            <userprofile>admin-profile</userprofile>
            <userprofile>oper-profile</userprofile>
            <userprofile>maint-profile</userprofile>
        <context_criteria>
                <filterconfig type="Expression">
                <isa>LSP</isa>
                </filterconfig>
        </context_criteria>
    </actionconfig>
   

The tool executable file collects attributes of the tool target object and passes them to the local tool script as environment variables in the form:

SM_OBJ_Name=<value>

The Service Assurance Manager Configuration Guide identifies the SM_OBJ_Name environment variables and describes the values defined for them.

The “LSP Ping” server tool calls LSPPing.sh on UNIX.

LSPPing.sh is defined as:

OS=`/bin/uname`
TELNET_DIRECTORY=/bin/
OS=`/bin/uname`
PING_DIRECTORY=/usr/sbin/
received=0
transmitted=0
INCHARGEDOMAIN="InChargeDomain"
Operation="invoke"
DMCTL=${SM_HOME}"/bin/dmctl"
SM_ADAPTER=${SM_HOME}"/bin/sm_adapter"
LD_LIBRARY_PATH=/usr/lib:$LD_LIBRARY_PATH
export LD_LIBRARY_PATH
XTERM_DIRECTORY=/usr/openwin/bin/
# Obtain the name of LSP from which LSP Ping is launched
LSP=${SM_OBJ_Name}
# Call tool ASL script
${SM_ADAPTER} --server=${SM_SERVER_NAME} --model=sm_invoke_remote 
   -D LSP=${LSP} -D ServerName=${SM_SERVER_NAME} ics/LSPPing.asl

In either file, the SM_ADAPTER command line, where SM_ADAPTER is an environment variable set to the full path of the sm_adapter command, starts the local tool script, LSPPing.asl, with two environment variables, SM_OBJ_Name and SM_SERVER_NAME. SM_OBJ_Name holds the name of the LSP from which the “LSP Ping” server tool was launched, and SM_SERVER_NAME holds the name of the Global Manager.