Implementation method and system for obtaining cloud server performance data based on Windows system
By configuring the cloud platform and Agent proxy server in a cloud computing environment, using WMIC and VBScript scripts to realize real-time collection and automated transmission of performance data of Windows cloud servers, the security, compatibility and automation of cloud management platform acquisition of performance data is solved. Improve the accuracy and efficiency of data acquisition, optimize resource allocation, and reduce operational costs.
Patent Information
- Application Number
- CN202411240086.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-05
- Publication Date
- 2024-12-10
- Estimated Expiration
- 2044-09-05
AI Technical Summary
In a cloud computing environment, directly obtaining the performance data of Windows cloud servers from the cloud management platform faces problems such as security, compatibility, real-time and automated collection, and it is difficult to achieve centralized management and resource optimization of large-scale servers in traditional ways.
By configuring the cloud platform server, setting the IP, username, and password information of the target Windows server, and using the Agent proxy server to issue encrypted job tasks, execute performance data acquisition scripts, obtain performance data, and remotely launch the VBScript interpreter through WMIC commands Execute scripts, capture output and error logs, and realize real-time data acquisition and automated transmission.
Improve the real-time and accuracy of data acquisition, realize remote monitoring and automation processes, reduce the work burden of managers, improve the efficiency of obtaining performance data, reduce human errors, and optimize resource allocation and reduce operational costs. .
Smart Images

