Help Center/ Migration Center/ MgC Agent Usage Guide/ Best Practices/ Collecting Process and Network Information from Servers
Updated on 2025-08-25 GMT+08:00

Collecting Process and Network Information from Servers

This section describes how to use the collectors provided by the MgC Agent to collect process and network information from servers. With the collected details, you can monitor the system status, locate faults, and optimize performance.

Collector Introduction

The MgC Agent provides collectors for Linux and Windows. The content below explains how these collectors work and what they do.

  • The Windows process and network collector uses the WMI protocol to remotely connect to the servers to be collected. The following commands are used to collect data:
    • wmic: obtains the process information from the servers.
    • netstat: obtains the network connection information from the servers.
  • The collector collects data at a specified interval. On each server from which data is collected, a temporary shared folder is created to store the collected data before it is transmitted to the collector. Once the collection is complete, the shared folder and any temporary files within it are automatically deleted.
  • The collected process names and network relationships between these processes are saved as CSV files.
  • The Linux collector remotely connects to the servers to be collected through SSH and uses the netstat command to obtain process and network connection information.
  • The collector collects data at a specified interval. On each server from which data is collected, a temporary shared folder is created to store the collected data before it is transmitted to the collector. Once the collection is complete, the shared folder and any temporary files within it are automatically deleted.
  • The collected process names and network relationships between these processes are saved as CSV files.

Precautions

Before creating a task to collect process and network information, read the following precautions carefully.

  • Generally, installing the MgC Agent on a 4U8G server supports data collection from a maximum of 50 servers at the same time. If the servers to be collected handle heavy network traffic or extensive data processing, you are advised to use a server with 8U16G.
  • It is recommended that a single collection task run for no more than seven days.
  • The system automatically ends and marks a collection task as complete once it gathers 300,000 data records. To ensure smooth data collection, you are advised to ensure that the server where the MgC Agent is installed has at least 6 GB available memory for every 300,000 data records to be collected.
  • Do not perform collection and migration tasks using the same MgC Agent at the same time. Otherwise, the execution efficiency and stability of the tasks may be affected.
  • This collector can only gather data from Windows servers.
  • To collect details from servers successfully, you must provide the collector with the administrator accounts or the AD domain accounts (with its password) added to the Administrators group.
  • The servers to be collected must have both WMI and SMB enabled.
  • The following ports must be enabled on the servers to be collected:
    • WMI protocol: TCP 135 and a high-range random port (recommended: 1024 to 65535)
    • SMB protocol: TCP 445
    • DCOM communication: port 135 (which must remain open at all times) and a dynamic port range (typically 1024–65535, or a custom range such as 5000–5100).
  • The firewall of some operating systems may block WMI communications. By default, the WMI ports are not enabled on the firewall. This may lead to collection failures. You need to manually enable the related protocols and ports on the Windows firewall.
  • Only private IPv4 addresses can be collected.
  • The internal network relationships of containers, as well as the actual forwarding relationships handled by Nginx or load balancers, cannot be collected.
  • The collector cannot collect details about processes that do not interact with each other or are not started.
  • Updating server login credentials or shared folders before the collection is complete will result in data collection errors.
  • During data collection, a shared folder named MgC_Agent_Share_safe_to_delete_<data_source_ID> is created on drive C of every Windows server to be collected. This folder is used only for temporary storage and a transfer point for network results.network result transmission. Access is restricted to the Administrators group. After the collection is complete, the folder is automatically deleted. If the task is interrupted unexpectedly, you can manually delete the folder.
  • This collector can only gather data from Linux servers.
  • To collect details from servers successfully, you must provide the collector with the root account or an account with sudo permissions.
  • The collector connects to the servers to be collected through SSH and a specified port.
  • The internal network relationships of containers, as well as the actual forwarding relationships handled by Nginx or load balancers, cannot be collected.
  • The collector cannot collect details about processes that do not interact with each other or are not started.
  • Updating server login credentials or shared folder passwords before the collection is complete will result in data collection errors.
  • The collector can collect data from up to 50 servers for one day. If a large amount of data needs to be collected at the same time, the collection takes a long time, which may cause the collector to crush. In such cases, only the server hosting the collector is affected. The servers being collected remain unaffected.

