Agent Maintenance Tool: Command Structure
Case-sensitive attributes such as SupervisorId and AgentType that make up AMT commands, and the response codes a command returns.
Command Structure#
The following attributes are part of the Agent Maintenance Tool command structure.
Note: These attributes are case-sensitive.
| Attribute | Description |
|---|---|
SupervisorId | Unique ID or identifier of the supervisor on the target box. Execute the following query to fetch the value of this attribute: select supervisor_type_id from supervisor_details;This is a mandatory attribute. |
AgentType | Name of the agent. The tool supports the following agents: ForensicAgent, PSAgent, ComponentAgent, LogForwarder, JIMAgent, VersionUtil, Supervisor, LogScanAgent. Using this tool, only the download of the Java agent is supported. Execute the following query to fetch the value of this attribute: select name from view_types where typeid =1 and subtypeid not in (4,5,218);This is a mandatory attribute. |
AgentId | Unique ID or Identifier of the agent. Execute the following query to fetch the value of this attribute: select physical_agent_id from agent;This is a mandatory attribute. |
UserDetailsId | Unique ID or Identifier of the user triggering the command. Execute following query to fetch value of this attribute: select user_details_id from agent; This is a mandatory attribute. |
Command | It can be one of the following – Install, Upgrade, Uninstall, GetVersion, GetAllVersions, Config, GetConfig, fetchVersion, PushFile, FetchFile, RenameFile. This is a mandatory attribute. |
CommandType | The default value of this attribute is MaintenanceCmds. You can also specify ForensicCmds if you need to execute any script (.sh / .bat file). This script should be available in the directory of the installed agent. This is a mandatory attribute. |
CommandTimeout | This is the maximum time in which the supervisor should finish the command execution. It is in milliseconds. It can be a minimum of 5 seconds and a maximum of 1 hour. This is an optional attribute. |
SupervisorCtrlTTL | This time interval is in milliseconds. Whenever Supervisor Controller receives a command from RMQ, the controller waits for the duration mentioned in this attribute for Supervisor to be up. If the supervisor doesn't communicate with the controller in this duration, the command fails. This is an optional attribute. |
Metadata | |
OS | OS of the target server. It can be Linux, Windows, Solaris, AIX, or HP-UX. This attribute is mandatory for install and upgrade commands. |
OSVER | Version of the OS on the target box. This attribute is mandatory for install and upgrade commands. |
BIT | It can be 32-bit or 64-bit. This attribute is mandatory for install and upgrade commands. |
MD5SUM | Checksum of the agent package. Get the checksum using the md5sum command.md5sum <agent package>This attribute is mandatory for install and upgrade commands. |
Version | Version of the agent. The agent package contains the version number. This attribute is mandatory for install and upgrade commands. |
ARCH | Architecture of the target box. This attribute is mandatory for install and upgrade commands. |
config_file1… config_filen | Agent configuration file name. It can be one or more depending on the agent. This attribute is mandatory for config, GetConfig, PushFile, and FetchFile commands. You need to pass at least one config file as an argument for these commands. Maximum recommended files are 10 for these commands. |
config_file1_opt1… config_file1_optn | Configuration parameters in the agent configuration file. This is an optional parameter. The install and upgrade commands use this parameter. |
rename_file1… rename_filen | This parameter is mandatory for the RenameFile command. |
OutputQueue | This is applicable only for CommandType ForensicCmds. This is mandatory for CommandType ForensicCmds. The value of this attribute should be agent-maintenance-response-messages. |
Args | This is an optional parameter. This attribute is applicable for log agents and component agents for install and upgrade commands. The BASEDIR, AGENTID_CA, and AGENTID_LF arguments are mandatory for the ForensicCmds CommandType and fetchVersion command. JAVA_HOME is mandatory for install and upgrade commands. |
For Information: Send these command attributes as arguments to agent-maintenance-tool.sh (RHEL) and agent-maintenance-tool.bat to (Windows).
The output of each command executed gets printed on the console and in the log file at the below directory:
<install_path>/log
Note: Values for OS, OSVER, BIT, Version, and ARCH attributes in agent package file name and in tool commands need to be the same.
Sending Commands using Tool#
To send a single command, run the tool with the attributes above, as shown in Install Agent, Agent Configuration, Upgrade Agent, Agent Maintenance Tool: Agent File and Uninstall Agent. To send several commands in one run, list them in an input file and run the tool with -file, as described in Executing Multiple Commands.
Note: This tool doesn't support Forensic Agent on Windows OS.
Command Response Codes#
Supervisor-related codes are as follows:
0: Success
1: Script not found
2: Script execution timed out
3: Script sign verification failed
4: Exception information while executing the script
5: Invalid input to supervisor controller – either command or result
6: Duplicate Installation
7: md5sum mismatch
8: Symbolic link failure
9: Directories create/delete failure
10: Agent doesn't exist
11: Invalid Command Type
12: Failed to configure
13: Failed to self-upgrade
14: prerequisite check failed during agent installation
15-30 : Reserved for future
30: Downloading of package failed
31: Unknown error
32: Unsupported platform
33: The "FORENSIC_LIB_FOLDER" variable not set for forensic lib file path
34: Forensic lib file not found
35: Failed to stop agent
36: Failed to Start agent
If there is an issue with the command format or any argument, the tool returns one of the following codes:
E5001: Invalid number of arguments passed to the script.
E5002: Invalid data received at an argument.
E5003: Command not found.
E5004: Error at library dependency during ldd check.
E5005: Not enough permission for execution.
E5006: Unable to create file in the directory.
E5007: Failed to delete a file.
Forensic Agent Error Codes also lists E5001 to E5007, worded for the Forensic Agent scripts, together with the other codes those scripts return.