Figure CN119109981A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of cloud server performance data acquisition, and in particular to an implementation method and system for acquiring cloud server performance data based on a Windows system. Background Art
[0002] In the traditional server management model, administrators usually need to log in directly to each server to collect and analyze performance data. This method is not only inefficient, but also difficult to achieve centralized management of large-scale servers. With the development of cloud computing technology, cloud management platforms have emerged, which provide the ability to remotely manage, monitor and automate cloud servers.
[0003] However, it is not easy to obtain performance data of Windows cloud servers directly from the cloud management platform. There are several challenges:
[0004] Security issues: Directly transmitting sensitive information (such as server login credentials, performance data, etc.) over the network poses a risk of being intercepted, so encryption measures are needed to ensure the security of data transmission.
[0005] Compatibility issues: The Windows system has its own unique architecture and API. Compared with Linux or other operating systems, there may be differences in performance data collection, which requires special tools or scripts to adapt.
[0006] Real-time issues: The performance data of cloud servers needs to be collected in real time or near real time so that performance bottlenecks or faults can be discovered and resolved in a timely manner.
[0007] Automation requirements: As the number of cloud servers increases, manual collection of performance data becomes unrealistic, and automated collection, analysis, and alarm mechanisms need to be implemented.
[0008] Resource usage: The performance data collection process should minimize the impact on the normal operation of the server and avoid occupying too many system resources. Summary of the invention
[0009] The purpose of the present invention is to provide a method and system for obtaining cloud server performance data based on a Windows system to solve the problems raised in the above background technology.
[0010] To achieve the above object, the present invention provides the following technical solution: a method for obtaining cloud server performance data based on Windows system, the method comprising the following steps:
[0011] Configure the cloud platform server, set the IP, user name, and password information of the target Windows server, and configure the performance data acquisition strategy, alarm threshold, alarm strategy, and email notification;
[0012] The cloud platform server sends encrypted job tasks to the Agent server. The job tasks include target machine information and performance data collection scripts.
[0013] The Agent server parses the job tasks, interacts with the target Windows server, executes the performance data collection script, and obtains performance data;
[0014] The Agent server returns the collected performance data to the cloud platform server for analysis and display.
[0015] Preferably, the method further comprises the following steps:
[0016] The Agent server creates a temporary directory on the target Windows server to store scripts and performance data, and performs directory sharing operations;
[0017] Transfer the performance data collection script to the shared directory of the target Windows server;
[0018] Use the WMIC command to remotely start a command line process to call the VBScript interpreter to execute the script and capture the script output and error log.
[0019] Preferably, the method further comprises the following steps:
[0020] After the VBScript script is executed, the performance data is written to the result file, which is named after the job ID.
[0021] The Agent server reads the result file and returns the performance data to the cloud platform server.
[0022] Preferably, the method further comprises the following steps:
[0023] After obtaining the performance data, the Agent server performs cleanup work, including revoking the file sharing permissions of the target Windows server, deleting the script files, result files and other temporary files in the shared directory, and deleting the temporary directory on the target machine.
[0024] Preferably, the method further comprises the following steps:
[0025] The cloud platform server and the Agent server communicate via the HTTP protocol, and the job task data is encrypted during transmission.
[0026] A system for obtaining cloud server performance data based on a Windows system, the system comprising:
[0027] The business center is used to configure target machine information, performance data acquisition strategies, and alarm strategies, and send jobs to Agents;
[0028] Agent server, which is used to listen to job requests, parse and execute job tasks, interact with the target server, execute scripts and obtain performance data;
[0029] Script engine, with built-in performance collection script, provides script execution environment;
[0030] The target server provides performance data sources and executes WMIC and VBScript scripts.
[0031] Preferably, after receiving the job request, the Agent server performs operations in the remote preparation phase, including:
[0032] Determine the target server;
[0033] Perform target machine login verification;
[0034] Create remote path directories and perform remote path sharing operations;
[0035] Transfer the VBScript script to the specified location on the target server through network sharing and I / O stream.
[0036] Preferably, the operations in the remote execution phase include:
[0037] Use WMIC to remotely start a command line process to call the VBScript interpreter to execute the performance script file;
[0038] Record the execution process and check the information output and error logs;
[0039] Redirect the output to result files and name and distinguish the result files by the job ID;
[0040] The Agent server reads the result file content and returns it to the cloud platform server for storage and display.
[0041] Preferably, the method for processing output and log includes:
[0042] Add a command in the VBScript script to redirect the output to the execution result output file in the target machine's shared path;
[0043] The Agent server determines the location of the result file through the job ID and reads the result file content in the form of I / O stream;
[0044] Ensure capture and subsequent analysis of script output.
[0045] Preferably, the operations of the remote completion phase include:
[0046] The Agent server performs cleanup work and revokes temporary resources and sharing permissions on the target machine;
[0047] Delete script files, result files and other temporary files in the shared directory;
[0048] Delete the shared path and the temporary directory on the target machine;
[0049] Ensure the proper management and use of target server resources and the cleanliness of the system environment.
[0050] Compared with the prior art, the present invention has the following beneficial effects:
[0051] The present invention proposes a method and system for obtaining cloud server performance data based on Windows system, which improves the real-time and accuracy of data acquisition: WMI provides a wide range of performance counters, including key performance indicators such as CPU, memory, disk, network, etc. Therefore, the performance data obtained through WMI has high accuracy and reliability. Through these counters, administrators can obtain all-round information on the operation status of cloud servers, providing sufficient data support for performance analysis and tuning.
[0052] Real-time remote monitoring capability: This method can obtain performance data from a remote Windows cloud server in real time. This remote monitoring capability allows managers to obtain the performance status of the server without physical access to the server, greatly improving the flexibility and efficiency of monitoring. It enables remote acquisition and automatic transmission of performance data, and the entire acquisition process can be completed without human intervention. It can significantly reduce the workload of managers, improve the efficiency of obtaining performance data, and reduce the occurrence of human errors.
[0053] Automated process capabilities: Administrators can configure scheduled policies to collect cloud server performance data, configure alarm thresholds, trigger alarms, receive alarm emails, handle alarms, and other automated process tasks, greatly improving the automated process of monitoring and management.
[0054] Easy to integrate and expand: By executing VBScript scripts through the WMIC command, administrators can select or develop solutions to obtain corresponding performance monitoring data as needed, and easily expand them to the entire multi-cloud server architecture system. In this way, the Agent server can not only complete the acquisition of result files, but also ensure that the resources and permissions of the target machine are properly managed and cleaned, thereby maintaining the security and cleanliness of the system.
[0055] Optimize resource allocation: By obtaining cloud server performance data in real time and accurately, users can more accurately understand the use of system resources and allocate and optimize resources according to actual needs. This not only helps improve the operating efficiency of the system, but also reduces unnecessary resource waste and saves operating costs for enterprises. BRIEF DESCRIPTION OF THE DRAWINGS
[0056] Figure 1 It is a schematic diagram of the system architecture of the present invention;
[0057] Figure 2 The figure is a flow chart of the method of the present invention. DETAILED DESCRIPTION
[0058] In order to make the purpose and technical solution of the present invention clearly and completely described, and the advantages more clearly understood, the embodiments of the present invention are further described in detail with reference to the accompanying drawings. It should be understood that the specific embodiments described herein are part of the embodiments of the present invention, rather than all of the embodiments, and are only used to explain the embodiments of the present invention, and are not used to limit the embodiments of the present invention. All other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0059] For example, see Figure 2 The present invention provides a technical solution: a method for obtaining cloud server performance data based on a Windows system, the method comprising the following steps:
[0060] 1. Architecture design:
[0061] 1) Business center, cloud platform server configures Windows target machine IP, user name, password and other information to facilitate remote connection operation. Also configures the strategy for obtaining Windows target machine performance data, alarm threshold, alarm strategy, email notification information, etc. Responsible for sending jobs to the agent layer, communicating via http protocol and encrypting the job data and sending it to the agent layer, to obtain the Windows target machine performance data collected by the Agent server.
[0062] 2) Agent, the Agent server listens to the job requests issued by the cloud platform management system, parses and executes the received job task parameters including the target machine IP, user name, password and other information. It is responsible for interacting with the target server, realizing script synchronization on the target machine, executing script tasks, obtaining results, and feeding back to the cloud platform management system.
[0063] 3) Script engine. After the performance collection script is written by the developer, it is built into the Agent server. The Agent provides the environment and dependency libraries required for script execution to ensure that the script can run correctly. The Agent also controls the script execution process, such as timeout processing and error capture. When the Agent collects the performance data of the target server (such as CPU, memory, disk, network, etc.), it is analyzed and displayed by the cloud platform management system.
[0064] 4) The target server provides the performance data source and needs to execute WMIC and VBScript scripts. It manages the computing, storage, and network resources allocated to it. It is necessary to ensure that these resources are reasonably allocated and used to support the applications and services running on them.
[0065] 2. WMIC remotely executes VBScript files
[0066] The Agent server receives the job request data sent by the cloud platform backend server, which includes job ID, remote target machine IP, user name, password and other information.
[0067] 1) Remote preparation stage
[0068] Determine the target server and determine the name and IP address of the target server for remotely executing VBScript through the job data.
[0069] Target machine login verification verifies whether the provided credentials are correct. By executing the wmic command, it is determined whether the target machine can be logged in normally. If it can be logged in, proceed to the next step. If the login fails, the job request ends and the cloud platform is prompted with login failure information.
[0070] Create a remote path directory, create a directory or path on the remote server for storing scripts and performance monitoring data, select a temporary location on the target machine, perform the directory creation operation, and name the temporary directory with the job ID. After successful creation; perform the remote path sharing operation and set the corresponding sharing permissions to facilitate file transfer between the Agent server and the target machine. After confirming that the path directory is shared successfully, file transfer can be performed.
[0071] Transfer VBScript scripts, which are used to collect performance monitoring data, to a specified location on a remote server. Transfer the VBScript script file (.vbs) to be executed to a shared path on the target server. This operation can be completed using FTP, SCP, network sharing, or other file transfer methods. This method transfers the script file through network sharing and writes the VBScript script file to a shared path directory through I / O streams.
[0072] 2) Remote execution phase
[0073] Since WMIC does not directly support VBScript execution, this method will use WMIC to remotely start a command line process cmd.exe to call the VBScript interpreter wscript.exe to execute the performance script file in the target machine's shared directory, thereby obtaining the target machine's performance data.
[0074] Record the execution process and check the information output and error logs. After the WMIC command is executed, some output will be returned, which includes the results of the command and any error messages. This ensures that the VBScript script has been successfully executed and no errors have been encountered.
[0075] Process output and logs. If the VBScript script generates any output or logs, you need to capture these outputs for subsequent analysis. Since WMIC itself does not directly capture the output of the script, you need to add commands in the VBScript script to redirect the output to the execution result output file in the target machine's shared path. The result file is named and distinguished by the job ID.
[0076] When the remote script execution is completed, the obtained performance data has been written to the result file. You need to read the content of the result file and determine the location and result file of the result file to be read by the job ID. After determining the directory, read the result file named by the job ID in the shared directory to the Agent server in the same way as the I / O stream. The Agent server returns it to the cloud platform server, stores it in the database, and returns it to the front-end page for display.
[0077] 3) Remote completion phase
[0078] When the Agent server obtains the result file of the target machine, the Agent agent needs to perform a series of cleanup tasks to ensure that the temporary resources and sharing permissions of the target machine are properly handled. The temporary directory and files of the target machine need to be cleaned up. The sharing permissions of the files or directories were set before, and now these permissions need to be revoked. The file deletion operation is performed remotely to delete the script files, result files and other temporary files in the shared directory. After the deletion is successful, the Agent agent needs to perform the shared path deletion operation and delete the temporary directory on the target machine.
[0079] Embodiment 2, based on Embodiment 1, proposes a system for obtaining cloud server performance data based on Windows system, the system comprising:
[0080] The business center is used to configure target machine information, performance data acquisition strategies, and alarm strategies, and send jobs to Agents;
[0081] The Agent server is used to listen to job requests, parse and execute job tasks, interact with the target server, execute scripts and obtain performance data. After receiving the job request, the Agent server performs operations in the remote preparation phase, including:
[0082] Determine the target server;
[0083] Perform target machine login verification;
[0084] Create remote path directories and perform remote path sharing operations;
[0085] Transfer the VBScript script to the specified location on the target server through network sharing and I / O stream.
[0086] The operations during the remote execution phase include:
[0087] Use WMIC to remotely start a command line process to call the VBScript interpreter to execute the performance script file;
[0088] Record the execution process and check the information output and error logs;
[0089] Redirect the output to result files and name and distinguish the result files by the job ID;
[0090] The Agent server reads the result file content and returns it to the cloud platform server for storage and display.
[0091] Script engine, with built-in performance collection script, provides script execution environment;
[0092] The target server provides performance data sources and executes WMIC and VBScript scripts.
[0093] Methods that handle output and logging include:
[0094] Add a command in the VBScript script to redirect the output to the execution result output file in the target machine's shared path;
[0095] The Agent server determines the location of the result file through the job ID and reads the result file content in the form of I / O stream;
[0096] Ensure capture and subsequent analysis of script output.
[0097] The operations during the remote completion phase include:
[0098] The Agent server performs cleanup work and revokes temporary resources and sharing permissions on the target machine;
[0099] Delete script files, result files and other temporary files in the shared directory;
[0100] Delete the shared path and the temporary directory on the target machine;
[0101] Ensure the proper management and use of target server resources and the cleanliness of the system environment.
[0102] Although embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the present invention, and that the scope of the present invention is defined by the appended claims and their equivalents.
Claims
1. A method for obtaining cloud server performance data based on Windows system, characterized in that: The method comprises the following steps: Configure the cloud platform server, set the IP, user name, and password information of the target Windows server, and configure the performance data acquisition strategy, alarm threshold, alarm strategy, and email notification; The cloud platform server sends encrypted job tasks to the Agent server. The job tasks include target machine information and performance data collection scripts. The Agent server parses the job tasks, interacts with the target Windows server, executes the performance data collection script, and obtains performance data; The Agent server returns the collected performance data to the cloud platform server for analysis and display.
2. According to claim 1, a method for obtaining cloud server performance data based on a Windows system is characterized in that: The following steps are also included: The Agent server creates a temporary directory on the target Windows server to store scripts and performance data, and performs directory sharing operations; Transfer the performance data collection script to the shared directory of the target Windows server; Use the WMIC command to remotely start a command line process to call the VBScript interpreter to execute the script and capture the script output and error log.
3. According to claim 2, a method for obtaining cloud server performance data based on a Windows system is characterized in that: The following steps are also included: After the VBScript script is executed, the performance data is written to the result file, which is named after the job ID. The Agent server reads the result file and returns the performance data to the cloud platform server.
4. According to claim 1, a method for obtaining cloud server performance data based on a Windows system is characterized in that: The following steps are also included: After obtaining the performance data, the Agent server performs cleanup work, including revoking the file sharing permissions of the target Windows server, deleting the script files, result files and other temporary files in the shared directory, and deleting the temporary directory on the target machine.
5. According to claim 1, a method for obtaining cloud server performance data based on Windows system is characterized in that: The following steps are also included: The cloud platform server and the Agent server communicate via the HTTP protocol, and the job task data is encrypted during transmission.
6. A system for implementing the method for implementing the method for implementing the method for implementing the method for implementing the method for implementing the cloud server performance data based on the Windows system, characterized in that: The system comprises: The business center is used to configure target machine information, performance data acquisition strategies, and alarm strategies, and send jobs to Agents; Agent server, which is used to listen to job requests, parse and execute job tasks, interact with the target server, execute scripts and obtain performance data; Script engine, with built-in performance collection script, provides script execution environment; The target server provides performance data sources and executes WMIC and VBScript scripts.
7. A system for obtaining cloud server performance data based on Windows system according to claim 6, characterized in that: After receiving the job request, the Agent server performs the remote preparation phase operations, including: Determine the target server; Perform target machine login verification; Create remote path directories and perform remote path sharing operations; Transfer the VBScript script to the specified location on the target server through network sharing and I / O stream.
8. A system for obtaining cloud server performance data based on Windows system according to claim 7, characterized in that: The operations during the remote execution phase include: Use WMIC to remotely start a command line process to call the VBScript interpreter to execute the performance script file; Record the execution process and check the information output and error logs; Redirect the output to result files and name and distinguish the result files by the job ID; The Agent server reads the result file content and returns it to the cloud platform server for storage and display.
9. A system for obtaining cloud server performance data based on Windows system according to claim 8, characterized in that: Methods that handle output and logging include: Add a command in the VBScript script to redirect the output to the execution result output file in the target machine's shared path; The Agent server determines the location of the result file through the job ID and reads the result file content in the form of I / O stream; Ensure capture and subsequent analysis of script output.
10. A system for obtaining cloud server performance data based on Windows system according to claim 6, characterized in that: The operations during the remote completion phase include: The Agent server performs cleanup work and revokes temporary resources and sharing permissions on the target machine; Delete script files, result files and other temporary files in the shared directory; Delete the shared path and the temporary directory on the target machine; Ensure the proper management and use of target server resources and the cleanliness of the system environment.
Citation Information
Patent Citations
CC (Communication Center) attack protective method and system thereof
CN101834866A
Proxy server monitoring management method and system
CN107181643A
Big data storage and processing platform and processing method for cloud computing environment
CN107943555A
Mobile terminal application testing method and device
CN112433938A
Network range log file acquisition proxy gateway, acquisition system and method
CN115914369A
