Agent Configuration
How to remotely fetch and update agent configuration files and self-heal thresholds on the target box using the AMT.
Agent Configuration#
Agent configuration using the AMT enables remotely modifying and updating settings on agents. This tool streamlines the process of configuring agents for optimal performance and compliance.
Fetching Agent Configuration#
You can retrieve the configurations for an agent from the target box. The agent configuration file is retrieved and placed at the location provided in the conf.properties file. In one command execution, you can fetch more than one configuration file. File(s) are placed in the agentname_agentid_configfilename format.
Using the below command, you can fetch config files that an agent supports.
agent-maintenance-tool.sh SupervisorId:<Sup_ID> AgentType:<type> AgentId:<Agent_ID>
UserDetailsId:<user_ID> Command:GetConfig CommandType:MaintenanceCmds
CommandTimeout:<time_out> SupervisorCtrlTTL:<sup_ctrl_ttl> Metadata:"config_file1=<filename1>;config_file2=<filename2>"
After execution of the above command, restart the agent via the Control Center UI.
Updating Agent Configuration#
To update configurations for an agent on the target box, modify the required configuration parameter(s) in the config file. Specify the path to the updated config file in the command.
Multiple config files can be updated for an agent in one command execution. These updated files will replace the earlier ones in the agent's directory on the target server.
./agent-maintenance-tool.sh SupervisorId:<Sup_ID> AgentType:<type> AgentId:<Agent_ID>
UserDetailsId:<user_ID> Command:Config CommandType:MaintenanceCmds
CommandTimeout:<time_out> SupervisorCtrlTTL:<sup_ctrl_ttl> Metadata:"config_file1_path=<file1 path>; config_file1=<filename>;
config_file1_compression=gzip;config_file2_path=<file2 path>;config_file2=<filename> ;config_file2_compression=gzip"
For example:
./agent-maintenance-tool.sh SupervisorId:562dcfdc-9a45-4c2f-94d3-86e444d7d9be
AgentType:ComponentAgent AgentId:e570de02-c585-4917-bbb7-5c97b35e-2_sp
UserDetailsId:7640123a-fbde-4fe5-9812-581cd1e3a9c1 Command:Config
CommandType:MaintenanceCmds CommandTimeout:3000 SupervisorCtrlTTL:3000
Metadata:"config_file1_path=/opt/ComponentAgent_e570de02-c585-4917-bbb7-5c97b35e-2_sp_config/basic.properties;config_file1=config/basic.properties;config_file1_compression=gzip"
Expected Output:
[main] INFO com.appnomic.healutil.CommandHandler:14 - Command is sent to queue, response wait time 300s
2020-09-17 12:24:43.576 [main] INFO com.appnomic.healutil.CommandHandler:60 - Response
Command: Config SupervisorId: 562dcfdc-9a45-4c2f-94d3-86e444d7d9be AgentType:
ComponentAgent AgentId: e570de02-c585-4917-bbb7-5c97b35e-2_sp CommandJobId: d21632a7-a83a-4bac-9c38-a910777834f4 ExitCode: 0[Success] CommandStartTime: 1600325721066
CommandCompleteTime: 1600325721067 received for Command: Config SupervisorId: 562dcfdc-9a45-4c2f-94d3-86e444d7d9be AgentType: ComponentAgent AgentId: e570de02-c585-4917-bbb7-5c97b35e-2_sp CommandJobId: d21632a7-a83a-4bac-9c38-a910777834f4
2020-09-17 12:24:43.578 [main] INFO com.appnomic.healutil.CommandHandler:150 - Command:
Config of Agent: ComponentAgent with AgentId: e570de02-c585-4917-bbb7-5c97b35e-2_sp on target with SupervisorId: 562dcfdc-9a45-4c2f-94d3-86e444d7d9be Status: Success Info: Received empty response data
After execution of the above command, restart the agent via the Control Center UI.
Self-HEAL Configuration#
Self-HEAL Configuration offers a streamlined and efficient method for remotely updating and managing self-healing parameters across various agents. This helps to effortlessly apply configuration changes and adjust thresholds for the agents.
This approach minimizes the need for direct access to target servers.
For what these thresholds control and how selfheal.sh applies them, see Self-Healing in the Component Agent Guide.
Prerequisites#
1. Ensure the supervisor version is the latest.
- v2.1.2.13 for Unix systems
- v3.0.1 for Windows systems.
2. Agents must be installed with a correct directory structure with soft links.
- CA
[root@host01 ComponentAgent]# ll
total 4
lrwxrwxrwx. 1 healadmin 89 Feb 16 18:13
203.0.113.7_ca_18300785ced6b3392b5ecea45f4fffaa_Physical -> /opt/heal/AgentInstaller/Agent/ComponentAgent/ComponentAgent-1.3.0-1/ComponentAgent_1.3.0
drwxr-xr-x. 3 healadmin 34 Mar 7 15:33 ComponentAgent-1.3.0-1
-rw-r--r--. 1 healadmin 286 Mar 6 12:47 test.sh
[root@host01 ComponentAgent]#
[root@host01 ComponentAgent]# pwd
/opt/heal/AgentInstaller/Agent/ComponentAgent
- LFA
[root@host01 LogForwarder]# pwd
/opt/heal/AgentInstaller/Agent/LogForwarder
[root@host01 LogForwarder]#
[root@host01 LogForwarder]# ll
total 0
lrwxrwxrwx. 1 healadmin 85 Feb 13 16:34
203.0.113.7_lfa_18300785ced6b3392b5ecea45f4fffaa_Physical -> /opt/heal/AgentInstaller/Agent/LogForwarder/LogForwarder-5.8.28-1/LogForwarder-5.8.28
drwxr-xr-x. 3 healadmin 33 Feb 13 16:34 LogForwarder-5.8.28-1
Procedure#
Use AMT (Agent Maintenance Tool) for updating the agents' self-heal configurations on target servers.
Execute the following commands via AMT:
1. Update configurations:
sh agent-maintenance-tool.sh SupervisorId:<supervisor-identifier> AgentId:<physical-agent-identifier> UserDetailsId:7640123a-fbde-4fe5-9812-581cd1e3a9c1 AgentType:Supervisor
CommandType:ForensicCmds Command:scripts/ConfigureSelfheal Args:"agent_path=<agents-base-path>;component_name=<agent-type>;HOST_MEM_THRESHOLD=<value>;HOST_CPU_THRESHOLD=<value>"
Metadata:OutputQueue=agent-maintenance-response-messages
Note: The component_name attribute must have values from following:
- CA (Component Agent)
- LFA (LogForwarder Agent)
- LSA (LogScan Agent)
For example:
1. When the supervisor running on a Unix server,
- CA
sh agent-maintenance-tool.sh
SupervisorId:203.0.113.7_sup_18300785ced6b3392b5ecea45f4fffaa
AgentId:203.0.113.7_ca_18300785ced6b3392b5ecea45f4fffaa_Physical UserDetailsId:7640123a-fbde-4fe5-9812-581cd1e3a9c1 AgentType:Supervisor CommandType:ForensicCmds
Command:scripts/ConfigureSelfheal
Args:"agent_path=/opt/heal/AgentInstaller/Agent;component_name=CA;HOST_MEM_THRESHOLD=70;HOST_CPU_THRESHOLD=80;PROC_MEM_THRESHOLD=70;PROC_CPU_THRESHOLD=80;Load_Average_Threshold=95;
Disk_Space_Threshold=/opt,90;Process_Count_Threshold=300;Process_Pattern=all"
Metadata:OutputQueue=agent-maintenance-response-messages
- LFA
sh agent-maintenance-tool.sh
SupervisorId:203.0.113.7_sup_18300785ced6b3392b5ecea45f4fffaa
AgentId:203.0.113.7_lf_18300785ced6b3392b5ecea45f123456_Physical UserDetailsId:7640123a-fbde-4fe5-9812-581cd1e3a9c1 AgentType:Supervisor CommandType:ForensicCmds
Command:scripts/ConfigureSelfheal
Args:"agent_path=/opt/heal/AgentInstaller/Agent;component_name=LFA;HOST_MEM_THRESHOLD=70;HOST_CPU_THRESHOLD=80;PROC_MEM_THRESHOLD=70;PROC_CPU_THRESHOLD=80;Load_Average_Threshold=95;
Disk_Space_Threshold=/opt,90;Process_Count_Threshold=300;Process_Pattern=all"
Metadata:OutputQueue=agent-maintenance-response-messages
- LSA
sh agent-maintenance-tool.sh
SupervisorId:203.0.113.7_sup_18300785ced6b3392b5ecea45f4fffaa
AgentId:203.0.113.7_lsa_18300785ced6b3392b5eceaabcdeffaa_Physical
UserDetailsId:7640123a-fbde-4fe5-9812-581cd1e3a9c1 AgentType:Supervisor
CommandType:ForensicCmds Command:scripts/ConfigureSelfheal
Args:"agent_path=/opt/heal/AgentInstaller/Agent;component_name=LSA;HOST_MEM_THRESHOLD=70;HOST_CPU_THRESHOLD=80;PROC_MEM_THRESHOLD=70;PROC_CPU_THRESHOLD=80;Load_Average_Threshold=95;
Disk_Space_Threshold=/opt,90;Process_Count_Threshold=300;Process_Pattern=all"
Metadata:OutputQueue=agent-maintenance-response-messages
Expected Output:
- CA
JAVA_HOME is not set. Trying to use java from PATH
Set JAVA_HOME to use any specific JRE/JDK.
2024-03-07 15:46:25.471 [main] INFO c.a.a.common.util.ConfProperties:44 - successfully loaded conf.properties file
2024-03-07 15:46:25.475 [main] INFO c.a.a.common.util.ConfProperties:44 - successfully loaded conf.properties file
2024-03-07 15:46:25.482 [main] INFO com.appnomic.healutil.CommandRequest:299 - arg ====> SupervisorId:203.0.113.7_sup_18300785ced6b3392b5ecea45f4fffaa
2024-03-07 15:46:25.489 [main] INFO com.appnomic.healutil.CommandRequest:299 - arg ====> AgentId:203.0.113.7_ca_18300785ced6b3392b5ecea45f4fffaa_Physical
2024-03-07 15:46:25.490 [main] INFO com.appnomic.healutil.CommandRequest:299 - arg ====> UserDetailsId:7640123a-fbde-4fe5-9812-581cd1e3a9c1
2024-03-07 15:46:25.490 [main] INFO com.appnomic.healutil.CommandRequest:299 - arg ====> AgentType:Supervisor
2024-03-07 15:46:25.491 [main] INFO com.appnomic.healutil.CommandRequest:299 - arg ====> CommandType:ForensicCmds
2024-03-07 15:46:25.491 [main] INFO com.appnomic.healutil.CommandRequest:299 - arg ====> Command:scripts/ConfigureSelfheal
2024-03-07 15:46:25.491 [main] INFO com.appnomic.healutil.CommandRequest:299 - arg ====> Args:agent_path=/opt/heal/AgentInstaller/Agent;component_name=CA;HOST_MEM_THRESHOLD=70;HOST
_CPU_THRESHOLD=80;PROC_MEM_THRESHOLD=70;PROC_CPU_THRESHOLD=80;Load_Average_Threshold=95;Disk_Space_Threshold=/opt,90;Process_Count_Threshold=300;Process_Pattern=all
2024-03-07 15:46:25.492 [main] INFO com.appnomic.healutil.CommandRequest:299 - arg ====> Metadata:OutputQueue=agent-maintenance-response-messages
2024-03-07 15:46:25.522 [main] INFO com.appnomic.healutil.QueueHandler:109 - Command request queue 192.0.2.75:5671/tls:enabled, name: command-messages
2024-03-07 15:46:25.679 [main] WARN c.r.c.TrustEverythingTrustManager:33 - SECURITY ALERT:this trust manager trusts every certificate, effectively disabling peer verification. This
is convenient for local development but offers no protection against man-in-the-middle attacks. Please see https://www.rabbitmq.com/ssl.html to learn more about peer certificate verification.
2024-03-07 15:46:26.341 [main] INFO com.appnomic.healutil.QueueHandler:146 - Command response queue 192.0.2.75:5671/tls:enabled, name: agent-maintenance-response-messages
2024-03-07 15:46:26.440 [main] INFO com.appnomic.healutil.CommandHandler:121 - Sending
Command: scripts/ConfigureSelfheal SupervisorId:
203.0.113.7_sup_18300785ced6b3392b5ecea45f4fffaa AgentType: Supervisor AgentId:
203.0.113.7_ca_18300785ced6b3392b5ecea45f4fffaa_Physical CommandJobId: 2c1c4d34-851e-4278-98b8-5a83598a3f7e to Queue: command-messages queue
2024-03-07 15:46:26.677 [main] INFO com.appnomic.healutil.CommandHandler:123 - Command is sent to queue, response wait time 300s
2024-03-07 15:46:28.089 [main] INFO com.appnomic.healutil.CommandHandler:171 - Response Command: scripts/ConfigureSelfheal SupervisorId:
203.0.113.7_sup_18300785ced6b3392b5ecea45f4fffaa AgentType: Supervisor AgentId: 203.0.113.7_ca_18300785ced6b3392b5ecea45f4fffaa_Physical CommandJobId: 2c1c4d34-851e-
4278-98b8-5a83598a3f7e ExitCode: 0[Success] CommandStartTime: 1709806587429
CommandCompleteTime: 1709806588204 received for Command: scripts/ConfigureSelfheal
SupervisorId: 203.0.113.7_sup_18300785ced6b3392b5ecea45f4fffaa AgentType: Supervisor
AgentId: 203.0.113.7_ca_18300785ced6b3392b5ecea45f4fffaa_Physical CommandJobId:2c1c4d34-851e-4278-98b8-5a83598a3f7e
2024-03-07 15:46:28.094 [main] INFO com.appnomic.healutil.CommandHandler:252 - Command:
scripts/ConfigureSelfheal SupervisorId: 203.0.113.7_sup_18300785ced6b3392b5ecea45f4fffaa
AgentType: Supervisor AgentId: 203.0.113.7_ca_18300785ced6b3392b5ecea45f4fffaa_Physical
CommandJobId: 2c1c4d34-851e-4278-98b8-5a83598a3f7e succeeded with [2024-03-07 15:46:28]
[INFO ] Updated values in /opt/heal/AgentInstaller/Agent/ComponentAgent/ComponentAgent-
1.3.0-1/ComponentAgent_1.3.0/selfheal/selfhealconfig from /opt/heal/AgentInstaller/Agent/Supervisor/supervisor/.selfhealconfigure
[2024-03-07 15:46:28] [INFO ] Updated values in /opt/heal/AgentInstaller/Agent/ComponentAgent/ComponentAgent-1.3.0-
1/ComponentAgent_1.3.0/selfheal/external_command/externalconfig from /opt/heal/AgentInstaller/Agent/Supervisor/supervisor/.selfhealconfigure
2. When the supervisor is running on a Windows server.
For example:
- CA
sh agent-maintenance-tool.sh
SupervisorId:203.0.113.7_sup_18300785ced6b3392b5ecea45f4fffaa
AgentId:203.0.113.7_ca_18300785ced6b3392b5ecea45f4fffaa_Physical UserDetailsId:7640123a-fbde-4fe5-9812-581cd1e3a9c1 AgentType:Supervisor CommandType:ForensicCmds
Command:scripts/ConfigureSelfheal
Args:"agent_path=/opt/heal/AgentInstaller/Agent;component_name=CA;hostMemLimit=70;hostCpuLimit=80;procMemLimit=70;procCpuLimit=80" Metadata:OutputQueue=agent-maintenance-response-messages
Expected Output: Supervisor Logs
- ShellCommandRunner.log:
../Supervisor/supervisor/logs/ShellCommandRunner.log <==
[15:46:27:429470] [info] [002056] Primary Signature check Success for file
/opt/heal/AgentInstaller/Agent/Supervisor/supervisor//scripts/ConfigureSelfheal.sh
[15:46:27:429569] [info] [002056] Starting <CommandJobId: 2c1c4d34-851e-4278-98b8-5a83598a3f7e>
[15:46:28:204335] [info] [002056] Exited <CommandJobId: 2c1c4d34-851e-4278-98b8-5a83598a3f7e> <Exit status: 0>
- ResultSender.log:
../Supervisor/supervisor/logs/ResultSender.log <==
[15:46:28:228304] [trace] [002064] outputJson:
{"supervisorIdentifier":"203.0.113.7_sup_18300785ced6b3392b5ecea45f4fffaa","agentIdentifier":"203.0.113.7_ca_18300785ced6b3392b5ecea45f4fffaa_Physical","agentType":"Supervisor",
"triggerSource":"AgentMaintenanceTool","commandJobID":"2c1c4d34-851e-4278-98b8-5a83598a3f7e","commandType":"ForensicCmds","command":"scripts/ConfigureSelfheal","cmdOut":"
H4sIAAAAAAAA/82PywrCMBRE937F/YE06cMH3YkgdKOguCqlhPa2BvIiSYufryhUFMGV4O7MWcwwZcKSjLCUsCXE8zxb5MmqgrLYbfdQwcm2PGALI5cDehAaqLGBHvgo6LpHHQrtA5cS3SPSjVHW6Bt9iiSO0oiR+E3Xd009yu6MXE7QGN2JHjpn1LfZ42DRjcIbR/0To9emweGs/L+7eAnoNJd1Y5Tiup3EL/5fAYzAJinvAQAA","stdErr":"","exitCode":0,"commandStartTime":1709806587429,"commandEndTime":1709806588204,"metaData":
{"Disk_Space_Threshold":"/opt,90","HOST_CPU_THRESHOLD":"80","HOST_MEM_THRESHOLD":"70","Load_Average_Threshold":"95","OutputQueue":"agent-maintenance-response-messages","PROC_CPU_THRESHOLD":"80","PROC_MEM_THRESHOLD":"70","Process_Count_Threshold":"300","Process_Pattern":"all","agent_path":"/opt/heal/AgentInstaller/Agent","component_name":"CA"}}
[15:46:28:242246] [info] [002064] Result sent for command 2c1c4d34-851e-4278-98b8-5a83598a3f7e
[15:46:28:242259] [trace] [002064] Response: {"MESSAGE":"Command response successfully processed.","STATUS_CODE":200}
- Supervisor.log:
../Supervisor/supervisor/logs/Supervisor.log <==
[15:46:27:424513] [info] [002065] Command received for Supervisor, commandJobId: 2c1c4d34-851e-4278-98b8-5a83598a3f7e
[15:46:28:227698] [info] [002064] Sending result for command 2c1c4d34-851e-4278-98b8-5a83598a3f7eHttpsClient.log
- Logs from the HttpsClient:
[15:46:27:424177] [info] [002065] CommandChannel: Request sent. GET https://haproxy-node1.example:9998/command
[15:46:28:228268] [info] [002064] DataChannel00: Request sent. POST https://haproxy-node1.example:9998/result
- TaskReceiver.log:
../Supervisor/supervisor/logs/TaskReceiver.log <==
[15:46:27:424233] [trace] [002065]
{"supervisorIdentifier":"203.0.113.7_sup_18300785ced6b3392b5ecea45f4fffaa","agentIdentifier":"203.0.113.7_ca_18300785ced6b3392b5ecea45f4fffaa_Physical","commandJobID":"2c1c4d34
-851e-4278-98b8-5a83598a3f7e","commandType":"ForensicCmds","commandOutputType":"Blob","commandExecType":"Execute","triggerSource":"AgentMaintenanceTool","userDetailsId":"7640123a-fbde-4fe5-9812-581cd1e3a9c1","retryNumber":3,"triggerTime":1709806586661,"supervisorCtrlTTL":300000,"commandTimeout":300000,"violationTime":1709806586661,"metaData":
{"Process_Count_Threshold":"300","OutputQueue":"agent-maintenance-response-messages","HOST_MEM_THRESHOLD":"70","PROC_MEM_THRESHOLD":"70","component_name":"CA","Load_A
verage_Threshold":"95","Disk_Space_Threshold":"/opt,90","PROC_CPU_THRESHOLD":"80","agent_path":"/opt/heal/AgentInstaller/Agent","HOST_CPU_THRESHOLD":"80","Process_Pattern":"all"},"command":"scripts/ConfigureSelfheal","agentType":"Supervisor","arguments":{"Process_Count_Threshold":"300","HOST_MEM_THRESHOLD":"70","PROC_MEM_THRESHOLD":"70","component_name":"CA","Load_Average_Threshold":"95","Disk_Space_Threshold":"/opt,90","PROC_CPU_THRESHOLD":"80","agent_path":"/opt/heal/AgentInstaller/Agent","HOST_CPU_THRESHOLD":"80","Process_Pattern":"all"},"envArgs":{}}
Agent Version Details#
Current Agent Version#
To know the version of the installed agent, execute the below command:
./agent-maintenance-tool.sh SupervisorId:<Sup_ID> AgentType:<type> AgentId:<Agent_ID>
UserDetailsId:<user_ID> Command:GetVersion CommandType:MaintenanceCmds
CommandTimeout:<time_out> SupervisorCtrlTTL:<sup_ctrl_ttl>
Note: To get the agent's version using this tool, ensure that the agent has been installed with this tool initially.
For example:
./agent-maintenance-tool.sh SupervisorId:68fae2b8-e7cf-45cb-a141-0bb6ed0b5799
AgentType:ComponentAgent AgentId:e570de02-c585-4917-bbb7-5c97b35e-2-physical
UserDetailsId:7640123a-fbde-4fe5-9812-581cd1e3a9c1 Command:GetVersion
CommandType:MaintenanceCmds CommandTimeout:3000 SupervisorCtrlTTL:3000
Expected Output:
2021-05-13 17:25:26.001 [main] INFO com.appnomic.healutil.CommandHandler:171 - Response
Command: GetAllVersions SupervisorId: 16a46977-dfe5-4b66-ad07-f340cec9981a AgentType:
ComponentAgent AgentId: e570de02-c585-4917-bbb7-5c97b35e-1-physical CommandJobId: 53692ba8-
e5b4-4f7e-90a0-d2ce71b22e67 ExitCode: 0[Success] CommandStartTime: 1620906858816
CommandCompleteTime: 1620906858816 received for Command: GetAllVersions SupervisorId:
16a46977-dfe5-4b66-ad07-f340cec9981a AgentType: ComponentAgent AgentId: e570de02-c585-4917-
bbb7-5c97b35e-1-physical CommandJobId: 53692ba8-e5b4-4f7e-90a0-d2ce71b22e67
2021-05-13 17:25:26.006 [main] INFO com.appnomic.healutil.CommandHandler:353 - Command:
GetAllVersions of Agent: ComponentAgent with AgentId: e570de02-c585-4917-bbb7-5c97b35e-1-
physical on target with SupervisorId: 16a46977-dfe5-4b66-ad07-f340cec9981a Status: Success
Info: ComponentAgent_5.8.20#@#@#APPSONE_NEWLINE#@#@#
Retrieve Versions#
Consider a situation where the agent is upgraded from version 4.5.1 to 5.5.1 to 6.5.1. To retrieve all the versions (folder names) for an agent, follow the below steps:
1. Navigate to the below folder.
cd <agent_name>/<agent_id>
2. Execute the below command to get all the versions.
./agent-maintenance-tool.sh SupervisorId:<Sup_ID> AgentType:<type> AgentId:<Agent_ID>
UserDetailsId:<user_ID> Command:GetAllVersions CommandType:MaintenanceCmds CommandTimeout:<time_out> SupervisorCtrlTTL:<sup_ctrl_ttl>
For example:
./agent-maintenance-tool.sh SupervisorId:68fae2b8-e7cf-45cb-a141-0bb6ed0b5799 AgentType:LogForwarder AgentId:f570de02-c585-5c97b35e-LFA-98 UserDetailsId:7640123a-fbde-4fe5-9812-581cd1e3a9c1
Command:GetAllVersions CommandType:MaintenanceCmds CommandTimeout:3000
SupervisorCtrlTTL:3000
Expected Output:
2020-08-26 06:32:23.687 [main] INFO com.appnomic.healutil.CommandHandler:12 - Sending
Command: GetAllVersions SupervisorId: 68fae2b8-e7cf-45cb-a141-0bb6ed0b5799 AgentType:
LogForwarder AgentId: f570de02-c585-5c97b35e-LFA-98 CommandJobId: 34169a5a-26eb-433b-9d94-fbb6cd5772b5 to Queue: command-messages queue
2020-08-26 06:32:23.865 [main] INFO com.appnomic.healutil.CommandHandler:14 - Command is sent to queue, response wait time 600s
2020-08-26 06:32:47.913 [main] INFO com.appnomic.healutil.CommandHandler:53 - Response
Command: GetAllVersions SupervisorId: 68fae2b8-e7cf-45cb-a141-0bb6ed0b5799 AgentType:
LogForwarder AgentId: f570de02-c585-5c97b35e-LFA-98 CommandJobId: 34169a5a-26eb-433b-9d94-fbb6cd5772b5 ExitCode: 0[Success] CommandStartTime: 1598403848668 CommandCompleteTime:
1598403848668 received for Command: GetAllVersions SupervisorId: 68fae2b8-e7cf-45cb-a141-0bb6ed0b5799 AgentType: LogForwarder AgentId: f570de02-c585-5c97b35e-LFA-98 CommandJobId:
34169a5a-26eb-433b-9d94-fbb6cd5772b5
2020-08-26 06:32:47.919 [main] INFO com.appnomic.healutil.CommandHandler:181 - Command:
GetAllVersions of Agent: LogForwarder with AgentId: f570de02-c585-5c97b35e-LFA-98 on target
with SupervisorId: 68fae2b8-e7cf-45cb-a141-0bb6ed0b5799 Status: Success Info:
LogForwarder_Linux_7.4_x86_64_64_5.8.13#@#@#APPSONE_NEWLINE#@#@#
Retrieving Versions for All the Installed Agents#
To retrieve all versions of the installed agents at once, access the directory provided below.
<agent_name>/<agent_id>
Note: This command is applicable only for Unix platform.
Prerequisite: Install VersionUtil agent.
./agent-maintenance-tool.sh SupervisorId:<Sup_ID> AgentType:VersionUtil AgentId:<Agent_ID>
UserDetailsId:<user_ID> Command:Install CommandType:MaintenanceCmds CommandTimeout:
<time_out> SupervisorCtrlTTL:<sup_ctrl_ttl> Metadata:"OS=<os>;OSVER=<ver>;
BIT=<bit>;MD5SUM=<checksum>;version=<ver>;ARCH=<arch>;config_file1=<filename>;config_file1_opt1=<<attribute>=<value>>;config_file1_opt2=<<attribute>=<value>>"
For Example:
./agent-maintenance-tool.sh SupervisorId:914693ae-4474-4ee9-ae3c-4c6c8c532154
AgentId:e570de02-c585-4917-bbb7-5c97b35e-54-version UserDetailsId:7640123a-fbde-4fe5-9812-581cd1e3a9c1 Command:Install AgentType:VersionUtil
Metadata:"version=1.2.0.1;MD5SUM=5d3fdab84b0078fd961c61cf95c633f2"
The format to get versions of all agents' commands is as follows:
./agent-maintenance-tool.sh SupervisorId:<Sup_ID> AgentType:VersionUtil AgentId:<Agent_ID>
UserDetailsId:<user_ID> Command:fetchVersion CommandType:ForensicCmds CommandTimeout:
<time_out> SupervisorCtrlTTL:<sup_ctrl_ttl> Metadata:"OutputQueue=agent-maintenance-response-messages" Args:"BASEDIR=<base_dir of agent>;AGENTID_CA=<Id of Component agent>;AGENTID_LF=<Id of Log agent>"
For example:
./agent-maintenance-tool.sh SupervisorId:914693ae-4474-4ee9-ae3c-4c6c8c532154
AgentId:e570de02-c585-4917-bbb7-5c97b35e-54-version UserDetailsId:7640123a-fbde-4fe5-9812-581cd1e3a9c1 CommandType:ForensicCmds Command:fetchVersion AgentType:VersionUtil
Metadata:"OutputQueue=agent-maintenance-response-messages"
Args:"BASEDIR=/home/appnomic/Agents;AGENTID_CA=e570de02-c585-4917-bbb7-5c97b35e-5-physical;AGENTID_LF=e570de02-c585-4917-bbb7-5c97b35e-54"
Expected Output:
@@@@@SEPERATOR@@@@@
ComponentAgent
Version : ComponentAgent-5.8.14
Build Date : 2020-11-01 17:42
@@@@@SEPERATOR@@@@@
LogForwarder
Version : LogForwarder_5.8.15
Build Date : 2020-11-01 18:23
@@@@@SEPERATOR@@@@@
Supervisor version: 1.1.0.6
Build Time: Oct 23 2020 13:40:14
@@@@@SEPERATOR@@@@@
PSAgent
Version: 7.4.3.0
Build Date: 2018-11-28 19:53:28
Executing Multiple Commands#
You can execute a single command or multiple commands using this tool.
If you need to execute multiple commands, create a .sh file in the following format.
HostIP, supervisorID, agentId, userDetailId, agentType, command, commandType, metadata, Args, commandTimeout
All the above parameters except 'metadata' and 'Args' are mandatory.
The default value of the 'commandTimeout' parameter is 3000 seconds.
For example:
#HostIP,supervisorID,agentId,userDetailId,agentType,command,commandType,metadata,Args,commandTimeout
192.0.2.119,2cce6952-c5ad-4460-989e-0bec0a66f581,e570de02-c585-4917-bbb7-5c97b35e-5-physical,7640123a-fbde-4fe5-9812-581cd1e3a9c1,ComponentAgent,Install,MaintenanceCmds,version=5.8.15;MD5SUM=efcb0c1d59936701b620b6bd1e116cb3;config_file1=config/basic.properties;config_file1_opt1=@@@CA_UNIQUE_ID@@@=e570de02-c585-4917-bbb7-5c97b35e-5;config_file1_opt2=@@@CA_CONFIG_URL@@@=https://haproxy.example:9998/appsone-controlcenter/v2.0/api/config-data,JAVA_HOME=C:/Program Files/Java/zulu
192.0.2.124,d1c284c3-73ae-4476-98e6-d385272ac621,e570de02-c585-4917-bbb7-5c97b35e-54,7640123a-fbde-4fe5-9812-581cd1e3a9c1,LogForwarder,Uninstall,MaintenanceCmds,version=5.8.16;MD5SUM=a4a26770292c4d32879580fd2e58ea8f
If you don’t provide a value for any parameter before the 'commandTimeout' parameter, provide a separator (‘,’) between the values.
Don't leave any empty space between commas.
For example:
<HostIP>,<supervisorID>,<agentId>,<userDetailId>,<agentType>,<command>,<commandType>,,,
<commandTimeout>
The tool reads the input file and executes commands from the same.
Execute the following command to execute multiple commands using the tool.
agent-maintenance-tool.sh -file <filename> - <path of input file name>/<input file name>
'-file' is to differentiate between single command and multiple command execution. This indicates the tool needs to read the commands from the input file.
Default available template file: multicommandtemplate.sh
To generate this file automatically from the agent topology in the database, rather than writing the rows by hand, see Generating the Multi-Command File.
The commands will be sent to the command-messages queue, from which the supervisor controller consumes the data. Then, the respective supervisor retrieves the commands through a GET request from the target server to the supervisor controller.