About the Asset Discovery Agent

What is the TDX Asset Discovery Windows Agent?

The TeamDynamix Asset Discovery Windows Agent (aka the Discovery Agent) is a software program that you install on a computer that uses Microsoft Windows. During installation, you connect it to a TeamDynamix Asset Discovery Scanner. Once it's set up, the Discovery Agent periodically scans the computer using WinRM and sends the gathered information back to the Discovery Scanner.

How the Agent Works

  1. The agent connects to TDAdmin to figure out how often it should run.
    1. The schedule for how often it should run is set on the Asset Discovery job in TDAdmin.
    2. The default value is once a week, but can be changed.
  2. On the interval specified in the Asset Discovery job, the agent uses WinRM to scan the machine it's installed on.
    1. Because the agent uses WinRM to collect data, the data it returns will be exactly the same as the data returned by a job using the "WMI" data provider.
  3. The agent then sends the information it collected back to TDAdmin.

Agent Configuration Files

When the TeamDynamix Asset Discovery Scanner service is installed on the scanner machine, it creates a directory of files. The default directory is C:\Program Files(x86)\TeamDynamix\Asset Discovery Scanner. Inside that directory is a folder called "config". This folder contains multiple .json files which control the configuration of the different data providers, including the agent.

Four configuration files that control how the agent service works are:

  • applocal.json - this provides service-level settings, like which TeamDynamix environment and scanner the agent should communicate with. You should never need to modify this file.
  • appsettings.json - settings related to the scanner service, like how often it checks for configuration updates
  • agentappsettings.json -  settings related to the agent service, like how often to check for configuration updates and how often to send data to TDAdmin
  • wmisettings.json - this controls exactly how WinRM discovery is conducted, including which credentials to use and which port to use

When the agent is installed on a target machine, it copies these files and installs them on the machine running the agent. The default directory is C:\Program Files(x86)\TeamDynamix\Asset Discovery Agent. The config files on the agent machine are identical copies of the ones on the Asset Discovery Scanner machine.

Configuration File Updates

The scanner's configuration updates in two ways:

  1. After using Sync Config
    1. You can make changes to the configuration of the scanner or any data provider in TDAdmin. 
    2. Then, click Sync Config in the Discovery Manager application on the scanner service to update the relevant configuration files on the scanner machine.
    3. The files in the /config folder will be replaced with the updated settings from TDAdmin
      1. If you have modified any config files in the /config/custom folder, they will be unchanged
  2. Automatically:
    1. The scanner will also check TDAdmin for configuration changes periodically, even if Sync Config isn't clicked.
    2. The default schedule for checking for configuration changes is every 30 minutes.
    3. The schedule can be updated by modifiying the "Server.ConfigPollingMinutes" attribute in the appsettings.json file (see below).

The agent's configuration updates in two ways:

  1. After every scan:
    • Each time the agent sends discovery results back to the scanner, it checks the timestamps of each file in the /config folder on the scanner machine, and compares those timestamps to the matching files in the /config folder on the agent machine.
    • If any of the files on the scanner machine is newer than the one on the agent machine, the agent will update its own copy with the newer version.
    • If changes have been made, the agent will immediately re-run the discovery process using the updated settings.
  2. Automatically:
    • The agent will also check for new configuration files periodically, even if a discovery job is not configured. 
    • The default schedule for checking for configuration changes is once a day.
    • The schedule can be updated by modifiying the "ConfigPollingMinutes" attribute in the appsettings.json file (see below).

Modifying Agent Configuration

Warning: Most settings should be modified using TDAdmin, rather than by manually modifying the files. If you choose to modify the files, you accept the risk that you may break your discovery settings.

To modify a configuration file for the the agent:

  1. Access the machine running the Asset Discovery Scanner
  2. Navigate to the installation directory for the Asset Discovery Scanner.
    1. The default is C:\Program Files (x86)\TeamDynamix\TeamDynamix Asset Discovery Scanner
  3. Open the /config folder
  4. Using a text editor (e.g., Notepad, Notepad++, or Wordpad), open the relevant file you want to update
  5. Make changes to the file
  6. Click Save
  7. Restart the service:
    1. Click Windows Key + R to open the Run interface
    2. Type services.msc, then click Enter
    3. From the list of services, find the TeamDynamix Asset Discovery Scanner service
    4. Right-click the service, then click Restart

The next time the agent checks in, it will get the updated version of the configuration file and replace its own copy with the one you modified on the scanner machine.