How to copy configuration files between Discovery Tool and Discovery Agents

Still need help?

The Atlassian Community is here for you.

Ask the community

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.

(info) 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.0.1

Agent settings in Discovery Tool v7.x

Agent settings of Discovery Tool versions below 7

Agent settings in Discovery Tool versions below 7.x


Step-by-step guide

  1. Navigate to your Assets Discovery directory and type discovery.exe -s in your terminal or command-line interpreter.

    1. 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.

  2. Select the Agent tab.

  3. 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.

  4. 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.

  5. Agent TCP Port - The TCP Port of the available Agents in the configured IP Range.

    1. Discovery tool uses the outgoing TCP port 51337

    2. Discovery-Agent TCP port 51337 as inbound.

  6. Agent Timeout(s) - The default timeout for each connection to a remote agent. The default period is 3 seconds

  7. Agent Token - Add a secure token in this field or generate a token to be used for all agents and save it.

  8. Patterns transfer - Select to configure files that will be synchronised with all available agents at the configured range. 

    1. 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.
      Files to be transferred are in a custom folder called transfer in the Discovery Tool folder
       

      The file transfer list in earlier versions of Discovery Tool

    2. 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.

    3. 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. 
      1. As an administrator on your Windows or Linux system, open a command-line interpreter window.

      2. Navigate to your Asset Discovery directory and type discovery -stad in your terminal or command-line interpreter.

      3. You can display all the available commands with "Discovery -?". For more information, Set up Assets Discovery 
    4. To synchronize the Agent configuration file (Agents.cfg) across all the Agent hosts in Discovery 7.x, a specific modification is required.

      1. The initial step involves setting up the agent token.

      2. 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 '!'. 




Last modified on Sep 27, 2024

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.