Adding tags to Agent config file
Resilio Connect v2.5.2 allows to automatically add newly connected Agents to a certain Group and starting from v2.8.0 it supports fully automatic sorting.
There are three levels to sort the agents:
1. Add all new agents
Every newly connected Agent will be added to the group and all the jobs accordingly. Newly connected Agent is the one with new AgentID, meaning the Agent that has not yet been connected to the MC. Keep in mind parameter "Identify Agent by name" in Console's advances settings. If it's "Yes", Console uses Agent's name instead of AgentID to consider an Agent as new or not, so the Agent with same name as a previously connected one won't get to the group automatically.
This type or auto-sorting allows to manually add or remove agents from the group later.
2. Add new agents that match the rule
Only those of newly connected agents that match the tags' rule* will be added to the group.
This type or auto-sorting allows to manually add or remove agents from the group later.
3. Always update the group according to the rule
This is a fully automatic group. If this option is enabled, all agents - new ones and already connected - will be re-sorted and added or removed from this group if their tags don't contain the value from the rule*.
It's not possible to manually add or remove the agents from this group.
(*) The tag rule means that the Agent's tags meet the filter in group settings. In the example above, agents with location USA, Pusad, Russia will match the rule. The tags can be set in Agent config: first we need to assign tags to Agents in its config and then set rules for sorting. When making the first connection to the Management Console, Agent sends these tags, the sorting rule applies and the Agent ends up in the configured group.
Add necessary tags to sync.conf file, to top level.
{
"tags": {
"NAME1":"value1",
"NAME2":"value2",
"NAME3":"value3"
},
"folders_storage_path": "%DOWNLOADS%",
"management_server": {
"host": "14.200.267.32:8444",
"cert_authority_fingerprint": "3367a4e*****eb19d2cd18f95f59e39",
"bootstrap_token": "I6NRD*****GPZMSWJZNN",
"disable_cert_check": false
}
}
Note
Only uppercase is allowed in tag name.Two predefined tags AGENT_NAME and AGENT_ID must not be used in config.
Important notes:
- If several groups have similar or same sorting rules, and an agent tags match them all, agent will be added to the groups in order of their creation time, until it faces a conflict. Agent won't be added to the first conflicting group. Event about this will appear in Events tab.
- Tags from config are used only when agent connects to MC for the first time ever. It also means that any changes to tags in sync.conf made later, after the Agent has connected to MC, these will be skipped and won't be applied. Use Console's UI to manage tags for already connected agents.
- Only one tag can be used for a sorting rule. Regular expressions are supported which gives certain flexibility.
All tags you use will also appear in Console UI and can be used by other agents.