Server protocol configuration method and apparatus, computer device, and storage medium
By serializing and extracting data, we generate configuration requests and verify the results, solving the problem of SNMP Trap configuration information being overwritten in the server cluster, achieving efficient and reliable protocol configuration and continuous monitoring, and improving server stability.
Patent Information
- Application Number
- CN202411734273.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-29
- Publication Date
- 2025-10-10
- Estimated Expiration
- 2044-11-29
AI Technical Summary
In a large-scale server cluster, using multiple server management software to configure SNMP traps can easily cause configuration information to be overwritten, resulting in reduced server system performance. Furthermore, after the configuration is completed, it is impossible to effectively detect the success of the configuration, resulting in problems such as incorrect overwriting and low efficiency.
By obtaining the initial and expected protocol configuration information, serializing it into the target format, extracting the configuration data, determining the status of the protocol configuration space, generating a configuration request and verifying the configuration results, the accuracy and reliability of the configuration are ensured.
Improves the accuracy and reliability of server protocol configuration, prevents accidental overwriting of configuration information, improves configuration efficiency, and continuously monitors configuration status through scheduled tasks to ensure stable operation of the server.
Smart Images

Figure CN119629050B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of server protocol configuration, in particular to a server protocol configuration method and device, computer equipment and storage medium. BACKGROUND
[0002] With the wide application of information technology in various industries, as one of the important infrastructures, the use of servers in enterprises and organizations is expanding. In order to better monitor the health status of the server, it is usually necessary to configure SNMP Trap (SNMP protocol) in the server BMC to realize the rapid reporting of faults through SNMP Trap. Therefore, it has become a trend to use server management software to configure the server BMC in batches.
[0003] However, in the related art, when using server management software to configure the BMC of the server, the same template is used to configure fixed parameters for the same model of machine. For large-scale server clusters, more than one set of server management software may be used to manage a server cluster, and each server management software needs to be configured with SNMP Trap to detect the status of the server through SNMP Trap. Therefore, when performing batch SNMP Trap configuration, the configuration information may be overwritten by other server management software, resulting in reduced server system performance. SUMMARY
[0004] Therefore, it is necessary to provide a server protocol configuration method and device, computer equipment and storage medium capable of improving the reliability of the server.
[0005] In order to solve the above technical problems, in a first aspect, a server protocol configuration method is provided, the method comprising:
[0006] obtaining initial protocol configuration information and expected protocol configuration information, and serializing the initial protocol configuration information into initial protocol configuration information in a target format;
[0007] extracting data from the initial protocol configuration information in the target format and the expected protocol configuration information to obtain first configuration data and second configuration data;
[0008] obtaining target protocol configuration space state information, and determining a protocol configuration method corresponding to a target server based on the first configuration data, the second configuration data and the target protocol configuration space state information;
[0009] Obtaining a target configuration instruction type and target server information, generating a protocol configuration request based on the target server information, the protocol configuration method, and the target configuration instruction type, and executing protocol configuration on the target server according to the protocol configuration request;
[0010] In response to the target server completing the protocol configuration, the target server performing the protocol configuration result is verified.
[0011] In one embodiment, obtaining the desired protocol configuration information includes:
[0012] Obtain initial protocol configuration information and parse the initial protocol configuration information based on the protocol configuration template;
[0013] Obtain the target configuration instruction type corresponding to the target server, and obtain the configuration information parsing rules based on the target configuration instruction type;
[0014] The initial protocol configuration information is parsed based on the configuration information parsing rules to obtain the expected protocol configuration information.
[0015] In one embodiment, obtaining the target configuration instruction type and target server information includes:
[0016] Obtain target server information and protocol configuration template, which includes the correspondence between server information, configuration instructions, and protocol configuration information;
[0017] Based on the target server information, the target configuration instruction type corresponding to the target server is searched from the protocol configuration template.
[0018] In one embodiment, extracting data from the initial protocol configuration information and the expected protocol configuration information in the target format to obtain the first configuration data and the second configuration data includes:
[0019] Traversing the initial protocol configuration information of the target format, extracting first configuration data of the initial protocol configuration information of the target format, where the first configuration data includes a protocol configuration ID, an enabled state, a first alarm IP, and a first alarm port;
[0020] Obtain expected protocol configuration information, and extract second configuration data of the expected protocol configuration information, where the second configuration data includes a second alarm IP address and a second alarm port.
[0021] In one embodiment, a method for obtaining target protocol configuration space state information and determining a protocol configuration corresponding to a target server based on the first configuration data, the second configuration data, and the target protocol configuration space state information includes:
[0022] Determine whether the first alarm IP and the first alarm port match the second alarm IP and the second alarm port;
[0023] If there is a match, determine whether the enablement status of the target entry in the target protocol configuration space is enabled;
[0024] If yes, there is no need to configure the first alarm IP and the first alarm port, and the protocol configuration ID of the first configuration data is output;
[0025] If not, the protocol configuration information assembly operation is performed, and the enabling state of the target entry is changed to enabled, and the target entry is output.
[0026] If the first alarm IP, the first alarm port and the second alarm IP, the second alarm port do not match, then determining whether there is a target entry with a startup state of not enabled in the target protocol configuration space;
[0027] If it exists, assign the first alarm IP and the first alarm port to the target entry whose startup state is not enabled, change the enablement state of the target entry to enabled, and output the target entry;
[0028] If it does not exist, obtain the protocol configuration policy type. If the protocol configuration policy type is a target type, assign the first alarm IP and the first alarm port to the target entry and output them.
[0029] If the protocol configuration policy type is non-target type, it returns that the target entry corresponding to the target server is full.
[0030] In one embodiment, in response to the target server completing the protocol configuration, verifying the protocol configuration result of the target server includes:
[0031] In response to the target server completing the protocol configuration, determining whether the second configuration data exists in the target entry, and obtaining an activation status of the target entry;
[0032] If the second configuration data exists in the target entry and the enabling state of the target entry is enabled, obtaining a test alarm sending command;
[0033] Determine whether the protocol receiving end can receive the test alarm sending command sent by the target server;
[0034] If yes, the target server is considered to have successfully executed the protocol configuration result;
[0035] If not, it is considered that the target server has failed to execute the protocol configuration result.
[0036] In one embodiment, in response to the target server executing the protocol configuration result successfully, a detection time is configured, and a scheduled task is started according to the detection time, the scheduled task is used to detect the operating status of the target server at the detection time;
[0037] In response to receiving an alarm message from a target server during the execution of a scheduled task, increasing a counter value;
[0038] When the scheduled task is not completed and the counter value is greater than the preset threshold, the alarm level of the alarm information received from the target server during the execution of the scheduled task is obtained, and it is determined whether the alarm information of the target server with the target alarm level is received during the execution of the scheduled task;
[0039] If so, the target server is considered to be operating abnormally and the operator is notified;
[0040] If not, reconfigure the preset threshold.
[0041] In order to solve the above technical problems, in a second aspect, a server protocol configuration device is provided, the device comprising:
[0042] An acquisition module is used to acquire initial protocol configuration information and expected protocol configuration information, and serialize the initial protocol configuration information into initial protocol configuration information in a target format;
[0043] An extraction module, configured to extract data from the initial protocol configuration information and the expected protocol configuration information in the target format to obtain first configuration data and second configuration data;
[0044] a determination module, configured to obtain target protocol configuration space state information, and determine a protocol configuration method corresponding to the target server based on the first configuration data, the second configuration data, and the target protocol configuration space state information;
[0045] An execution module is used to obtain a target configuration instruction type and target server information, generate a protocol configuration request based on the target server information, the protocol configuration method and the target configuration instruction type, and execute the protocol configuration on the target server according to the protocol configuration request;
[0046] The verification module is used to verify the result of the protocol configuration executed by the target server in response to the target server completing the protocol configuration.
[0047] In order to solve the above technical problems, in the third aspect, a computer device is provided, including a memory, a processor and a computer program stored in the memory and runnable on the processor, and when the processor executes the computer program, the following steps are implemented: when the processor executes the computer program, the steps of the above-mentioned first aspect method are implemented.
[0048] In order to solve the above technical problems, in a fourth aspect, the present application provides a computer-readable storage medium on which a computer program is stored, and when the computer program is executed by a processor, the steps of the method of the above first aspect are implemented.
[0049] Different from the related art, the present application serializes the initial protocol configuration information into the initial protocol configuration information of the target format; extracts the data of the initial protocol configuration information of the target format and the expected protocol configuration information respectively to obtain the first configuration data and the second configuration data; determines the protocol configuration method corresponding to the target server based on the first configuration data, the second configuration data and the target protocol configuration space state information; obtains the target configuration instruction type and the target server information, generates a protocol configuration request based on the target server information, the protocol configuration method and the target configuration instruction type, and executes the protocol configuration on the target server according to the protocol configuration request; in response to the target server completing the protocol configuration, verifies the result of the protocol configuration execution on the target server. In this way, the initial protocol configuration information and the expected protocol configuration information are first compared to determine the protocol configuration method corresponding to the target server, and then a protocol configuration request is generated based on the target server information, the protocol configuration method and the target configuration instruction type, and the protocol configuration is executed on the target server according to the protocol configuration request. This can improve the accuracy of the protocol configuration and prevent the erroneous overwriting of the existing protocol configuration. The protocol configuration result of the target server after the protocol configuration is completed is verified, which can improve the reliability of the server protocol configuration. BRIEF DESCRIPTION OF THE DRAWINGS
[0050] Figure 1 A schematic flow chart of a server protocol configuration method in one embodiment;
[0051] Figure 2 A flowchart of a server protocol configuration method according to another embodiment;
[0052] Figure 3 A structural block diagram of a server protocol configuration system in one embodiment;
[0053] Figure 4 It is a structural block diagram of a server protocol configuration device in one embodiment;
[0054] Figure 5 FIG. 1 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0055] In order to make the purpose, technical solutions and advantages of this application more clear, the following further describes this application in detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain this application and are not intended to limit this application.
[0056] SNMP (Simple Network Management Protocol) is a widely used network management protocol. Its trap messages are used to report device status changes and fault events to the management system. Related technologies typically implement batch SNMP trap configuration by obtaining server IP addresses and related information, matching them to different brands, and then generating SNMP trap configuration instructions based on each brand. These instructions are then executed in a loop, and finally, the IP configuration is verified to ensure success.
[0057] As can be seen from the description of the related art, when performing batch SNMP trap configuration, the SNMP trap configuration for each service is not pre-checked. This is equivalent to configuring all machines of the same model with the same configuration file. This may result in old SNMP trap configurations existing on the original server, but the new configuration will overwrite the old configuration. Because large-scale data centers or computer rooms may have multiple health monitoring programs and multiple SNMP trap configurations, overwriting old information can cause accidents. Furthermore, after the configuration is completed, the configuration is considered complete after the successful check. This poses a problem. After the configuration is successful, a connectivity test should be performed to ensure that the configured trap alerts can be sent to the target machine. Furthermore, the configuration results may be modified or overwritten by other programs, resulting in the target machine not receiving the trap alerts. Furthermore, the related art uses a loop to set the SNMP trap configuration, which does not improve efficiency and is very time-consuming when configuring a large number of servers.
[0058] In order to solve the above technical problems, in one embodiment, Figure 1 As shown, the present application provides a server protocol configuration method, which specifically includes the following steps:
[0059] Step S10: Acquire initial protocol configuration information and expected protocol configuration information, and serialize the initial protocol configuration information into initial protocol configuration information in a target format.
[0060] Specifically, the protocol configuration of the present application can be SNMP Trap configuration of the server. The initial protocol configuration information can be obtained from the server, and the protocol configuration template can be called according to the initial protocol configuration information. The configuration instruction type corresponding to the initial protocol configuration information can be obtained from the protocol configuration template, and the initial protocol configuration information can be parsed according to the configuration instruction type to obtain the expected protocol configuration information. For example, if the Trap url type configuration instruction is used when obtaining the protocol configuration information, the initial protocol configuration information is parsed according to the parsing rules of the url return information; if the ipmitool type configuration instruction is used when obtaining the protocol configuration information, the initial protocol configuration information is parsed according to the parsing rules of the ipmitool command.
[0061] The protocol configuration template is pre-configured and includes the corresponding relationship between server information, configuration instructions and protocol configuration information.
[0062] Even for servers from the same manufacturer, the configuration information obtained may vary. For example, a typical server can have three or four configurable alarm policies, while some models can have more. Some servers may have the first policy configured, while others may have the third policy configured, or even all of them. Therefore, it is necessary to compare and assemble the configuration information. First, the obtained initial protocol configuration information is serialized into the corresponding format in the template, that is, the initial protocol configuration information is serialized into the initial protocol configuration information in the target format. The data of the initial protocol configuration information in the target format is looped through, and the first configuration data is read in the loop, and then compared with the second configuration data in the expected protocol configuration information.
[0063] Step S11 : extracting data from the initial protocol configuration information and the expected protocol configuration information in the target format to obtain first configuration data and second configuration data.
[0064] Specifically, traverse the initial protocol configuration information of the target format, extract the first configuration data of the initial protocol configuration information of the target format, the first configuration data includes the protocol configuration ID, the enabled status, the first alarm IP, and the first alarm port; obtain the expected protocol configuration information, extract the second configuration data of the expected protocol configuration information, the second configuration data includes the second alarm IP and the second alarm port.
[0065] Step S12: Acquire target protocol configuration space state information, and determine the protocol configuration method corresponding to the target server based on the first configuration data, the second configuration data, and the target protocol configuration space state information.
[0066] The target protocol configuration space status information refers to the protocol configuration space corresponding to the target server. The protocol configuration space of a general target server can be configured with a certain number of alarm policies. The method for determining the protocol configuration corresponding to the target server through the first configuration data, the second configuration data and the target protocol configuration space status information includes: judging whether the first alarm IP and the first alarm port match the second alarm IP and the second alarm port; if they match, judging whether the enablement status of the target entry in the target protocol configuration space is enabled; if so, there is no need to configure the first alarm IP and the first alarm port, and output the protocol configuration ID of the first configuration data; if not, executing the protocol configuration information assembly operation, and changing the enablement status of the target entry to enabled, and outputting the target entry.
[0067] Specifically, determine whether the first alarm IP and the first alarm port match the second alarm IP and the second alarm port, that is, determine whether the expected second alarm IP and the second alarm port exist in the initial protocol configuration information obtained. If so, determine whether the target entry's enabled state is enabled. The target entry represents the expected protocol configuration information that needs to be configured. If the target entry's enabled state is enabled, it means that the alarm IP and port (second alarm IP, second alarm port) to be configured already exist and do not need to be configured again. Output the corresponding protocol ID and jump to the next step. If the target entry's enabled state is not enabled, start assembling the configuration information, change the enabled state to enabled, and then output the entry. This entry is the expected protocol configuration information.
[0068] In one embodiment, determining whether the first alarm IP and the first alarm port match the second alarm IP and the second alarm port also includes: if the first alarm IP and the first alarm port do not match the second alarm IP and the second alarm port, determining whether there is a target entry with a startup status of not enabled in the target protocol configuration space; if so, assigning the first alarm IP and the first alarm port to the target entry with a startup status of not enabled, and changing the enablement status of the assigned target entry to enabled, and outputting the target entry; if not, obtaining the protocol configuration policy type, and if the protocol configuration policy type is a target type, assigning the first alarm IP and the first alarm port to the target entry and outputting it; if the protocol configuration policy type is a non-target type, returning that the target entry corresponding to the target server is full.
[0069] Specifically, if the first alarm IP, the first alarm port do not match the second alarm IP, the second alarm port, it means that the expected second alarm IP, the second alarm port do not exist in the initial protocol configuration information obtained. Further determine whether there is a target entry with a startup status of not enabled in the target protocol configuration space, that is, whether there is a target entry in the protocol configuration space of the target server that has no alarm policy configured. If there is an enabled entry, the second alarm IP and the second alarm port are assigned to the entry, and the enable status is changed to enabled, and then the entry is output. If the enable status of all entries is enabled, the protocol configuration policy is read to obtain the type of the protocol configuration policy. If the protocol configuration policy type is a target type, that is, the protocol configuration policy is a forced overwrite, the second alarm IP and the second alarm port are assigned to the entry and the entry is output together. If the protocol configuration policy type is a non-target type, the protocol configuration policy is not a forced overwrite, the target server information is recorded, and the target server protocol configuration entry is returned. The message "The target server protocol configuration entry is full, please handle it manually" is returned.
[0070] Step S13: Obtain the target configuration instruction type and target server information, generate a protocol configuration request based on the target server information, the protocol configuration method and the target configuration instruction type, and perform protocol configuration on the target server according to the protocol configuration request.
[0071] The protocol configuration template of this application provides the correspondence between server manufacturers, server models (server information) and configuration information, and also includes configuration instructions and parameter analysis content to facilitate quick data search.
[0072] In this application, before assembling the configuration request, it is also necessary to obtain the configuration instruction type corresponding to the target server, that is, the configuration type of the server of this model, and assemble the configuration request according to the type of configuration instruction.
[0073] For example, if the configuration type corresponding to the model is ipmitool, then the name used in Trap->SET->param corresponds to the data returned in the previous step, and then is converted into ASCII with a length equal to the data difference defined by location according to the parameter processing rules in location and rule. For example, int2ascii converts int type data into ASCII, and then splices the ASCII according to the data defined by location, and then splices it with the cmd command to form a complete Trap configuration ipmitool command.
[0074] If the configuration type corresponding to the model is redfish, then according to the name used in Trap->SET->param and the data returned in the previous step, corresponding to the previous step, the set data is verified to be legal according to the verification rules in rule. After the verification is successful, the data value is assigned to paramjson according to the correspondence between name and key. After the assignment is completed, the request parameters are assembled, and then a complete http request can be formed according to the data and request parameters in cmd and method. Verifying the legitimacy of the set data through verification rules is conducive to improving the reliability of the server protocol configuration.
[0075] After generating a protocol configuration request based on the target server information, the protocol configuration method, and the target configuration instruction type, the protocol configuration is performed on the target server according to the protocol configuration request.
[0076] Step S14: In response to the target server completing the protocol configuration, verifying the target server's protocol configuration result.
[0077] In response to the target server completing the protocol configuration execution, verifying the target server's protocol configuration execution result includes: in response to the target server completing the protocol configuration execution, determining whether the second configuration data exists in the target entry, and obtaining the enabled status of the target entry; if the second configuration data exists in the target entry and the enabled status of the target entry is enabled, obtaining a test alarm sending command; determining whether the protocol receiving end can receive the test alarm sending command sent by the target server; if so, the target server is deemed to have successfully executed the protocol configuration result; if not, the target server is deemed to have failed to execute the protocol configuration result.
[0078] Specifically, the first step of verification is performed to obtain the protocol configuration information of the target server, and then the combination of the alarm IP and alarm port is compared to see whether it exists in the target entry of the target server, and whether the target entry is enabled. If the above conditions are met, the second step of verification begins, and the test alarm sending command is obtained from the protocol template. The test alarm command is sent from the server management software to the target server, and then a period of time is waited to see whether the protocol receiving end can receive the test alarm sent by the target server. If it is received, it means that the target server protocol configuration is normal. Otherwise, it is an alarm exception. The reason may be a target server failure, a network link abnormality, or a protocol receiving end failure, and manual processing is required. If the first step of the test fails, the protocol configuration process is restarted. If the verification result of the first step of verification is repeatedly failed, it means that someone or software has repeatedly performed the protocol configuration, resulting in the existing protocol configuration being overwritten. It is necessary to send an alarm configuration exception to notify the management personnel to check. In this way, the problem of easy overwriting and detection after overwriting during the server protocol configuration process and subsequent maintenance can be solved.
[0079] In one embodiment, when the verification result of the protocol configuration result executed on the target server is successful, the scheduled task is started, and the server is inspected regularly to detect whether the protocol configuration function is normal. In actual applications, if the protocol alarm of a certain server is not received, there will be two situations. One is that the server does not generate an alarm; the other is that there is a problem with the protocol configuration, or the server fails and the alarm cannot be sent. Therefore, it is necessary to regularly detect the server protocol status. The inspection interval is specified in the scheduled task, and the verification module call is triggered when the specified time interval is reached; when a protocol alarm is received from a certain server within the time interval, the timer corresponding to the server is reset and the timing is restarted. In this way, the server protocol configuration can be performed quickly and efficiently, and the protocol configuration can be continuously monitored. It can improve the work efficiency of operation and maintenance personnel and save labor costs.
[0080] In one embodiment, the present application also includes format conversion of the alarm data to obtain alarm data in a target format, and generating a link address of the alarm data in the target format; the target format is a format that can be recognized by the WEB page; and sending the link address to the WEB server so that the WEB server obtains the alarm data in the target format according to the link address and displays it on the WEB page.
[0081] The target format of the alarm data can be a format that can be recognized by the WEB page, and the target format of the alarm data can be set according to the user's needs. Generally, the format of the abnormal data generated by the BMC client in the tested server when detecting a monitoring event is relatively messy and not uniform, so the user cannot easily analyze and process the abnormal data; therefore, it is necessary to convert the format of the original alarm data to obtain the alarm data in the unified format required by the user; after the SNMP server generates the alarm data in the target format, it is saved in the SNMP log file, and then a soft connection can be established with the WEB server. The soft connection refers to establishing a synchronous link address for the SNMP log file in the WEB server, so that the WEB server can directly obtain the alarm data in the target format according to the address, thereby improving the efficiency of user data viewing.
[0082] See also Figure 2In a specific embodiment, the SNMP Trap configuration tool in the BMC configuration page is first started in the present application to obtain BMC information, the BMC information includes input server BMC IP, username, password and protocol information, and server information scanned is obtained. Then, the Trap strategy is configured through the Trap configuration strategy module, the Trap strategy includes Trap version, alarm level, alarm IP, alarm port, whether to force to cover existing entries when configuring, etc. The Trap configuration function is started to obtain Trap configuration information of all servers; the Trap configuration information is assembled according to the Trap configuration strategy, the Trap configuration information obtained in the previous step, and data in the Trap template; the configuration information is written into the corresponding server through the task module; after the configuration is completed, the verification module is called to verify whether the Trap information is truly configured successfully; if the first step verification is successful, the second step verification is performed. If the first step verification fails, the third step is returned, the configuration is restarted, and the administrator is notified. If the second step verification is successful, it means that the Trap configuration is successful, which means that the configuration is successful, and the Trap alarm can be normally sent and received; if the second step verification fails, it means that the server or the Trap receiving module has a fault, and the administrator needs to be notified. When the Trap verification is successful, the timing task module is started. The server is regularly inspected to detect whether the Trap configuration function is normal, so that the SNMP Trap configuration can be quickly and efficiently performed, and the Trap configuration can be continuously monitored. The Trap configuration exception can be quickly found, and the reliability of server operation and maintenance is improved, and the server problem can be quickly found.
[0083] In one embodiment, the server protocol configuration method of the present application is applied to a server protocol configuration system, which is described by taking the protocol SNMP Trap as an example, and specifically as shown in Figure 3
[0084] The server protocol configuration system of the present application includes an asset scanning module, a storage module, a protocol obtaining module (Trap obtaining module), a protocol configuration strategy (Trap configuration strategy), a protocol assembling module (Trap assembling module), a task execution module, a configuration module, a timing task module, a verification module and a protocol receiving module (Trap receiving module).
[0085] The asset scanning module is used to scan and discover all machines that need to be configured with SNMP Trap, input server BMC IP, username, password and protocol information, and can automatically scan the server, and then obtain server manufacturer and model information.
[0086] The Trap configuration strategy module is used to set the Trap configuration strategy, such as Trap version, alarm level, alarm IP, alarm port, whether to force to cover existing entries when configuring, and the like. The alarm IP address is the IP address of the machine running the program by default, and the alarm IP can also be specified.
[0087] The storage module is used to save the scanned asset information for subsequent use.
[0088] The Trap template is included in the configuration template of the server management software. The Trap template includes Trap compatible information of different manufacturers and models, including the acquisition, setting and sending of test alarm Trap url information of restful and redfish protocols, request parameters and return information parsing rules, ipmitool acquisition, setting and sending of test alarm commands, and command parameter parsing rules. As shown in the following example, the template can also be defined in other forms. The function of the template is to provide the correspondence between the manufacturer, model and configuration information, and the configuration instruction and parameter parsing. The restful template is similar to redfish and is not listed one by one.
[0089] When Trap configuration information needs to be acquired, the server information scanned by the asset is needed, including server manufacturer, model, IP, version and the like, to find the corresponding query configuration information (Trap configuration information) url or ipmitool command (configuration instruction) information in the protocol configuration template. Then the server IP, username, password and Trap configuration information or ipmitool command information are combined into a task, which is handed over to the task execution module, and the task execution module can execute Trap configuration acquisition in batches. Then the task execution module returns the Trap configuration original information (initial protocol configuration information) acquired from the server. The configuration acquisition module calls the protocol configuration template again according to the Trap configuration original information (initial protocol configuration information) to parse the Trap configuration original information (initial protocol configuration information). If Trap url is used for acquisition, the url return information parsing rule is used for parsing; if ipmitool command is used for acquisition, the ipmitool command parsing rule is used for parsing. Finally, the parsed expected protocol configuration information is returned.
[0090] When assembling trap configuration information, the user's desired trap information (protocol information), including the trap version, alarm level, alarm IP address, and alarm port, is used to assemble the trap configuration information (protocol configuration information). The trap information obtained by the trap acquisition module and the corresponding template information in the trap are used to assemble the trap configuration information (protocol configuration information). Because the SNMP Trap configuration interface and required parameters vary across servers of different manufacturers and models, it is necessary to find a template that is compatible with the server model. The information in the template's config (configuration information) is then assembled into a data structure appropriate for that model. The initial protocol configuration information and the desired protocol configuration information are then compared and assembled. First, the obtained SNMP Trap configuration information is serialized into the format corresponding to the template (the target format of the initial protocol configuration information). The serialized data is then looped through, reading information such as the protocol ID, enabled status, alarm IP address, and alarm port address. The data is then compared against the desired alarm IP address and alarm port address to determine whether the first alarm IP address and first alarm port match the second alarm IP address and second alarm port.
[0091] If the combination of the alarm IP and alarm port (second alarm IP, second alarm port) to be set already exists in the obtained SNMP Trap information, then determine whether the enable status is enabled. If the enable status is enabled, it means that (second alarm IP, second alarm port) already exists and no further configuration is required. Output the corresponding protocol ID and jump to the next step. If the enable status is not enabled, start assembling the configuration information, change the enable status to enabled, and then output the entry. This entry is the SNMP Trap information that needs to be configured.
[0092] If the alarm IP and alarm port combination (secondary alarm IP, secondary alarm port) to be set does not exist in the obtained SNMP Trap information, then determine whether there is an entry with the enabled state set to disabled. If there is an entry with the enabled state set to enabled, assign the alarm IP and alarm port to the entry, change the enabled state to enabled, and then output the entry.
[0093] If all entries are enabled, the trap configuration policy (protocol configuration policy type) is read. If the protocol policy type is forced overwrite, the alarm IP and alarm port are assigned to the entry and the entry is output. If the protocol policy type is not forced overwrite, the machine information is recorded and a message is displayed indicating that the trap configuration entries for the machine are full, requesting manual processing.
[0094] Next, the request message is assembled based on the configuration command type. Verification is performed to verify that the SNMP Trap configuration has been successfully configured. This is a two-step verification process. The first step involves calling the Trap Acquisition Module to retrieve the target server's SNMP Trap configuration information. The module then compares the alarm IP and alarm port combination to ensure that the entry is enabled. If these conditions are met, the second step begins. A test alarm transmission command is obtained from the Trap template and sent from the server management software to the target server. The server then waits for a while to check whether the Trap receiver receives the test alarm. If so, the SNMP Trap configuration is functioning properly. Otherwise, the alarm is abnormal, possibly due to a target server failure, a network link failure, or a faulty Trap receiver, requiring manual intervention. If the first step fails, the Trap Assembly Module is called to restart the Trap configuration process. Repeated failures in the first step indicate that someone or software has overwritten the existing SNMP Trap configuration. A configuration anomaly alarm should be sent to notify management personnel for inspection.
[0095] This application also includes server inspections, and periodic calls to the verification module to detect whether the Trap configuration in the server is available. Because if you never receive a Trap alarm from a server, there are two situations: one is that the server does not generate an alarm; the other is that there is a problem with the Trap configuration, or the server fails and the alarm cannot be sent. Therefore, it is necessary to regularly check the server Trap status. Specify the inspection interval in the scheduled task, and when the specified time interval is reached, the verification module call is triggered; when a Trap alarm is received from a server within the time interval, the timer corresponding to the server is reset to zero and the timing starts again.
[0096] The Trap Receiver module receives trap alerts sent from the server and analyzes the alert content. If the alert is a test alert, it pushes the alert notification to the Verification Module, which uses the test alert to determine if the trap configuration is functioning properly. If the alert content is a normal server alert, it stores the alert information in the Storage Module and pushes it to the Timer Task Module, which resets the corresponding timer and restarts the timer.
[0097] In an embodiment, in response to the target server performing the protocol configuration result being successful, a detection time is configured, and a timing task is started to run according to the detection time, the timing task being used to detect the running state of the target server at the detection time; in response to receiving the alarm information of the target server during the running of the timing task, the counter value is increased; when the timing task is not executed completely and the counter value is greater than a preset threshold, the alarm level of the alarm information of the target server received during the running of the timing task is acquired, and it is judged whether the alarm information of the target alarm level of the target server is received during the running of the timing task; if yes, it is considered that the target server is running abnormally, and the operator is informed; and if no, the preset threshold is reconfigured.
[0098] Specifically, a detection time is set first, the detection time can be a detection interval duration, the counter is opened from the time when the target server performing the protocol configuration result is successful, and the counter value is increased by 1 each time the alarm information of the target server is received during the running of the timing task. The initial value of the counter of each timing task is 0. During the execution of a certain timing task, if the value of the counter is greater than the preset threshold, it is further judged whether the alarm information of the target level is included in the counted alarm information. The alarm information of the target level refers to the alarm information of a higher alarm level and more serious alarm information. If the alarm information of the target level is included in the counted alarm information, it is considered that the target server is running abnormally, and the operator is contacted for maintenance. If the alarm information of the target level is not included in the counted alarm information, it is considered that the preset threshold is set too low, and the value of the preset threshold can be increased. In this way, the running state of the target server is further verified by setting the timing task and the value of the alarm number, and the reliability of the target server can be improved.
[0099] It should be understood that, although Figure 1-Figure 2 the steps in the flowchart are shown in a sequential order following the arrows, the steps are not necessarily executed in the order shown by the arrows. Unless otherwise specified herein, the execution of the steps is not necessarily limited to the order shown in the flowchart. The steps can be executed in other orders. Figure 1-Figure 2 At least a part of the steps in may include multiple sub-steps or multiple stages, which are not necessarily executed at the same time, but can be executed at different times. The execution order of the sub-steps or stages is not necessarily sequential, but can be round-robin or alternately executed with other steps or sub-steps or stages of other steps.
[0100] In one embodiment, as shown in Figure 4 , a server protocol configuration device is provided, comprising an acquisition module 30, an extraction module 31, a determination module 32, an execution module 33, and a verification module 34.
[0101] An acquisition module 30 is configured to acquire initial protocol configuration information and desired protocol configuration information, and to serialize the initial protocol configuration information into initial protocol configuration information in a target format;
[0102] An extraction module 31 is configured to extract data from the initial protocol configuration information and the expected protocol configuration information in the target format to obtain first configuration data and second configuration data;
[0103] A determination module 32 is configured to obtain target protocol configuration space state information and determine a protocol configuration method corresponding to the target server based on the first configuration data, the second configuration data, and the target protocol configuration space state information;
[0104] An execution module 33 is configured to obtain a target configuration instruction type and target server information, generate a protocol configuration request based on the target server information, the protocol configuration method, and the target configuration instruction type, and execute the protocol configuration on the target server according to the protocol configuration request;
[0105] The verification module 34 is configured to verify the result of the protocol configuration executed by the target server in response to the target server completing the protocol configuration.
[0106] In one embodiment, the above device can implement another implementation of the server protocol configuration method, and the specific steps are as follows:
[0107] Obtaining the expected protocol configuration information includes:
[0108] Obtain initial protocol configuration information and parse the initial protocol configuration information based on the protocol configuration template;
[0109] Obtain the target configuration instruction type corresponding to the target server, and obtain the configuration information parsing rules based on the target configuration instruction type;
[0110] The initial protocol configuration information is parsed based on the configuration information parsing rules to obtain the expected protocol configuration information.
[0111] In one embodiment, the above device can implement another implementation of the server protocol configuration method, and the specific steps are as follows:
[0112] Obtaining target configuration instruction type and target server information includes:
[0113] Obtain target server information and protocol configuration template, which includes the correspondence between server information, configuration instructions, and protocol configuration information;
[0114] Based on the target server information, the target configuration instruction type corresponding to the target server is searched from the protocol configuration template.
[0115] In one embodiment, the above device can implement another embodiment of the server protocol configuration method, and the specific steps are as follows:
[0116] The data extraction is respectively performed on the initial protocol configuration information of the target format and the expected protocol configuration information to obtain first configuration data and second configuration data, and the first configuration data includes a protocol configuration ID, an enabled state, a first alarm IP, and a first alarm port.
[0117] The initial protocol configuration information of the target format is traversed to extract the first configuration data of the initial protocol configuration information of the target format, and the first configuration data includes a protocol configuration ID, an enabled state, a first alarm IP, and a first alarm port.
[0118] The expected protocol configuration information is obtained, and the second configuration data of the expected protocol configuration information is extracted, and the second configuration data includes a second alarm IP and a second alarm port.
[0119] In one embodiment, the above device can implement another embodiment of the server protocol configuration method, and the specific steps are as follows:
[0120] The target protocol configuration space state information is obtained, and the protocol configuration method corresponding to the target server is determined based on the first configuration data, the second configuration data, and the target protocol configuration space state information.
[0121] It is judged whether the first alarm IP and the first alarm port match the second alarm IP and the second alarm port.
[0122] If the match is true, it is judged whether the enabled state of the target entry of the target protocol configuration space is enabled.
[0123] If the enabled state is enabled, the first alarm IP and the first alarm port do not need to be configured, and the protocol configuration ID of the first configuration data is output.
[0124] If the enabled state is not enabled, a protocol configuration information assembly operation is performed, the enabled state of the target entry is changed to enabled, and the target entry is output.
[0125] If the first alarm IP and the first alarm port do not match the second alarm IP and the second alarm port, it is judged whether there is a target entry with an enabled state of not enabled in the target protocol configuration space.
[0126] If there is, the first alarm IP and the first alarm port are assigned to the target entry with the enabled state of not enabled, the enabled state of the target entry to which the assignment is performed is changed to enabled, and the target entry is output.
[0127] If there is not, the protocol configuration strategy type is obtained, and if the protocol configuration strategy type is a target type, the first alarm IP and the first alarm port are assigned to the target entry and output.
[0128] If the protocol configuration policy type is non-target type, the target entry corresponding to the target server is returned to be full.
[0129] In one embodiment, the above device can implement another implementation of the server protocol configuration method, and the specific steps are as follows:
[0130] In response to the target server completing the protocol configuration, verifying the target server's protocol configuration results includes:
[0131] In response to the target server completing the protocol configuration, determining whether the second configuration data exists in the target entry, and obtaining an activation status of the target entry;
[0132] If the second configuration data exists in the target entry and the enabling state of the target entry is enabled, obtaining a test alarm sending command;
[0133] Determine whether the protocol receiving end can receive the test alarm sending command sent by the target server;
[0134] If yes, the target server is considered to have successfully executed the protocol configuration result;
[0135] If not, it is considered that the target server has failed to execute the protocol configuration result.
[0136] In one embodiment, the above device can implement another implementation of the server protocol configuration method, and the specific steps are as follows:
[0137] In response to the target server executing the protocol configuration result successfully, configuring the detection time, and starting to run the scheduled task according to the detection time, the scheduled task is used to detect the operating status of the target server at the detection time;
[0138] In response to receiving an alarm message from a target server during the execution of a scheduled task, increasing a counter value;
[0139] When the scheduled task is not completed and the counter value is greater than the preset threshold, the alarm level of the alarm information received from the target server during the execution of the scheduled task is obtained, and it is determined whether the alarm information of the target server with the target alarm level is received during the execution of the scheduled task;
[0140] If so, the target server is considered to be operating abnormally and the operator is notified;
[0141] If not, reconfigure the preset threshold.
[0142] For the specific definition of the server protocol configuration device, please refer to the definition of the server protocol configuration method above, which will not be repeated here. The various modules in the above-mentioned server protocol configuration device can be implemented in whole or in part by software, hardware, or a combination thereof. The above-mentioned modules can be embedded in or independent of the processor in the computer device in hardware form, or can be stored in the memory of the computer device in software form, so that the processor can call and execute the operations corresponding to the above modules.
[0143] In one embodiment, the present application also provides a computer program product, which includes a computer program stored on a non-transitory computer-readable storage medium, and the computer program includes program instructions. When the program instructions are executed by a computer, the computer can execute the server protocol configuration method provided by the above methods.
[0144] In one embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as follows: Figure 4 As shown. The computer device includes a processor, a memory, a network interface, and a database connected via a system bus. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operation of the operating system and computer program in the non-volatile storage medium. The database of the computer device is used to store data used in the server protocol configuration method. The network interface of the computer device is used to communicate with an external terminal via a network connection. When the computer program is executed by the processor, a server protocol configuration method is implemented.
[0145] Those skilled in the art will understand that Figure 4 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than shown in the figure, or combine certain components, or have a different component arrangement.
[0146] In one embodiment, a computer device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the following steps are performed:
[0147] Obtaining initial protocol configuration information and expected protocol configuration information, and serializing the initial protocol configuration information into initial protocol configuration information in a target format;
[0148] Extracting data from the initial protocol configuration information and the expected protocol configuration information in the target format to obtain first configuration data and second configuration data;
[0149] Obtaining target protocol configuration space state information, and determining a protocol configuration method corresponding to the target server based on the first configuration data, the second configuration data, and the target protocol configuration space state information;
[0150] Obtaining a target configuration instruction type and target server information, generating a protocol configuration request based on the target server information, the protocol configuration method, and the target configuration instruction type, and executing protocol configuration on the target server according to the protocol configuration request;
[0151] In response to the target server completing the protocol configuration, the target server performing the protocol configuration result is verified.
[0152] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0153] Obtaining the expected protocol configuration information includes:
[0154] Obtain initial protocol configuration information and parse the initial protocol configuration information based on the protocol configuration template;
[0155] Obtain the target configuration instruction type corresponding to the target server, and obtain the configuration information parsing rules based on the target configuration instruction type;
[0156] The initial protocol configuration information is parsed based on the configuration information parsing rules to obtain the expected protocol configuration information.
[0157] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0158] Obtaining target configuration instruction type and target server information includes:
[0159] Obtain target server information and protocol configuration template, which includes the correspondence between server information, configuration instructions, and protocol configuration information;
[0160] Based on the target server information, the target configuration instruction type corresponding to the target server is searched from the protocol configuration template.
[0161] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0162] Extracting data from the initial protocol configuration information and the expected protocol configuration information in the target format to obtain first configuration data and second configuration data includes:
[0163] Traversing the initial protocol configuration information of the target format, extracting first configuration data of the initial protocol configuration information of the target format, where the first configuration data includes a protocol configuration ID, an enabled state, a first alarm IP, and a first alarm port;
[0164] Obtain expected protocol configuration information, and extract second configuration data of the expected protocol configuration information, where the second configuration data includes a second alarm IP address and a second alarm port.
[0165] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0166] The method of obtaining target protocol configuration space state information and determining the protocol configuration corresponding to the target server based on the first configuration data, the second configuration data, and the target protocol configuration space state information includes:
[0167] Determine whether the first alarm IP and the first alarm port match the second alarm IP and the second alarm port;
[0168] If there is a match, determine whether the enablement status of the target entry in the target protocol configuration space is enabled;
[0169] If yes, there is no need to configure the first alarm IP and the first alarm port, and the protocol configuration ID of the first configuration data is output;
[0170] If not, the protocol configuration information assembly operation is performed, and the enabling state of the target entry is changed to enabled, and the target entry is output.
[0171] If the first alarm IP, the first alarm port and the second alarm IP, the second alarm port do not match, then determining whether there is a target entry with a startup state of not enabled in the target protocol configuration space;
[0172] If it exists, assign the first alarm IP and the first alarm port to the target entry whose startup state is not enabled, change the enablement state of the target entry to enabled, and output the target entry;
[0173] If it does not exist, obtain the protocol configuration policy type. If the protocol configuration policy type is a target type, assign the first alarm IP and the first alarm port to the target entry and output them.
[0174] If the protocol configuration policy type is non-target type, the target entry corresponding to the target server is returned to be full.
[0175] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0176] In response to the target server completing the protocol configuration, verifying the target server's protocol configuration execution result includes:
[0177] In response to the target server completing the protocol configuration, determining whether the second configuration data exists in the target entry, and obtaining an activation status of the target entry;
[0178] If the second configuration data exists in the target entry and the enabling state of the target entry is enabled, obtaining a test alarm sending command;
[0179] Determine whether the protocol receiving end can receive the test alarm sending command sent by the target server;
[0180] If yes, the target server is considered to have successfully executed the protocol configuration result;
[0181] If not, it is considered that the target server has failed to execute the protocol configuration result.
[0182] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0183] In response to the target server executing the protocol configuration result successfully, configuring the detection time, and starting to run the scheduled task according to the detection time, the scheduled task is used to detect the operating status of the target server at the detection time;
[0184] In response to receiving an alarm message from a target server during the execution of a scheduled task, increasing a counter value;
[0185] When the scheduled task is not completed and the counter value is greater than the preset threshold, the alarm level of the alarm information received from the target server during the execution of the scheduled task is obtained, and it is determined whether the alarm information of the target server with the target alarm level is received during the execution of the scheduled task;
[0186] If so, the target server is considered to be operating abnormally and the operator is notified;
[0187] If not, reconfigure the preset threshold.
[0188] A computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the following steps are implemented:
[0189] Obtaining initial protocol configuration information and expected protocol configuration information, and serializing the initial protocol configuration information into initial protocol configuration information in a target format;
[0190] Extracting data from the initial protocol configuration information and the expected protocol configuration information in the target format to obtain first configuration data and second configuration data;
[0191] Obtaining target protocol configuration space state information, and determining a protocol configuration method corresponding to the target server based on the first configuration data, the second configuration data, and the target protocol configuration space state information;
[0192] Obtaining a target configuration instruction type and target server information, generating a protocol configuration request based on the target server information, the protocol configuration method, and the target configuration instruction type, and executing protocol configuration on the target server according to the protocol configuration request;
[0193] In response to the target server completing the protocol configuration, the target server performing the protocol configuration result is verified.
[0194] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented:
[0195] Obtaining the expected protocol configuration information includes:
[0196] Obtain initial protocol configuration information and parse the initial protocol configuration information based on the protocol configuration template;
[0197] Obtain the target configuration instruction type corresponding to the target server, and obtain the configuration information parsing rules based on the target configuration instruction type;
[0198] The initial protocol configuration information is parsed based on the configuration information parsing rules to obtain the expected protocol configuration information.
[0199] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented:
[0200] Obtaining target configuration instruction type and target server information includes:
[0201] Obtain target server information and protocol configuration template, which includes the correspondence between server information, configuration instructions, and protocol configuration information;
[0202] Based on the target server information, the target configuration instruction type corresponding to the target server is searched from the protocol configuration template.
[0203] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented:
[0204] Extracting data from the initial protocol configuration information and the expected protocol configuration information in the target format to obtain first configuration data and second configuration data includes:
[0205] Traversing the initial protocol configuration information of the target format, extracting first configuration data of the initial protocol configuration information of the target format, where the first configuration data includes a protocol configuration ID, an enabled state, a first alarm IP, and a first alarm port;
[0206] Obtain expected protocol configuration information, and extract second configuration data of the expected protocol configuration information, where the second configuration data includes a second alarm IP address and a second alarm port.
[0207] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented:
[0208] The method of obtaining target protocol configuration space state information and determining the protocol configuration corresponding to the target server based on the first configuration data, the second configuration data, and the target protocol configuration space state information includes:
[0209] Determine whether the first alarm IP and the first alarm port match the second alarm IP and the second alarm port;
[0210] If there is a match, determine whether the enablement status of the target entry in the target protocol configuration space is enabled;
[0211] If yes, there is no need to configure the first alarm IP and the first alarm port, and the protocol configuration ID of the first configuration data is output;
[0212] If not, the protocol configuration information assembly operation is performed, and the enabling state of the target entry is changed to enabled, and the target entry is output.
[0213] If the first alarm IP, the first alarm port and the second alarm IP, the second alarm port do not match, then determining whether there is a target entry with a startup state of not enabled in the target protocol configuration space;
[0214] If it exists, assign the first alarm IP and the first alarm port to the target entry whose startup state is not enabled, change the enablement state of the target entry to enabled, and output the target entry;
[0215] If it does not exist, obtain the protocol configuration policy type. If the protocol configuration policy type is a target type, assign the first alarm IP and the first alarm port to the target entry and output them.
[0216] If the protocol configuration policy type is non-target type, the target entry corresponding to the target server is returned to be full.
[0217] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented:
[0218] In response to the target server completing the protocol configuration, verifying the target server's protocol configuration results includes:
[0219] In response to the target server completing the protocol configuration, determining whether the second configuration data exists in the target entry, and obtaining an activation status of the target entry;
[0220] If the second configuration data exists in the target entry and the enabling state of the target entry is enabled, obtaining a test alarm sending command;
[0221] determining whether the target server sends a test alarm sending command to the protocol receiving end;
[0222] If yes, it is considered that the protocol configuration result of the target server is successful.
[0223] If no, it is considered that the protocol configuration result of the target server is unsuccessful.
[0224] In one embodiment, the computer program, when executed by the processor, further implements the following steps:
[0225] In response to the protocol configuration result of the target server being successful, a detection time is configured, and a timing task is started to run according to the detection time, the timing task being used to detect the running state of the target server at the detection time;
[0226] In response to receiving alarm information of the target server during the running of the timing task, the counter value is increased;
[0227] When the timing task is not executed completely and the counter value is greater than a preset threshold value, an alarm level of the alarm information of the target server received during the running of the timing task is acquired, and it is determined whether alarm information of the target alarm level of the target server is received during the running of the timing task;
[0228] If yes, it is considered that the target server is running abnormally, and an operator is notified;
[0229] If no, the preset threshold value is reconfigured.
[0230] Those skilled in the art will understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program. The computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application may include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in many forms such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous forwarding path (Synchlink) DRAM (SLDRAM), RAMbus direct RAM (RDRAM), direct RAMbus dynamic RAM (DRDRAM), and RAMbus dynamic RAM (RDRAM), etc.
[0231] The technical features of the above embodiments can be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0232] The above-described embodiments merely represent several implementation methods of the present application. While the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the present invention. It should be noted that a person skilled in the art could make various modifications and improvements without departing from the spirit of the present application, all of which fall within the scope of protection of the present application. Therefore, the scope of protection of the present patent application shall be determined by the appended claims.
Claims
1. A server protocol configuration method, characterized in that: include: Acquire initial protocol configuration information and expected protocol configuration information, and serialize the initial protocol configuration information into initial protocol configuration information in a target format; Extracting data from the initial protocol configuration information in the target format and the expected protocol configuration information respectively to obtain first configuration data and second configuration data, wherein the first configuration data includes a protocol configuration ID, an enabled state, a first alarm IP address, and a first alarm port; and the second configuration data includes a second alarm IP address and a second alarm port; Obtain target protocol configuration space state information, and determine a protocol configuration method corresponding to the target server based on the first configuration data, the second configuration data, and the target protocol configuration space state information; Obtaining a target configuration instruction type and target server information, generating a protocol configuration request based on the target server information, the protocol configuration method, and the target configuration instruction type, and performing protocol configuration on the target server according to the protocol configuration request; In response to the target server completing the protocol configuration, verifying the target server's protocol configuration result; The method of obtaining target protocol configuration space state information and determining the protocol configuration corresponding to the target server based on the first configuration data, the second configuration data, and the target protocol configuration space state information includes: If the first alarm IP address and the first alarm port match the second alarm IP address and the second alarm port, determining whether the activation state of the target entry in the target protocol configuration space is activated; If yes, there is no need to configure the first alarm IP and the first alarm port, and the protocol configuration ID of the first configuration data is output; If not, the protocol configuration information assembly operation is performed, and the enabling state of the target entry is changed to enabled, and the target entry is output; If the first alarm IP, the first alarm port and the second alarm IP, the second alarm port do not match, determining whether there is a target entry with a startup state of not enabled in the target protocol configuration space; If it exists, assign the first alarm IP and the first alarm port to the target entry whose startup state is not enabled, change the enablement state of the target entry to enabled, and output the target entry; If it does not exist, obtain the protocol configuration policy type. If the protocol configuration policy type is a target type, assign the first alarm IP and the first alarm port to the target entry and output them. If the protocol configuration policy type is a non-target type, it is returned that the target entry corresponding to the target server is full.
2. The method according to claim 1, characterized in that The obtaining of the expected protocol configuration information includes: Obtaining initial protocol configuration information, and parsing the initial protocol configuration information based on a protocol configuration template; Obtaining a target configuration instruction type corresponding to a target server, and obtaining a configuration information parsing rule based on the target configuration instruction type; The initial protocol configuration information is parsed based on the configuration information parsing rule to obtain the expected protocol configuration information.
3. The method according to claim 1, characterized in that The acquisition of target configuration instruction type and target server information includes: Obtain target server information and a protocol configuration template, wherein the protocol configuration template includes a correspondence between server information, configuration instructions, and protocol configuration information; The target configuration instruction type corresponding to the target server is searched from the protocol configuration template based on the target server information.
4. The method according to claim 1, wherein The extracting data from the initial protocol configuration information of the target format and the expected protocol configuration information to obtain first configuration data and second configuration data includes: Traversing the initial protocol configuration information of the target format, and extracting the first configuration data of the initial protocol configuration information of the target format; Obtain expected protocol configuration information, and extract second configuration data of the expected protocol configuration information.
5. The method according to claim 1, wherein If the first alarm IP address and the first alarm port match the second alarm IP address and the second alarm port, the method further includes: Determine whether the first alarm IP and the first alarm port match the second alarm IP and the second alarm port.
6. The method according to claim 1, characterized in that In response to the target server completing the protocol configuration, verifying the target server's protocol configuration execution result includes: In response to the target server completing the protocol configuration, determining whether the second configuration data exists in the target entry, and obtaining an activation status of the target entry; If the second configuration data exists in the target entry and the enabling state of the target entry is enabled, obtaining a test alarm sending command; Determine whether the protocol receiving end can receive the test alarm sending command sent by the target server; If yes, the target server is considered to have successfully executed the protocol configuration result; If not, it is considered that the target server has failed to execute the protocol configuration result.
7. The method according to claim 6, characterized in that The method further comprises: In response to the target server executing the protocol configuration result successfully, configuring a detection time, and starting to run a scheduled task according to the detection time, the scheduled task is used to detect the operating status of the target server at the detection time; In response to receiving an alarm message from a target server during the execution of a scheduled task, increasing a counter value; When the scheduled task is not completed and the counter value is greater than the preset threshold, the alarm level of the alarm information received from the target server during the execution of the scheduled task is obtained, and it is determined whether the alarm information of the target server with the target alarm level is received during the execution of the scheduled task; If so, the target server is considered to be operating abnormally and the operator is notified; If not, reconfigure the preset threshold.
8. A server protocol configuration device, characterized in that: The device comprises: An acquisition module, configured to acquire initial protocol configuration information and expected protocol configuration information, and serialize the initial protocol configuration information into initial protocol configuration information in a target format; an extraction module, configured to extract data from the initial protocol configuration information in the target format and the expected protocol configuration information, respectively, to obtain first configuration data and second configuration data, wherein the first configuration data includes a protocol configuration ID, an enabled state, a first alarm IP address, and a first alarm port, and the second configuration data includes a second alarm IP address and a second alarm port; A determination module is used to obtain target protocol configuration space status information, and determine the protocol configuration method corresponding to the target server based on the first configuration data, the second configuration data and the target protocol configuration space status information; wherein, obtaining the target protocol configuration space status information, and determining the protocol configuration method corresponding to the target server based on the first configuration data, the second configuration data and the target protocol configuration space status information include: if the first alarm IP, the first alarm port and the second alarm IP, the second alarm port match, then judging whether the enabling status of the target entry of the target protocol configuration space is enabled; if so, then there is no need to configure the first alarm IP and the first alarm port, and output the protocol configuration ID of the first configuration data; if not, then executing the protocol The protocol configuration information assembly operation is performed, and the enabling state of the target entry is changed to enabled, and the target entry is output; if the first alarm IP, the first alarm port does not match the second alarm IP, the second alarm port, it is determined whether there is a target entry with a startup state of not enabled in the target protocol configuration space; if it exists, the first alarm IP, the first alarm port is assigned to the target entry with a startup state of not enabled, and the enabling state of the assigned target entry is changed to enabled, and the target entry is output; if it does not exist, the protocol configuration policy type is obtained, and if the protocol configuration policy type is a target type, the first alarm IP, the first alarm port is assigned to the target entry and output; if the protocol configuration policy type is a non-target type, it is returned that the target entry corresponding to the target server is full; an execution module, configured to obtain a target configuration instruction type and target server information, generate a protocol configuration request based on the target server information, the protocol configuration method, and the target configuration instruction type, and execute protocol configuration on the target server according to the protocol configuration request; The verification module is used to verify the result of the protocol configuration executed by the target server in response to the target server completing the protocol configuration.
9. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.
Citation Information
Patent Citations
Server configuration method and device, equipment and storage medium
CN113127099A
Interface testing method and device, computer equipment and storage medium
CN118093396A