Requirements for the Servers to Be Collected

The following are the requirements for servers to be collected.

If the server to be collected runs Windows, the server must:
  • Allow access from the server where the MgC Agent is installed over port 5985.
  • Use PowerShell 3.0 or later.
  • Have WinRM enabled and be able to access the server where the MgC Agent is installed. For more information, see How Do I Configure WinRM and Troubleshoot WinRM Connection Problems?
  • Allow the execution of shell scripts. To review the current execution policy, you can open PowerShell on the source servers as an administrator and run the following command:
    Get-ExecutionPolicy
    If Restricted is returned, no scripts can be executed. Run the following command and enter Y to change the policy to RemoteSigned:
    Set-ExecutionPolicy RemoteSigned
If the server to be collected runs Linux, the server must:
  • Allow access from the server where the MgC Agent is installed over port 22.
  • Allow direct root access. That means remote connections using root with SSH or other tools must be allowed on these Linux source servers.
  • Have SFTP and SSH enabled.
  • Support the following key exchange algorithms and MAC algorithms:
    • Key exchange algorithms: ssh-ed25519, ecdsa-sha2-nistp256, ecdsa-sha2-nistp384, ecdsa-sha2-nistp521, rsa-sha2-512, and rsa-sha2-256
    • MAC algorithms: hmac-sha2-256 and hmac-sha2-512

    If a server does not support the preceding security algorithms, you are advised to upgrade OpenSSH to 8.0 or later. Otherwise, deep collection cannot be performed for that server.

  • Have their iptables configured to allow all communications with the server where the MgC Agent is installed. To verify that, you can run the following command on the source servers. If the source field in the command output contains the IP address and port of the server where the MgC Agent is installed, it means that the MgC Agent is not allowed to access these source servers. In this case, you need to allow access from the MgC Agent.
    iptables -L INPUT -v -n

    Run the following command to allow the access.
    iptables -D INPUT -s <IP-address-of-the-MgC-Agent-server-indicated-by-the-source-field>

Preparations

You need to prepare a Windows server for installing the MgC Agent in the source intranet environment. The Windows server must:
  • Run Windows Server 2019, Windows Server 2016, Windows Server 2012, Windows 10, or Windows Server 8.1.
  • Use PowerShell 3.0 or later.
  • Have at least 4 CPUs and 8 GB of memory.
  • Have at least 20 GB of available space on the drive (drive C by default) for installing the MgC Agent.
  • Be able to access the Internet and the domain names of MgC, IoTDA, and other cloud services. For details about the domain names to be accessed, see Domain Names.
  • Allow the ports required by the MgC Agent (formerly Edge). For details about the required ports, see Communication Matrix.
  • Allow outbound traffic on port 8883 if the server is in a security group.
  • Not have any antivirus or protection software enabled. This type of software may stop the MgC Agent from executing migration commands, resulting in migration failures.

Do not install the MgC Agent on a source server to be migrated.

  • High resource consumption: The MgC Agent consumes CPU and memory resources during collection and migration. If a large number of migration tasks are performed by the MgC Agent, services on the source server may be affected.
  • Port occupation: The MgC Agent occupies some ports on the server, which may affect services running on it.

Step 1: Download and Install the MgC Agent

  1. Sign in to the MgC console from the Windows server you prepared.
  2. In the navigation pane, choose MgC Agent.
  3. In the Windows area, click Download Installation Package to download the MgC Agent installation package to the Windows server you prepared.
  4. Decompress the downloaded MgC Agent installation package and double-click the installation program to start the installation. If the installation program cannot be launched, try to run it in compatibility mode. For details, see How Do I Run the MgC Agent in Compatibility Mode? The default installation directory is C:\ and cannot be changed.
  5. Click Finish to complete the installation and open the MgC Agent console.

Step 2: Sign In to the MgC Agent Console

You need to register a username and password when logging in to the MgC Agent console for the first time. It is essential to keep them secure.

  1. On the login page, select Local Account.
  2. On the Register page, set a username and password, confirm the password, and click Privacy Statement.
  3. Read the privacy statement carefully before selecting I have read and agree to the Privacy Statement, and click Register.

    You are advised to change your password every three to six months.

  4. After the registration is successful, enter the registered username and password, and click Log In to open the Overview page of the MgC Agent console.

