Windows resident agent scan

Setting up the resident agent

Automatic deployment and uninstallation of the resident agent

Attention!

Before you start working with the resident agent, you need to configure a Data transfer method to send scanning results to a remote resource.

The following components may need to be installed on remote devices for certain resident agent functions to work properly:

  • Microsoft Visual C++ 2010 SP1 (x86) – when notified that msvcr100.dll is missing;

  • Microsoft Visual C++ 2015 (x86) – when notified of libssh2 error (required for SFTP upload).

Go to the Scanner  tab and click the Resident agent button on the Sidebar.

To deploy the resident agent, first add a scan task, configure the profile settings, and select logins, then click Deploy resident agent on the Sidebar.

Elements description:

  • Deploy resident agent. The main TNI unit uploads tniwinagent.exe and tniwinagent.ini to the remote computer’s folder C:\Windows\TNIRESIDENTAGENT, then connects to the Service Control Manager to install and start the agent as a service.
  • Remove resident agent. The main TNI unit connects to the Service Control Manager to stop and uninstall the resident agent service. The TNIRESIDENTAGENT folder is then deleted.

  • Set up logins. Allows you to configure logins for connecting to a remote computer to transfer the agent file.

  • Clear all. Deletes all created deployment tasks.

Buttons Deploy and Remove resident agent will be displayed only if tasks have been added to the task list.

When the resident agent is removed, all contents of the TNIRESIDENTAGENT folder will be permanently deleted, including inventory files and logs.

Resident agent profiles

All settings of resident agents can be saved in profiles. There is no limit to the number of profiles you can create. A profile can be assigned to an individual agent or to a group of agents by holding CTRL and selecting the desired devices in the network tree.

A default profile is always present, allowing you to change its settings, but it cannot be renamed or deleted. Any changes made to the default profile will be applied to all resident agents using this profile unless a different profile is selected.

Click Add a new profile on the Scanner details information panel and select Windows resident profile to create a new profile, or click the Add button in the drop-down menu of the Windows profile column.

When you create or edit a profile, you’ll see the Profile Settings, where you can specify a name for the profile and enable the Auto-export resident agent profiles option. This option determines where profiles will be automatically exported if they are modified or if an updated agent file is released. If enabled, you will need to specify or create a valid data transfer method.

It is highly recommended to specify the same network resource used for the automatic update of the resident agent, so that the agent can receive its updates.

Using a simple selection of a node or a group of assets in the network tree and the context menu, you can assign a single profile that will apply to all selected items.

If necessary, the Clear button removes the assigned profile from the selected asset(s), but the profile itself remains in the list of profiles.

Assigning a Windows resident profile to nodes in the network tree is only possible if all selected devices run Windows.

When you assign or modify a profile, an informational panel will appear in the status area. Clicking it will create a task in the Scanner tab to update the resident agent’s profile on the selected devices.

A full profile change requires the agent to be redeployed to the device, either automatically or manually.

If necessary, you can use the Resident agent state assistant in the network tree.

Agent settings

The following options are available in a profile and allow you to fully configure the Windows resident agent according to your requirements.

  • Run test scan immediately after service start – a test scan is performed immediately after the agent file is deployed and its service is installed. Once the scan is complete, the results are sent according to the specified data transfer method. This command runs independently of scheduled tasks and is similar to manually starting the agent with the “/testrun /install” commands.
  • Run a scan every time Windows starts – starts scanning after the OS boots. By default, the scan process begins 5 minutes after the OS has loaded. This delay ensures that all system processes and services are fully initialized before information is collected.
    Additional settings:
    startup-scan-delay={X}“: the parameter can be changed in the tniwinagent.ini file after exporting it, where {X}: 0 — complete delay deactivation, and 60 — is the maximum value in minutes (scanning will be performed within one hour after the OS start).
    resident-agent-startup-scan-delay={X}“: the parameter is located in the config.ini file in C:\ProgramData\Total Network Inventory. When generating tniwinagent.ini, the specified value {X} will be automatically substituted into the “startup-scan-delay” parameter.
  • Overwrite the asset file upon rescan – disables adding a timestamp to the device data file. If a data file with the same name already exists on the network-shared resource or server where the agent outputs the file, it will be overwritten.
  • Auto-update the agent or settings from a network resource – allows you to specify the path to a folder on a web or file server from which the resident agent can automatically update itself or retrieve new settings. See Updating the resident agent. The following protocols are supported:  SMB, HTTP, HTTPS, FTP, FTPS, SFTP, and SCP.
  • Send scan results / Data transfer method – allows you to select the data transfer method for sending scan results. The data will be sent to the specified resource. If no transfer protocol is selected, the files will be saved to the current folder where the agent is installed (for the automatically deployed agent, it’s C:\Windows\TNIRESIDENTAGENT\).
  • Keep sent data in the ‘Sent’ folder – allows disabling automatic deletion of inventory files after they are sent. Files can be found in the Sent subfolder inside the current folder where the agent is installed (for automatically deployed agents, this is C:\Windows\TNIRESIDENTAGENT\Sent\).
  • Attempt to avoid simultaneous requests to the server – allows you to prevent simultaneous requests to the server from multiple agents with the same settings. The start time of update and upload tasks will be adjusted when the agent starts.

After configuring scan result sending in the agent, be sure to create a data import task in TNI so that the data is properly imported and processed in the program’s storage.

Agent activity schedule

The agent can perform three types of tasks on a schedule. You can configure them similarly to tasks in the Scheduler. The following options are available in a profile:

  • Scan – specifies when the agent will collect information from an asset and attempt to send the scan results.
  • Agent update – specifies when the agent will check for updates to the executable and configuration files according to the schedule you set.
  • Resend data – If the agent could not send the scan results immediately after scanning, this task ensures the results are transferred according to the configured data transfer method.

the computer where the Resident agent service is deployed is not running at the scheduled time, the agent will perform the scan once the computer starts.

If the “Resend Data” and “Agent Update” tasks were not added during configuration, they will be automatically created the first time the agent is run, with the Resend Data task scheduled every 1 hour and the Agent Update task every 4 hours (provided that a transfer method and an update path have been specified).

Creating a scheduled scan is a crucial part of the setup process. If no schedule is created and “Run a scan every time Windows starts” is not enabled, the agent will not perform any scans or data transfers.

Sensors statistics

This functionality, available only in the Professional version of the program, allows you to enable continuous monitoring and collect data from hardware sensors. The data are statistical and processed in the main TNI module. For more details, visit the Sensors page.

By default, Light Mode is selected. Advanced Mode allows you to adjust sensor polling intervals and configure data processing settings.

Attention!

Changing sensor settings in Advanced Mode can considerably increase the load on the scanned device and the size of its data file, which in turn can significantly grow the overall storage size.

Advanced mode has the following settings:

  • Sensor polling period — sets the interval at which all available sensors are polled. A lower value increases accuracy, while a higher value improves the stability of the scanned system. Default: 1000 ms.
  • Data record interval —  to reduce stored and transferred data, collected information is packed into packages containing three values: minimum, average, and maximum. This option sets the interval over which average values are calculated and stored. A smaller interval increases data density, while a larger interval reduces the volume of collected and transferred data. Default: 3600 sec. Attention: Constant data collection with a very small interval may lead to significant growth of storage.
  • Grouping data to be sent —  specifies the number of data packages that can be saved into a file and imported into the program storage. A smaller value increases the frequency of sending new data to TNI, while a larger value reduces network load due to fewer opened connections and fewer files sent. Default: 3 packages.

The following sensor locations are available:  CPU, GPU, Motherboard, Storage device, NetworkBattery.

Selection of the type of sensor allows you to specify the readings collected from the devices. The following types are available: Temperature, Fan speed, Utilization, Clock speed, Voltage, Current, and Power.

Resident agent export

In addition to automatic export via the profile settings, you can also perform a manual export. The Export Resident Agents button is located on the Agent Profiles panel in the main area of the Scanner and allows you to export all available profiles, both Windows and Unix (SSH profiles).

It copies the agent files to the specified folder (for manual agent deployment). The exported files are tniwinagent.exe and tniwinagent.ini. A unique key in the tniwinagent_{GUID}.ini format is added to the name of the exported configuration files. For instance, tniwinagent_{DAD9B996-A618-4498-B958-BC507CA2BE7B}.ini.
SSH resident agent files will also be exported: tninixagent, tnimacagent, tninixagent_ssh_default.conf, and tninixagent.dtr (if a data transfer method or agent update is configured).

For correct export of all resident agent settings, please refer to Updating the resident agent and its settings.

Agent states

The resident agents’ states panel displays information about the status of agents on computers. It contains records of all hosted agents and indicates when updates are required. It also tracks the assignment of specific profiles to devices before they are installed on remote machines.

The Update resident agents button generates a list of agent deployment tasks for all nodes that require updates.

