Tags
Agent Resynchronization (resync) is an important topic but often misunderstood or misused. In this Q&A styled blog, I discuss how and when it is appropriate to use agent resynchronization.
What is Agent Resynchronization?
Management Agent can be reconfigured using target information present in the Management Repository. Resynchronization pushes all targets and related information from the Management Repository to the Management Agent and then unblocks the Agent.
 Why do agents need to be re-synchronized?
There are two primary reasons why you may need to use agent resynchronization:
1. Agent is blocked
An agent is blocked whenever it is out-of-sync with the repository. This, typically, can happen due to a corrupt targets.xml, missing files and directories, and bugs in the code (they are rare but few do exist 🙂 ) that can leave the plug-in inventories in a strange state. In this condition, the OMS rejects all heartbeat or upload requests from the blocked agent. This means, the blocked agent will not be able to upload any alerts or metric data to the OMS, but it does continue to collect monitoring data. This is useful as once the agent is resynchronized, no monitoring data is lost.
2. Agent is lost and has to be reinstalled
This could be considered to be a special case of agent blocked condition, but it is worth discussing separately. If an agent host or file system is ever lost, the recommended way to reinstall it is by cloning from a reference install. This not only recovers the agent, but avoids having to track and reapply customizations and patches.
Note: It is important to retain the same port when reinstalling the agent.
Agent resync when run on a reinstalled agent, reconfigures it using target information present in the repository. The OMS detects that the agent has been re-installed and blocks it temporarily to prevent the auto-discovered targets in the re-installed agent from overwriting previous customizations.
Note: NEVER, NEVER, combine agent recovery with upgrade! If you lose your agent, recover it first using the original version, and then upgrade it to the new release.
Which interfaces are available for this operation?
There are two interfaces that will allow you to perform agent resync.
1. The Enterprise Manager Console
a. Navigate to Setup->Manage Cloud Control->Agents to view list of all agents
b. Select the desired agent and visit its home page
c. Finally, select the ‘Resynchronization…’ option from the agent menu
2. EMCLI
The agent can also be resynchronized via EMCLI. The command is as follows:
>> emcli resyncAgent
-agent="Agent Host:Port"
How long does it take to resynchronize an agent?
This is a popular question, but unfortunately there is no straight answer for it. The time for resynchronization depends on the amount of data stored in the repository about the agent. When this action is invoked, the OMS does not consult the agent – it just asks agent to delete everything first, and then pushes the known state to it. Majority of the time is spent in pushing the plug-in content. So the more plug-ins deployed to the agent, the longer it takes. Metric Extensions and Configuration Extensions deployed to the agent would also contribute to the time.