Step 3: Obtain the List of Servers to Be Collected

You can obtain the server list by automatic discovery or manual addition.

You can discover servers in any of the following ways:

  • VMware collection: You provide the IP addresses and credentials of vCenter Servers to discover all VMs they manage.
  • RVTools data import: You can import the report generated by RVTools to the MgC Agent. Then the MgC Agent can extract information about servers.
  • Network range scan: You can use the MgC Agent to scan for servers on a specific network range over the intranet.

You can manually input server details, such as public or private IP address and access ports, into the MgC Agent, regardless of the environment they run in or on.

  1. Sign in to the MgC Agent console.
  2. In the navigation pane, choose Resources.
  3. Click Add Resource above the list.
  4. Configure the parameters listed in Table 1.

    Table 1 Parameters for adding a resource

    Parameter

    Description

    Resource Name

    User-defined

    Resource Type

    Select Server from the drop-down list.

    OS

    Select the OS as required.

    Access Mode

    Access IP Address: Enter the private IP address of the server. The MgC Agent will use this IP address to remotely access the server and collect its details.

    NOTE:
    • To collect the process details and network associations from a Windows server, you must provide its private IP address.
    • To collect the process details and network associations from a Linux server, you can provide either its public or private IP address. However, you are advised to provide the private IP address.

    Access Port

    Enter the accessible port of the server.

    • The port defaults to 5985 on Windows and can be modified.
    • The port defaults to 22 on Linux and can be modified.

    Host (Optional)

    Select the corresponding host from the drop-down list.

    Credential (Optional)

    Select the corresponding credential from the drop-down list.

  5. Click OK. You can view the added server in the list.

Step 4: Add Server Credentials

Add the credentials of servers to be collected on the MgC Agent console. The credentials you provide must have sufficient permissions, so the MgC Agent can collect necessary server details. The requirements for servers credentials are as follows:

  • Linux: root and its password
  • Windows: administrator and its password
  1. In the navigation pane, choose Credentials.
  2. Click Add Credential above the list.

    Figure 1 Adding a credential

  3. Set Usage Type to Server, select the OS type, select an authentication mode, and enter the corresponding credential. For details, see Table 2. The credential name is user-defined.

    Table 2 Credentials

    OS Type

    Authentication Method

    Description

    Windows servers

    Username/Password

    Choose whether to set up an HTTPS connection. By default, WinRM connections to Windows servers are established over port 5985 using HTTP. Using WinRM HTTPS (port 5986) to establish connections is more secure.

    Enter the username and password for logging in to the server. Then specify Network Range, which can be a single IP address or an IP address range.

    Examples:

    • A single IP address, for example, 192.168.10.10/32
    • An IP address range, for example, 192.168.52.0/24
    • All IP addresses. You need to enter 0.0.0.0/0.

    Linux servers

    • Username/Password
    • Username/Key
    • If you select Username/Password, enter the username and password for logging in to the server.
    • If you select Username/Key, enter the username and the password of the key file for logging in to the server, and upload the key file in .pem format.
      NOTICE:

      If the key file is not encrypted, you do not need to enter the password.

    Then specify Network Range, which can be a single IP address or an IP address range. Examples:

    • A single IP address, for example, 192.168.10.10/32
    • An IP address range, for example, 192.168.52.0/24
    • All IP addresses. You need to enter 0.0.0.0/0.

  4. After the credential information is configured, click OK to save the credential.

Step 5: Associating Servers with Their Credentials

After discovering or adding servers, you need associate the servers with their credentials.

  1. In the resource list, click Associate in the Credential column.
  2. Select the server credential added in Step 4 from the drop-down list. Associated will show up in this column.
  3. (Optional) Click Change in the Access Port column. In the Change Port dialog box displayed, enter the accessible port of the server.

Step 6: Create a Collection Task