When this mode is activated, the program checks data against previously created device snapshots to determine whether agent files and their profiles need updating. If outdated agents are detected, this will be reflected in the states panel and a corresponding pop-up notification will appear above the main area of the Scanner tab.

Manual addition and removal of the resident agent

Manual deployment can be used when the computer to be inventoried is not connected to your network or when the resident agent cannot be deployed automatically for any reason.

To perform manual deployment, follow these steps:

  1. Set up the resident agent and its Schedule.
  2. Using the Export resident agent button on the Agent profiles panel, select an empty folder to which the tniwinagent.exe and tniwinagent_{*}.ini files will be copied.
  3. After exporting the files, select the tniwinagent_{*}.ini file corresponding to the profile you prepared for manual installation and rename it to tniwinagent.ini. You can find the profile name by opening the *.ini file in any text editor.
  4. Copy or move these files to an empty directory on the remote computer where the agent will be installed. Make sure the directory is not accidentally deleted from the remote computer.
  5. Install the resident agent service from the resident agent folder using this command:
    tniwinagent.exe /installThe following switches can also be used during installation:
    /start – starts the service immediately after installation;
    /testrun – runs a test scan when the service is started for the first time, and the resulting data will be transferred afterward via the selected protocol.
    If you haven’t used the /start switch with /install, you can start the service manually using the services.msc applet, or from the command prompt with net start TNIResidentAgent or sc start TNIResidentAgent command.
    Exampletniwinagent.exe /install /start /testrun – installs the agent service, starts it, and performs a test scan immediately.

To remove the service, use the following command:
tniwinagent.exe /uninstall

You will receive a notification when the service is successfully installed or uninstalled.

Updating the resident agent and its settings

The resident agent can be updated on remote computers using any of the following methods:

  1. Re-deploy the agent from the Scanner tab in TNI.

In this case, do not remove the resident agent first; otherwise, all contents of the agent’s folder, including any saved scan results, will be deleted.

 2. Configure auto-updates from a network resource. To do this, enable the option in the agent profile settings and specify the path to the directory where updated versions of the agent and settings file will be placed. If only the settings need to be updated, the settings file (tniwinagent.ini) can be copied to the specified directory without the agent file.
The resident agent automatically checks for updates according to the specified scheduled tasks. The following protocols are supported for updating: SMB, HTTP, HTTPS, SCP, FTP, FTPS, and SFTP.

Example path for updating via SMB:
\\computername\folder\

Example path for updating via HTTP:
http://websiteaddress/folder/

Example path for updating via HTTPS:
https://serveradress:44300/TNIAgentFolder/

Example path for updating via SCP:
scp://serveradress:22/TNIAgentFolder/

Example path for updating via FTP/FTPS:
ftp://serveradress:21/TNIAgentFolder/

Example path for updating via SFTP:
sftp://serveradress:22/TNIAgentFolder/

The agent cannot be updated without the corresponding *.ini settings file.

When specifying paths, ports can be omitted. In this case, the resident agent will use the default ports for the corresponding protocols when sending data.

Resident agent export for TNI versions 5.3.1 and earlier

Due to changes in the naming format of resident agent configuration files, agents from TNI versions 5.3.1 and earlier will not read the new files.

Solution: To update the agents, you can either:

  1. Reinstall the resident agents using the new version of TNI from the new Scanner mode; or

  2. Export the configuration file in the new format, copy it to the network shared resource specified for agent auto-update, and rename the exported file to tniwinagent.ini.

Example: After exporting, rename the file tniwinagent_{DAD9B996-A618-4498-B958-BC507CA2BE7B}.ini to tniwinagent.ini.

This renaming is only required once when upgrading from versions earlier than 5.3.1 to 5.4.0.

3. Manual updating. If needed, the resident agent can be updated manually. To do this, set up the agent as usual and export it to obtain an updated tniwinagent.ini file (and tniwinagent.exe, if required).

On the target computer, stop the resident agent service using the services.msc applet or the command line with net stop TNIResidentAgent or sc stop TNIResidentAgent.

Copy the updated .ini file (and .exe if needed) to the agent folder, overwriting the existing files, and then start the service again using net start TNIResidentAgent or sc start TNIResidentAgent.

Note: If you copy the new .ini file without stopping the service first, it will be overwritten by the agent’s settings stored in memory.

After starting, the service automatically creates six daily scheduled tasks to check for updates: one minute after the service starts, and five additional times every four hours.

Contents