How to deploy Assets Discovery Agents through Software deployment


プラットフォームについて: Cloud および Data Center - この記事はクラウドと Data Center 両方のプラットフォームに等しく適用されます。

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.

*Fisheye および Crucible は除く

  

要約

Assets Discovery Agents are independent processes that can help you discover data from systems that are not always online, or collect data from Windows systems without opening the inbound WMI Port and the Dynamic DCOM Ports needed by discovery tool. They are only available on Windows OS. An agent is typically used in isolated hosts, high security hosts, traveling hosts (e.g. Laptops) and where hosts are on a private network.

In large organizations, administrators aim to deploy Assets Discovery Agents across numerous hosts. There is no automated process that allows for the complete setup of all Discovery Agents across multiple remote hosts.

This means that while you can install Discovery Agents using a Software deployment such as SCCM, Intune, or others, it usually requires manual token configuration for each host where the agents are installed. Why is this necessary? Here is how the token communication works:

  • The Agent Token generated by Discovery app is used only as pairing token (token is used just to initiate the connection for the first time).
  • After the first communication, Agent is generating unique token and saving it locally in the settings. The same token is sent to the Discovery.
  • Discovery is saving this token in local storage and for the next communication with Agent instance this token will be used.
  • So all Agents (starting from v 7.0.3 of Discovery tool) will use unique tokens for the communication.

環境

Assets Discovery 7.0.3 onwards.

ソリューション

The following information is provided as-is. Atlassian Support cannot provide further assistance with the Groovy script described below.

A PowerShell script can be executed on Agents host to configure the Discovery token during the deployment of Assets Discovery Agents through Software deployment.   <NEW_TOKEN> should be replaced by the pairing token from the Discovery tool.


Set Discovery Token
$AgentToken = <NEW_TOKEN>
$path='C:\Program Files\Atlassian\Discovery Agent\Agent.cfg'

$xml = [xml](Get-Content -Path $path)

# Select the AgentToken node
$agentTokenElement = $xml.SelectSingleNode('Settings/AgentToken')

# Check if the AgentToken node exists
if ($null -eq $agentTokenElement) {
    # Create a new AgentToken element if it doesn't exist
    $agentTokenElement = $xml.CreateElement('AgentToken')
    $xml.Settings.AppendChild($agentTokenElement) | Out-Null
}

# Clear any existing text within the AgentToken element
$agentTokenElement.InnerText = ""

# Add the new AgentToken value
$agentTokenElement.AppendChild($xml.CreateTextNode($AgentToken)) | Out-Null

# Save the updated XML file
$xml.Save($path)


# Restart Discovery Agent Service to apply changes
Restart-Service -DisplayName "Discovery Agent Service*"

考慮事項:

  1. If Discovery Agents have never been configured before, no further action is required after running the PowerShell script.

  2. However, if Discovery Agents were previously configured with a token, you will need to take additional steps after running the PowerShell script.

    1. Select the agents from the Discovery tool where the script was executed, and then click on "Revoke token". This should remove previously received tokens.

  3. The same method used to configure other Agent settings, such as SFTP, can also be implemented using a PowerShell script.


Last modified on Mar 28, 2025

この内容はお役に立ちましたか?

はい
いいえ
この記事についてのフィードバックを送信する
Powered by Confluence and Scroll Viewport.