The MgC Agent provides process and network collectors for Linux and Windows. The task parameters vary with the OS type.

  1. In the navigation pane, choose Tasks.
  2. Click the Resource Collection Tasks tab and click Create Collection Task.

  3. In the Basic Information area, select the Windows process and network collector from the Collector drop-down list. The system sets a task name by default in the format of Windows-process-and-network-collector-<current-time>. You can change the task name.

  4. In the Resources area, select resources that have credentials configured. A maximum of 50 resources can be included in a single task.
  5. In the Configuration Parameters area, set collector parameters based on Table 3. For more information, see Windows Process and Network Collector (app-discovery-process-netstat-win).

    Table 3 Parameters for configuring the Windows process and network collector

    Parameter

    Mandatory

    Configuration

    app_only

    No

    Specify whether to collect only process information. The options are true and false. true indicates that only process information is collected. false indicates that process and network information is collected. The default value is false.

    duration

    No

    Specify the collection duration. If the duration exceeds the defined limit, the collection stops. The unit can be m (minute), h (hour), or d (day). The value is an integer greater than or equal to 1. The unit must be specified. If this parameter is not set, the default value 1m is used.

    interval

    No

    Specify the collection interval, in minutes. The value is an integer ranging from 1 to 30. If this parameter is not set, the default value 1m is used.

    output_path

    No

    Enter the path for storing the CSV output file. For example, C:\MgC-Agent\test.

    The default path is C:\MgC-Agent\data\collection-result\app-discovery-process-netstat-win.

  6. After the configuration is complete, click OK. You can view the data sources included in the task and their collection statuses.

    • After a data source is successfully collected, obtain the collected details in any of the following ways:
      • Click the task name. In the dialog box that is displayed on the right, select resources and click Export to export the collected resource details as required.

      • Choose More > Download CSV (.zip) in the Operation column to save the collected details of all data sources as a.csv file to the local PC.

      • Choose More > View Storage Path in the Operation column to view the path for saving the collected details.
      • Click the drop-down arrow and click View Command in the Operation column to view the data source information.

      • Click the drop-down arrow and click Download CSV in the Operation column to save the collected details of a single data source as a CSV file to the local PC.
    • If a data source fails to be collected, click the drop-down arrow and move the cursor to Failed in the Status column to view the error information.

  1. In the navigation pane, choose Tasks.
  2. Click the Resource Collection Tasks tab and click Create Collection Task.

  3. In the Basic Information area, select the Linux process and network collector from the Collector drop-down list. The system sets a task name by default in the format of Linux-process-and-network-collector-<current-time>. You can change the task name.

  4. In the Resources area, select resources that have credentials configured. A maximum of 50 resources can be included in a single task.
  5. In the Configuration Parameters area, set collector parameters based on Table 4.

    Table 4 Parameters for configuring the process and network collector

    Parameter

    Mandatory

    Configuration

    app_only

    No

    Specify whether to collect only process information. The options are true and false. true indicates that only process information is collected. false indicates that process and network information is collected. The default value is false.

    duration

    No

    Specify the collection duration. If the duration exceeds the defined limit, the collection stops. The unit can be m (minute), h (hour), or d (day). The value is an integer greater than or equal to 1. The unit must be specified. If this parameter is not set, the default value 1m is used.

    interval

    No

    Specify the collection interval, in minutes. The value is an integer ranging from 1 to 30. If this parameter is not set, the default value 1m is used.

    output_path

    No

    Enter the path for storing the CSV output file. For example, C:\MgC-Agent\test.

    The default path is C:\MgC-Agent\data\collection-result\app-discovery-process-netstat-linux.

  6. After the configuration is complete, click OK. You can view the data sources included in the task and their collection statuses.

    • After a data source is successfully collected, obtain the collected details in any of the following ways:
      • Click the task name. In the dialog box that is displayed on the right, select resources and click Export to export the collected resource details as required.

      • Choose More > Download CSV (.zip) in the Operation column to save the collected details of all data sources as a.csv file to the local PC.

      • Choose More > View Storage Path in the Operation column to view the path for saving the collected details.
      • Click the drop-down arrow and click View Command in the Operation column to view the data source information.

      • Click the drop-down arrow and click Download CSV in the Operation column to save the collected details of a single data source as a CSV file to the local PC.
    • If a data source fails to be collected, click the drop-down arrow and move the cursor to Failed in the Status column to view the error information.