Skip to content

Upgrade Agent

Run the Upgrade command, which backs up the existing agent before installing the new version.

5 min read Updated SS MR

Upgrade Agent#

In an upgrade, the supervisor takes a backup of the existing agent version, and the new version is installed.

To upgrade the Component Agent manually on the target host instead, see Upgrading Component Agent in the Component Agent Guide.

Note: Ensure to stop the agent via Control Center UI before executing the command.

The upgrade command is similar to the install command.

To upgrade the agent, execute the below command:

./agent-maintenance-tool.sh SupervisorId:<Sup_ID> AgentType:<type> AgentId:<Agent_ID>
UserDetailsId:<user_ID> Command:Upgrade CommandType: MaintenanceCmds CommandTimeout:<time_out>
SupervisorCtrlTTL:<sup_ctrl_ttl> Metadata:"MD5SUM=<checksum>;version=<ver>;ARCH=<arch>;config_file1=<filename>;config_file1_opt1=<<attribute>=<value>>;config_file1_opt2=<<attribute>=<value>>" Args:"JAVA_HOME=<jdk/jre path>"

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:Upgrade CommandType:MaintenanceCmds CommandTimeout:3000 SupervisorCtrlTTL:3000
Metadata:" MD5SUM=3209e5528db9fbf128a7ec6358b400eb;version=5.8.13;" Args:"JAVA_HOME=/usr"

Expected Output:

2020-08-26 06:22:33.217 [main] INFO com.appnomic.healutil.CommandHandler:12 - Sending
Command: Upgrade SupervisorId: 68fae2b8-e7cf-45cb-a141-0bb6ed0b5799 AgentType: LogForwarder
AgentId: f570de02-c585-5c97b35e-LFA-98 CommandJobId: befeaaff-a7f9-4e38-8af1-7e36e04d65a9
to Queue: command-messages queue
2020-08-26 06:22:33.439 [main] INFO com.appnomic.healutil.CommandHandler:14 - Command is sent to queue, response wait time 600s
2020-08-26 06:22:52.782 [main] INFO com.appnomic.healutil.CommandHandler:53 - Response
Command: Upgrade SupervisorId: 68fae2b8-e7cf-45cb-a141-0bb6ed0b5799 AgentType: LogForwarder
AgentId: f570de02-c585-5c97b35e-LFA-98 CommandJobId: befeaaff-a7f9-4e38-8af1-7e36e04d65a9
ExitCode: 0[Success] CommandStartTime: 1598403253658 CommandCompleteTime: 1598403253671
received for Command: Upgrade SupervisorId: 68fae2b8-e7cf-45cb-a141-0bb6ed0b5799 AgentType:
LogForwarder AgentId: f570de02-c585-5c97b35e-LFA-98 CommandJobId: befeaaff-a7f9-4e38-8af1-7e36e04d65a9
2020-08-26 06:22:52.789 [main] INFO com.appnomic.healutil.CommandHandler:126 - Command:
Upgrade of Agent: LogForwarder with AgentId: f570de02-c585-5c97b35e-LFA-98 on target with SupervisorId: 68fae2b8-e7cf-45cb-a141-0bb6ed0b5799 Status: Success Info: Upgrade of LogForwarder 5.8.13 befeaaff-a7f9-4e38-8af1-7e36e04d65a9 Successful

Note: 

  • After the command execution is completed, restart the agent via CC UI.
  • To upgrade an agent that was originally installed without this tool, use the tool to uninstall the existing agent and then, proceed to install the desired version of the agent. After this initial setup, future upgrades can be performed directly using the tool's upgrade command.

Supervisor Self Upgrade#

Execute the command below to achieve supervisor self-upgrade:

./agent-maintenance-tool.sh SupervisorId:<Sup_ID> AgentType:<type> AgentId:<Agent_ID>
UserDetailsId:<user_ID> Command:Upgrade 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>>"
Args:"JAVA_HOME=<jdk/jre path>"

Note: <Agent_ID> can be any dummy value in case of self upgrade of Supervisor.

Windows Platform#

