Skip to main content
Version: 2.17.x.x LTS

NevisAgentDataSink

The NevisAgentDataSink sends scripts to NevisAgent, commands the agent to execute the scripts, and analyzes the script execution result.

During initialisation (init), the NevisAgentDataSink tries to send all scripts to the NevisAgent. If the delivery fails at init, the data sink will try one more time during export. Once all scripts are available in the agent, the data sink sends a command execution request to the agent, and the agent executes it locally. The agent replies the data sink with execution output and exit status. The user could define the acceptable output format and exit status in the configuration xml-file. If the data sink detects any inconsistency, it reports an error and terminates the export.

Configuration

NameType, usage constraints, defaultsDescription
commandrequired: paraVal
default: none
type: string
Defines which command of the command set to be executed.
urlrequired: paraVal
default: none
type: http URI
Defines the URL of the agent.
connectionPoolrequired: paraVal
default: none
type: org.apache.http.client.HttpClient
A reference to an org.apache.http.client.HttpClient object. It refers to either an HttpConnectionPool defined in some initialization section of the configuration file, or to an HttpClient provided programmatically by the client application that is put into the configuration repository.
useroptional: paraVal
default: none
type: string
Defines the owner of the script in the agent.
groupoptional: paraVal
default: none
type: string
Defines the owner's group of the script.
maskoptional: paraVal
default: 700
type: string
Defines the mask of the script's permission mode.
commandSetrequired: paraMap
default: none
type: A map of key-value pairs denoting all the commands. The key is the name of a command. The details of the command are described using a map. The structure of the map is defined in the next table.
Defines a set of commands the agent could execute.
NameType, usage constraints, defaultsDescription
cmdrequired: value
default: none
type: path to the script
Defines the name of script to be sent to the agent.
argsoptional: list
default: none
type: java.util.List
Defines the list of arguments when executing the command.
destrequired: value
default: none
type: string
Defines the destination path and script name in the agent.
retoptional: value
default: 0
type: string
Defines the expected exit value of the script execution.
outputoptional: value
default: none
type: string
Defines the regular expression of the script execution output.

Example

Put a script in NevisAgent and execute the script.

<dataSink type="NevisAgentDataSink">
<dp:paraVal name="url" value="${cfg.nevisAgent}"/>
<dp:paraVal name="connectionPool" value="${inst.httpConnection}"/>
<dp:paraVal name="command" value="cmd0"/>
<dp:paraMap name="commandSet">
<map name="cmd0">
<value name="cmd" value="run.sh"/>
<value name="dest" value="/tmp/run.sh"/>
</map>
</dp:paraMap>
</dataSink>

Define a set of commands, and select the command to execute according to the input value.

<dataSink type="NevisAgentDataSink">
<dp:paraVal name="url" value="${cfg.nevisAgent}"/>
<dp:paraVal name="connectionPool" value="${inst.httpConnection}"/>
<dp:paraVal name="command" value="#{in.test.ctrl}"/>
<dp:paraMap name="commandSet">
<map name="ctrl0">
<value name="cmd" value="run.sh"/>
<value name="dest" value="/tmp/run.sh"/>
</map>
<map name="ctrl1">
<value name="cmd" value="sit.sh"/>
<value name="dest" value="/tmp/sit.sh"/>
<value name="ret" value="-1"/>
</map>
<map name="ctrl2">
<value name="cmd" value="walk.sh"/>
<value name="dest" value="/tmp/walk.sh"/>
</map>
</dp:paraMap>
</dataSink>