How to copy configuration files between Discovery Tool and Discovery Agents
Platform Notice: Cloud, Server, and Data Center - This article applies equally to all platforms.
Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.
*Except Fisheye and Crucible
Purpose
Some organizations have a requirement to deploy Discovery Agents in many hosts such as laptops and they need to distribute Agent configuration files over the network. The requirement could be a time-consuming process if you have to copy each file in each of the Agent hosts.
This article provides guidelines on how to:
- Use the Asset Discovery tool to copy configuration files between Discovery Agent hosts.
Solution
In the Discovery tool, under the Agent tab, there is an option called "Patterns transfer". Here you can configure files that will be synchronized with all available Agents at the configured range.
On Discovery Tool versions below 7.x, this option is available under the Scan Settings tab as "Agent File-Transfer List".
In this article, as an example, we are going to transfer a pattern file from discovery_host/pattern/myCustomPattern.pat to agent_host/pattern/myCustomPattern.pat. This will also work if you made changes to your "source" files and would like to share these files to other available Agents.
You also can synchronize the Agent configuration file (Agents.cfg) or any other file such as ObjectHashSettings.xml, by copying them to your main Discovery folder and choosing it for synchronizing.
Agent settings in Discovery Tool v7.x | Agent settings in Discovery Tool versions below 7.x |
---|
Step-by-step guide
Navigate to your Assets Discovery directory and type discovery.exe -s in your terminal or command-line interpreter.
Enter your password. If this is the first time you have used Asset Discovery you will be asked to enter and confirm a new password. This password must contain at least 8 characters including at least one uppercase, one lowercase, one numeric and one non-alphanumeric (symbol) character.
Select the Agent tab.
Agent Scan Interval - The interval, in minutes, Discovery service (Discovery tool needs to be installed as a Service) checks with the Discovery Agents for new data available.
Agent IP Range - Here you can define the Discovery Agents IP Range(s) that will be checked. You can define multiple Ranges.
When you define an Agent IP range, Discovery goes through it every 'Agent Scan Interval' minutes and tries to get data from the Agents. If an Agent has new data, it will perform an SSL handshake to encrypt data for this communication.Agent TCP Port - The TCP Port of the available Agents in the configured IP Range.
Discovery tool uses the outgoing TCP port 51337
Discovery-Agent TCP port 51337 as inbound.
Agent Timeout(s) - The default timeout for each connection to a remote agent. The default period is 3 seconds
Agent Token - Add a secure token in this field or generate a token to be used for all agents and save it.
Patterns transfer - Select to configure files that will be synchronised with all available agents at the configured range.
The files you want to transfer need to be stored within the Discovery tool directory. Below are the screenshots from Discovery Tool v7.0.1 and 3.1.4.
The above example, Windows_custom.pat file will be copied to \Discovery Agent Installer\pattern Agent directory (IP address 10.227.16.137) based on the "Agent Scan Interval" field. In this case, after 2 minutes as long as the Discovery tool is installed as a Service.
- If Discovery is not enabled as a service, you can manually trigger the transfer following the steps below. To install Discovery as a service, the option is available under the Service tab.
As an administrator on your Windows or Linux system, open a command-line interpreter window.
Navigate to your Asset Discovery directory and type discovery -stad in your terminal or command-line interpreter.
- You can display all the available commands with "Discovery -?". For more information, Set up Assets Discovery
To synchronize the Agent configuration file (Agents.cfg) across all the Agent hosts in Discovery 7.x, a specific modification is required.
The initial step involves setting up the agent token.
- Within the agent.cfg file intended for duplication, the <SaveTimeStamp> value must be modified by adding a future date. For instance, advancing it by one day. Failure to do so will result in the copied agent.cfg file being overwritten with the previous version shortly after.
Notes
- Patterns transfer only works on a relative path.
- Source files need to be within the Discovery tool installation directory.
- Files then will be copied to the Discovery Agents directory. For example C:\Program Files\Atlassian\Discovery Agent Installer directory.
- If the source files are stored outside of the Discovery tool directory, then files will be copied to the Discovery Installation directory on Agent host, if exists.
- If modifications are made to the current files selected in 'Patterns transfer', the updated file will sync to all your Agents.
- If the Discovery tool service is restarted, the synchronization will be triggered automatically.
- If the agents are included in any of the Scan Settings IP Ranges, make sure to exclude them from the range, by indicating the Agents' IPs with the modifier '!'.