Deploy Supervisor version 2.1.0.7 manually. For further releases of Supervisor, if the existing version of Supervisor in the setup is 2.1.0.7, you can only use the Agents Maintenance Tool to upgrade the Supervisor.

Unix Platform#

Deploy Supervisor version 2.1.0.9 manually. For further releases of Supervisor, if the existing version of Supervisor in the setup is 2.1.0.9, only then you can use the Agents Maintenance Tool to upgrade the Supervisor.

For example:

./agent-maintenance-tool.sh SupervisorId:71a354e3-1d24-4fc9-b288-a6d94c2b8a6d
AgentType:Supervisor AgentId:c570de02-c585-4917-bbb7
UserDetailsId:7640123a-fbde-4fe5-9812-581cd1e3a9c1 Command:Upgrade
CommandType:MaintenanceCmds
Metadata:"version=2.1.0.7;MD5SUM=a9cb2bedc252321da961c79a354a8761"
Args:"JAVA_HOME=C:\Program Files\Java\jre1.8.0_281"

Expected Output:

JAVA_HOME is not set. Trying to use java from PATH
Set JAVA_HOME to use any specific JRE/JDK.
2021-03-10 17:50:31.731 [main] INFO c.a.a.common.util.ConfProperties:44 - successfully
loaded conf.properties file
2021-03-10 17:50:31.735 [main] INFO c.a.a.common.util.ConfProperties:44 - successfully
loaded conf.properties file
2021-03-10 17:50:31.765 [main] INFO com.appnomic.healutil.QueueHandler:113 - Command request queue haproxy.example:5672/tls:enabled, name: command-messages
2021-03-10 17:50:32.461 [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.
2021-03-10 17:50:33.061 [main] INFO com.appnomic.healutil.QueueHandler:149 - Command
response queue haproxy.example:5672/tls:enabled, name: agent-maintenance-response-messages
2021-03-10 17:50:33.146 [main] INFO com.appnomic.healutil.CommandRequest:299 - arg ====> Host:192.0.2.76
2021-03-10 17:50:33.154 [main] WARN com.appnomic.healutil.CommandRequest:368 - Found unknown argument, skipping it. Arg: Host:192.0.2.76, Host: 192.0.2.76
2021-03-10 17:50:33.155 [main] INFO com.appnomic.healutil.CommandRequest:299 - arg ====> SupervisorId:71a354e3-1d24-4fc9-b288-a6d94c2b8a6d
2021-03-10 17:50:33.157 [main] INFO com.appnomic.healutil.CommandRequest:299 - arg ====> AgentId:c570de02-c585-4917-bbb7
2021-03-10 17:50:33.158 [main] INFO com.appnomic.healutil.CommandRequest:299 - arg ====> UserDetailsId:7640123a-fbde-4fe5-9812-581cd1e3a9c1
2021-03-10 17:50:33.158 [main] INFO com.appnomic.healutil.CommandRequest:299 - arg ====> AgentType:Supervisor
2021-03-10 17:50:33.159 [main] INFO com.appnomic.healutil.CommandRequest:299 - arg ====> Command:Upgrade
2021-03-10 17:50:33.160 [main] INFO com.appnomic.healutil.CommandRequest:299 - arg ====> CommandType:MaintenanceCmds
2021-03-10 17:50:33.161 [main] INFO com.appnomic.healutil.CommandRequest:299 - arg ====> Metadata:version=2.1.0.7;MD5SUM=a9cb2bedc252321da961c79a354a8761
2021-03-10 17:50:33.171 [main] INFO com.appnomic.healutil.CommandRequest:299 - arg ====> Args:JAVA_HOME=C:\Program Files\Java\jre1.8.0_281
2021-03-10 17:50:33.175 [main] INFO com.appnomic.healutil.CommandHandler:66 - Sending
Command: Upgrade SupervisorId: 71a354e3-1d24-4fc9-b288-a6d94c2b8a6d AgentType: Supervisor
AgentId: c570de02-c585-4917-bbb7 CommandJobId: 458c6031-97c2-4e99-bce6-17526a9cf366 to
Queue: command-messages queue
2021-03-10 17:50:33.413 [main] INFO com.appnomic.healutil.CommandHandler:69 - Command is sent to queue, response wait time 300s
2021-03-10 17:50:33.414 [main] INFO com.appnomic.healutil.CommandHandler:70 - Waiting for response for 71a354e3-1d24-4fc9-b288-a6d94c2b8a6d agentName:Supervisor command:Upgrade
2021-03-10 17:51:29.172 [main] INFO com.appnomic.healutil.CommandHandler:171 - Response 
Command: Upgrade SupervisorId: 71a354e3-1d24-4fc9-b288-a6d94c2b8a6d AgentType: Supervisor
AgentId: c570de02-c585-4917-bbb7 CommandJobId: 458c6031-97c2-4e99-bce6-17526a9cf366
ExitCode: 0[Success] CommandStartTime: 1615378914213 CommandCompleteTime: 1615378920630
received for Command: Upgrade SupervisorId: 71a354e3-1d24-4fc9-b288-a6d94c2b8a6d AgentType:
Supervisor AgentId: c570de02-c585-4917-bbb7 CommandJobId: 458c6031-97c2-4e99-bce6-17526a9cf366
2021-03-10 17:51:29.176 [main] INFO com.appnomic.healutil.CommandHandler:266 - Command:
Upgrade of Agent: Supervisor with AgentId: c570de02-c585-4917-bbb7 on target with
SupervisorId: 71a354e3-1d24-4fc9-b288-a6d94c2b8a6d Status: Success Info: upgrade of Supervisor Successful

Upgrading Agent on Multiple Hosts#

1. Navigate to the folder below.

<path>/agent-maintenance-tool/config

2. Add or update the IP address of the target host in the IP_list.txt file.
3. Configure the upgrade_config.properties file as follows.

Attribute Description
userDetailsId This is the Keycloak user ID.
Do not modify the value.
Default value is 7640123a-fbde-4fe5-9812-581cd1e3a9c1.
agenttypeid This is the ID of the agent that you need to upgrade.
It can have one of the following values.
1 - Component Agent
3 - Protocol Stack Agent
183 - Log Agent
MD5SUM This is the checksum of the tar file name of the agent.
version This is the version of the agent.
You can get the version from the tar file name of the agent.
CA_CONFIG_URL This is the config data URL of the Component Agent. Update the IP address and port number corresponding to the HAProxy you use.
For example: https://<haproxy-ip>:<haproxy-port>/appsone-controlcenter/v2.0/api/agent-config-data
perconaIP This is the IP address of the host where the Percona database runs.
perconapwd This is the base64-encoded password of the Percona DB Admin user.
Execute the following command to encode the password. echo "****" | base64
JAVA_PATH This is mandatory for the Component Agent.
For example: /usr/java/jre1.8.0_92
CERT_PATH Provide the path of the cacerts file in the HEAL server.
This is a mandatory parameter.
/opt/appnomic/agent-maintenance-tool/output

4. Navigate to the directory below:

<path>/agent-maintenance-tool

5. Execute the following command to upgrade the agent on the Linux platform.

./Upgrade_Wrapper_Root.sh <option>
  • <option> - can be one of the following.
  • ALL - This internally takes backup of the configuration files of the agent, uninstalls the agent, and then installs the agent. It updates the configuration files from the backup.
  • Install - This installs the agent on the target server. This is a fresh installation.
  • Update - This upgrades the agent that you install only using this tool.
  • Uninstall - This uninstalls the existing agent on the target server.

For Example:

./Upgrade_Wrapper_Root.sh ALL

6. Execute the following command to convert the IP_list.txt file to Unix format to upgrade the agent on the Linux platform.

dos2unix IP_list.txt

7. Execute the following command to upgrade the agent on the Windows platform.

./Upgrade_Wrapper_Root_Windows.sh <option>
  • <option> - can be one of the following.
  • ALL - This internally takes backup of the configuration files of the agent, uninstalls the agent, and then installs the agent. It updates the configuration files from the backup.
  • Install - This installs the agent on the target server. This is a fresh installation.
  • Update - This upgrades the agent that you install only using this tool.
  • Uninstall - This uninstalls the existing agent on the target server.

For Example:

./Upgrade_Wrapper_Root_Windows.sh ALL