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 better analyze, govern, and migrate the system architecture.
Collector Introduction
The MgC Agent provides the network and process collector. The content below explains how this collector works and what it does.
- Windows servers: The collector communicates with Windows servers using WinRM over HTTP (port 5985) or HTTPS (port 5986). 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.
- Linux servers: The collector connects to servers via SSH to collect network information with netstat or ss and collect process information by querying process files.
- Collected data is stored in XLSX and JSON files, including the process information and network connection information.
Precautions
Before creating a task to collect process and network information, read the following precautions carefully.
- Theoretically, installing the MgC Agent on a 4U8G server supports data collection from a maximum of 200 servers at the same time. However, you are advised to use an 8U16G server in the following scenarios:
- Collect data from 200 servers at the same time, and most of the servers have a large number of network accesses.
- Collect data from more than 50 servers at the same time, and the migration task or other types of collection tasks must be executed stably at the same time.
- You can enable continuous, periodic collection tasks on the collector by setting the following parameters:
- Collection interval: how often the collector collects data from a server.
- Collection duration: how long does a collection task last. Ideally, no longer than 7 days.
- You can create collection tasks in batches. A maximum of 100,000 network invoking data records can be collected from a single server. After that, the collector stops collecting data from this source and marks the source as successful. The collector will update the task status after all data sources are 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.
- 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.
- Run winrm quickconfig to enable the WinRM protocol on the target server.
- Enable one of the following ports on the server:
- Port 5985 (HTTP-based, applicable to non-encrypted scenarios)
- Port 5986 (HTTPS-based, applicable to encrypted scenarios)
- Private IPv4 addresses are recommended in certain scenarios. This prevents the data collection from affecting server association analysis.
- 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.
- The following table lists the supported Windows OSs.
Windows OS
Remarks
Windows 2012 R2 Standard
Supported
Windows 2012 R2 Datacenter
Supported
Windows 2016 Datacenter
Supported
Windows 2016 Standard
Supported
Windows 2019 Standard
Supported
Windows 2022 Standard
Supported
- Prepare one of the following accounts:
- Account of the root user (highest-privilege account)
- Account with the sudo permission (can perform administrator operations)
Password authentication is supported, instead of key authentication.
- The collector connects to the Linux server over SSH (default port 22) to perform data collection.
- Private IPv4 addresses are recommended. This prevents the data collection from affecting server association analysis.
- The internal network relationships of containers, as well as the actual forwarding relationships handled by Nginx or load balancers, cannot be collected.
- The following table lists the supported Linux OSs.
Linux OS
Remarks
CentOS 6.5 or later
Upgrade OpenSSH 5.3 to 7.0 or later.
CentOS 7.x
Supported
CentOS 8.x
Supported
CentOS Stream 8/9/10
Supported
Ubuntu Server 16.04
Supported
Ubuntu Server 18.04
Supported
Ubuntu Server 20.04
Supported
Ubuntu Server 22.04
Supported
openSUSE Leap 15.4
OpenSSH 8.4 supported
openSUSE Leap 15.5
Supported
openEuler 22.03 LTS
Supported
Requirements for the Servers to Be Collected
Here are the requirements for servers to be collected.
- Allow access from the server where the MgC Agent is installed over port 5985 or 5986.
- 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
- Allow access from the server where the MgC Agent is installed over port 22.
- Allow direct root access. This 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, 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
- Run Windows Server 2016, Windows Server 2019, Windows Server 2022, Windows 10, or Windows 11.
- 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. 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
- Sign in to the MgC console from the Windows server you prepared in the source environment.
- In the navigation pane, choose MgC Agent.
- In the Application Migration (Manual Installation) area, choose Download > Download Windows Version to download the MgC Agent installation program to the Windows server.
- 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.
- 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.
- On the login page, select Local Account.
- On the Register page, set a username and password, confirm the password, and click Privacy Statement.
- 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.
- After the registration is successful, enter the registered username and password, and click Log In to access 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.
- Sign in to the MgC Agent console.
- In the navigation pane, choose Resources.
- Click Add Resource above the list.
- Configure the parameters based on Table 1.
Table 1 Parameters for adding a resource Parameter
Description
Resource Name
User-defined.
Resource Type
Select Servers 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:Private IP addresses are recommended.
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.
- 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, or an account with the sudo permission
- Windows: administrator and its password
- In the navigation pane, choose Credentials.
- Click Add Credential above the list.
Figure 1 Adding a credential
- 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
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: 192.168.10.10/32
- An IP address range: 192.168.52.0/24
- All IP addresses: Enter 0.0.0.0/0.
Linux servers
- Username/Password
If you select Username/Password, 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: 192.168.10.10/32
- An IP address range: 192.168.52.0/24
- All IP addresses: Enter 0.0.0.0/0.
- 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.
- Automatically associating credentials
- Choose Associate Credential > Automatic above the resource list.
- Select an OS type and click Confirm.
- Wait until all servers are bound with credentials. Failed ones will remain in the original credential status (Not associated). Successful ones will be in the Associated status.
- Manually associating credentials
- Choose Associate Credential > Manual above the resource list.
- Select the server credential added in Step 4: Add Server Credentials from the drop-down list. Associated will show up in this column.
- (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 the network and process collector for Windows and Linux servers.
- In the navigation pane, choose Tasks.
- Click the Resource Collection Tasks tab and click Create Collection Task.

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

- In the Resources area, select resources that have credentials configured. A maximum of 50 resources can be included in a single task. If no credential has been bound to the resources, perform the following steps:
- Manual association
- In the resource list, select resources and choose Associate Credential > Manual above the list. The Associate Credential – Manual dialog box is displayed.
- Select the corresponding credential from the drop-down list. Click Verify Credential to verify the validity of the selected server credential.
- Automatic association
- Choose Associate Credential > Automatic above the list. The Associate Credential – Automatic dialog box is displayed.
- Select the desired system type.
- Click Confirm. The system will automatically attempt to associate credentials for all servers without existing associations. Any servers with failed associations will retain their original credential status (Not associated).
- Manual association
- In the Configuration Parameters area, set collector parameters based on Table 3. For more information, see Network and Process Collector (agent-collector-server-netstat-process).
Table 3 Parameters for configuring the network and process collector Parameter
Mandatory
Configuration
process_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 output file. For example, C:\MgC-Agent\test.
The default path is C:\MgC-Agent\data\collection-result\agent-collector-server-netstat-process.
- 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:
Export CSV files for the old Agent and XLSX files for the new Agent.
- Click the task name, select resources in the dialog box on the right, and export the CSV or XLSX file.
- Click More in the Operation column, then choose to save the results as a CSV, XLSX, or JSON file as required.

- Choose More > View Storage Path in the Operation column to view the path for saving the collected details.
- Choose More > View Storage Path in the Operation column to check the path for storing data sources.
- Click More in the Operation column, select Download JSON, Download XLSX, or Download CSV to save the collection result of each data source.
- 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.
- After a data source is successfully collected, obtain the collected details in any of the following ways:
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot
